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.
@@ -6359,12 +6359,12 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
6359
6359
  }
6360
6360
 
6361
6361
  //锁指标
6362
- this.LockIndex=function(lockData)
6362
+ this.EnableLockIndex=function(aryData)
6363
6363
  {
6364
- if(this.JSChartContainer && typeof(this.JSChartContainer.LockIndex)=='function')
6364
+ if(this.JSChartContainer && typeof(this.JSChartContainer.EnableLockIndex)=='function')
6365
6365
  {
6366
- JSConsole.Chart.Log('[JSChart:LockIndex] lockData', lockData);
6367
- this.JSChartContainer.LockIndex(lockData);
6366
+ JSConsole.Chart.Log('[JSChart:EnableLockIndex] aryData', aryData);
6367
+ this.JSChartContainer.EnableLockIndex(lockData);
6368
6368
  }
6369
6369
  }
6370
6370
 
@@ -16648,6 +16648,55 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
16648
16648
  if (!this.PressKeyboardConfig) return false;
16649
16649
  if (!this.PressKeyboardConfig.PauseUpdate) return false;
16650
16650
 
16651
+ return true;
16652
+ },
16653
+
16654
+ //启动|关闭锁指标 aryIndex=[{ IndexID:指标ID, LockData:{IsLocked:} } ]
16655
+ this.EnableLockIndex=function(aryIndex)
16656
+ {
16657
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryIndex)) return false;
16658
+
16659
+ var mapIndex=new Map();
16660
+ for(var i=0;i<aryIndex.length;++i)
16661
+ {
16662
+ var item=aryIndex[i];
16663
+ if (item.IndexID && item.LockData) mapIndex.set(item.IndexID, item);
16664
+ }
16665
+
16666
+ var aryUpdate=[];
16667
+ for(var i=0; i<this.WindowIndex.length; ++i)
16668
+ {
16669
+ var item=this.WindowIndex[i];
16670
+ if (!item) continue;
16671
+ if (mapIndex.has(item.ID))
16672
+ {
16673
+ var mapItem=mapIndex.get(item.ID);
16674
+ item.SetLock(mapItem.LockData); //设置锁
16675
+ aryUpdate.push({ ID:i});
16676
+ }
16677
+ }
16678
+
16679
+ for(var i=0; i<this.Frame.SubFrame.length; ++i)
16680
+ {
16681
+ var item=this.Frame.SubFrame[i];
16682
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)) continue;
16683
+
16684
+ for(var j=0; j<item.OverlayIndex.length; ++j)
16685
+ {
16686
+ var overlayItem=item.OverlayIndex[j];
16687
+ var script=overlayItem.Script;
16688
+ if (mapIndex.has(script.ID))
16689
+ {
16690
+ var mapItem=mapIndex.get(script.ID);
16691
+ script.SetLock(mapItem.LockData);
16692
+ aryUpdate.push({OverlayID:overlayItem.Identify});
16693
+ }
16694
+ }
16695
+ }
16696
+
16697
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryUpdate)) return false;
16698
+
16699
+ this.UpdateWindowIndexV2(aryUpdate);
16651
16700
  return true;
16652
16701
  }
16653
16702
  }
@@ -17297,8 +17346,8 @@ function IChartFramePainting()
17297
17346
  this.XSplitOperator; //X轴分割
17298
17347
  this.Data; //主数据
17299
17348
 
17300
- this.IsLocked=false; //是否上锁
17301
- this.LockPaint = null;
17349
+ this.LockPaint = null; //锁图形
17350
+ this.IndexLock=new IndexLockData(); //指标锁
17302
17351
 
17303
17352
  this.YSpecificMaxMin=null; //指定Y轴最大最小值
17304
17353
  this.IsShowBorder = true; //是否显示边框
@@ -17570,15 +17619,8 @@ function IChartFramePainting()
17570
17619
 
17571
17620
  this.DrawLock=function()
17572
17621
  {
17573
- if (this.IsLocked)
17574
- {
17575
- if (this.LockPaint == null)
17576
- this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
17577
- this.LockPaint.Canvas=this.Canvas;
17578
- this.LockPaint.ChartBorder=this.ChartBorder;
17579
- this.LockPaint.ChartFrame=this;
17580
- this.LockPaint.Draw(true);
17581
- }
17622
+ if (!this.LockPaint) return;
17623
+ this.LockPaint.Draw(true);
17582
17624
  }
17583
17625
 
17584
17626
  this.DrawLogo=function()
@@ -17634,46 +17676,28 @@ function IChartFramePainting()
17634
17676
  }
17635
17677
  }
17636
17678
 
17637
- this.CalculateLock=function()
17679
+ this.CalculateLock=function(aryData)
17638
17680
  {
17639
- if (this.IsLocked)
17640
- {
17641
- if (this.LockPaint == null)
17642
- this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
17643
- this.LockPaint.Canvas=this.Canvas;
17644
- this.LockPaint.ChartBorder=this.ChartBorder;
17645
- this.LockPaint.ChartFrame=this;
17646
- this.LockPaint.Draw(false);
17647
- }
17681
+ this.LockPaint.SetData(aryData);
17682
+ this.LockPaint.Draw(false);
17648
17683
  }
17649
17684
 
17650
- //设施上锁
17651
- this.SetLock=function(lockData)
17685
+ //创建锁图形
17686
+ this.CreateLockPaint=function()
17652
17687
  {
17653
- if (!lockData) //空数据不上锁
17654
- {
17655
- this.IsLocked=false;
17656
- return;
17657
- }
17658
-
17659
- this.IsLocked=true;
17660
- if (!this.LockPaint) this.LockPaint=g_ChartPaintFactory.Create("ChartLock"); //new ChartLock(); //创建锁
17688
+ this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
17689
+ this.LockPaint.Canvas=this.Canvas;
17690
+ this.LockPaint.ChartBorder=this.ChartBorder;
17691
+ this.LockPaint.ChartFrame=this;
17692
+ }
17661
17693
 
17662
- if (lockData.Callback) this.LockPaint.Callback=lockData.Callback; //回调
17663
- if (lockData.IndexName) this.LockPaint.IndexName=lockData.IndexName; //指标名字
17664
- if (lockData.IndexID) this.LockPaint.IndexID=lockData.IndexID; //指标ID
17665
- if (lockData.ID) this.LockPaint.LockID=lockData.ID; //锁ID
17666
- if (lockData.BG) this.LockPaint.BGColor=lockData.BG; //背景色
17667
- if (lockData.Text) this.LockPaint.Title= lockData.Text;
17668
- if (lockData.TextColor) this.LockPaint.TextColor=lockData.TextColor;
17669
- if (lockData.Font) this.LockPaint.Font=lockData.Font;
17670
- if (lockData.Count) this.LockPaint.LockCount=lockData.Count;
17671
- if (lockData.MinWidth>0) this.LockPaint.MinWidth=lockData.MinWidth;
17694
+ this.SetLock=function(lockData)
17695
+ {
17696
+ this.IndexLock.SetData(lockData);
17672
17697
  }
17673
17698
 
17674
17699
  this.GetLockRect=function()
17675
17700
  {
17676
- if (!this.IsLocked) return null;
17677
17701
  if (!this.LockPaint) return null;
17678
17702
  return this.LockPaint.LockRect;
17679
17703
  }
@@ -22710,6 +22734,13 @@ function OverlayMinuteFrame()
22710
22734
  this.IsShareY=false; //使用和主框架公用Y轴
22711
22735
  this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
22712
22736
  this.IsShowMainFrame=0; //是否显示在主框架坐标上 1=左边 2=右边
22737
+ this.MainFrame=null; //主框架
22738
+
22739
+ this.GetLockRect=function()
22740
+ {
22741
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
22742
+ return this.MainFrame.GetLockRect();
22743
+ }
22713
22744
 
22714
22745
  this.Draw=function()
22715
22746
  {
@@ -22768,6 +22799,13 @@ function OverlayMinuteHScreenFrame()
22768
22799
 
22769
22800
  this.ClassName="OverlayMinuteHScreenFrame";
22770
22801
  this.IsShow=true; //坐标是否显示
22802
+ this.MainFrame=null; //主框架
22803
+
22804
+ this.GetLockRect=function()
22805
+ {
22806
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
22807
+ return this.MainFrame.GetLockRect();
22808
+ }
22771
22809
 
22772
22810
  this.Draw=function()
22773
22811
  {
@@ -24155,6 +24193,12 @@ function OverlayKLineFrame()
24155
24193
  }
24156
24194
  }
24157
24195
 
24196
+ this.GetLockRect=function()
24197
+ {
24198
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
24199
+ return this.MainFrame.GetLockRect();
24200
+ }
24201
+
24158
24202
  this.Draw=function()
24159
24203
  {
24160
24204
  this.Buttons=[];
@@ -25467,6 +25511,12 @@ function OverlayKLineHScreenFrame()
25467
25511
  this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;
25468
25512
  this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;
25469
25513
 
25514
+ this.GetLockRect=function()
25515
+ {
25516
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
25517
+ return this.MainFrame.GetLockRect();
25518
+ }
25519
+
25470
25520
  this.Draw=function()
25471
25521
  {
25472
25522
  this.SplitXYCoordinate();
@@ -26673,7 +26723,7 @@ function HQTradeFrame()
26673
26723
 
26674
26724
  this.DrawLock=function()
26675
26725
  {
26676
- for (var i in this.SubFrame)
26726
+ for (var i=0; i<this.SubFrame.length; ++i)
26677
26727
  {
26678
26728
  var item = this.SubFrame[i];
26679
26729
  item.Frame.DrawLock();
@@ -26695,10 +26745,21 @@ function HQTradeFrame()
26695
26745
 
26696
26746
  this.CalculateLock=function()
26697
26747
  {
26698
- for (var i in this.SubFrame)
26748
+ for (var i=0, j=0; i<this.SubFrame.length; ++i)
26699
26749
  {
26700
26750
  var item = this.SubFrame[i];
26701
- item.Frame.CalculateLock();
26751
+ var aryLockData=[];
26752
+ if (item.Frame.IndexLock.IsLocked) aryLockData.push({ Data:item.Frame.IndexLock, IsOverlay:false });
26753
+ for(j=0; j<item.OverlayIndex.length; ++j)
26754
+ {
26755
+ var subItem=item.OverlayIndex[j];
26756
+ if (subItem.Frame.IndexLock.IsLocked===true)
26757
+ {
26758
+ aryLockData.push({ Data:subItem.Frame.IndexLock, IsOverlay:true } );
26759
+ }
26760
+ }
26761
+
26762
+ item.Frame.CalculateLock(aryLockData);
26702
26763
  }
26703
26764
  }
26704
26765
 
@@ -42845,6 +42906,13 @@ function ChartStickLine()
42845
42906
  xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
42846
42907
  }
42847
42908
 
42909
+ var lockRect=this.GetLockRect();
42910
+ if (lockRect)
42911
+ {
42912
+ if (this.IsHScreen) chartright=lockRect.Top;
42913
+ else chartright=lockRect.Left;
42914
+ }
42915
+
42848
42916
  var isMinute=this.IsMinuteFrame();
42849
42917
 
42850
42918
  if (isMinute)
@@ -51920,6 +51988,39 @@ function ChartDrawFlagText()
51920
51988
  }
51921
51989
  }
51922
51990
 
51991
+ function IndexLockData()
51992
+ {
51993
+ this.IsLocked=false;
51994
+ this.LockCount = 20; // 锁最新的几个数据
51995
+ this.BGColor = g_JSChartResource.IndexLock.BGColor;
51996
+ this.TextColor = g_JSChartResource.IndexLock.TextColor;
51997
+ this.Font = g_JSChartResource.IndexLock.Font;
51998
+ this.Title = g_JSChartResource.IndexLock.Title;
51999
+ this.LockID; //锁ID
52000
+ this.IndexName; //指标名字
52001
+ this.IndexID; //指标ID
52002
+
52003
+ this.SetData=function(lockData)
52004
+ {
52005
+ if (!lockData) //空 解锁
52006
+ {
52007
+ this.IsLocked=false;
52008
+ return;
52009
+ }
52010
+
52011
+ this.IsLocked=true;
52012
+ if (lockData.Callback) this.Callback=lockData.Callback; //回调 !!废弃
52013
+ if (lockData.IndexName) this.IndexName=lockData.IndexName; //指标名字
52014
+ if (lockData.IndexID) this.IndexID=lockData.IndexID; //指标ID
52015
+ if (lockData.ID) this.LockID=lockData.ID; //锁ID
52016
+ if (lockData.BG) this.BGColor=lockData.BG; //背景色
52017
+ if (lockData.Text) this.Title= lockData.Text;
52018
+ if (lockData.TextColor) this.TextColor=lockData.TextColor;
52019
+ if (lockData.Font) this.Font=lockData.Font;
52020
+ if (lockData.Count) this.LockCount=lockData.Count;
52021
+ }
52022
+ }
52023
+
51923
52024
  //锁 支持横屏
51924
52025
  function ChartLock()
51925
52026
  {
@@ -51928,17 +52029,39 @@ function ChartLock()
51928
52029
  delete this.newMethod;
51929
52030
 
51930
52031
  this.ClassName="ChartLock";
52032
+ this.AryData=null;
52033
+ this.LockRect=null; //上锁区域
52034
+
51931
52035
  this.LockCount = 20; // 锁最新的几个数据
51932
52036
  this.BGColor = g_JSChartResource.IndexLock.BGColor;
51933
52037
  this.TextColor = g_JSChartResource.IndexLock.TextColor;
51934
52038
  this.Font = g_JSChartResource.IndexLock.Font;
51935
52039
  this.Title = g_JSChartResource.IndexLock.Title;
51936
- this.LockRect=null; //上锁区域
52040
+
51937
52041
  this.LockID; //锁ID
51938
52042
  this.Callback; //回调
51939
52043
  this.IndexName; //指标名字
51940
52044
  this.IndexID; //指标ID
51941
52045
 
52046
+ this.SetData=function(aryData)
52047
+ {
52048
+ this.AryData=aryData;
52049
+
52050
+ if (IFrameSplitOperator.IsNonEmptyArray(this.AryData))
52051
+ {
52052
+ var item=this.AryData[0].Data; //取第一个锁
52053
+
52054
+ this.LockCount = item.LockCount;
52055
+ this.BGColor = item.BGColor
52056
+ this.TextColor = item.TextColor
52057
+ this.Font = item.Font
52058
+ this.Title = item.Title
52059
+ this.LockID=item.LockID; //锁ID
52060
+ this.Callback=item.Callback; //回调
52061
+ this.IndexName=item.IndexName; //指标名字
52062
+ this.IndexID=item.IndexID; //指标ID
52063
+ }
52064
+ }
51942
52065
 
51943
52066
  this.CalculateTextSize=function(aryText, defaultFont, out)
51944
52067
  {
@@ -51960,7 +52083,7 @@ function ChartLock()
51960
52083
  }
51961
52084
  else
51962
52085
  {
51963
- if (item.Font)
52086
+ if (item.Font)
51964
52087
  {
51965
52088
  this.Canvas.font=item.Font;
51966
52089
  lineHeight=this.Canvas.measureText("擎").width;
@@ -52006,12 +52129,7 @@ function ChartLock()
52006
52129
  this.Draw=function(bDraw)
52007
52130
  {
52008
52131
  this.LockRect=null;
52009
- if (!bDraw) return;
52010
- if (this.NotSupportMessage)
52011
- {
52012
- this.DrawNotSupportmessage();
52013
- return;
52014
- }
52132
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
52015
52133
 
52016
52134
  var bHScreen=this.ChartFrame.IsHScreen;
52017
52135
  var bMinute=this.IsMinuteFrame();
@@ -52057,24 +52175,33 @@ function ChartLock()
52057
52175
  var rtBG={ Left:border.Left, Right:border.RightEx, Top:left, Bottom:border.Bottom };
52058
52176
  rtBG.Width=rtBG.Right-rtBG.Left;
52059
52177
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52060
-
52061
- var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
52062
- this.Canvas.fillStyle =bgColor;
52063
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52064
52178
  this.LockRect=rtBG; //保存上锁区域
52179
+
52180
+ if (bDraw)
52181
+ {
52182
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
52183
+ this.Canvas.fillStyle =bgColor;
52184
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52185
+ }
52065
52186
  }
52066
52187
  else
52067
52188
  {
52068
52189
  var rtBG={ Left:left, Right:border.RightEx, Top:border.TopTitle, Bottom:border.Bottom };
52069
52190
  rtBG.Width=rtBG.Right-rtBG.Left;
52070
52191
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52071
- //上下渐变
52072
- var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
52073
- this.Canvas.fillStyle =bgColor;
52074
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52075
52192
  this.LockRect=rtBG; //保存上锁区域
52193
+
52194
+ if (bDraw)
52195
+ {
52196
+ //上下渐变
52197
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
52198
+ this.Canvas.fillStyle =bgColor;
52199
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52200
+ }
52076
52201
  }
52077
52202
 
52203
+ if (!bDraw) return;
52204
+
52078
52205
  var aryText=null;
52079
52206
  if (Array.isArray(this.Title)) aryText=this.Title;
52080
52207
  else aryText=[{Text:this.Title}];
@@ -52091,67 +52218,54 @@ function ChartLock()
52091
52218
  var top=rtBG.Top+(rtBG.Height-outSize.Width)/2;
52092
52219
  if (outSize.Width>rtBG.Height) top=rtBG.Bottom-outSize.Width;
52093
52220
  var left=rtBG.Left+(rtBG.Width-outSize.Height)/2;
52094
-
52095
52221
  this.Canvas.save();
52096
52222
  this.Canvas.translate(left, top);
52097
52223
  this.Canvas.rotate(90 * Math.PI / 180);
52098
- var yText=0,xText=0;
52099
- for(var i=0;i<outSize.AryText.length;++i)
52100
- {
52101
- var item=outSize.AryText[i];
52102
- if (item.Color) this.Canvas.fillStyle=item.Color;
52103
- else this.Canvas.fillStyle=this.TextColor;
52104
-
52105
- if (item.Font) this.Canvas.font = item.Font;
52106
- else this.Canvas.font = this.Font;
52107
-
52108
- yText+=item.Height;
52109
- this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52110
- }
52111
-
52112
- this.Canvas.restore();
52224
+ var left=0,top=0;
52113
52225
  }
52114
52226
  else
52115
52227
  {
52116
52228
  var left=rtBG.Left+(rtBG.Width-outSize.Width)/2;
52117
52229
  if (outSize.Width>rtBG.Width) left=rtBG.Right-outSize.Width;
52118
52230
  var top=rtBG.Top+(rtBG.Height-outSize.Height)/2;
52119
-
52120
- var yText=top, xText=left;
52121
- for(var i=0;i<outSize.AryText.length;++i)
52231
+ }
52232
+
52233
+ var yText=top, xText=left;
52234
+ for(var i=0;i<outSize.AryText.length;++i)
52235
+ {
52236
+ var item=outSize.AryText[i];
52237
+ xText=left;
52238
+ if (item.Image)
52122
52239
  {
52123
- var item=outSize.AryText[i];
52124
- if (item.Image)
52240
+ if (item.Align===1)
52125
52241
  {
52126
- xText=left;
52127
- if (item.Align===1)
52128
- {
52129
- if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52130
- }
52131
-
52132
- this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
52133
-
52134
- yText+=item.Height;
52242
+ if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52135
52243
  }
52136
- else
52137
- {
52138
- if (item.Color) this.Canvas.fillStyle=item.Color;
52139
- else this.Canvas.fillStyle=this.TextColor;
52140
52244
 
52141
- if (item.Font) this.Canvas.font = item.Font;
52142
- else this.Canvas.font = this.Font;
52245
+ this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
52143
52246
 
52144
- yText+=item.Height;
52145
- xText=left;
52146
- if (item.Align===1)
52147
- {
52148
- if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52149
- }
52247
+ yText+=item.Height;
52248
+ }
52249
+ else
52250
+ {
52251
+ if (item.Color) this.Canvas.fillStyle=item.Color;
52252
+ else this.Canvas.fillStyle=this.TextColor;
52253
+
52254
+ if (item.Font) this.Canvas.font = item.Font;
52255
+ else this.Canvas.font = this.Font;
52150
52256
 
52151
- this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52257
+ yText+=item.Height;
52258
+
52259
+ if (item.Align===1)
52260
+ {
52261
+ if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52152
52262
  }
52153
- }
52263
+
52264
+ this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52265
+ }
52154
52266
  }
52267
+
52268
+ if (bHScreen) this.Canvas.restore();
52155
52269
  }
52156
52270
 
52157
52271
  //x,y是否在上锁区域
@@ -52161,7 +52275,7 @@ function ChartLock()
52161
52275
 
52162
52276
  if (Path2DHelper.PtInRect(x,y,this.LockRect))
52163
52277
  {
52164
- tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID };
52278
+ tooltip.Data={ ID:this.LockID, Callback:this.Callback, IndexName:this.IndexName, IndexID:this.IndexID, Data:this.AryData };
52165
52279
  tooltip.ChartPaint=this;
52166
52280
  return true;
52167
52281
  }
@@ -87118,6 +87232,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87118
87232
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
87119
87233
  frame.GlobalOption=this.GlobalOption;
87120
87234
  frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
87235
+ frame.CreateLockPaint();
87121
87236
 
87122
87237
  frame.HorizontalMax=20;
87123
87238
  frame.HorizontalMin=10;
@@ -87219,6 +87334,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87219
87334
  frame.XSplitOperator.Symbol=this.Symbol;
87220
87335
  frame.XSplitOperator.Period=this.Period;
87221
87336
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
87337
+ frame.CreateLockPaint();
87222
87338
 
87223
87339
  //K线数据绑定
87224
87340
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
@@ -89678,7 +89794,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89678
89794
 
89679
89795
 
89680
89796
  subFrame.YSpecificMaxMin=null; //清空指定最大最小值
89681
- subFrame.IsLocked=false; //解除上锁
89682
89797
  subFrame.YSplitScale = null; //清空固定刻度
89683
89798
  subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
89684
89799
 
@@ -89976,7 +90091,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89976
90091
 
89977
90092
 
89978
90093
  this.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=null; //清空指定最大最小值
89979
- this.Frame.SubFrame[windowIndex].Frame.IsLocked=false; //解除上锁
89980
90094
  this.Frame.SubFrame[windowIndex].Frame.YSplitScale = null; //清空固定刻度
89981
90095
 
89982
90096
  this.ChartPaint=paint;
@@ -90034,7 +90148,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90034
90148
  }
90035
90149
  else if (obj.Script) //动态执行脚本
90036
90150
  {
90037
- indexInfo={ Script:obj.Script, ID:obj.indexName, Name:obj.indexName};
90151
+ indexInfo={ Script:obj.Script, ID:obj.IndexName, Name:obj.IndexName};
90038
90152
  if (obj.Name) indexInfo.Name=obj.Name;
90039
90153
  }
90040
90154
  else
@@ -90369,7 +90483,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90369
90483
  this.DeleteIndexPaint(i);
90370
90484
  var frame=this.Frame.SubFrame[i];
90371
90485
  frame.YSpecificMaxMin=null;
90372
- frame.IsLocked=false;
90373
90486
  frame.YSplitScale = null;
90374
90487
  }
90375
90488
 
@@ -90749,35 +90862,16 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90749
90862
  }
90750
90863
  }
90751
90864
 
90752
- //锁|解锁指标 { Index:指标名字,IsLocked:是否要锁上,Callback:回调 }
90753
- this.LockIndex=function(lockData)
90754
- {
90755
- if (!lockData) return;
90756
- if (!lockData.IndexName) return;
90757
-
90758
- for(let i in this.WindowIndex)
90759
- {
90760
- let item=this.WindowIndex[i];
90761
- if (!item) conintue;
90762
- if (item.Name==lockData.IndexName)
90763
- {
90764
- item.SetLock(lockData);
90765
- this.Update();
90766
- break;
90767
- }
90768
- }
90769
- }
90770
-
90771
90865
  this.TryClickLock=function(x,y)
90772
90866
  {
90773
90867
  for(var i=0;i<this.Frame.SubFrame.length; ++i)
90774
90868
  {
90775
90869
  var item=this.Frame.SubFrame[i];
90776
- if (!item.Frame.IsLocked) continue;
90777
- if (!item.Frame.LockPaint) continue;
90870
+ var chartLock=item.Frame.LockPaint;
90871
+ if (!chartLock || !chartLock.LockRect) continue;
90778
90872
 
90779
90873
  var tooltip=new TooltipData();
90780
- if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
90874
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
90781
90875
 
90782
90876
  tooltip.HQChart=this;
90783
90877
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
@@ -96783,6 +96877,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96783
96877
  frame.XPointCount=243;
96784
96878
  frame.HQChart=this;
96785
96879
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96880
+ frame.CreateLockPaint();
96786
96881
 
96787
96882
  if (i>=2)
96788
96883
  {
@@ -96894,6 +96989,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96894
96989
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96895
96990
  frame.XSplitOperator.Symbol=this.Symbol;
96896
96991
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
96992
+ frame.CreateLockPaint();
96897
96993
 
96898
96994
  if (this.DayCount>1)
96899
96995
  {
@@ -97019,7 +97115,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
97019
97115
  //清空指定最大最小值
97020
97116
 
97021
97117
  subFrame.YSpecificMaxMin=null;
97022
- subFrame.IsLocked=false; //解除上锁
97023
97118
  subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
97024
97119
 
97025
97120
  this.ChartPaint=paint;
@@ -97252,7 +97347,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
97252
97347
  this.DeleteIndexPaint(i);
97253
97348
  var frame=this.Frame.SubFrame[i];
97254
97349
  frame.YSpecificMaxMin=null;
97255
- frame.IsLocked=false;
97256
97350
  frame.YSplitScale = null;
97257
97351
  }
97258
97352
 
@@ -99499,9 +99593,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
99499
99593
  {
99500
99594
  overlayFrame=new OverlayIndexItem();
99501
99595
  overlayFrame.Identify='Position_Line_Frame';
99502
-
99503
- if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99504
- else frame=new OverlayMinuteHScreenFrame();
99596
+ frame=this.CreateOverlayFrame();
99597
+ //if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99598
+ //else frame=new OverlayMinuteHScreenFrame();
99505
99599
 
99506
99600
  frame.Canvas=this.Canvas;
99507
99601
  frame.MainFrame=subFrame.Frame;
@@ -99684,9 +99778,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
99684
99778
  var subFrame=this.Frame.SubFrame[windowIndex];
99685
99779
  var overlayFrame=new OverlayIndexItem();
99686
99780
  if (obj.Identify) overlayFrame.Identify=obj.Identify; //由外部指定id
99687
- var frame=null;
99688
- if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99689
- else frame=new OverlayMinuteHScreenFrame();
99781
+ var frame=this.CreateOverlayFrame();
99782
+ //if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99783
+ //else frame=new OverlayMinuteHScreenFrame();
99690
99784
  frame.Canvas=this.Canvas;
99691
99785
  frame.MainFrame=subFrame.Frame;
99692
99786
  frame.ChartBorder=subFrame.Frame.ChartBorder;
@@ -100606,13 +100700,22 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100606
100700
  for(var i=0;i<this.Frame.SubFrame.length; ++i)
100607
100701
  {
100608
100702
  var item=this.Frame.SubFrame[i];
100609
- if (!item.Frame.IsLocked) continue;
100610
- if (!item.Frame.LockPaint) continue;
100703
+ var chartLock=item.Frame.LockPaint;
100704
+ if (!chartLock || !chartLock.LockRect) continue;
100611
100705
 
100612
100706
  var tooltip=new TooltipData();
100613
- if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
100707
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
100614
100708
 
100615
100709
  tooltip.HQChart=this;
100710
+
100711
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
100712
+ if (event && event.Callback)
100713
+ {
100714
+ var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
100715
+ event.Callback(event,sendData,this);
100716
+ }
100717
+
100718
+
100616
100719
  if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
100617
100720
  return true;
100618
100721
  }
@@ -130328,7 +130431,7 @@ function ScriptIndex(name,script,args,option)
130328
130431
  Name:hqChart.Name,
130329
130432
  Data:hisData,
130330
130433
  SourceData:hqChart.SourceData,
130331
- Callback:this.RecvResultData, CallbackParam:param,
130434
+ Callback:(arg1, arg2)=>{ this.RecvResultData(arg1, arg2); }, CallbackParam:param,
130332
130435
  Async:true,
130333
130436
  MaxRequestDataCount:hqChart.MaxRequestDataCount,
130334
130437
  MaxRequestMinuteDayCount:hqChart.MaxRequestMinuteDayCount,
@@ -133017,6 +133120,18 @@ function OverlayScriptIndex(name,script,args,option)
133017
133120
  param.Self.OutVar=outVar;
133018
133121
  param.Self.BindData(hqChart,windowIndex,hisData);
133019
133122
 
133123
+ var frame=this.OverlayIndex.Frame.Frame;
133124
+ if (this.IsLocked==false) //不上锁
133125
+ {
133126
+ frame.SetLock(null);
133127
+ }
133128
+ else //上锁
133129
+ {
133130
+ let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID, IndexID:this.ID,
133131
+ BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
133132
+ frame.SetLock(lockData);
133133
+ }
133134
+
133020
133135
  param.HQChart.UpdataDataoffset(); //更新数据偏移
133021
133136
  param.HQChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
133022
133137
 
@@ -134877,20 +134992,20 @@ function APIScriptIndex(name,script,args,option, isOverlay)
134877
134992
  }
134878
134993
  this.BindData(hqChart,windowIndex,hisData);
134879
134994
 
134880
- if (!this.IsOverlayIndex)
134995
+ var frame=hqChart.Frame.SubFrame[windowIndex].Frame;
134996
+ if (this.IsOverlayIndex) frame=this.OverlayIndex.Frame.Frame;
134997
+
134998
+ if (this.IsLocked==false) //不上锁
134881
134999
  {
134882
- if (this.IsLocked==false) //不上锁
134883
- {
134884
- hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(null);
134885
- }
134886
- else //上锁
134887
- {
134888
- let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,
134889
- BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
134890
- hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(lockData);
134891
- }
135000
+ frame.SetLock(null);
134892
135001
  }
134893
-
135002
+ else //上锁
135003
+ {
135004
+ let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,IndexID:this.ID,
135005
+ BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
135006
+ frame.SetLock(lockData);
135007
+ }
135008
+
134894
135009
  hqChart.UpdataDataoffset(); //更新数据偏移
134895
135010
  hqChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
134896
135011
 
@@ -164218,7 +164333,7 @@ function JSDialogSearchIndex()
164218
164333
 
164219
164334
  this.MaxRowCount=30; //行
164220
164335
  this.ColCount=3; //列
164221
- this.MaxGroupCount=10; //分类最多个数
164336
+ this.MaxGroupCount=20; //分类最多个数
164222
164337
 
164223
164338
  this.AryData=[];
164224
164339
  this.AryGroup=[]; //分类
@@ -164499,12 +164614,14 @@ function JSDialogSearchIndex()
164499
164614
  else if (indexItem.Type==1) //自定义脚本指标
164500
164615
  {
164501
164616
  var indexData={ ID:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
164617
+ if (indexItem.Lock) indexData.Lock=indexItem.Lock;
164502
164618
  this.HQChart.ChangeScriptIndex(this.OpData.WindowIndex, indexData);
164503
164619
  }
164504
164620
  else if (indexItem.Type==2) //api指标
164505
164621
  {
164506
- var indedData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
164507
- this.HQChart.ChangeAPIIndex(this.OpData.WindowIndex, indedData);
164622
+ var indexData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
164623
+ if (indexItem.Lock) indexData.Lock=indexItem.Lock;
164624
+ this.HQChart.ChangeAPIIndex(this.OpData.WindowIndex, indexData);
164508
164625
  }
164509
164626
  else if (indexItem.Type==3) //指标模板
164510
164627
  {
@@ -164524,11 +164641,13 @@ function JSDialogSearchIndex()
164524
164641
  else if (indexItem.Type==1) //自定义脚本指标
164525
164642
  {
164526
164643
  var obj={ WindowIndex:this.OpData.WindowIndex, IndexName:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
164644
+ if (indexItem.Lock) obj.Lock=indexItem.Lock;
164527
164645
  this.HQChart.AddOverlayIndex(obj);
164528
164646
  }
164529
164647
  else if (indexItem.Type==2) //api指标
164530
164648
  {
164531
164649
  var obj={ WindowIndex:this.OpData.WindowIndex, API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
164650
+ if (indexItem.Lock) obj.Lock=indexItem.Lock;
164532
164651
  this.HQChart.AddOverlayIndex(obj);
164533
164652
  }
164534
164653
  else if (indexItem.Type==3) //指标模板
@@ -164555,6 +164674,7 @@ function JSDialogSearchIndex()
164555
164674
  else if (indexItem.Type==2) //api指标
164556
164675
  {
164557
164676
  var indexData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
164677
+ if (indexItem.Lock) indexData.Lock=indexItem.Lock;
164558
164678
  this.HQChart.AddAPIIndexWindow(indexData, this.OpData);
164559
164679
  }
164560
164680
  else if (indexItem.Type==3) //指标模板
@@ -164978,8 +165098,25 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
164978
165098
  Group:{ ID:"自定义", Name:"自定义"} ,
164979
165099
  AryIndex:
164980
165100
  [
164981
- { Name:"收盘线(后台指标)", ID:"CLOSE_LINE", Type:2, Args:null },
164982
- { Name:"高低均价(自定义脚本)", ID:"HIGH_LOW_AV", Type:1, Args:null , Script:"均价:(H+L)/2;高:H;低:L;", Args:[ { Name:'N', Value:20}, { Name:'M', Value:6}]},
165101
+ { Name:"收盘线(后台指标)", ID:"API-DRAWTEXTREL", Type:2, Args:null },
165102
+ { Name:"高低均价(自定义脚本)", ID:"HIGH_LOW_AV", Type:1, Script:"均价:(H+L)/2;高:H;低:L;", Args:[ { Name:'N', Value:20}, { Name:'M', Value:6}]},
165103
+ {
165104
+ Name:"波段量能跟庄-波段量能", ID:"TEST_INDEX_4AE0_1", Type:1, Args:null,
165105
+ Script:TEST_INDEX_4AE0_1,
165106
+ Lock:{ IsLocked:true }
165107
+ }
165108
+ ]
165109
+ },
165110
+ {
165111
+ Group:{ ID:"付费指标", Name:"付费指标"} ,
165112
+ AryIndex:
165113
+ [
165114
+ { Name:"面积图(后台指标)", ID:"API-DRAWBAND", Type:2, Args:null, Lock:{ IsLocked:true } },
165115
+ {
165116
+ Name:"波段量能跟庄-波段量能", ID:"TEST_INDEX_4AE0_1", Type:1, Args:null,
165117
+ Script:TEST_INDEX_4AE0_1,
165118
+ Lock:{ IsLocked:true }
165119
+ }
164983
165120
  ]
164984
165121
  },
164985
165122
  {
@@ -165479,6 +165616,25 @@ function JSDialogModifyIndexParam()
165479
165616
  }
165480
165617
 
165481
165618
 
165619
+ /////////////////////////////////////////////////////////////////////////////////////////////
165620
+ //测试指标
165621
+
165622
+ var TEST_INDEX_4AE0_1=`能量:=SQRT(VOL)*(((C-(H+L)/2))/((H+L)/2));
165623
+ 平滑能量:=EMA(能量,16);
165624
+ 能量惯性:EMA(平滑能量,16);
165625
+ DRAWICON(能量惯性>0 AND REF(能量惯性,1)<0,0,1);
165626
+ STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.05),(能量惯性-能量惯性*0.15),3,0), COLOR0000CC;
165627
+ STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.2),(能量惯性-能量惯性*0.35),3,0), COLOR0066FF;
165628
+ STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.4),(能量惯性-能量惯性*0.55),3,0),COLOR0099FF;
165629
+ STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.6),(能量惯性-能量惯性*0.75),3,0), COLOR00CCFF;
165630
+ STICKLINE(能量惯性>=0,(能量惯性-能量惯性*0.8),(能量惯性-能量惯性*0.95),3,0), COLOR00FFFF;
165631
+ STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.05),(能量惯性-能量惯性*0.15),3,0), COLORFF3300;
165632
+ STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.2),(能量惯性-能量惯性*0.35),3,0), COLORFF6600;
165633
+ STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.4),(能量惯性-能量惯性*0.55),3,0), COLORFF9900;
165634
+ STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.6),(能量惯性-能量惯性*0.75),3,0), COLORFFCC00;
165635
+ STICKLINE(能量惯性<0,(能量惯性-能量惯性*0.8),(能量惯性-能量惯性*0.95),3,0), COLORFFFF00;`
165636
+
165637
+
165482
165638
 
165483
165639
 
165484
165640
  ///////////////////////////////////////////////////////////////////////////////////
@@ -165602,7 +165758,7 @@ function HQChartScriptWorker()
165602
165758
 
165603
165759
 
165604
165760
 
165605
- var HQCHART_VERSION="1.1.15105";
165761
+ var HQCHART_VERSION="1.1.15110";
165606
165762
 
165607
165763
  function PrintHQChartVersion()
165608
165764
  {