hqchart 1.1.12935 → 1.1.12943

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.
@@ -192,6 +192,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
192
192
  if (IFrameSplitOperator.IsBool(attribute.IsShortTitle)) indexInfo.IsShortTitle=attribute.IsShortTitle;
193
193
  if (attribute.TitleFont) indexInfo.TitleFont=attribute.TitleFont;
194
194
  if (attribute.Lock) indexInfo.Lock=attribute.Lock;
195
+ if (IFrameSplitOperator.IsNumber(attribute.YSplitType)) indexInfo.YSplitType=attribute.YSplitType;
195
196
 
196
197
  if (attribute.YAxis)
197
198
  {
@@ -4745,7 +4746,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4745
4746
  }
4746
4747
 
4747
4748
  //创建子窗口的指标
4748
- let scriptData = new JSIndexScript();
4749
+ var scriptData = new JSIndexScript();
4749
4750
 
4750
4751
  if (option.ColorIndex) //五彩K线
4751
4752
  {
@@ -4800,6 +4801,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4800
4801
  }
4801
4802
  else
4802
4803
  {
4804
+ var scriptData = new JSIndexScript();
4803
4805
  let indexInfo = scriptData.Get(item.Index);
4804
4806
  if (!indexInfo) continue;
4805
4807
  JSIndexScript.ModifyAttribute(indexInfo, item);
@@ -5641,7 +5643,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5641
5643
  if (IFrameSplitOperator.IsNonEmptyArray(option.Windows))
5642
5644
  {
5643
5645
  //创建子窗口的指标
5644
- let scriptData = new JSIndexScript();
5646
+
5645
5647
  for(var i=0;i<option.Windows.length;++i)
5646
5648
  {
5647
5649
  var item=option.Windows[i];
@@ -5659,6 +5661,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5659
5661
  }
5660
5662
  else
5661
5663
  {
5664
+ var scriptData = new JSIndexScript();
5662
5665
  let indexInfo = scriptData.Get(item.Index);
5663
5666
  if (!indexInfo) continue;
5664
5667
 
@@ -12445,6 +12448,45 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12445
12448
  return paint.ClearPoint();
12446
12449
  }
12447
12450
 
12451
+ //删除指定窗口的所有叠加指标
12452
+ this.DeleteWindowsOverlayIndex=function(windowIndex)
12453
+ {
12454
+ if (!IFrameSplitOperator.IsNumber(windowIndex)) return;
12455
+ if (windowIndex<0 || windowIndex>=this.Frame.SubFrame.length) return;
12456
+
12457
+ var subFrame=this.Frame.SubFrame[windowIndex];
12458
+ if (!IFrameSplitOperator.IsNonEmptyArray(subFrame.OverlayIndex)) return;
12459
+
12460
+ var aryIndexID=[];
12461
+ for(var i=0; i<subFrame.OverlayIndex.length; ++i)
12462
+ {
12463
+ var overlayItem=subFrame.OverlayIndex[i];
12464
+ aryIndexID.push(overlayItem.Identify);
12465
+
12466
+ for(var j=0;j<overlayItem.ChartPaint.length;++j) //图形销毁事件
12467
+ {
12468
+ var overlayChart=overlayItem.ChartPaint[j];
12469
+ if (overlayChart && overlayChart.OnDestroy) overlayChart.OnDestroy();
12470
+ }
12471
+
12472
+ overlayItem.ChartPaint=[];
12473
+ }
12474
+
12475
+ subFrame.OverlayIndex=[];
12476
+
12477
+ var titlePaint=this.TitlePaint[windowIndex+1];
12478
+ for(var i=0;i<aryIndexID.length;++i)
12479
+ {
12480
+ var identify=aryIndexID[i];
12481
+
12482
+ if (titlePaint.OverlayIndex.has(identify))
12483
+ titlePaint.OverlayIndex.delete(identify);
12484
+
12485
+ if (titlePaint.OverlayDynamicTitle.has(identify))
12486
+ titlePaint.OverlayDynamicTitle.delete(identify);
12487
+ }
12488
+ }
12489
+
12448
12490
  //删除叠加指标, 没有重绘
12449
12491
  this.DeleteOverlayIndex=function(identify, windowIndex)
12450
12492
  {
@@ -21581,7 +21623,7 @@ function HQTradeFrame()
21581
21623
  if (IFrameSplitOperator.IsNumber(this.OverlayBlankWidth)) overlayItem.Frame.BlankWidth=this.OverlayBlankWidth;
21582
21624
 
21583
21625
  overlayItem.Frame.Draw();
21584
- rightOffset+=overlayItem.RightWidth.Width;
21626
+ if (overlayItem.RightWidth) rightOffset+=overlayItem.RightWidth.Width;
21585
21627
  if (overlayItem.Frame.IsShow) ++index;
21586
21628
  }
21587
21629
  }
@@ -72478,14 +72520,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72478
72520
  if (count<=0) return;
72479
72521
  var currentLength=this.Frame.SubFrame.length;
72480
72522
 
72481
- var period=null, right=null;
72523
+ var period=null, right=null, symbol=null;
72524
+ if (option.Symbol) symbol=option.Symbol;
72482
72525
  if (option.KLine)
72483
72526
  {
72484
72527
  if (IFrameSplitOperator.IsNumber(option.KLine.Period) && option.KLine.Period!=this.Period) period=option.KLine.Period; //周期
72485
72528
  if (IFrameSplitOperator.IsNumber(option.KLine.Right) && option.KLine.Right!=this.Right) right=option.KLine.Right; //复权
72486
72529
  }
72487
72530
 
72488
- var bRefreshData= (period!=null || right!=null);
72531
+ var bRefreshData= (period!=null || right!=null || symbol!=null);
72489
72532
 
72490
72533
  //清空所有的指标图型
72491
72534
  for(var i=0;i<currentLength;++i)
@@ -72513,6 +72556,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72513
72556
 
72514
72557
  this.Frame.SubFrame.splice(count,currentLength-count);
72515
72558
  this.WindowIndex.splice(count,currentLength-count);
72559
+ this.TitlePaint.splice(count+1,currentLength-count);
72516
72560
  }
72517
72561
  else
72518
72562
  {
@@ -72529,8 +72573,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72529
72573
  this.TitlePaint[i+1]=titlePaint;
72530
72574
  }
72531
72575
  }
72532
-
72533
- var systemScript = new JSIndexScript();
72576
+
72534
72577
  for(var i=0;i<count;++i)
72535
72578
  {
72536
72579
  var windowIndex=i;
@@ -72540,7 +72583,10 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72540
72583
  var titleIndex=windowIndex+1;
72541
72584
  this.TitlePaint[titleIndex].Data=[];
72542
72585
  this.TitlePaint[titleIndex].Title=null;
72586
+ var frame=this.Frame.SubFrame[i];
72543
72587
 
72588
+ this.DeleteWindowsOverlayIndex(i); //清空叠加指标
72589
+
72544
72590
  if (item.Script) //自定义指标脚本
72545
72591
  {
72546
72592
  this.WindowIndex[i]=new ScriptIndex(item.Name,item.Script,item.Args,item); //脚本执行
@@ -72561,6 +72607,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72561
72607
  }
72562
72608
  else
72563
72609
  {
72610
+ var systemScript = new JSIndexScript();
72564
72611
  var indexInfo = systemScript.Get(indexID);
72565
72612
  if (indexInfo)
72566
72613
  {
@@ -72570,7 +72617,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72570
72617
  }
72571
72618
  }
72572
72619
 
72573
- this.SetSubFrameAttribute(this.Frame.SubFrame[i], item, frameItem);
72620
+ this.SetSubFrameAttribute(frame, item, frameItem);
72574
72621
  }
72575
72622
 
72576
72623
  //最后一个显示X轴坐标
@@ -72581,6 +72628,23 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72581
72628
  else item.XSplitOperator.ShowText=false;
72582
72629
  }
72583
72630
 
72631
+ //叠加指标
72632
+ var aryOverlayIndex=[];
72633
+ if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
72634
+ {
72635
+ for(var i=0;i<option.OverlayIndex.length;++i)
72636
+ {
72637
+ var item=option.OverlayIndex[i];
72638
+ if (item.Index) item.IndexName=item.Index;
72639
+ if (item.Windows>=0) item.WindowIndex=item.Windows;
72640
+
72641
+ var overlay=this.CreateOverlayWindowsIndex(item);
72642
+ if (!overlay) continue;
72643
+
72644
+ aryOverlayIndex.push({ WindowsIndex:item.WindowIndex, Overlay:overlay });
72645
+ }
72646
+ }
72647
+
72584
72648
  if (!bRefreshData)
72585
72649
  {
72586
72650
  var bindData=this.ChartPaint[0].Data;
@@ -72589,6 +72653,12 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72589
72653
  this.BindIndexData(i,bindData);
72590
72654
  }
72591
72655
 
72656
+ for(var i=0;i<aryOverlayIndex.length;++i)
72657
+ {
72658
+ var item=aryOverlayIndex[i];
72659
+ this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);
72660
+ }
72661
+
72592
72662
  this.UpdataDataoffset(); //更新数据偏移
72593
72663
  this.Frame.SetSizeChage(true);
72594
72664
  this.ResetFrameXYSplit();
@@ -72597,9 +72667,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72597
72667
  }
72598
72668
  else
72599
72669
  {
72600
- this.Frame.SetSizeChage(true);
72601
- if (period!=null) this.ChangePeriod(period, option);
72602
- else if (right!=null) this.ChangeRight(right);
72670
+ if (!symbol) symbol=this.Symbol;
72671
+
72672
+ var optionData={ KLine:{} };
72673
+ if (IFrameSplitOperator.IsNumber(period)) optionData.KLine.Period=period;
72674
+ if (IFrameSplitOperator.IsNumber(right)) optionData.KLine.Right=right;
72675
+
72676
+ this.ChangeSymbol(symbol, optionData);
72603
72677
  }
72604
72678
  }
72605
72679
 
@@ -73044,11 +73118,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73044
73118
 
73045
73119
  if (option)
73046
73120
  {
73047
- if (option.Windows && Array.isArray(option.Windows) && option.Windows.length>0)
73121
+ if (IFrameSplitOperator.IsNonEmptyArray(option.Windows))
73048
73122
  {
73049
73123
  var windows=option.Windows;
73050
- var systemScript = new JSIndexScript();
73051
- for(var i in windows)
73124
+
73125
+ for(var i=0; i<windows.length; ++i)
73052
73126
  {
73053
73127
  if (i>=this.WindowIndex.length) break; //暂时不支持 动态增加/减少
73054
73128
  var item=windows[i];
@@ -73066,11 +73140,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73066
73140
  else
73067
73141
  {
73068
73142
  var indexID=item.Index;
73143
+ var systemScript = new JSIndexScript();
73069
73144
  var indexInfo = systemScript.Get(indexID);
73070
73145
  if (indexInfo)
73071
73146
  {
73072
- var args=indexInfo.Args;
73073
- if (item.Args) indexInfo.Args=item.Args;
73147
+ JSIndexScript.ModifyAttribute(indexInfo,item);
73074
73148
  indexInfo.ID=indexID;
73075
73149
  this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
73076
73150
  }
@@ -77819,25 +77893,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77819
77893
  if (windowIndex<2) windowIndex=2;
77820
77894
  if (windowIndex>=this.Frame.SubFrame.length) windowIndex=2;
77821
77895
 
77822
- let indexData =
77823
- {
77824
- Name:indexInfo.Name, Script:indexInfo.Script, Args: indexInfo.Args, ID:indexName ,
77825
- //扩展属性 可以是空
77826
- KLineType:indexInfo.KLineType, YSpecificMaxMin:indexInfo.YSpecificMaxMin, YSplitScale:indexInfo.YSplitScale,
77827
- FloatPrecision:indexInfo.FloatPrecision, Condition:indexInfo.Condition,StringFormat:indexInfo.StringFormat,
77828
- OutName:indexInfo.OutName
77829
- };
77896
+ JSIndexScript.ModifyAttribute(indexInfo, option)
77830
77897
 
77831
- if (option)
77832
- {
77833
- if (option.FloatPrecision>=0) indexData.FloatPrecision=option.FloatPrecision;
77834
- if (option.StringFormat>0) indexData.StringFormat=option.StringFormat;
77835
- if (option.Args) indexData.Args=option.Args;
77836
- if (IFrameSplitOperator.IsNumber(option.YSplitType)) indexData.YSplitType=option.YSplitType;
77837
- if (option.Lock) indexData.Lock=option.Lock;
77838
- }
77839
-
77840
- return this.ChangeScriptIndex(windowIndex, indexData,option);
77898
+ return this.ChangeScriptIndex(windowIndex, indexInfo, option);
77841
77899
  }
77842
77900
 
77843
77901
  //设置指标窗口个数
@@ -77951,6 +78009,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77951
78009
 
77952
78010
  this.Frame.SubFrame.splice(count,currentLength-count);
77953
78011
  this.WindowIndex.splice(count,currentLength-count);
78012
+ this.TitlePaint.splice(count+1,currentLength-count);
77954
78013
  }
77955
78014
  else
77956
78015
  {
@@ -77968,8 +78027,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77968
78027
  }
77969
78028
  }
77970
78029
 
77971
- var systemScript = new JSIndexScript();
77972
-
77973
78030
  for(var i=0;i<count;++i)
77974
78031
  {
77975
78032
  var windowIndex=i;
@@ -78003,22 +78060,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78003
78060
  }
78004
78061
  else
78005
78062
  {
78063
+ var systemScript = new JSIndexScript();
78006
78064
  var indexInfo = systemScript.Get(indexID);
78007
78065
  if (indexInfo)
78008
78066
  {
78009
- var args=indexInfo.Args;
78010
- if (item.Args) args=item.Args;
78011
- let indexData =
78012
- {
78013
- Name:indexInfo.Name, Script:indexInfo.Script, Args: args, ID:indexID ,
78014
- //扩展属性 可以是空
78015
- KLineType:indexInfo.KLineType, YSpecificMaxMin:indexInfo.YSpecificMaxMin, YSplitScale:indexInfo.YSplitScale,
78016
- FloatPrecision:indexInfo.FloatPrecision, Condition:indexInfo.Condition,
78017
- OutName:indexInfo.OutName
78018
- };
78019
- if (item.TitleFont) indexData.TitleFont=item.TitleFont;
78020
-
78021
- this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
78067
+ JSIndexScript.ModifyAttribute(indexInfo,item);
78068
+ this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
78022
78069
  }
78023
78070
  }
78024
78071
  }
@@ -78027,6 +78074,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78027
78074
  this.SetSubFrameAttribute(this.Frame.SubFrame[windowIndex], item, frameItem);
78028
78075
  }
78029
78076
 
78077
+ //清空叠加指标
78078
+ for(var i=0;i<this.Frame.SubFrame.length;++i)
78079
+ {
78080
+ this.DeleteWindowsOverlayIndex(i);
78081
+ }
78082
+
78030
78083
  //最后一个显示X轴坐标
78031
78084
  for(var i=0;i<this.Frame.SubFrame.length;++i)
78032
78085
  {
@@ -78035,6 +78088,23 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78035
78088
  else item.XSplitOperator.ShowText=false;
78036
78089
  }
78037
78090
 
78091
+ //叠加指标
78092
+ var aryOverlayIndex=[];
78093
+ if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
78094
+ {
78095
+ for(var i=0;i<option.OverlayIndex.length;++i)
78096
+ {
78097
+ var item=option.OverlayIndex[i];
78098
+ if (item.Index) item.IndexName=item.Index;
78099
+ if (item.Windows>=0) item.WindowIndex=item.Windows;
78100
+
78101
+ var overlay=this.CreateOverlayWindowsIndex(item);
78102
+ if (!overlay) continue;
78103
+
78104
+ aryOverlayIndex.push({ WindowsIndex:item.WindowIndex, Overlay:overlay });
78105
+ }
78106
+ }
78107
+
78038
78108
  if (!bRefreshData)
78039
78109
  {
78040
78110
  var bindData=this.SourceData;
@@ -78042,6 +78112,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78042
78112
  {
78043
78113
  this.BindIndexData(i,bindData); //执行脚本
78044
78114
  }
78115
+
78116
+ for(var i=0;i<aryOverlayIndex.length;++i)
78117
+ {
78118
+ var item=aryOverlayIndex[i];
78119
+ this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);
78120
+ }
78121
+
78045
78122
  this.UpdataDataoffset(); //更新数据偏移
78046
78123
  this.Frame.SetSizeChage(true);
78047
78124
  if (this.UpdateXShowText) this.UpdateXShowText();
@@ -78216,7 +78293,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78216
78293
 
78217
78294
  if (IFrameSplitOperator.IsNonEmptyArray(option.Windows)) //切换指标
78218
78295
  {
78219
- var systemScript = new JSIndexScript();
78296
+
78220
78297
  for(var i=0; i<option.Windows.length; ++i)
78221
78298
  {
78222
78299
  var index=2+i;
@@ -78236,12 +78313,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78236
78313
  }
78237
78314
  else
78238
78315
  {
78316
+ var systemScript = new JSIndexScript();
78239
78317
  var indexID=item.Index;
78240
78318
  var indexInfo = systemScript.Get(indexID);
78241
78319
  if (indexInfo)
78242
78320
  {
78243
- var args=indexInfo.Args;
78244
- if (item.Args) indexInfo.Args=item.Args;
78321
+ JSIndexScript.ModifyAttribute(indexInfo,item);
78245
78322
  indexInfo.ID=indexID;
78246
78323
  this.WindowIndex[index]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
78247
78324
  }
@@ -129308,7 +129385,7 @@ function ScrollBarBGChart()
129308
129385
 
129309
129386
 
129310
129387
 
129311
- var HQCHART_VERSION="1.1.12934";
129388
+ var HQCHART_VERSION="1.1.12942";
129312
129389
 
129313
129390
  function PrintHQChartVersion()
129314
129391
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12934";
8
+ var HQCHART_VERSION="1.1.12942";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {