hqchart 1.1.13909 → 1.1.13915

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.
@@ -4464,6 +4464,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4464
4464
 
4465
4465
  if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
4466
4466
  if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
4467
+ if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
4467
4468
 
4468
4469
  }
4469
4470
 
@@ -4941,6 +4942,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4941
4942
 
4942
4943
  if (IFrameSplitOperator.IsNumber(item.HPenType)) chart.ChartCorssCursor.HPenType=item.HPenType;
4943
4944
  if (IFrameSplitOperator.IsNumber(item.VPenType)) chart.ChartCorssCursor.VPenType=item.VPenType;
4945
+ if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
4944
4946
  }
4945
4947
 
4946
4948
  if (option.MinuteInfo) chart.CreateMinuteInfo(option.MinuteInfo);
@@ -5687,6 +5689,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5687
5689
  if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
5688
5690
  if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
5689
5691
 
5692
+ //K线tooltip
5693
+ if (option.EnableTooltipDialog===true) chart.InitalTooltipDialog();
5694
+
5690
5695
  //注册事件
5691
5696
  if (option.EventCallback)
5692
5697
  {
@@ -6988,6 +6993,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6988
6993
  this.DialogDrawTool; //画图工具
6989
6994
  this.DialogModifyDraw; //画图修改
6990
6995
 
6996
+ this.DialogTooltip; //tooltip信息
6997
+
6991
6998
 
6992
6999
  this.ClearStockCache=function()
6993
7000
  {
@@ -7011,6 +7018,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7011
7018
  this.DialogDrawTool.Create();
7012
7019
  }
7013
7020
 
7021
+ this.InitalTooltipDialog=function()
7022
+ {
7023
+ if (this.DialogTooltip) return;
7024
+
7025
+ this.DialogTooltip=new JSDialogTooltip();
7026
+ this.DialogTooltip.Inital(this);
7027
+ this.DialogTooltip.Create();
7028
+ }
7029
+
7014
7030
  this.InitalModifyDrawDialog=function()
7015
7031
  {
7016
7032
  if ( this.DialogModifyDraw) return;
@@ -7067,6 +7083,22 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7067
7083
  this.DialogModifyDraw.Close();
7068
7084
  }
7069
7085
 
7086
+ this.IsShowTooltipDialog=function()
7087
+ {
7088
+ if (!this.DialogTooltip) return false;
7089
+
7090
+ return this.DialogTooltip.IsShow();
7091
+ }
7092
+
7093
+ this.CloseTooltipDialog=function()
7094
+ {
7095
+ if (!this.DialogTooltip) return;
7096
+
7097
+ this.DialogTooltip.Close();
7098
+ }
7099
+
7100
+
7101
+
7070
7102
  //obj={ Element:, Canvas: }
7071
7103
  this.SetCorssCursorElement=function(obj)
7072
7104
  {
@@ -9393,6 +9425,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9393
9425
 
9394
9426
  this.DrawDrawPictureXYCoordinate(); //绘制画图工具 X,Y轴刻度信息
9395
9427
 
9428
+ var bDrawDialogTooltip=false;
9396
9429
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
9397
9430
  if (this.LastPoint.X!=null || this.LastPoint.Y!=null)
9398
9431
  {
@@ -9436,6 +9469,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9436
9469
  {
9437
9470
  this.ChartCorssCursor.Canvas=this.Canvas;
9438
9471
  }
9472
+
9473
+ bDrawDialogTooltip=true;
9439
9474
  }
9440
9475
 
9441
9476
  ptPosition=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
@@ -9516,6 +9551,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9516
9551
  var frame=this.LastMouseStatus.MouseOnToolbar.Frame;
9517
9552
  if (frame && frame.DrawToolbarTooltip) frame.DrawToolbarTooltip(this.LastMouseStatus.MouseOnToolbar);
9518
9553
  }
9554
+
9555
+
9556
+ if (bDrawDialogTooltip) this.DrawTooltipDialog();
9519
9557
 
9520
9558
  //发送图形状态给外部
9521
9559
  if (this.mapEvent.has(JSCHART_EVENT_ID.CHART_STATUS))
@@ -9841,7 +9879,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9841
9879
  }
9842
9880
 
9843
9881
  this.DrawDrawPictureXYCoordinate();
9844
-
9882
+ var bDrawDialogTooltip=false;
9845
9883
  if (this.ChartCorssCursor)
9846
9884
  {
9847
9885
  this.ChartCorssCursor.LastPoint=this.LastPoint;
@@ -9885,6 +9923,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9885
9923
  {
9886
9924
  this.ChartCorssCursor.Canvas=this.Canvas;
9887
9925
  }
9926
+
9927
+ bDrawDialogTooltip=true;
9888
9928
  }
9889
9929
 
9890
9930
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
@@ -9979,6 +10019,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9979
10019
 
9980
10020
  this.OffscreenToShowCanvas();
9981
10021
 
10022
+ if (bDrawDialogTooltip) this.DrawTooltipDialog();
10023
+
9982
10024
  ++this.TouchDrawCount;
9983
10025
  }
9984
10026
 
@@ -10407,6 +10449,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10407
10449
  }
10408
10450
 
10409
10451
  var keyID = e.keyCode ? e.keyCode :e.which;
10452
+
10453
+ var draw=false;
10454
+ if (this.ChartCorssCursor && this.ChartCorssCursor.OnKeyDown) //十字光标 隐藏显示
10455
+ {
10456
+ var sendData={ e:e, KeyID:keyID, Draw:false, PreventDefault:false };
10457
+ this.ChartCorssCursor.OnKeyDown(sendData);
10458
+ draw=sendData.Draw;
10459
+ }
10460
+
10410
10461
  switch(keyID)
10411
10462
  {
10412
10463
  case 37: //left
@@ -10549,6 +10600,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10549
10600
  return;
10550
10601
  }
10551
10602
 
10603
+ if (draw) this.DrawDynamicInfo();
10604
+
10552
10605
  //不让滚动条滚动
10553
10606
  if(e.preventDefault) e.preventDefault();
10554
10607
  else e.returnValue = false;
@@ -10856,6 +10909,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10856
10909
  this.ShowTooltip(this.LastPoint.X/pixelTatio,this.LastPoint.Y/pixelTatio,toolTip);
10857
10910
  }
10858
10911
 
10912
+ this.DrawTooltipDialog=function()
10913
+ {
10914
+
10915
+ }
10916
+
10859
10917
  this.ShowTooltip=function(x,y,toolTip)
10860
10918
  {
10861
10919
  if (!this.IsShowTooltip) return;
@@ -11965,6 +12023,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11965
12023
  else if (option.Draw==true) this.Draw(); //是否立即重绘
11966
12024
 
11967
12025
  if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
12026
+ if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
11968
12027
  }
11969
12028
 
11970
12029
  this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
@@ -13954,6 +14013,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13954
14013
  item.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
13955
14014
  }
13956
14015
  }
14016
+
14017
+ //十字光标状态变动
14018
+ this.OnChangeCorssCursorStatus=function(data, obj)
14019
+ {
14020
+ if (data.Type==1)
14021
+ {
14022
+ if (!data.IsShowCorss) //十字光标隐藏
14023
+ {
14024
+ this.HideTooltip();
14025
+ this.CloseTooltipDialog();
14026
+ }
14027
+ }
14028
+ }
13957
14029
  }
13958
14030
 
13959
14031
  function GetDevicePixelRatio()
@@ -36935,7 +37007,8 @@ function ChartVolStick()
36935
37007
  this.ClassName='ChartVolStick';
36936
37008
 
36937
37009
  this.BarWidth; //固定宽度 目前只支持宽度为1
36938
- this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
37010
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
37011
+ this.BarColorType=0; //0=柱子颜色跟K线走 1=正upcolor 负downcolor
36939
37012
  this.PtInChart=this.PtInBar;
36940
37013
  this.DrawSelectedStatus=this.DrawLinePoint;
36941
37014
 
@@ -36982,7 +37055,7 @@ function ChartVolStick()
36982
37055
  if (right>chartright) break;
36983
37056
 
36984
37057
  var y=this.ChartFrame.GetYFromData(value);
36985
- var barColor=this.GetBarColor(kItem);
37058
+ var barColor=this.GetBarColor(kItem,value);
36986
37059
  var bUp=barColor.IsUp;
36987
37060
 
36988
37061
 
@@ -37030,7 +37103,7 @@ function ChartVolStick()
37030
37103
  if (x>chartright) break;
37031
37104
 
37032
37105
  if (isMinute) barColor=this.GetMinuteBarColor(kItem,preKItem); //分时图颜色单独计算
37033
- else barColor=this.GetBarColor(kItem);
37106
+ else barColor=this.GetBarColor(kItem, value);
37034
37107
 
37035
37108
  this.Canvas.strokeStyle=barColor.Color;
37036
37109
 
@@ -37075,7 +37148,7 @@ function ChartVolStick()
37075
37148
  if (right>chartBottom) break;
37076
37149
 
37077
37150
  var y=this.ChartFrame.GetYFromData(value);
37078
- var barColor=this.GetBarColor(kItem);
37151
+ var barColor=this.GetBarColor(kItem, value);
37079
37152
  var bUp=barColor.IsUp;
37080
37153
 
37081
37154
  var height=ToFixedRect(y-yBottom); //高度调整为整数
@@ -37121,7 +37194,7 @@ function ChartVolStick()
37121
37194
  if (x>chartBottom) break;
37122
37195
 
37123
37196
  if (isMinute) barColor=this.GetMinuteBarColor(kItem,preKItem); //分时图颜色单独计算
37124
- else barColor=this.GetBarColor(kItem);
37197
+ else barColor=this.GetBarColor(kItem,value);
37125
37198
 
37126
37199
  var bUp=barColor.IsUp;
37127
37200
  this.Canvas.strokeStyle=barColor.Color;
@@ -37161,8 +37234,14 @@ function ChartVolStick()
37161
37234
  return range;
37162
37235
  }
37163
37236
 
37164
- this.GetBarColor=function(kItem)
37237
+ this.GetBarColor=function(kItem, value)
37165
37238
  {
37239
+ if (this.BarColorType===1) //更具正负决定柱子颜色
37240
+ {
37241
+ if (value>=0) return { Color:this.UpColor, IsUp:true }; //颜色, 是否是上涨
37242
+ else return { Color:this.DownColor, IsUp:false };
37243
+ }
37244
+
37166
37245
  if (kItem.Close>=kItem.Open) return { Color:this.UpColor, IsUp:true }; //颜色, 是否是上涨
37167
37246
  else return { Color:this.DownColor, IsUp:false };
37168
37247
  }
@@ -46156,7 +46235,7 @@ function KLineTooltipPaint()
46156
46235
  }
46157
46236
 
46158
46237
  if (this.HQChart.CurrentChartDrawPicture) return false; //画图工具操作的时候 不显示
46159
-
46238
+
46160
46239
  return true;
46161
46240
  }
46162
46241
 
@@ -46988,6 +47067,8 @@ function MinuteLeftTooltipPaint()
46988
47067
  var pt=this.HQChart.LastPoint;
46989
47068
  if (!pt) return false;
46990
47069
 
47070
+ if (this.HQChart.ChartCorssCursor && !this.HQChart.ChartCorssCursor.IsShowCorss) return false;
47071
+
46991
47072
  return this.HQChart.IsMouseOnClient(pt.X, pt.Y);
46992
47073
  }
46993
47074
 
@@ -54638,6 +54719,9 @@ function ChartCorssCursor()
54638
54719
  this.IsShowClose=false; //Y轴始终显示收盘价
54639
54720
  this.ClientPos=-1;
54640
54721
  this.CallAcutionXOperator;
54722
+
54723
+ this.EnableKeyboard=false; //是否支持键盘隐藏显示
54724
+ this.OnChangeStatusCallback; //状态切换以后回调
54641
54725
 
54642
54726
 
54643
54727
  this.RightButton=
@@ -55816,6 +55900,29 @@ function ChartCorssCursor()
55816
55900
 
55817
55901
  this.Status=1;
55818
55902
  }
55903
+
55904
+ //data={ e:e, PreventDefault:false, KeyID, Draw:是否需要重绘 }
55905
+ this.OnKeyDown=function(data)
55906
+ {
55907
+ if (!this.EnableKeyboard) return;
55908
+
55909
+ var keyID=data.KeyID;
55910
+ if (keyID==27) //ESC 隐藏十字线
55911
+ {
55912
+ if (!this.IsShowCorss) return;
55913
+ this.IsShowCorss=false;
55914
+ data.Draw=true;
55915
+ if (this.OnChangeStatusCallback) this.OnChangeStatusCallback({ Type:1, IsShowCorss:this.IsShowCorss }, this);
55916
+ }
55917
+ else if (keyID==37 || keyID==39) //left, right 显示十字线
55918
+ {
55919
+ if (this.IsShowCorss) return;
55920
+ this.IsShowCorss=true;
55921
+ data.Draw=true;
55922
+ if (this.OnChangeStatusCallback) this.OnChangeStatusCallback({ Type:1, IsShowCorss:this.IsShowCorss }, this);
55923
+ }
55924
+ }
55925
+
55819
55926
  }
55820
55927
 
55821
55928
 
@@ -72866,6 +72973,18 @@ function JSChartResource()
72866
72973
  LineHeight:25 //单行高度
72867
72974
  };
72868
72975
 
72976
+ this.DialogTooltip=
72977
+ {
72978
+ BGColor:'rgb(250,250,250)', //背景色
72979
+ BorderColor:'rgb(20,20,20)', //边框颜色
72980
+ TitleColor:'rgb(0,0,0)', //标题颜色
72981
+ VolColor:"rgb(255, 185, 15)", //标题成交量
72982
+ AmountColor:"rgb(79, 79, 79)", //成交金额
72983
+ DateTimeColor:'rgb(60,60,60)',
72984
+ TurnoverRateColor:'rgb(43,54,69)', //换手率
72985
+ PositionColor:"rgb(43,54,69)" //持仓
72986
+ }
72987
+
72869
72988
  //弹幕
72870
72989
  this.Barrage= {
72871
72990
  Font:16*GetDevicePixelRatio() +'px 微软雅黑', //字体
@@ -73848,6 +73967,21 @@ function JSChartResource()
73848
73967
  if (item.AmountColor) this.PCTooltipPaint.AmountColor=item.AmountColor;
73849
73968
  }
73850
73969
 
73970
+ if (style.DialogTooltip)
73971
+ {
73972
+ var item=style.DialogTooltip;
73973
+ if (item.BGColor) this.DialogTooltip.BGColor=item.BGColor;
73974
+ if (item.BorderColor) this.DialogTooltip.BorderColor=item.BorderColor;
73975
+ if (item.TitleColor) this.DialogTooltip.TitleColor=item.TitleColor;
73976
+ if (item.DateTimeColor) this.DialogTooltip.DateTimeColor=item.DateTimeColor;
73977
+
73978
+ if (item.VolColor) this.DialogTooltip.VolColor=item.VolColor;
73979
+ if (item.AmountColor) this.DialogTooltip.AmountColor=item.AmountColor;
73980
+ if (item.TurnoverRateColor) this.DialogTooltip.TurnoverRateColor=item.TurnoverRateColor;
73981
+ if (item.PositionColor) this.DialogTooltip.PositionColor=item.PositionColor;
73982
+
73983
+ }
73984
+
73851
73985
  if (style.MinuteInfo)
73852
73986
  {
73853
73987
  var item=style.MinuteInfo;
@@ -74789,7 +74923,26 @@ function JSChartLocalization()
74789
74923
  ['DivTooltip-Amount', {CN:'金额:', EN:'Amount:', TC:'金額'}],
74790
74924
  ['DivTooltip-Exchange', {CN:'换手:', EN:'Exchange:', TC:'換手'}],
74791
74925
  ['DivTooltip-Position', {CN:'持仓:', EN:'Position:', TC:'持倉'}],
74792
- ['DivTooltip-Price', {CN:'价格:', EN:'Open:', TC:'價格'}],
74926
+ ['DivTooltip-Price', {CN:'价格:', EN:'Price:', TC:'價格'}],
74927
+
74928
+ ['DialogTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
74929
+ ['DialogTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
74930
+ ['DialogTooltip-Open', {CN:'开盘价', EN:'Open', TC:'開盤價'}],
74931
+ ['DialogTooltip-High', {CN:'最高价', EN:'High', TC:'最高價'}],
74932
+ ['DialogTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
74933
+ ['DialogTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
74934
+ ['DialogTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
74935
+ ['DialogTooltip-Risefall', {CN:'涨跌', EN:'Risefall', TC:'漲跌'}],
74936
+ ['DialogTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
74937
+ ['DialogTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
74938
+ ['DialogTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
74939
+ ['DialogTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
74940
+ ['DialogTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
74941
+ ['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'價格'}],
74942
+ ['DialogTooltip-AC-Price', {CN:'匹配价', EN:'Price', TC:'匹配價'}],
74943
+ ['DialogTooltip-AC-AvPrice', {CN:'匹配均价', EN:'AVPrice', TC:'匹配均價'}],
74944
+ ['DialogTooltip-AC-Increase', {CN:'竞价涨幅', EN:'Increase', TC:'競價漲幅'}],
74945
+ ['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
74793
74946
 
74794
74947
  //走势图PC tooltip
74795
74948
  ['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
@@ -76541,6 +76694,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76541
76694
  this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
76542
76695
  this.ChartCorssCursor.StringFormatY.ExtendChartPaint=this.ExtendChartPaint;
76543
76696
  this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
76697
+ this.ChartCorssCursor.OnChangeStatusCallback=(data, obj)=>{ this.OnChangeCorssCursorStatus(data,obj); }
76544
76698
 
76545
76699
  //创建等待提示
76546
76700
  this.ChartSplashPaint = new ChartSplashPaint();
@@ -83075,6 +83229,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83075
83229
 
83076
83230
  this.Draw();
83077
83231
  }
83232
+
83233
+ this.DrawTooltipDialog=function()
83234
+ {
83235
+ if (!this.DialogTooltip) return;
83236
+
83237
+ this.UpdateTooltipDialog();
83238
+ }
83239
+
83240
+ this.UpdateTooltipDialog=function()
83241
+ {
83242
+ if (!this.DialogTooltip) return false;
83243
+ if (!this.ChartCorssCursor) return false;
83244
+
83245
+ var kItem=null;
83246
+ if (this.ChartCorssCursor.ClientPos>=0)
83247
+ {
83248
+ var hisData=this.ChartOperator_Temp_GetHistroyData();;
83249
+ if (!hisData) return false; //数据还没有到达
83250
+
83251
+ var dataIndex=hisData.DataOffset+this.ChartCorssCursor.CursorIndex;
83252
+ var kItem=hisData.Data[dataIndex];
83253
+ }
83254
+
83255
+ var sendData=
83256
+ {
83257
+ ClientPos:this.ChartCorssCursor.ClientPos, //位置
83258
+ IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
83259
+ KItem:kItem,
83260
+ Symbol:this.Symbol, Name:this.Name,
83261
+ };
83262
+
83263
+
83264
+ this.DialogTooltip.Update(sendData);
83265
+
83266
+ return true;
83267
+ }
83078
83268
  }
83079
83269
 
83080
83270
  //API 返回数据 转化为array[]
@@ -84755,6 +84945,15 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84755
84945
  }
84756
84946
 
84757
84947
  var keyID = e.keyCode ? e.keyCode :e.which;
84948
+
84949
+ var draw=false;
84950
+ if (this.ChartCorssCursor && this.ChartCorssCursor.OnKeyDown) //十字光标 隐藏显示
84951
+ {
84952
+ var sendData={ e:e, KeyID:keyID, Draw:false, PreventDefault:false };
84953
+ this.ChartCorssCursor.OnKeyDown(sendData);
84954
+ draw=sendData.Draw;
84955
+ }
84956
+
84758
84957
  switch(keyID)
84759
84958
  {
84760
84959
  case 37: //left
@@ -84860,10 +85059,20 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84860
85059
  this.ChartOperator(option);
84861
85060
  }
84862
85061
  break;
85062
+ case 27:
85063
+ if (this.CurrentChartDrawPicture)
85064
+ {
85065
+ var drawPicture=this.CurrentChartDrawPicture;
85066
+ if (drawPicture.Status!=20) //画布移动的时候不能取消
85067
+ this.CurrentChartDrawPicture=null;
85068
+ }
85069
+ break;
84863
85070
  default:
84864
85071
  return;
84865
85072
  }
84866
85073
 
85074
+ if (draw) this.DrawDynamicInfo();
85075
+
84867
85076
  //不让滚动条滚动
84868
85077
  if(e.preventDefault) e.preventDefault();
84869
85078
  else e.returnValue = false;
@@ -88810,6 +89019,55 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88810
89019
 
88811
89020
  return null;
88812
89021
  }
89022
+
89023
+ this.DrawTooltipDialog=function()
89024
+ {
89025
+ if (!this.DialogTooltip) return;
89026
+
89027
+ this.UpdateTooltipDialog();
89028
+ }
89029
+
89030
+ this.UpdateTooltipDialog=function()
89031
+ {
89032
+ if (!this.DialogTooltip) return false;
89033
+ if (!this.ChartCorssCursor) return false;
89034
+
89035
+ var minuteItem=null; //{ Type:0=连续交易 1=集合竞价, Data:数据 }
89036
+ if (this.ChartCorssCursor.ClientPos>=0)
89037
+ {
89038
+ var titlePaint=this.TitlePaint[0];
89039
+ if (titlePaint && titlePaint.PointInfo)
89040
+ {
89041
+ var pointInfo=titlePaint.PointInfo;
89042
+ if ((pointInfo.ClientPos==2 || pointInfo.ClientPos==3 || (pointInfo.ClientPos>=200&& pointInfo.ClientPos<=299) || (pointInfo.ClientPos>=300&& pointInfo.ClientPos<=399)))
89043
+ {
89044
+ var auctionData=titlePaint.GetCurrentAuctionData();
89045
+ if (!auctionData) return;
89046
+ minuteItem={ Type:1, Data:auctionData };
89047
+ }
89048
+ else
89049
+ {
89050
+ var minuteData=titlePaint.GetCurrentKLineData();
89051
+ if (!minuteData) return;
89052
+ minuteItem={ Type:0, Data:minuteData };
89053
+ }
89054
+ }
89055
+
89056
+ }
89057
+
89058
+ var sendData=
89059
+ {
89060
+ ClientPos:this.ChartCorssCursor.ClientPos, //位置
89061
+ IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
89062
+ MinItem:minuteItem,
89063
+ Symbol:this.Symbol, Name:this.Name,
89064
+ };
89065
+
89066
+
89067
+ this.DialogTooltip.Update(sendData);
89068
+
89069
+ return true;
89070
+ }
88813
89071
  }
88814
89072
 
88815
89073
  //盘前数据
@@ -119990,6 +120248,7 @@ function ScriptIndex(name,script,args,option)
119990
120248
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
119991
120249
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
119992
120250
  if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
120251
+ if (IFrameSplitOperator.IsNumber(varItem.BarColorType)) chart.BarColorType=varItem.BarColorType;
119993
120252
  if (varItem.LineWidth)
119994
120253
  {
119995
120254
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -120001,9 +120260,21 @@ function ScriptIndex(name,script,args,option)
120001
120260
  chart.HistoryData=hisData;
120002
120261
  this.ReloadChartResource(hqChart,windowIndex,chart);
120003
120262
 
120004
- var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
120005
- hqChart.TitlePaint[titleIndex].Data[id]=titleData;
120006
- this.SetTitleData(titleData,chart);
120263
+ if (varItem.IsShowTitle===false) //NOTEXT 不绘制标题
120264
+ {
120265
+
120266
+ }
120267
+ else if (IFrameSplitOperator.IsString(varItem.Name) && varItem.Name.indexOf("NOTEXT")==0) //标题中包含NOTEXT不绘制标题
120268
+ {
120269
+
120270
+ }
120271
+ else
120272
+ {
120273
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
120274
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
120275
+ this.SetTitleData(titleData,chart);
120276
+ }
120277
+
120007
120278
  this.SetChartIndexName(chart);
120008
120279
  hqChart.ChartPaint.push(chart);
120009
120280
  }
@@ -121949,6 +122220,7 @@ function OverlayScriptIndex(name,script,args,option)
121949
122220
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
121950
122221
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
121951
122222
  if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
122223
+ if (IFrameSplitOperator.IsNumber(varItem.BarColorType)) chart.BarColorType=varItem.BarColorType;
121952
122224
  if (varItem.LineWidth)
121953
122225
  {
121954
122226
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -123377,6 +123649,8 @@ function APIScriptIndex(name,script,args,option, isOverlay)
123377
123649
  if (IFrameSplitOperator.IsBool(item.isDotLine)) outVarItem.IsDotLine = item.isDotLine;
123378
123650
  if (IFrameSplitOperator.IsNonEmptyArray(item.lineDash)) outVarItem.LineDash=item.lineDash;
123379
123651
  if (IFrameSplitOperator.IsBool(item.isSingleLine)) outVarItem.IsSingleLine=item.isSingleLine;
123652
+ if (IFrameSplitOperator.IsNumber(item.StickType)) outVarItem.StickType=item.StickType;
123653
+ if (IFrameSplitOperator.IsNumber(item.BarColorType)) outVarItem.BarColorType=item.BarColorType;
123380
123654
 
123381
123655
  result.push(outVarItem);
123382
123656
  }
@@ -125109,7 +125383,19 @@ function GetBlackStyle()
125109
125383
  VolColor:"rgb(161,154,3)", //标题成交量
125110
125384
  AmountColor:"rgb(161,154,3)", //成交金额
125111
125385
  },
125112
-
125386
+
125387
+ DialogTooltip:
125388
+ {
125389
+ BGColor:'rgb(20,20,20)', //背景色
125390
+ BorderColor:'rgb(170,170,170)', //边框颜色
125391
+ TitleColor:'rgb(210,210,210)', //标题颜色
125392
+ VolColor:"rgb(255, 185, 15)", //标题成交量
125393
+ AmountColor:"rgb(210,210,210)", //成交金额
125394
+ DateTimeColor:'rgb(210,210,210)',
125395
+ TurnoverRateColor:'rgb(43,54,69)', //换手率
125396
+ PositionColor:"rgb(43,54,69)" //持仓
125397
+ },
125398
+
125113
125399
  //走势图 信息地雷
125114
125400
  MinuteInfo:
125115
125401
  {
@@ -142942,7 +143228,577 @@ JSPopKeyboard.GetOption=function()
142942
143228
 
142943
143229
 
142944
143230
 
142945
- ///////////////////////////////////////////////////////////////////////////////////
143231
+ /*
143232
+ Copyright (c) 2018 jones
143233
+
143234
+ http://www.apache.org/licenses/LICENSE-2.0
143235
+
143236
+ 开源项目 https://github.com/jones2000/HQChart
143237
+
143238
+ jones_2000@163.com
143239
+
143240
+ 内置K线提示信息
143241
+ */
143242
+
143243
+
143244
+ function JSDialogTooltip()
143245
+ {
143246
+ this.DivDialog=null;
143247
+ this.DragTitle=null;
143248
+ this.TitleBox=null; //{ DivTitle, DivName, DivName }
143249
+
143250
+ this.HQChart=null;
143251
+
143252
+ this.UpColor=g_JSChartResource.UpTextColor;
143253
+ this.DownColor=g_JSChartResource.DownTextColor;
143254
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
143255
+
143256
+ this.TitleColor=g_JSChartResource.DialogTooltip.TitleColor;
143257
+ this.TitleBGColor=g_JSChartResource.DialogTooltip.TitleBGColor;
143258
+ this.BGColor=g_JSChartResource.DialogTooltip.BGColor;
143259
+ this.BorderColor=g_JSChartResource.DialogTooltip.BorderColor;
143260
+
143261
+ this.VolColor=g_JSChartResource.DialogTooltip.VolColor;
143262
+ this.AmountColor=g_JSChartResource.DialogTooltip.AmountColor;
143263
+ this.TurnoverRateColor=g_JSChartResource.DialogTooltip.TurnoverRateColor;
143264
+ this.PositionColor=g_JSChartResource.DialogTooltip.PositionColor;
143265
+ this.DateTimeColor=g_JSChartResource.DialogTooltip.DateTimeColor;
143266
+ this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
143267
+ this.MaxRowCount=10;
143268
+
143269
+ this.AryData=[];
143270
+ this.AryText=[];
143271
+
143272
+ this.KItemCache=null;
143273
+ this.KItemCacheID=null;
143274
+
143275
+ this.Inital=function(hqchart)
143276
+ {
143277
+ this.HQChart=hqchart;
143278
+ }
143279
+
143280
+ this.Destroy=function()
143281
+ {
143282
+ this.AryData=[];
143283
+ this.AryText=[];
143284
+ this.KItemCache=null;
143285
+ this.KItemCacheID=null;
143286
+
143287
+ if (this.DivDialog)
143288
+ {
143289
+ document.body.removeChild(this.DivDialog);
143290
+ this.DivDialog=null;
143291
+ }
143292
+ }
143293
+
143294
+ this.OnClickColseButton=function(e)
143295
+ {
143296
+ this.Close(e);
143297
+
143298
+ if (this.HQChart && this.HQChart.ChartCorssCursor)
143299
+ {
143300
+ var chart=this.HQChart.ChartCorssCursor;
143301
+ if (!chart.IsShowCorss) return;
143302
+
143303
+ chart.IsShowCorss=false;
143304
+ this.HQChart.Draw();
143305
+ this.HQChart.SetFocus();
143306
+ }
143307
+ }
143308
+
143309
+ this.Create=function()
143310
+ {
143311
+ var divDom=document.createElement("div");
143312
+ divDom.className='UMyChart_Tooltip_Dialog_Div';
143313
+
143314
+ var divTitle=document.createElement("div");
143315
+ divTitle.className='UMyChart_Tooltip_Title_Div';
143316
+ divTitle.onmousedown=(e)=>{ this.OnMouseDownTitle(e);}
143317
+
143318
+ var divName=document.createElement("div");
143319
+ divName.className='UMyChart_Tooltip_Name_Div';
143320
+ divName.innerText="----";
143321
+ divTitle.appendChild(divName);
143322
+
143323
+ var divClose=document.createElement("div");
143324
+ divClose.className='UMyChart_Tooltip_Close_Div';
143325
+ divClose.innerText="x";
143326
+ divClose.onmousedown=(e)=>{ this.OnClickColseButton(e); }
143327
+ divTitle.appendChild(divClose);
143328
+
143329
+ divDom.appendChild(divTitle);
143330
+
143331
+ var table=document.createElement("table");
143332
+ table.className="UMyChart_Tooltip_Table";
143333
+ divDom.appendChild(table);
143334
+
143335
+ var tbody=document.createElement("tbody");
143336
+ tbody.className="UMyChart_Tooltip_Tbody";
143337
+ table.appendChild(tbody);
143338
+
143339
+ this.AryData=[];
143340
+ for(var i=0;i<this.MaxRowCount;++i)
143341
+ {
143342
+ var rowItem={ Tr:null, TitleSpan:null, TextSpan:null };
143343
+
143344
+ var trDom=document.createElement("tr");
143345
+ trDom.className='UMyChart_Tooltip_Group_Tr';
143346
+ tbody.appendChild(trDom);
143347
+ rowItem.Tr=trDom;
143348
+
143349
+ var tdDom=document.createElement("td");
143350
+ tdDom.className="UMyChart_Tooltip_Title_Td"; //标题
143351
+ trDom.appendChild(tdDom);
143352
+
143353
+ var spanDom=document.createElement("span");
143354
+ spanDom.className='UMyChart_Tooltip_Title_Span';
143355
+ spanDom.innerText='标题';
143356
+ tdDom.appendChild(spanDom);
143357
+ rowItem.TitleSpan=spanDom;
143358
+
143359
+ var tdDom=document.createElement("td");
143360
+ tdDom.className="UMyChart_Tooltip_Text_Td"; //数值
143361
+ trDom.appendChild(tdDom);
143362
+
143363
+ var spanDom=document.createElement("span");
143364
+ spanDom.className='UMyChart_Tooltip_Text_Span';
143365
+ spanDom.innerText='数值';
143366
+ tdDom.appendChild(spanDom);
143367
+ rowItem.TextSpan=spanDom;
143368
+
143369
+ this.AryData.push(rowItem);
143370
+ }
143371
+
143372
+
143373
+ document.body.appendChild(divDom);
143374
+
143375
+ this.DivName=divName;
143376
+ this.DivDialog=divDom;
143377
+ this.TitleBox={ DivTitle:divTitle, DivName:divName, DivColor:divClose };
143378
+
143379
+ this.UpdateStyle();
143380
+ }
143381
+
143382
+ this.Update=function(data)
143383
+ {
143384
+ if (!this.DivDialog || !this.TitleBox) return;
143385
+ if ((!data.KItem && !data.MinItem) || !data.IsShowCorss || data.ClientPos<0) return;
143386
+
143387
+ this.LanguageID=this.HQChart.LanguageID;
143388
+
143389
+ if (this.HQChart.ClassName=='KLineChartContainer')
143390
+ {
143391
+ var strKItem=JSON.stringify(data.KItem);
143392
+ if (this.KItemCacheID!=strKItem) //数据变动的才更新
143393
+ {
143394
+ this.KItemCache= JSON.parse(strKItem);
143395
+ this.KItemCacheID=strKItem;
143396
+ this.UpdateTableDOM();
143397
+ }
143398
+ else
143399
+ {
143400
+ //JSConsole.Chart.Log(`[JSDialogTooltip::Update] save as KItemCache and KItem`);
143401
+ }
143402
+ }
143403
+ else if (this.HQChart.ClassName=='MinuteChartContainer')
143404
+ {
143405
+ var strKItem=JSON.stringify(data.MinItem);
143406
+ if (this.KItemCacheID!=strKItem) //数据变动的才更新
143407
+ {
143408
+ this.KItemCache= JSON.parse(strKItem);
143409
+ this.KItemCacheID=strKItem;
143410
+ this.UpdateTableDOM();
143411
+ }
143412
+ }
143413
+ else
143414
+ {
143415
+ return;
143416
+ }
143417
+
143418
+ this.TitleBox.DivName.innerText=data.Name;
143419
+
143420
+
143421
+ if (!this.IsShow()) this.Show();
143422
+ }
143423
+
143424
+ this.UpdateTableDOM=function()
143425
+ {
143426
+ if (!this.KItemCache) return;
143427
+
143428
+ if (this.HQChart.ClassName=='KLineChartContainer')
143429
+ this.AryText=this.GetFormatKlineTooltipText(this.KItemCache);
143430
+ else if (this.HQChart.ClassName=='MinuteChartContainer')
143431
+ this.AryText=this.GetFormatMinuteTooltipText(this.KItemCache);
143432
+ else
143433
+ return;
143434
+
143435
+ var index=0;
143436
+ for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
143437
+ {
143438
+ var outItem=this.AryText[index];
143439
+ var item=this.AryData[index];
143440
+
143441
+ item.TitleSpan.innerText=outItem.Title;
143442
+ item.TitleSpan.style.color=this.TitleColor;
143443
+ item.TextSpan.innerText=outItem.Text;
143444
+ item.TextSpan.style.color=outItem.Color;
143445
+ item.Tr.style.display="";
143446
+ }
143447
+
143448
+ for( ; index<this.MaxRowCount; ++index)
143449
+ {
143450
+ var item=this.AryData[index];
143451
+ item.Tr.style.display="none";
143452
+ }
143453
+ }
143454
+
143455
+ this.Close=function(e)
143456
+ {
143457
+ if (!this.DivDialog) return;
143458
+
143459
+ this.DivDialog.style.visibility='hidden';
143460
+ }
143461
+
143462
+ this.OnMouseDownTitle=function(e)
143463
+ {
143464
+ if (!this.DivDialog) return;
143465
+
143466
+ var dragData={ X:e.clientX, Y:e.clientY };
143467
+ dragData.YOffset=e.clientX - this.DivDialog.offsetLeft;
143468
+ dragData.XOffset=e.clientY - this.DivDialog.offsetTop;
143469
+ this.DragTitle=dragData;
143470
+
143471
+ document.onmousemove=(e)=>{ this.DocOnMouseMoveTitle(e); }
143472
+ document.onmouseup=(e)=>{ this.DocOnMouseUpTitle(e); }
143473
+ }
143474
+
143475
+ this.DocOnMouseMoveTitle=function(e)
143476
+ {
143477
+ if (!this.DragTitle) return;
143478
+
143479
+ var left = e.clientX - this.DragTitle.YOffset;
143480
+ var top = e.clientY - this.DragTitle.XOffset;
143481
+
143482
+ var right=left+this.DivDialog.offsetWidth;
143483
+ var bottom=top+ this.DivDialog.offsetHeight;
143484
+
143485
+ if ((right+5)>=window.innerWidth) left=window.innerWidth-this.DivDialog.offsetWidth-5;
143486
+ if ((bottom+5)>=window.innerHeight) top=window.innerHeight-this.DivDialog.offsetHeight-5;
143487
+
143488
+ this.DivDialog.style.left = left + 'px';
143489
+ this.DivDialog.style.top = top + 'px';
143490
+
143491
+ if(e.preventDefault) e.preventDefault();
143492
+ }
143493
+
143494
+ this.DocOnMouseUpTitle=function(e)
143495
+ {
143496
+ this.DragTitle=null;
143497
+ this.onmousemove = null;
143498
+ this.onmouseup = null;
143499
+ }
143500
+
143501
+ this.Show=function()
143502
+ {
143503
+ if (!this.DivDialog) return;
143504
+ if (!this.HQChart) return;
143505
+
143506
+ if (!this.DivDialog.style.top || !this.DivDialog.style.left) //上一次显示的位置
143507
+ {
143508
+ var top=this.HQChart.Frame.ChartBorder.GetTop();
143509
+ var left=this.HQChart.Frame.ChartBorder.GetLeft();
143510
+ var rtClient=this.HQChart.UIElement.getBoundingClientRect();
143511
+
143512
+ var x=left+rtClient.left+5;
143513
+ var y=top+rtClient.top+10;
143514
+ this.DivDialog.style.top = y + "px";
143515
+ this.DivDialog.style.left = x + "px";
143516
+ }
143517
+
143518
+ this.DivDialog.style.visibility='visible';
143519
+ }
143520
+
143521
+ this.IsShow=function()
143522
+ {
143523
+ if (!this.DivDialog) return false;
143524
+
143525
+ return this.DivDialog.style.visibility==='visible';
143526
+ }
143527
+
143528
+
143529
+ this.GetFormatKlineTooltipText=function(data)
143530
+ {
143531
+ var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143532
+
143533
+ //日期
143534
+ var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' );
143535
+
143536
+ //时间
143537
+ var timeItem=null;
143538
+ if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'DialogTooltip-Time');
143539
+
143540
+ var aryText=
143541
+ [
143542
+ this.ForamtPrice(data.Open,data.YClose, defaultfloatPrecision,'DialogTooltip-Open'),
143543
+ this.ForamtPrice(data.High,data.YClose, defaultfloatPrecision,'DialogTooltip-High'),
143544
+ this.ForamtPrice(data.Low,data.YClose, defaultfloatPrecision,'DialogTooltip-Low'),
143545
+ this.ForamtPrice(data.Close,data.YClose, defaultfloatPrecision,'DialogTooltip-Close'),
143546
+ this.FormatVol(data.Vol,'DialogTooltip-Vol' ),
143547
+ this.FormatAmount(data.Amount,'DialogTooltip-Amount' ),
143548
+ this.FormatIncrease(data.Close,data.YClose,'DialogTooltip-Increase'),
143549
+ this.FormatAmplitude(data.High,data.Low,data.YClose,'DialogTooltip-Amplitude'),
143550
+ ];
143551
+
143552
+ if (timeItem) aryText.unshift(timeItem);
143553
+ aryText.unshift(dateItem);
143554
+
143555
+ return aryText;
143556
+ },
143557
+
143558
+ this.GetFormatMinuteTooltipText=function(data)
143559
+ {
143560
+ var defaultfloatPrecision=GetfloatPrecision(this.HQChart.Symbol);//价格小数位数
143561
+
143562
+ if (data.Type==0) //连续交易
143563
+ {
143564
+ var item=data.Data;
143565
+ if (!item) item={ };
143566
+
143567
+ var aryText=
143568
+ [
143569
+ this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143570
+ this.FormatTime(item.Time, null, "HH:MM", 'DialogTooltip-Time'),
143571
+ this.ForamtPrice(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Price'),
143572
+ this.FormatRisefall(item.Close,item.YClose, defaultfloatPrecision,'DialogTooltip-Risefall'),
143573
+ this.FormatIncrease(item.Close,item.YClose,'DialogTooltip-Increase'),
143574
+ this.FormatVol(item.Vol,'DialogTooltip-Vol' ),
143575
+ this.FormatAmount(item.Amount,'DialogTooltip-Amount' ),
143576
+ ];
143577
+
143578
+ return aryText;
143579
+ }
143580
+ else if (data.Type==1) //集合竞价
143581
+ {
143582
+ var item=data.Data.Data;
143583
+ if (!item) item={ Vol:[] };
143584
+
143585
+ var timeForamt="HH:MM:SS";
143586
+ if (item.Ver===1) timeForamt="HH:MM"
143587
+ var aryText=
143588
+ [
143589
+ this.ForamtDate(item.Date,"YYYY/MM/DD/W",'DialogTooltip-Date' ),
143590
+ this.FormatTime(item.Time, null, timeForamt, 'DialogTooltip-Time'),
143591
+ this.ForamtPrice(item.Price,item.YClose, defaultfloatPrecision,'DialogTooltip-AC-Price'),
143592
+ this.FormatIncrease(item.Price,item.YClose,'DialogTooltip-AC-Increase'),
143593
+ this.FormatVol(item.Vol[0],'DialogTooltip-AC-Vol' ),
143594
+ ];
143595
+
143596
+ return aryText;
143597
+ }
143598
+
143599
+ return [];
143600
+ }
143601
+
143602
+ this.GetColor=function(price,yClose)
143603
+ {
143604
+ if(price>yClose) return this.UpColor;
143605
+ else if (price<yClose) return this.DownColor;
143606
+ else return this.UnchangeColor;
143607
+ }
143608
+
143609
+ this.GetPriceColor=function(price, yClose)
143610
+ {
143611
+ var color=this.GetColor(price, yClose);
143612
+ return color;
143613
+ }
143614
+
143615
+ //配色修改
143616
+ this.ReloadResource=function(option)
143617
+ {
143618
+ this.UpColor=g_JSChartResource.UpTextColor;
143619
+ this.DownColor=g_JSChartResource.DownTextColor;
143620
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
143621
+
143622
+ this.TitleColor=g_JSChartResource.DialogTooltip.TitleColor;
143623
+ this.TitleBGColor=g_JSChartResource.DialogTooltip.TitleBGColor;
143624
+ this.BGColor=g_JSChartResource.DialogTooltip.BGColor;
143625
+ this.BorderColor=g_JSChartResource.DialogTooltip.BorderColor;
143626
+
143627
+ this.VolColor=g_JSChartResource.DialogTooltip.VolColor;
143628
+ this.AmountColor=g_JSChartResource.DialogTooltip.AmountColor;
143629
+ this.TurnoverRateColor=g_JSChartResource.DialogTooltip.TurnoverRateColor;
143630
+ this.PositionColor=g_JSChartResource.DialogTooltip.PositionColor;
143631
+ this.DateTimeColor=g_JSChartResource.DialogTooltip.DateTimeColor;
143632
+
143633
+ if (!this.DivDialog) return;
143634
+
143635
+ this.UpdateStyle();
143636
+ }
143637
+
143638
+ this.UpdateStyle=function()
143639
+ {
143640
+ if (!this.DivDialog) return;
143641
+
143642
+ if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
143643
+ if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
143644
+
143645
+ if (this.TitleBGColor) this.TitleBox.DivTitle.style['background-color']=this.TitleBGColor;
143646
+
143647
+ this.UpdateTableDOM();
143648
+ },
143649
+
143650
+
143651
+ /////////////////////////////////////////////////////////////////////////////////////////////
143652
+ //数据格式化
143653
+ this.ForamtPrice=function(price, yClose, defaultfloatPrecision, TitleID)
143654
+ {
143655
+ var item=
143656
+ {
143657
+ Title:g_JSChartLocalization.GetText(TitleID, this.LanguageID),
143658
+ Text:"--.--",
143659
+ Color:this.TitleColor
143660
+ };
143661
+
143662
+ if (!IFrameSplitOperator.IsNumber(price)) return item;
143663
+
143664
+ item.Text=price.toFixed(defaultfloatPrecision);
143665
+ item.Color=this.GetColor(price, yClose);
143666
+
143667
+ return item;
143668
+ }
143669
+
143670
+ this.FormatVol=function(vol, TitleID)
143671
+ {
143672
+ var item=
143673
+ {
143674
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143675
+ Text:'--',
143676
+ Color:this.VolColor
143677
+ };
143678
+
143679
+ if (!IFrameSplitOperator.IsNumber(vol)) return item;
143680
+
143681
+ item.Text=IFrameSplitOperator.FormatValueString(vol,2,this.LanguageID);
143682
+
143683
+ return item;
143684
+ }
143685
+
143686
+ this.FormatAmount=function(amount, TitleID)
143687
+ {
143688
+ var item=
143689
+ {
143690
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143691
+ Text:'--',
143692
+ Color:this.AmountColor
143693
+ };
143694
+
143695
+ if (!IFrameSplitOperator.IsNumber(amount)) return item;
143696
+
143697
+ item.Text=IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
143698
+
143699
+ return item;
143700
+ }
143701
+
143702
+ this.FormatIncrease=function(price, yClose, TitleID)
143703
+ {
143704
+ //涨幅
143705
+ var item=
143706
+ {
143707
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143708
+ Text:"--.--",
143709
+ Color:this.TitleColor
143710
+ };
143711
+
143712
+ if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143713
+
143714
+ var value=(price-yClose)/yClose;
143715
+ item.Text=`${(value*100).toFixed(2)}%`;
143716
+ item.Color=this.GetColor(value,0);
143717
+
143718
+ return item;
143719
+ }
143720
+
143721
+ this.FormatRisefall=function(price, yClose, defaultfloatPrecision, TitleID)
143722
+ {
143723
+ //涨跌
143724
+ var item=
143725
+ {
143726
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143727
+ Text:"--.--",
143728
+ Color:this.TitleColor
143729
+ };
143730
+
143731
+ if (!IFrameSplitOperator.IsNumber(price) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143732
+
143733
+ var value=price-yClose;
143734
+ item.Text=`${value.toFixed(defaultfloatPrecision)}`;
143735
+ item.Color=this.GetColor(value,0);
143736
+
143737
+ return item;
143738
+ }
143739
+
143740
+ this.FormatAmplitude=function(high, low, yClose, TitleID)
143741
+ {
143742
+ //涨幅
143743
+ var item=
143744
+ {
143745
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143746
+ Text:"--.--",
143747
+ Color:this.TitleColor
143748
+ };
143749
+
143750
+
143751
+ if (!IFrameSplitOperator.IsNumber(high) || !IFrameSplitOperator.IsNumber(low) || !IFrameSplitOperator.IsNumber(yClose)) return item;
143752
+
143753
+ var value=(high-low)/yClose;
143754
+ item.Text=`${(value*100).toFixed(2)}%`;
143755
+ item.Color=this.GetColor(value,0);
143756
+
143757
+ return item;
143758
+ }
143759
+
143760
+ this.ForamtDate=function(date, format, TitleID)
143761
+ {
143762
+ //日期
143763
+ var item=
143764
+ {
143765
+ Title:g_JSChartLocalization.GetText('DialogTooltip-Date',this.LanguageID),
143766
+ Text:"----/--/--",
143767
+ Color:this.DateTimeColor
143768
+ }
143769
+
143770
+ if (!IFrameSplitOperator.IsNumber(date)) return item;
143771
+
143772
+ item.Text=IFrameSplitOperator.FormatDateString(date,format);
143773
+
143774
+ return item;
143775
+ }
143776
+
143777
+ this.FormatTime=function(time, period, format, TitleID)
143778
+ {
143779
+ //时间
143780
+ var item=
143781
+ {
143782
+ Title:g_JSChartLocalization.GetText(TitleID,this.LanguageID),
143783
+ Text:'--:--',
143784
+ Color:this.DateTimeColor
143785
+ };
143786
+
143787
+ if (!IFrameSplitOperator.IsNumber(time)) return item;
143788
+ if (!format)
143789
+ {
143790
+ format="HH:MM";
143791
+ if (ChartData.IsMinutePeriod(period,true)) timeFormat='HH:MM'; // 分钟周期
143792
+ else if (ChartData.IsSecondPeriod(period)) timeFormat='HH:MM:SS';
143793
+ else if (ChartData.IsMilliSecondPeriod(period)) timeFormat='HH:MM:SS.fff';
143794
+ }
143795
+
143796
+ item.Text=IFrameSplitOperator.FormatTimeString(time,format);
143797
+
143798
+ return item;
143799
+ }
143800
+
143801
+ }///////////////////////////////////////////////////////////////////////////////////
142946
143802
  // 工作线程计算指标示例
142947
143803
  //
142948
143804
  //
@@ -143063,7 +143919,7 @@ function HQChartScriptWorker()
143063
143919
 
143064
143920
 
143065
143921
 
143066
- var HQCHART_VERSION="1.1.13907";
143922
+ var HQCHART_VERSION="1.1.13914";
143067
143923
 
143068
143924
  function PrintHQChartVersion()
143069
143925
  {