hqchart 1.1.15104 → 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
 
@@ -6758,12 +6758,6 @@ JSChart.RegisterScriptIndexChart=function(name, option)
6758
6758
  return g_ScriptIndexChartFactory.Add(name, option);
6759
6759
  }
6760
6760
 
6761
- //注册设置对话框类
6762
- //option:{ Create:创建类方法 }
6763
- JSChart.RegisterDialogClass=function(name, option)
6764
- {
6765
- return g_DialogFactory.Add(name, option);
6766
- }
6767
6761
 
6768
6762
  //注册框架类
6769
6763
  JSChart.RegisterChartFrameClass=function(name, option)
@@ -16654,6 +16648,55 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
16654
16648
  if (!this.PressKeyboardConfig) return false;
16655
16649
  if (!this.PressKeyboardConfig.PauseUpdate) return false;
16656
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);
16657
16700
  return true;
16658
16701
  }
16659
16702
  }
@@ -17303,8 +17346,8 @@ function IChartFramePainting()
17303
17346
  this.XSplitOperator; //X轴分割
17304
17347
  this.Data; //主数据
17305
17348
 
17306
- this.IsLocked=false; //是否上锁
17307
- this.LockPaint = null;
17349
+ this.LockPaint = null; //锁图形
17350
+ this.IndexLock=new IndexLockData(); //指标锁
17308
17351
 
17309
17352
  this.YSpecificMaxMin=null; //指定Y轴最大最小值
17310
17353
  this.IsShowBorder = true; //是否显示边框
@@ -17576,15 +17619,8 @@ function IChartFramePainting()
17576
17619
 
17577
17620
  this.DrawLock=function()
17578
17621
  {
17579
- if (this.IsLocked)
17580
- {
17581
- if (this.LockPaint == null)
17582
- this.LockPaint = g_ChartPaintFactory.Create("ChartLock");//new ChartLock();
17583
- this.LockPaint.Canvas=this.Canvas;
17584
- this.LockPaint.ChartBorder=this.ChartBorder;
17585
- this.LockPaint.ChartFrame=this;
17586
- this.LockPaint.Draw(true);
17587
- }
17622
+ if (!this.LockPaint) return;
17623
+ this.LockPaint.Draw(true);
17588
17624
  }
17589
17625
 
17590
17626
  this.DrawLogo=function()
@@ -17640,46 +17676,28 @@ function IChartFramePainting()
17640
17676
  }
17641
17677
  }
17642
17678
 
17643
- this.CalculateLock=function()
17679
+ this.CalculateLock=function(aryData)
17644
17680
  {
17645
- if (this.IsLocked)
17646
- {
17647
- if (this.LockPaint == null)
17648
- this.LockPaint = g_ChartPaintFactory.Create("ChartLock"); // new ChartLock();
17649
- this.LockPaint.Canvas=this.Canvas;
17650
- this.LockPaint.ChartBorder=this.ChartBorder;
17651
- this.LockPaint.ChartFrame=this;
17652
- this.LockPaint.Draw(false);
17653
- }
17681
+ this.LockPaint.SetData(aryData);
17682
+ this.LockPaint.Draw(false);
17654
17683
  }
17655
17684
 
17656
- //设施上锁
17657
- this.SetLock=function(lockData)
17685
+ //创建锁图形
17686
+ this.CreateLockPaint=function()
17658
17687
  {
17659
- if (!lockData) //空数据不上锁
17660
- {
17661
- this.IsLocked=false;
17662
- return;
17663
- }
17664
-
17665
- this.IsLocked=true;
17666
- 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
+ }
17667
17693
 
17668
- if (lockData.Callback) this.LockPaint.Callback=lockData.Callback; //回调
17669
- if (lockData.IndexName) this.LockPaint.IndexName=lockData.IndexName; //指标名字
17670
- if (lockData.IndexID) this.LockPaint.IndexID=lockData.IndexID; //指标ID
17671
- if (lockData.ID) this.LockPaint.LockID=lockData.ID; //锁ID
17672
- if (lockData.BG) this.LockPaint.BGColor=lockData.BG; //背景色
17673
- if (lockData.Text) this.LockPaint.Title= lockData.Text;
17674
- if (lockData.TextColor) this.LockPaint.TextColor=lockData.TextColor;
17675
- if (lockData.Font) this.LockPaint.Font=lockData.Font;
17676
- if (lockData.Count) this.LockPaint.LockCount=lockData.Count;
17677
- if (lockData.MinWidth>0) this.LockPaint.MinWidth=lockData.MinWidth;
17694
+ this.SetLock=function(lockData)
17695
+ {
17696
+ this.IndexLock.SetData(lockData);
17678
17697
  }
17679
17698
 
17680
17699
  this.GetLockRect=function()
17681
17700
  {
17682
- if (!this.IsLocked) return null;
17683
17701
  if (!this.LockPaint) return null;
17684
17702
  return this.LockPaint.LockRect;
17685
17703
  }
@@ -22716,6 +22734,13 @@ function OverlayMinuteFrame()
22716
22734
  this.IsShareY=false; //使用和主框架公用Y轴
22717
22735
  this.IsCalculateYMaxMin=true; //是否计算Y最大最小值
22718
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
+ }
22719
22744
 
22720
22745
  this.Draw=function()
22721
22746
  {
@@ -22774,6 +22799,13 @@ function OverlayMinuteHScreenFrame()
22774
22799
 
22775
22800
  this.ClassName="OverlayMinuteHScreenFrame";
22776
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
+ }
22777
22809
 
22778
22810
  this.Draw=function()
22779
22811
  {
@@ -24161,6 +24193,12 @@ function OverlayKLineFrame()
24161
24193
  }
24162
24194
  }
24163
24195
 
24196
+ this.GetLockRect=function()
24197
+ {
24198
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
24199
+ return this.MainFrame.GetLockRect();
24200
+ }
24201
+
24164
24202
  this.Draw=function()
24165
24203
  {
24166
24204
  this.Buttons=[];
@@ -25473,6 +25511,12 @@ function OverlayKLineHScreenFrame()
25473
25511
  this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;
25474
25512
  this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;
25475
25513
 
25514
+ this.GetLockRect=function()
25515
+ {
25516
+ if (!this.MainFrame || !this.MainFrame.GetLockRect) return null;
25517
+ return this.MainFrame.GetLockRect();
25518
+ }
25519
+
25476
25520
  this.Draw=function()
25477
25521
  {
25478
25522
  this.SplitXYCoordinate();
@@ -26679,7 +26723,7 @@ function HQTradeFrame()
26679
26723
 
26680
26724
  this.DrawLock=function()
26681
26725
  {
26682
- for (var i in this.SubFrame)
26726
+ for (var i=0; i<this.SubFrame.length; ++i)
26683
26727
  {
26684
26728
  var item = this.SubFrame[i];
26685
26729
  item.Frame.DrawLock();
@@ -26701,10 +26745,21 @@ function HQTradeFrame()
26701
26745
 
26702
26746
  this.CalculateLock=function()
26703
26747
  {
26704
- for (var i in this.SubFrame)
26748
+ for (var i=0, j=0; i<this.SubFrame.length; ++i)
26705
26749
  {
26706
26750
  var item = this.SubFrame[i];
26707
- 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);
26708
26763
  }
26709
26764
  }
26710
26765
 
@@ -42851,6 +42906,13 @@ function ChartStickLine()
42851
42906
  xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
42852
42907
  }
42853
42908
 
42909
+ var lockRect=this.GetLockRect();
42910
+ if (lockRect)
42911
+ {
42912
+ if (this.IsHScreen) chartright=lockRect.Top;
42913
+ else chartright=lockRect.Left;
42914
+ }
42915
+
42854
42916
  var isMinute=this.IsMinuteFrame();
42855
42917
 
42856
42918
  if (isMinute)
@@ -51926,6 +51988,39 @@ function ChartDrawFlagText()
51926
51988
  }
51927
51989
  }
51928
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
+
51929
52024
  //锁 支持横屏
51930
52025
  function ChartLock()
51931
52026
  {
@@ -51934,34 +52029,79 @@ function ChartLock()
51934
52029
  delete this.newMethod;
51935
52030
 
51936
52031
  this.ClassName="ChartLock";
52032
+ this.AryData=null;
52033
+ this.LockRect=null; //上锁区域
52034
+
51937
52035
  this.LockCount = 20; // 锁最新的几个数据
51938
52036
  this.BGColor = g_JSChartResource.IndexLock.BGColor;
51939
52037
  this.TextColor = g_JSChartResource.IndexLock.TextColor;
51940
52038
  this.Font = g_JSChartResource.IndexLock.Font;
51941
52039
  this.Title = g_JSChartResource.IndexLock.Title;
51942
- this.LockRect=null; //上锁区域
52040
+
51943
52041
  this.LockID; //锁ID
51944
52042
  this.Callback; //回调
51945
52043
  this.IndexName; //指标名字
51946
52044
  this.IndexID; //指标ID
51947
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
+ }
51948
52065
 
51949
52066
  this.CalculateTextSize=function(aryText, defaultFont, out)
51950
52067
  {
51951
52068
  if (!out || !IFrameSplitOperator.IsNonEmptyArray(aryText)) return false;
51952
52069
 
51953
52070
  this.Canvas.font=defaultFont;
51954
- var lineHeight=this.Canvas.measureText("擎").width; //行高
52071
+ var defaultLineHeight=this.Canvas.measureText("擎").width; //行高
52072
+ var lineHeight=defaultLineHeight;
51955
52073
  var height=0, width=0;
51956
52074
  out.AryText=[];
51957
52075
  for(var i=0;i<aryText.length;++i)
51958
52076
  {
51959
52077
  var item=aryText[i];
51960
- if (!item || !item.Text) continue;
51961
- var textWidth=this.Canvas.measureText(item.Text).width;
52078
+ if (!item || (!item.Text && !item.Image)) continue;
52079
+ if (item.Image)
52080
+ {
52081
+ textWidth=item.Image.Width;
52082
+ lineHeight=item.Image.Height;
52083
+ }
52084
+ else
52085
+ {
52086
+ if (item.Font)
52087
+ {
52088
+ this.Canvas.font=item.Font;
52089
+ lineHeight=this.Canvas.measureText("擎").width;
52090
+ }
52091
+ else
52092
+ {
52093
+ this.Canvas.font=defaultFont;
52094
+ lineHeight=defaultLineHeight;
52095
+ }
52096
+
52097
+ var textWidth=this.Canvas.measureText(item.Text).width;
52098
+ }
51962
52099
 
51963
52100
  var lineItem={ Text:item.Text, Width:textWidth, Height:lineHeight, Color:item.Color, TextMargin:{ Top:0, Bottom:0, Left:0, Right:0 }, YOffset:0 };
51964
52101
  if (IFrameSplitOperator.IsNumber(item.YOffset)) lineItem.YOffset=item.YOffset;
52102
+ if (item.Font) lineItem.Font=item.Font;
52103
+ if (IFrameSplitOperator.IsNumber(item.Align)) lineItem.Align=item.Align; //左右对齐 0=左 1=中 2=右
52104
+ if (item.Image) lineItem.Image=item.Image;
51965
52105
  if (item.TextMargin)
51966
52106
  {
51967
52107
  var margin=item.TextMargin;
@@ -51989,12 +52129,7 @@ function ChartLock()
51989
52129
  this.Draw=function(bDraw)
51990
52130
  {
51991
52131
  this.LockRect=null;
51992
- if (!bDraw) return;
51993
- if (this.NotSupportMessage)
51994
- {
51995
- this.DrawNotSupportmessage();
51996
- return;
51997
- }
52132
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryData)) return;
51998
52133
 
51999
52134
  var bHScreen=this.ChartFrame.IsHScreen;
52000
52135
  var bMinute=this.IsMinuteFrame();
@@ -52040,24 +52175,33 @@ function ChartLock()
52040
52175
  var rtBG={ Left:border.Left, Right:border.RightEx, Top:left, Bottom:border.Bottom };
52041
52176
  rtBG.Width=rtBG.Right-rtBG.Left;
52042
52177
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52043
-
52044
- var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Right, rtBG.Top);
52045
- this.Canvas.fillStyle =bgColor;
52046
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52047
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
+ }
52048
52186
  }
52049
52187
  else
52050
52188
  {
52051
52189
  var rtBG={ Left:left, Right:border.RightEx, Top:border.TopTitle, Bottom:border.Bottom };
52052
52190
  rtBG.Width=rtBG.Right-rtBG.Left;
52053
52191
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52054
- //上下渐变
52055
- var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
52056
- this.Canvas.fillStyle =bgColor;
52057
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
52058
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
+ }
52059
52201
  }
52060
52202
 
52203
+ if (!bDraw) return;
52204
+
52061
52205
  var aryText=null;
52062
52206
  if (Array.isArray(this.Title)) aryText=this.Title;
52063
52207
  else aryText=[{Text:this.Title}];
@@ -52074,40 +52218,54 @@ function ChartLock()
52074
52218
  var top=rtBG.Top+(rtBG.Height-outSize.Width)/2;
52075
52219
  if (outSize.Width>rtBG.Height) top=rtBG.Bottom-outSize.Width;
52076
52220
  var left=rtBG.Left+(rtBG.Width-outSize.Height)/2;
52077
-
52078
52221
  this.Canvas.save();
52079
52222
  this.Canvas.translate(left, top);
52080
52223
  this.Canvas.rotate(90 * Math.PI / 180);
52081
- var yText=0,xText=0;
52082
- for(var i=0;i<outSize.AryText.length;++i)
52083
- {
52084
- var item=outSize.AryText[i];
52085
- if (item.Color) this.Canvas.fillStyle=item.Color;
52086
- else this.Canvas.fillStyle=this.TextColor;
52087
-
52088
- yText+=item.Height;
52089
- this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52090
- }
52091
-
52092
- this.Canvas.restore();
52224
+ var left=0,top=0;
52093
52225
  }
52094
52226
  else
52095
52227
  {
52096
52228
  var left=rtBG.Left+(rtBG.Width-outSize.Width)/2;
52097
52229
  if (outSize.Width>rtBG.Width) left=rtBG.Right-outSize.Width;
52098
52230
  var top=rtBG.Top+(rtBG.Height-outSize.Height)/2;
52099
-
52100
- var yText=top, xText=left;
52101
- 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)
52239
+ {
52240
+ if (item.Align===1)
52241
+ {
52242
+ if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52243
+ }
52244
+
52245
+ this.Canvas.drawImage(item.Image.Data, xText, yText, item.Image.Width, item.Image.Height);
52246
+
52247
+ yText+=item.Height;
52248
+ }
52249
+ else
52102
52250
  {
52103
- var item=outSize.AryText[i];
52104
52251
  if (item.Color) this.Canvas.fillStyle=item.Color;
52105
52252
  else this.Canvas.fillStyle=this.TextColor;
52106
52253
 
52254
+ if (item.Font) this.Canvas.font = item.Font;
52255
+ else this.Canvas.font = this.Font;
52256
+
52107
52257
  yText+=item.Height;
52258
+
52259
+ if (item.Align===1)
52260
+ {
52261
+ if (outSize.Width>item.Width) xText+=(outSize.Width-item.Width)/2;
52262
+ }
52263
+
52108
52264
  this.Canvas.fillText(item.Text, xText, yText+item.YOffset);
52109
- }
52265
+ }
52110
52266
  }
52267
+
52268
+ if (bHScreen) this.Canvas.restore();
52111
52269
  }
52112
52270
 
52113
52271
  //x,y是否在上锁区域
@@ -52117,7 +52275,7 @@ function ChartLock()
52117
52275
 
52118
52276
  if (Path2DHelper.PtInRect(x,y,this.LockRect))
52119
52277
  {
52120
- 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 };
52121
52279
  tooltip.ChartPaint=this;
52122
52280
  return true;
52123
52281
  }
@@ -87074,6 +87232,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87074
87232
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
87075
87233
  frame.GlobalOption=this.GlobalOption;
87076
87234
  frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
87235
+ frame.CreateLockPaint();
87077
87236
 
87078
87237
  frame.HorizontalMax=20;
87079
87238
  frame.HorizontalMin=10;
@@ -87175,6 +87334,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87175
87334
  frame.XSplitOperator.Symbol=this.Symbol;
87176
87335
  frame.XSplitOperator.Period=this.Period;
87177
87336
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
87337
+ frame.CreateLockPaint();
87178
87338
 
87179
87339
  //K线数据绑定
87180
87340
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
@@ -89634,7 +89794,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89634
89794
 
89635
89795
 
89636
89796
  subFrame.YSpecificMaxMin=null; //清空指定最大最小值
89637
- subFrame.IsLocked=false; //解除上锁
89638
89797
  subFrame.YSplitScale = null; //清空固定刻度
89639
89798
  subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
89640
89799
 
@@ -89932,7 +90091,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89932
90091
 
89933
90092
 
89934
90093
  this.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=null; //清空指定最大最小值
89935
- this.Frame.SubFrame[windowIndex].Frame.IsLocked=false; //解除上锁
89936
90094
  this.Frame.SubFrame[windowIndex].Frame.YSplitScale = null; //清空固定刻度
89937
90095
 
89938
90096
  this.ChartPaint=paint;
@@ -89990,7 +90148,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89990
90148
  }
89991
90149
  else if (obj.Script) //动态执行脚本
89992
90150
  {
89993
- indexInfo={ Script:obj.Script, ID:obj.indexName, Name:obj.indexName};
90151
+ indexInfo={ Script:obj.Script, ID:obj.IndexName, Name:obj.IndexName};
89994
90152
  if (obj.Name) indexInfo.Name=obj.Name;
89995
90153
  }
89996
90154
  else
@@ -90325,7 +90483,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90325
90483
  this.DeleteIndexPaint(i);
90326
90484
  var frame=this.Frame.SubFrame[i];
90327
90485
  frame.YSpecificMaxMin=null;
90328
- frame.IsLocked=false;
90329
90486
  frame.YSplitScale = null;
90330
90487
  }
90331
90488
 
@@ -90705,35 +90862,16 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90705
90862
  }
90706
90863
  }
90707
90864
 
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
90865
  this.TryClickLock=function(x,y)
90728
90866
  {
90729
90867
  for(var i=0;i<this.Frame.SubFrame.length; ++i)
90730
90868
  {
90731
90869
  var item=this.Frame.SubFrame[i];
90732
- if (!item.Frame.IsLocked) continue;
90733
- if (!item.Frame.LockPaint) continue;
90870
+ var chartLock=item.Frame.LockPaint;
90871
+ if (!chartLock || !chartLock.LockRect) continue;
90734
90872
 
90735
90873
  var tooltip=new TooltipData();
90736
- if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
90874
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
90737
90875
 
90738
90876
  tooltip.HQChart=this;
90739
90877
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
@@ -96739,6 +96877,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96739
96877
  frame.XPointCount=243;
96740
96878
  frame.HQChart=this;
96741
96879
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96880
+ frame.CreateLockPaint();
96742
96881
 
96743
96882
  if (i>=2)
96744
96883
  {
@@ -96850,6 +96989,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96850
96989
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
96851
96990
  frame.XSplitOperator.Symbol=this.Symbol;
96852
96991
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
96992
+ frame.CreateLockPaint();
96853
96993
 
96854
96994
  if (this.DayCount>1)
96855
96995
  {
@@ -96975,7 +97115,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
96975
97115
  //清空指定最大最小值
96976
97116
 
96977
97117
  subFrame.YSpecificMaxMin=null;
96978
- subFrame.IsLocked=false; //解除上锁
96979
97118
  subFrame.YSplitOperator.SplitType=subFrame.YSplitOperator.DefaultSplitType; //还原Y坐标分割模式
96980
97119
 
96981
97120
  this.ChartPaint=paint;
@@ -97208,7 +97347,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
97208
97347
  this.DeleteIndexPaint(i);
97209
97348
  var frame=this.Frame.SubFrame[i];
97210
97349
  frame.YSpecificMaxMin=null;
97211
- frame.IsLocked=false;
97212
97350
  frame.YSplitScale = null;
97213
97351
  }
97214
97352
 
@@ -99455,9 +99593,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
99455
99593
  {
99456
99594
  overlayFrame=new OverlayIndexItem();
99457
99595
  overlayFrame.Identify='Position_Line_Frame';
99458
-
99459
- if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99460
- else frame=new OverlayMinuteHScreenFrame();
99596
+ frame=this.CreateOverlayFrame();
99597
+ //if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99598
+ //else frame=new OverlayMinuteHScreenFrame();
99461
99599
 
99462
99600
  frame.Canvas=this.Canvas;
99463
99601
  frame.MainFrame=subFrame.Frame;
@@ -99640,9 +99778,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
99640
99778
  var subFrame=this.Frame.SubFrame[windowIndex];
99641
99779
  var overlayFrame=new OverlayIndexItem();
99642
99780
  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();
99781
+ var frame=this.CreateOverlayFrame();
99782
+ //if (this.ClassName=="MinuteChartContainer") frame=new OverlayMinuteFrame();
99783
+ //else frame=new OverlayMinuteHScreenFrame();
99646
99784
  frame.Canvas=this.Canvas;
99647
99785
  frame.MainFrame=subFrame.Frame;
99648
99786
  frame.ChartBorder=subFrame.Frame.ChartBorder;
@@ -100562,13 +100700,22 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100562
100700
  for(var i=0;i<this.Frame.SubFrame.length; ++i)
100563
100701
  {
100564
100702
  var item=this.Frame.SubFrame[i];
100565
- if (!item.Frame.IsLocked) continue;
100566
- if (!item.Frame.LockPaint) continue;
100703
+ var chartLock=item.Frame.LockPaint;
100704
+ if (!chartLock || !chartLock.LockRect) continue;
100567
100705
 
100568
100706
  var tooltip=new TooltipData();
100569
- if (!item.Frame.LockPaint.GetTooltipData(x,y,tooltip)) continue;
100707
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
100570
100708
 
100571
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
+
100572
100719
  if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
100573
100720
  return true;
100574
100721
  }
@@ -105103,239 +105250,9 @@ function IsFundSymbol(symbol)
105103
105250
  return false;
105104
105251
  }
105105
105252
 
105106
- //设置对话框工厂类
105107
- function DialogFactory()
105108
- {
105109
- //[key:name, { Create:function(divElement) { return new class(divElement); }} ]
105110
- this.DataMap=new Map(
105111
- [
105112
- ["ChartPictureSettingMenu", { Create:function(divElement) { return new ChartPictureSettingMenu(divElement); } }],
105113
- ]);
105114
-
105115
- this.Create=function(name, option)
105116
- {
105117
- if (!this.DataMap.has(name))
105118
- {
105119
- JSConsole.Chart.Warn(`[DialogFactory::Create] can't find class=${name}.`);
105120
- return null;
105121
- }
105122
-
105123
- var item=this.DataMap.get(name);
105124
- return item.Create(option);
105125
- }
105126
-
105127
- this.Add=function(name, option)
105128
- {
105129
- this.DataMap.set(name, { Create:option.Create } );
105130
- }
105131
- }
105132
-
105133
- var g_DialogFactory=new DialogFactory();
105134
-
105135
- //设置窗口基类
105136
- function IDivDialog(divElement)
105137
- {
105138
- this.DivElement=divElement; //父节点
105139
- this.ID=null; //div id
105140
- this.TimeOut=null; //定时器
105141
-
105142
- //隐藏窗口
105143
- this.Hide=function()
105144
- {
105145
- $("#"+this.ID).hide();
105146
- }
105147
-
105148
- //显示窗口
105149
- this.Show=function(left,top,width,height)
105150
- {
105151
- var cssData={display:'block'};
105152
- if (IFrameSplitOperator.IsNumber(left)) cssData.left=left+'px';
105153
- if (IFrameSplitOperator.IsNumber(top)) cssData.top=top+'px';
105154
- if (IFrameSplitOperator.IsNumber(width)) cssData.width=width+'px';
105155
- if (IFrameSplitOperator.IsNumber(height)) cssData.height=height+'px';
105156
-
105157
- $("#"+this.ID).css(cssData);
105158
- }
105159
- }
105160
-
105161
- //等待动画窗口
105162
- function WaitDialog(divElement)
105163
- {
105164
- this.newMethod=IDivDialog; //派生
105165
- this.newMethod(divElement);
105166
- delete this.newMethod;
105167
-
105168
- this.Title='加载中......';
105169
- this.Dialog;
105170
-
105171
- //隐藏窗口
105172
- this.Close=function()
105173
- {
105174
- if (this.Dialog)
105175
- {
105176
- this.DivElement.removeChild(this.Dialog);
105177
- this.Dialog=null;
105178
- }
105179
- }
105180
-
105181
- this.SetTitle=function(title)
105182
- {
105183
- this.Title=title;
105184
- if (!this.Dialog) return;
105185
- //TODO: 更新标题数据
105186
- }
105187
-
105188
- this.Create=function()
105189
- {
105190
- this.ID=Guid();
105191
- var div=document.createElement('div');
105192
- div.className='jchart-wait-box';
105193
- div.id=this.ID;
105194
- div.innerHTML=
105195
- `<div class='parameter jchart-kline-match-box'>
105196
- <div class='parameter-header'>
105197
- <span>${this.Title}</span>
105198
- </div>
105199
- </div>`.trim();
105200
-
105201
- this.DivElement.appendChild(div);
105202
- this.Dialog=div;
105203
- }
105204
-
105205
- //显示
105206
- this.DoModal=function(event)
105207
- {
105208
- this.Title=event.data.Title;
105209
- var chart=event.data.Chart;
105210
- if (this.ID==null) this.Create(); //第1次 需要创建div
105211
-
105212
- //居中显示
105213
- var border=chart.Frame.ChartBorder;
105214
- var scrollPos=GetScrollPosition();
105215
- var left=border.GetWidth()/2;
105216
- var top=border.GetHeight()/2;
105217
-
105218
- this.Show(left,top,200,40); //显示
105219
- }
105220
- }
105221
-
105222
- //画图工具 单个图形设置
105223
- function ChartPictureSettingMenu(divElement)
105224
- {
105225
- this.newMethod=IDivDialog; //派生
105226
- this.newMethod(divElement);
105227
- delete this.newMethod;
105228
-
105229
- this.HQChart;
105230
- this.ChartPicture;
105231
- this.SubToolsDiv;
105232
- this.SettingMenu;
105233
- this.SettingPV;
105234
-
105235
- this.DoModal=function(event)
105236
- {
105237
- var $body;
105238
- if (!this.SubToolsDiv)
105239
- {
105240
- this.ID=Guid();
105241
- var div=document.createElement("div");
105242
- div.className='subTolls';
105243
- div.id=this.ID;
105244
- this.DivElement.appendChild(div);
105245
- //$body = $("."+event.data.HQChart.ClassName).context.body;
105246
- //$body.append(div);
105247
- this.SubToolsDiv=div;
105248
- }
105249
- this.HQChart=event.data.HQChart;
105250
- this.ChartPicture=event.data.ChartPicture;
105251
-
105252
- var pixelTatio = GetDevicePixelRatio();
105253
- var frame=this.HQChart.Frame.SubFrame[0].Frame;
105254
- // var top=frame.ChartBorder.GetTopTitle();
105255
- var top=frame.ChartBorder.Top + 40;
105256
- // var right=frame.ChartBorder.GetRight();
105257
- var right=frame.ChartBorder.Right;
105258
- var left=frame.ChartBorder.GetLeft();
105259
- var className = this.ChartPicture.ClassName; //='ChartDrawPictureText'时加“设置”
105260
- var lineColor=this.ChartPicture.LineColor;
105261
- if (lineColor.indexOf("rgb(")==0 || lineColor.indexOf("RGB(")==0)
105262
- lineColor=IChartDrawPicture.RGBToHex(lineColor.toLowerCase());
105263
- var toolsDiv = "";
105264
- if(className === 'ChartDrawPictureText')
105265
- {
105266
- toolsDiv = '<span class="changes-color" title="改变图形颜色">'+
105267
- '<i class="iconfont icon-bianji"></i>'+
105268
- '<input type="color" name="color" id="color" class="change-color" value="'+ lineColor +'">'+
105269
- '</span>\n' +
105270
- '<span class="subtool-set" title="设置"><i class="iconfont icon-shezhi"></i></span>'+
105271
- '<span class="subtool-del"><i class="iconfont icon-recycle_bin"></i></span>';
105272
- }
105273
- else if (className=="ChartDrawVolProfile")
105274
- {
105275
- toolsDiv='<span class="vp-set" title="设置"><i class="iconfont icon-shezhi"></i></span>'+
105276
- '<span class="subtool-del"><i class="iconfont icon-recycle_bin"></i></span>';
105277
- }
105278
- else
105279
- {
105280
- toolsDiv =
105281
- '<p class="changes-color" title="改变图形颜色"><i class="iconfont icon-bianji"></i>' +
105282
- '<input type="color" name="color" id="color" class="change-color" value="'+ lineColor +'"></p>\n' +
105283
- ' <p class="subtool-del"><i class="iconfont icon-recycle_bin"></i></p>';
105284
- }
105285
-
105286
-
105287
- this.SubToolsDiv.style.right = right/pixelTatio + "px";
105288
- this.SubToolsDiv.style.top = top/pixelTatio + "px";
105289
- this.SubToolsDiv.innerHTML = toolsDiv;
105290
- this.SubToolsDiv.style.position = "absolute";
105291
- this.SubToolsDiv.style.display = "block";
105292
-
105293
- var hqChart = this.HQChart;
105294
- var picture = this.ChartPicture;
105295
- var subToolDiv = this.SubToolsDiv;
105296
- $(".subtool-del").click(function(){
105297
- hqChart.SelectChartDrawPicture=null;
105298
- hqChart.ClearChartDrawPicture(picture);
105299
- // subToolDiv.innerHTML = "";
105300
- $(".subTolls").css("display","none");
105301
- });
105302
- var self = this;
105303
- $(".subtool-set").click(function(){
105304
- $(self.SubToolsDiv).hide();
105305
- //创建div设置窗口
105306
- if (!self.SettingMenu) self.SettingMenu=new ChartPictureTextSettingMenu(frame.ChartBorder.UIElement.parentNode);
105307
-
105308
- self.SettingMenu.ChartPicture=picture;
105309
- self.SettingMenu.HQChart=hqChart;
105310
- self.SettingMenu.Position={Left:right + 80,Top:top + 20};
105311
- self.SettingMenu.DoModal();
105312
- });
105313
- $(".changes-color").click(function () {
105314
- document.getElementById('color').click();
105315
- $(".change-color").change(function () {
105316
- var color = $(".change-color").val();
105317
- picture.LineColor = color;
105318
- picture.PointColor = color;
105319
- if (hqChart.ChartDrawStorage) hqChart.ChartDrawStorage.SaveDrawData(picture); //保存下
105320
- });
105321
- });
105322
-
105323
- //成交量分布图设置
105324
- $(".vp-set").click(function()
105325
- {
105326
- if (!self.SettingPV) self.SettingPV=new ChartPictureVolProfileSettingMenu(frame.ChartBorder.UIElement.parentNode);
105327
- self.SettingPV.ChartPicture=picture;
105328
- self.SettingPV.HQChart=hqChart;
105329
- self.SettingPV.Position={Left:right + 80,Top:top + 20};
105330
- self.SettingPV.DoModal();
105331
- });
105332
-
105333
-
105334
- JSConsole.Chart.Log("[ChartPictureSettingMenu::DoModal]", {Top:top,Left:left, Right:right});
105335
- }
105336
- }
105337
105253
 
105338
105254
 
105255
+ /*
105339
105256
  function ChartPictureVolProfileSettingMenu(divElement)
105340
105257
  {
105341
105258
  this.newMethod=IDivDialog; //派生
@@ -105424,6 +105341,7 @@ function ChartPictureVolProfileSettingMenu(divElement)
105424
105341
  }
105425
105342
  }
105426
105343
  }
105344
+ */
105427
105345
 
105428
105346
 
105429
105347
 
@@ -130513,7 +130431,7 @@ function ScriptIndex(name,script,args,option)
130513
130431
  Name:hqChart.Name,
130514
130432
  Data:hisData,
130515
130433
  SourceData:hqChart.SourceData,
130516
- Callback:this.RecvResultData, CallbackParam:param,
130434
+ Callback:(arg1, arg2)=>{ this.RecvResultData(arg1, arg2); }, CallbackParam:param,
130517
130435
  Async:true,
130518
130436
  MaxRequestDataCount:hqChart.MaxRequestDataCount,
130519
130437
  MaxRequestMinuteDayCount:hqChart.MaxRequestMinuteDayCount,
@@ -133202,6 +133120,18 @@ function OverlayScriptIndex(name,script,args,option)
133202
133120
  param.Self.OutVar=outVar;
133203
133121
  param.Self.BindData(hqChart,windowIndex,hisData);
133204
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
+
133205
133135
  param.HQChart.UpdataDataoffset(); //更新数据偏移
133206
133136
  param.HQChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
133207
133137
 
@@ -135062,20 +134992,20 @@ function APIScriptIndex(name,script,args,option, isOverlay)
135062
134992
  }
135063
134993
  this.BindData(hqChart,windowIndex,hisData);
135064
134994
 
135065
- 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) //不上锁
135066
134999
  {
135067
- if (this.IsLocked==false) //不上锁
135068
- {
135069
- hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(null);
135070
- }
135071
- else //上锁
135072
- {
135073
- let lockData={ IsLocked:true,Callback:this.LockCallback,IndexName:this.Name ,ID:this.LockID,
135074
- BG:this.LockBG,Text:this.LockText,TextColor:this.LockTextColor, Font:this.LockFont, Count:this.LockCount, MinWidth:this.LockMinWidth };
135075
- hqChart.Frame.SubFrame[windowIndex].Frame.SetLock(lockData);
135076
- }
135000
+ frame.SetLock(null);
135077
135001
  }
135078
-
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
+
135079
135009
  hqChart.UpdataDataoffset(); //更新数据偏移
135080
135010
  hqChart.UpdateFrameMaxMin(); //调整坐标最大 最小值
135081
135011
 
@@ -158686,6 +158616,11 @@ function JSDialogModifyDraw()
158686
158616
  this.HQChart.Draw();
158687
158617
  }
158688
158618
 
158619
+ this.AdvancedSetting=function()
158620
+ {
158621
+
158622
+ }
158623
+
158689
158624
  this.GetRandomText=function(text)
158690
158625
  {
158691
158626
  var ARY_TEXT=["下跌形态","反转十字星","低位档五阳线","倒V型反转","双顶","持续整理形态"];
@@ -164398,7 +164333,7 @@ function JSDialogSearchIndex()
164398
164333
 
164399
164334
  this.MaxRowCount=30; //行
164400
164335
  this.ColCount=3; //列
164401
- this.MaxGroupCount=10; //分类最多个数
164336
+ this.MaxGroupCount=20; //分类最多个数
164402
164337
 
164403
164338
  this.AryData=[];
164404
164339
  this.AryGroup=[]; //分类
@@ -164679,12 +164614,14 @@ function JSDialogSearchIndex()
164679
164614
  else if (indexItem.Type==1) //自定义脚本指标
164680
164615
  {
164681
164616
  var indexData={ ID:indexItem.ID, Name:indexItem.Name, Script:indexItem.Script, Args:indexItem.Args };
164617
+ if (indexItem.Lock) indexData.Lock=indexItem.Lock;
164682
164618
  this.HQChart.ChangeScriptIndex(this.OpData.WindowIndex, indexData);
164683
164619
  }
164684
164620
  else if (indexItem.Type==2) //api指标
164685
164621
  {
164686
- var indedData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
164687
- 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);
164688
164625
  }
164689
164626
  else if (indexItem.Type==3) //指标模板
164690
164627
  {
@@ -164704,11 +164641,13 @@ function JSDialogSearchIndex()
164704
164641
  else if (indexItem.Type==1) //自定义脚本指标
164705
164642
  {
164706
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;
164707
164645
  this.HQChart.AddOverlayIndex(obj);
164708
164646
  }
164709
164647
  else if (indexItem.Type==2) //api指标
164710
164648
  {
164711
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;
164712
164651
  this.HQChart.AddOverlayIndex(obj);
164713
164652
  }
164714
164653
  else if (indexItem.Type==3) //指标模板
@@ -164735,6 +164674,7 @@ function JSDialogSearchIndex()
164735
164674
  else if (indexItem.Type==2) //api指标
164736
164675
  {
164737
164676
  var indexData={ API: { ID:indexItem.ID, Name:indexItem.Name, Args:indexItem.Args, Url:'local'} };
164677
+ if (indexItem.Lock) indexData.Lock=indexItem.Lock;
164738
164678
  this.HQChart.AddAPIIndexWindow(indexData, this.OpData);
164739
164679
  }
164740
164680
  else if (indexItem.Type==3) //指标模板
@@ -165158,8 +165098,25 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
165158
165098
  Group:{ ID:"自定义", Name:"自定义"} ,
165159
165099
  AryIndex:
165160
165100
  [
165161
- { Name:"收盘线(后台指标)", ID:"CLOSE_LINE", Type:2, Args:null },
165162
- { 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
+ }
165163
165120
  ]
165164
165121
  },
165165
165122
  {
@@ -165659,6 +165616,25 @@ function JSDialogModifyIndexParam()
165659
165616
  }
165660
165617
 
165661
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
+
165662
165638
 
165663
165639
 
165664
165640
  ///////////////////////////////////////////////////////////////////////////////////
@@ -165782,7 +165758,7 @@ function HQChartScriptWorker()
165782
165758
 
165783
165759
 
165784
165760
 
165785
- var HQCHART_VERSION="1.1.15103";
165761
+ var HQCHART_VERSION="1.1.15110";
165786
165762
 
165787
165763
  function PrintHQChartVersion()
165788
165764
  {