hqchart 1.1.14045 → 1.1.14056

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.
@@ -5647,6 +5647,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5647
5647
  if (option.TooltipDialog && option.TooltipDialog.Enable)
5648
5648
  chart.InitalTooltipDialog(option.TooltipDialog);
5649
5649
 
5650
+ if (option.FloatTooltip && option.FloatTooltip.Enable)
5651
+ chart.InitalFloatTooltip(option.FloatTooltip);
5652
+
5650
5653
  if (option.SelectRectDialog && option.SelectRectDialog.Enable)
5651
5654
  {
5652
5655
  chart.InitalSelectRectDialog(option.SelectRectDialog);
@@ -6558,9 +6561,11 @@ var JSCHART_EVENT_ID=
6558
6561
  ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
6559
6562
  ON_CLICK_HORIZONTAL_LABEL:158, //点击Y轴刻度标签
6560
6563
 
6561
- ON_FORMAT_DIALOG_TOOLTIP_TEXT:159, //格式化Tooltip对话框显示文字
6564
+ ON_FORMAT_DIALOG_TOOLTIP:159, //格式化Tooltip对话框显示文字
6565
+
6566
+ ON_CHANGE_KLINE_RIGHT:160, //切换复权
6562
6567
 
6563
- ON_CHANGE_KLINE_RIGHT:160, //切换复权
6568
+ ON_FORMAT_KLINE_FLOAT_TOOLTIP:161, //格式化k线浮动框显示文字
6564
6569
  }
6565
6570
 
6566
6571
  var JSCHART_OPERATOR_ID=
@@ -6964,6 +6969,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6964
6969
 
6965
6970
  this.DialogTooltip; //tooltip信息
6966
6971
  this.DialogSelectRect; //区间统计
6972
+ this.FloatTooltip; //浮动tooltip信息
6967
6973
 
6968
6974
 
6969
6975
  this.ClearStockCache=function()
@@ -6997,6 +7003,15 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6997
7003
  this.DialogTooltip.Create();
6998
7004
  }
6999
7005
 
7006
+ this.InitalFloatTooltip=function(option)
7007
+ {
7008
+ if (this.FloatTooltip) return;
7009
+
7010
+ this.FloatTooltip=new JSFloatTooltip();
7011
+ this.FloatTooltip.Inital(this, option);
7012
+ this.FloatTooltip.Create();
7013
+ }
7014
+
7000
7015
  this.InitalModifyDrawDialog=function()
7001
7016
  {
7002
7017
  if ( this.DialogModifyDraw) return;
@@ -7015,6 +7030,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7015
7030
  this.DialogSelectRect.Create();
7016
7031
  }
7017
7032
 
7033
+
7034
+
7018
7035
  this.DrawSelectRectDialog=function()
7019
7036
  {
7020
7037
 
@@ -7088,6 +7105,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7088
7105
  this.DialogTooltip.Close();
7089
7106
  }
7090
7107
 
7108
+ this.HideFloatTooltip=function()
7109
+ {
7110
+ if (!this.FloatTooltip) return;
7111
+
7112
+ this.FloatTooltip.Hide();
7113
+ }
7114
+
7091
7115
  this.DestroyTooltipDialog=function()
7092
7116
  {
7093
7117
  if (!this.DialogTooltip) return;
@@ -7096,6 +7120,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7096
7120
  this.DialogTooltip=null;
7097
7121
  }
7098
7122
 
7123
+ this.DestroyFloatTooltip=function()
7124
+ {
7125
+ if (!this.FloatTooltip) return;
7126
+
7127
+ this.FloatTooltip.Destroy();
7128
+ this.FloatTooltip=null;
7129
+ }
7130
+
7099
7131
 
7100
7132
 
7101
7133
  //obj={ Element:, Canvas: }
@@ -7148,6 +7180,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7148
7180
  this.IsDestroy=true;
7149
7181
  this.StopAutoUpdate();
7150
7182
  this.DestroyTooltipDialog();
7183
+ this.DestroyFloatTooltip();
7151
7184
  }
7152
7185
 
7153
7186
  this.ChartDestory=this.ChartDestroy; //老版本写错了,需要兼容下
@@ -10919,6 +10952,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10919
10952
 
10920
10953
  }
10921
10954
 
10955
+ this.DrawFloatTooltip=function(point,toolTip)
10956
+ {
10957
+
10958
+ }
10959
+
10960
+ //更新实时行情到浮动tooltip
10961
+ this.UpdateHQFloatTooltip=function(item)
10962
+ {
10963
+
10964
+ }
10965
+
10922
10966
  this.ShowTooltip=function(x,y,toolTip)
10923
10967
  {
10924
10968
  if (!this.IsShowTooltip) return;
@@ -10930,11 +10974,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10930
10974
  this.TooltipCache.Data=null;
10931
10975
  this.TooltipCache.X=x;
10932
10976
  this.TooltipCache.Y=y;
10933
-
10977
+ var bHideFloatToolip=true;
10934
10978
  if (toolTip.Type===0) //K线信息
10935
10979
  {
10936
10980
  if (!this.KLineTooltipConfig.Enable) return;
10937
10981
 
10982
+ if (this.FloatTooltip)
10983
+ {
10984
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
10985
+ bHideFloatToolip=false;
10986
+ return;
10987
+ }
10988
+
10938
10989
  var scrollPos=GetScrollPosition();
10939
10990
  var left = x;
10940
10991
  var top = y;
@@ -10974,6 +11025,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10974
11025
  }
10975
11026
  else if (toolTip.Type===1) //信息地雷提示信息
10976
11027
  {
11028
+ if (this.FloatTooltip)
11029
+ {
11030
+ this.DrawFloatTooltip({X:x, Y:y, YMove:20/pixelTatio}, toolTip);
11031
+ bHideFloatToolip=false;
11032
+ return;
11033
+ }
11034
+
10977
11035
  var scrollPos=GetScrollPosition();
10978
11036
  var left = x;
10979
11037
  var top = y;
@@ -11128,6 +11186,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11128
11186
  this.Tooltip.innerHTML=format.Text;
11129
11187
  this.Tooltip.style.display = "block";
11130
11188
  }
11189
+
11190
+
11191
+ if (bHideFloatToolip) this.HideFloatTooltip();
11131
11192
  }
11132
11193
 
11133
11194
  this.UpdateDOMTooltip=function(toolTipType, data)
@@ -11164,6 +11225,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11164
11225
  this.TooltipCache.Data=null;
11165
11226
 
11166
11227
  if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
11228
+
11229
+ this.HideFloatTooltip();
11167
11230
  }
11168
11231
 
11169
11232
  this.UpdateSelectRect=function(start,end)
@@ -12029,6 +12092,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12029
12092
 
12030
12093
  if (this.PopMinuteChart) this.PopMinuteChart.ReloadResource(option);
12031
12094
  if (this.DialogTooltip) this.DialogTooltip.ReloadResource(option);
12095
+ if (this.FloatTooltip) this.FloatTooltip.ReloadResource(option);
12032
12096
  if (this.DialogSelectRect) this.DialogSelectRect.ReloadResource(option);
12033
12097
  }
12034
12098
 
@@ -14371,6 +14435,8 @@ function CoordinateInfo()
14371
14435
  this.ExtendData; //扩展属性
14372
14436
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
14373
14437
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
14438
+ //输出位置的Y轴偏移
14439
+ //this.YOffset;
14374
14440
  this.AreaData; //区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
14375
14441
 
14376
14442
  //不在当前屏范围 (可定义刻度使用)
@@ -17402,7 +17468,7 @@ function AverageWidthFrame()
17402
17468
  this.Canvas.lineWidth=pixelRatio;
17403
17469
  }
17404
17470
  }
17405
- else if (lineType==2) //绘制短线
17471
+ else if (lineType==3) //绘制短线
17406
17472
  {
17407
17473
  var lineWidth=10*GetDevicePixelRatio();
17408
17474
  this.Canvas.strokeStyle=color;
@@ -73201,8 +73267,20 @@ function JSChartResource()
73201
73267
 
73202
73268
  TextColor:"rgb(0,0,0)", //数值名称
73203
73269
  ValueColor:"rgb(0,0,0)", //数值
73270
+ };
73204
73271
 
73205
-
73272
+ this.FloatTooltip=
73273
+ {
73274
+ BGColor:'rgb(250,250,250)', //背景色
73275
+ BorderColor:'rgb(20,20,20)', //边框颜色
73276
+ VolColor:"rgb(255, 185, 15)", //标题成交量
73277
+ AmountColor:"rgb(79, 79, 79)", //成交金额
73278
+ DateTimeColor:'rgb(60,60,60)',
73279
+ TurnoverRateColor:'rgb(43,54,69)', //换手率
73280
+ PositionColor:"rgb(255,0,255)", //持仓
73281
+
73282
+ TextColor:"rgb(0,0,0)", //数值名称
73283
+ ValueColor:"rgb(0,0,0)", //数值
73206
73284
  };
73207
73285
 
73208
73286
  //区间统计
@@ -74251,6 +74329,22 @@ function JSChartResource()
74251
74329
  if (item.ValueColor) this.DialogTooltip.ValueColor=item.ValueColor;
74252
74330
  }
74253
74331
 
74332
+ if (style.FloatTooltip)
74333
+ {
74334
+ var item=style.FloatTooltip;
74335
+ if (item.BGColor) this.FloatTooltip.BGColor=item.BGColor;
74336
+ if (item.BorderColor) this.FloatTooltip.BorderColor=item.BorderColor;
74337
+
74338
+ if (item.DateTimeColor) this.FloatTooltip.DateTimeColor=item.DateTimeColor;
74339
+ if (item.VolColor) this.FloatTooltip.VolColor=item.VolColor;
74340
+ if (item.AmountColor) this.FloatTooltip.AmountColor=item.AmountColor;
74341
+ if (item.TurnoverRateColor) this.FloatTooltip.TurnoverRateColor=item.TurnoverRateColor;
74342
+ if (item.PositionColor) this.FloatTooltip.PositionColor=item.PositionColor;
74343
+
74344
+ if (item.TextColor) this.FloatTooltip.TextColor=item.TextColor;
74345
+ if (item.ValueColor) this.FloatTooltip.ValueColor=item.ValueColor;
74346
+ }
74347
+
74254
74348
  if (style.DialogSelectRect)
74255
74349
  {
74256
74350
  var item=style.DialogSelectRect;
@@ -75353,7 +75447,26 @@ function JSChartLocalization()
75353
75447
  ['DialogTooltip-AC-Vol', {CN:'匹配量', EN:'Vol', TC:'匹配量'}],
75354
75448
  ['DialogTooltip-Value', {CN:'数值', EN:'Value', TC:'数值'}],
75355
75449
 
75450
+ ['FloatTooltip-Date', {CN:'日期', EN:'Date', TC:'日期'}],
75451
+ ['FloatTooltip-Time', {CN:'时间', EN:'Time', TC:'時間'}],
75452
+ ['FloatTooltip-Open', {CN:'开盘价', EN:'Open', TC:'開盤價'}],
75453
+ ['FloatTooltip-High', {CN:'最高价', EN:'High', TC:'最高價'}],
75454
+ ['FloatTooltip-Low', {CN:'最低价', EN:'Low', TC:'最低價'}],
75455
+ ['FloatTooltip-Close', {CN:'收盘价', EN:'Close', TC:'收盤價'}],
75456
+ ['FloatTooltip-YClose', {CN:'昨收价', EN:'YClose', TC:'昨收價'}],
75457
+ ['FloatTooltip-Increase', {CN:'涨幅', EN:'Increase', TC:'漲幅'}],
75458
+ ['FloatTooltip-Risefall', {CN:'涨跌', EN:'Risefall', TC:'漲跌'}],
75459
+ ['FloatTooltip-Vol', {CN:'成交量', EN:'Volume', TC:'數量'}],
75460
+ ['FloatTooltip-Amount', {CN:'成交额', EN:'Amount', TC:'金額'}],
75461
+ ['FloatTooltip-Exchange', {CN:'换手率', EN:'Exchange', TC:'換手'}],
75462
+ ['FloatTooltip-Position', {CN:'持仓量', EN:'Position', TC:'持倉'}],
75463
+ ['FloatTooltip-Price', {CN:'价格', EN:'Price', TC:'價格'}],
75464
+ ['FloatTooltip-AvPrice', {CN:'均价', EN:'AVPrice:', TC:'均價'}],
75465
+ ['FloatTooltip-FClose', {CN:"结算价", EN:'Settlement', TC:'結算價'}],
75466
+ ['FloatTooltip-YSettlePrice', {CN:"昨结算", EN:'YSettlement', TC:'昨結算'}],
75467
+ ['FloatTooltip-Amplitude', {CN:'振幅', EN:'amplitude', TC:'振幅'}],
75356
75468
 
75469
+
75357
75470
  ['DialogSelectRect-StartPrice', {CN:'起始价:', EN:'Start Price:', TC:'起始價'}],
75358
75471
  ['DialogSelectRect-EndPrice', {CN:'最终价:', EN:"End Price:", TC:'最终價'}],
75359
75472
  ['DialogSelectRect-High', {CN:'最高价:', EN:'High:', TC:'最高價'}],
@@ -78828,6 +78941,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
78828
78941
 
78829
78942
  this.SendKLineUpdateEvent(bindData);
78830
78943
  this.UpdateDOMTooltip(0, bindData);
78944
+ this.UpdateHQFloatTooltip(bindData);
78831
78945
 
78832
78946
  //叠加指标计算
78833
78947
  this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
@@ -79086,6 +79200,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
79086
79200
 
79087
79201
  this.SendKLineUpdateEvent(bindData);
79088
79202
  this.UpdateDOMTooltip(0, bindData);
79203
+ this.UpdateHQFloatTooltip(bindData);
79089
79204
 
79090
79205
  //更新叠加指标
79091
79206
  this.BindAllOverlayIndexData(bindData, { CheckRunCount:true,SyncExecute:false }); //异步模式叠加指标
@@ -83621,18 +83736,34 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83621
83736
  if (!this.DialogTooltip) return false;
83622
83737
  if (!this.ChartCorssCursor) return false;
83623
83738
 
83739
+ var dataType=0;
83624
83740
  var kItem=null;
83625
83741
  if (this.ChartCorssCursor.ClientPos>=0)
83626
83742
  {
83627
83743
  var hisData=this.ChartOperator_Temp_GetHistroyData();;
83628
83744
  if (!hisData) return false; //数据还没有到达
83745
+ if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return false;
83629
83746
 
83630
83747
  var dataIndex=hisData.DataOffset+this.ChartCorssCursor.CursorIndex;
83748
+ if (dataIndex>=hisData.Data.length) dataIndex=hisData.Data.length-1;
83631
83749
  var kItem=hisData.Data[dataIndex];
83632
83750
  }
83751
+ else //取最后一个数据
83752
+ {
83753
+ var hisData=this.ChartOperator_Temp_GetHistroyData();;
83754
+ if (!hisData) return false; //数据还没有到达
83755
+ if (!IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return false;
83756
+ var kItem=hisData.Data[hisData.Data.length-1];
83757
+ var dataID={ Symbol:this.Symbol, Date:kItem.Date };
83758
+ if (IFrameSplitOperator.IsNumber(kItem.Time)) dataID.Time=kItem.Time;
83759
+ if (!this.DialogTooltip.IsEqualDataID(dataID)) return false;
83760
+
83761
+ dataType=1;
83762
+ }
83633
83763
 
83634
83764
  var sendData=
83635
83765
  {
83766
+ DataType:dataType, //0=全部更新 1=更新实时K线
83636
83767
  ClientPos:this.ChartCorssCursor.ClientPos, //位置
83637
83768
  IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
83638
83769
  KItem:kItem,
@@ -83640,7 +83771,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83640
83771
  LastValue:this.ChartCorssCursor.LastValue,
83641
83772
  };
83642
83773
 
83643
-
83644
83774
  this.DialogTooltip.Update(sendData);
83645
83775
 
83646
83776
  return true;
@@ -83681,6 +83811,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83681
83811
 
83682
83812
  this.DialogSelectRect.Update(sendData);
83683
83813
  }
83814
+
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
+ this.UpdateHQFloatTooltip=function(kData)
83839
+ {
83840
+ if (!this.FloatTooltip) return;
83841
+ if (!this.FloatTooltip.IsShow()) return;
83842
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
83843
+
83844
+ var lastItem=kData.Data[kData.Data.length-1];
83845
+ if (!lastItem) return;
83846
+
83847
+ var dataID={ Symbol:kData.Symbol, Date:lastItem.Date, Time:lastItem.Time };
83848
+ if (!this.FloatTooltip.IsEqualHQID(dataID)) return;
83849
+
83850
+ var sendData=
83851
+ {
83852
+ Data:lastItem,
83853
+ Symbol:this.Symbol,
83854
+ Name:this.Name,
83855
+ DataType:2,
83856
+ };
83857
+
83858
+ this.FloatTooltip.Update(sendData);
83859
+ }
83684
83860
  }
83685
83861
 
83686
83862
  //API 返回数据 转化为array[]
@@ -89507,6 +89683,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
89507
89683
  if (!this.ChartCorssCursor) return false;
89508
89684
 
89509
89685
  var minuteItem=null; //{ Type:0=连续交易 1=集合竞价, Data:数据 }
89686
+ var dataType=0; //0=全部更新 2=分时实时数据更新
89510
89687
  if (this.ChartCorssCursor.ClientPos>=0)
89511
89688
  {
89512
89689
  var titlePaint=this.TitlePaint[0];
@@ -89516,21 +89693,32 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
89516
89693
  if ((pointInfo.ClientPos==2 || pointInfo.ClientPos==3 || (pointInfo.ClientPos>=200&& pointInfo.ClientPos<=299) || (pointInfo.ClientPos>=300&& pointInfo.ClientPos<=399)))
89517
89694
  {
89518
89695
  var auctionData=titlePaint.GetCurrentAuctionData();
89519
- if (!auctionData) return;
89696
+ if (!auctionData) return false;
89520
89697
  minuteItem={ Type:1, Data:auctionData };
89521
89698
  }
89522
89699
  else
89523
89700
  {
89524
89701
  var minuteData=titlePaint.GetCurrentKLineData();
89525
- if (!minuteData) return;
89702
+ if (!minuteData) return false;
89526
89703
  minuteItem={ Type:0, Data:minuteData };
89527
89704
  }
89528
89705
  }
89529
-
89706
+ }
89707
+ else //实时数据更新
89708
+ {
89709
+ if (!this.SourceData || !IFrameSplitOperator.IsNonEmptyArray(this.SourceData.Data)) return false;
89710
+ var minuteData=this.SourceData.Data[this.SourceData.Data.length-1];
89711
+
89712
+ var dataID={ Symbol:this.Symbol, Date:minuteData.Date, Time:minuteData.Time };
89713
+ if (!this.DialogTooltip.IsEqualDataID(dataID)) return false;
89714
+
89715
+ minuteItem={ Type:0, Data:minuteData };
89716
+ dataType=2;
89530
89717
  }
89531
89718
 
89532
89719
  var sendData=
89533
89720
  {
89721
+ DataType:dataType,
89534
89722
  ClientPos:this.ChartCorssCursor.ClientPos, //位置
89535
89723
  IsShowCorss:this.ChartCorssCursor.IsShowCorss, //是否显示十字线
89536
89724
  MinItem:minuteItem,
@@ -125290,6 +125478,21 @@ function GetBlackStyle()
125290
125478
  TitleBGColor:"rgb(200, 66, 69)",
125291
125479
  },
125292
125480
 
125481
+ FloatTooltip:
125482
+ {
125483
+ BGColor:'rgb(20,20,20)', //背景色
125484
+ BorderColor:'rgb(170,170,170)', //边框颜色
125485
+
125486
+ VolColor:"rgb(255, 185, 15)", //标题成交量
125487
+ AmountColor:"rgb(210,210,210)", //成交金额
125488
+ DateTimeColor:'rgb(210,210,210)',
125489
+ TurnoverRateColor:'rgb(43,54,69)', //换手率
125490
+ PositionColor:"rgb(255,0,255)", //持仓
125491
+
125492
+ TextColor:"rgb(210,210,210)", //数值名称
125493
+ ValueColor:"rgb(210,210,210)", //数值
125494
+ },
125495
+
125293
125496
  DialogSelectRect:
125294
125497
  {
125295
125498
  BGColor:'rgb(20,20,20)', //背景色
@@ -139284,7 +139487,7 @@ function ScrollBarBGChart()
139284
139487
 
139285
139488
 
139286
139489
 
139287
- var HQCHART_VERSION="1.1.14044";
139490
+ var HQCHART_VERSION="1.1.14055";
139288
139491
 
139289
139492
  function PrintHQChartVersion()
139290
139493
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14044";
8
+ var HQCHART_VERSION="1.1.14055";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {