hqchart 1.1.14056 → 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
@@ -7134,6 +7153,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7134
7153
  }
7135
7154
  else if (toolTip.Type==2) //指标信息
7136
7155
  {
7156
+ if (this.FloatTooltip)
7157
+ {
7158
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7159
+ bHideFloatToolip=false;
7160
+ return;
7161
+ }
7162
+
7137
7163
  var left = x;
7138
7164
  var top = y;
7139
7165
 
@@ -7155,6 +7181,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7155
7181
  }
7156
7182
  else if (toolTip.Type==3) //分时图异动信息
7157
7183
  {
7184
+ if (this.FloatTooltip)
7185
+ {
7186
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7187
+ bHideFloatToolip=false;
7188
+ return;
7189
+ }
7190
+
7158
7191
  var left = x;
7159
7192
  var top = y;
7160
7193
 
@@ -7174,8 +7207,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7174
7207
  this.Tooltip.innerHTML=format.Text;;
7175
7208
  this.Tooltip.style.display = "block";
7176
7209
  }
7177
- else if (toolTip.Type==4) //icon图标信息
7210
+ else if (toolTip.Type==4) //ChartMultiSVGIconV2 图标信息
7178
7211
  {
7212
+ if (this.FloatTooltip)
7213
+ {
7214
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7215
+ bHideFloatToolip=false;
7216
+ return;
7217
+ }
7218
+
7179
7219
  var left = x;
7180
7220
  var top = y;
7181
7221
 
@@ -7197,6 +7237,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7197
7237
  }
7198
7238
  else if (toolTip.Type==5)
7199
7239
  {
7240
+ if (this.FloatTooltip)
7241
+ {
7242
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7243
+ bHideFloatToolip=false;
7244
+ return;
7245
+ }
7246
+
7200
7247
  var left = x;
7201
7248
  var top = y;
7202
7249
 
@@ -7219,6 +7266,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7219
7266
  }
7220
7267
  else if (toolTip.Type==6) //散点图
7221
7268
  {
7269
+ if (this.FloatTooltip)
7270
+ {
7271
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7272
+ bHideFloatToolip=false;
7273
+ return;
7274
+ }
7275
+
7222
7276
  var left = x;
7223
7277
  var top = y;
7224
7278
 
@@ -7241,6 +7295,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7241
7295
  }
7242
7296
  else if (toolTip.Type==7) //ChartDrawSVG
7243
7297
  {
7298
+ if (this.FloatTooltip)
7299
+ {
7300
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
7301
+ bHideFloatToolip=false;
7302
+ return;
7303
+ }
7304
+
7244
7305
  var left = x;
7245
7306
  var top = y;
7246
7307
 
@@ -7261,6 +7322,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7261
7322
  this.Tooltip.innerHTML=format.Text;
7262
7323
  this.Tooltip.style.display = "block";
7263
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
+ }
7264
7334
 
7265
7335
 
7266
7336
  if (bHideFloatToolip) this.HideFloatTooltip();
@@ -10504,7 +10574,7 @@ function CoordinateInfo()
10504
10574
  this.Font=g_JSChartResource.FrameSplitTextFont; //字体
10505
10575
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
10506
10576
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
10507
- this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
10577
+ this.LineType=1; //线段类型 -1=不画线段 0=虚线 1,2=虚线, 3=短线 8,9=集合竞价坐标
10508
10578
  this.LineWidth; //线段宽度
10509
10579
  this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
10510
10580
  this.ExtendData; //扩展属性
@@ -13514,7 +13584,7 @@ function AverageWidthFrame()
13514
13584
  {
13515
13585
  if (lineType==-1) return;
13516
13586
 
13517
- if (lineType==0)
13587
+ if (lineType==0) //直线
13518
13588
  {
13519
13589
  var pixelRatio=GetDevicePixelRatio();
13520
13590
  this.Canvas.strokeStyle=color;
@@ -13560,7 +13630,7 @@ function AverageWidthFrame()
13560
13630
  }
13561
13631
  this.Canvas.stroke();
13562
13632
  }
13563
- else
13633
+ else if (lineType==1 || lineType==2) //虚线
13564
13634
  {
13565
13635
  this.DrawDotLine(left,right,y, color, option);
13566
13636
  }
@@ -39941,203 +40011,6 @@ function ChartMultiText()
39941
40011
  }
39942
40012
  }
39943
40013
 
39944
- // 图标集合 支持横屏
39945
- function ChartMultiSVGIcon()
39946
- {
39947
- this.newMethod=IChartPainting; //派生
39948
- this.newMethod();
39949
- delete this.newMethod;
39950
-
39951
- this.ClassName="ChartMultiSVGIcon";
39952
- this.Icon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
39953
- this.IconSize={ Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
39954
- Zoom:{ Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type , Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value } //放大倍数
39955
- };
39956
- this.Family;
39957
- this.Color=g_JSChartResource.DefaultTextColor;
39958
- this.IsHScreen=false;
39959
- this.IconRect=[]; //0=序号,1=区域
39960
-
39961
- this.Draw=function()
39962
- {
39963
- this.IconRect=[];
39964
- if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
39965
- if (this.IsShowIndexTitleOnly()) return;
39966
- if (this.IsHideScriptIndex()) return;
39967
- if (!this.Data || this.Data.length<=0) return;
39968
- if (!this.Family || !this.Icon) return;
39969
- if (!IFrameSplitOperator.IsNonEmptyArray(this.Icon)) return;
39970
-
39971
- this.IsHScreen=(this.ChartFrame.IsHScreen===true);
39972
- var xPointCount=this.ChartFrame.XPointCount;
39973
- var offset=this.Data.DataOffset;
39974
- this.DataWidth=this.ChartFrame.DataWidth;
39975
- this.DistanceWidth=this.ChartFrame.DistanceWidth;
39976
-
39977
- var border=this.GetBorder();
39978
- if (this.IsHScreen)
39979
- {
39980
- var left=border.TopEx;
39981
- var right=border.BottomEx;
39982
- }
39983
- else
39984
- {
39985
- var left=border.LeftEx;
39986
- var right=border.RightEx;
39987
- }
39988
-
39989
- var fontSize=this.GetDynamicIconSize(this.DataWidth,this.DistanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);
39990
- this.Canvas.font=fontSize+'px '+this.Family;
39991
-
39992
- for(var i=0; i<this.Icon.length; ++i)
39993
- {
39994
- var item=this.Icon[i];
39995
- if (!IFrameSplitOperator.IsNumber(item.Index)) continue;
39996
-
39997
- var index=item.Index-offset;
39998
- if (index>=0 && index<xPointCount)
39999
- {
40000
- var x=this.ChartFrame.GetXFromIndex(index);
40001
- var y=this.ChartFrame.GetYFromData(item.Value);
40002
-
40003
- if (item.Color) this.Canvas.fillStyle = item.Color;
40004
- else this.Canvas.fillStyle = this.Color;
40005
-
40006
- var textWidth=this.Canvas.measureText(item.Symbol).width;
40007
- this.Canvas.textAlign='center';
40008
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
40009
- if (x+textWidth/2>=right)
40010
- {
40011
- this.Canvas.textAlign='right';
40012
- x+=this.DataWidth/2;
40013
- rtIcon.X=x-fontSize;
40014
- }
40015
- else if (x-textWidth/2<left)
40016
- {
40017
- this.Canvas.textAlign = 'left';
40018
- x-=this.DataWidth/2;
40019
- rtIcon.X=x;
40020
- }
40021
-
40022
- if (item.Baseline==1)
40023
- {
40024
- this.Canvas.textBaseline='top';
40025
- rtIcon.Y=y;
40026
- }
40027
- else if (item.Baseline==2)
40028
- {
40029
- this.Canvas.textBaseline='bottom';
40030
- rtIcon.Y=y-fontSize;
40031
- }
40032
- else
40033
- {
40034
- this.Canvas.textBaseline = 'middle';
40035
- rtIcon.Y=y-fontSize/2;
40036
- }
40037
-
40038
- if (this.IsHScreen)
40039
- {
40040
- this.Canvas.save();
40041
- this.Canvas.translate(y, x);
40042
- this.Canvas.rotate(90 * Math.PI / 180);
40043
- this.Canvas.fillText(item.Symbol,0,0);
40044
- this.Canvas.restore();
40045
- }
40046
- else
40047
- {
40048
- if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
40049
- this.Canvas.fillText(item.Symbol, x, y);
40050
- if (item.Text) this.IconRect.push({ Index:i, Rect:rtIcon , Item:item });
40051
- }
40052
-
40053
- if (item.Line)
40054
- {
40055
- var kItem=this.Data.Data[item.Index];
40056
- var price=item.Line.KData=="H"? kItem.High:kItem.Low;
40057
- var yPrice=this.ChartFrame.GetYFromData(price);
40058
- var yText=y;
40059
- if (Array.isArray(item.Line.Offset) && item.Line.Offset.length==2)
40060
- {
40061
- if (yText>yPrice) //文字在下方
40062
- {
40063
- yText-=item.Line.Offset[1];
40064
- yPrice+=item.Line.Offset[0]
40065
- }
40066
- else if (yText<yPrice)
40067
- {
40068
- yText+=item.Line.Offset[1];
40069
- yPrice-=item.Line.Offset[0]
40070
- }
40071
- }
40072
- this.Canvas.save();
40073
- if (item.Line.Dash) this.Canvas.setLineDash(item.Line.Dash); //虚线
40074
- if (item.Line.Width>0) this.Canvas.lineWidth=item.Line.Width; //线宽
40075
- this.Canvas.strokeStyle = item.Line.Color;
40076
- this.Canvas.beginPath();
40077
- if (this.IsHScreen)
40078
- {
40079
- this.Canvas.moveTo(yText, ToFixedPoint(x));
40080
- this.Canvas.lineTo(yPrice,ToFixedPoint(x));
40081
- }
40082
- else
40083
- {
40084
- this.Canvas.moveTo(ToFixedPoint(x),yText);
40085
- this.Canvas.lineTo(ToFixedPoint(x),yPrice);
40086
- }
40087
-
40088
- this.Canvas.stroke();
40089
- this.Canvas.restore();
40090
- }
40091
- }
40092
- }
40093
- }
40094
-
40095
- this.GetTooltipData=function(x,y,tooltip)
40096
- {
40097
- if (!IFrameSplitOperator.IsNonEmptyArray(this.IconRect)) return false;
40098
- for(var i=0; i<this.IconRect.length; ++i)
40099
- {
40100
- var item=this.IconRect[i];
40101
- if (!item.Rect) continue;
40102
- var rect=item.Rect;
40103
- this.Canvas.beginPath();
40104
- this.Canvas.rect(rect.X,rect.Y,rect.Width,rect.Height);
40105
- if (this.Canvas.isPointInPath(x,y))
40106
- {
40107
- JSConsole.Chart.Log('[ChartMultiSVGIcon::GetTooltipData] icon ', item);
40108
- tooltip.Data=item;
40109
- tooltip.ChartPaint=this;
40110
- tooltip.Type=4; //指标
40111
- return true;
40112
- }
40113
- }
40114
-
40115
- return false;
40116
- }
40117
-
40118
- this.GetMaxMin=function()
40119
- {
40120
- var range={ Min:null, Max:null };
40121
- var xPointCount=this.ChartFrame.XPointCount;
40122
- var start=this.Data.DataOffset;
40123
- var end=start+xPointCount;
40124
-
40125
- for(var i in this.Icon)
40126
- {
40127
- var item=this.Icon[i];
40128
- if (item.Index>=start && item.Index<end)
40129
- {
40130
- if (range.Max==null) range.Max=item.Value;
40131
- else if (range.Max<item.Value) range.Max=item.Value;
40132
- if (range.Min==null) range.Min=item.Value;
40133
- else if (range.Min>item.Value) range.Min=item.Value;
40134
- }
40135
- }
40136
-
40137
- return range;
40138
- }
40139
- }
40140
-
40141
40014
 
40142
40015
  //图标集合(2.0) 支持横屏
40143
40016
  function ChartMultiSVGIconV2()
@@ -40349,6 +40222,7 @@ function ChartMultiSVGIconV2()
40349
40222
  if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
40350
40223
  this.Canvas.fillText(item.Symbol, x, y);
40351
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 });
40352
40226
  }
40353
40227
 
40354
40228
  if (item.Line)
@@ -41098,6 +40972,7 @@ function ChartDrawSVG()
41098
40972
  tooltip.Data={ Rect:item.Rect, Item:data, Index:item.Index };
41099
40973
  tooltip.ChartPaint=this;
41100
40974
  tooltip.Type=7; //drawsvg
40975
+ if (data.Tooltip && data.Tooltip.Ver==2.0) tooltip.Type=8; //drawsvg 新本版
41101
40976
  return true;
41102
40977
  }
41103
40978
  }
@@ -79887,29 +79762,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79887
79762
  this.DialogSelectRect.Update(sendData);
79888
79763
  }
79889
79764
 
79890
- this.DrawFloatTooltip=function(point,toolTip)
79891
- {
79892
- if (!this.FloatTooltip) return;
79893
-
79894
- this.UpdateFloatTooltip(point, toolTip)
79895
- }
79896
-
79897
- this.UpdateFloatTooltip=function(point, toolTip)
79898
- {
79899
- if (!this.FloatTooltip) return;
79900
-
79901
- var sendData=
79902
- {
79903
- Tooltip:toolTip,
79904
- Point:point,
79905
- Symbol:this.Symbol,
79906
- Name:this.Name,
79907
- DataType:1,
79908
- };
79909
-
79910
- this.FloatTooltip.Update(sendData);
79911
- }
79912
-
79913
79765
  this.UpdateHQFloatTooltip=function(kData)
79914
79766
  {
79915
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
  }
@@ -1892,6 +1892,10 @@ input[type="color"] {
1892
1892
  {
1893
1893
  min-width:80px;
1894
1894
  max-width: 500px;
1895
+
1896
+ white-space: nowrap;
1897
+ overflow: hidden;
1898
+ text-overflow: ellipsis;
1895
1899
  }
1896
1900
 
1897
1901
  .UMyChart_Tooltip_Float_Title_Span
@@ -1914,6 +1918,7 @@ input[type="color"] {
1914
1918
  .UMyChart_Tooltip_Float_Text3_Span
1915
1919
  {
1916
1920
  margin-left: 5px;
1921
+
1917
1922
  }
1918
1923
 
1919
1924