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.
@@ -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();
@@ -11414,6 +11491,49 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11414
11491
  return null;
11415
11492
  }
11416
11493
 
11494
+ this.GetCorssCursorTooltipData=function(option)
11495
+ {
11496
+ if (!this.ChartCorssCursor) return null;
11497
+ if (this.ChartCorssCursor.Status===0) return null;
11498
+
11499
+ var kItem=this.ChartCorssCursor.StringFormatX.KItem;
11500
+ if (!kItem) return null;
11501
+
11502
+ //X轴取十字光标坐标
11503
+ var toolTip={ AryData:[], X:this.ChartCorssCursor.StringFormatX.Point.X };
11504
+
11505
+ for(var i=0;i<this.ChartPaint.length;++i)
11506
+ {
11507
+ var item=this.ChartPaint[i];
11508
+ if (!item.GetCorssCursorTooltipData) continue;
11509
+
11510
+ item.GetCorssCursorTooltipData(kItem, toolTip);
11511
+ }
11512
+
11513
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame))
11514
+ {
11515
+ for(var i=0;i<this.Frame.SubFrame.length;++i)
11516
+ {
11517
+ var subFrame=this.Frame.SubFrame[i];
11518
+ for(var j=0;j<subFrame.OverlayIndex.length;++j)
11519
+ {
11520
+ var overlayItem=subFrame.OverlayIndex[j];
11521
+ for(var k=0;k<overlayItem.ChartPaint.length;++k)
11522
+ {
11523
+ var item=overlayItem.ChartPaint[k];
11524
+ if (!item.GetCorssCursorTooltipData) continue;
11525
+
11526
+ item.GetCorssCursorTooltipData(kItem, toolTip);
11527
+ }
11528
+ }
11529
+ }
11530
+ }
11531
+
11532
+ if (!IFrameSplitOperator.IsNonEmptyArray(toolTip.AryData)) return null;
11533
+
11534
+ return toolTip;
11535
+ }
11536
+
11417
11537
  this.PtInExtendChartButtons=function(x,y)
11418
11538
  {
11419
11539
  for(var i=0;i<this.ExtendChartPaint.length; ++i)
@@ -11727,6 +11847,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11727
11847
  }
11728
11848
  }
11729
11849
 
11850
+ var corssTooltipData=this.GetCorssCursorTooltipData(null);
11851
+ if (corssTooltipData) this.DrawSmallFloatTooltip(corssTooltipData);
11852
+ else this.HideSmallFloatTooltip();
11853
+
11730
11854
  this.SetCursor(mouseStatus);
11731
11855
  }
11732
11856
 
@@ -12451,6 +12575,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12451
12575
 
12452
12576
  this.ShowTooltipByKeyDown=function()
12453
12577
  {
12578
+ var corssTooltipData=this.GetCorssCursorTooltipData(null);
12579
+ if (corssTooltipData) this.DrawSmallFloatTooltip(corssTooltipData);
12580
+ else this.HideSmallFloatTooltip();
12581
+
12454
12582
  if (!this.KLineTooltipConfig.Enable || !this.KLineTooltipConfig.EnableKeyDown)
12455
12583
  {
12456
12584
  this.HideFloatTooltip();
@@ -12469,7 +12597,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12469
12597
  var kItem=kData.Data[dataIndex];
12470
12598
  if (!kItem) return;
12471
12599
 
12472
- var data=this.Frame.Data;
12473
12600
  var toolTip=new TooltipData();
12474
12601
  toolTip.Data=kItem;
12475
12602
  toolTip.ChartPaint=this.ChartPaint[0];
@@ -12837,6 +12964,29 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12837
12964
  if (this.Tooltip.style.display!="none") this.Tooltip.style.display = "none";
12838
12965
 
12839
12966
  this.HideFloatTooltip();
12967
+ this.HideSmallFloatTooltip();
12968
+ }
12969
+
12970
+ this.DrawSmallFloatTooltip=function(toolTip)
12971
+ {
12972
+ if (!this.SmallFloatTooltipGroup) return;
12973
+
12974
+ this.UpdateSmallFloatTooltip(toolTip)
12975
+ }
12976
+
12977
+ this.UpdateSmallFloatTooltip=function(toolTip)
12978
+ {
12979
+ if (!this.SmallFloatTooltipGroup) return;
12980
+
12981
+ var sendData=
12982
+ {
12983
+ Tooltip:toolTip,
12984
+ Symbol:this.Symbol,
12985
+ Name:this.Name,
12986
+ DataType:1,
12987
+ };
12988
+
12989
+ this.SmallFloatTooltipGroup.Update(sendData);
12840
12990
  }
12841
12991
 
12842
12992
  this.UpdateSelectRect=function(start,end)
@@ -38011,7 +38161,8 @@ function ChartKLineTable()
38011
38161
  this.RowHeight=10; //行高
38012
38162
  this.RowHeightType=1; //0=均分 1=固定高度
38013
38163
  this.TextFontConfig=CloneData(g_JSChartResource.ChartKLineTable.TextFont);
38014
- this.ItemMergin=CloneData(g_JSChartResource.ChartKLineTable.ItemMergin);
38164
+ this.ItemMargin=CloneData(g_JSChartResource.ChartKLineTable.ItemMargin);
38165
+ this.CellWidth=12*GetDevicePixelRatio();
38015
38166
 
38016
38167
  this.TextFont;
38017
38168
  this.TextColor='rgb(0,0,0)';
@@ -38021,6 +38172,37 @@ function ChartKLineTable()
38021
38172
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
38022
38173
  this.GetKValue=ChartData.GetKValue;
38023
38174
  this.AryCellRect=[]; //保存单元格信息
38175
+
38176
+
38177
+ this.SetOption=function(option)
38178
+ {
38179
+ if (!option) return;
38180
+
38181
+ if (option.BGColor) this.BGColor=option.BGColor;
38182
+ if (option.TextColor) this.TextColor=option.TextColor;
38183
+ if (option.BorderColor) this.BorderColor=option.BorderColor;
38184
+ if (IFrameSplitOperator.IsNumber(option.RowNamePosition)) this.RowNamePosition=option.RowNamePosition;
38185
+ if (IFrameSplitOperator.IsNumber(option.RowHeightType)) this.RowHeightType=option.RowHeightType;
38186
+
38187
+ if (option.ItemMargin)
38188
+ {
38189
+ var subItem=option.ItemMargin;
38190
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) this.ItemMargin.Left=subItem.Left;
38191
+ if (IFrameSplitOperator.IsNumber(subItem.Top)) this.ItemMargin.Top=subItem.Top;
38192
+ if (IFrameSplitOperator.IsNumber(subItem.Bottom)) this.ItemMargin.Bottom=subItem.Bottom;
38193
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) this.ItemMargin.Right=subItem.Right;
38194
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) this.ItemMargin.YOffset=subItem.YOffset;
38195
+ }
38196
+
38197
+ if (option.TextFont)
38198
+ {
38199
+ var subItem=option.TextFont;
38200
+ if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) this.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
38201
+ if (subItem.Family) this.TextFontConfig.Family=subItem.Family;
38202
+ }
38203
+
38204
+ if (IFrameSplitOperator.IsPlusNumber(option.CellWidth)) this.CellWidth=option.CellWidth;
38205
+ }
38024
38206
 
38025
38207
  this.BuildCacheData=function()
38026
38208
  {
@@ -38079,7 +38261,7 @@ function ChartKLineTable()
38079
38261
  {
38080
38262
  if (this.RowHeightType==1)
38081
38263
  {
38082
- this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMergin.Top+this.ItemMergin.Bottom;
38264
+ this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMargin.Top+this.ItemMargin.Bottom;
38083
38265
  }
38084
38266
  else
38085
38267
  {
@@ -38138,23 +38320,40 @@ function ChartKLineTable()
38138
38320
 
38139
38321
  var itemHeight=this.RowHeight;
38140
38322
  var itemWidth=dataWidth+distanceWidth;
38141
- if (itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom>0) itemHeight=itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom;
38142
- if (itemWidth-this.ItemMergin.Left-this.ItemMergin.Right>0) itemWidth=itemWidth-this.ItemMergin.Left-this.ItemMergin.Right;
38323
+ if (itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom>0) itemHeight=itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom;
38324
+ if (itemWidth-this.ItemMargin.Left-this.ItemMargin.Right>0) itemWidth=itemWidth-this.ItemMargin.Left-this.ItemMargin.Right;
38143
38325
 
38144
38326
  var font=this.GetDynamicTextFont(itemHeight, itemWidth);
38145
38327
  this.TextFont=font;
38146
38328
  this.Canvas.font=this.TextFont;
38329
+ var bMinute=this.IsMinuteFrame();
38330
+ var cellWidth=1
38331
+ if (bMinute)
38332
+ {
38333
+ cellWidth=(border.Right-border.Left)/this.ChartFrame.XPointCount;
38334
+ if (cellWidth<1) cellWidth=1;
38335
+ }
38147
38336
 
38148
38337
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
38149
38338
  {
38150
38339
  var kItem=this.Data.Data[i];
38151
38340
  if (!kItem) continue;
38152
38341
 
38153
- var left=xOffset;
38154
- var right=xOffset+dataWidth+distanceWidth;
38155
- if (right>chartright) break;
38156
- var x=left+(right-left)/2;
38157
- if (x>chartright) break;
38342
+ if (bMinute)
38343
+ {
38344
+ var x=this.ChartFrame.GetXFromIndex(j);
38345
+ var left=x-cellWidth/2;
38346
+ var right=x+cellWidth/2;
38347
+ }
38348
+ else
38349
+ {
38350
+ var left=xOffset;
38351
+ var right=xOffset+dataWidth+distanceWidth;
38352
+ if (right>chartright) break;
38353
+ var x=left+(right-left)/2;
38354
+ if (x>chartright) break;
38355
+ }
38356
+
38158
38357
 
38159
38358
  var bDrawName=false;
38160
38359
  if (j==0 && this.RowNamePosition===1) bDrawName=true;
@@ -38178,7 +38377,7 @@ function ChartKLineTable()
38178
38377
 
38179
38378
  var x=left,y=top, width=right-left;
38180
38379
  var yOffset=3;
38181
- if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38380
+ if (this.ItemMargin.YOffset) yOffset=this.ItemMargin.YOffset;
38182
38381
  for(var i=0;i<this.RowName.length;++i)
38183
38382
  {
38184
38383
  var item=this.RowName[i];
@@ -38260,7 +38459,7 @@ function ChartKLineTable()
38260
38459
 
38261
38460
  var x=rtBG.Right, y=rtBG.Top;
38262
38461
  var yOffset=3;
38263
- if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38462
+ if (this.ItemMargin.YOffset) yOffset=this.ItemMargin.YOffset;
38264
38463
  for(var i=0;i<this.RowName.length;++i)
38265
38464
  {
38266
38465
  var item=this.RowName[i];
@@ -38291,7 +38490,7 @@ function ChartKLineTable()
38291
38490
 
38292
38491
  var x=left,y=top, width=right-left;
38293
38492
  var yOffset=3;
38294
- if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38493
+ if (this.ItemMargin.YOffset) yOffset=this.ItemMargin.YOffset;
38295
38494
  for(var i=0; i<data.Data.length; ++i, y+=this.RowHeight)
38296
38495
  {
38297
38496
  var item=data.Data[i];
@@ -44373,7 +44572,7 @@ function ChartMinutePriceLine()
44373
44572
  {
44374
44573
  InterLastPoint:{X:this.LastPoint.X, Y:this.LastPoint.Y}, //内部点 给画布用
44375
44574
  LastPoint:{X:this.LastPoint.X/pixelRatio, Y:this.LastPoint.Y/pixelRatio}, //外部点 给DOM用
44376
- Price:this.LastPoint.Price, Data:this.LastPoint.Data,
44575
+ Price:this.LastPoint.Value, Data:this.LastPoint.Data,
44377
44576
  PixelRatio:pixelRatio,
44378
44577
  };
44379
44578
  event.Callback(event,data,this);
@@ -51585,6 +51784,69 @@ function ChartStackedBar()
51585
51784
 
51586
51785
  }
51587
51786
 
51787
+ //绘制随光标移动的浮动文字。
51788
+ //用法:DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
51789
+ //例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
51790
+ function ChartDrawFlagText()
51791
+ {
51792
+ this.newMethod=IChartPainting; //派生
51793
+ this.newMethod();
51794
+ delete this.newMethod;
51795
+
51796
+ this.ClassName="ChartDrawFlagText";
51797
+
51798
+ this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
51799
+ this.AryData=[];
51800
+
51801
+ this.GetKValue=ChartData.GetKValue;
51802
+ this.BuildCacheData=function()
51803
+ {
51804
+ var mapData=new Map();
51805
+ this.MapCache=mapData;
51806
+ if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
51807
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
51808
+
51809
+ for(var i=0;i<this.Data.Data.length;++i)
51810
+ {
51811
+ var item=this.AryData[i];
51812
+ if (!item) continue;
51813
+
51814
+ var kItem=this.Data.Data[i];
51815
+ item.Date=kItem.Date;
51816
+ item.Time=kItem.Time;
51817
+
51818
+ var key=this.BuildKey(kItem);
51819
+ mapData.set(key, item);
51820
+ }
51821
+ }
51822
+
51823
+ this.Draw=function()
51824
+ {
51825
+
51826
+ }
51827
+
51828
+ this.GetCorssCursorTooltipData=function(kItem, tooltip)
51829
+ {
51830
+ if (!kItem) return null;
51831
+ if (!this.MapCache) return null;
51832
+
51833
+ var key=this.BuildKey(kItem);
51834
+ if (!this.MapCache.has(key)) return null;
51835
+
51836
+ var item=this.MapCache.get(key);
51837
+ if (item.YValue>this.ChartFrame.HorizontalMax || item.YValue<this.ChartFrame.HorizontalMin) return null;
51838
+
51839
+ var y=this.ChartFrame.GetYFromData(item.YValue,false);
51840
+ tooltip.AryData.push({ Data:item, Y:y, ChartPaint:this, Type:1 });
51841
+ return item;
51842
+ }
51843
+
51844
+ this.GetMaxMin=function()
51845
+ {
51846
+ return {Min:null, Max:null};
51847
+ }
51848
+ }
51849
+
51588
51850
  //锁 支持横屏
51589
51851
  function ChartLock()
51590
51852
  {
@@ -52013,7 +52275,8 @@ function ExtendChartPaintFactory()
52013
52275
  ["DragMovePaint", { Create:function() { return new DragMovePaint(); } }],
52014
52276
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
52015
52277
  ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
52016
- ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}]
52278
+ ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}],
52279
+ ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}]
52017
52280
  ]
52018
52281
  );
52019
52282
 
@@ -56755,6 +57018,238 @@ function LatestPointFlashPaint()
56755
57018
  }
56756
57019
  }
56757
57020
 
57021
+
57022
+ //K线倒计时
57023
+ function KLineCountDownPaint()
57024
+ {
57025
+ this.newMethod=IExtendChartPainting; //派生
57026
+ this.newMethod();
57027
+ delete this.newMethod;
57028
+
57029
+ this.ClassName='KLineCountDownPaint';
57030
+ this.HQChart;
57031
+ this.CanvasEx;
57032
+ this.Frequency=500; //闪烁频率ms
57033
+ this.Font=g_JSChartResource.KLineCountDownPaint.Font;
57034
+ this.PriceColor=g_JSChartResource.KLineCountDownPaint.PriceColor;
57035
+ this.TimeColor=g_JSChartResource.KLineCountDownPaint.TimeColor;
57036
+
57037
+ this.TextMargin=CloneData(g_JSChartResource.KLineCountDownPaint.TextMargin);
57038
+ this.LabelMargin=CloneData(g_JSChartResource.KLineCountDownPaint.LabelMargin);
57039
+ this.LineConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Line); //{ IsShow:true, Width:1, Dash:[3,4] };
57040
+
57041
+ this.UnchangeConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Unchange);
57042
+ this.UpConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Up);
57043
+ this.DownConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Down);
57044
+
57045
+ //临时使用
57046
+ this.MainFrame;
57047
+ this.LastItem;
57048
+
57049
+ this.SetOption=function(option)
57050
+ {
57051
+ if (this.HQChart)
57052
+ {
57053
+ var extraElement=this.HQChart.GetExtraCanvas(JSChart.KLineCountDownKey);
57054
+ if (extraElement && extraElement.Canvas) this.CanvasEx=extraElement.Canvas; //绑定独立的画布
57055
+ }
57056
+
57057
+ if (option)
57058
+ {
57059
+ if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
57060
+ if (option.TextMargin) CopyMarginConfig(option.TextMargin, this.TextMargin);
57061
+ if (option.LabelMargin) CopyMarginConfig(option.LabelMargin, this.LabelMargin);
57062
+ if (option.UnchangeColor) this.UnchangeColor=option.UnchangeColor;
57063
+ if (option.UpColor) this.UpColor=option.UpColor;
57064
+ if (option.DownColor) this.DownColor=option.DownColor;
57065
+
57066
+ if (option.Line)
57067
+ {
57068
+ var item=option.Line;
57069
+ if (IFrameSplitOperator.IsBool(item.IsShow)) this.LineConfig.IsShow=item.IsShow;
57070
+ if (IFrameSplitOperator.IsNumber(item.Width)) this.LineConfig.Width=item.Width;
57071
+ if (item.Dash) this.LineConfig.Dash=item.Dash;
57072
+ }
57073
+ }
57074
+ }
57075
+
57076
+ this.ReloadResource=function(resource)
57077
+ {
57078
+ this.Font=g_JSChartResource.KLineCountDownPaint.Font;
57079
+ this.PriceColor=g_JSChartResource.KLineCountDownPaint.PriceColor;
57080
+ this.TimeColor=g_JSChartResource.KLineCountDownPaint.TimeColor;
57081
+
57082
+ this.TextMargin=CloneData(g_JSChartResource.KLineCountDownPaint.TextMargin);
57083
+ this.LabelMargin=CloneData(g_JSChartResource.KLineCountDownPaint.LabelMargin);
57084
+ this.LineConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Line); //{ IsShow:true, Width:1, Dash:[3,4] };
57085
+
57086
+ this.UnchangeConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Unchange);
57087
+ this.UpConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Up);
57088
+ this.DownConfig=CloneData(g_JSChartResource.KLineCountDownPaint.Down);
57089
+ }
57090
+
57091
+ this.Draw=function()
57092
+ {
57093
+ this.MainFrame=null;
57094
+ this.LastItem=null;
57095
+
57096
+ if (!this.HQChart) return;
57097
+ if (!this.CanvasEx) return;
57098
+ this.HQChart.ClearCanvas(this.CanvasEx);
57099
+ var kData=this.HQChart.GetKData();
57100
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return;
57101
+
57102
+ var lastItem=kData.Data[kData.Data.length-1];
57103
+ if (!lastItem || !IFrameSplitOperator.IsNumber(lastItem.Close)) return;
57104
+ var frame=this.ChartFrame.SubFrame[0].Frame;
57105
+ if (!frame) return;
57106
+ var price=lastItem.Close;
57107
+ if (price>frame.HorizontalMax || price<frame.HorizontalMin) return;
57108
+
57109
+ if (frame.IsHScreen) return;
57110
+
57111
+ this.MainFrame=frame;
57112
+ this.LastItem=lastItem;
57113
+
57114
+ this.CanvasEx.save();
57115
+ this.DrawDownPaint();
57116
+ this.CanvasEx.restore();
57117
+
57118
+ this.MainFrame=null;
57119
+ this.LastItem=null;
57120
+ //if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.CountDown) return;
57121
+ }
57122
+
57123
+ this.DrawDownPaint=function()
57124
+ {
57125
+ if (!this.MainFrame || !this.LastItem || !IFrameSplitOperator.IsNumber(this.LastItem.Close)) return;
57126
+
57127
+ var decNum=GetfloatPrecision(this.HQChart.Symbol); //小数位数
57128
+ var yPrice=this.MainFrame.GetYFromData(this.LastItem.Close,false);
57129
+ var strPrice=this.LastItem.Close.toFixed(decNum);
57130
+
57131
+ var config=this.GetColorConfig(this.LastItem);
57132
+ var out={ BGColor:config.BGColor, Font:this.Font, AryText:[ ], YPrice:yPrice };
57133
+
57134
+ var item={ Text:strPrice, Color:config.PriceColor };
57135
+ out.AryText.push(item);
57136
+
57137
+ var item={ Text:"--:--", Color:config.TimeColor};
57138
+ out.AryText.push(item);
57139
+
57140
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_COUNTDOWN_TEXT);
57141
+ if (event && event.Callback)
57142
+ {
57143
+ var sendData={ LastItem:this.LastItem, Frame:this.MainFrame, Out:out, Period:this.HQChart.Period, Symbol:this.HQChart.Symbol };
57144
+ event.Callback(event, sendData, this);
57145
+ }
57146
+
57147
+ if (!this.CalculateLableSize(out)) return;
57148
+
57149
+ this.DrawLable(out);
57150
+ }
57151
+
57152
+ this.CalculateLableSize=function(out)
57153
+ {
57154
+ if (!out || !IFrameSplitOperator.IsNonEmptyArray(out.AryText)) return false;
57155
+
57156
+ this.CanvasEx.font=this.Font;
57157
+ this.FontHeight=this.CanvasEx.measureText("O").width; //行高
57158
+
57159
+ var lableWidth=0, lableHeight=0
57160
+ for(var i=0; i<out.AryText.length; ++i)
57161
+ {
57162
+ var item=out.AryText[i];
57163
+ if (!item || !item.Text) continue;
57164
+ item.TextWidth=this.CanvasEx.measureText(item.Text).width;
57165
+ item.TextWidth+=this.TextMargin.Left+this.TextMargin.Right;
57166
+
57167
+ if (lableWidth<item.TextWidth) lableWidth=item.TextWidth;
57168
+ lableHeight+=this.FontHeight+this.TextMargin.Top+this.TextMargin.Bottom;
57169
+ }
57170
+
57171
+ out.Width=lableWidth+this.LabelMargin.Left+this.LabelMargin.Right;
57172
+ out.Height=lableHeight+this.LabelMargin.Top+this.LabelMargin.Bottom;
57173
+
57174
+ return true;
57175
+ }
57176
+
57177
+ this.FixedRect=function(rt)
57178
+ {
57179
+ rt.Left=ToFixedRect(rt.Left);
57180
+ rt.Top=ToFixedRect(rt.Top);
57181
+ rt.Width=ToFixedRect(rt.Width);
57182
+ rt.Height=ToFixedRect(rt.Height);
57183
+
57184
+ rt.Right=rt.Left+rt.Width;
57185
+ rt.Bottom=rt.Top+rt.Height;
57186
+ }
57187
+
57188
+ this.DrawLable=function(out)
57189
+ {
57190
+ if (!out || !IFrameSplitOperator.IsNonEmptyArray(out.AryText)) return;
57191
+
57192
+ var border=this.MainFrame.GetBorder();
57193
+ var chartBorder=this.MainFrame.ChartBorder;
57194
+ var lineHeight=this.FontHeight+this.TextMargin.Top+this.TextMargin.Bottom;
57195
+ if (chartBorder.Right>10 ) //外部刻度
57196
+ {
57197
+ var rtBG={ Left:border.Right, Top:out.YPrice-lineHeight/2, Width:out.Width, Height:out.Height };
57198
+ rtBG.Right=rtBG.Left+rtBG.Width;
57199
+ if (rtBG.Right>border.ChartWidth)
57200
+ {
57201
+ rtBG.Right=border.ChartWidth-1;
57202
+ rtBG.Left=rtBG.Right-rtBG.Width;
57203
+ }
57204
+
57205
+ this.FixedRect(rtBG);
57206
+ this.CanvasEx.fillStyle=out.BGColor;
57207
+ this.CanvasEx.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
57208
+ }
57209
+
57210
+ this.Canvas.textAlign = "left";
57211
+ this.Canvas.textBaseline = "bottom";
57212
+ var yText=rtBG.Top+lineHeight+this.LabelMargin.Top;
57213
+ var xText=rtBG.Left+this.TextMargin.Left+this.LabelMargin.Left;
57214
+ for(var i=0;i<out.AryText.length;++i)
57215
+ {
57216
+ var item=out.AryText[i];
57217
+ var yOffset=this.TextMargin.YOffset;
57218
+
57219
+ this.CanvasEx.fillStyle=item.Color;
57220
+ this.CanvasEx.fillText(item.Text, xText, yText+yOffset-this.TextMargin.Bottom);
57221
+
57222
+ yText+=lineHeight;
57223
+ }
57224
+
57225
+ //线段
57226
+ var config=this.LineConfig;
57227
+ if (config.IsShow)
57228
+ {
57229
+ this.CanvasEx.strokeStyle=out.BGColor;
57230
+ this.CanvasEx.lineWidth=config.Width;
57231
+ if (IFrameSplitOperator.IsNonEmptyArray(config.Dash)) this.CanvasEx.setLineDash(config.Dash);
57232
+ this.CanvasEx.beginPath();
57233
+ var xLeft=border.LeftEx;
57234
+ var xRight=rtBG.Left;
57235
+ this.CanvasEx.moveTo(xLeft,ToFixedPoint(out.YPrice));
57236
+ this.CanvasEx.lineTo(xRight,ToFixedPoint(out.YPrice));
57237
+ this.CanvasEx.stroke();
57238
+ }
57239
+ }
57240
+
57241
+ this.GetColorConfig=function(kItem, symbol)
57242
+ {
57243
+ var config=this.UnchangeConfig;
57244
+ if (!kItem) return config;
57245
+
57246
+ if (kItem.Close>kItem.YClose) config=this.UpConfig;
57247
+ else if (kItem.Close<kItem.YClose) config=this.DownConfig;
57248
+
57249
+ return config;
57250
+ }
57251
+ }
57252
+
56758
57253
  //拖拽效果图
56759
57254
  var JSCHART_DRAGCHART_TYPE_ID=
56760
57255
  {
@@ -70685,6 +71180,7 @@ function ChartDrawHLine()
70685
71180
  this.Font=14*GetDevicePixelRatio() +"px 微软雅黑";
70686
71181
  this.TextFont=12*GetDevicePixelRatio() +"px 微软雅黑";
70687
71182
  this.RightSpaceWidth=50;
71183
+ this.PriceBGColor;
70688
71184
 
70689
71185
  this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
70690
71186
  this.ButtonBGColor='rgb(190,190,190)';
@@ -70791,6 +71287,8 @@ function ChartDrawHLine()
70791
71287
  if (IFrameSplitOperator.IsNumber(item.Bottom)) this.TextMargin.Bottom=item.Bottom;
70792
71288
  if (IFrameSplitOperator.IsNumber(item.YOffset)) this.TextMargin.YOffset=item.YOffset;
70793
71289
  }
71290
+
71291
+ if (option.PriceBGColor) this.PriceBGColor=option.PriceBGColor;
70794
71292
  }
70795
71293
  }
70796
71294
 
@@ -71231,7 +71729,8 @@ function ChartDrawHLine()
71231
71729
  if (!bVisibleRange) this.Canvas.setLineDash([]);
71232
71730
  }
71233
71731
 
71234
- this.Canvas.fillStyle=this.LineColor;
71732
+ if (this.PriceBGColor) this.Canvas.fillStyle=this.PriceBGColor;
71733
+ else this.Canvas.fillStyle=this.LineColor;
71235
71734
  this.Canvas.font=this.Font;
71236
71735
  var textWidth=this.Canvas.measureText(strValue).width;
71237
71736
  var lineHeight=this.GetFontHeight();
@@ -80966,7 +81465,7 @@ function JSChartResource()
80966
81465
  this.ChartKLineTable=
80967
81466
  {
80968
81467
  TextFont:{ Family:'Arial' , FontMaxSize:25 },
80969
- ItemMergin:{ Left:5, Right:5, Top:4, Bottom:2 },
81468
+ ItemMargin:{ Left:5, Right:5, Top:4, Bottom:2 },
80970
81469
  };
80971
81470
 
80972
81471
  this.ChartSimpleTable=
@@ -81534,6 +82033,18 @@ function JSChartResource()
81534
82033
  SplitLine:{ Color:'rgb(73,133,231)', Width:1*GetDevicePixelRatio(), Dash:[5*GetDevicePixelRatio(),5*GetDevicePixelRatio()] }
81535
82034
  }
81536
82035
 
82036
+ this.KLineCountDownPaint=
82037
+ {
82038
+ Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
82039
+ TextMargin:{ Left:0, Right:0, Bottom:2, Top:2, YOffset:0 },
82040
+ LabelMargin:{ Left:5, Right:5, Bottom:4, Top:2 },
82041
+ Line:{ IsShow:true, Width:1, Dash:[5*GetDevicePixelRatio(), 5*GetDevicePixelRatio()] },
82042
+
82043
+ Unchange:{ BGColor:"rgb(0,0,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82044
+ Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82045
+ Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82046
+ }
82047
+
81537
82048
 
81538
82049
  //成交明细
81539
82050
  this.DealList=
@@ -82866,6 +83377,61 @@ function JSChartResource()
82866
83377
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
82867
83378
 
82868
83379
  if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
83380
+ if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
83381
+ }
83382
+
83383
+
83384
+ this.SetKLineCountDownPaint=function(style)
83385
+ {
83386
+ var dest=this.KLineCountDownPaint;
83387
+ if (style.Font) dest.Font=style.Font;
83388
+
83389
+ if (style.TextMargin)
83390
+ {
83391
+ var item=style.TextMargin;
83392
+ CopyMarginConfig(dest.TextMargin, item);
83393
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) dest.TextMargin.YOffset=item.YOffset;
83394
+ }
83395
+
83396
+ if (style.LabelMargin) CopyMarginConfig(dest.LabelMargin, style.LabelMargin);
83397
+
83398
+ if (style.Line)
83399
+ {
83400
+ var item=style.Line;
83401
+ if (IFrameSplitOperator.IsNumber(item.Width)) dest.Line.Width=item.Width;
83402
+ if (IFrameSplitOperator.IsBool(item.IsShow)) dest.Line.Width=item.Width;
83403
+ if (item.Dash) dest.Line.Dash=item.Dash;
83404
+ }
83405
+
83406
+ if (style.Unchange)
83407
+ {
83408
+ var item=style.Unchange;
83409
+ var subDest=dest.Unchange;
83410
+
83411
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83412
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83413
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83414
+ }
83415
+
83416
+ if (style.Up)
83417
+ {
83418
+ var item=style.Up;
83419
+ var subDest=dest.Up;
83420
+
83421
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83422
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83423
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83424
+ }
83425
+
83426
+ if (style.Down)
83427
+ {
83428
+ var item=style.Down;
83429
+ var subDest=dest.Down;
83430
+
83431
+ if (item.BGColor) subDest.BGColor=item.BGColor;
83432
+ if (item.PriceColor) subDest.PriceColor=item.PriceColor;
83433
+ if (item.TimeColor) subDest.TimeColor=item.TimeColor;
83434
+ }
82869
83435
  }
82870
83436
 
82871
83437
 
@@ -117975,6 +118541,55 @@ function JSDraw(errorHandler,symbolData)
117975
118541
  this.ErrorHandler=errorHandler;
117976
118542
  this.SymbolData=symbolData;
117977
118543
 
118544
+ //绘制随光标移动的浮动文字。
118545
+ //用法: DRAWFLAGTEXT(COND,PRICE,TEXT),光标处当COND条件满足时,在PRICE位置用半透明窗口显示文字TEXT,随光标移动而移动。将\\n插入TEXT内容中可实现文字换行。
118546
+ //例如:DRAWFLAGTEXT(CLOSE/OPEN>1.08,LOW,'大阳线')表示当光标移动到涨幅大于8%的地方,在最低价位置显示'大阳线'字样的浮动窗口。
118547
+ this.DRAWFLAGTEXT=function(condition,price,text)
118548
+ {
118549
+ var drawData=[];
118550
+ var result={ DrawData:drawData, DrawType:'DRAWFLAGTEXT' };
118551
+ if (!text) return result;
118552
+
118553
+ if (Array.isArray(condition))
118554
+ {
118555
+ if (condition.length<=0) return result;
118556
+
118557
+ var bSinglePrice=IFrameSplitOperator.IsNumber(price);
118558
+ for(var i=0; i<condition.length; ++i)
118559
+ {
118560
+ drawData[i]=null;
118561
+
118562
+ if (isNaN(condition[i]) || !condition[i]) continue;
118563
+
118564
+ if (bSinglePrice)
118565
+ {
118566
+ drawData[i]={ YValue:price, Text:text };
118567
+ }
118568
+ else
118569
+ {
118570
+ if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
118571
+ }
118572
+ }
118573
+ }
118574
+ else if (IFrameSplitOperator.IsPlusNumber(condition))
118575
+ {
118576
+ var bSinglePrice=IFrameSplitOperator.IsNumber(price);
118577
+ for(var i=0;i<this.SymbolData.Data.Data.length;++i)
118578
+ {
118579
+ if (bSinglePrice)
118580
+ {
118581
+ drawData[i]={ YValue:price, Text:text };
118582
+ }
118583
+ else
118584
+ {
118585
+ if (IFrameSplitOperator.IsNumber(price[i])) drawData[i]={ YValue:price[i], Text:text };
118586
+ }
118587
+ }
118588
+ }
118589
+
118590
+ return result;
118591
+ }
118592
+
117978
118593
  this.DRAWTEXT=function(condition,price,text)
117979
118594
  {
117980
118595
  let drawData=[];
@@ -120355,6 +120970,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
120355
120970
  "VERTLINE","HORLINE","TIPICON",
120356
120971
  "BUY","SELL","SELLSHORT","BUYSHORT",
120357
120972
  "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE","DRAWRADAR","DRAWDOUGHNUT",
120973
+ "DRAWFLAGTEXT"
120358
120974
  ]);
120359
120975
  if (setFunctionName.has(name)) return true;
120360
120976
 
@@ -126920,6 +127536,10 @@ function JSExecute(ast,option)
126920
127536
  node.Draw=this.Draw.DRAWTEXT_FIX(args[0],args[1],args[2],args[3],args[4]);
126921
127537
  node.Out=[];
126922
127538
  break;
127539
+ case "DRAWFLAGTEXT":
127540
+ node.Draw=this.Draw.DRAWFLAGTEXT(args[0],args[1],args[2]);
127541
+ node.Out=[];
127542
+ break;
126923
127543
  case 'SUPERDRAWTEXT':
126924
127544
  node.Draw=this.Draw.SUPERDRAWTEXT(args[0],args[1],args[2],args[3],args[4]);
126925
127545
  node.Out=[];
@@ -129745,6 +130365,22 @@ function ScriptIndex(name,script,args,option)
129745
130365
  hqChart.ChartPaint.push(chartText);
129746
130366
  }
129747
130367
 
130368
+ this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
130369
+ {
130370
+ var chart=new ChartDrawFlagText();
130371
+ chart.Canvas=hqChart.Canvas;
130372
+ chart.Name=varItem.Name;
130373
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
130374
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
130375
+ if (chart.ReloadResource) chart.ReloadResource();
130376
+
130377
+ chart.Data=hqChart.GetKData();
130378
+ if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
130379
+ chart.BuildCacheData();
130380
+
130381
+ hqChart.ChartPaint.push(chart);
130382
+ }
130383
+
129748
130384
  //COLORSTICK
129749
130385
  this.CreateMACD=function(hqChart,windowIndex,varItem,id)
129750
130386
  {
@@ -130910,31 +131546,7 @@ function ScriptIndex(name,script,args,option)
130910
131546
  if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
130911
131547
 
130912
131548
  var config=varItem.Draw.Config;
130913
- if (config)
130914
- {
130915
- if (config.BGColor) chart.BGColor=config.BGColor;
130916
- if (config.TextColor) chart.TextColor=config.TextColor;
130917
- if (config.BorderColor) chart.BorderColor=config.BorderColor;
130918
- if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
130919
- if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
130920
-
130921
- if (config.ItemMergin)
130922
- {
130923
- var subItem=config.ItemMergin;
130924
- if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
130925
- if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
130926
- if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
130927
- if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
130928
- if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
130929
- }
130930
-
130931
- if (config.TextFont)
130932
- {
130933
- var subItem=config.TextFont;
130934
- if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
130935
- if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
130936
- }
130937
- }
131549
+ chart.SetOption(config);
130938
131550
 
130939
131551
  chart.BuildCacheData();
130940
131552
  this.SetChartIndexName(chart);
@@ -131235,6 +131847,9 @@ function ScriptIndex(name,script,args,option)
131235
131847
  case 'DRAWTEXT':
131236
131848
  this.CreateDrawTextV2(hqChart,windowIndex,item,i);
131237
131849
  break;
131850
+ case "DRAWFLAGTEXT":
131851
+ this.CreateDrawFlagText(hqChart,windowIndex,item,i);
131852
+ break;
131238
131853
  case 'SUPERDRAWTEXT':
131239
131854
  this.CreateText(hqChart,windowIndex,item,i);
131240
131855
  break;
@@ -131656,6 +132271,8 @@ function OverlayScriptIndex(name,script,args,option)
131656
132271
  case 'DRAWTEXT':
131657
132272
  this.CreateDrawTextV2(hqChart,windowIndex,item,i);
131658
132273
  break;
132274
+ case "DRAWFLAGTEXT":
132275
+ this.CreateDrawFlagText(hqChart,windowIndex,item,i);
131659
132276
  case 'SUPERDRAWTEXT':
131660
132277
  this.CreateText(hqChart,windowIndex,item,i);
131661
132278
  break;
@@ -132020,6 +132637,25 @@ function OverlayScriptIndex(name,script,args,option)
132020
132637
  frame.ChartPaint.push(chartText);
132021
132638
  }
132022
132639
 
132640
+ this.CreateDrawFlagText=function(hqChart,windowIndex,varItem,id)
132641
+ {
132642
+ var overlayIndex=this.OverlayIndex;
132643
+ var frame=overlayIndex.Frame;
132644
+ var chart=new ChartDrawFlagText();
132645
+ chart.Canvas=hqChart.Canvas;
132646
+ chart.Name=varItem.Name;
132647
+ chart.ChartBorder=frame.Frame.ChartBorder;
132648
+ chart.ChartFrame=frame.Frame;
132649
+ chart.Identify=overlayIndex.Identify;
132650
+ if (chart.ReloadResource) chart.ReloadResource();
132651
+
132652
+ chart.Data=hqChart.GetKData();
132653
+ if (varItem.Draw.DrawData) chart.AryData=varItem.Draw.DrawData;
132654
+ chart.BuildCacheData();
132655
+
132656
+ frame.ChartPaint.push(chart);
132657
+ }
132658
+
132023
132659
  //创建文本
132024
132660
  this.CreateText=function(hqChart,windowIndex,varItem,id, drawName)
132025
132661
  {
@@ -132619,33 +133255,7 @@ function OverlayScriptIndex(name,script,args,option)
132619
133255
  if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
132620
133256
 
132621
133257
  var config=varItem.Draw.Config;
132622
- if (config)
132623
- {
132624
- if (config.BGColor) chart.BGColor=config.BGColor;
132625
- if (config.TextColor) chart.TextColor=config.TextColor;
132626
- if (config.BorderColor) chart.BorderColor=config.BorderColor;
132627
- if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
132628
- if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
132629
- if (IFrameSplitOperator.IsNumber(config.Style)) chart.Style=config.Style;
132630
-
132631
- if (config.ItemMergin)
132632
- {
132633
- var subItem=config.ItemMergin;
132634
- if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
132635
- if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
132636
- if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
132637
- if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
132638
- if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
132639
- }
132640
-
132641
- if (config.TextFont)
132642
- {
132643
- var subItem=config.TextFont;
132644
- if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
132645
- if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
132646
- }
132647
- }
132648
-
133258
+ chart.SetOption(config);
132649
133259
  chart.BuildCacheData();
132650
133260
  frame.ChartPaint.push(chart);
132651
133261
 
@@ -134714,6 +135324,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
134714
135324
 
134715
135325
  result.push(outVarItem);
134716
135326
  }
135327
+ else if (draw.DrawType==SCRIPT_CHART_NAME.KLINE_TABLE)
135328
+ {
135329
+ drawItem.Name=draw.Name;
135330
+ drawItem.Type=draw.Type;
135331
+ drawItem.DrawType=draw.DrawType;
135332
+ drawItem.DrawData=draw.DrawData;
135333
+ drawItem.RowCount=draw.RowCount;
135334
+ drawItem.RowName=draw.RowName;
135335
+ drawItem.Config=draw.Config;
135336
+ outVarItem.Draw=drawItem;
135337
+ result.push(outVarItem);
135338
+ }
134717
135339
  else
134718
135340
  {
134719
135341
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -136107,6 +136729,13 @@ function GetBlackStyle()
136107
136729
  BGColor:[null, "rgb(42,46,57)"],
136108
136730
  SplitLine:{ Color:'rgb(73,133,231)', Width:1*GetDevicePixelRatio(), Dash:[5*GetDevicePixelRatio(),5*GetDevicePixelRatio()] }
136109
136731
  },
136732
+
136733
+ KLineCountDownPaint:
136734
+ {
136735
+ Unchange:{ BGColor:"rgb(190, 190 ,190)", PriceColor:"rgb(0,0,0)", TimeColor:"rgb(50,50,50)" },
136736
+ Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
136737
+ Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
136738
+ },
136110
136739
 
136111
136740
  //成交明细
136112
136741
  DealList:
@@ -160387,8 +161016,6 @@ function JSFloatTooltip()
160387
161016
  Left:"UMyChart_Tooltip_Float_Text2_Span", //左对齐
160388
161017
  MarginLeft:'UMyChart_Tooltip_Float_Text3_Span',
160389
161018
  Right:"UMyChart_Tooltip_Float_Text_Span",
160390
-
160391
-
160392
161019
  }
160393
161020
 
160394
161021
  this.TitleAlign=
@@ -161604,6 +162231,164 @@ function JSFloatTooltip()
161604
162231
  this.UpdateStyle();
161605
162232
  }
161606
162233
  }
162234
+
162235
+ function JSSmallFloatTooltip()
162236
+ {
162237
+ this.DivDialog=null;
162238
+ this.DivContent=null;
162239
+ this.HQChart=null;
162240
+
162241
+ this.Destroy=function()
162242
+ {
162243
+ if (this.DivDialog)
162244
+ {
162245
+ document.body.removeChild(this.DivDialog);
162246
+ this.DivDialog=null;
162247
+ this.DivContent=null;
162248
+ }
162249
+
162250
+ this.HQChart=null;
162251
+ }
162252
+
162253
+ this.Hide=function()
162254
+ {
162255
+ if (!this.DivDialog) return;
162256
+ if (this.DivDialog.style.visibility!='hidden') this.DivDialog.style.visibility='hidden';
162257
+ }
162258
+
162259
+ this.Create=function()
162260
+ {
162261
+ var divDom=document.createElement("div");
162262
+ divDom.className='UMyChart_Small_Tooltip_Div';
162263
+
162264
+ var divContent=document.createElement("div");
162265
+ divContent.className='UMyChart_Small_Tooltip_Content_Div';
162266
+ divDom.appendChild(divContent);
162267
+
162268
+ document.body.appendChild(divDom);
162269
+
162270
+ this.DivContent=divContent;
162271
+ this.DivDialog=divDom;
162272
+ }
162273
+
162274
+ this.IsShow=function()
162275
+ {
162276
+ if (!this.DivDialog) return false;
162277
+
162278
+ return this.DivDialog.style.visibility==='visible';
162279
+ }
162280
+
162281
+ this.ShowTooltip=function(data)
162282
+ {
162283
+ if (!data.Point) return;
162284
+
162285
+ var x=data.Point.X;
162286
+ var y=data.Point.Y;
162287
+ this.Show(x, y, { YMove:data.Point.YMove });
162288
+ }
162289
+
162290
+ this.Show=function(x, y, option)
162291
+ {
162292
+ if (!this.DivDialog) return;
162293
+ if (!this.HQChart) return;
162294
+
162295
+ var rtClient=this.HQChart.UIElement.getBoundingClientRect();
162296
+ var yMove=0;
162297
+ if (option && IFrameSplitOperator.IsNumber(option.YMove)) yMove=option.YMove;
162298
+
162299
+ var left=x+rtClient.left,top=y+rtClient.top+yMove;
162300
+ var right=left+this.DivDialog.offsetWidth;
162301
+ var bottom=top+this.DivDialog.offsetHeight;
162302
+
162303
+ if ((right+5)>=window.innerWidth) left=left-this.DivDialog.offsetWidth;
162304
+ if ((bottom+5)>=window.innerHeight)
162305
+ {
162306
+ top=(y+rtClient.top)-this.DivDialog.offsetHeight;
162307
+ }
162308
+
162309
+ this.DivDialog.style.top = top + "px";
162310
+ this.DivDialog.style.left = left + "px";
162311
+
162312
+ if (this.DivDialog.style.visibility!='visible')
162313
+ this.DivDialog.style.visibility='visible';
162314
+ }
162315
+
162316
+ this.Update=function(data)
162317
+ {
162318
+ var text=data.Data.Data.Text;
162319
+ if (!this.DivContent) return false;
162320
+
162321
+ this.DivContent.innerText=text;
162322
+
162323
+ this.ShowTooltip(data);
162324
+ }
162325
+ }
162326
+
162327
+ function JSSmallFloatTooltipGroup()
162328
+ {
162329
+ this.AryTooltip=[];
162330
+ this.HQChart=null;
162331
+ this.MaxCount=5;
162332
+
162333
+ this.Inital=function(hqchart, option)
162334
+ {
162335
+ this.HQChart=hqchart;
162336
+ }
162337
+
162338
+ this.Create=function()
162339
+ {
162340
+ for(var i=0;i<this.MaxCount;++i)
162341
+ {
162342
+ var item=new JSSmallFloatTooltip();
162343
+ item.HQChart=this.HQChart;
162344
+ item.Create();
162345
+ this.AryTooltip.push(item);
162346
+ }
162347
+ }
162348
+
162349
+ this.Destroy=function()
162350
+ {
162351
+ for(var i=0;i<this.AryTooltip.length;++i)
162352
+ {
162353
+ var item=this.AryTooltip[i];
162354
+ item.Destroy();
162355
+ }
162356
+
162357
+ this.AryTooltip=[];
162358
+ }
162359
+
162360
+ this.Update=function(data)
162361
+ {
162362
+ var tooltipData=data.Tooltip;
162363
+ var pixelTatio = GetDevicePixelRatio();
162364
+ if (pixelTatio===0) pixelTatio=1;
162365
+ for(var i=0; i<tooltipData.AryData.length && i<this.AryTooltip.length; ++i)
162366
+ {
162367
+ var item=tooltipData.AryData[i];
162368
+ var tooltipItem=this.AryTooltip[i];
162369
+
162370
+ //去掉分辨率倍数
162371
+ var x=tooltipData.X/pixelTatio;
162372
+ var y=item.Y/pixelTatio;
162373
+ tooltipItem.Update({ Data:item, Point:{ X:x, Y:y} });
162374
+ }
162375
+
162376
+ for(var i=tooltipData.AryData.length; i<this.AryTooltip.length; ++i)
162377
+ {
162378
+ var item=this.AryTooltip[i];
162379
+ item.Hide();
162380
+ }
162381
+ }
162382
+
162383
+ this.Hide=function()
162384
+ {
162385
+ for(var i=0;i<this.AryTooltip.length;++i)
162386
+ {
162387
+ var item=this.AryTooltip[i];
162388
+ item.Hide();
162389
+ }
162390
+ }
162391
+ }
161607
162392
  /*
161608
162393
  Copyright (c) 2018 jones
161609
162394
 
@@ -163895,7 +164680,7 @@ function HQChartScriptWorker()
163895
164680
 
163896
164681
 
163897
164682
 
163898
- var HQCHART_VERSION="1.1.15007";
164683
+ var HQCHART_VERSION="1.1.15017";
163899
164684
 
163900
164685
  function PrintHQChartVersion()
163901
164686
  {