hqchart 1.1.14050 → 1.1.14064

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2641,6 +2641,7 @@ var JSCHART_EVENT_ID=
2641
2641
  ON_CHANGE_KLINE_RIGHT:160, //切换复权
2642
2642
 
2643
2643
  ON_FORMAT_KLINE_FLOAT_TOOLTIP:161, //格式化k线浮动框显示文字
2644
+ ON_FORMAT_KLINE_INFO_FLOAT_TOOLTIP:162, //格式化信息地雷显示文字
2644
2645
  }
2645
2646
 
2646
2647
  var JSCHART_OPERATOR_ID=
@@ -7029,7 +7030,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7029
7030
 
7030
7031
  this.DrawFloatTooltip=function(point,toolTip)
7031
7032
  {
7033
+ if (!this.FloatTooltip) return;
7032
7034
 
7035
+ this.UpdateFloatTooltip(point, toolTip)
7036
+ }
7037
+
7038
+ this.UpdateFloatTooltip=function(point, toolTip)
7039
+ {
7040
+ if (!this.FloatTooltip) return;
7041
+
7042
+ var sendData=
7043
+ {
7044
+ Tooltip:toolTip,
7045
+ Point:point,
7046
+ Symbol:this.Symbol,
7047
+ Name:this.Name,
7048
+ DataType:1,
7049
+ };
7050
+
7051
+ this.FloatTooltip.Update(sendData);
7033
7052
  }
7034
7053
 
7035
7054
  //更新实时行情到浮动tooltip
@@ -7100,6 +7119,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7100
7119
  }
7101
7120
  else if (toolTip.Type===1) //信息地雷提示信息
7102
7121
  {
7122
+ if (this.FloatTooltip)
7123
+ {
7124
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7125
+ bHideFloatToolip=false;
7126
+ return;
7127
+ }
7128
+
7103
7129
  var scrollPos=GetScrollPosition();
7104
7130
  var left = x;
7105
7131
  var top = y;
@@ -7127,6 +7153,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7127
7153
  }
7128
7154
  else if (toolTip.Type==2) //指标信息
7129
7155
  {
7156
+ if (this.FloatTooltip)
7157
+ {
7158
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7159
+ bHideFloatToolip=false;
7160
+ return;
7161
+ }
7162
+
7130
7163
  var left = x;
7131
7164
  var top = y;
7132
7165
 
@@ -7148,6 +7181,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7148
7181
  }
7149
7182
  else if (toolTip.Type==3) //分时图异动信息
7150
7183
  {
7184
+ if (this.FloatTooltip)
7185
+ {
7186
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7187
+ bHideFloatToolip=false;
7188
+ return;
7189
+ }
7190
+
7151
7191
  var left = x;
7152
7192
  var top = y;
7153
7193
 
@@ -7167,8 +7207,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7167
7207
  this.Tooltip.innerHTML=format.Text;;
7168
7208
  this.Tooltip.style.display = "block";
7169
7209
  }
7170
- else if (toolTip.Type==4) //icon图标信息
7210
+ else if (toolTip.Type==4) //ChartMultiSVGIconV2 图标信息
7171
7211
  {
7212
+ if (this.FloatTooltip)
7213
+ {
7214
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7215
+ bHideFloatToolip=false;
7216
+ return;
7217
+ }
7218
+
7172
7219
  var left = x;
7173
7220
  var top = y;
7174
7221
 
@@ -7190,6 +7237,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7190
7237
  }
7191
7238
  else if (toolTip.Type==5)
7192
7239
  {
7240
+ if (this.FloatTooltip)
7241
+ {
7242
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7243
+ bHideFloatToolip=false;
7244
+ return;
7245
+ }
7246
+
7193
7247
  var left = x;
7194
7248
  var top = y;
7195
7249
 
@@ -7212,6 +7266,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7212
7266
  }
7213
7267
  else if (toolTip.Type==6) //散点图
7214
7268
  {
7269
+ if (this.FloatTooltip)
7270
+ {
7271
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7272
+ bHideFloatToolip=false;
7273
+ return;
7274
+ }
7275
+
7215
7276
  var left = x;
7216
7277
  var top = y;
7217
7278
 
@@ -7234,6 +7295,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7234
7295
  }
7235
7296
  else if (toolTip.Type==7) //ChartDrawSVG
7236
7297
  {
7298
+ if (this.FloatTooltip)
7299
+ {
7300
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7301
+ bHideFloatToolip=false;
7302
+ return;
7303
+ }
7304
+
7237
7305
  var left = x;
7238
7306
  var top = y;
7239
7307
 
@@ -7254,6 +7322,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7254
7322
  this.Tooltip.innerHTML=format.Text;
7255
7323
  this.Tooltip.style.display = "block";
7256
7324
  }
7325
+ else if (toolTip.Type==8) //ChartDrawSVG 新版本
7326
+ {
7327
+ if (this.FloatTooltip)
7328
+ {
7329
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7330
+ bHideFloatToolip=false;
7331
+ return;
7332
+ }
7333
+ }
7257
7334
 
7258
7335
 
7259
7336
  if (bHideFloatToolip) this.HideFloatTooltip();
@@ -10497,7 +10574,7 @@ function CoordinateInfo()
10497
10574
  this.Font=g_JSChartResource.FrameSplitTextFont; //字体
10498
10575
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
10499
10576
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
10500
- this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
10577
+ this.LineType=1; //线段类型 -1=不画线段 0=虚线 1,2=虚线, 3=短线 8,9=集合竞价坐标
10501
10578
  this.LineWidth; //线段宽度
10502
10579
  this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
10503
10580
  this.ExtendData; //扩展属性
@@ -13507,7 +13584,7 @@ function AverageWidthFrame()
13507
13584
  {
13508
13585
  if (lineType==-1) return;
13509
13586
 
13510
- if (lineType==0)
13587
+ if (lineType==0) //直线
13511
13588
  {
13512
13589
  var pixelRatio=GetDevicePixelRatio();
13513
13590
  this.Canvas.strokeStyle=color;
@@ -13536,7 +13613,7 @@ function AverageWidthFrame()
13536
13613
  this.Canvas.lineWidth=pixelRatio;
13537
13614
  }
13538
13615
  }
13539
- else if (lineType==2) //绘制短线
13616
+ else if (lineType==3) //绘制短线
13540
13617
  {
13541
13618
  var lineWidth=10*GetDevicePixelRatio();
13542
13619
  this.Canvas.strokeStyle=color;
@@ -13553,7 +13630,7 @@ function AverageWidthFrame()
13553
13630
  }
13554
13631
  this.Canvas.stroke();
13555
13632
  }
13556
- else
13633
+ else if (lineType==1 || lineType==2) //虚线
13557
13634
  {
13558
13635
  this.DrawDotLine(left,right,y, color, option);
13559
13636
  }
@@ -39934,203 +40011,6 @@ function ChartMultiText()
39934
40011
  }
39935
40012
  }
39936
40013
 
39937
- // 图标集合 支持横屏
39938
- function ChartMultiSVGIcon()
39939
- {
39940
- this.newMethod=IChartPainting; //派生
39941
- this.newMethod();
39942
- delete this.newMethod;
39943
-
39944
- this.ClassName="ChartMultiSVGIcon";
39945
- this.Icon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
39946
- this.IconSize={ Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
39947
- Zoom:{ Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type , Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value } //放大倍数
39948
- };
39949
- this.Family;
39950
- this.Color=g_JSChartResource.DefaultTextColor;
39951
- this.IsHScreen=false;
39952
- this.IconRect=[]; //0=序号,1=区域
39953
-
39954
- this.Draw=function()
39955
- {
39956
- this.IconRect=[];
39957
- if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
39958
- if (this.IsShowIndexTitleOnly()) return;
39959
- if (this.IsHideScriptIndex()) return;
39960
- if (!this.Data || this.Data.length<=0) return;
39961
- if (!this.Family || !this.Icon) return;
39962
- if (!IFrameSplitOperator.IsNonEmptyArray(this.Icon)) return;
39963
-
39964
- this.IsHScreen=(this.ChartFrame.IsHScreen===true);
39965
- var xPointCount=this.ChartFrame.XPointCount;
39966
- var offset=this.Data.DataOffset;
39967
- this.DataWidth=this.ChartFrame.DataWidth;
39968
- this.DistanceWidth=this.ChartFrame.DistanceWidth;
39969
-
39970
- var border=this.GetBorder();
39971
- if (this.IsHScreen)
39972
- {
39973
- var left=border.TopEx;
39974
- var right=border.BottomEx;
39975
- }
39976
- else
39977
- {
39978
- var left=border.LeftEx;
39979
- var right=border.RightEx;
39980
- }
39981
-
39982
- var fontSize=this.GetDynamicIconSize(this.DataWidth,this.DistanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);
39983
- this.Canvas.font=fontSize+'px '+this.Family;
39984
-
39985
- for(var i=0; i<this.Icon.length; ++i)
39986
- {
39987
- var item=this.Icon[i];
39988
- if (!IFrameSplitOperator.IsNumber(item.Index)) continue;
39989
-
39990
- var index=item.Index-offset;
39991
- if (index>=0 && index<xPointCount)
39992
- {
39993
- var x=this.ChartFrame.GetXFromIndex(index);
39994
- var y=this.ChartFrame.GetYFromData(item.Value);
39995
-
39996
- if (item.Color) this.Canvas.fillStyle = item.Color;
39997
- else this.Canvas.fillStyle = this.Color;
39998
-
39999
- var textWidth=this.Canvas.measureText(item.Symbol).width;
40000
- this.Canvas.textAlign='center';
40001
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
40002
- if (x+textWidth/2>=right)
40003
- {
40004
- this.Canvas.textAlign='right';
40005
- x+=this.DataWidth/2;
40006
- rtIcon.X=x-fontSize;
40007
- }
40008
- else if (x-textWidth/2<left)
40009
- {
40010
- this.Canvas.textAlign = 'left';
40011
- x-=this.DataWidth/2;
40012
- rtIcon.X=x;
40013
- }
40014
-
40015
- if (item.Baseline==1)
40016
- {
40017
- this.Canvas.textBaseline='top';
40018
- rtIcon.Y=y;
40019
- }
40020
- else if (item.Baseline==2)
40021
- {
40022
- this.Canvas.textBaseline='bottom';
40023
- rtIcon.Y=y-fontSize;
40024
- }
40025
- else
40026
- {
40027
- this.Canvas.textBaseline = 'middle';
40028
- rtIcon.Y=y-fontSize/2;
40029
- }
40030
-
40031
- if (this.IsHScreen)
40032
- {
40033
- this.Canvas.save();
40034
- this.Canvas.translate(y, x);
40035
- this.Canvas.rotate(90 * Math.PI / 180);
40036
- this.Canvas.fillText(item.Symbol,0,0);
40037
- this.Canvas.restore();
40038
- }
40039
- else
40040
- {
40041
- if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
40042
- this.Canvas.fillText(item.Symbol, x, y);
40043
- if (item.Text) this.IconRect.push({ Index:i, Rect:rtIcon , Item:item });
40044
- }
40045
-
40046
- if (item.Line)
40047
- {
40048
- var kItem=this.Data.Data[item.Index];
40049
- var price=item.Line.KData=="H"? kItem.High:kItem.Low;
40050
- var yPrice=this.ChartFrame.GetYFromData(price);
40051
- var yText=y;
40052
- if (Array.isArray(item.Line.Offset) && item.Line.Offset.length==2)
40053
- {
40054
- if (yText>yPrice) //文字在下方
40055
- {
40056
- yText-=item.Line.Offset[1];
40057
- yPrice+=item.Line.Offset[0]
40058
- }
40059
- else if (yText<yPrice)
40060
- {
40061
- yText+=item.Line.Offset[1];
40062
- yPrice-=item.Line.Offset[0]
40063
- }
40064
- }
40065
- this.Canvas.save();
40066
- if (item.Line.Dash) this.Canvas.setLineDash(item.Line.Dash); //虚线
40067
- if (item.Line.Width>0) this.Canvas.lineWidth=item.Line.Width; //线宽
40068
- this.Canvas.strokeStyle = item.Line.Color;
40069
- this.Canvas.beginPath();
40070
- if (this.IsHScreen)
40071
- {
40072
- this.Canvas.moveTo(yText, ToFixedPoint(x));
40073
- this.Canvas.lineTo(yPrice,ToFixedPoint(x));
40074
- }
40075
- else
40076
- {
40077
- this.Canvas.moveTo(ToFixedPoint(x),yText);
40078
- this.Canvas.lineTo(ToFixedPoint(x),yPrice);
40079
- }
40080
-
40081
- this.Canvas.stroke();
40082
- this.Canvas.restore();
40083
- }
40084
- }
40085
- }
40086
- }
40087
-
40088
- this.GetTooltipData=function(x,y,tooltip)
40089
- {
40090
- if (!IFrameSplitOperator.IsNonEmptyArray(this.IconRect)) return false;
40091
- for(var i=0; i<this.IconRect.length; ++i)
40092
- {
40093
- var item=this.IconRect[i];
40094
- if (!item.Rect) continue;
40095
- var rect=item.Rect;
40096
- this.Canvas.beginPath();
40097
- this.Canvas.rect(rect.X,rect.Y,rect.Width,rect.Height);
40098
- if (this.Canvas.isPointInPath(x,y))
40099
- {
40100
- JSConsole.Chart.Log('[ChartMultiSVGIcon::GetTooltipData] icon ', item);
40101
- tooltip.Data=item;
40102
- tooltip.ChartPaint=this;
40103
- tooltip.Type=4; //指标
40104
- return true;
40105
- }
40106
- }
40107
-
40108
- return false;
40109
- }
40110
-
40111
- this.GetMaxMin=function()
40112
- {
40113
- var range={ Min:null, Max:null };
40114
- var xPointCount=this.ChartFrame.XPointCount;
40115
- var start=this.Data.DataOffset;
40116
- var end=start+xPointCount;
40117
-
40118
- for(var i in this.Icon)
40119
- {
40120
- var item=this.Icon[i];
40121
- if (item.Index>=start && item.Index<end)
40122
- {
40123
- if (range.Max==null) range.Max=item.Value;
40124
- else if (range.Max<item.Value) range.Max=item.Value;
40125
- if (range.Min==null) range.Min=item.Value;
40126
- else if (range.Min>item.Value) range.Min=item.Value;
40127
- }
40128
- }
40129
-
40130
- return range;
40131
- }
40132
- }
40133
-
40134
40014
 
40135
40015
  //图标集合(2.0) 支持横屏
40136
40016
  function ChartMultiSVGIconV2()
@@ -40342,6 +40222,7 @@ function ChartMultiSVGIconV2()
40342
40222
  if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
40343
40223
  this.Canvas.fillText(item.Symbol, x, y);
40344
40224
  if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
40225
+ else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
40345
40226
  }
40346
40227
 
40347
40228
  if (item.Line)
@@ -41091,6 +40972,7 @@ function ChartDrawSVG()
41091
40972
  tooltip.Data={ Rect:item.Rect, Item:data, Index:item.Index };
41092
40973
  tooltip.ChartPaint=this;
41093
40974
  tooltip.Type=7; //drawsvg
40975
+ if (data.Tooltip && data.Tooltip.Ver==2.0) tooltip.Type=8; //drawsvg 新本版
41094
40976
  return true;
41095
40977
  }
41096
40978
  }
@@ -79880,29 +79762,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79880
79762
  this.DialogSelectRect.Update(sendData);
79881
79763
  }
79882
79764
 
79883
- this.DrawFloatTooltip=function(point,toolTip)
79884
- {
79885
- if (!this.FloatTooltip) return;
79886
-
79887
- this.UpdateFloatTooltip(point, toolTip)
79888
- }
79889
-
79890
- this.UpdateFloatTooltip=function(point, toolTip)
79891
- {
79892
- if (!this.FloatTooltip) return;
79893
-
79894
- var sendData=
79895
- {
79896
- Tooltip:toolTip,
79897
- Point:point,
79898
- Symbol:this.Symbol,
79899
- Name:this.Name,
79900
- DataType:1,
79901
- };
79902
-
79903
- this.FloatTooltip.Update(sendData);
79904
- }
79905
-
79906
79765
  this.UpdateHQFloatTooltip=function(kData)
79907
79766
  {
79908
79767
  if (!this.FloatTooltip) return;
@@ -1873,7 +1873,7 @@ input[type="color"] {
1873
1873
 
1874
1874
  .UMyChart_Tooltip_Float_Table
1875
1875
  {
1876
- border-spacing: 2px;
1876
+ border-spacing: 3px;
1877
1877
  user-select: none;
1878
1878
  font-size:12px;
1879
1879
  }
@@ -1891,6 +1891,11 @@ input[type="color"] {
1891
1891
  .UMyChart_Tooltip_Float_Text_Td
1892
1892
  {
1893
1893
  min-width:80px;
1894
+ max-width: 500px;
1895
+
1896
+ white-space: nowrap;
1897
+ overflow: hidden;
1898
+ text-overflow: ellipsis;
1894
1899
  }
1895
1900
 
1896
1901
  .UMyChart_Tooltip_Float_Title_Span
@@ -1907,9 +1912,16 @@ input[type="color"] {
1907
1912
 
1908
1913
  .UMyChart_Tooltip_Float_Text2_Span
1909
1914
  {
1910
- color: rgb(230,230,230);
1915
+ margin-left: 1px;
1911
1916
  }
1912
1917
 
1918
+ .UMyChart_Tooltip_Float_Text3_Span
1919
+ {
1920
+ margin-left: 5px;
1921
+
1922
+ }
1923
+
1924
+
1913
1925
 
1914
1926
 
1915
1927
 
@@ -48,6 +48,10 @@ var TEST_TRADE_DETAL_DATA={
48
48
  {
49
49
  "type": 6,
50
50
  "typeexplain": "单只标的证券的当日融资买入数量达到当日该证券总交易量的50%以上"
51
+ },
52
+ {
53
+ "type": 3,
54
+ "typeexplain": "跌幅偏离值达7%的证券"
51
55
  }
52
56
  ],
53
57
  "fweek": {