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.
@@ -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
@@ -11059,6 +11078,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11059
11078
  }
11060
11079
  else if (toolTip.Type==2) //指标信息
11061
11080
  {
11081
+ if (this.FloatTooltip)
11082
+ {
11083
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11084
+ bHideFloatToolip=false;
11085
+ return;
11086
+ }
11087
+
11062
11088
  var left = x;
11063
11089
  var top = y;
11064
11090
 
@@ -11080,6 +11106,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11080
11106
  }
11081
11107
  else if (toolTip.Type==3) //分时图异动信息
11082
11108
  {
11109
+ if (this.FloatTooltip)
11110
+ {
11111
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11112
+ bHideFloatToolip=false;
11113
+ return;
11114
+ }
11115
+
11083
11116
  var left = x;
11084
11117
  var top = y;
11085
11118
 
@@ -11099,8 +11132,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11099
11132
  this.Tooltip.innerHTML=format.Text;;
11100
11133
  this.Tooltip.style.display = "block";
11101
11134
  }
11102
- else if (toolTip.Type==4) //icon图标信息
11135
+ else if (toolTip.Type==4) //ChartMultiSVGIconV2 图标信息
11103
11136
  {
11137
+ if (this.FloatTooltip)
11138
+ {
11139
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11140
+ bHideFloatToolip=false;
11141
+ return;
11142
+ }
11143
+
11104
11144
  var left = x;
11105
11145
  var top = y;
11106
11146
 
@@ -11122,6 +11162,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11122
11162
  }
11123
11163
  else if (toolTip.Type==5)
11124
11164
  {
11165
+ if (this.FloatTooltip)
11166
+ {
11167
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11168
+ bHideFloatToolip=false;
11169
+ return;
11170
+ }
11171
+
11125
11172
  var left = x;
11126
11173
  var top = y;
11127
11174
 
@@ -11144,6 +11191,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11144
11191
  }
11145
11192
  else if (toolTip.Type==6) //散点图
11146
11193
  {
11194
+ if (this.FloatTooltip)
11195
+ {
11196
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11197
+ bHideFloatToolip=false;
11198
+ return;
11199
+ }
11200
+
11147
11201
  var left = x;
11148
11202
  var top = y;
11149
11203
 
@@ -11166,6 +11220,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11166
11220
  }
11167
11221
  else if (toolTip.Type==7) //ChartDrawSVG
11168
11222
  {
11223
+ if (this.FloatTooltip)
11224
+ {
11225
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11226
+ bHideFloatToolip=false;
11227
+ return;
11228
+ }
11229
+
11169
11230
  var left = x;
11170
11231
  var top = y;
11171
11232
 
@@ -11186,6 +11247,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11186
11247
  this.Tooltip.innerHTML=format.Text;
11187
11248
  this.Tooltip.style.display = "block";
11188
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
+ }
11189
11259
 
11190
11260
 
11191
11261
  if (bHideFloatToolip) this.HideFloatTooltip();
@@ -14429,7 +14499,7 @@ function CoordinateInfo()
14429
14499
  this.Font=g_JSChartResource.FrameSplitTextFont; //字体
14430
14500
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
14431
14501
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
14432
- this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
14502
+ this.LineType=1; //线段类型 -1=不画线段 0=虚线 1,2=虚线, 3=短线 8,9=集合竞价坐标
14433
14503
  this.LineWidth; //线段宽度
14434
14504
  this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
14435
14505
  this.ExtendData; //扩展属性
@@ -17439,7 +17509,7 @@ function AverageWidthFrame()
17439
17509
  {
17440
17510
  if (lineType==-1) return;
17441
17511
 
17442
- if (lineType==0)
17512
+ if (lineType==0) //直线
17443
17513
  {
17444
17514
  var pixelRatio=GetDevicePixelRatio();
17445
17515
  this.Canvas.strokeStyle=color;
@@ -17485,7 +17555,7 @@ function AverageWidthFrame()
17485
17555
  }
17486
17556
  this.Canvas.stroke();
17487
17557
  }
17488
- else
17558
+ else if (lineType==1 || lineType==2) //虚线
17489
17559
  {
17490
17560
  this.DrawDotLine(left,right,y, color, option);
17491
17561
  }
@@ -43866,203 +43936,6 @@ function ChartMultiText()
43866
43936
  }
43867
43937
  }
43868
43938
 
43869
- // 图标集合 支持横屏
43870
- function ChartMultiSVGIcon()
43871
- {
43872
- this.newMethod=IChartPainting; //派生
43873
- this.newMethod();
43874
- delete this.newMethod;
43875
-
43876
- this.ClassName="ChartMultiSVGIcon";
43877
- this.Icon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
43878
- this.IconSize={ Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
43879
- Zoom:{ Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type , Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value } //放大倍数
43880
- };
43881
- this.Family;
43882
- this.Color=g_JSChartResource.DefaultTextColor;
43883
- this.IsHScreen=false;
43884
- this.IconRect=[]; //0=序号,1=区域
43885
-
43886
- this.Draw=function()
43887
- {
43888
- this.IconRect=[];
43889
- if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
43890
- if (this.IsShowIndexTitleOnly()) return;
43891
- if (this.IsHideScriptIndex()) return;
43892
- if (!this.Data || this.Data.length<=0) return;
43893
- if (!this.Family || !this.Icon) return;
43894
- if (!IFrameSplitOperator.IsNonEmptyArray(this.Icon)) return;
43895
-
43896
- this.IsHScreen=(this.ChartFrame.IsHScreen===true);
43897
- var xPointCount=this.ChartFrame.XPointCount;
43898
- var offset=this.Data.DataOffset;
43899
- this.DataWidth=this.ChartFrame.DataWidth;
43900
- this.DistanceWidth=this.ChartFrame.DistanceWidth;
43901
-
43902
- var border=this.GetBorder();
43903
- if (this.IsHScreen)
43904
- {
43905
- var left=border.TopEx;
43906
- var right=border.BottomEx;
43907
- }
43908
- else
43909
- {
43910
- var left=border.LeftEx;
43911
- var right=border.RightEx;
43912
- }
43913
-
43914
- var fontSize=this.GetDynamicIconSize(this.DataWidth,this.DistanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);
43915
- this.Canvas.font=fontSize+'px '+this.Family;
43916
-
43917
- for(var i=0; i<this.Icon.length; ++i)
43918
- {
43919
- var item=this.Icon[i];
43920
- if (!IFrameSplitOperator.IsNumber(item.Index)) continue;
43921
-
43922
- var index=item.Index-offset;
43923
- if (index>=0 && index<xPointCount)
43924
- {
43925
- var x=this.ChartFrame.GetXFromIndex(index);
43926
- var y=this.ChartFrame.GetYFromData(item.Value);
43927
-
43928
- if (item.Color) this.Canvas.fillStyle = item.Color;
43929
- else this.Canvas.fillStyle = this.Color;
43930
-
43931
- var textWidth=this.Canvas.measureText(item.Symbol).width;
43932
- this.Canvas.textAlign='center';
43933
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
43934
- if (x+textWidth/2>=right)
43935
- {
43936
- this.Canvas.textAlign='right';
43937
- x+=this.DataWidth/2;
43938
- rtIcon.X=x-fontSize;
43939
- }
43940
- else if (x-textWidth/2<left)
43941
- {
43942
- this.Canvas.textAlign = 'left';
43943
- x-=this.DataWidth/2;
43944
- rtIcon.X=x;
43945
- }
43946
-
43947
- if (item.Baseline==1)
43948
- {
43949
- this.Canvas.textBaseline='top';
43950
- rtIcon.Y=y;
43951
- }
43952
- else if (item.Baseline==2)
43953
- {
43954
- this.Canvas.textBaseline='bottom';
43955
- rtIcon.Y=y-fontSize;
43956
- }
43957
- else
43958
- {
43959
- this.Canvas.textBaseline = 'middle';
43960
- rtIcon.Y=y-fontSize/2;
43961
- }
43962
-
43963
- if (this.IsHScreen)
43964
- {
43965
- this.Canvas.save();
43966
- this.Canvas.translate(y, x);
43967
- this.Canvas.rotate(90 * Math.PI / 180);
43968
- this.Canvas.fillText(item.Symbol,0,0);
43969
- this.Canvas.restore();
43970
- }
43971
- else
43972
- {
43973
- if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
43974
- this.Canvas.fillText(item.Symbol, x, y);
43975
- if (item.Text) this.IconRect.push({ Index:i, Rect:rtIcon , Item:item });
43976
- }
43977
-
43978
- if (item.Line)
43979
- {
43980
- var kItem=this.Data.Data[item.Index];
43981
- var price=item.Line.KData=="H"? kItem.High:kItem.Low;
43982
- var yPrice=this.ChartFrame.GetYFromData(price);
43983
- var yText=y;
43984
- if (Array.isArray(item.Line.Offset) && item.Line.Offset.length==2)
43985
- {
43986
- if (yText>yPrice) //文字在下方
43987
- {
43988
- yText-=item.Line.Offset[1];
43989
- yPrice+=item.Line.Offset[0]
43990
- }
43991
- else if (yText<yPrice)
43992
- {
43993
- yText+=item.Line.Offset[1];
43994
- yPrice-=item.Line.Offset[0]
43995
- }
43996
- }
43997
- this.Canvas.save();
43998
- if (item.Line.Dash) this.Canvas.setLineDash(item.Line.Dash); //虚线
43999
- if (item.Line.Width>0) this.Canvas.lineWidth=item.Line.Width; //线宽
44000
- this.Canvas.strokeStyle = item.Line.Color;
44001
- this.Canvas.beginPath();
44002
- if (this.IsHScreen)
44003
- {
44004
- this.Canvas.moveTo(yText, ToFixedPoint(x));
44005
- this.Canvas.lineTo(yPrice,ToFixedPoint(x));
44006
- }
44007
- else
44008
- {
44009
- this.Canvas.moveTo(ToFixedPoint(x),yText);
44010
- this.Canvas.lineTo(ToFixedPoint(x),yPrice);
44011
- }
44012
-
44013
- this.Canvas.stroke();
44014
- this.Canvas.restore();
44015
- }
44016
- }
44017
- }
44018
- }
44019
-
44020
- this.GetTooltipData=function(x,y,tooltip)
44021
- {
44022
- if (!IFrameSplitOperator.IsNonEmptyArray(this.IconRect)) return false;
44023
- for(var i=0; i<this.IconRect.length; ++i)
44024
- {
44025
- var item=this.IconRect[i];
44026
- if (!item.Rect) continue;
44027
- var rect=item.Rect;
44028
- this.Canvas.beginPath();
44029
- this.Canvas.rect(rect.X,rect.Y,rect.Width,rect.Height);
44030
- if (this.Canvas.isPointInPath(x,y))
44031
- {
44032
- JSConsole.Chart.Log('[ChartMultiSVGIcon::GetTooltipData] icon ', item);
44033
- tooltip.Data=item;
44034
- tooltip.ChartPaint=this;
44035
- tooltip.Type=4; //指标
44036
- return true;
44037
- }
44038
- }
44039
-
44040
- return false;
44041
- }
44042
-
44043
- this.GetMaxMin=function()
44044
- {
44045
- var range={ Min:null, Max:null };
44046
- var xPointCount=this.ChartFrame.XPointCount;
44047
- var start=this.Data.DataOffset;
44048
- var end=start+xPointCount;
44049
-
44050
- for(var i in this.Icon)
44051
- {
44052
- var item=this.Icon[i];
44053
- if (item.Index>=start && item.Index<end)
44054
- {
44055
- if (range.Max==null) range.Max=item.Value;
44056
- else if (range.Max<item.Value) range.Max=item.Value;
44057
- if (range.Min==null) range.Min=item.Value;
44058
- else if (range.Min>item.Value) range.Min=item.Value;
44059
- }
44060
- }
44061
-
44062
- return range;
44063
- }
44064
- }
44065
-
44066
43939
 
44067
43940
  //图标集合(2.0) 支持横屏
44068
43941
  function ChartMultiSVGIconV2()
@@ -44274,6 +44147,7 @@ function ChartMultiSVGIconV2()
44274
44147
  if (IFrameSplitOperator.IsNumber(item.YMove)) y+=item.YMove;
44275
44148
  this.Canvas.fillText(item.Symbol, x, y);
44276
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 });
44277
44151
  }
44278
44152
 
44279
44153
  if (item.Line)
@@ -45023,6 +44897,7 @@ function ChartDrawSVG()
45023
44897
  tooltip.Data={ Rect:item.Rect, Item:data, Index:item.Index };
45024
44898
  tooltip.ChartPaint=this;
45025
44899
  tooltip.Type=7; //drawsvg
44900
+ if (data.Tooltip && data.Tooltip.Ver==2.0) tooltip.Type=8; //drawsvg 新本版
45026
44901
  return true;
45027
44902
  }
45028
44903
  }
@@ -83812,29 +83687,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83812
83687
  this.DialogSelectRect.Update(sendData);
83813
83688
  }
83814
83689
 
83815
- this.DrawFloatTooltip=function(point,toolTip)
83816
- {
83817
- if (!this.FloatTooltip) return;
83818
-
83819
- this.UpdateFloatTooltip(point, toolTip)
83820
- }
83821
-
83822
- this.UpdateFloatTooltip=function(point, toolTip)
83823
- {
83824
- if (!this.FloatTooltip) return;
83825
-
83826
- var sendData=
83827
- {
83828
- Tooltip:toolTip,
83829
- Point:point,
83830
- Symbol:this.Symbol,
83831
- Name:this.Name,
83832
- DataType:1,
83833
- };
83834
-
83835
- this.FloatTooltip.Update(sendData);
83836
- }
83837
-
83838
83690
  this.UpdateHQFloatTooltip=function(kData)
83839
83691
  {
83840
83692
  if (!this.FloatTooltip) return;
@@ -139487,7 +139339,7 @@ function ScrollBarBGChart()
139487
139339
 
139488
139340
 
139489
139341
 
139490
- var HQCHART_VERSION="1.1.14055";
139342
+ var HQCHART_VERSION="1.1.14063";
139491
139343
 
139492
139344
  function PrintHQChartVersion()
139493
139345
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14055";
8
+ var HQCHART_VERSION="1.1.14063";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {