hqchart 1.1.12516 → 1.1.12522
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 +30 -8
- package/package.json +1 -1
- package/src/jscommon/umychart.js +428 -4
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +429 -5
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +429 -5
- package/src/jscommon/umychart.wechat/umychart.chartpaint.wechat.js +13 -1
- package/src/jscommon/umychart.wechat/umychart.index.wechat.js +6 -0
|
@@ -33139,6 +33139,7 @@ function ChartStick()
|
|
|
33139
33139
|
this.Draw=function()
|
|
33140
33140
|
{
|
|
33141
33141
|
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
33142
|
+
if (this.IsHideScriptIndex()) return;
|
|
33142
33143
|
|
|
33143
33144
|
if (this.NotSupportMessage)
|
|
33144
33145
|
{
|
|
@@ -33164,6 +33165,8 @@ function ChartLineStick()
|
|
|
33164
33165
|
this.Draw=function()
|
|
33165
33166
|
{
|
|
33166
33167
|
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
33168
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
33169
|
+
if (this.IsHideScriptIndex()) return;
|
|
33167
33170
|
|
|
33168
33171
|
if (this.NotSupportMessage)
|
|
33169
33172
|
{
|
|
@@ -43692,7 +43695,7 @@ function DrawToolsButton()
|
|
|
43692
43695
|
{ HTML: { Title: 'M头W底', IClass: 'iconfont icon-draw_wavemw', ID: 'icon-wavemw' }, Name: 'M头W底' },
|
|
43693
43696
|
{ HTML: { Title: '头肩型', IClass: 'iconfont icon-draw_head_shoulders_bt', ID: 'icon-Head-Shoulders' }, Name: '头肩型' },
|
|
43694
43697
|
{ HTML: { Title: '波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: '波浪尺' },
|
|
43695
|
-
{ HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-
|
|
43698
|
+
{ HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler2' }, Name: 'AB波浪尺' },
|
|
43696
43699
|
{ HTML: { Title: '箱型线', IClass: 'iconfont icon-draw_box', ID: 'icon-drawbox' }, Name: '箱型线' },
|
|
43697
43700
|
{ HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment2' }, Name: '涂鸦线段' },
|
|
43698
43701
|
|
|
@@ -52675,7 +52678,8 @@ function DynamicMinuteTitlePainting()
|
|
|
52675
52678
|
|
|
52676
52679
|
if (beforeItem && dataItem) //盘前数据
|
|
52677
52680
|
{
|
|
52678
|
-
if (beforeItem.Date>dataItem.Date || (beforeItem.Date==dataItem.Date && beforeItem.Time>dataItem.Time &&
|
|
52681
|
+
if (beforeItem.Date>dataItem.Date || (beforeItem.Date==dataItem.Date && beforeItem.Time>dataItem.Time && beforeDataVer==1.0)
|
|
52682
|
+
|| (beforeItem.Date==dataItem.Date && parseInt(beforeItem.Time>dataItem.Time) && beforeDataVer==2.0))
|
|
52679
52683
|
return { Type:2, Data:beforeItem, Ver: beforeDataVer, Explain:beforeExplain};
|
|
52680
52684
|
}
|
|
52681
52685
|
|
|
@@ -56089,7 +56093,9 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
56089
56093
|
{ Name:"AnchoredText", ClassName:"ChartDrawAnchoredText", Create:function() { return new ChartDrawAnchoredText();} },
|
|
56090
56094
|
{ Name:"PriceLabel", ClassName:"ChartDrawPriceLabel", Create:function() { return new ChartDrawPriceLabel();} },
|
|
56091
56095
|
{ Name:"PriceNote", ClassName:"ChartDrawPriceNote", Create:function() { return new ChartDrawPriceNote();} },
|
|
56092
|
-
{ Name:"FibWedge", ClassName:"ChartDrawFibWedge", Create:function(){ return new ChartDrawFibWedge(); }}
|
|
56096
|
+
{ Name:"FibWedge", ClassName:"ChartDrawFibWedge", Create:function(){ return new ChartDrawFibWedge(); }},
|
|
56097
|
+
{ Name:"FibRetracement", ClassName:"ChartFibRetracement", Create:function() { return new ChartFibRetracement(); }}, //斐波那契回测
|
|
56098
|
+
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }} //斐波那契扇形
|
|
56093
56099
|
];
|
|
56094
56100
|
|
|
56095
56101
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -58360,7 +58366,7 @@ function ChartDrawPictureParallelChannel()
|
|
|
58360
58366
|
var ptCenter=new Point();
|
|
58361
58367
|
ptCenter.X=linePoint.Start.X+(linePoint.End.X-linePoint.Start.X)/2;
|
|
58362
58368
|
ptCenter.Y=linePoint.Start.Y+(linePoint.End.Y-linePoint.Start.Y)/2;
|
|
58363
|
-
drawPoint[
|
|
58369
|
+
drawPoint[2]=ptCenter;
|
|
58364
58370
|
|
|
58365
58371
|
this.Point[2]=ptCenter;
|
|
58366
58372
|
var xValue=parseInt(this.Frame.GetXData(ptCenter.X))+data.DataOffset;
|
|
@@ -58793,6 +58799,7 @@ function ChartDrawPictureGannFan()
|
|
|
58793
58799
|
else return 3;
|
|
58794
58800
|
}
|
|
58795
58801
|
|
|
58802
|
+
|
|
58796
58803
|
//isDotline 是否是虚线
|
|
58797
58804
|
this.DrawLine=function(ptStart,ptEnd,isDottedline)
|
|
58798
58805
|
{
|
|
@@ -63572,6 +63579,423 @@ function ChartDrawFibWedge()
|
|
|
63572
63579
|
|
|
63573
63580
|
}
|
|
63574
63581
|
|
|
63582
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
63583
|
+
// 斐波那契回测
|
|
63584
|
+
//
|
|
63585
|
+
function ChartFibRetracement()
|
|
63586
|
+
{
|
|
63587
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
63588
|
+
this.newMethod();
|
|
63589
|
+
delete this.newMethod;
|
|
63590
|
+
|
|
63591
|
+
this.ClassName='ChartFibRetracement';
|
|
63592
|
+
this.PointCount=2;
|
|
63593
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
63594
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
63595
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
63596
|
+
this.PointToValue_Default=this.PointToValue;
|
|
63597
|
+
this.OnlyMoveXIndex=true;
|
|
63598
|
+
this.IsSupportMagnet=true;
|
|
63599
|
+
this.LineDash=[6,3];
|
|
63600
|
+
this.LineWidth=1;
|
|
63601
|
+
this.EnableBGColor=true;
|
|
63602
|
+
this.ExtendLine={ Left:false, Right: false }; //延长线
|
|
63603
|
+
|
|
63604
|
+
this.AreaConfig=
|
|
63605
|
+
{
|
|
63606
|
+
AryData:
|
|
63607
|
+
[
|
|
63608
|
+
{ Value: 0, Color:"rgb(128,128,128)", Enable:true },
|
|
63609
|
+
{ Value: 0.236, Color:"rgb(242,52,69)", Enable:true },
|
|
63610
|
+
{ Value: 0.382, Color:"rgb(255,152,0)",Enable:true },
|
|
63611
|
+
{ Value: 0.5, Color:"rgb(76,175,80)", Enable:true },
|
|
63612
|
+
{ Value: 0.618, Color:"rgb(8,153,129)", Enable:true },
|
|
63613
|
+
{ Value: 0.786, Color:"rgb(0,188,212)" ,Enable:true },
|
|
63614
|
+
{ Value: 1, Color:"rgb(120,123,134)", Enable:true },
|
|
63615
|
+
{ Value: 1.618, Color:"rgb(41,98,255)",Enable:true },
|
|
63616
|
+
{ Value: 2.618, Color:"rgb(242,54,69)",Enable:false },
|
|
63617
|
+
],
|
|
63618
|
+
|
|
63619
|
+
Opacity:0.3
|
|
63620
|
+
}
|
|
63621
|
+
|
|
63622
|
+
this.SetOption=function(option)
|
|
63623
|
+
{
|
|
63624
|
+
if (!option) return;
|
|
63625
|
+
|
|
63626
|
+
if (option.Font) this.Font=option.Font;
|
|
63627
|
+
if (option.LineWidth) this.LineWidth=option.LineWidth;
|
|
63628
|
+
if (option.LineDash) this.LineDash=option.LineDash;
|
|
63629
|
+
if (IFrameSplitOperator.IsBool(option.EnableBGColor)) this.EnableBGColor=option.EnableBGColor;
|
|
63630
|
+
if (option.ExtendLine)
|
|
63631
|
+
{
|
|
63632
|
+
var item=option.ExtendLine;
|
|
63633
|
+
if (IFrameSplitOperator.IsBool(item.Left)) this.ExtendLine.Left=item.Left;
|
|
63634
|
+
if (IFrameSplitOperator.IsBool(item.Right)) this.ExtendLine.Left=item.Right;
|
|
63635
|
+
}
|
|
63636
|
+
|
|
63637
|
+
if (option.AreaConfig) this.AreaConfig=option.AreaConfig;
|
|
63638
|
+
}
|
|
63639
|
+
|
|
63640
|
+
//导出成存储格式
|
|
63641
|
+
this.ExportStorageData=function()
|
|
63642
|
+
{
|
|
63643
|
+
var storageData=this.ExportBaseData();
|
|
63644
|
+
|
|
63645
|
+
storageData.Value=[];
|
|
63646
|
+
for(var i=0;i<this.Value.length && i<this.PointCount;++i)
|
|
63647
|
+
{
|
|
63648
|
+
var item=this.Value[i];
|
|
63649
|
+
storageData.Value.push( { XValue:item.XValue, YValue:item.YValue } );
|
|
63650
|
+
}
|
|
63651
|
+
|
|
63652
|
+
storageData.Font=this.Font;
|
|
63653
|
+
storageData.EnableBGColor=this.EnableBGColor;
|
|
63654
|
+
storageData.LineDash=this.LineDash;
|
|
63655
|
+
storageData.ExtendLine={ Left:this.ExtendLine.Left, Right:this.ExtendLine.Right };
|
|
63656
|
+
storageData.AreaConfig=CloneData(this.AreaConfig);
|
|
63657
|
+
|
|
63658
|
+
return storageData;
|
|
63659
|
+
}
|
|
63660
|
+
|
|
63661
|
+
this.ImportStorageData=function(storageData)
|
|
63662
|
+
{
|
|
63663
|
+
if (storageData.Font) this.Font=storageData.Font;
|
|
63664
|
+
if (storageData.LineDash) this.LineDash=storageData.LineDash;
|
|
63665
|
+
if (IFrameSplitOperator.IsBool(storageData.EnableBGColor)) this.EnableBGColor=storageData.EnableBGColor;
|
|
63666
|
+
if (storageData.ExtendLine) this.ExtendLine=storageData.ExtendLine;
|
|
63667
|
+
if (storageData.AreaConfig) this.AreaConfig=storageData.AreaConfig;
|
|
63668
|
+
}
|
|
63669
|
+
|
|
63670
|
+
this.Draw=function()
|
|
63671
|
+
{
|
|
63672
|
+
this.LinePoint=[];
|
|
63673
|
+
if (this.IsFrameMinSize()) return;
|
|
63674
|
+
var bCheckXY=true;
|
|
63675
|
+
if (this.ExtendLine.Left || this.ExtendLine.Right) bCheckXY=false;
|
|
63676
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
|
|
63677
|
+
if (!drawPoint) return;
|
|
63678
|
+
if (drawPoint.length!=2) return;
|
|
63679
|
+
|
|
63680
|
+
this.ClipFrame();
|
|
63681
|
+
|
|
63682
|
+
var ptStart=drawPoint[0];
|
|
63683
|
+
var ptEnd=drawPoint[1];
|
|
63684
|
+
|
|
63685
|
+
this.SetLineWidth();
|
|
63686
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
63687
|
+
this.Canvas.setLineDash(this.LineDash);
|
|
63688
|
+
this.Canvas.beginPath();
|
|
63689
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
63690
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
63691
|
+
this.Canvas.stroke();
|
|
63692
|
+
this.Canvas.setLineDash([]);
|
|
63693
|
+
|
|
63694
|
+
this.DrawBlock(ptStart, ptEnd);
|
|
63695
|
+
|
|
63696
|
+
this.RestoreLineWidth();
|
|
63697
|
+
|
|
63698
|
+
var line={Start:ptStart, End:ptEnd};
|
|
63699
|
+
this.LinePoint.push(line);
|
|
63700
|
+
|
|
63701
|
+
this.DrawPoint(drawPoint); //画点
|
|
63702
|
+
this.Canvas.restore();
|
|
63703
|
+
}
|
|
63704
|
+
|
|
63705
|
+
this.GetArrayAreaConfig=function()
|
|
63706
|
+
{
|
|
63707
|
+
var aryArea=[];
|
|
63708
|
+
for(var i=0;i<this.AreaConfig.AryData.length;++i)
|
|
63709
|
+
{
|
|
63710
|
+
var item=this.AreaConfig.AryData[i];
|
|
63711
|
+
if (item.Enable) aryArea.push(item);
|
|
63712
|
+
}
|
|
63713
|
+
|
|
63714
|
+
aryArea.sort((left,right)=>{ return right.Value-left.Value; })
|
|
63715
|
+
|
|
63716
|
+
return aryArea;
|
|
63717
|
+
}
|
|
63718
|
+
|
|
63719
|
+
this.DrawBlock=function(ptStart, ptEnd)
|
|
63720
|
+
{
|
|
63721
|
+
var yTop=Math.min(ptStart.Y, ptEnd.Y);
|
|
63722
|
+
var yBottom=Math.max(ptStart.Y, ptEnd.Y);
|
|
63723
|
+
var xLeft=Math.min(ptStart.X, ptEnd.X);
|
|
63724
|
+
var xRight=Math.max(ptStart.X, ptEnd.X);
|
|
63725
|
+
var height=yBottom-yTop;
|
|
63726
|
+
//var baseValue=Math.min(this.Value[0].YValue, this.Value[1].YValue);
|
|
63727
|
+
//var diffValue=Math.abs(this.Value[0].YValue-this.Value[1].YValue); //差值
|
|
63728
|
+
|
|
63729
|
+
if (this.ExtendLine.Right) xRight=this.Frame.ChartBorder.GetRight();
|
|
63730
|
+
if (this.ExtendLine.Left) xLeft=this.Frame.ChartBorder.GetLeft();
|
|
63731
|
+
|
|
63732
|
+
var aryArea=this.GetArrayAreaConfig();
|
|
63733
|
+
var yPre=null; //上一个点
|
|
63734
|
+
var clrArea=null;
|
|
63735
|
+
this.Canvas.font=this.Font;
|
|
63736
|
+
if (this.ExtendLine.Left) this.Canvas.textAlign="left";
|
|
63737
|
+
else this.Canvas.textAlign="right";
|
|
63738
|
+
this.Canvas.textBaseline="bottom";
|
|
63739
|
+
|
|
63740
|
+
for(var i=0;i<aryArea.length;++i)
|
|
63741
|
+
{
|
|
63742
|
+
var item=aryArea[i];
|
|
63743
|
+
var y=yBottom-height*item.Value;
|
|
63744
|
+
//var yValue=baseValue+diffValue*item.Value;
|
|
63745
|
+
yValue=this.Frame.GetYData(y,false);
|
|
63746
|
+
y=ToFixedPoint(y);
|
|
63747
|
+
if (this.EnableBGColor && IFrameSplitOperator.IsNumber(yPre))
|
|
63748
|
+
{
|
|
63749
|
+
var rtBG={ Left:xLeft, Right:xRight, Top:yPre, Bottom:y };
|
|
63750
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
63751
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
63752
|
+
this.Canvas.fillStyle=clrArea;
|
|
63753
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
63754
|
+
}
|
|
63755
|
+
|
|
63756
|
+
this.Canvas.strokeStyle=item.Color;
|
|
63757
|
+
this.Canvas.beginPath();
|
|
63758
|
+
this.Canvas.moveTo(xLeft,y);
|
|
63759
|
+
this.Canvas.lineTo(xRight,y);
|
|
63760
|
+
this.Canvas.stroke();
|
|
63761
|
+
|
|
63762
|
+
var line={ Start:{X:xLeft, Y:y}, End:{X:xRight, Y:y} };
|
|
63763
|
+
this.LinePoint.push(line);
|
|
63764
|
+
|
|
63765
|
+
//文字
|
|
63766
|
+
var text=`${item.Value} (${yValue.toFixed(2)})`;
|
|
63767
|
+
this.Canvas.fillStyle=item.Color;
|
|
63768
|
+
if (this.ExtendLine.Left)
|
|
63769
|
+
this.Canvas.fillText(text,xLeft+2,y-2);
|
|
63770
|
+
else
|
|
63771
|
+
this.Canvas.fillText(text,xLeft-2,y-2);
|
|
63772
|
+
|
|
63773
|
+
yPre=y;
|
|
63774
|
+
clrArea=IChartDrawPicture.ColorToRGBA(item.Color, this.AreaConfig.Opacity);
|
|
63775
|
+
}
|
|
63776
|
+
}
|
|
63777
|
+
|
|
63778
|
+
}
|
|
63779
|
+
|
|
63780
|
+
|
|
63781
|
+
function ChartFibSpeedResistanceFan()
|
|
63782
|
+
{
|
|
63783
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
63784
|
+
this.newMethod();
|
|
63785
|
+
delete this.newMethod;
|
|
63786
|
+
|
|
63787
|
+
this.ClassName='ChartFibSpeedResistanceFan';
|
|
63788
|
+
this.PointCount=2;
|
|
63789
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
63790
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
63791
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
63792
|
+
this.PointToValue_Default=this.PointToValue;
|
|
63793
|
+
this.OnlyMoveXIndex=true;
|
|
63794
|
+
this.IsSupportMagnet=true;
|
|
63795
|
+
this.LineWidth=1;
|
|
63796
|
+
this.EnableBGColor=true;
|
|
63797
|
+
|
|
63798
|
+
this.AreaConfig=
|
|
63799
|
+
{
|
|
63800
|
+
AryYData:
|
|
63801
|
+
[
|
|
63802
|
+
{ Value: 0, Color:"rgb(128,128,128)", Enable:true },
|
|
63803
|
+
{ Value: 0.25, Color:"rgb(242,52,69)", Enable:true },
|
|
63804
|
+
{ Value: 0.382, Color:"rgb(255,152,0)",Enable:true },
|
|
63805
|
+
{ Value: 0.5, Color:"rgb(76,175,80)", Enable:true },
|
|
63806
|
+
{ Value: 0.618, Color:"rgb(8,153,129)", Enable:true },
|
|
63807
|
+
{ Value: 0.75, Color:"rgb(0,188,212)" ,Enable:true },
|
|
63808
|
+
{ Value: 1, Color:"rgb(120,123,134)", Enable:true },
|
|
63809
|
+
|
|
63810
|
+
],
|
|
63811
|
+
|
|
63812
|
+
AryXData:
|
|
63813
|
+
[
|
|
63814
|
+
{ Value: 0, Color:"rgb(128,128,128)", Enable:true },
|
|
63815
|
+
{ Value: 0.25, Color:"rgb(242,52,69)", Enable:true },
|
|
63816
|
+
{ Value: 0.382, Color:"rgb(255,152,0)",Enable:true },
|
|
63817
|
+
{ Value: 0.5, Color:"rgb(76,175,80)", Enable:true },
|
|
63818
|
+
{ Value: 0.618, Color:"rgb(8,153,129)", Enable:true },
|
|
63819
|
+
{ Value: 0.75, Color:"rgb(0,188,212)" ,Enable:true },
|
|
63820
|
+
{ Value: 1, Color:"rgb(120,123,134)", Enable:true },
|
|
63821
|
+
],
|
|
63822
|
+
|
|
63823
|
+
Opacity:0.3
|
|
63824
|
+
}
|
|
63825
|
+
|
|
63826
|
+
this.Draw=function()
|
|
63827
|
+
{
|
|
63828
|
+
this.LinePoint=[];
|
|
63829
|
+
if (this.IsFrameMinSize()) return;
|
|
63830
|
+
var bCheckXY=false;
|
|
63831
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
|
|
63832
|
+
if (!drawPoint) return;
|
|
63833
|
+
if (drawPoint.length!=2) return;
|
|
63834
|
+
|
|
63835
|
+
this.ClipFrame();
|
|
63836
|
+
|
|
63837
|
+
var ptStart=drawPoint[0];
|
|
63838
|
+
var ptEnd=drawPoint[1];
|
|
63839
|
+
|
|
63840
|
+
this.SetLineWidth();
|
|
63841
|
+
this.DrawBlock(ptEnd, ptStart);
|
|
63842
|
+
this.RestoreLineWidth();
|
|
63843
|
+
|
|
63844
|
+
this.DrawPoint(drawPoint); //画点
|
|
63845
|
+
this.Canvas.restore();
|
|
63846
|
+
}
|
|
63847
|
+
|
|
63848
|
+
//获取在第几象限
|
|
63849
|
+
this.GetQuadrant=function(ptStart,ptEnd)
|
|
63850
|
+
{
|
|
63851
|
+
if (ptStart.X<ptEnd.X && ptStart.Y>ptEnd.Y) return 1;
|
|
63852
|
+
else if (ptStart.X>ptEnd.X && ptStart.Y>ptEnd.Y) return 2;
|
|
63853
|
+
else if (ptStart.X<ptEnd.X && ptStart.Y< ptEnd.Y) return 4;
|
|
63854
|
+
else return 3;
|
|
63855
|
+
}
|
|
63856
|
+
|
|
63857
|
+
this.DrawBlock=function(ptStart, ptEnd)
|
|
63858
|
+
{
|
|
63859
|
+
var center=ptEnd;
|
|
63860
|
+
var xDiff=ptEnd.X-ptStart.X;
|
|
63861
|
+
var yDiff=ptEnd.Y-ptStart.Y;
|
|
63862
|
+
var quadrant=this.GetQuadrant(center,ptStart); //象限
|
|
63863
|
+
|
|
63864
|
+
var aryYData=this.GetArrayAreaConfig(this.AreaConfig.AryYData);
|
|
63865
|
+
var ptPre=null; //上一个点
|
|
63866
|
+
var clrArea=null;
|
|
63867
|
+
this.Canvas.font=this.Font;
|
|
63868
|
+
var textOffset=4;
|
|
63869
|
+
if (quadrant==1 || quadrant==4)
|
|
63870
|
+
{
|
|
63871
|
+
this.Canvas.textAlign="right";
|
|
63872
|
+
textOffset=-4;
|
|
63873
|
+
}
|
|
63874
|
+
else
|
|
63875
|
+
{
|
|
63876
|
+
this.Canvas.textAlign="left";
|
|
63877
|
+
textOffset=4;
|
|
63878
|
+
}
|
|
63879
|
+
this.Canvas.textBaseline="middle";
|
|
63880
|
+
for(var i=0;i<aryYData.length;++i)
|
|
63881
|
+
{
|
|
63882
|
+
var item=aryYData[i];
|
|
63883
|
+
var y=item.Value*yDiff+ptStart.Y;
|
|
63884
|
+
|
|
63885
|
+
var pt=this.CalculateExtendLineEndPoint([center, {X:ptStart.X, Y:y}]);
|
|
63886
|
+
|
|
63887
|
+
if (ptPre)
|
|
63888
|
+
{
|
|
63889
|
+
this.Canvas.beginPath();
|
|
63890
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
63891
|
+
this.Canvas.lineTo(ptPre.X,ptPre.Y);
|
|
63892
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
63893
|
+
this.Canvas.closePath();
|
|
63894
|
+
this.Canvas.fillStyle=clrArea;
|
|
63895
|
+
this.Canvas.fill();
|
|
63896
|
+
}
|
|
63897
|
+
|
|
63898
|
+
this.Canvas.strokeStyle=item.Color;
|
|
63899
|
+
this.Canvas.beginPath();
|
|
63900
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
63901
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
63902
|
+
this.Canvas.stroke();
|
|
63903
|
+
|
|
63904
|
+
this.LinePoint.push({Start:center, End:pt});
|
|
63905
|
+
|
|
63906
|
+
if (item.Value!=1)
|
|
63907
|
+
{
|
|
63908
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
63909
|
+
this.Canvas.beginPath();
|
|
63910
|
+
this.Canvas.moveTo(center.X,y);
|
|
63911
|
+
this.Canvas.lineTo(ptStart.X,y);
|
|
63912
|
+
this.Canvas.stroke();
|
|
63913
|
+
}
|
|
63914
|
+
|
|
63915
|
+
ptPre=pt;
|
|
63916
|
+
clrArea=IChartDrawPicture.ColorToRGBA(item.Color, this.AreaConfig.Opacity);
|
|
63917
|
+
|
|
63918
|
+
//文字
|
|
63919
|
+
var text=`${item.Value}`;
|
|
63920
|
+
this.Canvas.fillStyle=item.Color;
|
|
63921
|
+
this.Canvas.fillText(text,center.X+textOffset,y);
|
|
63922
|
+
}
|
|
63923
|
+
|
|
63924
|
+
var aryXData=this.GetArrayAreaConfig(this.AreaConfig.AryXData);
|
|
63925
|
+
var ptPre=null;
|
|
63926
|
+
this.Canvas.textAlign="center";
|
|
63927
|
+
if (quadrant==3 || quadrant==4)
|
|
63928
|
+
{
|
|
63929
|
+
this.Canvas.textBaseline="bottom";
|
|
63930
|
+
textOffset=-5;
|
|
63931
|
+
}
|
|
63932
|
+
else
|
|
63933
|
+
{
|
|
63934
|
+
this.Canvas.textBaseline="top";
|
|
63935
|
+
textOffset=5;
|
|
63936
|
+
}
|
|
63937
|
+
|
|
63938
|
+
for(var i=0;i<aryXData.length;++i)
|
|
63939
|
+
{
|
|
63940
|
+
var item=aryXData[i];
|
|
63941
|
+
var x=item.Value*xDiff+ptStart.X;
|
|
63942
|
+
|
|
63943
|
+
var pt=this.CalculateExtendLineEndPoint([center, {X:x, Y:ptStart.Y}]);
|
|
63944
|
+
|
|
63945
|
+
if (ptPre) //面积
|
|
63946
|
+
{
|
|
63947
|
+
this.Canvas.beginPath();
|
|
63948
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
63949
|
+
this.Canvas.lineTo(ptPre.X,ptPre.Y);
|
|
63950
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
63951
|
+
this.Canvas.closePath();
|
|
63952
|
+
this.Canvas.fillStyle=clrArea;
|
|
63953
|
+
this.Canvas.fill();
|
|
63954
|
+
}
|
|
63955
|
+
|
|
63956
|
+
this.Canvas.strokeStyle=item.Color;
|
|
63957
|
+
this.Canvas.beginPath();
|
|
63958
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
63959
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
63960
|
+
this.Canvas.stroke();
|
|
63961
|
+
|
|
63962
|
+
this.LinePoint.push({Start:center, End:pt});
|
|
63963
|
+
|
|
63964
|
+
if (item.Value!=1)
|
|
63965
|
+
{
|
|
63966
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
63967
|
+
this.Canvas.beginPath();
|
|
63968
|
+
this.Canvas.moveTo(x,center.Y);
|
|
63969
|
+
this.Canvas.lineTo(x,ptStart.Y);
|
|
63970
|
+
this.Canvas.stroke();
|
|
63971
|
+
}
|
|
63972
|
+
|
|
63973
|
+
ptPre=pt;
|
|
63974
|
+
clrArea=IChartDrawPicture.ColorToRGBA(item.Color, this.AreaConfig.Opacity);
|
|
63975
|
+
|
|
63976
|
+
//文字
|
|
63977
|
+
var text=`${item.Value}`;
|
|
63978
|
+
this.Canvas.fillStyle=item.Color;
|
|
63979
|
+
this.Canvas.fillText(text,x,center.Y+textOffset);
|
|
63980
|
+
}
|
|
63981
|
+
}
|
|
63982
|
+
|
|
63983
|
+
this.GetArrayAreaConfig=function(aryData)
|
|
63984
|
+
{
|
|
63985
|
+
var aryArea=[];
|
|
63986
|
+
for(var i=0;i<aryData.length;++i)
|
|
63987
|
+
{
|
|
63988
|
+
var item=aryData[i];
|
|
63989
|
+
if (item.Enable) aryArea.push(item);
|
|
63990
|
+
}
|
|
63991
|
+
|
|
63992
|
+
aryArea.sort((left,right)=>{ return right.Value-left.Value; })
|
|
63993
|
+
|
|
63994
|
+
return aryArea;
|
|
63995
|
+
}
|
|
63996
|
+
|
|
63997
|
+
}
|
|
63998
|
+
|
|
63575
63999
|
function ChartDrawStorage()
|
|
63576
64000
|
{
|
|
63577
64001
|
this.DrawData=new Map(); //画图工具数据 key=symbol-Period, value=Map() Key:Guid, Value:{Guid, Symbol, Period, ClassName, Value}
|
|
@@ -128616,7 +129040,7 @@ function HQChartScriptWorker()
|
|
|
128616
129040
|
|
|
128617
129041
|
|
|
128618
129042
|
|
|
128619
|
-
var HQCHART_VERSION="1.1.
|
|
129043
|
+
var HQCHART_VERSION="1.1.12521";
|
|
128620
129044
|
|
|
128621
129045
|
function PrintHQChartVersion()
|
|
128622
129046
|
{
|
|
@@ -98,6 +98,7 @@ function IChartPainting()
|
|
|
98
98
|
this.Name; //名称
|
|
99
99
|
this.ClassName = 'IChartPainting'; //类名
|
|
100
100
|
this.Data = new ChartData(); //数据区
|
|
101
|
+
this.Script; //图形对应的指标脚本 (只有指标图形才有)
|
|
101
102
|
|
|
102
103
|
this.NotSupportMessage = null;
|
|
103
104
|
this.MessageFont = g_JSChartPaintResource.Index.NotSupport.Font;
|
|
@@ -123,6 +124,13 @@ function IChartPainting()
|
|
|
123
124
|
return isMinute
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
//是否隐藏指标
|
|
128
|
+
this.IsHideScriptIndex=function()
|
|
129
|
+
{
|
|
130
|
+
if (this.Script && this.Script.IsShow==false) return true;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
126
134
|
this.DrawNotSupportmessage = function ()
|
|
127
135
|
{
|
|
128
136
|
this.Canvas.font = this.MessageFont;
|
|
@@ -3303,6 +3311,7 @@ function ChartLine()
|
|
|
3303
3311
|
this.Draw = function ()
|
|
3304
3312
|
{
|
|
3305
3313
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
3314
|
+
if (this.IsHideScriptIndex()) return;
|
|
3306
3315
|
if (this.NotSupportMessage)
|
|
3307
3316
|
{
|
|
3308
3317
|
this.DrawNotSupportmessage();
|
|
@@ -3804,6 +3813,7 @@ function ChartStick()
|
|
|
3804
3813
|
this.DrawLine = function ()
|
|
3805
3814
|
{
|
|
3806
3815
|
if (this.ChartFrame.IsMinSize) return;
|
|
3816
|
+
if (this.IsHideScriptIndex()) return;
|
|
3807
3817
|
if (!this.Data || !this.Data.Data) return;
|
|
3808
3818
|
|
|
3809
3819
|
var isHScreen = (this.ChartFrame.IsHScreen === true);
|
|
@@ -3915,7 +3925,7 @@ function ChartLineStick()
|
|
|
3915
3925
|
this.Draw = function ()
|
|
3916
3926
|
{
|
|
3917
3927
|
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
3918
|
-
|
|
3928
|
+
if (this.IsHideScriptIndex()) return;
|
|
3919
3929
|
if (this.NotSupportMessage)
|
|
3920
3930
|
{
|
|
3921
3931
|
this.DrawNotSupportmessage();
|
|
@@ -5936,6 +5946,7 @@ function ChartMACD()
|
|
|
5936
5946
|
this.Draw = function ()
|
|
5937
5947
|
{
|
|
5938
5948
|
if (this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
5949
|
+
if (this.IsHideScriptIndex()) return;
|
|
5939
5950
|
if (this.NotSupportMessage)
|
|
5940
5951
|
{
|
|
5941
5952
|
this.DrawNotSupportmessage();
|
|
@@ -7010,6 +7021,7 @@ function ChartVolStick()
|
|
|
7010
7021
|
this.Draw = function ()
|
|
7011
7022
|
{
|
|
7012
7023
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
7024
|
+
if (this.IsHideScriptIndex()) return;
|
|
7013
7025
|
if (this.ChartFrame.IsHScreen === true)
|
|
7014
7026
|
{
|
|
7015
7027
|
this.HScreenDraw();
|
|
@@ -216,6 +216,8 @@ function ScriptIndex(name, script, args, option)
|
|
|
216
216
|
this.TitleFont=g_JSChartResource.DynamicTitleFont; //标题字体
|
|
217
217
|
this.IsShortTitle=false; //是否显示指标参数
|
|
218
218
|
|
|
219
|
+
this.IsShow=true; //是否显示图形
|
|
220
|
+
|
|
219
221
|
if (option)
|
|
220
222
|
{
|
|
221
223
|
if (option.FloatPrecision >= 0) this.FloatPrecision = option.FloatPrecision;
|
|
@@ -1476,6 +1478,10 @@ function ScriptIndex(name, script, args, option)
|
|
|
1476
1478
|
{
|
|
1477
1479
|
if (this.Name) chart.IndexName=this.Name;
|
|
1478
1480
|
else if (this.ID) chart.IndexName==this.ID;
|
|
1481
|
+
|
|
1482
|
+
if (this.ID) chart.IndexID=this.ID;
|
|
1483
|
+
|
|
1484
|
+
chart.Script=this; //指标内容绑定上去
|
|
1479
1485
|
}
|
|
1480
1486
|
}
|
|
1481
1487
|
|