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
|
@@ -82,7 +82,7 @@ JSNetwork.HttpRequest=function(obj) //对请求进行封装
|
|
|
82
82
|
Condition: 限制条件 { Symbol:'Index'/'Stock'(只支持指数/股票),Period:[](支持的周期), Include:[](指定支持的股票,代码全部大写包括后缀, Message:"提示信息")}
|
|
83
83
|
OutName:动态输出变量名字 [{Name:原始变量名, DynamicName:动态名字格式}] 如 {Name:"MA1", DynamicName:"MA{M1}"};
|
|
84
84
|
SplitType: Y轴分割类型,
|
|
85
|
-
YAxis:{ FloatPrecision:小数位数, StringFormat
|
|
85
|
+
YAxis:{ FloatPrecision:小数位数, StringFormat:, EnableRemoveZero } //Y轴刻度输出格式
|
|
86
86
|
*/
|
|
87
87
|
|
|
88
88
|
//周期条件枚举
|
|
@@ -224,6 +224,30 @@ JSIndexScript.AddIndex=function(aryIndex) //添加自定义指标
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
//修改指标属性
|
|
228
|
+
JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
|
|
229
|
+
{
|
|
230
|
+
if (!attribute) return;
|
|
231
|
+
|
|
232
|
+
if (attribute.Args) indexInfo.Args=attribute.Args; //外部可以设置参数
|
|
233
|
+
if (IFrameSplitOperator.IsNumber(attribute.FloatPrecision)) indexInfo.FloatPrecision=attribute.FloatPrecision;
|
|
234
|
+
if (IFrameSplitOperator.IsNumber(attribute.StringFormat)) indexInfo.StringFormat=attribute.StringFormat;
|
|
235
|
+
if (IFrameSplitOperator.IsBool(attribute.IsSync)) indexInfo.IsSync=attribute.IsSync;
|
|
236
|
+
if (IFrameSplitOperator.IsBool(attribute.IsShortTitle)) indexInfo.IsShortTitle=attribute.IsShortTitle;
|
|
237
|
+
if (attribute.TitleFont) indexInfo.TitleFont=attribute.TitleFont;
|
|
238
|
+
if (attribute.Lock) indexInfo.Lock=attribute.Lock;
|
|
239
|
+
if (IFrameSplitOperator.IsNumber(attribute.YSplitType)) indexInfo.YSplitType=attribute.YSplitType;
|
|
240
|
+
|
|
241
|
+
if (attribute.YAxis)
|
|
242
|
+
{
|
|
243
|
+
var item=attribute.YAxis;
|
|
244
|
+
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
245
|
+
if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.FloatPrecision;
|
|
246
|
+
if (IFrameSplitOperator.IsNumber(item.StringFormat)) indexInfo.YAxis.StringFormat=item.StringFormat;
|
|
247
|
+
if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
227
251
|
JSIndexScript.prototype.Get=function(id)
|
|
228
252
|
{
|
|
229
253
|
var data=g_CustomIndex.Get(id);
|
|
@@ -4766,7 +4790,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4766
4790
|
}
|
|
4767
4791
|
|
|
4768
4792
|
//创建子窗口的指标
|
|
4769
|
-
|
|
4793
|
+
var scriptData = new JSIndexScript();
|
|
4770
4794
|
|
|
4771
4795
|
if (option.ColorIndex) //五彩K线
|
|
4772
4796
|
{
|
|
@@ -4821,27 +4845,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4821
4845
|
}
|
|
4822
4846
|
else
|
|
4823
4847
|
{
|
|
4848
|
+
var scriptData = new JSIndexScript();
|
|
4824
4849
|
let indexInfo = scriptData.Get(item.Index);
|
|
4825
4850
|
if (!indexInfo) continue;
|
|
4826
|
-
|
|
4827
|
-
if (item.Lock) indexInfo.Lock=item.Lock;
|
|
4851
|
+
JSIndexScript.ModifyAttribute(indexInfo, item);
|
|
4828
4852
|
indexInfo.ID=item.Index;
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
if (item.IsShortTitle) indexInfo.IsShortTitle=item.IsShortTitle;
|
|
4832
|
-
if (item.TitleFont) indexInfo.TitleFont=item.TitleFont;
|
|
4833
|
-
if (IFrameSplitOperator.IsBool(item.IsSync)) indexInfo.IsSync=item.IsSync;
|
|
4834
|
-
chart.WindowIndex[i] = new ScriptIndex(indexInfo.Name, indexInfo.Script, args,indexInfo); //脚本执行
|
|
4853
|
+
|
|
4854
|
+
chart.WindowIndex[i] = new ScriptIndex(indexInfo.Name, indexInfo.Script, indexInfo.Args,indexInfo); //脚本执行
|
|
4835
4855
|
if (item.StringFormat>0) chart.WindowIndex[i].StringFormat=item.StringFormat;
|
|
4836
4856
|
if (item.FloatPrecision>=0) chart.WindowIndex[i].FloatPrecision=item.FloatPrecision;
|
|
4837
|
-
|
|
4838
|
-
if (item.YAxis)
|
|
4839
|
-
{
|
|
4840
|
-
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
4841
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.YAxis.FloatPrecision;
|
|
4842
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=item.YAxis.StringFormat;
|
|
4843
|
-
if (IFrameSplitOperator.IsBool(item.YAxis.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=item.YAxis.EnableRemoveZero;
|
|
4844
|
-
}
|
|
4845
4857
|
}
|
|
4846
4858
|
|
|
4847
4859
|
}
|
|
@@ -5675,7 +5687,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5675
5687
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Windows))
|
|
5676
5688
|
{
|
|
5677
5689
|
//创建子窗口的指标
|
|
5678
|
-
|
|
5690
|
+
|
|
5679
5691
|
for(var i=0;i<option.Windows.length;++i)
|
|
5680
5692
|
{
|
|
5681
5693
|
var item=option.Windows[i];
|
|
@@ -5693,6 +5705,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5693
5705
|
}
|
|
5694
5706
|
else
|
|
5695
5707
|
{
|
|
5708
|
+
var scriptData = new JSIndexScript();
|
|
5696
5709
|
let indexInfo = scriptData.Get(item.Index);
|
|
5697
5710
|
if (!indexInfo) continue;
|
|
5698
5711
|
|
|
@@ -12329,20 +12342,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12329
12342
|
this.RemoveMinSizeWindows(); //清空隐藏的指标
|
|
12330
12343
|
var index=this.AddNewSubFrame(option);
|
|
12331
12344
|
|
|
12332
|
-
|
|
12333
|
-
{
|
|
12334
|
-
if (option.FloatPrecision>=0) indexInfo.FloatPrecision=option.FloatPrecision;
|
|
12335
|
-
if (option.StringFormat>0) indexInfo.StringFormat=option.StringFormat;
|
|
12336
|
-
if (option.Args) indexInfo.Args=option.Args;
|
|
12337
|
-
if (option.Lock) indexInfo.Lock=option.Lock;
|
|
12338
|
-
if (option.YAxis)
|
|
12339
|
-
{
|
|
12340
|
-
indexInfo.YAxis={ };
|
|
12341
|
-
if (IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=option.YAxis.FloatPrecision;
|
|
12342
|
-
if (IFrameSplitOperator.IsNumber(option.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=option.YAxis.StringFormat;
|
|
12343
|
-
if (IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;
|
|
12344
|
-
}
|
|
12345
|
-
}
|
|
12345
|
+
JSIndexScript.ModifyAttribute(indexInfo, option);
|
|
12346
12346
|
|
|
12347
12347
|
this.WindowIndex[index] = new ScriptIndex(indexInfo.Name, indexInfo.Script, indexInfo.Args,indexInfo); //脚本执行
|
|
12348
12348
|
if (this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer")
|
|
@@ -12492,6 +12492,45 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12492
12492
|
return paint.ClearPoint();
|
|
12493
12493
|
}
|
|
12494
12494
|
|
|
12495
|
+
//删除指定窗口的所有叠加指标
|
|
12496
|
+
this.DeleteWindowsOverlayIndex=function(windowIndex)
|
|
12497
|
+
{
|
|
12498
|
+
if (!IFrameSplitOperator.IsNumber(windowIndex)) return;
|
|
12499
|
+
if (windowIndex<0 || windowIndex>=this.Frame.SubFrame.length) return;
|
|
12500
|
+
|
|
12501
|
+
var subFrame=this.Frame.SubFrame[windowIndex];
|
|
12502
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(subFrame.OverlayIndex)) return;
|
|
12503
|
+
|
|
12504
|
+
var aryIndexID=[];
|
|
12505
|
+
for(var i=0; i<subFrame.OverlayIndex.length; ++i)
|
|
12506
|
+
{
|
|
12507
|
+
var overlayItem=subFrame.OverlayIndex[i];
|
|
12508
|
+
aryIndexID.push(overlayItem.Identify);
|
|
12509
|
+
|
|
12510
|
+
for(var j=0;j<overlayItem.ChartPaint.length;++j) //图形销毁事件
|
|
12511
|
+
{
|
|
12512
|
+
var overlayChart=overlayItem.ChartPaint[j];
|
|
12513
|
+
if (overlayChart && overlayChart.OnDestroy) overlayChart.OnDestroy();
|
|
12514
|
+
}
|
|
12515
|
+
|
|
12516
|
+
overlayItem.ChartPaint=[];
|
|
12517
|
+
}
|
|
12518
|
+
|
|
12519
|
+
subFrame.OverlayIndex=[];
|
|
12520
|
+
|
|
12521
|
+
var titlePaint=this.TitlePaint[windowIndex+1];
|
|
12522
|
+
for(var i=0;i<aryIndexID.length;++i)
|
|
12523
|
+
{
|
|
12524
|
+
var identify=aryIndexID[i];
|
|
12525
|
+
|
|
12526
|
+
if (titlePaint.OverlayIndex.has(identify))
|
|
12527
|
+
titlePaint.OverlayIndex.delete(identify);
|
|
12528
|
+
|
|
12529
|
+
if (titlePaint.OverlayDynamicTitle.has(identify))
|
|
12530
|
+
titlePaint.OverlayDynamicTitle.delete(identify);
|
|
12531
|
+
}
|
|
12532
|
+
}
|
|
12533
|
+
|
|
12495
12534
|
//删除叠加指标, 没有重绘
|
|
12496
12535
|
this.DeleteOverlayIndex=function(identify, windowIndex)
|
|
12497
12536
|
{
|
|
@@ -21628,7 +21667,7 @@ function HQTradeFrame()
|
|
|
21628
21667
|
if (IFrameSplitOperator.IsNumber(this.OverlayBlankWidth)) overlayItem.Frame.BlankWidth=this.OverlayBlankWidth;
|
|
21629
21668
|
|
|
21630
21669
|
overlayItem.Frame.Draw();
|
|
21631
|
-
rightOffset+=overlayItem.RightWidth.Width;
|
|
21670
|
+
if (overlayItem.RightWidth) rightOffset+=overlayItem.RightWidth.Width;
|
|
21632
21671
|
if (overlayItem.Frame.IsShow) ++index;
|
|
21633
21672
|
}
|
|
21634
21673
|
}
|
|
@@ -47342,6 +47381,8 @@ function IFrameSplitOperator()
|
|
|
47342
47381
|
{
|
|
47343
47382
|
|
|
47344
47383
|
}
|
|
47384
|
+
|
|
47385
|
+
this.SetOption=function(option) { }
|
|
47345
47386
|
}
|
|
47346
47387
|
|
|
47347
47388
|
//字符串格式化 千分位分割
|
|
@@ -48608,7 +48649,7 @@ function FrameSplitY()
|
|
|
48608
48649
|
this.DefaultSplitType=0;
|
|
48609
48650
|
this.Custom=[]; //[{Type:0}]; 定制刻度
|
|
48610
48651
|
this.DefaultYMaxMin; //{ Max:null, Min:null }; //指定最大,最小, Y轴范围必须比最大值大, 比最小值小
|
|
48611
|
-
this.EnableRemoveZero=
|
|
48652
|
+
this.EnableRemoveZero=g_JSChartResource.Frame.EnableRemoveZero;
|
|
48612
48653
|
this.LineType=null; //线段样式
|
|
48613
48654
|
this.IgnoreYValue = null; //在这个数组里的数字不显示在刻度上
|
|
48614
48655
|
this.FixedYMaxMin; //{ Max, Min} 固定Y轴最大最小值
|
|
@@ -48633,6 +48674,22 @@ function FrameSplitY()
|
|
|
48633
48674
|
return true;
|
|
48634
48675
|
}
|
|
48635
48676
|
|
|
48677
|
+
|
|
48678
|
+
this.Reset=function() //重置
|
|
48679
|
+
{
|
|
48680
|
+
this.EnableRemoveZero=g_JSChartResource.Frame.EnableRemoveZero;
|
|
48681
|
+
this.StringFormat=g_JSChartResource.Frame.StringFormat;
|
|
48682
|
+
}
|
|
48683
|
+
|
|
48684
|
+
this.SetOption=function(option)
|
|
48685
|
+
{
|
|
48686
|
+
if (!option) return;
|
|
48687
|
+
|
|
48688
|
+
if (IFrameSplitOperator.IsNumber(option.FloatPrecision)) this.FloatPrecision=option.FloatPrecision;
|
|
48689
|
+
if (IFrameSplitOperator.IsNumber(option.StringFormat)) this.StringFormat=option.StringFormat;
|
|
48690
|
+
if (IFrameSplitOperator.IsBool(option.EnableRemoveZero)) this.EnableRemoveZero=option.EnableRemoveZero;
|
|
48691
|
+
}
|
|
48692
|
+
|
|
48636
48693
|
this.GetFloatPrecision=function(value,floatPrecision)
|
|
48637
48694
|
{
|
|
48638
48695
|
if (value>this.FLOATPRECISION_RANGE[0]) return floatPrecision;
|
|
@@ -66044,7 +66101,9 @@ function JSChartResource()
|
|
|
66044
66101
|
this.Frame={
|
|
66045
66102
|
XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
|
|
66046
66103
|
YTopOffset:2*GetDevicePixelRatio(), //Y轴顶部文字向下偏移
|
|
66047
|
-
YTextPadding:[2,2]
|
|
66104
|
+
YTextPadding:[2,2],
|
|
66105
|
+
EnableRemoveZero:true, //移除小数点后面的0
|
|
66106
|
+
StringFormat:0
|
|
66048
66107
|
};
|
|
66049
66108
|
this.ToolbarButtonStyle=0;
|
|
66050
66109
|
|
|
@@ -72073,18 +72132,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72073
72132
|
{
|
|
72074
72133
|
if (windowIndex == 0) windowIndex = 1; //幅图指标,不能再主图显示
|
|
72075
72134
|
}
|
|
72076
|
-
|
|
72077
|
-
|
|
72078
|
-
|
|
72079
|
-
if (option.FloatPrecision>=0) indexData.FloatPrecision=option.FloatPrecision;
|
|
72080
|
-
if (option.StringFormat>0) indexData.StringFormat=option.StringFormat;
|
|
72081
|
-
if (option.Args) indexData.Args=option.Args;
|
|
72082
|
-
if (option.TitleFont) indexData.TitleFont=option.TitleFont;
|
|
72083
|
-
if (option.IsShortTitle) indexData.IsShortTitle=option.IsShortTitle;
|
|
72084
|
-
if (option.Lock) indexData.Lock=option.Lock;
|
|
72085
|
-
}
|
|
72086
|
-
|
|
72087
|
-
return this.ChangeScriptIndex(windowIndex, indexData,option);
|
|
72135
|
+
|
|
72136
|
+
JSIndexScript.ModifyAttribute(indexInfo, option)
|
|
72137
|
+
return this.ChangeScriptIndex(windowIndex, indexInfo, option);
|
|
72088
72138
|
}
|
|
72089
72139
|
|
|
72090
72140
|
//主图指标
|
|
@@ -72230,18 +72280,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72230
72280
|
}
|
|
72231
72281
|
else if (indexInfo)
|
|
72232
72282
|
{
|
|
72233
|
-
|
|
72234
|
-
if (IFrameSplitOperator.IsNumber(obj.FloatPrecision)) indexInfo.FloatPrecision=obj.FloatPrecision;
|
|
72235
|
-
if (IFrameSplitOperator.IsNumber(obj.StringFormat)) indexInfo.StringFormat=obj.StringFormat;
|
|
72236
|
-
if (IFrameSplitOperator.IsBool(obj.IsSync)) indexInfo.IsSync=obj.IsSync;
|
|
72237
|
-
if (obj.YAxis)
|
|
72238
|
-
{
|
|
72239
|
-
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
72240
|
-
if (IFrameSplitOperator.IsNumber(obj.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=obj.YAxis.FloatPrecision;
|
|
72241
|
-
if (IFrameSplitOperator.IsNumber(obj.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=obj.YAxis.StringFormat;
|
|
72242
|
-
if (IFrameSplitOperator.IsBool(obj.YAxis.EnableRemoveZero)) indexInfo.YAxis.EnableRemoveZero=obj.YAxis.EnableRemoveZero;
|
|
72243
|
-
}
|
|
72244
|
-
|
|
72283
|
+
JSIndexScript.ModifyAttribute(indexInfo, obj);
|
|
72245
72284
|
var scriptIndex=new OverlayScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
72246
72285
|
scriptIndex.OverlayIndex={ IsOverlay:true, Identify:overlayFrame.Identify, WindowIndex:windowIndex, Frame:overlayFrame }; //叠加指标信息
|
|
72247
72286
|
overlayFrame.Script=scriptIndex;
|
|
@@ -72525,14 +72564,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72525
72564
|
if (count<=0) return;
|
|
72526
72565
|
var currentLength=this.Frame.SubFrame.length;
|
|
72527
72566
|
|
|
72528
|
-
var period=null, right=null;
|
|
72567
|
+
var period=null, right=null, symbol=null;
|
|
72568
|
+
if (option.Symbol) symbol=option.Symbol;
|
|
72529
72569
|
if (option.KLine)
|
|
72530
72570
|
{
|
|
72531
72571
|
if (IFrameSplitOperator.IsNumber(option.KLine.Period) && option.KLine.Period!=this.Period) period=option.KLine.Period; //周期
|
|
72532
72572
|
if (IFrameSplitOperator.IsNumber(option.KLine.Right) && option.KLine.Right!=this.Right) right=option.KLine.Right; //复权
|
|
72533
72573
|
}
|
|
72534
72574
|
|
|
72535
|
-
var bRefreshData= (period!=null || right!=null);
|
|
72575
|
+
var bRefreshData= (period!=null || right!=null || symbol!=null);
|
|
72536
72576
|
|
|
72537
72577
|
//清空所有的指标图型
|
|
72538
72578
|
for(var i=0;i<currentLength;++i)
|
|
@@ -72560,6 +72600,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72560
72600
|
|
|
72561
72601
|
this.Frame.SubFrame.splice(count,currentLength-count);
|
|
72562
72602
|
this.WindowIndex.splice(count,currentLength-count);
|
|
72603
|
+
this.TitlePaint.splice(count+1,currentLength-count);
|
|
72563
72604
|
}
|
|
72564
72605
|
else
|
|
72565
72606
|
{
|
|
@@ -72576,8 +72617,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72576
72617
|
this.TitlePaint[i+1]=titlePaint;
|
|
72577
72618
|
}
|
|
72578
72619
|
}
|
|
72579
|
-
|
|
72580
|
-
var systemScript = new JSIndexScript();
|
|
72620
|
+
|
|
72581
72621
|
for(var i=0;i<count;++i)
|
|
72582
72622
|
{
|
|
72583
72623
|
var windowIndex=i;
|
|
@@ -72587,7 +72627,10 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72587
72627
|
var titleIndex=windowIndex+1;
|
|
72588
72628
|
this.TitlePaint[titleIndex].Data=[];
|
|
72589
72629
|
this.TitlePaint[titleIndex].Title=null;
|
|
72630
|
+
var frame=this.Frame.SubFrame[i];
|
|
72590
72631
|
|
|
72632
|
+
this.DeleteWindowsOverlayIndex(i); //清空叠加指标
|
|
72633
|
+
|
|
72591
72634
|
if (item.Script) //自定义指标脚本
|
|
72592
72635
|
{
|
|
72593
72636
|
this.WindowIndex[i]=new ScriptIndex(item.Name,item.Script,item.Args,item); //脚本执行
|
|
@@ -72608,28 +72651,17 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72608
72651
|
}
|
|
72609
72652
|
else
|
|
72610
72653
|
{
|
|
72654
|
+
var systemScript = new JSIndexScript();
|
|
72611
72655
|
var indexInfo = systemScript.Get(indexID);
|
|
72612
72656
|
if (indexInfo)
|
|
72613
72657
|
{
|
|
72614
|
-
|
|
72615
|
-
|
|
72616
|
-
if (item.TitleFont) indexInfo.TitleFont=item.TitleFont;
|
|
72617
|
-
if (item.IsShortTitle) indexInfo.IsShortTitle=item.IsShortTitle;
|
|
72618
|
-
if (IFrameSplitOperator.IsBool(item.IsSync)) indexInfo.IsSync=item.IsSync;
|
|
72619
|
-
|
|
72620
|
-
if (item.YAxis)
|
|
72621
|
-
{
|
|
72622
|
-
if (!indexInfo.YAxis) indexInfo.YAxis={ };
|
|
72623
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.FloatPrecision)) indexInfo.YAxis.FloatPrecision=item.YAxis.FloatPrecision;
|
|
72624
|
-
if (IFrameSplitOperator.IsNumber(item.YAxis.StringFormat)) indexInfo.YAxis.StringFormat=item.YAxis.StringFormat;
|
|
72625
|
-
}
|
|
72626
|
-
|
|
72627
|
-
this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,args,indexInfo); //脚本执行
|
|
72658
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
72659
|
+
this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
72628
72660
|
}
|
|
72629
72661
|
}
|
|
72630
72662
|
}
|
|
72631
72663
|
|
|
72632
|
-
this.SetSubFrameAttribute(
|
|
72664
|
+
this.SetSubFrameAttribute(frame, item, frameItem);
|
|
72633
72665
|
}
|
|
72634
72666
|
|
|
72635
72667
|
//最后一个显示X轴坐标
|
|
@@ -72640,6 +72672,23 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72640
72672
|
else item.XSplitOperator.ShowText=false;
|
|
72641
72673
|
}
|
|
72642
72674
|
|
|
72675
|
+
//叠加指标
|
|
72676
|
+
var aryOverlayIndex=[];
|
|
72677
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
|
|
72678
|
+
{
|
|
72679
|
+
for(var i=0;i<option.OverlayIndex.length;++i)
|
|
72680
|
+
{
|
|
72681
|
+
var item=option.OverlayIndex[i];
|
|
72682
|
+
if (item.Index) item.IndexName=item.Index;
|
|
72683
|
+
if (item.Windows>=0) item.WindowIndex=item.Windows;
|
|
72684
|
+
|
|
72685
|
+
var overlay=this.CreateOverlayWindowsIndex(item);
|
|
72686
|
+
if (!overlay) continue;
|
|
72687
|
+
|
|
72688
|
+
aryOverlayIndex.push(overlay);
|
|
72689
|
+
}
|
|
72690
|
+
}
|
|
72691
|
+
|
|
72643
72692
|
if (!bRefreshData)
|
|
72644
72693
|
{
|
|
72645
72694
|
var bindData=this.ChartPaint[0].Data;
|
|
@@ -72648,6 +72697,12 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72648
72697
|
this.BindIndexData(i,bindData);
|
|
72649
72698
|
}
|
|
72650
72699
|
|
|
72700
|
+
for(var i=0;i<aryOverlayIndex.length;++i)
|
|
72701
|
+
{
|
|
72702
|
+
var item=aryOverlayIndex[i];
|
|
72703
|
+
this.BindOverlayIndexData(item,item.WindowIndex,bindData);
|
|
72704
|
+
}
|
|
72705
|
+
|
|
72651
72706
|
this.UpdataDataoffset(); //更新数据偏移
|
|
72652
72707
|
this.Frame.SetSizeChage(true);
|
|
72653
72708
|
this.ResetFrameXYSplit();
|
|
@@ -72656,9 +72711,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72656
72711
|
}
|
|
72657
72712
|
else
|
|
72658
72713
|
{
|
|
72659
|
-
|
|
72660
|
-
|
|
72661
|
-
|
|
72714
|
+
if (!symbol) symbol=this.Symbol;
|
|
72715
|
+
|
|
72716
|
+
var optionData={ KLine:{} };
|
|
72717
|
+
if (IFrameSplitOperator.IsNumber(period)) optionData.KLine.Period=period;
|
|
72718
|
+
if (IFrameSplitOperator.IsNumber(right)) optionData.KLine.Right=right;
|
|
72719
|
+
|
|
72720
|
+
this.ChangeSymbol(symbol, optionData);
|
|
72662
72721
|
}
|
|
72663
72722
|
}
|
|
72664
72723
|
|
|
@@ -73103,11 +73162,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73103
73162
|
|
|
73104
73163
|
if (option)
|
|
73105
73164
|
{
|
|
73106
|
-
if (
|
|
73165
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.Windows))
|
|
73107
73166
|
{
|
|
73108
73167
|
var windows=option.Windows;
|
|
73109
|
-
|
|
73110
|
-
for(var i
|
|
73168
|
+
|
|
73169
|
+
for(var i=0; i<windows.length; ++i)
|
|
73111
73170
|
{
|
|
73112
73171
|
if (i>=this.WindowIndex.length) break; //暂时不支持 动态增加/减少
|
|
73113
73172
|
var item=windows[i];
|
|
@@ -73125,11 +73184,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73125
73184
|
else
|
|
73126
73185
|
{
|
|
73127
73186
|
var indexID=item.Index;
|
|
73187
|
+
var systemScript = new JSIndexScript();
|
|
73128
73188
|
var indexInfo = systemScript.Get(indexID);
|
|
73129
73189
|
if (indexInfo)
|
|
73130
73190
|
{
|
|
73131
|
-
|
|
73132
|
-
if (item.Args) indexInfo.Args=item.Args;
|
|
73191
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
73133
73192
|
indexInfo.ID=indexID;
|
|
73134
73193
|
this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
73135
73194
|
}
|
|
@@ -77878,25 +77937,9 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
77878
77937
|
if (windowIndex<2) windowIndex=2;
|
|
77879
77938
|
if (windowIndex>=this.Frame.SubFrame.length) windowIndex=2;
|
|
77880
77939
|
|
|
77881
|
-
|
|
77882
|
-
{
|
|
77883
|
-
Name:indexInfo.Name, Script:indexInfo.Script, Args: indexInfo.Args, ID:indexName ,
|
|
77884
|
-
//扩展属性 可以是空
|
|
77885
|
-
KLineType:indexInfo.KLineType, YSpecificMaxMin:indexInfo.YSpecificMaxMin, YSplitScale:indexInfo.YSplitScale,
|
|
77886
|
-
FloatPrecision:indexInfo.FloatPrecision, Condition:indexInfo.Condition,StringFormat:indexInfo.StringFormat,
|
|
77887
|
-
OutName:indexInfo.OutName
|
|
77888
|
-
};
|
|
77940
|
+
JSIndexScript.ModifyAttribute(indexInfo, option)
|
|
77889
77941
|
|
|
77890
|
-
|
|
77891
|
-
{
|
|
77892
|
-
if (option.FloatPrecision>=0) indexData.FloatPrecision=option.FloatPrecision;
|
|
77893
|
-
if (option.StringFormat>0) indexData.StringFormat=option.StringFormat;
|
|
77894
|
-
if (option.Args) indexData.Args=option.Args;
|
|
77895
|
-
if (IFrameSplitOperator.IsNumber(option.YSplitType)) indexData.YSplitType=option.YSplitType;
|
|
77896
|
-
if (option.Lock) indexData.Lock=option.Lock;
|
|
77897
|
-
}
|
|
77898
|
-
|
|
77899
|
-
return this.ChangeScriptIndex(windowIndex, indexData,option);
|
|
77942
|
+
return this.ChangeScriptIndex(windowIndex, indexInfo, option);
|
|
77900
77943
|
}
|
|
77901
77944
|
|
|
77902
77945
|
//设置指标窗口个数
|
|
@@ -78027,7 +78070,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78027
78070
|
}
|
|
78028
78071
|
}
|
|
78029
78072
|
|
|
78030
|
-
|
|
78073
|
+
|
|
78031
78074
|
|
|
78032
78075
|
for(var i=0;i<count;++i)
|
|
78033
78076
|
{
|
|
@@ -78062,22 +78105,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78062
78105
|
}
|
|
78063
78106
|
else
|
|
78064
78107
|
{
|
|
78108
|
+
var systemScript = new JSIndexScript();
|
|
78065
78109
|
var indexInfo = systemScript.Get(indexID);
|
|
78066
78110
|
if (indexInfo)
|
|
78067
78111
|
{
|
|
78068
|
-
|
|
78069
|
-
|
|
78070
|
-
let indexData =
|
|
78071
|
-
{
|
|
78072
|
-
Name:indexInfo.Name, Script:indexInfo.Script, Args: args, ID:indexID ,
|
|
78073
|
-
//扩展属性 可以是空
|
|
78074
|
-
KLineType:indexInfo.KLineType, YSpecificMaxMin:indexInfo.YSpecificMaxMin, YSplitScale:indexInfo.YSplitScale,
|
|
78075
|
-
FloatPrecision:indexInfo.FloatPrecision, Condition:indexInfo.Condition,
|
|
78076
|
-
OutName:indexInfo.OutName
|
|
78077
|
-
};
|
|
78078
|
-
if (item.TitleFont) indexData.TitleFont=item.TitleFont;
|
|
78079
|
-
|
|
78080
|
-
this.WindowIndex[windowIndex]=new ScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
|
|
78112
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
78113
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
78081
78114
|
}
|
|
78082
78115
|
}
|
|
78083
78116
|
}
|
|
@@ -78275,7 +78308,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78275
78308
|
|
|
78276
78309
|
if (IFrameSplitOperator.IsNonEmptyArray(option.Windows)) //切换指标
|
|
78277
78310
|
{
|
|
78278
|
-
|
|
78311
|
+
|
|
78279
78312
|
for(var i=0; i<option.Windows.length; ++i)
|
|
78280
78313
|
{
|
|
78281
78314
|
var index=2+i;
|
|
@@ -78295,12 +78328,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
78295
78328
|
}
|
|
78296
78329
|
else
|
|
78297
78330
|
{
|
|
78331
|
+
var systemScript = new JSIndexScript();
|
|
78298
78332
|
var indexID=item.Index;
|
|
78299
78333
|
var indexInfo = systemScript.Get(indexID);
|
|
78300
78334
|
if (indexInfo)
|
|
78301
78335
|
{
|
|
78302
|
-
|
|
78303
|
-
if (item.Args) indexInfo.Args=item.Args;
|
|
78336
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
78304
78337
|
indexInfo.ID=indexID;
|
|
78305
78338
|
this.WindowIndex[index]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
78306
78339
|
}
|
|
@@ -114201,13 +114234,13 @@ function ScriptIndex(name,script,args,option)
|
|
|
114201
114234
|
{
|
|
114202
114235
|
//Y轴刻度格式 默认跟标题栏一致
|
|
114203
114236
|
var ySpliter=hqChart.Frame.SubFrame[windowIndex].Frame.YSplitOperator;
|
|
114204
|
-
ySpliter
|
|
114205
|
-
if (this.YAxis)
|
|
114237
|
+
if (ySpliter)
|
|
114206
114238
|
{
|
|
114207
|
-
|
|
114208
|
-
|
|
114239
|
+
ySpliter.Reset();
|
|
114240
|
+
ySpliter.FloatPrecision=this.FloatPrecision;
|
|
114241
|
+
if (this.YAxis) ySpliter.SetOption(this.YAxis);
|
|
114209
114242
|
}
|
|
114210
|
-
|
|
114243
|
+
|
|
114211
114244
|
if (this.YSpecificMaxMin) hqChart.Frame.SubFrame[windowIndex].Frame.YSpecificMaxMin=this.YSpecificMaxMin; //最大最小值
|
|
114212
114245
|
if (this.YSplitScale) hqChart.Frame.SubFrame[windowIndex].Frame.YSplitScale=this.YSplitScale; //固定刻度
|
|
114213
114246
|
}
|
|
@@ -114580,14 +114613,12 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
114580
114613
|
|
|
114581
114614
|
//修改Y轴分割方式
|
|
114582
114615
|
var ySpliter=this.OverlayIndex.Frame.Frame.YSplitOperator;
|
|
114583
|
-
if (
|
|
114584
|
-
ySpliter.FloatPrecision=this.FloatPrecision;
|
|
114585
|
-
ySpliter.EnableRemoveZero=true;
|
|
114586
|
-
if (this.YAxis)
|
|
114616
|
+
if (ySpliter)
|
|
114587
114617
|
{
|
|
114588
|
-
|
|
114589
|
-
|
|
114590
|
-
if (IFrameSplitOperator.
|
|
114618
|
+
ySpliter.Reset();
|
|
114619
|
+
ySpliter.FloatPrecision=this.FloatPrecision;
|
|
114620
|
+
if (IFrameSplitOperator.IsNumber(this.YSplitType)) ySpliter.SplitType=this.YSplitType;
|
|
114621
|
+
if (this.YAxis) ySpliter.SetOption(this.YAxis);
|
|
114591
114622
|
}
|
|
114592
114623
|
|
|
114593
114624
|
//指标名字
|
|
@@ -129483,7 +129514,7 @@ function HQChartScriptWorker()
|
|
|
129483
129514
|
|
|
129484
129515
|
|
|
129485
129516
|
|
|
129486
|
-
var HQCHART_VERSION="1.1.
|
|
129517
|
+
var HQCHART_VERSION="1.1.12938";
|
|
129487
129518
|
|
|
129488
129519
|
function PrintHQChartVersion()
|
|
129489
129520
|
{
|