hqchart 1.1.13905 → 1.1.13911

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.
@@ -4420,6 +4420,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4420
4420
 
4421
4421
  if (IFrameSplitOperator.IsNumber(item.PriceFormatType)) chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;
4422
4422
  if (IFrameSplitOperator.IsNumber(item.DataFormatType)) chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;
4423
+ if (IFrameSplitOperator.IsBool(item.EnableKeyboard)) chart.ChartCorssCursor.EnableKeyboard=item.EnableKeyboard;
4423
4424
 
4424
4425
  }
4425
4426
 
@@ -5643,6 +5644,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5643
5644
  if (option.EnableDrawToolDialogV2===true) chart.InitalDrawToolDialog();
5644
5645
  if (option.EnableModifyDrawDialogV2===true) chart.InitalModifyDrawDialog();
5645
5646
 
5647
+ //K线tooltip
5648
+ if (option.EnableTooltipDialog===true) chart.InitalTooltipDialog();
5649
+
5646
5650
  //注册事件
5647
5651
  if (option.EventCallback)
5648
5652
  {
@@ -6944,6 +6948,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6944
6948
  this.DialogDrawTool; //画图工具
6945
6949
  this.DialogModifyDraw; //画图修改
6946
6950
 
6951
+ this.DialogTooltip; //tooltip信息
6952
+
6947
6953
 
6948
6954
  this.ClearStockCache=function()
6949
6955
  {
@@ -6967,6 +6973,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6967
6973
  this.DialogDrawTool.Create();
6968
6974
  }
6969
6975
 
6976
+ this.InitalTooltipDialog=function()
6977
+ {
6978
+ if (this.DialogTooltip) return;
6979
+
6980
+ this.DialogTooltip=new JSDialogTooltip();
6981
+ this.DialogTooltip.Inital(this);
6982
+ this.DialogTooltip.Create();
6983
+ }
6984
+
6970
6985
  this.InitalModifyDrawDialog=function()
6971
6986
  {
6972
6987
  if ( this.DialogModifyDraw) return;
@@ -7023,6 +7038,22 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7023
7038
  this.DialogModifyDraw.Close();
7024
7039
  }
7025
7040
 
7041
+ this.IsShowTooltipDialog=function()
7042
+ {
7043
+ if (!this.DialogTooltip) return false;
7044
+
7045
+ return this.DialogTooltip.IsShow();
7046
+ }
7047
+
7048
+ this.CloseTooltipDialog=function()
7049
+ {
7050
+ if (!this.DialogTooltip) return;
7051
+
7052
+ this.DialogTooltip.Close();
7053
+ }
7054
+
7055
+
7056
+
7026
7057
  //obj={ Element:, Canvas: }
7027
7058
  this.SetCorssCursorElement=function(obj)
7028
7059
  {
@@ -9392,6 +9423,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9392
9423
  {
9393
9424
  this.ChartCorssCursor.Canvas=this.Canvas;
9394
9425
  }
9426
+
9427
+ this.DrawTooltipDialog();
9395
9428
  }
9396
9429
 
9397
9430
  ptPosition=this.Frame.PtInFrame(this.LastPoint.X, this.LastPoint.Y);
@@ -9841,6 +9874,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9841
9874
  {
9842
9875
  this.ChartCorssCursor.Canvas=this.Canvas;
9843
9876
  }
9877
+
9878
+ this.DrawTooltipDialog();
9844
9879
  }
9845
9880
 
9846
9881
  var ptPosition=null; //鼠标位置 null 无效 -1 在外面 >=0 对应的指标窗口中ID
@@ -10363,6 +10398,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10363
10398
  }
10364
10399
 
10365
10400
  var keyID = e.keyCode ? e.keyCode :e.which;
10401
+
10402
+ var draw=false;
10403
+ if (this.ChartCorssCursor && this.ChartCorssCursor.OnKeyDown) //十字光标 隐藏显示
10404
+ {
10405
+ var sendData={ e:e, KeyID:keyID, Draw:false, PreventDefault:false };
10406
+ this.ChartCorssCursor.OnKeyDown(sendData);
10407
+ draw=sendData.Draw;
10408
+ }
10409
+
10366
10410
  switch(keyID)
10367
10411
  {
10368
10412
  case 37: //left
@@ -10505,6 +10549,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10505
10549
  return;
10506
10550
  }
10507
10551
 
10552
+ if (draw) this.DrawDynamicInfo();
10553
+
10508
10554
  //不让滚动条滚动
10509
10555
  if(e.preventDefault) e.preventDefault();
10510
10556
  else e.returnValue = false;
@@ -10812,6 +10858,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10812
10858
  this.ShowTooltip(this.LastPoint.X/pixelTatio,this.LastPoint.Y/pixelTatio,toolTip);
10813
10859
  }
10814
10860
 
10861
+ this.DrawTooltipDialog=function()
10862
+ {
10863
+
10864
+ }
10865
+
10815
10866
  this.ShowTooltip=function(x,y,toolTip)
10816
10867
  {
10817
10868
  if (!this.IsShowTooltip) return;
@@ -11921,6 +11972,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11921
11972
  else if (option.Draw==true) this.Draw(); //是否立即重绘
11922
11973
 
11923
11974
  if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
11975
+ if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
11924
11976
  }
11925
11977
 
11926
11978
  this.ReloadBorder=function(option) //根据页面缩放调整对应边框的尺长
@@ -13910,6 +13962,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13910
13962
  item.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
13911
13963
  }
13912
13964
  }
13965
+
13966
+ //十字光标状态变动
13967
+ this.OnChangeCorssCursorStatus=function(data, obj)
13968
+ {
13969
+ if (data.Type==1)
13970
+ {
13971
+ if (!data.IsShowCorss) //十字光标隐藏
13972
+ {
13973
+ this.HideTooltip();
13974
+ this.CloseTooltipDialog();
13975
+ }
13976
+ }
13977
+ }
13913
13978
  }
13914
13979
 
13915
13980
  function GetDevicePixelRatio()
@@ -17420,6 +17485,20 @@ function MinuteFrame()
17420
17485
 
17421
17486
  this.NightDayConfig=CloneData(g_JSChartResource.Minute.NightDay);
17422
17487
 
17488
+
17489
+ this.MinuteFrame_ReloadResource=this.ReloadResource;
17490
+
17491
+
17492
+ this.ReloadResource=function(resource)
17493
+ {
17494
+ this.MinuteFrame_ReloadResource(resource);
17495
+
17496
+ //集合竞价配色修改
17497
+ this.BeforeBGColor=g_JSChartResource.Minute.Before.BGColor;
17498
+ this.AfterBGColor=g_JSChartResource.Minute.After.BGColor;
17499
+ this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;
17500
+ }
17501
+
17423
17502
  this.DrawFrame=function()
17424
17503
  {
17425
17504
  if (!this.IsMinSize)
@@ -46908,6 +46987,22 @@ function MinuteLeftTooltipPaint()
46908
46987
  if (IFrameSplitOperator.IsNumber(option.FixedWidth)) this.FixedWidth=option.FixedWidth;
46909
46988
  }
46910
46989
 
46990
+ this.ReloadResource=function(resource)
46991
+ {
46992
+ this.BorderColor=g_JSChartResource.PCTooltipPaint.BorderColor; //边框颜色
46993
+ this.BGColor=g_JSChartResource.PCTooltipPaint.BGColor; //背景色
46994
+ this.TitleColor=g_JSChartResource.PCTooltipPaint.TitleColor; //标题颜色
46995
+ this.DateTimeColor=g_JSChartResource.PCTooltipPaint.DateTimeColor; //日期时间颜色
46996
+ this.VolColor=g_JSChartResource.PCTooltipPaint.VolColor; //标题成交量
46997
+ this.AmountColor=g_JSChartResource.PCTooltipPaint.AmountColor; //成交金额
46998
+
46999
+ this.UpColor=g_JSChartResource.UpTextColor;
47000
+ this.DownColor=g_JSChartResource.DownTextColor;
47001
+ this.UnchagneColor=g_JSChartResource.UnchagneTextColor;
47002
+
47003
+ this.Font=g_JSChartResource.PCTooltipPaint.TitleFont;
47004
+ }
47005
+
46911
47006
  this.IsEnableDraw=function()
46912
47007
  {
46913
47008
  if (!this.HQChart || !this.HQChart.TitlePaint || !this.HQChart.TitlePaint[0]) return false;
@@ -54564,6 +54659,9 @@ function ChartCorssCursor()
54564
54659
  this.IsShowClose=false; //Y轴始终显示收盘价
54565
54660
  this.ClientPos=-1;
54566
54661
  this.CallAcutionXOperator;
54662
+
54663
+ this.EnableKeyboard=false; //是否支持键盘隐藏显示
54664
+ this.OnChangeStatusCallback; //状态切换以后回调
54567
54665
 
54568
54666
 
54569
54667
  this.RightButton=
@@ -55742,6 +55840,29 @@ function ChartCorssCursor()
55742
55840
 
55743
55841
  this.Status=1;
55744
55842
  }
55843
+
55844
+ //data={ e:e, PreventDefault:false, KeyID, Draw:是否需要重绘 }
55845
+ this.OnKeyDown=function(data)
55846
+ {
55847
+ if (!this.EnableKeyboard) return;
55848
+
55849
+ var keyID=data.KeyID;
55850
+ if (keyID==27) //ESC 隐藏十字线
55851
+ {
55852
+ if (!this.IsShowCorss) return;
55853
+ this.IsShowCorss=false;
55854
+ data.Draw=true;
55855
+ if (this.OnChangeStatusCallback) this.OnChangeStatusCallback({ Type:1, IsShowCorss:this.IsShowCorss }, this);
55856
+ }
55857
+ else if (keyID==37 || keyID==39) //left, right 显示十字线
55858
+ {
55859
+ if (this.IsShowCorss) return;
55860
+ this.IsShowCorss=true;
55861
+ data.Draw=true;
55862
+ if (this.OnChangeStatusCallback) this.OnChangeStatusCallback({ Type:1, IsShowCorss:this.IsShowCorss }, this);
55863
+ }
55864
+ }
55865
+
55745
55866
  }
55746
55867
 
55747
55868
 
@@ -72792,6 +72913,18 @@ function JSChartResource()
72792
72913
  LineHeight:25 //单行高度
72793
72914
  };
72794
72915
 
72916
+ this.DialogTooltip=
72917
+ {
72918
+ BGColor:'rgb(250,250,250)', //背景色
72919
+ BorderColor:'rgb(20,20,20)', //边框颜色
72920
+ TitleColor:'rgb(0,0,0)', //标题颜色
72921
+ VolColor:"rgb(255, 185, 15)", //标题成交量
72922
+ AmountColor:"rgb(79, 79, 79)", //成交金额
72923
+ DateTimeColor:'rgb(60,60,60)',
72924
+ TurnoverRateColor:'rgb(43,54,69)', //换手率
72925
+ PositionColor:"rgb(43,54,69)" //持仓
72926
+ }
72927
+
72795
72928
  //弹幕
72796
72929
  this.Barrage= {
72797
72930
  Font:16*GetDevicePixelRatio() +'px 微软雅黑', //字体
@@ -73774,6 +73907,21 @@ function JSChartResource()
73774
73907
  if (item.AmountColor) this.PCTooltipPaint.AmountColor=item.AmountColor;
73775
73908
  }
73776
73909
 
73910
+ if (style.DialogTooltip)
73911
+ {
73912
+ var item=style.DialogTooltip;
73913
+ if (item.BGColor) this.DialogTooltip.BGColor=item.BGColor;
73914
+ if (item.BorderColor) this.DialogTooltip.BorderColor=item.BorderColor;
73915
+ if (item.TitleColor) this.DialogTooltip.TitleColor=item.TitleColor;
73916
+ if (item.DateTimeColor) this.DialogTooltip.DateTimeColor=item.DateTimeColor;
73917
+
73918
+ if (item.VolColor) this.DialogTooltip.VolColor=item.VolColor;
73919
+ if (item.AmountColor) this.DialogTooltip.AmountColor=item.AmountColor;
73920
+ if (item.TurnoverRateColor) this.DialogTooltip.TurnoverRateColor=item.TurnoverRateColor;
73921
+ if (item.PositionColor) this.DialogTooltip.PositionColor=item.PositionColor;
73922
+
73923
+ }
73924
+
73777
73925
  if (style.MinuteInfo)
73778
73926
  {
73779
73927
  var item=style.MinuteInfo;
@@ -74717,6 +74865,20 @@ function JSChartLocalization()
74717
74865
  ['DivTooltip-Position', {CN:'持仓:', EN:'Position:', TC:'持倉'}],
74718
74866
  ['DivTooltip-Price', {CN:'价格:', EN:'Open:', TC:'價格'}],
74719
74867
 
74868
+ ['DialogTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
74869
+ ['DialogTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
74870
+ ['DialogTooltip-Open', {CN:'开盘价', EN:'Open', TC:'開盤價'}],
74871
+ ['DialogTooltip-High', {CN:'最高价', EN:'High', TC:'最高價'}],
74872
+ ['DialogTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
74873
+ ['DialogTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
74874
+ ['DialogTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
74875
+ ['DialogTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
74876
+ ['DialogTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
74877
+ ['DialogTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
74878
+ ['DialogTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
74879
+ ['DialogTooltip-Price', {CN:'价格', EN:'Open', TC:'價格'}],
74880
+ ['DialogTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'價格'}],
74881
+
74720
74882
  //走势图PC tooltip
74721
74883
  ['PCTooltip-Date', {CN:'日期', EN:'Date', TC:"日期"}],
74722
74884
  ['PCTooltip-Time', {CN:'时间', EN:'Time', TC:"時間"}],
@@ -76467,6 +76629,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76467
76629
  this.ChartCorssCursor.StringFormatY.LanguageID=this.LanguageID;
76468
76630
  this.ChartCorssCursor.StringFormatY.ExtendChartPaint=this.ExtendChartPaint;
76469
76631
  this.ChartCorssCursor.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
76632
+ this.ChartCorssCursor.OnChangeStatusCallback=(data, obj)=>{ this.OnChangeCorssCursorStatus(data,obj); }
76470
76633
 
76471
76634
  //创建等待提示
76472
76635
  this.ChartSplashPaint = new ChartSplashPaint();
@@ -83001,6 +83164,42 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83001
83164
 
83002
83165
  this.Draw();
83003
83166
  }
83167
+
83168
+ this.DrawTooltipDialog=function()
83169
+ {
83170
+ if (!this.DialogTooltip) return;
83171
+
83172
+ this.UpdateTooltipDialog();
83173
+ }
83174
+
83175
+ this.UpdateTooltipDialog=function()
83176
+ {
83177
+ if (!this.DialogTooltip) return false;
83178
+ if (!this.ChartCorssCursor) return false;
83179
+
83180
+ var kItem=null;
83181
+ if (this.ChartCorssCursor.ClientPos>=0)
83182
+ {
83183
+ var hisData=this.ChartOperator_Temp_GetHistroyData();;
83184
+ if (!hisData) return false; //数据还没有到达
83185
+
83186
+ var dataIndex=hisData.DataOffset+this.ChartCorssCursor.CursorIndex;
83187
+ var kItem=hisData.Data[dataIndex];
83188
+ }
83189
+
83190
+ var sendData=
83191
+ {
83192
+ ClientPos:this.ChartCorssCursor.ClientPos, //位置
83193
+ IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
83194
+ KItem:kItem,
83195
+ Symbol:this.Symbol, Name:this.Name,
83196
+ };
83197
+
83198
+
83199
+ this.DialogTooltip.Update(sendData);
83200
+
83201
+ return true;
83202
+ }
83004
83203
  }
83005
83204
 
83006
83205
  //API 返回数据 转化为array[]
@@ -84681,6 +84880,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84681
84880
  }
84682
84881
 
84683
84882
  var keyID = e.keyCode ? e.keyCode :e.which;
84883
+
84684
84884
  switch(keyID)
84685
84885
  {
84686
84886
  case 37: //left
@@ -125035,7 +125235,19 @@ function GetBlackStyle()
125035
125235
  VolColor:"rgb(161,154,3)", //标题成交量
125036
125236
  AmountColor:"rgb(161,154,3)", //成交金额
125037
125237
  },
125038
-
125238
+
125239
+ DialogTooltip:
125240
+ {
125241
+ BGColor:'rgb(20,20,20)', //背景色
125242
+ BorderColor:'rgb(170,170,170)', //边框颜色
125243
+ TitleColor:'rgb(210,210,210)', //标题颜色
125244
+ VolColor:"rgb(255, 185, 15)", //标题成交量
125245
+ AmountColor:"rgb(210,210,210)", //成交金额
125246
+ DateTimeColor:'rgb(210,210,210)',
125247
+ TurnoverRateColor:'rgb(43,54,69)', //换手率
125248
+ PositionColor:"rgb(43,54,69)" //持仓
125249
+ },
125250
+
125039
125251
  //走势图 信息地雷
125040
125252
  MinuteInfo:
125041
125253
  {
@@ -138477,7 +138689,7 @@ function ScrollBarBGChart()
138477
138689
 
138478
138690
 
138479
138691
 
138480
- var HQCHART_VERSION="1.1.13904";
138692
+ var HQCHART_VERSION="1.1.13910";
138481
138693
 
138482
138694
  function PrintHQChartVersion()
138483
138695
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13904";
8
+ var HQCHART_VERSION="1.1.13910";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {