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.
@@ -6566,6 +6566,7 @@ var JSCHART_EVENT_ID=
6566
6566
  ON_CHANGE_KLINE_RIGHT:160, //切换复权
6567
6567
 
6568
6568
  ON_FORMAT_KLINE_FLOAT_TOOLTIP:161, //格式化k线浮动框显示文字
6569
+ ON_FORMAT_KLINE_INFO_FLOAT_TOOLTIP:162, //格式化信息地雷显示文字
6569
6570
  }
6570
6571
 
6571
6572
  var JSCHART_OPERATOR_ID=
@@ -10954,7 +10955,25 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10954
10955
 
10955
10956
  this.DrawFloatTooltip=function(point,toolTip)
10956
10957
  {
10958
+ if (!this.FloatTooltip) return;
10957
10959
 
10960
+ this.UpdateFloatTooltip(point, toolTip)
10961
+ }
10962
+
10963
+ this.UpdateFloatTooltip=function(point, toolTip)
10964
+ {
10965
+ if (!this.FloatTooltip) return;
10966
+
10967
+ var sendData=
10968
+ {
10969
+ Tooltip:toolTip,
10970
+ Point:point,
10971
+ Symbol:this.Symbol,
10972
+ Name:this.Name,
10973
+ DataType:1,
10974
+ };
10975
+
10976
+ this.FloatTooltip.Update(sendData);
10958
10977
  }
10959
10978
 
10960
10979
  //更新实时行情到浮动tooltip
@@ -11025,6 +11044,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11025
11044
  }
11026
11045
  else if (toolTip.Type===1) //信息地雷提示信息
11027
11046
  {
11047
+ if (this.FloatTooltip)
11048
+ {
11049
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11050
+ bHideFloatToolip=false;
11051
+ return;
11052
+ }
11053
+
11028
11054
  var scrollPos=GetScrollPosition();
11029
11055
  var left = x;
11030
11056
  var top = y;
@@ -11052,6 +11078,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11052
11078
  }
11053
11079
  else if (toolTip.Type==2) //指标信息
11054
11080
  {
11081
+ if (this.FloatTooltip)
11082
+ {
11083
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11084
+ bHideFloatToolip=false;
11085
+ return;
11086
+ }
11087
+
11055
11088
  var left = x;
11056
11089
  var top = y;
11057
11090
 
@@ -11073,6 +11106,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11073
11106
  }
11074
11107
  else if (toolTip.Type==3) //分时图异动信息
11075
11108
  {
11109
+ if (this.FloatTooltip)
11110
+ {
11111
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11112
+ bHideFloatToolip=false;
11113
+ return;
11114
+ }
11115
+
11076
11116
  var left = x;
11077
11117
  var top = y;
11078
11118
 
@@ -11092,8 +11132,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11092
11132
  this.Tooltip.innerHTML=format.Text;;
11093
11133
  this.Tooltip.style.display = "block";
11094
11134
  }
11095
- else if (toolTip.Type==4) //icon图标信息
11135
+ else if (toolTip.Type==4) //ChartMultiSVGIconV2 图标信息
11096
11136
  {
11137
+ if (this.FloatTooltip)
11138
+ {
11139
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11140
+ bHideFloatToolip=false;
11141
+ return;
11142
+ }
11143
+
11097
11144
  var left = x;
11098
11145
  var top = y;
11099
11146
 
@@ -11115,6 +11162,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11115
11162
  }
11116
11163
  else if (toolTip.Type==5)
11117
11164
  {
11165
+ if (this.FloatTooltip)
11166
+ {
11167
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11168
+ bHideFloatToolip=false;
11169
+ return;
11170
+ }
11171
+
11118
11172
  var left = x;
11119
11173
  var top = y;
11120
11174
 
@@ -11137,6 +11191,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11137
11191
  }
11138
11192
  else if (toolTip.Type==6) //散点图
11139
11193
  {
11194
+ if (this.FloatTooltip)
11195
+ {
11196
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11197
+ bHideFloatToolip=false;
11198
+ return;
11199
+ }
11200
+
11140
11201
  var left = x;
11141
11202
  var top = y;
11142
11203
 
@@ -11159,6 +11220,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11159
11220
  }
11160
11221
  else if (toolTip.Type==7) //ChartDrawSVG
11161
11222
  {
11223
+ if (this.FloatTooltip)
11224
+ {
11225
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11226
+ bHideFloatToolip=false;
11227
+ return;
11228
+ }
11229
+
11162
11230
  var left = x;
11163
11231
  var top = y;
11164
11232
 
@@ -11179,6 +11247,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11179
11247
  this.Tooltip.innerHTML=format.Text;
11180
11248
  this.Tooltip.style.display = "block";
11181
11249
  }
11250
+ else if (toolTip.Type==8) //ChartDrawSVG 新版本
11251
+ {
11252
+ if (this.FloatTooltip)
11253
+ {
11254
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11255
+ bHideFloatToolip=false;
11256
+ return;
11257
+ }
11258
+ }
11182
11259
 
11183
11260
 
11184
11261
  if (bHideFloatToolip) this.HideFloatTooltip();
@@ -14422,7 +14499,7 @@ function CoordinateInfo()
14422
14499
  this.Font=g_JSChartResource.FrameSplitTextFont; //字体
14423
14500
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
14424
14501
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
14425
- this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
14502
+ this.LineType=1; //线段类型 -1=不画线段 0=虚线 1,2=虚线, 3=短线 8,9=集合竞价坐标
14426
14503
  this.LineWidth; //线段宽度
14427
14504
  this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
14428
14505
  this.ExtendData; //扩展属性
@@ -17432,7 +17509,7 @@ function AverageWidthFrame()
17432
17509
  {
17433
17510
  if (lineType==-1) return;
17434
17511
 
17435
- if (lineType==0)
17512
+ if (lineType==0) //直线
17436
17513
  {
17437
17514
  var pixelRatio=GetDevicePixelRatio();
17438
17515
  this.Canvas.strokeStyle=color;
@@ -17461,7 +17538,7 @@ function AverageWidthFrame()
17461
17538
  this.Canvas.lineWidth=pixelRatio;
17462
17539
  }
17463
17540
  }
17464
- else if (lineType==2) //绘制短线
17541
+ else if (lineType==3) //绘制短线
17465
17542
  {
17466
17543
  var lineWidth=10*GetDevicePixelRatio();
17467
17544
  this.Canvas.strokeStyle=color;
@@ -17478,7 +17555,7 @@ function AverageWidthFrame()
17478
17555
  }
17479
17556
  this.Canvas.stroke();
17480
17557
  }
17481
- else
17558
+ else if (lineType==1 || lineType==2) //虚线
17482
17559
  {
17483
17560
  this.DrawDotLine(left,right,y, color, option);
17484
17561
  }
@@ -43859,203 +43936,6 @@ function ChartMultiText()
43859
43936
  }
43860
43937
  }
43861
43938
 
43862
- // 图标集合 支持横屏
43863
- function ChartMultiSVGIcon()
43864
- {
43865
- this.newMethod=IChartPainting; //派生
43866
- this.newMethod();
43867
- delete this.newMethod;
43868
-
43869
- this.ClassName="ChartMultiSVGIcon";
43870
- this.Icon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
43871
- this.IconSize={ Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
43872
- Zoom:{ Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type , Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value } //放大倍数
43873
- };
43874
- this.Family;
43875
- this.Color=g_JSChartResource.DefaultTextColor;
43876
- this.IsHScreen=false;
43877
- this.IconRect=[]; //0=序号,1=区域
43878
-
43879
- this.Draw=function()
43880
- {
43881
- this.IconRect=[];
43882
- if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
43883
- if (this.IsShowIndexTitleOnly()) return;
43884
- if (this.IsHideScriptIndex()) return;
43885
- if (!this.Data || this.Data.length<=0) return;
43886
- if (!this.Family || !this.Icon) return;
43887
- if (!IFrameSplitOperator.IsNonEmptyArray(this.Icon)) return;
43888
-
43889
- this.IsHScreen=(this.ChartFrame.IsHScreen===true);
43890
- var xPointCount=this.ChartFrame.XPointCount;
43891
- var offset=this.Data.DataOffset;
43892
- this.DataWidth=this.ChartFrame.DataWidth;
43893
- this.DistanceWidth=this.ChartFrame.DistanceWidth;
43894
-
43895
- var border=this.GetBorder();
43896
- if (this.IsHScreen)
43897
- {
43898
- var left=border.TopEx;
43899
- var right=border.BottomEx;
43900
- }
43901
- else
43902
- {
43903
- var left=border.LeftEx;
43904
- var right=border.RightEx;
43905
- }
43906
-
43907
- var fontSize=this.GetDynamicIconSize(this.DataWidth,this.DistanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);
43908
- this.Canvas.font=fontSize+'px '+this.Family;
43909
-
43910
- for(var i=0; i<this.Icon.length; ++i)
43911
- {
43912
- var item=this.Icon[i];
43913
- if (!IFrameSplitOperator.IsNumber(item.Index)) continue;
43914
-
43915
- var index=item.Index-offset;
43916
- if (index>=0 && index<xPointCount)
43917
- {
43918
- var x=this.ChartFrame.GetXFromIndex(index);
43919
- var y=this.ChartFrame.GetYFromData(item.Value);
43920
-
43921
- if (item.Color) this.Canvas.fillStyle = item.Color;
43922
- else this.Canvas.fillStyle = this.Color;
43923
-
43924
- var textWidth=this.Canvas.measureText(item.Symbol).width;
43925
- this.Canvas.textAlign='center';
43926
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
43927
- if (x+textWidth/2>=right)
43928
- {
43929
- this.Canvas.textAlign='right';
43930
- x+=this.DataWidth/2;
43931
- rtIcon.X=x-fontSize;
43932
- }
43933
- else if (x-textWidth/2<left)
43934
- {
43935
- this.Canvas.textAlign = 'left';
43936
- x-=this.DataWidth/2;
43937
- rtIcon.X=x;
43938
- }
43939
-
43940
- if (item.Baseline==1)
43941
- {
43942
- this.Canvas.textBaseline='top';
43943
- rtIcon.Y=y;
43944
- }
43945
- else if (item.Baseline==2)
43946
- {
43947
- this.Canvas.textBaseline='bottom';
43948
- rtIcon.Y=y-fontSize;
43949
- }
43950
- else
43951
- {
43952
- this.Canvas.textBaseline = 'middle';
43953
- rtIcon.Y=y-fontSize/2;
43954
- }
43955
-
43956
- if (this.IsHScreen)
43957
- {
43958
- this.Canvas.save();
43959
- this.Canvas.translate(y, x);
43960
- this.Canvas.rotate(90 * Math.PI / 180);
43961
- this.Canvas.fillText(item.Symbol,0,0);
43962
- this.Canvas.restore();
43963
- }
43964
- else
43965
- {
43966
- if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
43967
- this.Canvas.fillText(item.Symbol, x, y);
43968
- if (item.Text) this.IconRect.push({ Index:i, Rect:rtIcon , Item:item });
43969
- }
43970
-
43971
- if (item.Line)
43972
- {
43973
- var kItem=this.Data.Data[item.Index];
43974
- var price=item.Line.KData=="H"? kItem.High:kItem.Low;
43975
- var yPrice=this.ChartFrame.GetYFromData(price);
43976
- var yText=y;
43977
- if (Array.isArray(item.Line.Offset) && item.Line.Offset.length==2)
43978
- {
43979
- if (yText>yPrice) //文字在下方
43980
- {
43981
- yText-=item.Line.Offset[1];
43982
- yPrice+=item.Line.Offset[0]
43983
- }
43984
- else if (yText<yPrice)
43985
- {
43986
- yText+=item.Line.Offset[1];
43987
- yPrice-=item.Line.Offset[0]
43988
- }
43989
- }
43990
- this.Canvas.save();
43991
- if (item.Line.Dash) this.Canvas.setLineDash(item.Line.Dash); //虚线
43992
- if (item.Line.Width>0) this.Canvas.lineWidth=item.Line.Width; //线宽
43993
- this.Canvas.strokeStyle = item.Line.Color;
43994
- this.Canvas.beginPath();
43995
- if (this.IsHScreen)
43996
- {
43997
- this.Canvas.moveTo(yText, ToFixedPoint(x));
43998
- this.Canvas.lineTo(yPrice,ToFixedPoint(x));
43999
- }
44000
- else
44001
- {
44002
- this.Canvas.moveTo(ToFixedPoint(x),yText);
44003
- this.Canvas.lineTo(ToFixedPoint(x),yPrice);
44004
- }
44005
-
44006
- this.Canvas.stroke();
44007
- this.Canvas.restore();
44008
- }
44009
- }
44010
- }
44011
- }
44012
-
44013
- this.GetTooltipData=function(x,y,tooltip)
44014
- {
44015
- if (!IFrameSplitOperator.IsNonEmptyArray(this.IconRect)) return false;
44016
- for(var i=0; i<this.IconRect.length; ++i)
44017
- {
44018
- var item=this.IconRect[i];
44019
- if (!item.Rect) continue;
44020
- var rect=item.Rect;
44021
- this.Canvas.beginPath();
44022
- this.Canvas.rect(rect.X,rect.Y,rect.Width,rect.Height);
44023
- if (this.Canvas.isPointInPath(x,y))
44024
- {
44025
- JSConsole.Chart.Log('[ChartMultiSVGIcon::GetTooltipData] icon ', item);
44026
- tooltip.Data=item;
44027
- tooltip.ChartPaint=this;
44028
- tooltip.Type=4; //指标
44029
- return true;
44030
- }
44031
- }
44032
-
44033
- return false;
44034
- }
44035
-
44036
- this.GetMaxMin=function()
44037
- {
44038
- var range={ Min:null, Max:null };
44039
- var xPointCount=this.ChartFrame.XPointCount;
44040
- var start=this.Data.DataOffset;
44041
- var end=start+xPointCount;
44042
-
44043
- for(var i in this.Icon)
44044
- {
44045
- var item=this.Icon[i];
44046
- if (item.Index>=start && item.Index<end)
44047
- {
44048
- if (range.Max==null) range.Max=item.Value;
44049
- else if (range.Max<item.Value) range.Max=item.Value;
44050
- if (range.Min==null) range.Min=item.Value;
44051
- else if (range.Min>item.Value) range.Min=item.Value;
44052
- }
44053
- }
44054
-
44055
- return range;
44056
- }
44057
- }
44058
-
44059
43939
 
44060
43940
  //图标集合(2.0) 支持横屏
44061
43941
  function ChartMultiSVGIconV2()
@@ -44267,6 +44147,7 @@ function ChartMultiSVGIconV2()
44267
44147
  if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
44268
44148
  this.Canvas.fillText(item.Symbol, x, y);
44269
44149
  if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44150
+ else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44270
44151
  }
44271
44152
 
44272
44153
  if (item.Line)
@@ -45016,6 +44897,7 @@ function ChartDrawSVG()
45016
44897
  tooltip.Data={ Rect:item.Rect, Item:data, Index:item.Index };
45017
44898
  tooltip.ChartPaint=this;
45018
44899
  tooltip.Type=7; //drawsvg
44900
+ if (data.Tooltip && data.Tooltip.Ver==2.0) tooltip.Type=8; //drawsvg 新本版
45019
44901
  return true;
45020
44902
  }
45021
44903
  }
@@ -83805,29 +83687,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83805
83687
  this.DialogSelectRect.Update(sendData);
83806
83688
  }
83807
83689
 
83808
- this.DrawFloatTooltip=function(point,toolTip)
83809
- {
83810
- if (!this.FloatTooltip) return;
83811
-
83812
- this.UpdateFloatTooltip(point, toolTip)
83813
- }
83814
-
83815
- this.UpdateFloatTooltip=function(point, toolTip)
83816
- {
83817
- if (!this.FloatTooltip) return;
83818
-
83819
- var sendData=
83820
- {
83821
- Tooltip:toolTip,
83822
- Point:point,
83823
- Symbol:this.Symbol,
83824
- Name:this.Name,
83825
- DataType:1,
83826
- };
83827
-
83828
- this.FloatTooltip.Update(sendData);
83829
- }
83830
-
83831
83690
  this.UpdateHQFloatTooltip=function(kData)
83832
83691
  {
83833
83692
  if (!this.FloatTooltip) return;
@@ -139480,7 +139339,7 @@ function ScrollBarBGChart()
139480
139339
 
139481
139340
 
139482
139341
 
139483
- var HQCHART_VERSION="1.1.14049";
139342
+ var HQCHART_VERSION="1.1.14063";
139484
139343
 
139485
139344
  function PrintHQChartVersion()
139486
139345
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14049";
8
+ var HQCHART_VERSION="1.1.14063";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {