hqchart 1.1.15912 → 1.1.15921

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.
@@ -45,12 +45,23 @@ function JSDialogSelectRect()
45
45
 
46
46
  this.RestoreFocusDelay=800;
47
47
 
48
+ //计算公式配置
49
+ // Increase=涨幅 0=(收-昨收)/昨收 1=(收-今开)/今开 2=(区间末尾收盘价 − 区间起始收盘价) ÷ 区间起始收盘价
50
+ // Amplitude=振幅 0= (当日最高价 − 当日最低价) ÷ 昨日收盘价 1=(当日最高价 − 当日最低价) ÷ 今开价 2=(区间内最高价 − 区间内最低价) ÷ 区间起始 K 收盘价
51
+ this.FormualConfig={ Increase:0, Amplitude:0 };
52
+
53
+
48
54
  this.Inital=function(hqchart, option)
49
55
  {
50
56
  this.HQChart=hqchart;
51
57
  if (option)
52
58
  {
53
-
59
+ if (option.Formual)
60
+ {
61
+ var item=option.Formual;
62
+ if (IFrameSplitOperator.IsNumber(item.Increase)) this.FormualConfig.Increase=item.Increase;
63
+ if (IFrameSplitOperator.IsNumber(item.Amplitude)) this.FormualConfig.Amplitude=item.Amplitude;
64
+ }
54
65
  }
55
66
  }
56
67
 
@@ -536,7 +547,9 @@ function JSDialogSelectRect()
536
547
  {
537
548
  var showData=
538
549
  {
539
- Open:null,Close:null,High:null,Low:null, YClose:null,
550
+ Open:null, Close:null, High:null, Low:null,
551
+ YClose:null, //起始K昨价
552
+ StartClose:null, //起始K收盘价
540
553
  Vol:0, Amount:0,
541
554
  Date:
542
555
  {
@@ -605,11 +618,55 @@ function JSDialogSelectRect()
605
618
  showData.Date.End.Time=item.Time;
606
619
  if (!IFrameSplitOperator.IsNumber(showData.Date.Start.Time)) showData.Date.Start.Time=item.Time;
607
620
  }
621
+
622
+ if (i==start)
623
+ {
624
+ if (IFrameSplitOperator.IsNumber(item.YClose)) showData.YClose=item.YClose;
625
+ if (IFrameSplitOperator.IsNumber(item.Close)) showData.StartClose=item.Close;
626
+ }
608
627
  }
609
628
 
610
629
  return showData;
611
630
  }
612
631
 
632
+ this.FormatKLineIncrease=function(showData)
633
+ {
634
+ var value=null;
635
+ switch(this.FormualConfig.Increase)
636
+ {
637
+ case 1:
638
+ value=showData.Open;
639
+ break;
640
+ case 2:
641
+ value=showData.StartClose;
642
+ break;
643
+ default:
644
+ value=showData.YClose;
645
+ break;
646
+ }
647
+
648
+ return this.FormatIncrease(showData.Close, value, 'DialogSelectRect-Increase')
649
+ }
650
+
651
+ this.FormatKLineAmplitude=function(showData)
652
+ {
653
+ var value=null;
654
+ switch(this.FormualConfig.Increase)
655
+ {
656
+ case 1:
657
+ value=showData.Open;
658
+ break;
659
+ case 2:
660
+ value=showData.StartClose;
661
+ break;
662
+ default:
663
+ value=showData.YClose;
664
+ break;
665
+ }
666
+
667
+ return this.FormatAmplitude(showData.High, showData.Low, value, 'DialogSelectRect-Amplitude')
668
+ }
669
+
613
670
  //格式化K线数据
614
671
  this.FormatKLineText=function(showData)
615
672
  {
@@ -635,11 +692,11 @@ function JSDialogSelectRect()
635
692
 
636
693
  showData.AryText.push(this.ForamtPrice(showData.Open, showData.Open,defaultfloatPrecision, 'DialogSelectRect-StartPrice'));
637
694
  showData.AryText.push(this.ForamtPrice(showData.Close, showData.Open,defaultfloatPrecision, 'DialogSelectRect-EndPrice'));
638
- showData.AryText.push(this.FormatIncrease(showData.Close, showData.Open, 'DialogSelectRect-Increase'));
695
+ showData.AryText.push(this.FormatKLineIncrease(showData));
639
696
 
640
697
  showData.AryText.push(this.ForamtPrice(showData.High, showData.Open,defaultfloatPrecision, 'DialogSelectRect-High'));
641
698
  showData.AryText.push(this.ForamtPrice(showData.Low, showData.Open,defaultfloatPrecision, 'DialogSelectRect-Low'));
642
- showData.AryText.push(this.FormatAmplitude(showData.High, showData.Low, showData.Open, 'DialogSelectRect-Amplitude'));
699
+ showData.AryText.push(this.FormatKLineAmplitude(showData));
643
700
 
644
701
  showData.AryText.push(this.FormatVol(showData.Vol, 'DialogSelectRect-Vol'));
645
702
  showData.AryText.push(this.FormatAmount(showData.Amount, 'DialogSelectRect-Amount'));
@@ -1960,12 +1960,12 @@ function JSFloatTooltip()
1960
1960
 
1961
1961
  if (outItem.IsMergeCell) //合并单元格
1962
1962
  {
1963
- item.TitleTd.colspan=2;
1963
+ item.TitleTd.colSpan="2";
1964
1964
  item.TextTd.style.display="none";
1965
1965
  }
1966
1966
  else
1967
1967
  {
1968
- if (item.TitleTd.colspan!=1) item.TitleTd.colspan=1;
1968
+ if (item.TitleTd.colSpan!=1) item.TitleTd.colSpan=1;
1969
1969
  item.TextTd.style.display="";
1970
1970
  }
1971
1971
 
@@ -2172,7 +2172,7 @@ function JSFloatTooltip()
2172
2172
  //大宗交易
2173
2173
  this.FormatBlockTradingText=function(data, floatPrecision, aryOut)
2174
2174
  {
2175
- var item={ Title:"", Text:"大宗交易", Color:this.TextColor, ClassName:this.ValueAlign.Left };
2175
+ var item={ Title:"大宗交易", TitleColor:this.TextColor, IsMergeCell:true, TitleClassName:this.TitleAlign.Center };
2176
2176
  aryOut.push(item);
2177
2177
 
2178
2178
  var item={ Title:"日期",Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY-MM-DD"), Color:this.ValueColor };
@@ -2212,7 +2212,7 @@ function JSFloatTooltip()
2212
2212
  //龙虎榜
2213
2213
  this.FormatDragonTigerText=function(data, floatPrecision, aryOut)
2214
2214
  {
2215
- var item={ Title:"", Text:"龙虎榜", Color:this.TextColor, ClassName:this.ValueAlign.Left };
2215
+ var item={ Title:"龙虎榜", TitleColor:this.TextColor, IsMergeCell:true, TitleClassName:this.TitleAlign.Center };
2216
2216
  aryOut.push(item);
2217
2217
 
2218
2218
  var item={ Title:"日期",Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY-MM-DD"), Color:this.ValueColor};
@@ -2256,7 +2256,7 @@ function JSFloatTooltip()
2256
2256
  }
2257
2257
  else if (item.Type==2) //单行
2258
2258
  {
2259
- var outItem={ Title:"", Text:item.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
2259
+ var outItem={ Title:item.Name, TitleColor:this.TextColor, IsMergeCell:true, TitleClassName:this.TitleAlign.Center };
2260
2260
  }
2261
2261
  else
2262
2262
  {
@@ -2270,7 +2270,7 @@ function JSFloatTooltip()
2270
2270
  //调研
2271
2271
  this.FormatResearchText=function(data,aryOut)
2272
2272
  {
2273
- var item={ Title:"", Text:"机构调研", Color:this.TextColor, ClassName:this.ValueAlign.Left };
2273
+ var item={ Title:"机构调研", TitleColor:this.TextColor, IsMergeCell:true, TitleClassName:this.TitleAlign.Center };
2274
2274
  aryOut.push(item);
2275
2275
 
2276
2276
  var item={ Title:"公告日期",Text:IFrameSplitOperator.FormatDateString(data.Date,"YYYY-MM-DD"), Color:this.ValueColor };
@@ -2871,12 +2871,12 @@ function JSSmallFloatTooltipV2()
2871
2871
 
2872
2872
  if (outItem.IsMergeCell) //合并单元格
2873
2873
  {
2874
- item.TitleTd.colspan=2;
2874
+ item.TitleTd.colSpan='2';
2875
2875
  item.TextTd.style.display="none";
2876
2876
  }
2877
2877
  else
2878
2878
  {
2879
- if (item.TitleTd.colspan!=1) item.TitleTd.colspan=1;
2879
+ if (item.TitleTd.colSpan!='1') item.TitleTd.colSpan='1';
2880
2880
  item.TextTd.style.display="";
2881
2881
  }
2882
2882
 
@@ -7093,7 +7093,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7093
7093
 
7094
7094
  if (item.IsCallbackDraw)
7095
7095
  {
7096
- if (["KLineYAxisBGPaint","DepthMapPaint","BackgroundPaint","MinuteBackgroundPaint", "SessionBreaksPaint"].includes(item.ClassName))
7096
+ if (["KLineYAxisBGPaint","DepthMapPaint","BackgroundPaint","MinuteBackgroundPaint", "SessionBreaksPaint", "KLineSelectedPaint"].includes(item.ClassName))
7097
7097
  {
7098
7098
  if (item.FrameID==frame.Identify) item.Draw();
7099
7099
  }
@@ -51657,7 +51657,8 @@ function ExtendChartPaintFactory()
51657
51657
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
51658
51658
  ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
51659
51659
  ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}],
51660
- ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}]
51660
+ ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}],
51661
+ ["KLineSelectedPaint", { Create:function(){ return new KLineSelectedPaint(); }}],
51661
51662
  ]
51662
51663
  );
51663
51664
 
@@ -57183,6 +57184,159 @@ function SessionBreaksPaint()
57183
57184
  }
57184
57185
  }
57185
57186
 
57187
+ function KLineSelectedPaint()
57188
+ {
57189
+ this.newMethod=IExtendChartPainting; //派生
57190
+ this.newMethod();
57191
+ delete this.newMethod;
57192
+
57193
+ this.ClassName='KLineSelectedPaint';
57194
+ this.IsDynamic=false;
57195
+ this.IsCallbackDraw=true; //在回调函数里绘制, 不在Draw()中绘制
57196
+ this.FrameID=0;
57197
+ this.MapSelectedData=new Map(); //选中数据 { Period:, DateTime:[{ Date:, Time:}, .....] }
57198
+
57199
+ this.BGColor=g_JSChartResource.KLineSelectedPaint.BGColor;
57200
+ this.AryColor=g_JSChartResource.KLineSelectedPaint.AryColor.slice();
57201
+
57202
+ this.ReloadResource=function(resource)
57203
+ {
57204
+ this.BGColor=g_JSChartResource.KLineSelectedPaint.BGColor;
57205
+ this.AryColor=g_JSChartResource.KLineSelectedPaint.AryColor.slice();
57206
+ }
57207
+
57208
+ this.SetOption=function(option)
57209
+ {
57210
+ if (option)
57211
+ {
57212
+ if (option.BGColor) this.BGColor=option.BGColor;
57213
+ if (IFrameSplitOperator.IsNonEmptyArray(option.ArySelected))
57214
+ {
57215
+ for(var i=0;i<option.ArySelected.length;++i)
57216
+ {
57217
+ var item=option.ArySelected[i];
57218
+ this.AddSelected(item, item);
57219
+ }
57220
+ }
57221
+ }
57222
+ }
57223
+
57224
+ this.AddSelected=function(dateTime, option)
57225
+ {
57226
+ if (!dateTime) return false;
57227
+ var key=this.BuildKey(dateTime);
57228
+ if (!key) return false;
57229
+
57230
+ var item={ Date:dateTime.Date, Time:dateTime.Time};
57231
+ if (option && option.BGColor) item.BGColor=option.BGColor;
57232
+ if (option && IFrameSplitOperator.IsNumber(option.ColorID)) item.ColorID=option.ColorID;
57233
+
57234
+ this.MapSelectedData.set(key, item);
57235
+
57236
+ return true;
57237
+ }
57238
+
57239
+ this.RemoveSelected=function(dateTime)
57240
+ {
57241
+ if (!dateTime) return false;
57242
+ var key=this.BuildKey(dateTime);
57243
+ if (!key) return false;
57244
+ return this.MapSelectedData.delete(key);
57245
+ }
57246
+
57247
+ this.ClearAll=function()
57248
+ {
57249
+ this.MapSelectedData.clear();
57250
+ }
57251
+
57252
+ this.BuildKey=function(item)
57253
+ {
57254
+ if (IFrameSplitOperator.IsNumber(item.Time)) return `${item.Date}-${item.Time}`;
57255
+ else if (IFrameSplitOperator.IsNumber(item.Date)) return `${item.Date}`;
57256
+ else return null;
57257
+ }
57258
+
57259
+ this.Draw=function()
57260
+ {
57261
+ if (this.MapSelectedData.size<=0) return;
57262
+ if (!this.HQChart) return;
57263
+ var hisData=this.HQChart.GetKData();
57264
+ if (!hisData || !IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return; //数据还没有到达
57265
+
57266
+ var mainFrame=this.HQChart.Frame.SubFrame[0].Frame;
57267
+ var bHScreen=(this.ChartFrame.IsHScreen===true);
57268
+ var dataWidth=mainFrame.DataWidth;
57269
+ var distanceWidth=mainFrame.DistanceWidth;
57270
+ var xPointCount=mainFrame.XPointCount;
57271
+
57272
+ if (bHScreen)
57273
+ {
57274
+ var border=this.ChartBorder.GetHScreenBorder();
57275
+ var chartright=border.BottomEx;
57276
+ var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
57277
+ var top=border.RightEx;
57278
+ var bottom=border.LeftEx;
57279
+ }
57280
+ else
57281
+ {
57282
+ var border=this.ChartBorder.GetBorder();
57283
+ var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
57284
+ var chartright=border.RightEx;
57285
+ var top=border.TopEx;
57286
+ var bottom=border.BottomEx;
57287
+ }
57288
+
57289
+ var aryData=[];
57290
+ this.Canvas.fillStyle="rgb(40,30,100)";
57291
+ for(var i=hisData.DataOffset,j=0;i<hisData.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
57292
+ {
57293
+ var item=hisData.Data[i];
57294
+ if (!item) continue;
57295
+
57296
+ var key=this.BuildKey(item);
57297
+ if (!key || !this.MapSelectedData.has(key)) continue;
57298
+
57299
+ var left=xOffset;
57300
+ var right=xOffset+dataWidth;
57301
+ if (right>chartright) break;
57302
+ var xCenter=left+(right-left)/2;
57303
+
57304
+ var xStart=left-distanceWidth/2;
57305
+ var xEnd=right+distanceWidth/2;
57306
+
57307
+ var selectedItem=this.MapSelectedData.get(key);
57308
+ var drawItem={ Data:selectedItem, Left:xStart, Right:xEnd, XCenter:xCenter };
57309
+
57310
+ if (bHScreen)
57311
+ {
57312
+ var rtItem={ Left:top, Right:bottom, Top:drawItem.Left, Bottom:drawItem.Right };
57313
+ rtItem.Width=rtItem.Right-rtItem.Left;
57314
+ rtItem.Height=rtItem.Bottom-rtItem.Top;
57315
+ if (rtItem.Heigh<1) rtItem.Height=1;
57316
+ }
57317
+ else
57318
+ {
57319
+ var rtItem={ Left:drawItem.Left, Right:drawItem.Right, Top:top, Bottom:bottom };
57320
+ rtItem.Width=rtItem.Right-rtItem.Left;
57321
+ rtItem.Height=rtItem.Bottom-rtItem.Top;
57322
+ if (rtItem.Width<1) rtItem.Width=1;
57323
+ }
57324
+
57325
+ var color=this.BGColor;
57326
+ if (selectedItem.BGColor) color=selectedItem.BGColor;
57327
+ else if (IFrameSplitOperator.IsNumber(selectedItem.ColorID))
57328
+ {
57329
+ if (selectedItem.ColorID>=0 && selectedItem.ColorID<this.AryColor.length)
57330
+ color=this.AryColor[selectedItem.ColorID];
57331
+ }
57332
+
57333
+ this.Canvas.fillStyle=color;
57334
+
57335
+ this.Canvas.fillRect(ToFixedRect(rtItem.Left), ToFixedRect(rtItem.Top), ToFixedRect(rtItem.Width), ToFixedRect(rtItem.Height));
57336
+ }
57337
+ }
57338
+ }
57339
+
57186
57340
  //窗口底部工具栏
57187
57341
  function FrameButtomToolbarPaint()
57188
57342
  {
@@ -82354,6 +82508,12 @@ function JSChartResource()
82354
82508
  Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
82355
82509
  }
82356
82510
 
82511
+ this.KLineSelectedPaint=
82512
+ {
82513
+ BGColor:"rgb(255,222,173)",
82514
+ AryColor:["rgb(255,182,193)", "rgb(255,222,173)", "rgb(255,255,224)", "rgb(173,216,230)", "rgb(221,160,221)"],
82515
+ }
82516
+
82357
82517
 
82358
82518
  //成交明细
82359
82519
  this.DealList=
@@ -83919,6 +84079,7 @@ function JSChartResource()
83919
84079
 
83920
84080
  if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
83921
84081
  if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
84082
+ if (style.KLineSelectedPaint) this.SetKLineSelectedPaint(style.KLineSelectedPaint);
83922
84083
 
83923
84084
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83924
84085
  if (style.StockInfo) this.SetStockInfo(style.StockInfo);
@@ -83930,6 +84091,13 @@ function JSChartResource()
83930
84091
 
83931
84092
  }
83932
84093
 
84094
+ this.SetKLineSelectedPaint=function(style)
84095
+ {
84096
+ var dest=this.KLineSelectedPaint;
84097
+ if (style.BGColor) dest.BGColor=style.BGColor;
84098
+ if (IFrameSplitOperator.IsNonEmptyArray(style.AryColor)) dest.AryColor=style.AryColor.slice();
84099
+ }
84100
+
83933
84101
  this.SetCalendar=function(style)
83934
84102
  {
83935
84103
  var dest=this.Calendar;
@@ -752,6 +752,12 @@ function GetBlackStyle()
752
752
  Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
753
753
  Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
754
754
  },
755
+
756
+ KLineSelectedPaint:
757
+ {
758
+ BGColor:"rgb(100,149,237)",
759
+ AryColor:["rgb(205,92,92)", "rgb(188,143,143)", "rgb(255,127,80)", "rgb(255,99,71)", "rgb(255,69,0)"],
760
+ },
755
761
 
756
762
  //成交明细
757
763
  DealList:
@@ -11206,7 +11206,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11206
11206
 
11207
11207
  if (item.IsCallbackDraw)
11208
11208
  {
11209
- if (["KLineYAxisBGPaint","DepthMapPaint","BackgroundPaint","MinuteBackgroundPaint", "SessionBreaksPaint"].includes(item.ClassName))
11209
+ if (["KLineYAxisBGPaint","DepthMapPaint","BackgroundPaint","MinuteBackgroundPaint", "SessionBreaksPaint", "KLineSelectedPaint"].includes(item.ClassName))
11210
11210
  {
11211
11211
  if (item.FrameID==frame.Identify) item.Draw();
11212
11212
  }
@@ -55770,7 +55770,8 @@ function ExtendChartPaintFactory()
55770
55770
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
55771
55771
  ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
55772
55772
  ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}],
55773
- ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}]
55773
+ ["KLineCountDownPaint", { Create:function(){ return new KLineCountDownPaint(); }}],
55774
+ ["KLineSelectedPaint", { Create:function(){ return new KLineSelectedPaint(); }}],
55774
55775
  ]
55775
55776
  );
55776
55777
 
@@ -61296,6 +61297,159 @@ function SessionBreaksPaint()
61296
61297
  }
61297
61298
  }
61298
61299
 
61300
+ function KLineSelectedPaint()
61301
+ {
61302
+ this.newMethod=IExtendChartPainting; //派生
61303
+ this.newMethod();
61304
+ delete this.newMethod;
61305
+
61306
+ this.ClassName='KLineSelectedPaint';
61307
+ this.IsDynamic=false;
61308
+ this.IsCallbackDraw=true; //在回调函数里绘制, 不在Draw()中绘制
61309
+ this.FrameID=0;
61310
+ this.MapSelectedData=new Map(); //选中数据 { Period:, DateTime:[{ Date:, Time:}, .....] }
61311
+
61312
+ this.BGColor=g_JSChartResource.KLineSelectedPaint.BGColor;
61313
+ this.AryColor=g_JSChartResource.KLineSelectedPaint.AryColor.slice();
61314
+
61315
+ this.ReloadResource=function(resource)
61316
+ {
61317
+ this.BGColor=g_JSChartResource.KLineSelectedPaint.BGColor;
61318
+ this.AryColor=g_JSChartResource.KLineSelectedPaint.AryColor.slice();
61319
+ }
61320
+
61321
+ this.SetOption=function(option)
61322
+ {
61323
+ if (option)
61324
+ {
61325
+ if (option.BGColor) this.BGColor=option.BGColor;
61326
+ if (IFrameSplitOperator.IsNonEmptyArray(option.ArySelected))
61327
+ {
61328
+ for(var i=0;i<option.ArySelected.length;++i)
61329
+ {
61330
+ var item=option.ArySelected[i];
61331
+ this.AddSelected(item, item);
61332
+ }
61333
+ }
61334
+ }
61335
+ }
61336
+
61337
+ this.AddSelected=function(dateTime, option)
61338
+ {
61339
+ if (!dateTime) return false;
61340
+ var key=this.BuildKey(dateTime);
61341
+ if (!key) return false;
61342
+
61343
+ var item={ Date:dateTime.Date, Time:dateTime.Time};
61344
+ if (option && option.BGColor) item.BGColor=option.BGColor;
61345
+ if (option && IFrameSplitOperator.IsNumber(option.ColorID)) item.ColorID=option.ColorID;
61346
+
61347
+ this.MapSelectedData.set(key, item);
61348
+
61349
+ return true;
61350
+ }
61351
+
61352
+ this.RemoveSelected=function(dateTime)
61353
+ {
61354
+ if (!dateTime) return false;
61355
+ var key=this.BuildKey(dateTime);
61356
+ if (!key) return false;
61357
+ return this.MapSelectedData.delete(key);
61358
+ }
61359
+
61360
+ this.ClearAll=function()
61361
+ {
61362
+ this.MapSelectedData.clear();
61363
+ }
61364
+
61365
+ this.BuildKey=function(item)
61366
+ {
61367
+ if (IFrameSplitOperator.IsNumber(item.Time)) return `${item.Date}-${item.Time}`;
61368
+ else if (IFrameSplitOperator.IsNumber(item.Date)) return `${item.Date}`;
61369
+ else return null;
61370
+ }
61371
+
61372
+ this.Draw=function()
61373
+ {
61374
+ if (this.MapSelectedData.size<=0) return;
61375
+ if (!this.HQChart) return;
61376
+ var hisData=this.HQChart.GetKData();
61377
+ if (!hisData || !IFrameSplitOperator.IsNonEmptyArray(hisData.Data)) return; //数据还没有到达
61378
+
61379
+ var mainFrame=this.HQChart.Frame.SubFrame[0].Frame;
61380
+ var bHScreen=(this.ChartFrame.IsHScreen===true);
61381
+ var dataWidth=mainFrame.DataWidth;
61382
+ var distanceWidth=mainFrame.DistanceWidth;
61383
+ var xPointCount=mainFrame.XPointCount;
61384
+
61385
+ if (bHScreen)
61386
+ {
61387
+ var border=this.ChartBorder.GetHScreenBorder();
61388
+ var chartright=border.BottomEx;
61389
+ var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
61390
+ var top=border.RightEx;
61391
+ var bottom=border.LeftEx;
61392
+ }
61393
+ else
61394
+ {
61395
+ var border=this.ChartBorder.GetBorder();
61396
+ var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
61397
+ var chartright=border.RightEx;
61398
+ var top=border.TopEx;
61399
+ var bottom=border.BottomEx;
61400
+ }
61401
+
61402
+ var aryData=[];
61403
+ this.Canvas.fillStyle="rgb(40,30,100)";
61404
+ for(var i=hisData.DataOffset,j=0;i<hisData.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
61405
+ {
61406
+ var item=hisData.Data[i];
61407
+ if (!item) continue;
61408
+
61409
+ var key=this.BuildKey(item);
61410
+ if (!key || !this.MapSelectedData.has(key)) continue;
61411
+
61412
+ var left=xOffset;
61413
+ var right=xOffset+dataWidth;
61414
+ if (right>chartright) break;
61415
+ var xCenter=left+(right-left)/2;
61416
+
61417
+ var xStart=left-distanceWidth/2;
61418
+ var xEnd=right+distanceWidth/2;
61419
+
61420
+ var selectedItem=this.MapSelectedData.get(key);
61421
+ var drawItem={ Data:selectedItem, Left:xStart, Right:xEnd, XCenter:xCenter };
61422
+
61423
+ if (bHScreen)
61424
+ {
61425
+ var rtItem={ Left:top, Right:bottom, Top:drawItem.Left, Bottom:drawItem.Right };
61426
+ rtItem.Width=rtItem.Right-rtItem.Left;
61427
+ rtItem.Height=rtItem.Bottom-rtItem.Top;
61428
+ if (rtItem.Heigh<1) rtItem.Height=1;
61429
+ }
61430
+ else
61431
+ {
61432
+ var rtItem={ Left:drawItem.Left, Right:drawItem.Right, Top:top, Bottom:bottom };
61433
+ rtItem.Width=rtItem.Right-rtItem.Left;
61434
+ rtItem.Height=rtItem.Bottom-rtItem.Top;
61435
+ if (rtItem.Width<1) rtItem.Width=1;
61436
+ }
61437
+
61438
+ var color=this.BGColor;
61439
+ if (selectedItem.BGColor) color=selectedItem.BGColor;
61440
+ else if (IFrameSplitOperator.IsNumber(selectedItem.ColorID))
61441
+ {
61442
+ if (selectedItem.ColorID>=0 && selectedItem.ColorID<this.AryColor.length)
61443
+ color=this.AryColor[selectedItem.ColorID];
61444
+ }
61445
+
61446
+ this.Canvas.fillStyle=color;
61447
+
61448
+ this.Canvas.fillRect(ToFixedRect(rtItem.Left), ToFixedRect(rtItem.Top), ToFixedRect(rtItem.Width), ToFixedRect(rtItem.Height));
61449
+ }
61450
+ }
61451
+ }
61452
+
61299
61453
  //窗口底部工具栏
61300
61454
  function FrameButtomToolbarPaint()
61301
61455
  {
@@ -86467,6 +86621,12 @@ function JSChartResource()
86467
86621
  Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
86468
86622
  }
86469
86623
 
86624
+ this.KLineSelectedPaint=
86625
+ {
86626
+ BGColor:"rgb(255,222,173)",
86627
+ AryColor:["rgb(255,182,193)", "rgb(255,222,173)", "rgb(255,255,224)", "rgb(173,216,230)", "rgb(221,160,221)"],
86628
+ }
86629
+
86470
86630
 
86471
86631
  //成交明细
86472
86632
  this.DealList=
@@ -88032,6 +88192,7 @@ function JSChartResource()
88032
88192
 
88033
88193
  if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
88034
88194
  if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
88195
+ if (style.KLineSelectedPaint) this.SetKLineSelectedPaint(style.KLineSelectedPaint);
88035
88196
 
88036
88197
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
88037
88198
  if (style.StockInfo) this.SetStockInfo(style.StockInfo);
@@ -88043,6 +88204,13 @@ function JSChartResource()
88043
88204
 
88044
88205
  }
88045
88206
 
88207
+ this.SetKLineSelectedPaint=function(style)
88208
+ {
88209
+ var dest=this.KLineSelectedPaint;
88210
+ if (style.BGColor) dest.BGColor=style.BGColor;
88211
+ if (IFrameSplitOperator.IsNonEmptyArray(style.AryColor)) dest.AryColor=style.AryColor.slice();
88212
+ }
88213
+
88046
88214
  this.SetCalendar=function(style)
88047
88215
  {
88048
88216
  var dest=this.Calendar;
@@ -144427,6 +144595,12 @@ function GetBlackStyle()
144427
144595
  Up:{ BGColor:"rgb(238,21,21)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
144428
144596
  Down:{ BGColor:"rgb(25,158,0)", PriceColor:"rgb(250,250,250)", TimeColor:"rgb(190,190,190)" },
144429
144597
  },
144598
+
144599
+ KLineSelectedPaint:
144600
+ {
144601
+ BGColor:"rgb(100,149,237)",
144602
+ AryColor:["rgb(205,92,92)", "rgb(188,143,143)", "rgb(255,127,80)", "rgb(255,99,71)", "rgb(255,69,0)"],
144603
+ },
144430
144604
 
144431
144605
  //成交明细
144432
144606
  DealList:
@@ -161753,7 +161927,7 @@ function ScrollBarBGChart()
161753
161927
 
161754
161928
 
161755
161929
 
161756
- var HQCHART_VERSION="1.1.15911";
161930
+ var HQCHART_VERSION="1.1.15920";
161757
161931
 
161758
161932
  function PrintHQChartVersion()
161759
161933
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15911";
8
+ var HQCHART_VERSION="1.1.15920";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {