hqchart 1.1.15106 → 1.1.15111

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.
@@ -6315,12 +6315,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
6315
6315
  }
6316
6316
 
6317
6317
  //锁指标
6318
- this.LockIndex=function(lockData)
6318
+ this.EnableLockIndex=function(aryData)
6319
6319
  {
6320
- if(this.JSChartContainer && typeof(this.JSChartContainer.LockIndex)=='function')
6320
+ if(this.JSChartContainer && typeof(this.JSChartContainer.EnableLockIndex)=='function')
6321
6321
  {
6322
- JSConsole.Chart.Log('[JSChart:LockIndex] lockData', lockData);
6323
- this.JSChartContainer.LockIndex(lockData);
6322
+ JSConsole.Chart.Log('[JSChart:EnableLockIndex] aryData', aryData);
6323
+ this.JSChartContainer.EnableLockIndex(lockData);
6324
6324
  }
6325
6325
  }
6326
6326
 
@@ -16604,6 +16604,55 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
16604
16604
  if (!this.PressKeyboardConfig) return false;
16605
16605
  if (!this.PressKeyboardConfig.PauseUpdate) return false;
16606
16606
 
16607
+ return true;
16608
+ },
16609
+
16610
+ //启动|关闭锁指标 aryIndex=[{ IndexID:指标ID, LockData:{IsLocked:} } ]
16611
+ this.EnableLockIndex=function(aryIndex)
16612
+ {
16613
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryIndex)) return false;
16614
+
16615
+ var mapIndex=new Map();
16616
+ for(var i=0;i<aryIndex.length;++i)
16617
+ {
16618
+ var item=aryIndex[i];
16619
+ if (item.IndexID && item.LockData) mapIndex.set(item.IndexID, item);
16620
+ }
16621
+
16622
+ var aryUpdate=[];
16623
+ for(var i=0; i<this.WindowIndex.length; ++i)
16624
+ {
16625
+ var item=this.WindowIndex[i];
16626
+ if (!item) continue;
16627
+ if (mapIndex.has(item.ID))
16628
+ {
16629
+ var mapItem=mapIndex.get(item.ID);
16630
+ item.SetLock(mapItem.LockData); //设置锁
16631
+ aryUpdate.push({ ID:i});
16632
+ }
16633
+ }
16634
+
16635
+ for(var i=0; i<this.Frame.SubFrame.length; ++i)
16636
+ {
16637
+ var item=this.Frame.SubFrame[i];
16638
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)) continue;
16639
+
16640
+ for(var j=0; j<item.OverlayIndex.length; ++j)
16641
+ {
16642
+ var overlayItem=item.OverlayIndex[j];
16643
+ var script=overlayItem.Script;
16644
+ if (mapIndex.has(script.ID))
16645
+ {
16646
+ var mapItem=mapIndex.get(script.ID);
16647
+ script.SetLock(mapItem.LockData);
16648
+ aryUpdate.push({OverlayID:overlayItem.Identify});
16649
+ }
16650
+ }
16651
+ }
16652
+
16653
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryUpdate)) return false;
16654
+
16655
+ this.UpdateWindowIndexV2(aryUpdate);
16607
16656
  return true;
16608
16657
  }
16609
16658
  }
@@ -17253,8 +17302,8 @@ function IChartFramePainting()
17253
17302
  this.XSplitOperator; //X轴分割
17254
17303
  this.Data; //主数据
17255
17304
 
17256
- this.IsLocked=false; //是否上锁
17257
- this.LockPaint = null;
17305
+ this.LockPaint = null; //锁图形
17306
+ this.IndexLock=new IndexLockData(); //指标锁
17258
17307
 
17259
17308
  this.YSpecificMaxMin=null; //指定Y轴最大最小值
17260
17309
  this.IsShowBorder = true; //是否显示边框
@@ -17526,15 +17575,8 @@ function IChartFramePainting()
17526
17575
 
17527
17576
  this.DrawLock=function()
17528
17577
  {
17529
- if (this.IsLocked)
17530
- {
17531
- if (this.LockPaint == null)
17532
- this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
17533
- this.LockPaint.Canvas=this.Canvas;
17534
- this.LockPaint.ChartBorder=this.ChartBorder;
17535
- this.LockPaint.ChartFrame=this;
17536
- this.LockPaint.Draw(true);
17537
- }
17578
+ if (!this.LockPaint) return;
17579
+ this.LockPaint.Draw(true);
17538
17580
  }
17539
17581
 
17540
17582
  this.DrawLogo=function()
@@ -17590,46 +17632,28 @@ function IChartFramePainting()
17590
17632
  }
17591
17633
  }
17592
17634
 
17593
- this.CalculateLock=function()
17635
+ this.CalculateLock=function(aryData)
17594
17636
  {
17595
- if (this.IsLocked)
17596
- {
17597
- if (this.LockPaint == null)
17598
- this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
17599
- this.LockPaint.Canvas=this.Canvas;
17600
- this.LockPaint.ChartBorder=this.ChartBorder;
17601
- this.LockPaint.ChartFrame=this;
17602
- this.LockPaint.Draw(false);
17603
- }
17637
+ this.LockPaint.SetData(aryData);
17638
+ this.LockPaint.Draw(false);
17604
17639
  }
17605
17640
 
17606
- //设施上锁
17607
- this.SetLock=function(lockData)
17641
+ //创建锁图形
17642
+ this.CreateLockPaint=function()
17608
17643
  {
17609
- if (!lockData) //空数据不上锁
17610
- {
17611
- this.IsLocked=false;
17612
- return;
17613
- }
17614
-
17615
- this.IsLocked=true;
17616
- if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
17644
+ this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
17645
+ this.LockPaint.Canvas=this.Canvas;
17646
+ this.LockPaint.ChartBorder=this.ChartBorder;
17647
+ this.LockPaint.ChartFrame=this;
17648
+ }
17617
17649
 
17618
- if (lockData.Callback) this.LockPaint.Callback=lockData.Callback; //回调
17619
- if (lockData.IndexName) this.LockPaint.IndexName=lockData.IndexName; //指标名字
17620
- if (lockData.IndexID) this.LockPaint.IndexID=lockData.IndexID; //指标ID
17621
- if (lockData.ID) this.LockPaint.LockID=lockData.ID; //锁ID
17622
- if (lockData.BG) this.LockPaint.BGColor=lockData.BG; //背景色
17623
- if (lockData.Text) this.LockPaint.Title= lockData.Text;
17624
- if (lockData.TextColor) this.LockPaint.TextColor=lockData.TextColor;
17625
- if (lockData.Font) this.LockPaint.Font=lockData.Font;
17626
- if (lockData.Count) this.LockPaint.LockCount=lockData.Count;
17627
- if (lockData.MinWidth>0) this.LockPaint.MinWidth=lockData.MinWidth;
17650
+ this.SetLock=function(lockData)
17651
+ {
17652
+ this.IndexLock.SetData(lockData);
17628
17653
  }
17629
17654
 
17630
17655
  this.GetLockRect=function()
17631
17656
  {
17632
- if (!this.IsLocked) return null;
17633
17657
  if (!this.LockPaint) return null;
17634
17658
  return this.LockPaint.LockRect;
17635
17659
  }
@@ -22666,6 +22690,13 @@ function OverlayMinuteFrame()
22666
22690
  this.IsShareY=false; //使用和主框架公用Y轴
22667
22691
  this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
22668
22692
  this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
22693
+ this.MainFrame=null; //主框架
22694
+
22695
+ this.GetLockRect=function()
22696
+ {
22697
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
22698
+ return this.MainFrame.GetLockRect();
22699
+ }
22669
22700
 
22670
22701
  this.Draw=function()
22671
22702
  {
@@ -22724,6 +22755,13 @@ function OverlayMinuteHScreenFrame()
22724
22755
 
22725
22756
  this.ClassName="OverlayMinuteHScreenFrame";
22726
22757
  this.IsShow=true; //坐标是否显示
22758
+ this.MainFrame=null; //主框架
22759
+
22760
+ this.GetLockRect=function()
22761
+ {
22762
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
22763
+ return this.MainFrame.GetLockRect();
22764
+ }
22727
22765
 
22728
22766
  this.Draw=function()
22729
22767
  {
@@ -24111,6 +24149,12 @@ function OverlayKLineFrame()
24111
24149
  }
24112
24150
  }
24113
24151
 
24152
+ this.GetLockRect=function()
24153
+ {
24154
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
24155
+ return this.MainFrame.GetLockRect();
24156
+ }
24157
+
24114
24158
  this.Draw=function()
24115
24159
  {
24116
24160
  this.Buttons=[];
@@ -25423,6 +25467,12 @@ function OverlayKLineHScreenFrame()
25423
25467
  this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;
25424
25468
  this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;
25425
25469
 
25470
+ this.GetLockRect=function()
25471
+ {
25472
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
25473
+ return this.MainFrame.GetLockRect();
25474
+ }
25475
+
25426
25476
  this.Draw=function()
25427
25477
  {
25428
25478
  this.SplitXYCoordinate();
@@ -26629,7 +26679,7 @@ function HQTradeFrame()
26629
26679
 
26630
26680
  this.DrawLock=function()
26631
26681
  {
26632
- for (var i in this.SubFrame)
26682
+ for (var i=0; i<this.SubFrame.length; ++i)
26633
26683
  {
26634
26684
  var item = this.SubFrame[i];
26635
26685
  item.Frame.DrawLock();
@@ -26651,10 +26701,21 @@ function HQTradeFrame()
26651
26701
 
26652
26702
  this.CalculateLock=function()
26653
26703
  {
26654
- for (var i in this.SubFrame)
26704
+ for (var i=0, j=0; i<this.SubFrame.length; ++i)
26655
26705
  {
26656
26706
  var item = this.SubFrame[i];
26657
- item.Frame.CalculateLock();
26707
+ var aryLockData=[];
26708
+ if (item.Frame.IndexLock.IsLocked) aryLockData.push({ Data:item.Frame.IndexLock, IsOverlay:false });
26709
+ for(j=0; j<item.OverlayIndex.length; ++j)
26710
+ {
26711
+ var subItem=item.OverlayIndex[j];
26712
+ if (subItem.Frame.IndexLock.IsLocked===true)
26713
+ {
26714
+ aryLockData.push({ Data:subItem.Frame.IndexLock, IsOverlay:true } );
26715
+ }
26716
+ }
26717
+
26718
+ item.Frame.CalculateLock(aryLockData);
26658
26719
  }
26659
26720
  }
26660
26721
 
@@ -42801,6 +42862,13 @@ function ChartStickLine()
42801
42862
  xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
42802
42863
  }
42803
42864
 
42865
+ var lockRect=this.GetLockRect();
42866
+ if (lockRect)
42867
+ {
42868
+ if (this.IsHScreen) chartright=lockRect.Top;
42869
+ else chartright=lockRect.Left;
42870
+ }
42871
+
42804
42872
  var isMinute=this.IsMinuteFrame();
42805
42873
 
42806
42874
  if (isMinute)
@@ -51876,6 +51944,39 @@ function ChartDrawFlagText()
51876
51944
  }
51877
51945
  }
51878
51946
 
51947
+ function IndexLockData()
51948
+ {
51949
+ this.IsLocked=false;
51950
+ this.LockCount = 20; // 锁最新的几个数据
51951
+ this.BGColor = g_JSChartResource.IndexLock.BGColor;
51952
+ this.TextColor = g_JSChartResource.IndexLock.TextColor;
51953
+ this.Font = g_JSChartResource.IndexLock.Font;
51954
+ this.Title = g_JSChartResource.IndexLock.Title;
51955
+ this.LockID; //锁ID
51956
+ this.IndexName; //指标名字
51957
+ this.IndexID; //指标ID
51958
+
51959
+ this.SetData=function(lockData)
51960
+ {
51961
+ if (!lockData) //空 解锁
51962
+ {
51963
+ this.IsLocked=false;
51964
+ return;
51965
+ }
51966
+
51967
+ this.IsLocked=true;
51968
+ if (lockData.Callback) this.Callback=lockData.Callback; //回调 !!废弃
51969
+ if (lockData.IndexName) this.IndexName=lockData.IndexName; //指标名字
51970
+ if (lockData.IndexID) this.IndexID=lockData.IndexID; //指标ID
51971
+ if (lockData.ID) this.LockID=lockData.ID; //锁ID
51972
+ if (lockData.BG) this.BGColor=lockData.BG; //背景色
51973
+ if (lockData.Text) this.Title= lockData.Text;
51974
+ if (lockData.TextColor) this.TextColor=lockData.TextColor;
51975
+ if (lockData.Font) this.Font=lockData.Font;
51976
+ if (lockData.Count) this.LockCount=lockData.Count;
51977
+ }
51978
+ }
51979
+
51879
51980
  //锁 支持横屏
51880
51981
  function ChartLock()
51881
51982
  {
@@ -51884,17 +51985,39 @@ function ChartLock()
51884
51985
  delete this.newMethod;
51885
51986
 
51886
51987
  this.ClassName="ChartLock";
51988
+ this.AryData=null;
51989
+ this.LockRect=null; //上锁区域
51990
+
51887
51991
  this.LockCount = 20; // 锁最新的几个数据
51888
51992
  this.BGColor = g_JSChartResource.IndexLock.BGColor;
51889
51993
  this.TextColor = g_JSChartResource.IndexLock.TextColor;
51890
51994
  this.Font = g_JSChartResource.IndexLock.Font;
51891
51995
  this.Title = g_JSChartResource.IndexLock.Title;
51892
- this.LockRect=null; //上锁区域
51996
+
51893
51997
  this.LockID; //锁ID
51894
51998
  this.Callback; //回调
51895
51999
  this.IndexName; //指标名字
51896
52000
  this.IndexID; //指标ID
51897
52001
 
52002
+ this.SetData=function(aryData)
52003
+ {
52004
+ this.AryData=aryData;
52005
+
52006
+ if (IFrameSplitOperator.IsNonEmptyArray(this.AryData))
52007
+ {
52008
+ var item=this.AryData[0].Data; //取第一个锁
52009
+
52010
+ this.LockCount = item.LockCount;
52011
+ this.BGColor = item.BGColor
52012
+ this.TextColor = item.TextColor
52013
+ this.Font = item.Font
52014
+ this.Title = item.Title
52015
+ this.LockID=item.LockID; //锁ID
52016
+ this.Callback=item.Callback; //回调
52017
+ this.IndexName=item.IndexName; //指标名字
52018
+ this.IndexID=item.IndexID; //指标ID
52019
+ }
52020
+ }
51898
52021
 
51899
52022
  this.CalculateTextSize=function(aryText, defaultFont, out)
51900
52023
  {
@@ -51916,7 +52039,7 @@ function ChartLock()
51916
52039
  }
51917
52040
  else
51918
52041
  {
51919
- if (item.Font)
52042
+ if (item.Font)
51920
52043
  {
51921
52044
  this.Canvas.font=item.Font;
51922
52045
  lineHeight=this.Canvas.measureText("擎").width;
@@ -51962,12 +52085,7 @@ function ChartLock()
51962
52085
  this.Draw=function(bDraw)
51963
52086
  {
51964
52087
  this.LockRect=null;
51965
- if (!bDraw) return;
51966
- if (this.NotSupportMessage)
51967
- {
51968
- this.DrawNotSupportmessage();
51969
- return;
51970
- }
52088
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
51971
52089
 
51972
52090
  var bHScreen=this.ChartFrame.IsHScreen;
51973
52091
  var bMinute=this.IsMinuteFrame();
@@ -52013,24 +52131,33 @@ function ChartLock()
52013
52131
  var rtBG={ Left:border.Left, Right:border.RightEx, Top:left, Bottom:border.Bottom };
52014
52132
  rtBG.Width=rtBG.Right-rtBG.Left;
52015
52133
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52016
-
52017
- var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
52018
- this.Canvas.fillStyle =bgColor;
52019
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52020
52134
  this.LockRect=rtBG; //保存上锁区域
52135
+
52136
+ if (bDraw)
52137
+ {
52138
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
52139
+ this.Canvas.fillStyle =bgColor;
52140
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52141
+ }
52021
52142
  }
52022
52143
  else
52023
52144
  {
52024
52145
  var rtBG={ Left:left, Right:border.RightEx, Top:border.TopTitle, Bottom:border.Bottom };
52025
52146
  rtBG.Width=rtBG.Right-rtBG.Left;
52026
52147
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52027
- //上下渐变
52028
- var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
52029
- this.Canvas.fillStyle =bgColor;
52030
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52031
52148
  this.LockRect=rtBG; //保存上锁区域
52149
+
52150
+ if (bDraw)
52151
+ {
52152
+ //上下渐变
52153
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
52154
+ this.Canvas.fillStyle =bgColor;
52155
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52156
+ }
52032
52157
  }
52033
52158
 
52159
+ if (!bDraw) return;
52160
+
52034
52161
  var aryText=null;
52035
52162
  if (Array.isArray(this.Title)) aryText=this.Title;
52036
52163
  else aryText=[{Text:this.Title}];
@@ -52047,67 +52174,54 @@ function ChartLock()
52047
52174
  var top=rtBG.Top+(rtBG.Height-outSize.Width)/2;
52048
52175
  if (outSize.Width>rtBG.Height) top=rtBG.Bottom-outSize.Width;
52049
52176
  var left=rtBG.Left+(rtBG.Width-outSize.Height)/2;
52050
-
52051
52177
  this.Canvas.save();
52052
52178
  this.Canvas.translate(left, top);
52053
52179
  this.Canvas.rotate(90 * Math.PI / 180);
52054
- var yText=0,xText=0;
52055
- for(var i=0;i<outSize.AryText.length;++i)
52056
- {
52057
- var item=outSize.AryText[i];
52058
- if (item.Color) this.Canvas.fillStyle=item.Color;
52059
- else this.Canvas.fillStyle=this.TextColor;
52060
-
52061
- if (item.Font) this.Canvas.font = item.Font;
52062
- else this.Canvas.font = this.Font;
52063
-
52064
- yText+=item.Height;
52065
- this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52066
- }
52067
-
52068
- this.Canvas.restore();
52180
+ var left=0,top=0;
52069
52181
  }
52070
52182
  else
52071
52183
  {
52072
52184
  var left=rtBG.Left+(rtBG.Width-outSize.Width)/2;
52073
52185
  if (outSize.Width>rtBG.Width) left=rtBG.Right-outSize.Width;
52074
52186
  var top=rtBG.Top+(rtBG.Height-outSize.Height)/2;
52075
-
52076
- var yText=top, xText=left;
52077
- for(var i=0;i<outSize.AryText.length;++i)
52187
+ }
52188
+
52189
+ var yText=top, xText=left;
52190
+ for(var i=0;i<outSize.AryText.length;++i)
52191
+ {
52192
+ var item=outSize.AryText[i];
52193
+ xText=left;
52194
+ if (item.Image)
52078
52195
  {
52079
- var item=outSize.AryText[i];
52080
- if (item.Image)
52196
+ if (item.Align===1)
52081
52197
  {
52082
- xText=left;
52083
- if (item.Align===1)
52084
- {
52085
- if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52086
- }
52087
-
52088
- this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
52089
-
52090
- yText+=item.Height;
52198
+ if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52091
52199
  }
52092
- else
52093
- {
52094
- if (item.Color) this.Canvas.fillStyle=item.Color;
52095
- else this.Canvas.fillStyle=this.TextColor;
52096
52200
 
52097
- if (item.Font) this.Canvas.font = item.Font;
52098
- else this.Canvas.font = this.Font;
52201
+ this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
52099
52202
 
52100
- yText+=item.Height;
52101
- xText=left;
52102
- if (item.Align===1)
52103
- {
52104
- if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52105
- }
52203
+ yText+=item.Height;
52204
+ }
52205
+ else
52206
+ {
52207
+ if (item.Color) this.Canvas.fillStyle=item.Color;
52208
+ else this.Canvas.fillStyle=this.TextColor;
52209
+
52210
+ if (item.Font) this.Canvas.font = item.Font;
52211
+ else this.Canvas.font = this.Font;
52106
52212
 
52107
- this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52213
+ yText+=item.Height;
52214
+
52215
+ if (item.Align===1)
52216
+ {
52217
+ if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52108
52218
  }
52109
- }
52219
+
52220
+ this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52221
+ }
52110
52222
  }
52223
+
52224
+ if (bHScreen) this.Canvas.restore();
52111
52225
  }
52112
52226
 
52113
52227
  //x,y是否在上锁区域
@@ -52117,7 +52231,7 @@ function ChartLock()
52117
52231
 
52118
52232
  if (Path2DHelper.PtInRect(x,y,this.LockRect))
52119
52233
  {
52120
- tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID };
52234
+ tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID, Data:this.AryData };
52121
52235
  tooltip.ChartPaint=this;
52122
52236
  return true;
52123
52237
  }
@@ -87074,6 +87188,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87074
87188
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
87075
87189
  frame.GlobalOption=this.GlobalOption;
87076
87190
  frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
87191
+ frame.CreateLockPaint();
87077
87192
 
87078
87193
  frame.HorizontalMax=20;
87079
87194
  frame.HorizontalMin=10;
@@ -87175,6 +87290,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87175
87290
  frame.XSplitOperator.Symbol=this.Symbol;
87176
87291
  frame.XSplitOperator.Period=this.Period;
87177
87292
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
87293
+ frame.CreateLockPaint();
87178
87294
 
87179
87295
  //K线数据绑定
87180
87296
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
@@ -89634,7 +89750,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89634
89750
 
89635
89751
 
89636
89752
  subFrame.YSpecificMaxMin=null; //清空指定最大最小值
89637
- subFrame.IsLocked=false; //解除上锁
89638
89753
  subFrame.YSplitScale = null; //清空固定刻度
89639
89754
  subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
89640
89755
 
@@ -89932,7 +90047,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89932
90047
 
89933
90048
 
89934
90049
  this.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=null; //清空指定最大最小值
89935
- this.Frame.SubFrame[windowIndex].Frame.IsLocked=false; //解除上锁
89936
90050
  this.Frame.SubFrame[windowIndex].Frame.YSplitScale = null; //清空固定刻度
89937
90051
 
89938
90052
  this.ChartPaint=paint;
@@ -89990,7 +90104,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89990
90104
  }
89991
90105
  else if (obj.Script) //动态执行脚本
89992
90106
  {
89993
- indexInfo={ Script:obj.Script, ID:obj.indexName, Name:obj.indexName};
90107
+ indexInfo={ Script:obj.Script, ID:obj.IndexName, Name:obj.IndexName};
89994
90108
  if (obj.Name) indexInfo.Name=obj.Name;
89995
90109
  }
89996
90110
  else
@@ -90325,7 +90439,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90325
90439
  this.DeleteIndexPaint(i);
90326
90440
  var frame=this.Frame.SubFrame[i];
90327
90441
  frame.YSpecificMaxMin=null;
90328
- frame.IsLocked=false;
90329
90442
  frame.YSplitScale = null;
90330
90443
  }
90331
90444
 
@@ -90705,35 +90818,16 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90705
90818
  }
90706
90819
  }
90707
90820
 
90708
- //锁|解锁指标 { Index:指标名字,IsLocked:是否要锁上,Callback:回调 }
90709
- this.LockIndex=function(lockData)
90710
- {
90711
- if (!lockData) return;
90712
- if (!lockData.IndexName) return;
90713
-
90714
- for(let i in this.WindowIndex)
90715
- {
90716
- let item=this.WindowIndex[i];
90717
- if (!item) conintue;
90718
- if (item.Name==lockData.IndexName)
90719
- {
90720
- item.SetLock(lockData);
90721
- this.Update();
90722
- break;
90723
- }
90724
- }
90725
- }
90726
-
90727
90821
  this.TryClickLock=function(x,y)
90728
90822
  {
90729
90823
  for(var i=0;i<this.Frame.SubFrame.length; ++i)
90730
90824
  {
90731
90825
  var item=this.Frame.SubFrame[i];
90732
- if (!item.Frame.IsLocked) continue;
90733
- if (!item.Frame.LockPaint) continue;
90826
+ var chartLock=item.Frame.LockPaint;
90827
+ if (!chartLock || !chartLock.LockRect) continue;
90734
90828
 
90735
90829
  var tooltip=new TooltipData();
90736
- if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
90830
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
90737
90831
 
90738
90832
  tooltip.HQChart=this;
90739
90833
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
@@ -96739,6 +96833,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96739
96833
  frame.XPointCount=243;
96740
96834
  frame.HQChart=this;
96741
96835
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96836
+ frame.CreateLockPaint();
96742
96837
 
96743
96838
  if (i>=2)
96744
96839
  {
@@ -96850,6 +96945,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96850
96945
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96851
96946
  frame.XSplitOperator.Symbol=this.Symbol;
96852
96947
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
96948
+ frame.CreateLockPaint();
96853
96949
 
96854
96950
  if (this.DayCount>1)
96855
96951
  {
@@ -96975,7 +97071,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96975
97071
  //清空指定最大最小值
96976
97072
 
96977
97073
  subFrame.YSpecificMaxMin=null;
96978
- subFrame.IsLocked=false; //解除上锁
96979
97074
  subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
96980
97075
 
96981
97076
  this.ChartPaint=paint;
@@ -97208,7 +97303,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
97208
97303
  this.DeleteIndexPaint(i);
97209
97304
  var frame=this.Frame.SubFrame[i];
97210
97305
  frame.YSpecificMaxMin=null;
97211
- frame.IsLocked=false;
97212
97306
  frame.YSplitScale = null;
97213
97307
  }
97214
97308
 
@@ -99455,9 +99549,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
99455
99549
  {
99456
99550
  overlayFrame=new OverlayIndexItem();
99457
99551
  overlayFrame.Identify='Position_Line_Frame';
99458
-
99459
- if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99460
- else frame=new OverlayMinuteHScreenFrame();
99552
+ frame=this.CreateOverlayFrame();
99553
+ //if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99554
+ //else frame=new OverlayMinuteHScreenFrame();
99461
99555
 
99462
99556
  frame.Canvas=this.Canvas;
99463
99557
  frame.MainFrame=subFrame.Frame;
@@ -99640,9 +99734,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
99640
99734
  var subFrame=this.Frame.SubFrame[windowIndex];
99641
99735
  var overlayFrame=new OverlayIndexItem();
99642
99736
  if (obj.Identify) overlayFrame.Identify=obj.Identify; //由外部指定id
99643
- var frame=null;
99644
- if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99645
- else frame=new OverlayMinuteHScreenFrame();
99737
+ var frame=this.CreateOverlayFrame();
99738
+ //if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99739
+ //else frame=new OverlayMinuteHScreenFrame();
99646
99740
  frame.Canvas=this.Canvas;
99647
99741
  frame.MainFrame=subFrame.Frame;
99648
99742
  frame.ChartBorder=subFrame.Frame.ChartBorder;
@@ -100562,13 +100656,22 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100562
100656
  for(var i=0;i<this.Frame.SubFrame.length; ++i)
100563
100657
  {
100564
100658
  var item=this.Frame.SubFrame[i];
100565
- if (!item.Frame.IsLocked) continue;
100566
- if (!item.Frame.LockPaint) continue;
100659
+ var chartLock=item.Frame.LockPaint;
100660
+ if (!chartLock || !chartLock.LockRect) continue;
100567
100661
 
100568
100662
  var tooltip=new TooltipData();
100569
- if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
100663
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
100570
100664
 
100571
100665
  tooltip.HQChart=this;
100666
+
100667
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
100668
+ if (event && event.Callback)
100669
+ {
100670
+ var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
100671
+ event.Callback(event,sendData,this);
100672
+ }
100673
+
100674
+
100572
100675
  if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
100573
100676
  return true;
100574
100677
  }
@@ -130284,7 +130387,7 @@ function ScriptIndex(name,script,args,option)
130284
130387
  Name:hqChart.Name,
130285
130388
  Data:hisData,
130286
130389
  SourceData:hqChart.SourceData,
130287
- Callback:this.RecvResultData, CallbackParam:param,
130390
+ Callback:(arg1, arg2)=>{ this.RecvResultData(arg1, arg2); }, CallbackParam:param,
130288
130391
  Async:true,
130289
130392
  MaxRequestDataCount:hqChart.MaxRequestDataCount,
130290
130393
  MaxRequestMinuteDayCount:hqChart.MaxRequestMinuteDayCount,
@@ -132973,6 +133076,18 @@ function OverlayScriptIndex(name,script,args,option)
132973
133076
  param.Self.OutVar=outVar;
132974
133077
  param.Self.BindData(hqChart,windowIndex,hisData);
132975
133078
 
133079
+ var frame=this.OverlayIndex.Frame.Frame;
133080
+ if (this.IsLocked==false) //不上锁
133081
+ {
133082
+ frame.SetLock(null);
133083
+ }
133084
+ else //上锁
133085
+ {
133086
+ let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID, IndexID:this.ID,
133087
+ BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
133088
+ frame.SetLock(lockData);
133089
+ }
133090
+
132976
133091
  param.HQChart.UpdataDataoffset(); //更新数据偏移
132977
133092
  param.HQChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
132978
133093
 
@@ -134833,20 +134948,20 @@ function APIScriptIndex(name,script,args,option, isOverlay)
134833
134948
  }
134834
134949
  this.BindData(hqChart,windowIndex,hisData);
134835
134950
 
134836
- if (!this.IsOverlayIndex)
134951
+ var frame=hqChart.Frame.SubFrame[windowIndex].Frame;
134952
+ if (this.IsOverlayIndex) frame=this.OverlayIndex.Frame.Frame;
134953
+
134954
+ if (this.IsLocked==false) //不上锁
134837
134955
  {
134838
- if (this.IsLocked==false) //不上锁
134839
- {
134840
- hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(null);
134841
- }
134842
- else //上锁
134843
- {
134844
- let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,
134845
- BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
134846
- hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(lockData);
134847
- }
134956
+ frame.SetLock(null);
134848
134957
  }
134849
-
134958
+ else //上锁
134959
+ {
134960
+ let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,IndexID:this.ID,
134961
+ BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
134962
+ frame.SetLock(lockData);
134963
+ }
134964
+
134850
134965
  hqChart.UpdataDataoffset(); //更新数据偏移
134851
134966
  hqChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
134852
134967
 
@@ -153717,7 +153832,7 @@ function ScrollBarBGChart()
153717
153832
 
153718
153833
 
153719
153834
 
153720
- var HQCHART_VERSION="1.1.15105";
153835
+ var HQCHART_VERSION="1.1.15110";
153721
153836
 
153722
153837
  function PrintHQChartVersion()
153723
153838
  {