hqchart 1.1.14670 → 1.1.14683
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 +36 -29
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +25 -11
- package/src/jscommon/umychart.complier.js +41 -14
- package/src/jscommon/umychart.js +137 -68
- package/src/jscommon/umychart.testdata.js +25 -11
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +179 -83
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +25 -11
- package/src/jscommon/umychart.vue/umychart.vue.js +179 -83
|
@@ -7564,7 +7564,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7564
7564
|
|
|
7565
7565
|
this.DestroyDialogModifyIndexParam=function()
|
|
7566
7566
|
{
|
|
7567
|
-
if (this.DialogModifyIndexParam) return;
|
|
7567
|
+
if (!this.DialogModifyIndexParam) return;
|
|
7568
7568
|
|
|
7569
7569
|
this.DialogModifyIndexParam.Destroy();
|
|
7570
7570
|
this.DialogModifyIndexParam=null;
|
|
@@ -15898,7 +15898,7 @@ function CoordinateInfo()
|
|
|
15898
15898
|
//不在当前屏范围 (可定义刻度使用)
|
|
15899
15899
|
//this.OutRange={ BGColor:"", TextColor:, BorderColor: TopYOffset:, BottomYOffset: }
|
|
15900
15900
|
//Y轴文字偏移
|
|
15901
|
-
//this.YOffset=[{ Offset:5}, { Offset:10}] //目前只对框子外的刻度文字生效
|
|
15901
|
+
//this.YOffset=[{ Offset:5}, { Offset:10} ] //目前只对框子外的刻度文字生效 0=外左 1=外右 2=内左 3=内右
|
|
15902
15902
|
}
|
|
15903
15903
|
|
|
15904
15904
|
|
|
@@ -17608,10 +17608,18 @@ function AverageWidthFrame()
|
|
|
17608
17608
|
this.Canvas.textBaseline = "middle";
|
|
17609
17609
|
}
|
|
17610
17610
|
|
|
17611
|
-
var
|
|
17611
|
+
var yOffset=0;
|
|
17612
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.YOffset)) //文字Y轴偏移
|
|
17613
|
+
{
|
|
17614
|
+
var offsetItem=item.YOffset[2];
|
|
17615
|
+
if (offsetItem && IFrameSplitOperator.IsNumber(offsetItem.Offset))
|
|
17616
|
+
yOffset=offsetItem.Offset;
|
|
17617
|
+
}
|
|
17618
|
+
|
|
17619
|
+
var textObj={ X:left, Y:yText+yOffset, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[0]}} ;
|
|
17612
17620
|
if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj))
|
|
17613
17621
|
{
|
|
17614
|
-
this.Canvas.fillText(item.Message[2], left + 1*pixelTatio, yText);
|
|
17622
|
+
this.Canvas.fillText(item.Message[2], left + 1*pixelTatio, yText+yOffset);
|
|
17615
17623
|
if (yInsideText==null || yInsideText>yText)
|
|
17616
17624
|
{
|
|
17617
17625
|
this.YInsideOffset=this.Canvas.measureText(item.Message[2]).width+4*GetDevicePixelRatio();
|
|
@@ -17640,10 +17648,19 @@ function AverageWidthFrame()
|
|
|
17640
17648
|
{
|
|
17641
17649
|
this.Canvas.textBaseline = "middle";
|
|
17642
17650
|
}
|
|
17651
|
+
|
|
17652
|
+
var yOffset=0;
|
|
17653
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.YOffset)) //文字Y轴偏移
|
|
17654
|
+
{
|
|
17655
|
+
var offsetItem=item.YOffset[3];
|
|
17656
|
+
if (offsetItem && IFrameSplitOperator.IsNumber(offsetItem.Offset))
|
|
17657
|
+
yOffset=offsetItem.Offset;
|
|
17658
|
+
}
|
|
17659
|
+
|
|
17643
17660
|
var textWidth = this.Canvas.measureText(item.Message[3]).width;
|
|
17644
|
-
var textObj={ X:right-textWidth, Y:yText, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ;
|
|
17661
|
+
var textObj={ X:right-textWidth, Y:yText+yOffset, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ;
|
|
17645
17662
|
if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj))
|
|
17646
|
-
this.Canvas.fillText(item.Message[3], right - 1*pixelTatio, yText);
|
|
17663
|
+
this.Canvas.fillText(item.Message[3], right - 1*pixelTatio, yText+yOffset);
|
|
17647
17664
|
}
|
|
17648
17665
|
yPrev = y;
|
|
17649
17666
|
}
|
|
@@ -17706,10 +17723,18 @@ function AverageWidthFrame()
|
|
|
17706
17723
|
else this.Canvas.textBaseline = "middle";
|
|
17707
17724
|
}
|
|
17708
17725
|
|
|
17709
|
-
var
|
|
17726
|
+
var yOffset=0;
|
|
17727
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.YOffset)) //文字Y轴偏移
|
|
17728
|
+
{
|
|
17729
|
+
var offsetItem=item.YOffset[0];
|
|
17730
|
+
if (offsetItem && IFrameSplitOperator.IsNumber(offsetItem.Offset))
|
|
17731
|
+
yOffset=offsetItem.Offset;
|
|
17732
|
+
}
|
|
17733
|
+
|
|
17734
|
+
var textObj={ X:left, Y:yText+yOffset, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[0]}} ;
|
|
17710
17735
|
if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj))
|
|
17711
17736
|
{
|
|
17712
|
-
this.Canvas.fillText(item.Message[0], left + 1*pixelTatio, yText);
|
|
17737
|
+
this.Canvas.fillText(item.Message[0], left + 1*pixelTatio, yText+yOffset);
|
|
17713
17738
|
if (yInsideText==null || yInsideText>yText)
|
|
17714
17739
|
{
|
|
17715
17740
|
this.YInsideOffset=this.Canvas.measureText(item.Message[0]).width+4*GetDevicePixelRatio();
|
|
@@ -17744,10 +17769,18 @@ function AverageWidthFrame()
|
|
|
17744
17769
|
if (Array.isArray(item.Message[1])) var text=item.Message[1][0];
|
|
17745
17770
|
else var text=item.Message[1];
|
|
17746
17771
|
|
|
17772
|
+
var yOffset=0;
|
|
17773
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.YOffset)) //文字Y轴偏移
|
|
17774
|
+
{
|
|
17775
|
+
var offsetItem=item.YOffset[1];
|
|
17776
|
+
if (offsetItem && IFrameSplitOperator.IsNumber(offsetItem.Offset))
|
|
17777
|
+
yOffset=offsetItem.Offset;
|
|
17778
|
+
}
|
|
17779
|
+
|
|
17747
17780
|
var textWidth = this.Canvas.measureText(text).width;
|
|
17748
|
-
var textObj={ X:right-textWidth, Y:yText, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ;
|
|
17781
|
+
var textObj={ X:right-textWidth, Y:yText+yOffset, Text:{ BaseLine:this.Canvas.textBaseline, TextAlign: this.Canvas.textAlign, Font:this.Canvas.font, Value:item.Message[1]}} ;
|
|
17749
17782
|
if (!this.IsOverlayMaxMin || !this.IsOverlayMaxMin(textObj))
|
|
17750
|
-
this.Canvas.fillText(text, right - 1*pixelTatio, yText);
|
|
17783
|
+
this.Canvas.fillText(text, right - 1*pixelTatio, yText+yOffset);
|
|
17751
17784
|
}
|
|
17752
17785
|
yPrev = y;
|
|
17753
17786
|
}
|
|
@@ -29752,7 +29785,7 @@ function IChartPainting()
|
|
|
29752
29785
|
if (isHScreen==true)
|
|
29753
29786
|
{
|
|
29754
29787
|
var left=this.ChartBorder.GetLeftEx();
|
|
29755
|
-
var right=this.ChartBorder.GetRightEx();
|
|
29788
|
+
var right=this.ChartBorder.GetRightEx()+1;
|
|
29756
29789
|
var top=this.ChartBorder.GetTop();
|
|
29757
29790
|
var bottom=this.ChartBorder.GetBottom();
|
|
29758
29791
|
}
|
|
@@ -29760,7 +29793,7 @@ function IChartPainting()
|
|
|
29760
29793
|
{
|
|
29761
29794
|
var left=this.ChartBorder.GetLeft();
|
|
29762
29795
|
var right=this.ChartBorder.GetRight();
|
|
29763
|
-
var top=this.ChartBorder.GetTopEx();
|
|
29796
|
+
var top=this.ChartBorder.GetTopEx()-1;
|
|
29764
29797
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
29765
29798
|
}
|
|
29766
29799
|
|
|
@@ -30695,7 +30728,8 @@ function ChartKLine()
|
|
|
30695
30728
|
this.DaySummaryConfig=
|
|
30696
30729
|
{
|
|
30697
30730
|
Font: g_JSChartResource.DaySummaryKLine.Font,
|
|
30698
|
-
TextColor: g_JSChartResource.DaySummaryKLine.TextColor
|
|
30731
|
+
TextColor: g_JSChartResource.DaySummaryKLine.TextColor,
|
|
30732
|
+
LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
|
|
30699
30733
|
}
|
|
30700
30734
|
|
|
30701
30735
|
this.AddToDaySummary=function(kItem)
|
|
@@ -30777,7 +30811,8 @@ function ChartKLine()
|
|
|
30777
30811
|
this.DaySummaryConfig=
|
|
30778
30812
|
{
|
|
30779
30813
|
Font: g_JSChartResource.DaySummaryKLine.Font,
|
|
30780
|
-
TextColor: g_JSChartResource.DaySummaryKLine.TextColor
|
|
30814
|
+
TextColor: g_JSChartResource.DaySummaryKLine.TextColor,
|
|
30815
|
+
LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
|
|
30781
30816
|
}
|
|
30782
30817
|
|
|
30783
30818
|
}
|
|
@@ -30881,6 +30916,7 @@ function ChartKLine()
|
|
|
30881
30916
|
var yOpen=this.GetYFromData(data.Open,false);
|
|
30882
30917
|
var yClose=this.GetYFromData(data.Close,false);
|
|
30883
30918
|
this.DrawKRange.End=i;
|
|
30919
|
+
this.AddToDaySummary(data);
|
|
30884
30920
|
|
|
30885
30921
|
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yOpen, Left:left, Right:right }};
|
|
30886
30922
|
|
|
@@ -31164,6 +31200,7 @@ function ChartKLine()
|
|
|
31164
31200
|
var x=left+(right-left)/2;
|
|
31165
31201
|
var yClose=this.GetYFromData(data.Close,false);
|
|
31166
31202
|
this.DrawKRange.End=i;
|
|
31203
|
+
this.AddToDaySummary(data);
|
|
31167
31204
|
|
|
31168
31205
|
if (data.IsVirtual && this.PredictionConfig.Enable) //预测数据|虚拟数据
|
|
31169
31206
|
{
|
|
@@ -31307,6 +31344,7 @@ function ChartKLine()
|
|
|
31307
31344
|
var x=left+(right-left)/2;
|
|
31308
31345
|
var yClose=this.GetYFromData(data.Close,false);
|
|
31309
31346
|
this.DrawKRange.End=i;
|
|
31347
|
+
this.AddToDaySummary(data);
|
|
31310
31348
|
|
|
31311
31349
|
if (data.IsVirtual && this.PredictionConfig.Enable) //预测数据|虚拟数据
|
|
31312
31350
|
{
|
|
@@ -31411,7 +31449,7 @@ function ChartKLine()
|
|
|
31411
31449
|
this.ShowRange.End=i;
|
|
31412
31450
|
if (!data || data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
|
|
31413
31451
|
|
|
31414
|
-
|
|
31452
|
+
|
|
31415
31453
|
|
|
31416
31454
|
var left=xOffset;
|
|
31417
31455
|
var right=xOffset+dataWidth;
|
|
@@ -31425,6 +31463,7 @@ function ChartKLine()
|
|
|
31425
31463
|
|
|
31426
31464
|
var kItemInfo={ Data:data, Coordinate:{ X:x, Low:yLow, High:yHigh, Close:yClose, Open:yOpen, Left:left, Right:right }};
|
|
31427
31465
|
|
|
31466
|
+
this.AddToDaySummary(data);
|
|
31428
31467
|
this.DrawKRange.End=i;
|
|
31429
31468
|
if (ptMax.Value==null || ptMax.Value<data.High) //求最大值
|
|
31430
31469
|
{
|
|
@@ -35731,7 +35770,7 @@ function ChartKLine()
|
|
|
35731
35770
|
this.Canvas.textBaseline = 'bottom';
|
|
35732
35771
|
|
|
35733
35772
|
var border=this.ChartBorder.GetBorder();
|
|
35734
|
-
var xText=border.Left+
|
|
35773
|
+
var xText=border.Left+this.DaySummaryConfig.LeftMargin;
|
|
35735
35774
|
var yText=border.Bottom;
|
|
35736
35775
|
|
|
35737
35776
|
var textSize=GetTextSize(this.Canvas,text);
|
|
@@ -39033,6 +39072,32 @@ function ChartIndexTitle()
|
|
|
39033
39072
|
delete this.newMethod;
|
|
39034
39073
|
|
|
39035
39074
|
this.ClassName='ChartIndexTitle'; //类名
|
|
39075
|
+
this.AryTitle=[]; //{ Date, Time, AryText:[ ] }
|
|
39076
|
+
this.MapCache=null; //key=date/date-time value={ Data:[] }
|
|
39077
|
+
|
|
39078
|
+
this.BuildCacheData=function()
|
|
39079
|
+
{
|
|
39080
|
+
var mapData=new Map();
|
|
39081
|
+
this.MapCache=mapData;
|
|
39082
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryTitle)) return;
|
|
39083
|
+
|
|
39084
|
+
for(var i=0;i<this.AryTitle.length;++i)
|
|
39085
|
+
{
|
|
39086
|
+
var item=this.AryTitle[i];
|
|
39087
|
+
var key=this.BuildKey(item);
|
|
39088
|
+
|
|
39089
|
+
mapData.set(key,{ Data:item });
|
|
39090
|
+
}
|
|
39091
|
+
}
|
|
39092
|
+
|
|
39093
|
+
this.GetItem=function(kItem)
|
|
39094
|
+
{
|
|
39095
|
+
if (!this.MapCache || this.MapCache.size<=0) return null;
|
|
39096
|
+
var key=this.BuildKey(kItem);
|
|
39097
|
+
if (!this.MapCache.has(key)) return null;
|
|
39098
|
+
|
|
39099
|
+
return this.MapCache.get(key);
|
|
39100
|
+
}
|
|
39036
39101
|
|
|
39037
39102
|
this.Draw=function()
|
|
39038
39103
|
{
|
|
@@ -59925,44 +59990,39 @@ function ChartCorssCursor()
|
|
|
59925
59990
|
var textSize={ Width:textWidth+4, Height:this.TextHeight, Text:[] };
|
|
59926
59991
|
var buttonData={Y:y, YValue:yValue, FrameID:yValueExtend.FrameID };
|
|
59927
59992
|
|
|
59928
|
-
|
|
59993
|
+
var margin=this.LeftConfig.Margin;
|
|
59994
|
+
var textOffset=this.LeftConfig.TextOffset;
|
|
59995
|
+
var rtBG=null;
|
|
59996
|
+
if (this.Frame.ChartBorder.Left>=30 && this.ShowTextMode.Left==1) //左边
|
|
59929
59997
|
{
|
|
59930
|
-
var margin
|
|
59931
|
-
|
|
59932
|
-
|
|
59933
|
-
|
|
59934
|
-
if (this.ShowTextMode.Left==1)
|
|
59935
|
-
{
|
|
59936
|
-
var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
|
|
59937
|
-
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
59938
|
-
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
59939
|
-
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59998
|
+
var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
|
|
59999
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
60000
|
+
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
60001
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59940
60002
|
|
|
59941
|
-
|
|
59942
|
-
{
|
|
59943
|
-
rtBG.Left=0;
|
|
59944
|
-
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
59945
|
-
}
|
|
59946
|
-
}
|
|
59947
|
-
else if (this.ShowTextMode.Left==2) //在框架内显示
|
|
60003
|
+
if (rtBG.Left<0)
|
|
59948
60004
|
{
|
|
59949
|
-
|
|
60005
|
+
rtBG.Left=0;
|
|
59950
60006
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
59951
|
-
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
59952
|
-
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59953
|
-
}
|
|
59954
|
-
|
|
59955
|
-
if (rtBG)
|
|
59956
|
-
{
|
|
59957
|
-
this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
59958
|
-
this.Canvas.textAlign="left";
|
|
59959
|
-
this.Canvas.textBaseline="bottom";
|
|
59960
|
-
this.Canvas.fillStyle=this.TextColor;
|
|
59961
|
-
this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
|
|
59962
60007
|
}
|
|
60008
|
+
|
|
60009
|
+
}
|
|
60010
|
+
else if (this.ShowTextMode.Left==2) //在框架内显示
|
|
60011
|
+
{
|
|
60012
|
+
var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
|
|
60013
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60014
|
+
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
60015
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59963
60016
|
}
|
|
59964
60017
|
|
|
59965
|
-
|
|
60018
|
+
if (rtBG)
|
|
60019
|
+
{
|
|
60020
|
+
this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
|
|
60021
|
+
this.Canvas.textAlign="left";
|
|
60022
|
+
this.Canvas.textBaseline="bottom";
|
|
60023
|
+
this.Canvas.fillStyle=this.TextColor;
|
|
60024
|
+
this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
|
|
60025
|
+
}
|
|
59966
60026
|
|
|
59967
60027
|
var complexText=
|
|
59968
60028
|
{
|
|
@@ -60152,7 +60212,7 @@ function ChartCorssCursor()
|
|
|
60152
60212
|
this.Canvas.textBaseline="bottom";
|
|
60153
60213
|
this.Canvas.fillStyle=this.TextColor;
|
|
60154
60214
|
this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
|
|
60155
|
-
|
|
60215
|
+
}
|
|
60156
60216
|
}
|
|
60157
60217
|
|
|
60158
60218
|
//子坐标Y轴
|
|
@@ -64127,33 +64187,40 @@ function DynamicChartTitlePainting()
|
|
|
64127
64187
|
return aryText;
|
|
64128
64188
|
}
|
|
64129
64189
|
|
|
64130
|
-
this.FormatIndexTitle=function(
|
|
64190
|
+
this.FormatIndexTitle=function(kItem, dataInfo)
|
|
64131
64191
|
{
|
|
64132
|
-
|
|
64192
|
+
var result=null;
|
|
64193
|
+
var aryText=[];
|
|
64194
|
+
if (dataInfo.Name)
|
|
64195
|
+
{
|
|
64196
|
+
aryText.push({ Text:dataInfo.Name, Color:dataInfo.Color});
|
|
64197
|
+
result={ Text:null, ArrayText:aryText };
|
|
64198
|
+
}
|
|
64133
64199
|
|
|
64134
|
-
if (
|
|
64200
|
+
if (!kItem) return result;
|
|
64201
|
+
if (!dataInfo.Chart) return result;
|
|
64202
|
+
|
|
64203
|
+
var titleItem=dataInfo.Chart.GetItem(kItem);
|
|
64204
|
+
if (!titleItem || !titleItem.Data) return result;
|
|
64205
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(titleItem.Data.AryText)) return result;
|
|
64135
64206
|
|
|
64136
|
-
if (
|
|
64207
|
+
if (!result) result={ Text:null, ArrayText:aryText };
|
|
64208
|
+
|
|
64209
|
+
for(var i=0;i<titleItem.Data.AryText.length;++i)
|
|
64137
64210
|
{
|
|
64138
|
-
var
|
|
64139
|
-
|
|
64140
|
-
{
|
|
64141
|
-
var item=value[i];
|
|
64142
|
-
if (!item) continue;
|
|
64143
|
-
|
|
64144
|
-
var textItem={ Name:null, Text:null };
|
|
64145
|
-
if (item.Name) textItem.Name=item.Name;
|
|
64146
|
-
if (item.Text) textItem.Text=item.Text;
|
|
64147
|
-
if (item.Color) textItem.Color=item.Color;
|
|
64148
|
-
if (IFrameSplitOperator.IsNumber(item.LeftSpace)) textItem.LeftSpace=item.LeftSpace;
|
|
64211
|
+
var item=titleItem.Data.AryText[i];
|
|
64212
|
+
if (!item) continue;
|
|
64149
64213
|
|
|
64150
|
-
|
|
64151
|
-
|
|
64214
|
+
var textItem={ Name:null, Text:null };
|
|
64215
|
+
if (item.Name) textItem.Name=item.Name;
|
|
64216
|
+
if (item.Text) textItem.Text=item.Text;
|
|
64217
|
+
if (item.Color) textItem.Color=item.Color;
|
|
64218
|
+
if (IFrameSplitOperator.IsNumber(item.LeftSpace)) textItem.LeftSpace=item.LeftSpace;
|
|
64152
64219
|
|
|
64153
|
-
|
|
64220
|
+
aryText.push(textItem);
|
|
64154
64221
|
}
|
|
64155
64222
|
|
|
64156
|
-
return
|
|
64223
|
+
return result;
|
|
64157
64224
|
}
|
|
64158
64225
|
|
|
64159
64226
|
this.GetColor=function(price,yClose)
|
|
@@ -77874,7 +77941,8 @@ function JSChartResource()
|
|
|
77874
77941
|
this.DaySummaryKLine=
|
|
77875
77942
|
{
|
|
77876
77943
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
77877
|
-
TextColor:"rgb(105,105,105)"
|
|
77944
|
+
TextColor:"rgb(105,105,105)",
|
|
77945
|
+
LeftMargin:2*GetDevicePixelRatio(),
|
|
77878
77946
|
}
|
|
77879
77947
|
|
|
77880
77948
|
//订单流配置
|
|
@@ -79334,6 +79402,7 @@ function JSChartResource()
|
|
|
79334
79402
|
var dest=this.DaySummaryKLine;
|
|
79335
79403
|
if (item.Font) dest.Font=item.Font;
|
|
79336
79404
|
if (item.TextColor) dest.TextColor=item.TextColor;
|
|
79405
|
+
if (IFrameSplitOperator.IsNumber(item.LeftMargin)) dest.LeftMargin=item.LeftMargin;
|
|
79337
79406
|
}
|
|
79338
79407
|
|
|
79339
79408
|
if (style.Index)
|
|
@@ -125688,13 +125757,16 @@ function ScriptIndex(name,script,args,option)
|
|
|
125688
125757
|
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
125689
125758
|
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
125690
125759
|
chart.Identify=this.Guid;
|
|
125760
|
+
chart.Data=hqChart.GetKData(); //绑定K线
|
|
125691
125761
|
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
125692
125762
|
else chart.Color=this.GetDefaultColor(id);
|
|
125693
|
-
chart.
|
|
125763
|
+
chart.AryTitle=varItem.Draw.DrawData.AryTitle;
|
|
125764
|
+
chart.BuildCacheData();
|
|
125694
125765
|
|
|
125695
125766
|
var titleIndex=windowIndex+1;
|
|
125696
125767
|
var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
|
|
125697
125768
|
titleData.DataType="ChartIndexTitle";
|
|
125769
|
+
titleData.Chart=chart;
|
|
125698
125770
|
hqChart.TitlePaint[titleIndex].Data[id]=titleData;
|
|
125699
125771
|
|
|
125700
125772
|
this.SetChartIndexName(chart);
|
|
@@ -127512,6 +127584,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
127512
127584
|
case "DRAWSVG":
|
|
127513
127585
|
this.CreateChartDrawSVG(hqChart,windowIndex,item,i);
|
|
127514
127586
|
break;
|
|
127587
|
+
case "DRAWTITLE":
|
|
127588
|
+
this.CreateTitle(hqChart,windowIndex,item,i);
|
|
127589
|
+
break;
|
|
127515
127590
|
case "MULTI_HTMLDOM":
|
|
127516
127591
|
this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
|
|
127517
127592
|
break;
|
|
@@ -127605,11 +127680,7 @@ function ScriptIndex(name,script,args,option)
|
|
|
127605
127680
|
{
|
|
127606
127681
|
this.CreateArea(hqChart,windowIndex,item,i);
|
|
127607
127682
|
}
|
|
127608
|
-
|
|
127609
|
-
{
|
|
127610
|
-
this.CreateTitle(hqChart,windowIndex,item,i);
|
|
127611
|
-
}
|
|
127612
|
-
|
|
127683
|
+
|
|
127613
127684
|
var titlePaint=hqChart.TitlePaint[windowIndex+1];
|
|
127614
127685
|
if (titlePaint && titlePaint.Data && i<titlePaint.Data.length) //设置标题数值 小数位数和格式
|
|
127615
127686
|
{
|
|
@@ -127886,6 +127957,9 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
127886
127957
|
case "DRAWSVG":
|
|
127887
127958
|
this.CreateChartDrawSVG(hqChart,windowIndex,item,i);
|
|
127888
127959
|
break;
|
|
127960
|
+
case "DRAWTITLE":
|
|
127961
|
+
this.CreateTitle(hqChart,windowIndex,item,i);
|
|
127962
|
+
break;
|
|
127889
127963
|
case "MULTI_HTMLDOM":
|
|
127890
127964
|
this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
|
|
127891
127965
|
break;
|
|
@@ -127959,11 +128033,6 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
127959
128033
|
{
|
|
127960
128034
|
this.CreateLine(hqChart,windowIndex,item,i, item.Type);
|
|
127961
128035
|
}
|
|
127962
|
-
else if (item.Type==10)
|
|
127963
|
-
{
|
|
127964
|
-
this.CreateTitle(hqChart,windowIndex,item,i);
|
|
127965
|
-
}
|
|
127966
|
-
|
|
127967
128036
|
|
|
127968
128037
|
|
|
127969
128038
|
var titleData=titleInfo.Data[i];
|
|
@@ -128548,22 +128617,25 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
128548
128617
|
{
|
|
128549
128618
|
var overlayIndex=this.OverlayIndex;
|
|
128550
128619
|
var frame=overlayIndex.Frame;
|
|
128551
|
-
|
|
128620
|
+
var chart=new ChartIndexTitle();
|
|
128552
128621
|
chart.Canvas=hqChart.Canvas;
|
|
128553
128622
|
|
|
128554
128623
|
chart.Name=varItem.Name;
|
|
128555
128624
|
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
128556
128625
|
chart.ChartFrame=frame.Frame;
|
|
128557
128626
|
chart.Identify=overlayIndex.Identify;
|
|
128558
|
-
|
|
128627
|
+
chart.Data=hqChart.GetKData(); //绑定K线
|
|
128628
|
+
|
|
128559
128629
|
if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
|
|
128560
128630
|
else chart.Color=this.GetDefaultColor(id);
|
|
128561
|
-
chart.
|
|
128631
|
+
chart.AryTitle=varItem.Draw.DrawData.AryTitle;
|
|
128632
|
+
chart.BuildCacheData();
|
|
128562
128633
|
|
|
128563
128634
|
var titleIndex=windowIndex+1;
|
|
128564
128635
|
var titlePaint=hqChart.TitlePaint[titleIndex];
|
|
128565
128636
|
var titleData=new DynamicTitleData(chart.Data,chart.Name,chart.Color);
|
|
128566
128637
|
titleData.DataType="ChartIndexTitle";
|
|
128638
|
+
titleData.Chart=chart;
|
|
128567
128639
|
titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;
|
|
128568
128640
|
|
|
128569
128641
|
this.SetChartIndexName(chart);
|
|
@@ -130179,6 +130251,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
130179
130251
|
|
|
130180
130252
|
result.push(outVarItem);
|
|
130181
130253
|
}
|
|
130254
|
+
else if (draw.DrawType=="DRAWTITLE")
|
|
130255
|
+
{
|
|
130256
|
+
drawItem.Name=draw.Name;
|
|
130257
|
+
drawItem.Type=draw.Type;
|
|
130258
|
+
|
|
130259
|
+
drawItem.DrawType=draw.DrawType;
|
|
130260
|
+
drawItem.DrawData=draw.DrawData;
|
|
130261
|
+
|
|
130262
|
+
outVarItem.Draw=drawItem;
|
|
130263
|
+
|
|
130264
|
+
result.push(outVarItem);
|
|
130265
|
+
}
|
|
130182
130266
|
else if (draw.DrawType=="MULTI_HTMLDOM") //外部自己创建dom
|
|
130183
130267
|
{
|
|
130184
130268
|
drawItem.Text=draw.Text;
|
|
@@ -130737,6 +130821,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
130737
130821
|
|
|
130738
130822
|
result.push(outVarItem);
|
|
130739
130823
|
}
|
|
130824
|
+
else if (draw.DrawType=="DRAWTITLE")
|
|
130825
|
+
{
|
|
130826
|
+
drawItem.Name=draw.Name;
|
|
130827
|
+
drawItem.Type=draw.Type;
|
|
130828
|
+
|
|
130829
|
+
drawItem.DrawType=draw.DrawType;
|
|
130830
|
+
drawItem.DrawData=draw.DrawData;
|
|
130831
|
+
|
|
130832
|
+
outVarItem.Draw=drawItem;
|
|
130833
|
+
|
|
130834
|
+
result.push(outVarItem);
|
|
130835
|
+
}
|
|
130740
130836
|
else
|
|
130741
130837
|
{
|
|
130742
130838
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -147084,7 +147180,7 @@ function ScrollBarBGChart()
|
|
|
147084
147180
|
|
|
147085
147181
|
|
|
147086
147182
|
|
|
147087
|
-
var HQCHART_VERSION="1.1.
|
|
147183
|
+
var HQCHART_VERSION="1.1.14682";
|
|
147088
147184
|
|
|
147089
147185
|
function PrintHQChartVersion()
|
|
147090
147186
|
{
|
|
@@ -58517,24 +58517,38 @@ HQData.APIIndex_TITLE=function(data, callback)
|
|
|
58517
58517
|
var textData={ name:"标题", type:10, color:"rgb(0,128,128)", data:[], }; //名字
|
|
58518
58518
|
var closeData={ name:"收盘价", type:0, color:"rgb(255,165,0)", data:[] } ; //
|
|
58519
58519
|
|
|
58520
|
-
var
|
|
58521
|
-
|
|
58520
|
+
var titleData=
|
|
58521
|
+
{
|
|
58522
|
+
name:"我的指标标题", type:1,
|
|
58523
|
+
Draw:
|
|
58524
|
+
{
|
|
58525
|
+
Name:"指标标题测试",
|
|
58526
|
+
DrawType:"DRAWTITLE",
|
|
58527
|
+
DrawData:{ AryTitle:[] },
|
|
58528
|
+
},
|
|
58529
|
+
};
|
|
58530
|
+
|
|
58522
58531
|
for(var i=0;i<kData.Data.length-30;++i)
|
|
58523
58532
|
{
|
|
58524
58533
|
var kItem=kData.Data[i];
|
|
58525
58534
|
|
|
58526
58535
|
closeData.data.push(kItem.Close);
|
|
58527
58536
|
|
|
58528
|
-
|
|
58529
|
-
|
|
58530
|
-
|
|
58531
|
-
{ Name:`开`, Text:`${kItem.Open.toFixed(2)}`, Color:"rgb(0,200,10)", LeftSpace:2 }
|
|
58532
|
-
]);
|
|
58537
|
+
titleData.Draw.DrawData.AryTitle.push(
|
|
58538
|
+
{
|
|
58539
|
+
Date:kItem.Date, Time:kItem.Time,
|
|
58533
58540
|
|
|
58534
|
-
|
|
58541
|
+
AryText:
|
|
58542
|
+
[
|
|
58543
|
+
{ Name:`收`, Text:`${kItem.Close.toFixed(2)}`, Color:"rgb(200,10,10)",},
|
|
58544
|
+
{ Name:`开`, Text:`${kItem.Open.toFixed(2)}`, Color:"rgb(0,200,10)", LeftSpace:2 },
|
|
58545
|
+
{ Name:"标题1", Text:"1xxxxx", Color:"rgb(100,200,10)", LeftSpace:2},
|
|
58546
|
+
{ Name:"标题2", Text:"2xxxxx", Color:"rgb(200,200,10)", LeftSpace:2},
|
|
58547
|
+
{ Name:"标题3", Text:"3xxxxx", Color:"rgb(100,70,80)", LeftSpace:2},
|
|
58548
|
+
]
|
|
58549
|
+
});
|
|
58535
58550
|
|
|
58536
|
-
|
|
58537
|
-
aryTime.push(kItem.Time);
|
|
58551
|
+
//textData.data.push(`价格:${kItem.Close.toFixed(2)}`);
|
|
58538
58552
|
}
|
|
58539
58553
|
|
|
58540
58554
|
|
|
@@ -58542,7 +58556,7 @@ HQData.APIIndex_TITLE=function(data, callback)
|
|
|
58542
58556
|
{
|
|
58543
58557
|
code:0,
|
|
58544
58558
|
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
58545
|
-
outdata: { date:
|
|
58559
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ titleData, closeData] },
|
|
58546
58560
|
|
|
58547
58561
|
//error: { message:"无权限查看指标“测试指标1”" }
|
|
58548
58562
|
};
|