hqchart 1.1.15008 → 1.1.15018

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.
@@ -4909,12 +4909,27 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4909
4909
  var item=option.LatestPointFlash;
4910
4910
  if (item.Enable)
4911
4911
  {
4912
- this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
4912
+ var zIndex=6;
4913
+ if (IFrameSplitOperator.IsNumber(item.ZIndex)) zIndex=item.ZIndex;
4914
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:zIndex });
4913
4915
  chart.CreateExtendChart("LatestPointFlashPaint", item);
4914
4916
  chart.StartLatestPointFlash();
4915
4917
  }
4916
4918
  }
4917
4919
 
4920
+ if (option.KLineCountDown)
4921
+ {
4922
+ var item=option.KLineCountDown;
4923
+ if (item.Enable)
4924
+ {
4925
+ var zIndex=4;
4926
+ if (IFrameSplitOperator.IsNumber(item.ZIndex)) zIndex=item.ZIndex;
4927
+ this.CreateExtraCanvasElement(JSChart.KLineCountDownKey, { ZIndex:zIndex });
4928
+ chart.CreateExtendChart("KLineCountDownPaint", item);
4929
+ chart.StartCountDown();
4930
+ }
4931
+ }
4932
+
4918
4933
  return chart;
4919
4934
  }
4920
4935
 
@@ -5973,6 +5988,9 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5973
5988
  if (option.FloatTooltip && option.FloatTooltip.Enable)
5974
5989
  chart.InitalFloatTooltip(option.FloatTooltip);
5975
5990
 
5991
+ if (option.SmallFloatTooltip && option.SmallFloatTooltip.Enable)
5992
+ chart.InitalSmallFloatTooltip(option.SmallFloatTooltip);
5993
+
5976
5994
  if (option.SelectRectDialog && option.SelectRectDialog.Enable)
5977
5995
  chart.InitalSelectRectDialog(option.SelectRectDialog);
5978
5996
 
@@ -6485,6 +6503,7 @@ JSChart.CorssCursorCanvasKey="hqchart_corsscursor";
6485
6503
  JSChart.TooltipCursorCanvasKey="hqchart_tooltip";
6486
6504
  JSChart.RectDragCanvasKey="hqchart_drag_rect";
6487
6505
  JSChart.LatestPointFlashKey="hqchart_point_flash"; //最新数据点闪烁
6506
+ JSChart.KLineCountDownKey="hqchart_kline_countdown"; //倒计时
6488
6507
 
6489
6508
  //初始化
6490
6509
  JSChart.Init=function(divElement,bScreen,bCacheCanvas)
@@ -6931,6 +6950,8 @@ var JSCHART_EVENT_ID=
6931
6950
  ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息\
6932
6951
 
6933
6952
  ON_FORMAT_TVLONGPOSITION_LABEL:176,
6953
+
6954
+ ON_FORMAT_COUNTDOWN_TEXT:177, //倒计时
6934
6955
  }
6935
6956
 
6936
6957
  var JSCHART_OPERATOR_ID=
@@ -7398,7 +7419,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7398
7419
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
7399
7420
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
7400
7421
 
7401
- this.LatestPointFlashOption={ Timer:null, DelayTime:100 };
7422
+ this.LatestPointFlashOption={ Timer:null, DelayTime:100 }; //最后一个数据闪烁
7423
+ this.CountDownOption={ Timer:null, DelayTime:300 }; //倒计时
7402
7424
 
7403
7425
  this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
7404
7426
 
@@ -7416,6 +7438,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7416
7438
  this.FloatTooltip; //浮动tooltip信息
7417
7439
  this.DialogSearchIndex; //指标搜索
7418
7440
  this.DialogModifyIndexParam; //指标参数修改
7441
+ this.SmallFloatTooltipGroup; //小浮框tooltip信息集合
7419
7442
 
7420
7443
 
7421
7444
  this.RestoreFocusTimer=null; //恢复焦点定时器
@@ -7500,6 +7523,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7500
7523
 
7501
7524
  this.GlobalOption.LatestPoint=null;
7502
7525
  this.GlobalOption.TradeStatus=null;
7526
+ this.GlobalOption.CountDown=null;
7503
7527
  }
7504
7528
 
7505
7529
  this.RestoreFocus=function(delay)
@@ -7572,6 +7596,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7572
7596
  this.FloatTooltip.Create();
7573
7597
  }
7574
7598
 
7599
+
7600
+ this.InitalSmallFloatTooltip=function(option)
7601
+ {
7602
+ if (this.SmallFloatTooltipGroup) return;
7603
+
7604
+ this.SmallFloatTooltipGroup=new JSSmallFloatTooltipGroup();
7605
+ this.SmallFloatTooltipGroup.Inital(this, option);
7606
+ this.SmallFloatTooltipGroup.Create();
7607
+ }
7608
+
7609
+
7575
7610
  this.InitalModifyDrawDialog=function()
7576
7611
  {
7577
7612
  if ( this.DialogModifyDraw) return;
@@ -7749,6 +7784,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7749
7784
  this.FloatTooltip.Hide();
7750
7785
  }
7751
7786
 
7787
+ this.HideSmallFloatTooltip=function()
7788
+ {
7789
+ if (!this.SmallFloatTooltipGroup) return;
7790
+
7791
+ this.SmallFloatTooltipGroup.Hide();
7792
+ }
7793
+
7752
7794
  this.DestroyTooltipDialog=function()
7753
7795
  {
7754
7796
  if (!this.DialogTooltip) return;
@@ -7765,6 +7807,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7765
7807
  this.FloatTooltip=null;
7766
7808
  }
7767
7809
 
7810
+ this.DestroySmallFloatTooltip=function()
7811
+ {
7812
+ if (!this.SmallFloatTooltipGroup) return;
7813
+
7814
+ this.SmallFloatTooltipGroup.Destroy();
7815
+ this.SmallFloatTooltipGroup=null;
7816
+ }
7817
+
7768
7818
  this.DestroySearchIndexDialog=function()
7769
7819
  {
7770
7820
  if (!this.DialogSearchIndex) return;
@@ -7818,6 +7868,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7818
7868
  {
7819
7869
  this.HideFloatTooltip();
7820
7870
  this.CloseTooltipDialog();
7871
+ this.HideSmallFloatTooltip();
7821
7872
 
7822
7873
  if (this.DialogDrawTool) this.DialogDrawTool.Close();
7823
7874
  this.CloseModifyDrawDialog();
@@ -7907,6 +7958,30 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7907
7958
  chart.FlashCount=flashCount;
7908
7959
  }
7909
7960
 
7961
+ this.StartCountDown=function()
7962
+ {
7963
+ this.CountDownOption.Timer=setInterval(()=>
7964
+ {
7965
+ this.DrawCountDown();
7966
+ }, this.CountDownOption.DelayTime);
7967
+ }
7968
+
7969
+ this.DrawCountDown=function()
7970
+ {
7971
+ var finder=this.GetExtendChartByClassName("KLineCountDownPaint");
7972
+ if (finder && finder.Chart)
7973
+ finder.Chart.Draw();
7974
+ }
7975
+
7976
+ this.StopCountDown=function()
7977
+ {
7978
+ if (this.CountDownOption.Timer)
7979
+ {
7980
+ clearInterval(this.CountDownOption.Timer);
7981
+ this.CountDownOption.Timer=null;
7982
+ }
7983
+ }
7984
+
7910
7985
  this.ChartDestroy=function() //销毁
7911
7986
  {
7912
7987
  this.IsDestroy=true;
@@ -7914,6 +7989,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7914
7989
 
7915
7990
  this.DestroyTooltipDialog();
7916
7991
  this.DestroyFloatTooltip();
7992
+ this.DestroySmallFloatTooltip();
7917
7993
 
7918
7994
  this.DestroySearchIndexDialog();
7919
7995
  this.DestroyDialogModifyIndexParam();
@@ -7928,6 +8004,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7928
8004
  if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
7929
8005
 
7930
8006
  this.StopLatestPointFlash();
8007
+ this.StopCountDown();
7931
8008
 
7932
8009
  document.oncontextmenu=null;
7933
8010
  this.RemoveAllEventListener();
@@ -11370,6 +11447,49 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11370
11447
  return null;
11371
11448
  }
11372
11449
 
11450
+ this.GetCorssCursorTooltipData=function(option)
11451
+ {
11452
+ if (!this.ChartCorssCursor) return null;
11453
+ if (this.ChartCorssCursor.Status===0) return null;
11454
+
11455
+ var kItem=this.ChartCorssCursor.StringFormatX.KItem;
11456
+ if (!kItem) return null;
11457
+
11458
+ //X轴取十字光标坐标
11459
+ var toolTip={ AryData:[], X:this.ChartCorssCursor.StringFormatX.Point.X };
11460
+
11461
+ for(var i=0;i<this.ChartPaint.length;++i)
11462
+ {
11463
+ var item=this.ChartPaint[i];
11464
+ if (!item.GetCorssCursorTooltipData) continue;
11465
+
11466
+ item.GetCorssCursorTooltipData(kItem, toolTip);
11467
+ }
11468
+
11469
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame))
11470
+ {
11471
+ for(var i=0;i<this.Frame.SubFrame.length;++i)
11472
+ {
11473
+ var subFrame=this.Frame.SubFrame[i];
11474
+ for(var j=0;j<subFrame.OverlayIndex.length;++j)
11475
+ {
11476
+ var overlayItem=subFrame.OverlayIndex[j];
11477
+ for(var k=0;k<overlayItem.ChartPaint.length;++k)
11478
+ {
11479
+ var item=overlayItem.ChartPaint[k];
11480
+ if (!item.GetCorssCursorTooltipData) continue;
11481
+
11482
+ item.GetCorssCursorTooltipData(kItem, toolTip);
11483
+ }
11484
+ }
11485
+ }
11486
+ }
11487
+
11488
+ if (!IFrameSplitOperator.IsNonEmptyArray(toolTip.AryData)) return null;
11489
+
11490
+ return toolTip;
11491
+ }
11492
+
11373
11493
  this.PtInExtendChartButtons=function(x,y)
11374
11494
  {
11375
11495
  for(var i=0;i<this.ExtendChartPaint.length; ++i)
@@ -11683,6 +11803,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11683
11803
  }
11684
11804
  }
11685
11805
 
11806
+ var corssTooltipData=this.GetCorssCursorTooltipData(null);
11807
+ if (corssTooltipData) this.DrawSmallFloatTooltip(corssTooltipData);
11808
+ else this.HideSmallFloatTooltip();
11809
+
11686
11810
  this.SetCursor(mouseStatus);
11687
11811
  }
11688
11812
 
@@ -12407,6 +12531,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12407
12531
 
12408
12532
  this.ShowTooltipByKeyDown=function()
12409
12533
  {
12534
+ var corssTooltipData=this.GetCorssCursorTooltipData(null);
12535
+ if (corssTooltipData) this.DrawSmallFloatTooltip(corssTooltipData);
12536
+ else this.HideSmallFloatTooltip();
12537
+
12410
12538
  if (!this.KLineTooltipConfig.Enable || !this.KLineTooltipConfig.EnableKeyDown)
12411
12539
  {
12412
12540
  this.HideFloatTooltip();
@@ -12425,7 +12553,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12425
12553
  var kItem=kData.Data[dataIndex];
12426
12554
  if (!kItem) return;
12427
12555
 
12428
- var data=this.Frame.Data;
12429
12556
  var toolTip=new TooltipData();
12430
12557
  toolTip.Data=kItem;
12431
12558
  toolTip.ChartPaint=this.ChartPaint[0];
@@ -12793,6 +12920,29 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12793
12920
  if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
12794
12921
 
12795
12922
  this.HideFloatTooltip();
12923
+ this.HideSmallFloatTooltip();
12924
+ }
12925
+
12926
+ this.DrawSmallFloatTooltip=function(toolTip)
12927
+ {
12928
+ if (!this.SmallFloatTooltipGroup) return;
12929
+
12930
+ this.UpdateSmallFloatTooltip(toolTip)
12931
+ }
12932
+
12933
+ this.UpdateSmallFloatTooltip=function(toolTip)
12934
+ {
12935
+ if (!this.SmallFloatTooltipGroup) return;
12936
+
12937
+ var sendData=
12938
+ {
12939
+ Tooltip:toolTip,
12940
+ Symbol:this.Symbol,
12941
+ Name:this.Name,
12942
+ DataType:1,
12943
+ };
12944
+
12945
+ this.SmallFloatTooltipGroup.Update(sendData);
12796
12946
  }
12797
12947
 
12798
12948
  this.UpdateSelectRect=function(start,end)
@@ -37967,7 +38117,8 @@ function ChartKLineTable()
37967
38117
  this.RowHeight=10; //行高
37968
38118
  this.RowHeightType=1; //0=均分 1=固定高度
37969
38119
  this.TextFontConfig=CloneData(g_JSChartResource.ChartKLineTable.TextFont);
37970
- this.ItemMergin=CloneData(g_JSChartResource.ChartKLineTable.ItemMergin);
38120
+ this.ItemMargin=CloneData(g_JSChartResource.ChartKLineTable.ItemMargin);
38121
+ this.CellWidth=12*GetDevicePixelRatio();
37971
38122
 
37972
38123
  this.TextFont;
37973
38124
  this.TextColor='rgb(0,0,0)';
@@ -37977,6 +38128,37 @@ function ChartKLineTable()
37977
38128
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
37978
38129
  this.GetKValue=ChartData.GetKValue;
37979
38130
  this.AryCellRect=[]; //保存单元格信息
38131
+
38132
+
38133
+ this.SetOption=function(option)
38134
+ {
38135
+ if (!option) return;
38136
+
38137
+ if (option.BGColor) this.BGColor=option.BGColor;
38138
+ if (option.TextColor) this.TextColor=option.TextColor;
38139
+ if (option.BorderColor) this.BorderColor=option.BorderColor;
38140
+ if (IFrameSplitOperator.IsNumber(option.RowNamePosition)) this.RowNamePosition=option.RowNamePosition;
38141
+ if (IFrameSplitOperator.IsNumber(option.RowHeightType)) this.RowHeightType=option.RowHeightType;
38142
+
38143
+ if (option.ItemMargin)
38144
+ {
38145
+ var subItem=option.ItemMargin;
38146
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) this.ItemMargin.Left=subItem.Left;
38147
+ if (IFrameSplitOperator.IsNumber(subItem.Top)) this.ItemMargin.Top=subItem.Top;
38148
+ if (IFrameSplitOperator.IsNumber(subItem.Bottom)) this.ItemMargin.Bottom=subItem.Bottom;
38149
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) this.ItemMargin.Right=subItem.Right;
38150
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) this.ItemMargin.YOffset=subItem.YOffset;
38151
+ }
38152
+
38153
+ if (option.TextFont)
38154
+ {
38155
+ var subItem=option.TextFont;
38156
+ if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) this.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
38157
+ if (subItem.Family) this.TextFontConfig.Family=subItem.Family;
38158
+ }
38159
+
38160
+ if (IFrameSplitOperator.IsPlusNumber(option.CellWidth)) this.CellWidth=option.CellWidth;
38161
+ }
37980
38162
 
37981
38163
  this.BuildCacheData=function()
37982
38164
  {
@@ -38035,7 +38217,7 @@ function ChartKLineTable()
38035
38217
  {
38036
38218
  if (this.RowHeightType==1)
38037
38219
  {
38038
- this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMergin.Top+this.ItemMergin.Bottom;
38220
+ this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMargin.Top+this.ItemMargin.Bottom;
38039
38221
  }
38040
38222
  else
38041
38223
  {
@@ -38094,23 +38276,40 @@ function ChartKLineTable()
38094
38276
 
38095
38277
  var itemHeight=this.RowHeight;
38096
38278
  var itemWidth=dataWidth+distanceWidth;
38097
- if (itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom>0) itemHeight=itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom;
38098
- if (itemWidth-this.ItemMergin.Left-this.ItemMergin.Right>0) itemWidth=itemWidth-this.ItemMergin.Left-this.ItemMergin.Right;
38279
+ if (itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom>0) itemHeight=itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom;
38280
+ if (itemWidth-this.ItemMargin.Left-this.ItemMargin.Right>0) itemWidth=itemWidth-this.ItemMargin.Left-this.ItemMargin.Right;
38099
38281
 
38100
38282
  var font=this.GetDynamicTextFont(itemHeight, itemWidth);
38101
38283
  this.TextFont=font;
38102
38284
  this.Canvas.font=this.TextFont;
38285
+ var bMinute=this.IsMinuteFrame();
38286
+ var cellWidth=1
38287
+ if (bMinute)
38288
+ {
38289
+ cellWidth=(border.Right-border.Left)/this.ChartFrame.XPointCount;
38290
+ if (cellWidth<1) cellWidth=1;
38291
+ }
38103
38292
 
38104
38293
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
38105
38294
  {
38106
38295
  var kItem=this.Data.Data[i];
38107
38296
  if (!kItem) continue;
38108
38297
 
38109
- var left=xOffset;
38110
- var right=xOffset+dataWidth+distanceWidth;
38111
- if (right>chartright) break;
38112
- var x=left+(right-left)/2;
38113
- if (x>chartright) break;
38298
+ if (bMinute)
38299
+ {
38300
+ var x=this.ChartFrame.GetXFromIndex(j);
38301
+ var left=x-cellWidth/2;
38302
+ var right=x+cellWidth/2;
38303
+ }
38304
+ else
38305
+ {
38306
+ var left=xOffset;
38307
+ var right=xOffset+dataWidth+distanceWidth;
38308
+ if (right>chartright) break;
38309
+ var x=left+(right-left)/2;
38310
+ if (x>chartright) break;
38311
+ }
38312
+
38114
38313
 
38115
38314
  var bDrawName=false;
38116
38315
  if (j==0 && this.RowNamePosition===1) bDrawName=true;
@@ -38134,7 +38333,7 @@ function ChartKLineTable()
38134
38333
 
38135
38334
  var x=left,y=top, width=right-left;
38136
38335
  var yOffset=3;
38137
- if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38336
+ if (this.ItemMargin.YOffset) yOffset=this.ItemMargin.YOffset;
38138
38337
  for(var i=0;i<this.RowName.length;++i)
38139
38338
  {
38140
38339
  var item=this.RowName[i];
@@ -38216,7 +38415,7 @@ function ChartKLineTable()
38216
38415
 
38217
38416
  var x=rtBG.Right, y=rtBG.Top;
38218
38417
  var yOffset=3;
38219
- if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38418
+ if (this.ItemMargin.YOffset) yOffset=this.ItemMargin.YOffset;
38220
38419
  for(var i=0;i<this.RowName.length;++i)
38221
38420
  {
38222
38421
  var item=this.RowName[i];
@@ -38247,7 +38446,7 @@ function ChartKLineTable()
38247
38446
 
38248
38447
  var x=left,y=top, width=right-left;
38249
38448
  var yOffset=3;
38250
- if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38449
+ if (this.ItemMargin.YOffset) yOffset=this.ItemMargin.YOffset;
38251
38450
  for(var i=0; i<data.Data.length; ++i, y+=this.RowHeight)
38252
38451
  {
38253
38452
  var item=data.Data[i];
@@ -44329,7 +44528,7 @@ function ChartMinutePriceLine()
44329
44528
  {
44330
44529
  InterLastPoint:{X:this.LastPoint.X, Y:this.LastPoint.Y}, //内部点 给画布用
44331
44530
  LastPoint:{X:this.LastPoint.X/pixelRatio, Y:this.LastPoint.Y/pixelRatio}, //外部点 给DOM用
44332
- Price:this.LastPoint.Price, Data:this.LastPoint.Data,
44531
+ Price:this.LastPoint.Value, Data:this.LastPoint.Data,
44333
44532
  PixelRatio:pixelRatio,
44334
44533
  };
44335
44534
  event.Callback(event,data,this);
@@ -51541,6 +51740,69 @@ function ChartStackedBar()
51541
51740
 
51542
51741
  }
51543
51742
 
51743
+ //绘制随光标移动的浮动文字。
51744
+ //用法:DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
51745
+ //例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
51746
+ function ChartDrawFlagText()
51747
+ {
51748
+ this.newMethod=IChartPainting; //派生
51749
+ this.newMethod();
51750
+ delete this.newMethod;
51751
+
51752
+ this.ClassName="ChartDrawFlagText";
51753
+
51754
+ this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
51755
+ this.AryData=[];
51756
+
51757
+ this.GetKValue=ChartData.GetKValue;
51758
+ this.BuildCacheData=function()
51759
+ {
51760
+ var mapData=new Map();
51761
+ this.MapCache=mapData;
51762
+ if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
51763
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
51764
+
51765
+ for(var i=0;i<this.Data.Data.length;++i)
51766
+ {
51767
+ var item=this.AryData[i];
51768
+ if (!item) continue;
51769
+
51770
+ var kItem=this.Data.Data[i];
51771
+ item.Date=kItem.Date;
51772
+ item.Time=kItem.Time;
51773
+
51774
+ var key=this.BuildKey(kItem);
51775
+ mapData.set(key, item);
51776
+ }
51777
+ }
51778
+
51779
+ this.Draw=function()
51780
+ {
51781
+
51782
+ }
51783
+
51784
+ this.GetCorssCursorTooltipData=function(kItem, tooltip)
51785
+ {
51786
+ if (!kItem) return null;
51787
+ if (!this.MapCache) return null;
51788
+
51789
+ var key=this.BuildKey(kItem);
51790
+ if (!this.MapCache.has(key)) return null;
51791
+
51792
+ var item=this.MapCache.get(key);
51793
+ if (item.YValue>this.ChartFrame.HorizontalMax || item.YValue<this.ChartFrame.HorizontalMin) return null;
51794
+
51795
+ var y=this.ChartFrame.GetYFromData(item.YValue,false);
51796
+ tooltip.AryData.push({ Data:item, Y:y, ChartPaint:this, Type:1 });
51797
+ return item;
51798
+ }
51799
+
51800
+ this.GetMaxMin=function()
51801
+ {
51802
+ return {Min:null, Max:null};
51803
+ }
51804
+ }
51805
+
51544
51806
  //锁 支持横屏
51545
51807
  function ChartLock()
51546
51808
  {
@@ -51969,7 +52231,8 @@ function ExtendChartPaintFactory()
51969
52231
  ["DragMovePaint", { Create:function() { return new DragMovePaint(); } }],
51970
52232
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
51971
52233
  ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
51972
- ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}]
52234
+ ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}],
52235
+ ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}]
51973
52236
  ]
51974
52237
  );
51975
52238
 
@@ -56711,6 +56974,238 @@ function LatestPointFlashPaint()
56711
56974
  }
56712
56975
  }
56713
56976
 
56977
+
56978
+ //K线倒计时
56979
+ function KLineCountDownPaint()
56980
+ {
56981
+ this.newMethod=IExtendChartPainting; //派生
56982
+ this.newMethod();
56983
+ delete this.newMethod;
56984
+
56985
+ this.ClassName='KLineCountDownPaint';
56986
+ this.HQChart;
56987
+ this.CanvasEx;
56988
+ this.Frequency=500; //闪烁频率ms
56989
+ this.Font=g_JSChartResource.KLineCountDownPaint.Font;
56990
+ this.PriceColor=g_JSChartResource.KLineCountDownPaint.PriceColor;
56991
+ this.TimeColor=g_JSChartResource.KLineCountDownPaint.TimeColor;
56992
+
56993
+ this.TextMargin=CloneData(g_JSChartResource.KLineCountDownPaint.TextMargin);
56994
+ this.LabelMargin=CloneData(g_JSChartResource.KLineCountDownPaint.LabelMargin);
56995
+ this.LineConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Line); //{ IsShow:true, Width:1, Dash:[3,4] };
56996
+
56997
+ this.UnchangeConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Unchange);
56998
+ this.UpConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Up);
56999
+ this.DownConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Down);
57000
+
57001
+ //临时使用
57002
+ this.MainFrame;
57003
+ this.LastItem;
57004
+
57005
+ this.SetOption=function(option)
57006
+ {
57007
+ if (this.HQChart)
57008
+ {
57009
+ var extraElement=this.HQChart.GetExtraCanvas(JSChart.KLineCountDownKey);
57010
+ if (extraElement && extraElement.Canvas) this.CanvasEx=extraElement.Canvas; //绑定独立的画布
57011
+ }
57012
+
57013
+ if (option)
57014
+ {
57015
+ if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
57016
+ if (option.TextMargin) CopyMarginConfig(option.TextMargin, this.TextMargin);
57017
+ if (option.LabelMargin) CopyMarginConfig(option.LabelMargin, this.LabelMargin);
57018
+ if (option.UnchangeColor) this.UnchangeColor=option.UnchangeColor;
57019
+ if (option.UpColor) this.UpColor=option.UpColor;
57020
+ if (option.DownColor) this.DownColor=option.DownColor;
57021
+
57022
+ if (option.Line)
57023
+ {
57024
+ var item=option.Line;
57025
+ if (IFrameSplitOperator.IsBool(item.IsShow)) this.LineConfig.IsShow=item.IsShow;
57026
+ if (IFrameSplitOperator.IsNumber(item.Width)) this.LineConfig.Width=item.Width;
57027
+ if (item.Dash) this.LineConfig.Dash=item.Dash;
57028
+ }
57029
+ }
57030
+ }
57031
+
57032
+ this.ReloadResource=function(resource)
57033
+ {
57034
+ this.Font=g_JSChartResource.KLineCountDownPaint.Font;
57035
+ this.PriceColor=g_JSChartResource.KLineCountDownPaint.PriceColor;
57036
+ this.TimeColor=g_JSChartResource.KLineCountDownPaint.TimeColor;
57037
+
57038
+ this.TextMargin=CloneData(g_JSChartResource.KLineCountDownPaint.TextMargin);
57039
+ this.LabelMargin=CloneData(g_JSChartResource.KLineCountDownPaint.LabelMargin);
57040
+ this.LineConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Line); //{ IsShow:true, Width:1, Dash:[3,4] };
57041
+
57042
+ this.UnchangeConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Unchange);
57043
+ this.UpConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Up);
57044
+ this.DownConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Down);
57045
+ }
57046
+
57047
+ this.Draw=function()
57048
+ {
57049
+ this.MainFrame=null;
57050
+ this.LastItem=null;
57051
+
57052
+ if (!this.HQChart) return;
57053
+ if (!this.CanvasEx) return;
57054
+ this.HQChart.ClearCanvas(this.CanvasEx);
57055
+ var kData=this.HQChart.GetKData();
57056
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
57057
+
57058
+ var lastItem=kData.Data[kData.Data.length-1];
57059
+ if (!lastItem || !IFrameSplitOperator.IsNumber(lastItem.Close)) return;
57060
+ var frame=this.ChartFrame.SubFrame[0].Frame;
57061
+ if (!frame) return;
57062
+ var price=lastItem.Close;
57063
+ if (price>frame.HorizontalMax || price<frame.HorizontalMin) return;
57064
+
57065
+ if (frame.IsHScreen) return;
57066
+
57067
+ this.MainFrame=frame;
57068
+ this.LastItem=lastItem;
57069
+
57070
+ this.CanvasEx.save();
57071
+ this.DrawDownPaint();
57072
+ this.CanvasEx.restore();
57073
+
57074
+ this.MainFrame=null;
57075
+ this.LastItem=null;
57076
+ //if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.CountDown) return;
57077
+ }
57078
+
57079
+ this.DrawDownPaint=function()
57080
+ {
57081
+ if (!this.MainFrame || !this.LastItem || !IFrameSplitOperator.IsNumber(this.LastItem.Close)) return;
57082
+
57083
+ var decNum=GetfloatPrecision(this.HQChart.Symbol); //小数位数
57084
+ var yPrice=this.MainFrame.GetYFromData(this.LastItem.Close,false);
57085
+ var strPrice=this.LastItem.Close.toFixed(decNum);
57086
+
57087
+ var config=this.GetColorConfig(this.LastItem);
57088
+ var out={ BGColor:config.BGColor, Font:this.Font, AryText:[ ], YPrice:yPrice };
57089
+
57090
+ var item={ Text:strPrice, Color:config.PriceColor };
57091
+ out.AryText.push(item);
57092
+
57093
+ var item={ Text:"--:--", Color:config.TimeColor};
57094
+ out.AryText.push(item);
57095
+
57096
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_COUNTDOWN_TEXT);
57097
+ if (event && event.Callback)
57098
+ {
57099
+ var sendData={ LastItem:this.LastItem, Frame:this.MainFrame, Out:out, Period:this.HQChart.Period, Symbol:this.HQChart.Symbol };
57100
+ event.Callback(event, sendData, this);
57101
+ }
57102
+
57103
+ if (!this.CalculateLableSize(out)) return;
57104
+
57105
+ this.DrawLable(out);
57106
+ }
57107
+
57108
+ this.CalculateLableSize=function(out)
57109
+ {
57110
+ if (!out || !IFrameSplitOperator.IsNonEmptyArray(out.AryText)) return false;
57111
+
57112
+ this.CanvasEx.font=this.Font;
57113
+ this.FontHeight=this.CanvasEx.measureText("O").width; //行高
57114
+
57115
+ var lableWidth=0, lableHeight=0
57116
+ for(var i=0; i<out.AryText.length; ++i)
57117
+ {
57118
+ var item=out.AryText[i];
57119
+ if (!item || !item.Text) continue;
57120
+ item.TextWidth=this.CanvasEx.measureText(item.Text).width;
57121
+ item.TextWidth+=this.TextMargin.Left+this.TextMargin.Right;
57122
+
57123
+ if (lableWidth<item.TextWidth) lableWidth=item.TextWidth;
57124
+ lableHeight+=this.FontHeight+this.TextMargin.Top+this.TextMargin.Bottom;
57125
+ }
57126
+
57127
+ out.Width=lableWidth+this.LabelMargin.Left+this.LabelMargin.Right;
57128
+ out.Height=lableHeight+this.LabelMargin.Top+this.LabelMargin.Bottom;
57129
+
57130
+ return true;
57131
+ }
57132
+
57133
+ this.FixedRect=function(rt)
57134
+ {
57135
+ rt.Left=ToFixedRect(rt.Left);
57136
+ rt.Top=ToFixedRect(rt.Top);
57137
+ rt.Width=ToFixedRect(rt.Width);
57138
+ rt.Height=ToFixedRect(rt.Height);
57139
+
57140
+ rt.Right=rt.Left+rt.Width;
57141
+ rt.Bottom=rt.Top+rt.Height;
57142
+ }
57143
+
57144
+ this.DrawLable=function(out)
57145
+ {
57146
+ if (!out || !IFrameSplitOperator.IsNonEmptyArray(out.AryText)) return;
57147
+
57148
+ var border=this.MainFrame.GetBorder();
57149
+ var chartBorder=this.MainFrame.ChartBorder;
57150
+ var lineHeight=this.FontHeight+this.TextMargin.Top+this.TextMargin.Bottom;
57151
+ if (chartBorder.Right>10 ) //外部刻度
57152
+ {
57153
+ var rtBG={ Left:border.Right, Top:out.YPrice-lineHeight/2, Width:out.Width, Height:out.Height };
57154
+ rtBG.Right=rtBG.Left+rtBG.Width;
57155
+ if (rtBG.Right>border.ChartWidth)
57156
+ {
57157
+ rtBG.Right=border.ChartWidth-1;
57158
+ rtBG.Left=rtBG.Right-rtBG.Width;
57159
+ }
57160
+
57161
+ this.FixedRect(rtBG);
57162
+ this.CanvasEx.fillStyle=out.BGColor;
57163
+ this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
57164
+ }
57165
+
57166
+ this.Canvas.textAlign = "left";
57167
+ this.Canvas.textBaseline = "bottom";
57168
+ var yText=rtBG.Top+lineHeight+this.LabelMargin.Top;
57169
+ var xText=rtBG.Left+this.TextMargin.Left+this.LabelMargin.Left;
57170
+ for(var i=0;i<out.AryText.length;++i)
57171
+ {
57172
+ var item=out.AryText[i];
57173
+ var yOffset=this.TextMargin.YOffset;
57174
+
57175
+ this.CanvasEx.fillStyle=item.Color;
57176
+ this.CanvasEx.fillText(item.Text, xText, yText+yOffset-this.TextMargin.Bottom);
57177
+
57178
+ yText+=lineHeight;
57179
+ }
57180
+
57181
+ //线段
57182
+ var config=this.LineConfig;
57183
+ if (config.IsShow)
57184
+ {
57185
+ this.CanvasEx.strokeStyle=out.BGColor;
57186
+ this.CanvasEx.lineWidth=config.Width;
57187
+ if (IFrameSplitOperator.IsNonEmptyArray(config.Dash)) this.CanvasEx.setLineDash(config.Dash);
57188
+ this.CanvasEx.beginPath();
57189
+ var xLeft=border.LeftEx;
57190
+ var xRight=rtBG.Left;
57191
+ this.CanvasEx.moveTo(xLeft,ToFixedPoint(out.YPrice));
57192
+ this.CanvasEx.lineTo(xRight,ToFixedPoint(out.YPrice));
57193
+ this.CanvasEx.stroke();
57194
+ }
57195
+ }
57196
+
57197
+ this.GetColorConfig=function(kItem, symbol)
57198
+ {
57199
+ var config=this.UnchangeConfig;
57200
+ if (!kItem) return config;
57201
+
57202
+ if (kItem.Close>kItem.YClose) config=this.UpConfig;
57203
+ else if (kItem.Close<kItem.YClose) config=this.DownConfig;
57204
+
57205
+ return config;
57206
+ }
57207
+ }
57208
+
56714
57209
  //拖拽效果图
56715
57210
  var JSCHART_DRAGCHART_TYPE_ID=
56716
57211
  {
@@ -70641,6 +71136,7 @@ function ChartDrawHLine()
70641
71136
  this.Font=14*GetDevicePixelRatio() +"px 微软雅黑";
70642
71137
  this.TextFont=12*GetDevicePixelRatio() +"px 微软雅黑";
70643
71138
  this.RightSpaceWidth=50;
71139
+ this.PriceBGColor;
70644
71140
 
70645
71141
  this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
70646
71142
  this.ButtonBGColor='rgb(190,190,190)';
@@ -70747,6 +71243,8 @@ function ChartDrawHLine()
70747
71243
  if (IFrameSplitOperator.IsNumber(item.Bottom)) this.TextMargin.Bottom=item.Bottom;
70748
71244
  if (IFrameSplitOperator.IsNumber(item.YOffset)) this.TextMargin.YOffset=item.YOffset;
70749
71245
  }
71246
+
71247
+ if (option.PriceBGColor) this.PriceBGColor=option.PriceBGColor;
70750
71248
  }
70751
71249
  }
70752
71250
 
@@ -71187,7 +71685,8 @@ function ChartDrawHLine()
71187
71685
  if (!bVisibleRange) this.Canvas.setLineDash([]);
71188
71686
  }
71189
71687
 
71190
- this.Canvas.fillStyle=this.LineColor;
71688
+ if (this.PriceBGColor) this.Canvas.fillStyle=this.PriceBGColor;
71689
+ else this.Canvas.fillStyle=this.LineColor;
71191
71690
  this.Canvas.font=this.Font;
71192
71691
  var textWidth=this.Canvas.measureText(strValue).width;
71193
71692
  var lineHeight=this.GetFontHeight();
@@ -80922,7 +81421,7 @@ function JSChartResource()
80922
81421
  this.ChartKLineTable=
80923
81422
  {
80924
81423
  TextFont:{ Family:'Arial' , FontMaxSize:25 },
80925
- ItemMergin:{ Left:5, Right:5, Top:4, Bottom:2 },
81424
+ ItemMargin:{ Left:5, Right:5, Top:4, Bottom:2 },
80926
81425
  };
80927
81426
 
80928
81427
  this.ChartSimpleTable=
@@ -81490,6 +81989,18 @@ function JSChartResource()
81490
81989
  SplitLine:{ Color:'rgb(73,133,231)', Width:1*GetDevicePixelRatio(), Dash:[5*GetDevicePixelRatio(),5*GetDevicePixelRatio()] }
81491
81990
  }
81492
81991
 
81992
+ this.KLineCountDownPaint=
81993
+ {
81994
+ Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
81995
+ TextMargin:{ Left:0, Right:0, Bottom:2, Top:2, YOffset:0 },
81996
+ LabelMargin:{ Left:5, Right:5, Bottom:4, Top:2 },
81997
+ Line:{ IsShow:true, Width:1, Dash:[5*GetDevicePixelRatio(), 5*GetDevicePixelRatio()] },
81998
+
81999
+ Unchange:{ BGColor:"rgb(0,0,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82000
+ Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82001
+ Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82002
+ }
82003
+
81493
82004
 
81494
82005
  //成交明细
81495
82006
  this.DealList=
@@ -82822,6 +83333,61 @@ function JSChartResource()
82822
83333
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
82823
83334
 
82824
83335
  if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
83336
+ if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
83337
+ }
83338
+
83339
+
83340
+ this.SetKLineCountDownPaint=function(style)
83341
+ {
83342
+ var dest=this.KLineCountDownPaint;
83343
+ if (style.Font) dest.Font=style.Font;
83344
+
83345
+ if (style.TextMargin)
83346
+ {
83347
+ var item=style.TextMargin;
83348
+ CopyMarginConfig(dest.TextMargin, item);
83349
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.TextMargin.YOffset=item.YOffset;
83350
+ }
83351
+
83352
+ if (style.LabelMargin) CopyMarginConfig(dest.LabelMargin, style.LabelMargin);
83353
+
83354
+ if (style.Line)
83355
+ {
83356
+ var item=style.Line;
83357
+ if (IFrameSplitOperator.IsNumber(item.Width)) dest.Line.Width=item.Width;
83358
+ if (IFrameSplitOperator.IsBool(item.IsShow)) dest.Line.Width=item.Width;
83359
+ if (item.Dash) dest.Line.Dash=item.Dash;
83360
+ }
83361
+
83362
+ if (style.Unchange)
83363
+ {
83364
+ var item=style.Unchange;
83365
+ var subDest=dest.Unchange;
83366
+
83367
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83368
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83369
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83370
+ }
83371
+
83372
+ if (style.Up)
83373
+ {
83374
+ var item=style.Up;
83375
+ var subDest=dest.Up;
83376
+
83377
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83378
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83379
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83380
+ }
83381
+
83382
+ if (style.Down)
83383
+ {
83384
+ var item=style.Down;
83385
+ var subDest=dest.Down;
83386
+
83387
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83388
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83389
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83390
+ }
82825
83391
  }
82826
83392
 
82827
83393
 
@@ -117931,6 +118497,55 @@ function JSDraw(errorHandler,symbolData)
117931
118497
  this.ErrorHandler=errorHandler;
117932
118498
  this.SymbolData=symbolData;
117933
118499
 
118500
+ //绘制随光标移动的浮动文字。
118501
+ //用法: DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
118502
+ //例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
118503
+ this.DRAWFLAGTEXT=function(condition,price,text)
118504
+ {
118505
+ var drawData=[];
118506
+ var result={ DrawData:drawData, DrawType:'DRAWFLAGTEXT' };
118507
+ if (!text) return result;
118508
+
118509
+ if (Array.isArray(condition))
118510
+ {
118511
+ if (condition.length<=0) return result;
118512
+
118513
+ var bSinglePrice=IFrameSplitOperator.IsNumber(price);
118514
+ for(var i=0; i<condition.length; ++i)
118515
+ {
118516
+ drawData[i]=null;
118517
+
118518
+ if (isNaN(condition[i]) || !condition[i]) continue;
118519
+
118520
+ if (bSinglePrice)
118521
+ {
118522
+ drawData[i]={ YValue:price, Text:text };
118523
+ }
118524
+ else
118525
+ {
118526
+ if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
118527
+ }
118528
+ }
118529
+ }
118530
+ else if (IFrameSplitOperator.IsPlusNumber(condition))
118531
+ {
118532
+ var bSinglePrice=IFrameSplitOperator.IsNumber(price);
118533
+ for(var i=0;i<this.SymbolData.Data.Data.length;++i)
118534
+ {
118535
+ if (bSinglePrice)
118536
+ {
118537
+ drawData[i]={ YValue:price, Text:text };
118538
+ }
118539
+ else
118540
+ {
118541
+ if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
118542
+ }
118543
+ }
118544
+ }
118545
+
118546
+ return result;
118547
+ }
118548
+
117934
118549
  this.DRAWTEXT=function(condition,price,text)
117935
118550
  {
117936
118551
  let drawData=[];
@@ -120311,6 +120926,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
120311
120926
  "VERTLINE","HORLINE","TIPICON",
120312
120927
  "BUY","SELL","SELLSHORT","BUYSHORT",
120313
120928
  "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE","DRAWRADAR","DRAWDOUGHNUT",
120929
+ "DRAWFLAGTEXT"
120314
120930
  ]);
120315
120931
  if (setFunctionName.has(name)) return true;
120316
120932
 
@@ -126876,6 +127492,10 @@ function JSExecute(ast,option)
126876
127492
  node.Draw=this.Draw.DRAWTEXT_FIX(args[0],args[1],args[2],args[3],args[4]);
126877
127493
  node.Out=[];
126878
127494
  break;
127495
+ case "DRAWFLAGTEXT":
127496
+ node.Draw=this.Draw.DRAWFLAGTEXT(args[0],args[1],args[2]);
127497
+ node.Out=[];
127498
+ break;
126879
127499
  case 'SUPERDRAWTEXT':
126880
127500
  node.Draw=this.Draw.SUPERDRAWTEXT(args[0],args[1],args[2],args[3],args[4]);
126881
127501
  node.Out=[];
@@ -129701,6 +130321,22 @@ function ScriptIndex(name,script,args,option)
129701
130321
  hqChart.ChartPaint.push(chartText);
129702
130322
  }
129703
130323
 
130324
+ this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
130325
+ {
130326
+ var chart=new ChartDrawFlagText();
130327
+ chart.Canvas=hqChart.Canvas;
130328
+ chart.Name=varItem.Name;
130329
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
130330
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
130331
+ if (chart.ReloadResource) chart.ReloadResource();
130332
+
130333
+ chart.Data=hqChart.GetKData();
130334
+ if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
130335
+ chart.BuildCacheData();
130336
+
130337
+ hqChart.ChartPaint.push(chart);
130338
+ }
130339
+
129704
130340
  //COLORSTICK
129705
130341
  this.CreateMACD=function(hqChart,windowIndex,varItem,id)
129706
130342
  {
@@ -130866,31 +131502,7 @@ function ScriptIndex(name,script,args,option)
130866
131502
  if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
130867
131503
 
130868
131504
  var config=varItem.Draw.Config;
130869
- if (config)
130870
- {
130871
- if (config.BGColor) chart.BGColor=config.BGColor;
130872
- if (config.TextColor) chart.TextColor=config.TextColor;
130873
- if (config.BorderColor) chart.BorderColor=config.BorderColor;
130874
- if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
130875
- if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
130876
-
130877
- if (config.ItemMergin)
130878
- {
130879
- var subItem=config.ItemMergin;
130880
- if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
130881
- if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
130882
- if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
130883
- if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
130884
- if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
130885
- }
130886
-
130887
- if (config.TextFont)
130888
- {
130889
- var subItem=config.TextFont;
130890
- if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
130891
- if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
130892
- }
130893
- }
131505
+ chart.SetOption(config);
130894
131506
 
130895
131507
  chart.BuildCacheData();
130896
131508
  this.SetChartIndexName(chart);
@@ -131191,6 +131803,9 @@ function ScriptIndex(name,script,args,option)
131191
131803
  case 'DRAWTEXT':
131192
131804
  this.CreateDrawTextV2(hqChart,windowIndex,item,i);
131193
131805
  break;
131806
+ case "DRAWFLAGTEXT":
131807
+ this.CreateDrawFlagText(hqChart,windowIndex,item,i);
131808
+ break;
131194
131809
  case 'SUPERDRAWTEXT':
131195
131810
  this.CreateText(hqChart,windowIndex,item,i);
131196
131811
  break;
@@ -131612,6 +132227,8 @@ function OverlayScriptIndex(name,script,args,option)
131612
132227
  case 'DRAWTEXT':
131613
132228
  this.CreateDrawTextV2(hqChart,windowIndex,item,i);
131614
132229
  break;
132230
+ case "DRAWFLAGTEXT":
132231
+ this.CreateDrawFlagText(hqChart,windowIndex,item,i);
131615
132232
  case 'SUPERDRAWTEXT':
131616
132233
  this.CreateText(hqChart,windowIndex,item,i);
131617
132234
  break;
@@ -131976,6 +132593,25 @@ function OverlayScriptIndex(name,script,args,option)
131976
132593
  frame.ChartPaint.push(chartText);
131977
132594
  }
131978
132595
 
132596
+ this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
132597
+ {
132598
+ var overlayIndex=this.OverlayIndex;
132599
+ var frame=overlayIndex.Frame;
132600
+ var chart=new ChartDrawFlagText();
132601
+ chart.Canvas=hqChart.Canvas;
132602
+ chart.Name=varItem.Name;
132603
+ chart.ChartBorder=frame.Frame.ChartBorder;
132604
+ chart.ChartFrame=frame.Frame;
132605
+ chart.Identify=overlayIndex.Identify;
132606
+ if (chart.ReloadResource) chart.ReloadResource();
132607
+
132608
+ chart.Data=hqChart.GetKData();
132609
+ if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
132610
+ chart.BuildCacheData();
132611
+
132612
+ frame.ChartPaint.push(chart);
132613
+ }
132614
+
131979
132615
  //创建文本
131980
132616
  this.CreateText=function(hqChart,windowIndex,varItem,id, drawName)
131981
132617
  {
@@ -132575,33 +133211,7 @@ function OverlayScriptIndex(name,script,args,option)
132575
133211
  if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
132576
133212
 
132577
133213
  var config=varItem.Draw.Config;
132578
- if (config)
132579
- {
132580
- if (config.BGColor) chart.BGColor=config.BGColor;
132581
- if (config.TextColor) chart.TextColor=config.TextColor;
132582
- if (config.BorderColor) chart.BorderColor=config.BorderColor;
132583
- if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
132584
- if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
132585
- if (IFrameSplitOperator.IsNumber(config.Style)) chart.Style=config.Style;
132586
-
132587
- if (config.ItemMergin)
132588
- {
132589
- var subItem=config.ItemMergin;
132590
- if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
132591
- if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
132592
- if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
132593
- if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
132594
- if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
132595
- }
132596
-
132597
- if (config.TextFont)
132598
- {
132599
- var subItem=config.TextFont;
132600
- if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
132601
- if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
132602
- }
132603
- }
132604
-
133214
+ chart.SetOption(config);
132605
133215
  chart.BuildCacheData();
132606
133216
  frame.ChartPaint.push(chart);
132607
133217
 
@@ -134670,6 +135280,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
134670
135280
 
134671
135281
  result.push(outVarItem);
134672
135282
  }
135283
+ else if (draw.DrawType==SCRIPT_CHART_NAME.KLINE_TABLE)
135284
+ {
135285
+ drawItem.Name=draw.Name;
135286
+ drawItem.Type=draw.Type;
135287
+ drawItem.DrawType=draw.DrawType;
135288
+ drawItem.DrawData=draw.DrawData;
135289
+ drawItem.RowCount=draw.RowCount;
135290
+ drawItem.RowName=draw.RowName;
135291
+ drawItem.Config=draw.Config;
135292
+ outVarItem.Draw=drawItem;
135293
+ result.push(outVarItem);
135294
+ }
134673
135295
  else
134674
135296
  {
134675
135297
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -136063,6 +136685,13 @@ function GetBlackStyle()
136063
136685
  BGColor:[null, "rgb(42,46,57)"],
136064
136686
  SplitLine:{ Color:'rgb(73,133,231)', Width:1*GetDevicePixelRatio(), Dash:[5*GetDevicePixelRatio(),5*GetDevicePixelRatio()] }
136065
136687
  },
136688
+
136689
+ KLineCountDownPaint:
136690
+ {
136691
+ Unchange:{ BGColor:"rgb(190, 190 ,190)", PriceColor:"rgb(0,0,0)", TimeColor:"rgb(50,50,50)" },
136692
+ Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
136693
+ Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
136694
+ },
136066
136695
 
136067
136696
  //成交明细
136068
136697
  DealList:
@@ -152504,7 +153133,7 @@ function ScrollBarBGChart()
152504
153133
 
152505
153134
 
152506
153135
 
152507
- var HQCHART_VERSION="1.1.15007";
153136
+ var HQCHART_VERSION="1.1.15017";
152508
153137
 
152509
153138
  function PrintHQChartVersion()
152510
153139
  {