hqchart 1.1.15011 → 1.1.15026

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.
@@ -4953,12 +4953,27 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4953
4953
  var item=option.LatestPointFlash;
4954
4954
  if (item.Enable)
4955
4955
  {
4956
- this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
4956
+ var zIndex=6;
4957
+ if (IFrameSplitOperator.IsNumber(item.ZIndex)) zIndex=item.ZIndex;
4958
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:zIndex });
4957
4959
  chart.CreateExtendChart("LatestPointFlashPaint", item);
4958
4960
  chart.StartLatestPointFlash();
4959
4961
  }
4960
4962
  }
4961
4963
 
4964
+ if (option.KLineCountDown)
4965
+ {
4966
+ var item=option.KLineCountDown;
4967
+ if (item.Enable)
4968
+ {
4969
+ var zIndex=4;
4970
+ if (IFrameSplitOperator.IsNumber(item.ZIndex)) zIndex=item.ZIndex;
4971
+ this.CreateExtraCanvasElement(JSChart.KLineCountDownKey, { ZIndex:zIndex });
4972
+ chart.CreateExtendChart("KLineCountDownPaint", item);
4973
+ chart.StartCountDown();
4974
+ }
4975
+ }
4976
+
4962
4977
  return chart;
4963
4978
  }
4964
4979
 
@@ -6017,6 +6032,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
6017
6032
  if (option.FloatTooltip && option.FloatTooltip.Enable)
6018
6033
  chart.InitalFloatTooltip(option.FloatTooltip);
6019
6034
 
6035
+ if (option.SmallFloatTooltip && option.SmallFloatTooltip.Enable)
6036
+ chart.InitalSmallFloatTooltip(option.SmallFloatTooltip);
6037
+
6020
6038
  if (option.SelectRectDialog && option.SelectRectDialog.Enable)
6021
6039
  chart.InitalSelectRectDialog(option.SelectRectDialog);
6022
6040
 
@@ -6529,6 +6547,7 @@ JSChart.CorssCursorCanvasKey="hqchart_corsscursor";
6529
6547
  JSChart.TooltipCursorCanvasKey="hqchart_tooltip";
6530
6548
  JSChart.RectDragCanvasKey="hqchart_drag_rect";
6531
6549
  JSChart.LatestPointFlashKey="hqchart_point_flash"; //最新数据点闪烁
6550
+ JSChart.KLineCountDownKey="hqchart_kline_countdown"; //倒计时
6532
6551
 
6533
6552
  //初始化
6534
6553
  JSChart.Init=function(divElement,bScreen,bCacheCanvas)
@@ -6975,6 +6994,8 @@ var JSCHART_EVENT_ID=
6975
6994
  ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息\
6976
6995
 
6977
6996
  ON_FORMAT_TVLONGPOSITION_LABEL:176,
6997
+
6998
+ ON_FORMAT_COUNTDOWN_TEXT:177, //倒计时
6978
6999
  }
6979
7000
 
6980
7001
  var JSCHART_OPERATOR_ID=
@@ -7442,7 +7463,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7442
7463
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
7443
7464
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
7444
7465
 
7445
- this.LatestPointFlashOption={ Timer:null, DelayTime:100 };
7466
+ this.LatestPointFlashOption={ Timer:null, DelayTime:100 }; //最后一个数据闪烁
7467
+ this.CountDownOption={ Timer:null, DelayTime:300 }; //倒计时
7446
7468
 
7447
7469
  this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
7448
7470
 
@@ -7460,6 +7482,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7460
7482
  this.FloatTooltip; //浮动tooltip信息
7461
7483
  this.DialogSearchIndex; //指标搜索
7462
7484
  this.DialogModifyIndexParam; //指标参数修改
7485
+ this.SmallFloatTooltipGroup; //小浮框tooltip信息集合
7463
7486
 
7464
7487
 
7465
7488
  this.RestoreFocusTimer=null; //恢复焦点定时器
@@ -7544,6 +7567,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7544
7567
 
7545
7568
  this.GlobalOption.LatestPoint=null;
7546
7569
  this.GlobalOption.TradeStatus=null;
7570
+ this.GlobalOption.CountDown=null;
7547
7571
  }
7548
7572
 
7549
7573
  this.RestoreFocus=function(delay)
@@ -7616,6 +7640,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7616
7640
  this.FloatTooltip.Create();
7617
7641
  }
7618
7642
 
7643
+
7644
+ this.InitalSmallFloatTooltip=function(option)
7645
+ {
7646
+ if (this.SmallFloatTooltipGroup) return;
7647
+
7648
+ this.SmallFloatTooltipGroup=new JSSmallFloatTooltipGroup();
7649
+ this.SmallFloatTooltipGroup.Inital(this, option);
7650
+ this.SmallFloatTooltipGroup.Create();
7651
+ }
7652
+
7653
+
7619
7654
  this.InitalModifyDrawDialog=function()
7620
7655
  {
7621
7656
  if ( this.DialogModifyDraw) return;
@@ -7793,6 +7828,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7793
7828
  this.FloatTooltip.Hide();
7794
7829
  }
7795
7830
 
7831
+ this.HideSmallFloatTooltip=function()
7832
+ {
7833
+ if (!this.SmallFloatTooltipGroup) return;
7834
+
7835
+ this.SmallFloatTooltipGroup.Hide();
7836
+ }
7837
+
7796
7838
  this.DestroyTooltipDialog=function()
7797
7839
  {
7798
7840
  if (!this.DialogTooltip) return;
@@ -7809,6 +7851,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7809
7851
  this.FloatTooltip=null;
7810
7852
  }
7811
7853
 
7854
+ this.DestroySmallFloatTooltip=function()
7855
+ {
7856
+ if (!this.SmallFloatTooltipGroup) return;
7857
+
7858
+ this.SmallFloatTooltipGroup.Destroy();
7859
+ this.SmallFloatTooltipGroup=null;
7860
+ }
7861
+
7812
7862
  this.DestroySearchIndexDialog=function()
7813
7863
  {
7814
7864
  if (!this.DialogSearchIndex) return;
@@ -7862,6 +7912,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7862
7912
  {
7863
7913
  this.HideFloatTooltip();
7864
7914
  this.CloseTooltipDialog();
7915
+ this.HideSmallFloatTooltip();
7865
7916
 
7866
7917
  if (this.DialogDrawTool) this.DialogDrawTool.Close();
7867
7918
  this.CloseModifyDrawDialog();
@@ -7951,6 +8002,30 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7951
8002
  chart.FlashCount=flashCount;
7952
8003
  }
7953
8004
 
8005
+ this.StartCountDown=function()
8006
+ {
8007
+ this.CountDownOption.Timer=setInterval(()=>
8008
+ {
8009
+ this.DrawCountDown();
8010
+ }, this.CountDownOption.DelayTime);
8011
+ }
8012
+
8013
+ this.DrawCountDown=function()
8014
+ {
8015
+ var finder=this.GetExtendChartByClassName("KLineCountDownPaint");
8016
+ if (finder && finder.Chart)
8017
+ finder.Chart.Draw();
8018
+ }
8019
+
8020
+ this.StopCountDown=function()
8021
+ {
8022
+ if (this.CountDownOption.Timer)
8023
+ {
8024
+ clearInterval(this.CountDownOption.Timer);
8025
+ this.CountDownOption.Timer=null;
8026
+ }
8027
+ }
8028
+
7954
8029
  this.ChartDestroy=function() //销毁
7955
8030
  {
7956
8031
  this.IsDestroy=true;
@@ -7958,6 +8033,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7958
8033
 
7959
8034
  this.DestroyTooltipDialog();
7960
8035
  this.DestroyFloatTooltip();
8036
+ this.DestroySmallFloatTooltip();
7961
8037
 
7962
8038
  this.DestroySearchIndexDialog();
7963
8039
  this.DestroyDialogModifyIndexParam();
@@ -7972,6 +8048,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7972
8048
  if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
7973
8049
 
7974
8050
  this.StopLatestPointFlash();
8051
+ this.StopCountDown();
7975
8052
 
7976
8053
  document.oncontextmenu=null;
7977
8054
  this.RemoveAllEventListener();
@@ -10435,12 +10512,20 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10435
10512
  canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
10436
10513
  }
10437
10514
 
10515
+ this.ClearCorssCursorCanvas=function()
10516
+ {
10517
+ if (!this.CorssCursorCanvas) return;
10518
+
10519
+ this.CorssCursorCanvas.clearRect(0,0,this.CorssCursorElement.width,this.CorssCursorElement.height);
10520
+ }
10521
+
10438
10522
  this.Draw=function()
10439
10523
  {
10440
10524
  if (this.ChartCorssCursor) this.ChartCorssCursor.Status=0;
10441
10525
  if (this.UIElement.width<=0 || this.UIElement.height<=0) return;
10442
10526
 
10443
10527
  this.StopDrawDynamicInfo();
10528
+ this.ClearCorssCursorCanvas();
10444
10529
 
10445
10530
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW);
10446
10531
  if (event && event.Callback)
@@ -10614,7 +10699,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10614
10699
  if (this.CorssCursorCanvas) //独立的十字光标层
10615
10700
  {
10616
10701
  this.ChartCorssCursor.Canvas=this.CorssCursorCanvas;
10617
- this.ChartCorssCursor.Canvas.clearRect(0,0,this.CorssCursorElement.width,this.CorssCursorElement.height)
10618
10702
  bRestoreCanvas=true;
10619
10703
  }
10620
10704
 
@@ -11414,6 +11498,50 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11414
11498
  return null;
11415
11499
  }
11416
11500
 
11501
+ this.GetCorssCursorTooltipData=function(option)
11502
+ {
11503
+ if (!this.ChartCorssCursor) return null;
11504
+ if (this.ChartCorssCursor.Status===0) return null;
11505
+ if (!this.ChartCorssCursor.IsShowCorss) return null;
11506
+
11507
+ var kItem=this.ChartCorssCursor.StringFormatX.KItem;
11508
+ if (!kItem) return null;
11509
+
11510
+ //X轴取十字光标坐标
11511
+ var toolTip={ AryData:[], X:this.ChartCorssCursor.StringFormatX.Point.X };
11512
+
11513
+ for(var i=0;i<this.ChartPaint.length;++i)
11514
+ {
11515
+ var item=this.ChartPaint[i];
11516
+ if (!item.GetCorssCursorTooltipData) continue;
11517
+
11518
+ item.GetCorssCursorTooltipData(kItem, toolTip);
11519
+ }
11520
+
11521
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame))
11522
+ {
11523
+ for(var i=0;i<this.Frame.SubFrame.length;++i)
11524
+ {
11525
+ var subFrame=this.Frame.SubFrame[i];
11526
+ for(var j=0;j<subFrame.OverlayIndex.length;++j)
11527
+ {
11528
+ var overlayItem=subFrame.OverlayIndex[j];
11529
+ for(var k=0;k<overlayItem.ChartPaint.length;++k)
11530
+ {
11531
+ var item=overlayItem.ChartPaint[k];
11532
+ if (!item.GetCorssCursorTooltipData) continue;
11533
+
11534
+ item.GetCorssCursorTooltipData(kItem, toolTip);
11535
+ }
11536
+ }
11537
+ }
11538
+ }
11539
+
11540
+ if (!IFrameSplitOperator.IsNonEmptyArray(toolTip.AryData)) return null;
11541
+
11542
+ return toolTip;
11543
+ }
11544
+
11417
11545
  this.PtInExtendChartButtons=function(x,y)
11418
11546
  {
11419
11547
  for(var i=0;i<this.ExtendChartPaint.length; ++i)
@@ -11727,6 +11855,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11727
11855
  }
11728
11856
  }
11729
11857
 
11858
+ var corssTooltipData=this.GetCorssCursorTooltipData(null);
11859
+ if (corssTooltipData) this.DrawSmallFloatTooltip(corssTooltipData);
11860
+ else this.HideSmallFloatTooltip();
11861
+
11730
11862
  this.SetCursor(mouseStatus);
11731
11863
  }
11732
11864
 
@@ -12451,6 +12583,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12451
12583
 
12452
12584
  this.ShowTooltipByKeyDown=function()
12453
12585
  {
12586
+ var corssTooltipData=this.GetCorssCursorTooltipData(null);
12587
+ if (corssTooltipData) this.DrawSmallFloatTooltip(corssTooltipData);
12588
+ else this.HideSmallFloatTooltip();
12589
+
12454
12590
  if (!this.KLineTooltipConfig.Enable || !this.KLineTooltipConfig.EnableKeyDown)
12455
12591
  {
12456
12592
  this.HideFloatTooltip();
@@ -12469,7 +12605,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12469
12605
  var kItem=kData.Data[dataIndex];
12470
12606
  if (!kItem) return;
12471
12607
 
12472
- var data=this.Frame.Data;
12473
12608
  var toolTip=new TooltipData();
12474
12609
  toolTip.Data=kItem;
12475
12610
  toolTip.ChartPaint=this.ChartPaint[0];
@@ -12837,6 +12972,29 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12837
12972
  if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
12838
12973
 
12839
12974
  this.HideFloatTooltip();
12975
+ this.HideSmallFloatTooltip();
12976
+ }
12977
+
12978
+ this.DrawSmallFloatTooltip=function(toolTip)
12979
+ {
12980
+ if (!this.SmallFloatTooltipGroup) return;
12981
+
12982
+ this.UpdateSmallFloatTooltip(toolTip)
12983
+ }
12984
+
12985
+ this.UpdateSmallFloatTooltip=function(toolTip)
12986
+ {
12987
+ if (!this.SmallFloatTooltipGroup) return;
12988
+
12989
+ var sendData=
12990
+ {
12991
+ Tooltip:toolTip,
12992
+ Symbol:this.Symbol,
12993
+ Name:this.Name,
12994
+ DataType:1,
12995
+ };
12996
+
12997
+ this.SmallFloatTooltipGroup.Update(sendData);
12840
12998
  }
12841
12999
 
12842
13000
  this.UpdateSelectRect=function(start,end)
@@ -51634,6 +51792,69 @@ function ChartStackedBar()
51634
51792
 
51635
51793
  }
51636
51794
 
51795
+ //绘制随光标移动的浮动文字。
51796
+ //用法:DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
51797
+ //例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
51798
+ function ChartDrawFlagText()
51799
+ {
51800
+ this.newMethod=IChartPainting; //派生
51801
+ this.newMethod();
51802
+ delete this.newMethod;
51803
+
51804
+ this.ClassName="ChartDrawFlagText";
51805
+
51806
+ this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
51807
+ this.AryData=[];
51808
+
51809
+ this.GetKValue=ChartData.GetKValue;
51810
+ this.BuildCacheData=function()
51811
+ {
51812
+ var mapData=new Map();
51813
+ this.MapCache=mapData;
51814
+ if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
51815
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
51816
+
51817
+ for(var i=0;i<this.Data.Data.length;++i)
51818
+ {
51819
+ var item=this.AryData[i];
51820
+ if (!item) continue;
51821
+
51822
+ var kItem=this.Data.Data[i];
51823
+ item.Date=kItem.Date;
51824
+ item.Time=kItem.Time;
51825
+
51826
+ var key=this.BuildKey(kItem);
51827
+ mapData.set(key, item);
51828
+ }
51829
+ }
51830
+
51831
+ this.Draw=function()
51832
+ {
51833
+
51834
+ }
51835
+
51836
+ this.GetCorssCursorTooltipData=function(kItem, tooltip)
51837
+ {
51838
+ if (!kItem) return null;
51839
+ if (!this.MapCache) return null;
51840
+
51841
+ var key=this.BuildKey(kItem);
51842
+ if (!this.MapCache.has(key)) return null;
51843
+
51844
+ var item=this.MapCache.get(key);
51845
+ if (item.YValue>this.ChartFrame.HorizontalMax || item.YValue<this.ChartFrame.HorizontalMin) return null;
51846
+
51847
+ var y=this.ChartFrame.GetYFromData(item.YValue,false);
51848
+ tooltip.AryData.push({ Data:item, Y:y, ChartPaint:this, Type:1 });
51849
+ return item;
51850
+ }
51851
+
51852
+ this.GetMaxMin=function()
51853
+ {
51854
+ return {Min:null, Max:null};
51855
+ }
51856
+ }
51857
+
51637
51858
  //锁 支持横屏
51638
51859
  function ChartLock()
51639
51860
  {
@@ -52062,7 +52283,8 @@ function ExtendChartPaintFactory()
52062
52283
  ["DragMovePaint", { Create:function() { return new DragMovePaint(); } }],
52063
52284
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
52064
52285
  ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
52065
- ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}]
52286
+ ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}],
52287
+ ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}]
52066
52288
  ]
52067
52289
  );
52068
52290
 
@@ -56804,6 +57026,238 @@ function LatestPointFlashPaint()
56804
57026
  }
56805
57027
  }
56806
57028
 
57029
+
57030
+ //K线倒计时
57031
+ function KLineCountDownPaint()
57032
+ {
57033
+ this.newMethod=IExtendChartPainting; //派生
57034
+ this.newMethod();
57035
+ delete this.newMethod;
57036
+
57037
+ this.ClassName='KLineCountDownPaint';
57038
+ this.HQChart;
57039
+ this.CanvasEx;
57040
+ this.Frequency=500; //闪烁频率ms
57041
+ this.Font=g_JSChartResource.KLineCountDownPaint.Font;
57042
+ this.PriceColor=g_JSChartResource.KLineCountDownPaint.PriceColor;
57043
+ this.TimeColor=g_JSChartResource.KLineCountDownPaint.TimeColor;
57044
+
57045
+ this.TextMargin=CloneData(g_JSChartResource.KLineCountDownPaint.TextMargin);
57046
+ this.LabelMargin=CloneData(g_JSChartResource.KLineCountDownPaint.LabelMargin);
57047
+ this.LineConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Line); //{ IsShow:true, Width:1, Dash:[3,4] };
57048
+
57049
+ this.UnchangeConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Unchange);
57050
+ this.UpConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Up);
57051
+ this.DownConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Down);
57052
+
57053
+ //临时使用
57054
+ this.MainFrame;
57055
+ this.LastItem;
57056
+
57057
+ this.SetOption=function(option)
57058
+ {
57059
+ if (this.HQChart)
57060
+ {
57061
+ var extraElement=this.HQChart.GetExtraCanvas(JSChart.KLineCountDownKey);
57062
+ if (extraElement && extraElement.Canvas) this.CanvasEx=extraElement.Canvas; //绑定独立的画布
57063
+ }
57064
+
57065
+ if (option)
57066
+ {
57067
+ if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
57068
+ if (option.TextMargin) CopyMarginConfig(option.TextMargin, this.TextMargin);
57069
+ if (option.LabelMargin) CopyMarginConfig(option.LabelMargin, this.LabelMargin);
57070
+ if (option.UnchangeColor) this.UnchangeColor=option.UnchangeColor;
57071
+ if (option.UpColor) this.UpColor=option.UpColor;
57072
+ if (option.DownColor) this.DownColor=option.DownColor;
57073
+
57074
+ if (option.Line)
57075
+ {
57076
+ var item=option.Line;
57077
+ if (IFrameSplitOperator.IsBool(item.IsShow)) this.LineConfig.IsShow=item.IsShow;
57078
+ if (IFrameSplitOperator.IsNumber(item.Width)) this.LineConfig.Width=item.Width;
57079
+ if (item.Dash) this.LineConfig.Dash=item.Dash;
57080
+ }
57081
+ }
57082
+ }
57083
+
57084
+ this.ReloadResource=function(resource)
57085
+ {
57086
+ this.Font=g_JSChartResource.KLineCountDownPaint.Font;
57087
+ this.PriceColor=g_JSChartResource.KLineCountDownPaint.PriceColor;
57088
+ this.TimeColor=g_JSChartResource.KLineCountDownPaint.TimeColor;
57089
+
57090
+ this.TextMargin=CloneData(g_JSChartResource.KLineCountDownPaint.TextMargin);
57091
+ this.LabelMargin=CloneData(g_JSChartResource.KLineCountDownPaint.LabelMargin);
57092
+ this.LineConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Line); //{ IsShow:true, Width:1, Dash:[3,4] };
57093
+
57094
+ this.UnchangeConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Unchange);
57095
+ this.UpConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Up);
57096
+ this.DownConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Down);
57097
+ }
57098
+
57099
+ this.Draw=function()
57100
+ {
57101
+ this.MainFrame=null;
57102
+ this.LastItem=null;
57103
+
57104
+ if (!this.HQChart) return;
57105
+ if (!this.CanvasEx) return;
57106
+ this.HQChart.ClearCanvas(this.CanvasEx);
57107
+ var kData=this.HQChart.GetKData();
57108
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
57109
+
57110
+ var lastItem=kData.Data[kData.Data.length-1];
57111
+ if (!lastItem || !IFrameSplitOperator.IsNumber(lastItem.Close)) return;
57112
+ var frame=this.ChartFrame.SubFrame[0].Frame;
57113
+ if (!frame) return;
57114
+ var price=lastItem.Close;
57115
+ if (price>frame.HorizontalMax || price<frame.HorizontalMin) return;
57116
+
57117
+ if (frame.IsHScreen) return;
57118
+
57119
+ this.MainFrame=frame;
57120
+ this.LastItem=lastItem;
57121
+
57122
+ this.CanvasEx.save();
57123
+ this.DrawDownPaint();
57124
+ this.CanvasEx.restore();
57125
+
57126
+ this.MainFrame=null;
57127
+ this.LastItem=null;
57128
+ //if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.CountDown) return;
57129
+ }
57130
+
57131
+ this.DrawDownPaint=function()
57132
+ {
57133
+ if (!this.MainFrame || !this.LastItem || !IFrameSplitOperator.IsNumber(this.LastItem.Close)) return;
57134
+
57135
+ var decNum=GetfloatPrecision(this.HQChart.Symbol); //小数位数
57136
+ var yPrice=this.MainFrame.GetYFromData(this.LastItem.Close,false);
57137
+ var strPrice=this.LastItem.Close.toFixed(decNum);
57138
+
57139
+ var config=this.GetColorConfig(this.LastItem);
57140
+ var out={ BGColor:config.BGColor, Font:this.Font, AryText:[ ], YPrice:yPrice };
57141
+
57142
+ var item={ Text:strPrice, Color:config.PriceColor };
57143
+ out.AryText.push(item);
57144
+
57145
+ var item={ Text:"--:--", Color:config.TimeColor};
57146
+ out.AryText.push(item);
57147
+
57148
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_COUNTDOWN_TEXT);
57149
+ if (event && event.Callback)
57150
+ {
57151
+ var sendData={ LastItem:this.LastItem, Frame:this.MainFrame, Out:out, Period:this.HQChart.Period, Symbol:this.HQChart.Symbol };
57152
+ event.Callback(event, sendData, this);
57153
+ }
57154
+
57155
+ if (!this.CalculateLableSize(out)) return;
57156
+
57157
+ this.DrawLable(out);
57158
+ }
57159
+
57160
+ this.CalculateLableSize=function(out)
57161
+ {
57162
+ if (!out || !IFrameSplitOperator.IsNonEmptyArray(out.AryText)) return false;
57163
+
57164
+ this.CanvasEx.font=this.Font;
57165
+ this.FontHeight=this.CanvasEx.measureText("O").width; //行高
57166
+
57167
+ var lableWidth=0, lableHeight=0
57168
+ for(var i=0; i<out.AryText.length; ++i)
57169
+ {
57170
+ var item=out.AryText[i];
57171
+ if (!item || !item.Text) continue;
57172
+ item.TextWidth=this.CanvasEx.measureText(item.Text).width;
57173
+ item.TextWidth+=this.TextMargin.Left+this.TextMargin.Right;
57174
+
57175
+ if (lableWidth<item.TextWidth) lableWidth=item.TextWidth;
57176
+ lableHeight+=this.FontHeight+this.TextMargin.Top+this.TextMargin.Bottom;
57177
+ }
57178
+
57179
+ out.Width=lableWidth+this.LabelMargin.Left+this.LabelMargin.Right;
57180
+ out.Height=lableHeight+this.LabelMargin.Top+this.LabelMargin.Bottom;
57181
+
57182
+ return true;
57183
+ }
57184
+
57185
+ this.FixedRect=function(rt)
57186
+ {
57187
+ rt.Left=ToFixedRect(rt.Left);
57188
+ rt.Top=ToFixedRect(rt.Top);
57189
+ rt.Width=ToFixedRect(rt.Width);
57190
+ rt.Height=ToFixedRect(rt.Height);
57191
+
57192
+ rt.Right=rt.Left+rt.Width;
57193
+ rt.Bottom=rt.Top+rt.Height;
57194
+ }
57195
+
57196
+ this.DrawLable=function(out)
57197
+ {
57198
+ if (!out || !IFrameSplitOperator.IsNonEmptyArray(out.AryText)) return;
57199
+
57200
+ var border=this.MainFrame.GetBorder();
57201
+ var chartBorder=this.MainFrame.ChartBorder;
57202
+ var lineHeight=this.FontHeight+this.TextMargin.Top+this.TextMargin.Bottom;
57203
+ if (chartBorder.Right>10 ) //外部刻度
57204
+ {
57205
+ var rtBG={ Left:border.Right, Top:out.YPrice-lineHeight/2, Width:out.Width, Height:out.Height };
57206
+ rtBG.Right=rtBG.Left+rtBG.Width;
57207
+ if (rtBG.Right>border.ChartWidth)
57208
+ {
57209
+ rtBG.Right=border.ChartWidth-1;
57210
+ rtBG.Left=rtBG.Right-rtBG.Width;
57211
+ }
57212
+
57213
+ this.FixedRect(rtBG);
57214
+ this.CanvasEx.fillStyle=out.BGColor;
57215
+ this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
57216
+ }
57217
+
57218
+ this.Canvas.textAlign = "left";
57219
+ this.Canvas.textBaseline = "bottom";
57220
+ var yText=rtBG.Top+lineHeight+this.LabelMargin.Top;
57221
+ var xText=rtBG.Left+this.TextMargin.Left+this.LabelMargin.Left;
57222
+ for(var i=0;i<out.AryText.length;++i)
57223
+ {
57224
+ var item=out.AryText[i];
57225
+ var yOffset=this.TextMargin.YOffset;
57226
+
57227
+ this.CanvasEx.fillStyle=item.Color;
57228
+ this.CanvasEx.fillText(item.Text, xText, yText+yOffset-this.TextMargin.Bottom);
57229
+
57230
+ yText+=lineHeight;
57231
+ }
57232
+
57233
+ //线段
57234
+ var config=this.LineConfig;
57235
+ if (config.IsShow)
57236
+ {
57237
+ this.CanvasEx.strokeStyle=out.BGColor;
57238
+ this.CanvasEx.lineWidth=config.Width;
57239
+ if (IFrameSplitOperator.IsNonEmptyArray(config.Dash)) this.CanvasEx.setLineDash(config.Dash);
57240
+ this.CanvasEx.beginPath();
57241
+ var xLeft=border.LeftEx;
57242
+ var xRight=rtBG.Left;
57243
+ this.CanvasEx.moveTo(xLeft,ToFixedPoint(out.YPrice));
57244
+ this.CanvasEx.lineTo(xRight,ToFixedPoint(out.YPrice));
57245
+ this.CanvasEx.stroke();
57246
+ }
57247
+ }
57248
+
57249
+ this.GetColorConfig=function(kItem, symbol)
57250
+ {
57251
+ var config=this.UnchangeConfig;
57252
+ if (!kItem) return config;
57253
+
57254
+ if (kItem.Close>kItem.YClose) config=this.UpConfig;
57255
+ else if (kItem.Close<kItem.YClose) config=this.DownConfig;
57256
+
57257
+ return config;
57258
+ }
57259
+ }
57260
+
56807
57261
  //拖拽效果图
56808
57262
  var JSCHART_DRAGCHART_TYPE_ID=
56809
57263
  {
@@ -58487,6 +58941,8 @@ IFrameSplitOperator.FormatDateTimeStringV2=function(datetime, format, languageID
58487
58941
 
58488
58942
  case "HH:MM:SS":
58489
58943
  return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}:${IFrameSplitOperator.NumberToString(datetime.getSeconds())}`;
58944
+ case "MM:SS":
58945
+ return `${IFrameSplitOperator.NumberToString(datetime.getMinutes())}:${IFrameSplitOperator.NumberToString(datetime.getSeconds())}`;
58490
58946
  case "HH:MM":
58491
58947
  return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}`;
58492
58948
  case "HH:MM:SS.fff":
@@ -61576,7 +62032,7 @@ function ChartCorssCursor()
61576
62032
 
61577
62033
  //内部使用
61578
62034
  this.Close=null; //收盘价格
61579
- this.Status=0; //当前状态 0=隐藏 1=显示
62035
+ this.Status=0; //当前状态 0=隐藏 1=显示底部 2=十字线
61580
62036
 
61581
62037
  this.ReloadResource=function(resource)
61582
62038
  {
@@ -81147,6 +81603,15 @@ function JSChartResource()
81147
81603
  ValueColor:"rgb(0,0,0)", //数值
81148
81604
  };
81149
81605
 
81606
+ this.SmallFloatTooltipV2=
81607
+ {
81608
+ BGColor:'rgb(250,250,250)', //背景色
81609
+ BorderColor:'rgb(20,20,20)', //边框颜色
81610
+
81611
+ TextColor:"rgb(0,0,0)", //数值名称
81612
+ ValueColor:"rgb(0,0,0)", //数值
81613
+ };
81614
+
81150
81615
  //区间统计
81151
81616
  this.DialogSelectRect=
81152
81617
  {
@@ -81587,6 +82052,18 @@ function JSChartResource()
81587
82052
  SplitLine:{ Color:'rgb(73,133,231)', Width:1*GetDevicePixelRatio(), Dash:[5*GetDevicePixelRatio(),5*GetDevicePixelRatio()] }
81588
82053
  }
81589
82054
 
82055
+ this.KLineCountDownPaint=
82056
+ {
82057
+ Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
82058
+ TextMargin:{ Left:0, Right:0, Bottom:2, Top:2, YOffset:0 },
82059
+ LabelMargin:{ Left:5, Right:5, Bottom:4, Top:2 },
82060
+ Line:{ IsShow:true, Width:1, Dash:[5*GetDevicePixelRatio(), 5*GetDevicePixelRatio()] },
82061
+
82062
+ Unchange:{ BGColor:"rgb(0,0,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82063
+ Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82064
+ Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82065
+ }
82066
+
81590
82067
 
81591
82068
  //成交明细
81592
82069
  this.DealList=
@@ -82919,6 +83396,73 @@ function JSChartResource()
82919
83396
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
82920
83397
 
82921
83398
  if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
83399
+ if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
83400
+
83401
+ if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83402
+ }
83403
+
83404
+ this.SetSmallFloatTooltipV2=function(style)
83405
+ {
83406
+ var dest=this.SmallFloatTooltipV2;
83407
+
83408
+ if (style.BGColor) dest.BGColor=style.BGColor;
83409
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
83410
+
83411
+ if (style.TextColor) dest.TextColor=style.TextColor;
83412
+ if (style.ValueColor) dest.ValueColor=style.ValueColor;
83413
+ }
83414
+
83415
+ this.SetKLineCountDownPaint=function(style)
83416
+ {
83417
+ var dest=this.KLineCountDownPaint;
83418
+ if (style.Font) dest.Font=style.Font;
83419
+
83420
+ if (style.TextMargin)
83421
+ {
83422
+ var item=style.TextMargin;
83423
+ CopyMarginConfig(dest.TextMargin, item);
83424
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.TextMargin.YOffset=item.YOffset;
83425
+ }
83426
+
83427
+ if (style.LabelMargin) CopyMarginConfig(dest.LabelMargin, style.LabelMargin);
83428
+
83429
+ if (style.Line)
83430
+ {
83431
+ var item=style.Line;
83432
+ if (IFrameSplitOperator.IsNumber(item.Width)) dest.Line.Width=item.Width;
83433
+ if (IFrameSplitOperator.IsBool(item.IsShow)) dest.Line.Width=item.Width;
83434
+ if (item.Dash) dest.Line.Dash=item.Dash;
83435
+ }
83436
+
83437
+ if (style.Unchange)
83438
+ {
83439
+ var item=style.Unchange;
83440
+ var subDest=dest.Unchange;
83441
+
83442
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83443
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83444
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83445
+ }
83446
+
83447
+ if (style.Up)
83448
+ {
83449
+ var item=style.Up;
83450
+ var subDest=dest.Up;
83451
+
83452
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83453
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83454
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83455
+ }
83456
+
83457
+ if (style.Down)
83458
+ {
83459
+ var item=style.Down;
83460
+ var subDest=dest.Down;
83461
+
83462
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83463
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83464
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83465
+ }
82922
83466
  }
82923
83467
 
82924
83468
 
@@ -118028,6 +118572,55 @@ function JSDraw(errorHandler,symbolData)
118028
118572
  this.ErrorHandler=errorHandler;
118029
118573
  this.SymbolData=symbolData;
118030
118574
 
118575
+ //绘制随光标移动的浮动文字。
118576
+ //用法: DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
118577
+ //例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
118578
+ this.DRAWFLAGTEXT=function(condition,price,text)
118579
+ {
118580
+ var drawData=[];
118581
+ var result={ DrawData:drawData, DrawType:'DRAWFLAGTEXT' };
118582
+ if (!text) return result;
118583
+
118584
+ if (Array.isArray(condition))
118585
+ {
118586
+ if (condition.length<=0) return result;
118587
+
118588
+ var bSinglePrice=IFrameSplitOperator.IsNumber(price);
118589
+ for(var i=0; i<condition.length; ++i)
118590
+ {
118591
+ drawData[i]=null;
118592
+
118593
+ if (isNaN(condition[i]) || !condition[i]) continue;
118594
+
118595
+ if (bSinglePrice)
118596
+ {
118597
+ drawData[i]={ YValue:price, Text:text };
118598
+ }
118599
+ else
118600
+ {
118601
+ if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
118602
+ }
118603
+ }
118604
+ }
118605
+ else if (IFrameSplitOperator.IsPlusNumber(condition))
118606
+ {
118607
+ var bSinglePrice=IFrameSplitOperator.IsNumber(price);
118608
+ for(var i=0;i<this.SymbolData.Data.Data.length;++i)
118609
+ {
118610
+ if (bSinglePrice)
118611
+ {
118612
+ drawData[i]={ YValue:price, Text:text };
118613
+ }
118614
+ else
118615
+ {
118616
+ if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
118617
+ }
118618
+ }
118619
+ }
118620
+
118621
+ return result;
118622
+ }
118623
+
118031
118624
  this.DRAWTEXT=function(condition,price,text)
118032
118625
  {
118033
118626
  let drawData=[];
@@ -120408,6 +121001,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
120408
121001
  "VERTLINE","HORLINE","TIPICON",
120409
121002
  "BUY","SELL","SELLSHORT","BUYSHORT",
120410
121003
  "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE","DRAWRADAR","DRAWDOUGHNUT",
121004
+ "DRAWFLAGTEXT"
120411
121005
  ]);
120412
121006
  if (setFunctionName.has(name)) return true;
120413
121007
 
@@ -126973,6 +127567,10 @@ function JSExecute(ast,option)
126973
127567
  node.Draw=this.Draw.DRAWTEXT_FIX(args[0],args[1],args[2],args[3],args[4]);
126974
127568
  node.Out=[];
126975
127569
  break;
127570
+ case "DRAWFLAGTEXT":
127571
+ node.Draw=this.Draw.DRAWFLAGTEXT(args[0],args[1],args[2]);
127572
+ node.Out=[];
127573
+ break;
126976
127574
  case 'SUPERDRAWTEXT':
126977
127575
  node.Draw=this.Draw.SUPERDRAWTEXT(args[0],args[1],args[2],args[3],args[4]);
126978
127576
  node.Out=[];
@@ -129798,6 +130396,22 @@ function ScriptIndex(name,script,args,option)
129798
130396
  hqChart.ChartPaint.push(chartText);
129799
130397
  }
129800
130398
 
130399
+ this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
130400
+ {
130401
+ var chart=new ChartDrawFlagText();
130402
+ chart.Canvas=hqChart.Canvas;
130403
+ chart.Name=varItem.Name;
130404
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
130405
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
130406
+ if (chart.ReloadResource) chart.ReloadResource();
130407
+
130408
+ chart.Data=hqChart.GetKData();
130409
+ if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
130410
+ chart.BuildCacheData();
130411
+
130412
+ hqChart.ChartPaint.push(chart);
130413
+ }
130414
+
129801
130415
  //COLORSTICK
129802
130416
  this.CreateMACD=function(hqChart,windowIndex,varItem,id)
129803
130417
  {
@@ -131264,6 +131878,9 @@ function ScriptIndex(name,script,args,option)
131264
131878
  case 'DRAWTEXT':
131265
131879
  this.CreateDrawTextV2(hqChart,windowIndex,item,i);
131266
131880
  break;
131881
+ case "DRAWFLAGTEXT":
131882
+ this.CreateDrawFlagText(hqChart,windowIndex,item,i);
131883
+ break;
131267
131884
  case 'SUPERDRAWTEXT':
131268
131885
  this.CreateText(hqChart,windowIndex,item,i);
131269
131886
  break;
@@ -131685,6 +132302,8 @@ function OverlayScriptIndex(name,script,args,option)
131685
132302
  case 'DRAWTEXT':
131686
132303
  this.CreateDrawTextV2(hqChart,windowIndex,item,i);
131687
132304
  break;
132305
+ case "DRAWFLAGTEXT":
132306
+ this.CreateDrawFlagText(hqChart,windowIndex,item,i);
131688
132307
  case 'SUPERDRAWTEXT':
131689
132308
  this.CreateText(hqChart,windowIndex,item,i);
131690
132309
  break;
@@ -132049,6 +132668,25 @@ function OverlayScriptIndex(name,script,args,option)
132049
132668
  frame.ChartPaint.push(chartText);
132050
132669
  }
132051
132670
 
132671
+ this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
132672
+ {
132673
+ var overlayIndex=this.OverlayIndex;
132674
+ var frame=overlayIndex.Frame;
132675
+ var chart=new ChartDrawFlagText();
132676
+ chart.Canvas=hqChart.Canvas;
132677
+ chart.Name=varItem.Name;
132678
+ chart.ChartBorder=frame.Frame.ChartBorder;
132679
+ chart.ChartFrame=frame.Frame;
132680
+ chart.Identify=overlayIndex.Identify;
132681
+ if (chart.ReloadResource) chart.ReloadResource();
132682
+
132683
+ chart.Data=hqChart.GetKData();
132684
+ if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
132685
+ chart.BuildCacheData();
132686
+
132687
+ frame.ChartPaint.push(chart);
132688
+ }
132689
+
132052
132690
  //创建文本
132053
132691
  this.CreateText=function(hqChart,windowIndex,varItem,id, drawName)
132054
132692
  {
@@ -135914,6 +136552,15 @@ function GetBlackStyle()
135914
136552
  ValueColor:"rgb(210,210,210)", //数值
135915
136553
  },
135916
136554
 
136555
+ SmallFloatTooltipV2:
136556
+ {
136557
+ BGColor:'rgb(20,20,20)', //背景色
136558
+ BorderColor:'rgb(170,170,170)', //边框颜色
136559
+
136560
+ TextColor:"rgb(210,210,210)", //数值名称
136561
+ ValueColor:"rgb(210,210,210)", //数值
136562
+ },
136563
+
135917
136564
  DialogSelectRect:
135918
136565
  {
135919
136566
  BGColor:'rgb(20,20,20)', //背景色
@@ -136122,6 +136769,13 @@ function GetBlackStyle()
136122
136769
  BGColor:[null, "rgb(42,46,57)"],
136123
136770
  SplitLine:{ Color:'rgb(73,133,231)', Width:1*GetDevicePixelRatio(), Dash:[5*GetDevicePixelRatio(),5*GetDevicePixelRatio()] }
136124
136771
  },
136772
+
136773
+ KLineCountDownPaint:
136774
+ {
136775
+ Unchange:{ BGColor:"rgb(190, 190 ,190)", PriceColor:"rgb(0,0,0)", TimeColor:"rgb(50,50,50)" },
136776
+ Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
136777
+ Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
136778
+ },
136125
136779
 
136126
136780
  //成交明细
136127
136781
  DealList:
@@ -160402,8 +161056,6 @@ function JSFloatTooltip()
160402
161056
  Left:"UMyChart_Tooltip_Float_Text2_Span", //左对齐
160403
161057
  MarginLeft:'UMyChart_Tooltip_Float_Text3_Span',
160404
161058
  Right:"UMyChart_Tooltip_Float_Text_Span",
160405
-
160406
-
160407
161059
  }
160408
161060
 
160409
161061
  this.TitleAlign=
@@ -161619,6 +162271,431 @@ function JSFloatTooltip()
161619
162271
  this.UpdateStyle();
161620
162272
  }
161621
162273
  }
162274
+
162275
+ function JSSmallFloatTooltip()
162276
+ {
162277
+ this.DivDialog=null;
162278
+ this.DivContent=null;
162279
+ this.HQChart=null;
162280
+ this.ClassName="JSSmallFloatTooltip";
162281
+
162282
+ this.Destroy=function()
162283
+ {
162284
+ if (this.DivDialog)
162285
+ {
162286
+ document.body.removeChild(this.DivDialog);
162287
+ this.DivDialog=null;
162288
+ this.DivContent=null;
162289
+ }
162290
+
162291
+ this.HQChart=null;
162292
+ }
162293
+
162294
+ this.Hide=function()
162295
+ {
162296
+ if (!this.DivDialog) return;
162297
+ if (this.DivDialog.style.visibility!='hidden') this.DivDialog.style.visibility='hidden';
162298
+ }
162299
+
162300
+ this.Create=function()
162301
+ {
162302
+ var divDom=document.createElement("div");
162303
+ divDom.className='UMyChart_Small_Tooltip_Div';
162304
+
162305
+ var divContent=document.createElement("div");
162306
+ divContent.className='UMyChart_Small_Tooltip_Content_Div';
162307
+ divDom.appendChild(divContent);
162308
+
162309
+ document.body.appendChild(divDom);
162310
+
162311
+ this.DivContent=divContent;
162312
+ this.DivDialog=divDom;
162313
+ }
162314
+
162315
+ this.IsShow=function()
162316
+ {
162317
+ if (!this.DivDialog) return false;
162318
+
162319
+ return this.DivDialog.style.visibility==='visible';
162320
+ }
162321
+
162322
+ this.ShowTooltip=function(data)
162323
+ {
162324
+ if (!data.Point) return;
162325
+
162326
+ var x=data.Point.X;
162327
+ var y=data.Point.Y;
162328
+ this.Show(x, y, { YMove:data.Point.YMove });
162329
+ }
162330
+
162331
+ this.Show=function(x, y, option)
162332
+ {
162333
+ if (!this.DivDialog) return;
162334
+ if (!this.HQChart) return;
162335
+
162336
+ var rtClient=this.HQChart.UIElement.getBoundingClientRect();
162337
+ var yMove=0;
162338
+ if (option && IFrameSplitOperator.IsNumber(option.YMove)) yMove=option.YMove;
162339
+
162340
+ var left=x+rtClient.left,top=y+rtClient.top+yMove;
162341
+ var right=left+this.DivDialog.offsetWidth;
162342
+ var bottom=top+this.DivDialog.offsetHeight;
162343
+
162344
+ if ((right+5)>=window.innerWidth) left=left-this.DivDialog.offsetWidth;
162345
+ if ((bottom+5)>=window.innerHeight)
162346
+ {
162347
+ top=(y+rtClient.top)-this.DivDialog.offsetHeight;
162348
+ }
162349
+
162350
+ this.DivDialog.style.top = top + "px";
162351
+ this.DivDialog.style.left = left + "px";
162352
+
162353
+ if (this.DivDialog.style.visibility!='visible')
162354
+ this.DivDialog.style.visibility='visible';
162355
+ }
162356
+
162357
+ this.Update=function(data)
162358
+ {
162359
+ var text=data.Data.Data.Text;
162360
+ if (!this.DivContent) return false;
162361
+
162362
+ this.DivContent.innerText=text;
162363
+
162364
+ this.ShowTooltip(data);
162365
+ }
162366
+ }
162367
+
162368
+
162369
+ function JSSmallFloatTooltipV2()
162370
+ {
162371
+ this.newMethod=JSSmallFloatTooltip; //派生
162372
+ this.newMethod();
162373
+ delete this.newMethod;
162374
+
162375
+ this.ClassName="JSSmallFloatTooltipV2";
162376
+
162377
+ this.AryData=[]; //输出文字信息
162378
+ this.AryText=[]; //表格tr
162379
+ this.MaxRowCount=25;
162380
+
162381
+ this.BGColor=g_JSChartResource.SmallFloatTooltipV2.BGColor;
162382
+ this.BorderColor=g_JSChartResource.SmallFloatTooltipV2.BorderColor;
162383
+
162384
+ this.TextColor=g_JSChartResource.SmallFloatTooltipV2.TextColor;
162385
+ this.ValueColor=g_JSChartResource.SmallFloatTooltipV2.ValueColor;
162386
+
162387
+ this.ValueAlign=
162388
+ {
162389
+ Left:"UMyChart_Small_Tooltip_V2_Text2_Span", //左对齐
162390
+ MarginLeft:'UMyChart_Small_Tooltip_V2_Text3_Span',
162391
+ Right:"UMyChart_Small_Tooltip_V2_Text_Span",
162392
+ }
162393
+
162394
+ this.TitleAlign=
162395
+ {
162396
+ Default:"UMyChart_Small_Tooltip_V2_Title_Span", //标题默认
162397
+ }
162398
+
162399
+ this.Destroy=function()
162400
+ {
162401
+ this.AryData=[];
162402
+ this.AryText=[];
162403
+ this.HQChart=null;
162404
+
162405
+ if (this.DivDialog)
162406
+ {
162407
+ document.body.removeChild(this.DivDialog);
162408
+ this.DivDialog=null;
162409
+ }
162410
+ }
162411
+
162412
+ this.Create=function()
162413
+ {
162414
+ var divDom=document.createElement("div");
162415
+ divDom.className='UMyChart_Small_Tooltip_V2_Div';
162416
+
162417
+ var table=document.createElement("table");
162418
+ table.className="UMyChart_Small_Tooltip_V2_Table";
162419
+ divDom.appendChild(table);
162420
+
162421
+ var tbody=document.createElement("tbody");
162422
+ tbody.className="UMyChart_Small_Tooltip_V2_Tbody";
162423
+ table.appendChild(tbody);
162424
+
162425
+ this.AryData=[];
162426
+
162427
+ for(var i=0;i<this.MaxRowCount;++i)
162428
+ {
162429
+ var rowItem={ Tr:null, TitleSpan:null, TextSpan:null, TitleTd:null, TextTd:null };
162430
+
162431
+ var trDom=document.createElement("tr");
162432
+ trDom.className='UMyChart_Small_Tooltip_V2_Group_Tr';
162433
+ tbody.appendChild(trDom);
162434
+ rowItem.Tr=trDom;
162435
+
162436
+ var tdDom=document.createElement("td");
162437
+ tdDom.className="UMyChart_Small_Tooltip_V2_Title_Td"; //标题
162438
+ trDom.appendChild(tdDom);
162439
+ rowItem.TitleTd=tdDom;
162440
+
162441
+ var spanDom=document.createElement("span");
162442
+ spanDom.className=this.TitleAlign.Default;
162443
+ spanDom.innerText='标题';
162444
+ tdDom.appendChild(spanDom);
162445
+ rowItem.TitleSpan=spanDom;
162446
+
162447
+ var tdDom=document.createElement("td");
162448
+ tdDom.className="UMyChart_Small_Tooltip_V2_Text_Td"; //数值
162449
+ trDom.appendChild(tdDom);
162450
+ rowItem.TextTd=tdDom;
162451
+
162452
+ var spanDom=document.createElement("span");
162453
+ spanDom.className='UMyChart_Small_Tooltip_V2_Text_Span';
162454
+ spanDom.innerText='数值';
162455
+ tdDom.appendChild(spanDom);
162456
+ rowItem.TextSpan=spanDom;
162457
+
162458
+ this.AryData.push(rowItem);
162459
+ }
162460
+
162461
+ document.body.appendChild(divDom);
162462
+
162463
+ this.DivDialog=divDom;
162464
+
162465
+ this.UpdateStyle();
162466
+ }
162467
+
162468
+ this.UpdateStyle=function()
162469
+ {
162470
+ if (!this.DivDialog) return;
162471
+
162472
+ if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
162473
+ if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
162474
+ }
162475
+
162476
+ this.Update=function(data)
162477
+ {
162478
+ if (!this.DivDialog) return;
162479
+
162480
+ this.AryText=[];
162481
+ for(var i=0;i<data.AryData.length;++i)
162482
+ {
162483
+ var item=data.AryData[i];
162484
+ if (item.Type==1) this.UpdateDefaultTooltip(item);
162485
+ //else if (item.Type==2) this.Updateddd();
162486
+ }
162487
+
162488
+ this.UpdateTableDOM();
162489
+ this.ShowTooltip(data);
162490
+ }
162491
+
162492
+ this.UpdateDefaultTooltip=function(data)
162493
+ {
162494
+ var text=data.Data.Text;
162495
+ var rowItem={ Text:"", HTMLTitle:text, Color:this.ValueColor, IsMergeCell:true };
162496
+ this.AryText.push(rowItem);
162497
+ }
162498
+
162499
+ this.UpdateTableDOM=function()
162500
+ {
162501
+ var index=0;
162502
+ for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
162503
+ {
162504
+ var outItem=this.AryText[index];
162505
+ var item=this.AryData[index];
162506
+
162507
+ if (outItem.HTMLTitle) item.TitleSpan.innerHTML=outItem.HTMLTitle
162508
+ else item.TitleSpan.innerText=outItem.Title;
162509
+
162510
+ if (outItem.TitleColor) item.TitleSpan.style.color=outItem.TitleColor;
162511
+ else item.TitleSpan.style.color=this.TextColor;
162512
+
162513
+ if (outItem.HTMLText) item.TextSpan.innerHTML=outItem.HTMLText
162514
+ else item.TextSpan.innerText=outItem.Text;
162515
+
162516
+ item.TextSpan.style.color=outItem.Color;
162517
+ item.TextTd.style.color=outItem.Color;
162518
+
162519
+ if (outItem.ClassName)
162520
+ {
162521
+ item.TextSpan.className=outItem.ClassName;
162522
+ }
162523
+ else
162524
+ {
162525
+ if (item.TextSpan.className!=this.ValueAlign.Right) item.TextSpan.className=this.ValueAlign.Right;
162526
+ }
162527
+
162528
+ if (outItem.TitleClassName)
162529
+ {
162530
+ item.TitleSpan.className=outItem.TitleClassName;
162531
+ }
162532
+ else
162533
+ {
162534
+ if (item.TitleSpan.className!=this.TitleAlign.Default) item.TitleSpan.className=this.TitleAlign.Default;
162535
+ }
162536
+
162537
+ if (outItem.IsMergeCell) //合并单元格
162538
+ {
162539
+ item.TitleTd.colspan=2;
162540
+ item.TextTd.style.display="none";
162541
+ }
162542
+ else
162543
+ {
162544
+ if (item.TitleTd.colspan!=1) item.TitleTd.colspan=1;
162545
+ item.TextTd.style.display="";
162546
+ }
162547
+
162548
+ item.Tr.style.display="";
162549
+ if (item.Tr2) item.Tr2.style.display="none";
162550
+
162551
+ }
162552
+
162553
+ for( ; index<this.MaxRowCount; ++index)
162554
+ {
162555
+ var item=this.AryData[index];
162556
+ item.Tr.style.display="none";
162557
+ if (item.Tr2) item.Tr2.style.display="none";
162558
+ }
162559
+ }
162560
+ }
162561
+
162562
+ function JSSmallFloatTooltipGroup()
162563
+ {
162564
+ this.AryTooltip=[];
162565
+ this.HQChart=null;
162566
+ this.MaxCount=5;
162567
+ this.MaxRowCount=15;
162568
+ this.Style=0;
162569
+
162570
+ this.Inital=function(hqchart, option)
162571
+ {
162572
+ this.HQChart=hqchart;
162573
+ if (option)
162574
+ {
162575
+ if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
162576
+ if (IFrameSplitOperator.IsNumber(option.MaxRowCount)) this.Style=option.MaxRowCount;
162577
+ if (IFrameSplitOperator.IsNumber(option.MaxCount)) this.Style=option.MaxCount;
162578
+ }
162579
+ }
162580
+
162581
+ this.CreateTooltipDom=function()
162582
+ {
162583
+ var item=null;
162584
+ if (this.Style==1)
162585
+ {
162586
+ item=new JSSmallFloatTooltipV2();
162587
+ item.MaxRowCount=this.MaxRowCount;
162588
+ }
162589
+ else
162590
+ {
162591
+ item=new JSSmallFloatTooltip();
162592
+ }
162593
+
162594
+ item.HQChart=this.HQChart;
162595
+ return item;
162596
+ }
162597
+
162598
+ this.Create=function()
162599
+ {
162600
+ for(var i=0;i<this.MaxCount;++i)
162601
+ {
162602
+ var item=this.CreateTooltipDom();
162603
+
162604
+ item.Create();
162605
+ this.AryTooltip.push(item);
162606
+ }
162607
+ }
162608
+
162609
+ this.Destroy=function()
162610
+ {
162611
+ for(var i=0;i<this.AryTooltip.length;++i)
162612
+ {
162613
+ var item=this.AryTooltip[i];
162614
+ item.Destroy();
162615
+ }
162616
+
162617
+ this.AryTooltip=[];
162618
+ }
162619
+
162620
+ this.Update=function(data)
162621
+ {
162622
+ if (this.Style==1)
162623
+ {
162624
+ this.UpdateV2(data);
162625
+ return;
162626
+ }
162627
+
162628
+ var tooltipData=data.Tooltip;
162629
+ var pixelTatio = GetDevicePixelRatio();
162630
+ if (pixelTatio===0) pixelTatio=1;
162631
+ for(var i=0; i<tooltipData.AryData.length && i<this.AryTooltip.length; ++i)
162632
+ {
162633
+ var item=tooltipData.AryData[i];
162634
+ var tooltipItem=this.AryTooltip[i];
162635
+
162636
+ //去掉分辨率倍数
162637
+ var x=tooltipData.X/pixelTatio;
162638
+ var y=item.Y/pixelTatio;
162639
+ tooltipItem.Update({ Data:item, Point:{ X:x, Y:y} });
162640
+ }
162641
+
162642
+ for(var i=tooltipData.AryData.length; i<this.AryTooltip.length; ++i)
162643
+ {
162644
+ var item=this.AryTooltip[i];
162645
+ item.Hide();
162646
+ }
162647
+ }
162648
+
162649
+ //Style==1 同价格合并输出
162650
+ this.UpdateV2=function(data)
162651
+ {
162652
+ var tooltipData=data.Tooltip;
162653
+ var pixelTatio = GetDevicePixelRatio();
162654
+ if (pixelTatio===0) pixelTatio=1;
162655
+
162656
+ var x=tooltipData.X/pixelTatio;
162657
+ var mapTooltip=new Map(); //根据Y轴 归类
162658
+ for(var i=0; i<tooltipData.AryData.length;++i)
162659
+ {
162660
+ var item=tooltipData.AryData[i];
162661
+ var key=parseInt(item.Y);
162662
+ if (mapTooltip.has(key))
162663
+ {
162664
+ var mapItem=mapTooltip.get(key);
162665
+ mapItem.AryData.push(item);
162666
+ }
162667
+ else
162668
+ {
162669
+ mapTooltip.set(key, { Key:key, Point:{ X:x, Y:item.Y/pixelTatio }, AryData:[ item ] });
162670
+ }
162671
+ }
162672
+
162673
+ var aryData=[];
162674
+ for(var mapItem of mapTooltip) aryData.push(mapItem[1]);
162675
+
162676
+ for(var i=0; i<aryData.length && i<this.AryTooltip.length; ++i)
162677
+ {
162678
+ var item=aryData[i];
162679
+ var tooltipItem=this.AryTooltip[i];
162680
+ tooltipItem.Update(item);
162681
+ }
162682
+
162683
+ for(var i=tooltipData.AryData.length; i<this.AryTooltip.length; ++i)
162684
+ {
162685
+ var item=this.AryTooltip[i];
162686
+ item.Hide();
162687
+ }
162688
+ }
162689
+
162690
+ this.Hide=function()
162691
+ {
162692
+ for(var i=0;i<this.AryTooltip.length;++i)
162693
+ {
162694
+ var item=this.AryTooltip[i];
162695
+ item.Hide();
162696
+ }
162697
+ }
162698
+ }
161622
162699
  /*
161623
162700
  Copyright (c) 2018 jones
161624
162701
 
@@ -163910,7 +164987,7 @@ function HQChartScriptWorker()
163910
164987
 
163911
164988
 
163912
164989
 
163913
- var HQCHART_VERSION="1.1.15010";
164990
+ var HQCHART_VERSION="1.1.15025";
163914
164991
 
163915
164992
  function PrintHQChartVersion()
163916
164993
  {