hqchart 1.1.12928 → 1.1.12939
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.
- package/lib/umychart.vue.js +42 -37
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +11 -13
- package/src/jscommon/umychart.index.data.js +25 -1
- package/src/jscommon/umychart.js +130 -121
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +166 -135
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +166 -135
|
@@ -38,7 +38,7 @@ var JSConsole=
|
|
|
38
38
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
39
39
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
40
40
|
SplitType: Y轴分割类型,
|
|
41
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat
|
|
41
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
44
|
//周期条件枚举
|
|
@@ -180,6 +180,30 @@ JSIndexScript.AddIndex=function(aryIndex) //添加自定义指标
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
//修改指标属性
|
|
184
|
+
JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
|
|
185
|
+
{
|
|
186
|
+
if (!attribute) return;
|
|
187
|
+
|
|
188
|
+
if (attribute.Args) indexInfo.Args=attribute.Args; //外部可以设置参数
|
|
189
|
+
if (IFrameSplitOperator.IsNumber(attribute.FloatPrecision)) indexInfo.FloatPrecision=attribute.FloatPrecision;
|
|
190
|
+
if (IFrameSplitOperator.IsNumber(attribute.StringFormat)) indexInfo.StringFormat=attribute.StringFormat;
|
|
191
|
+
if (IFrameSplitOperator.IsBool(attribute.IsSync)) indexInfo.IsSync=attribute.IsSync;
|
|
192
|
+
if (IFrameSplitOperator.IsBool(attribute.IsShortTitle)) indexInfo.IsShortTitle=attribute.IsShortTitle;
|
|
193
|
+
if (attribute.TitleFont) indexInfo.TitleFont=attribute.TitleFont;
|
|
194
|
+
if (attribute.Lock) indexInfo.Lock=attribute.Lock;
|
|
195
|
+
if (IFrameSplitOperator.IsNumber(attribute.YSplitType)) indexInfo.YSplitType=attribute.YSplitType;
|
|
196
|
+
|
|
197
|
+
if (attribute.YAxis)
|
|
198
|
+
{
|
|
199
|
+
var item=attribute.YAxis;
|
|
200
|
+
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
201
|
+
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.FloatPrecision;
|
|
202
|
+
if (IFrameSplitOperator.IsNumber(item.StringFormat)) indexInfo.YAxis.StringFormat=item.StringFormat;
|
|
203
|
+
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
183
207
|
JSIndexScript.prototype.Get=function(id)
|
|
184
208
|
{
|
|
185
209
|
var data=g_CustomIndex.Get(id);
|
|
@@ -4722,7 +4746,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4722
4746
|
}
|
|
4723
4747
|
|
|
4724
4748
|
//创建子窗口的指标
|
|
4725
|
-
|
|
4749
|
+
var scriptData = new JSIndexScript();
|
|
4726
4750
|
|
|
4727
4751
|
if (option.ColorIndex) //五彩K线
|
|
4728
4752
|
{
|
|
@@ -4777,27 +4801,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4777
4801
|
}
|
|
4778
4802
|
else
|
|
4779
4803
|
{
|
|
4804
|
+
var scriptData = new JSIndexScript();
|
|
4780
4805
|
let indexInfo = scriptData.Get(item.Index);
|
|
4781
4806
|
if (!indexInfo) continue;
|
|
4782
|
-
|
|
4783
|
-
if (item.Lock) indexInfo.Lock=item.Lock;
|
|
4807
|
+
JSIndexScript.ModifyAttribute(indexInfo, item);
|
|
4784
4808
|
indexInfo.ID=item.Index;
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
if (item.IsShortTitle) indexInfo.IsShortTitle=item.IsShortTitle;
|
|
4788
|
-
if (item.TitleFont) indexInfo.TitleFont=item.TitleFont;
|
|
4789
|
-
if (IFrameSplitOperator.IsBool(item.IsSync)) indexInfo.IsSync=item.IsSync;
|
|
4790
|
-
chart.WindowIndex[i] = new ScriptIndex(indexInfo.Name, indexInfo.Script, args,indexInfo); //脚本执行
|
|
4809
|
+
|
|
4810
|
+
chart.WindowIndex[i] = new ScriptIndex(indexInfo.Name, indexInfo.Script, indexInfo.Args,indexInfo); //脚本执行
|
|
4791
4811
|
if (item.StringFormat>0) chart.WindowIndex[i].StringFormat=item.StringFormat;
|
|
4792
4812
|
if (item.FloatPrecision>=0) chart.WindowIndex[i].FloatPrecision=item.FloatPrecision;
|
|
4793
|
-
|
|
4794
|
-
if (item.YAxis)
|
|
4795
|
-
{
|
|
4796
|
-
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
4797
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.YAxis.FloatPrecision;
|
|
4798
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=item.YAxis.StringFormat;
|
|
4799
|
-
if (IFrameSplitOperator.IsBool(item.YAxis.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.YAxis.EnableRemoveZero;
|
|
4800
|
-
}
|
|
4801
4813
|
}
|
|
4802
4814
|
|
|
4803
4815
|
}
|
|
@@ -5631,7 +5643,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5631
5643
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Windows))
|
|
5632
5644
|
{
|
|
5633
5645
|
//创建子窗口的指标
|
|
5634
|
-
|
|
5646
|
+
|
|
5635
5647
|
for(var i=0;i<option.Windows.length;++i)
|
|
5636
5648
|
{
|
|
5637
5649
|
var item=option.Windows[i];
|
|
@@ -5649,6 +5661,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5649
5661
|
}
|
|
5650
5662
|
else
|
|
5651
5663
|
{
|
|
5664
|
+
var scriptData = new JSIndexScript();
|
|
5652
5665
|
let indexInfo = scriptData.Get(item.Index);
|
|
5653
5666
|
if (!indexInfo) continue;
|
|
5654
5667
|
|
|
@@ -12285,20 +12298,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12285
12298
|
this.RemoveMinSizeWindows(); //清空隐藏的指标
|
|
12286
12299
|
var index=this.AddNewSubFrame(option);
|
|
12287
12300
|
|
|
12288
|
-
|
|
12289
|
-
{
|
|
12290
|
-
if (option.FloatPrecision>=0) indexInfo.FloatPrecision=option.FloatPrecision;
|
|
12291
|
-
if (option.StringFormat>0) indexInfo.StringFormat=option.StringFormat;
|
|
12292
|
-
if (option.Args) indexInfo.Args=option.Args;
|
|
12293
|
-
if (option.Lock) indexInfo.Lock=option.Lock;
|
|
12294
|
-
if (option.YAxis)
|
|
12295
|
-
{
|
|
12296
|
-
indexInfo.YAxis={ };
|
|
12297
|
-
if (IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=option.YAxis.FloatPrecision;
|
|
12298
|
-
if (IFrameSplitOperator.IsNumber(option.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=option.YAxis.StringFormat;
|
|
12299
|
-
if (IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
12300
|
-
}
|
|
12301
|
-
}
|
|
12301
|
+
JSIndexScript.ModifyAttribute(indexInfo, option);
|
|
12302
12302
|
|
|
12303
12303
|
this.WindowIndex[index] = new ScriptIndex(indexInfo.Name, indexInfo.Script, indexInfo.Args,indexInfo); //脚本执行
|
|
12304
12304
|
if (this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer")
|
|
@@ -12448,6 +12448,45 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12448
12448
|
return paint.ClearPoint();
|
|
12449
12449
|
}
|
|
12450
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
|
+
|
|
12451
12490
|
//删除叠加指标, 没有重绘
|
|
12452
12491
|
this.DeleteOverlayIndex=function(identify, windowIndex)
|
|
12453
12492
|
{
|
|
@@ -21584,7 +21623,7 @@ function HQTradeFrame()
|
|
|
21584
21623
|
if (IFrameSplitOperator.IsNumber(this.OverlayBlankWidth)) overlayItem.Frame.BlankWidth=this.OverlayBlankWidth;
|
|
21585
21624
|
|
|
21586
21625
|
overlayItem.Frame.Draw();
|
|
21587
|
-
rightOffset+=overlayItem.RightWidth.Width;
|
|
21626
|
+
if (overlayItem.RightWidth) rightOffset+=overlayItem.RightWidth.Width;
|
|
21588
21627
|
if (overlayItem.Frame.IsShow) ++index;
|
|
21589
21628
|
}
|
|
21590
21629
|
}
|
|
@@ -47298,6 +47337,8 @@ function IFrameSplitOperator()
|
|
|
47298
47337
|
{
|
|
47299
47338
|
|
|
47300
47339
|
}
|
|
47340
|
+
|
|
47341
|
+
this.SetOption=function(option) { }
|
|
47301
47342
|
}
|
|
47302
47343
|
|
|
47303
47344
|
//字符串格式化 千分位分割
|
|
@@ -48564,7 +48605,7 @@ function FrameSplitY()
|
|
|
48564
48605
|
this.DefaultSplitType=0;
|
|
48565
48606
|
this.Custom=[]; //[{Type:0}]; 定制刻度
|
|
48566
48607
|
this.DefaultYMaxMin; //{ Max:null, Min:null }; //指定最大,最小, Y轴范围必须比最大值大, 比最小值小
|
|
48567
|
-
this.EnableRemoveZero=
|
|
48608
|
+
this.EnableRemoveZero=g_JSChartResource.Frame.EnableRemoveZero;
|
|
48568
48609
|
this.LineType=null; //线段样式
|
|
48569
48610
|
this.IgnoreYValue = null; //在这个数组里的数字不显示在刻度上
|
|
48570
48611
|
this.FixedYMaxMin; //{ Max, Min} 固定Y轴最大最小值
|
|
@@ -48589,6 +48630,22 @@ function FrameSplitY()
|
|
|
48589
48630
|
return true;
|
|
48590
48631
|
}
|
|
48591
48632
|
|
|
48633
|
+
|
|
48634
|
+
this.Reset=function() //重置
|
|
48635
|
+
{
|
|
48636
|
+
this.EnableRemoveZero=g_JSChartResource.Frame.EnableRemoveZero;
|
|
48637
|
+
this.StringFormat=g_JSChartResource.Frame.StringFormat;
|
|
48638
|
+
}
|
|
48639
|
+
|
|
48640
|
+
this.SetOption=function(option)
|
|
48641
|
+
{
|
|
48642
|
+
if (!option) return;
|
|
48643
|
+
|
|
48644
|
+
if (IFrameSplitOperator.IsNumber(option.FloatPrecision)) this.FloatPrecision=option.FloatPrecision;
|
|
48645
|
+
if (IFrameSplitOperator.IsNumber(option.StringFormat)) this.StringFormat=option.StringFormat;
|
|
48646
|
+
if (IFrameSplitOperator.IsBool(option.EnableRemoveZero)) this.EnableRemoveZero=option.EnableRemoveZero;
|
|
48647
|
+
}
|
|
48648
|
+
|
|
48592
48649
|
this.GetFloatPrecision=function(value,floatPrecision)
|
|
48593
48650
|
{
|
|
48594
48651
|
if (value>this.FLOATPRECISION_RANGE[0]) return floatPrecision;
|
|
@@ -66000,7 +66057,9 @@ function JSChartResource()
|
|
|
66000
66057
|
this.Frame={
|
|
66001
66058
|
XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
|
|
66002
66059
|
YTopOffset:2*GetDevicePixelRatio(), //Y轴顶部文字向下偏移
|
|
66003
|
-
YTextPadding:[2,2]
|
|
66060
|
+
YTextPadding:[2,2],
|
|
66061
|
+
EnableRemoveZero:true, //移除小数点后面的0
|
|
66062
|
+
StringFormat:0
|
|
66004
66063
|
};
|
|
66005
66064
|
this.ToolbarButtonStyle=0;
|
|
66006
66065
|
|
|
@@ -72029,18 +72088,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72029
72088
|
{
|
|
72030
72089
|
if (windowIndex == 0) windowIndex = 1; //幅图指标,不能再主图显示
|
|
72031
72090
|
}
|
|
72032
|
-
|
|
72033
|
-
|
|
72034
|
-
|
|
72035
|
-
if (option.FloatPrecision>=0) indexData.FloatPrecision=option.FloatPrecision;
|
|
72036
|
-
if (option.StringFormat>0) indexData.StringFormat=option.StringFormat;
|
|
72037
|
-
if (option.Args) indexData.Args=option.Args;
|
|
72038
|
-
if (option.TitleFont) indexData.TitleFont=option.TitleFont;
|
|
72039
|
-
if (option.IsShortTitle) indexData.IsShortTitle=option.IsShortTitle;
|
|
72040
|
-
if (option.Lock) indexData.Lock=option.Lock;
|
|
72041
|
-
}
|
|
72042
|
-
|
|
72043
|
-
return this.ChangeScriptIndex(windowIndex, indexData,option);
|
|
72091
|
+
|
|
72092
|
+
JSIndexScript.ModifyAttribute(indexInfo, option)
|
|
72093
|
+
return this.ChangeScriptIndex(windowIndex, indexInfo, option);
|
|
72044
72094
|
}
|
|
72045
72095
|
|
|
72046
72096
|
//主图指标
|
|
@@ -72186,18 +72236,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72186
72236
|
}
|
|
72187
72237
|
else if (indexInfo)
|
|
72188
72238
|
{
|
|
72189
|
-
|
|
72190
|
-
if (IFrameSplitOperator.IsNumber(obj.FloatPrecision)) indexInfo.FloatPrecision=obj.FloatPrecision;
|
|
72191
|
-
if (IFrameSplitOperator.IsNumber(obj.StringFormat)) indexInfo.StringFormat=obj.StringFormat;
|
|
72192
|
-
if (IFrameSplitOperator.IsBool(obj.IsSync)) indexInfo.IsSync=obj.IsSync;
|
|
72193
|
-
if (obj.YAxis)
|
|
72194
|
-
{
|
|
72195
|
-
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
72196
|
-
if (IFrameSplitOperator.IsNumber(obj.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=obj.YAxis.FloatPrecision;
|
|
72197
|
-
if (IFrameSplitOperator.IsNumber(obj.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=obj.YAxis.StringFormat;
|
|
72198
|
-
if (IFrameSplitOperator.IsBool(obj.YAxis.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=obj.YAxis.EnableRemoveZero;
|
|
72199
|
-
}
|
|
72200
|
-
|
|
72239
|
+
JSIndexScript.ModifyAttribute(indexInfo, obj);
|
|
72201
72240
|
var scriptIndex=new OverlayScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
72202
72241
|
scriptIndex.OverlayIndex={ IsOverlay:true, Identify:overlayFrame.Identify, WindowIndex:windowIndex, Frame:overlayFrame }; //叠加指标信息
|
|
72203
72242
|
overlayFrame.Script=scriptIndex;
|
|
@@ -72481,14 +72520,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72481
72520
|
if (count<=0) return;
|
|
72482
72521
|
var currentLength=this.Frame.SubFrame.length;
|
|
72483
72522
|
|
|
72484
|
-
var period=null, right=null;
|
|
72523
|
+
var period=null, right=null, symbol=null;
|
|
72524
|
+
if (option.Symbol) symbol=option.Symbol;
|
|
72485
72525
|
if (option.KLine)
|
|
72486
72526
|
{
|
|
72487
72527
|
if (IFrameSplitOperator.IsNumber(option.KLine.Period) && option.KLine.Period!=this.Period) period=option.KLine.Period; //周期
|
|
72488
72528
|
if (IFrameSplitOperator.IsNumber(option.KLine.Right) && option.KLine.Right!=this.Right) right=option.KLine.Right; //复权
|
|
72489
72529
|
}
|
|
72490
72530
|
|
|
72491
|
-
var bRefreshData= (period!=null || right!=null);
|
|
72531
|
+
var bRefreshData= (period!=null || right!=null || symbol!=null);
|
|
72492
72532
|
|
|
72493
72533
|
//清空所有的指标图型
|
|
72494
72534
|
for(var i=0;i<currentLength;++i)
|
|
@@ -72516,6 +72556,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72516
72556
|
|
|
72517
72557
|
this.Frame.SubFrame.splice(count,currentLength-count);
|
|
72518
72558
|
this.WindowIndex.splice(count,currentLength-count);
|
|
72559
|
+
this.TitlePaint.splice(count+1,currentLength-count);
|
|
72519
72560
|
}
|
|
72520
72561
|
else
|
|
72521
72562
|
{
|
|
@@ -72532,8 +72573,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72532
72573
|
this.TitlePaint[i+1]=titlePaint;
|
|
72533
72574
|
}
|
|
72534
72575
|
}
|
|
72535
|
-
|
|
72536
|
-
var systemScript = new JSIndexScript();
|
|
72576
|
+
|
|
72537
72577
|
for(var i=0;i<count;++i)
|
|
72538
72578
|
{
|
|
72539
72579
|
var windowIndex=i;
|
|
@@ -72543,7 +72583,10 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72543
72583
|
var titleIndex=windowIndex+1;
|
|
72544
72584
|
this.TitlePaint[titleIndex].Data=[];
|
|
72545
72585
|
this.TitlePaint[titleIndex].Title=null;
|
|
72586
|
+
var frame=this.Frame.SubFrame[i];
|
|
72546
72587
|
|
|
72588
|
+
this.DeleteWindowsOverlayIndex(i); //清空叠加指标
|
|
72589
|
+
|
|
72547
72590
|
if (item.Script) //自定义指标脚本
|
|
72548
72591
|
{
|
|
72549
72592
|
this.WindowIndex[i]=new ScriptIndex(item.Name,item.Script,item.Args,item); //脚本执行
|
|
@@ -72564,28 +72607,17 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72564
72607
|
}
|
|
72565
72608
|
else
|
|
72566
72609
|
{
|
|
72610
|
+
var systemScript = new JSIndexScript();
|
|
72567
72611
|
var indexInfo = systemScript.Get(indexID);
|
|
72568
72612
|
if (indexInfo)
|
|
72569
72613
|
{
|
|
72570
|
-
|
|
72571
|
-
|
|
72572
|
-
if (item.TitleFont) indexInfo.TitleFont=item.TitleFont;
|
|
72573
|
-
if (item.IsShortTitle) indexInfo.IsShortTitle=item.IsShortTitle;
|
|
72574
|
-
if (IFrameSplitOperator.IsBool(item.IsSync)) indexInfo.IsSync=item.IsSync;
|
|
72575
|
-
|
|
72576
|
-
if (item.YAxis)
|
|
72577
|
-
{
|
|
72578
|
-
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
72579
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.YAxis.FloatPrecision;
|
|
72580
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=item.YAxis.StringFormat;
|
|
72581
|
-
}
|
|
72582
|
-
|
|
72583
|
-
this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,args,indexInfo); //脚本执行
|
|
72614
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
72615
|
+
this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
72584
72616
|
}
|
|
72585
72617
|
}
|
|
72586
72618
|
}
|
|
72587
72619
|
|
|
72588
|
-
this.SetSubFrameAttribute(
|
|
72620
|
+
this.SetSubFrameAttribute(frame, item, frameItem);
|
|
72589
72621
|
}
|
|
72590
72622
|
|
|
72591
72623
|
//最后一个显示X轴坐标
|
|
@@ -72596,6 +72628,23 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72596
72628
|
else item.XSplitOperator.ShowText=false;
|
|
72597
72629
|
}
|
|
72598
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(overlay);
|
|
72645
|
+
}
|
|
72646
|
+
}
|
|
72647
|
+
|
|
72599
72648
|
if (!bRefreshData)
|
|
72600
72649
|
{
|
|
72601
72650
|
var bindData=this.ChartPaint[0].Data;
|
|
@@ -72604,6 +72653,12 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72604
72653
|
this.BindIndexData(i,bindData);
|
|
72605
72654
|
}
|
|
72606
72655
|
|
|
72656
|
+
for(var i=0;i<aryOverlayIndex.length;++i)
|
|
72657
|
+
{
|
|
72658
|
+
var item=aryOverlayIndex[i];
|
|
72659
|
+
this.BindOverlayIndexData(item,item.WindowIndex,bindData);
|
|
72660
|
+
}
|
|
72661
|
+
|
|
72607
72662
|
this.UpdataDataoffset(); //更新数据偏移
|
|
72608
72663
|
this.Frame.SetSizeChage(true);
|
|
72609
72664
|
this.ResetFrameXYSplit();
|
|
@@ -72612,9 +72667,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72612
72667
|
}
|
|
72613
72668
|
else
|
|
72614
72669
|
{
|
|
72615
|
-
|
|
72616
|
-
|
|
72617
|
-
|
|
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);
|
|
72618
72677
|
}
|
|
72619
72678
|
}
|
|
72620
72679
|
|
|
@@ -73059,11 +73118,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73059
73118
|
|
|
73060
73119
|
if (option)
|
|
73061
73120
|
{
|
|
73062
|
-
if (
|
|
73121
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.Windows))
|
|
73063
73122
|
{
|
|
73064
73123
|
var windows=option.Windows;
|
|
73065
|
-
|
|
73066
|
-
for(var i
|
|
73124
|
+
|
|
73125
|
+
for(var i=0; i<windows.length; ++i)
|
|
73067
73126
|
{
|
|
73068
73127
|
if (i>=this.WindowIndex.length) break; //暂时不支持 动态增加/减少
|
|
73069
73128
|
var item=windows[i];
|
|
@@ -73081,11 +73140,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73081
73140
|
else
|
|
73082
73141
|
{
|
|
73083
73142
|
var indexID=item.Index;
|
|
73143
|
+
var systemScript = new JSIndexScript();
|
|
73084
73144
|
var indexInfo = systemScript.Get(indexID);
|
|
73085
73145
|
if (indexInfo)
|
|
73086
73146
|
{
|
|
73087
|
-
|
|
73088
|
-
if (item.Args) indexInfo.Args=item.Args;
|
|
73147
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
73089
73148
|
indexInfo.ID=indexID;
|
|
73090
73149
|
this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
73091
73150
|
}
|
|
@@ -77834,25 +77893,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
77834
77893
|
if (windowIndex<2) windowIndex=2;
|
|
77835
77894
|
if (windowIndex>=this.Frame.SubFrame.length) windowIndex=2;
|
|
77836
77895
|
|
|
77837
|
-
|
|
77838
|
-
{
|
|
77839
|
-
Name:indexInfo.Name, Script:indexInfo.Script, Args: indexInfo.Args, ID:indexName ,
|
|
77840
|
-
//扩展属性 可以是空
|
|
77841
|
-
KLineType:indexInfo.KLineType, YSpecificMaxMin:indexInfo.YSpecificMaxMin, YSplitScale:indexInfo.YSplitScale,
|
|
77842
|
-
FloatPrecision:indexInfo.FloatPrecision, Condition:indexInfo.Condition,StringFormat:indexInfo.StringFormat,
|
|
77843
|
-
OutName:indexInfo.OutName
|
|
77844
|
-
};
|
|
77896
|
+
JSIndexScript.ModifyAttribute(indexInfo, option)
|
|
77845
77897
|
|
|
77846
|
-
|
|
77847
|
-
{
|
|
77848
|
-
if (option.FloatPrecision>=0) indexData.FloatPrecision=option.FloatPrecision;
|
|
77849
|
-
if (option.StringFormat>0) indexData.StringFormat=option.StringFormat;
|
|
77850
|
-
if (option.Args) indexData.Args=option.Args;
|
|
77851
|
-
if (IFrameSplitOperator.IsNumber(option.YSplitType)) indexData.YSplitType=option.YSplitType;
|
|
77852
|
-
if (option.Lock) indexData.Lock=option.Lock;
|
|
77853
|
-
}
|
|
77854
|
-
|
|
77855
|
-
return this.ChangeScriptIndex(windowIndex, indexData,option);
|
|
77898
|
+
return this.ChangeScriptIndex(windowIndex, indexInfo, option);
|
|
77856
77899
|
}
|
|
77857
77900
|
|
|
77858
77901
|
//设置指标窗口个数
|
|
@@ -77983,7 +78026,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
77983
78026
|
}
|
|
77984
78027
|
}
|
|
77985
78028
|
|
|
77986
|
-
|
|
78029
|
+
|
|
77987
78030
|
|
|
77988
78031
|
for(var i=0;i<count;++i)
|
|
77989
78032
|
{
|
|
@@ -78018,22 +78061,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78018
78061
|
}
|
|
78019
78062
|
else
|
|
78020
78063
|
{
|
|
78064
|
+
var systemScript = new JSIndexScript();
|
|
78021
78065
|
var indexInfo = systemScript.Get(indexID);
|
|
78022
78066
|
if (indexInfo)
|
|
78023
78067
|
{
|
|
78024
|
-
|
|
78025
|
-
|
|
78026
|
-
let indexData =
|
|
78027
|
-
{
|
|
78028
|
-
Name:indexInfo.Name, Script:indexInfo.Script, Args: args, ID:indexID ,
|
|
78029
|
-
//扩展属性 可以是空
|
|
78030
|
-
KLineType:indexInfo.KLineType, YSpecificMaxMin:indexInfo.YSpecificMaxMin, YSplitScale:indexInfo.YSplitScale,
|
|
78031
|
-
FloatPrecision:indexInfo.FloatPrecision, Condition:indexInfo.Condition,
|
|
78032
|
-
OutName:indexInfo.OutName
|
|
78033
|
-
};
|
|
78034
|
-
if (item.TitleFont) indexData.TitleFont=item.TitleFont;
|
|
78035
|
-
|
|
78036
|
-
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
78068
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
78069
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
78037
78070
|
}
|
|
78038
78071
|
}
|
|
78039
78072
|
}
|
|
@@ -78231,7 +78264,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78231
78264
|
|
|
78232
78265
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Windows)) //切换指标
|
|
78233
78266
|
{
|
|
78234
|
-
|
|
78267
|
+
|
|
78235
78268
|
for(var i=0; i<option.Windows.length; ++i)
|
|
78236
78269
|
{
|
|
78237
78270
|
var index=2+i;
|
|
@@ -78251,12 +78284,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78251
78284
|
}
|
|
78252
78285
|
else
|
|
78253
78286
|
{
|
|
78287
|
+
var systemScript = new JSIndexScript();
|
|
78254
78288
|
var indexID=item.Index;
|
|
78255
78289
|
var indexInfo = systemScript.Get(indexID);
|
|
78256
78290
|
if (indexInfo)
|
|
78257
78291
|
{
|
|
78258
|
-
|
|
78259
|
-
if (item.Args) indexInfo.Args=item.Args;
|
|
78292
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
78260
78293
|
indexInfo.ID=indexID;
|
|
78261
78294
|
this.WindowIndex[index]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
78262
78295
|
}
|
|
@@ -114157,13 +114190,13 @@ function ScriptIndex(name,script,args,option)
|
|
|
114157
114190
|
{
|
|
114158
114191
|
//Y轴刻度格式 默认跟标题栏一致
|
|
114159
114192
|
var ySpliter=hqChart.Frame.SubFrame[windowIndex].Frame.YSplitOperator;
|
|
114160
|
-
ySpliter
|
|
114161
|
-
if (this.YAxis)
|
|
114193
|
+
if (ySpliter)
|
|
114162
114194
|
{
|
|
114163
|
-
|
|
114164
|
-
|
|
114195
|
+
ySpliter.Reset();
|
|
114196
|
+
ySpliter.FloatPrecision=this.FloatPrecision;
|
|
114197
|
+
if (this.YAxis) ySpliter.SetOption(this.YAxis);
|
|
114165
114198
|
}
|
|
114166
|
-
|
|
114199
|
+
|
|
114167
114200
|
if (this.YSpecificMaxMin) hqChart.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=this.YSpecificMaxMin; //最大最小值
|
|
114168
114201
|
if (this.YSplitScale) hqChart.Frame.SubFrame[windowIndex].Frame.YSplitScale=this.YSplitScale; //固定刻度
|
|
114169
114202
|
}
|
|
@@ -114536,14 +114569,12 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
114536
114569
|
|
|
114537
114570
|
//修改Y轴分割方式
|
|
114538
114571
|
var ySpliter=this.OverlayIndex.Frame.Frame.YSplitOperator;
|
|
114539
|
-
if (
|
|
114540
|
-
ySpliter.FloatPrecision=this.FloatPrecision;
|
|
114541
|
-
ySpliter.EnableRemoveZero=true;
|
|
114542
|
-
if (this.YAxis)
|
|
114572
|
+
if (ySpliter)
|
|
114543
114573
|
{
|
|
114544
|
-
|
|
114545
|
-
|
|
114546
|
-
if (IFrameSplitOperator.
|
|
114574
|
+
ySpliter.Reset();
|
|
114575
|
+
ySpliter.FloatPrecision=this.FloatPrecision;
|
|
114576
|
+
if (IFrameSplitOperator.IsNumber(this.YSplitType)) ySpliter.SplitType=this.YSplitType;
|
|
114577
|
+
if (this.YAxis) ySpliter.SetOption(this.YAxis);
|
|
114547
114578
|
}
|
|
114548
114579
|
|
|
114549
114580
|
//指标名字
|
|
@@ -129325,7 +129356,7 @@ function ScrollBarBGChart()
|
|
|
129325
129356
|
|
|
129326
129357
|
|
|
129327
129358
|
|
|
129328
|
-
var HQCHART_VERSION="1.1.
|
|
129359
|
+
var HQCHART_VERSION="1.1.12938";
|
|
129329
129360
|
|
|
129330
129361
|
function PrintHQChartVersion()
|
|
129331
129362
|
{
|