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
package/src/jscommon/umychart.js
CHANGED
|
@@ -29015,6 +29015,7 @@ function ChartStick()
|
|
|
29015
29015
|
this.Draw=function()
|
|
29016
29016
|
{
|
|
29017
29017
|
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
29018
|
+
if (this.IsHideScriptIndex()) return;
|
|
29018
29019
|
|
|
29019
29020
|
if (this.NotSupportMessage)
|
|
29020
29021
|
{
|
|
@@ -29040,6 +29041,8 @@ function ChartLineStick()
|
|
|
29040
29041
|
this.Draw=function()
|
|
29041
29042
|
{
|
|
29042
29043
|
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
29044
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
29045
|
+
if (this.IsHideScriptIndex()) return;
|
|
29043
29046
|
|
|
29044
29047
|
if (this.NotSupportMessage)
|
|
29045
29048
|
{
|
|
@@ -39568,7 +39571,7 @@ function DrawToolsButton()
|
|
|
39568
39571
|
{ HTML: { Title: 'M头W底', IClass: 'iconfont icon-draw_wavemw', ID: 'icon-wavemw' }, Name: 'M头W底' },
|
|
39569
39572
|
{ HTML: { Title: '头肩型', IClass: 'iconfont icon-draw_head_shoulders_bt', ID: 'icon-Head-Shoulders' }, Name: '头肩型' },
|
|
39570
39573
|
{ HTML: { Title: '波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: '波浪尺' },
|
|
39571
|
-
{ HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-
|
|
39574
|
+
{ HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler2' }, Name: 'AB波浪尺' },
|
|
39572
39575
|
{ HTML: { Title: '箱型线', IClass: 'iconfont icon-draw_box', ID: 'icon-drawbox' }, Name: '箱型线' },
|
|
39573
39576
|
{ HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment2' }, Name: '涂鸦线段' },
|
|
39574
39577
|
|
|
@@ -48551,7 +48554,8 @@ function DynamicMinuteTitlePainting()
|
|
|
48551
48554
|
|
|
48552
48555
|
if (beforeItem && dataItem) //盘前数据
|
|
48553
48556
|
{
|
|
48554
|
-
if (beforeItem.Date>dataItem.Date || (beforeItem.Date==dataItem.Date && beforeItem.Time>dataItem.Time &&
|
|
48557
|
+
if (beforeItem.Date>dataItem.Date || (beforeItem.Date==dataItem.Date && beforeItem.Time>dataItem.Time && beforeDataVer==1.0)
|
|
48558
|
+
|| (beforeItem.Date==dataItem.Date && parseInt(beforeItem.Time>dataItem.Time) && beforeDataVer==2.0))
|
|
48555
48559
|
return { Type:2, Data:beforeItem, Ver: beforeDataVer, Explain:beforeExplain};
|
|
48556
48560
|
}
|
|
48557
48561
|
|
|
@@ -51965,7 +51969,9 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
51965
51969
|
{ Name:"AnchoredText", ClassName:"ChartDrawAnchoredText", Create:function() { return new ChartDrawAnchoredText();} },
|
|
51966
51970
|
{ Name:"PriceLabel", ClassName:"ChartDrawPriceLabel", Create:function() { return new ChartDrawPriceLabel();} },
|
|
51967
51971
|
{ Name:"PriceNote", ClassName:"ChartDrawPriceNote", Create:function() { return new ChartDrawPriceNote();} },
|
|
51968
|
-
{ Name:"FibWedge", ClassName:"ChartDrawFibWedge", Create:function(){ return new ChartDrawFibWedge(); }}
|
|
51972
|
+
{ Name:"FibWedge", ClassName:"ChartDrawFibWedge", Create:function(){ return new ChartDrawFibWedge(); }},
|
|
51973
|
+
{ Name:"FibRetracement", ClassName:"ChartFibRetracement", Create:function() { return new ChartFibRetracement(); }}, //斐波那契回测
|
|
51974
|
+
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }} //斐波那契扇形
|
|
51969
51975
|
];
|
|
51970
51976
|
|
|
51971
51977
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -54236,7 +54242,7 @@ function ChartDrawPictureParallelChannel()
|
|
|
54236
54242
|
var ptCenter=new Point();
|
|
54237
54243
|
ptCenter.X=linePoint.Start.X+(linePoint.End.X-linePoint.Start.X)/2;
|
|
54238
54244
|
ptCenter.Y=linePoint.Start.Y+(linePoint.End.Y-linePoint.Start.Y)/2;
|
|
54239
|
-
drawPoint[
|
|
54245
|
+
drawPoint[2]=ptCenter;
|
|
54240
54246
|
|
|
54241
54247
|
this.Point[2]=ptCenter;
|
|
54242
54248
|
var xValue=parseInt(this.Frame.GetXData(ptCenter.X))+data.DataOffset;
|
|
@@ -54669,6 +54675,7 @@ function ChartDrawPictureGannFan()
|
|
|
54669
54675
|
else return 3;
|
|
54670
54676
|
}
|
|
54671
54677
|
|
|
54678
|
+
|
|
54672
54679
|
//isDotline 是否是虚线
|
|
54673
54680
|
this.DrawLine=function(ptStart,ptEnd,isDottedline)
|
|
54674
54681
|
{
|
|
@@ -59448,6 +59455,423 @@ function ChartDrawFibWedge()
|
|
|
59448
59455
|
|
|
59449
59456
|
}
|
|
59450
59457
|
|
|
59458
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
59459
|
+
// 斐波那契回测
|
|
59460
|
+
//
|
|
59461
|
+
function ChartFibRetracement()
|
|
59462
|
+
{
|
|
59463
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
59464
|
+
this.newMethod();
|
|
59465
|
+
delete this.newMethod;
|
|
59466
|
+
|
|
59467
|
+
this.ClassName='ChartFibRetracement';
|
|
59468
|
+
this.PointCount=2;
|
|
59469
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
59470
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
59471
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
59472
|
+
this.PointToValue_Default=this.PointToValue;
|
|
59473
|
+
this.OnlyMoveXIndex=true;
|
|
59474
|
+
this.IsSupportMagnet=true;
|
|
59475
|
+
this.LineDash=[6,3];
|
|
59476
|
+
this.LineWidth=1;
|
|
59477
|
+
this.EnableBGColor=true;
|
|
59478
|
+
this.ExtendLine={ Left:false, Right: false }; //延长线
|
|
59479
|
+
|
|
59480
|
+
this.AreaConfig=
|
|
59481
|
+
{
|
|
59482
|
+
AryData:
|
|
59483
|
+
[
|
|
59484
|
+
{ Value: 0, Color:"rgb(128,128,128)", Enable:true },
|
|
59485
|
+
{ Value: 0.236, Color:"rgb(242,52,69)", Enable:true },
|
|
59486
|
+
{ Value: 0.382, Color:"rgb(255,152,0)",Enable:true },
|
|
59487
|
+
{ Value: 0.5, Color:"rgb(76,175,80)", Enable:true },
|
|
59488
|
+
{ Value: 0.618, Color:"rgb(8,153,129)", Enable:true },
|
|
59489
|
+
{ Value: 0.786, Color:"rgb(0,188,212)" ,Enable:true },
|
|
59490
|
+
{ Value: 1, Color:"rgb(120,123,134)", Enable:true },
|
|
59491
|
+
{ Value: 1.618, Color:"rgb(41,98,255)",Enable:true },
|
|
59492
|
+
{ Value: 2.618, Color:"rgb(242,54,69)",Enable:false },
|
|
59493
|
+
],
|
|
59494
|
+
|
|
59495
|
+
Opacity:0.3
|
|
59496
|
+
}
|
|
59497
|
+
|
|
59498
|
+
this.SetOption=function(option)
|
|
59499
|
+
{
|
|
59500
|
+
if (!option) return;
|
|
59501
|
+
|
|
59502
|
+
if (option.Font) this.Font=option.Font;
|
|
59503
|
+
if (option.LineWidth) this.LineWidth=option.LineWidth;
|
|
59504
|
+
if (option.LineDash) this.LineDash=option.LineDash;
|
|
59505
|
+
if (IFrameSplitOperator.IsBool(option.EnableBGColor)) this.EnableBGColor=option.EnableBGColor;
|
|
59506
|
+
if (option.ExtendLine)
|
|
59507
|
+
{
|
|
59508
|
+
var item=option.ExtendLine;
|
|
59509
|
+
if (IFrameSplitOperator.IsBool(item.Left)) this.ExtendLine.Left=item.Left;
|
|
59510
|
+
if (IFrameSplitOperator.IsBool(item.Right)) this.ExtendLine.Left=item.Right;
|
|
59511
|
+
}
|
|
59512
|
+
|
|
59513
|
+
if (option.AreaConfig) this.AreaConfig=option.AreaConfig;
|
|
59514
|
+
}
|
|
59515
|
+
|
|
59516
|
+
//导出成存储格式
|
|
59517
|
+
this.ExportStorageData=function()
|
|
59518
|
+
{
|
|
59519
|
+
var storageData=this.ExportBaseData();
|
|
59520
|
+
|
|
59521
|
+
storageData.Value=[];
|
|
59522
|
+
for(var i=0;i<this.Value.length && i<this.PointCount;++i)
|
|
59523
|
+
{
|
|
59524
|
+
var item=this.Value[i];
|
|
59525
|
+
storageData.Value.push( { XValue:item.XValue, YValue:item.YValue } );
|
|
59526
|
+
}
|
|
59527
|
+
|
|
59528
|
+
storageData.Font=this.Font;
|
|
59529
|
+
storageData.EnableBGColor=this.EnableBGColor;
|
|
59530
|
+
storageData.LineDash=this.LineDash;
|
|
59531
|
+
storageData.ExtendLine={ Left:this.ExtendLine.Left, Right:this.ExtendLine.Right };
|
|
59532
|
+
storageData.AreaConfig=CloneData(this.AreaConfig);
|
|
59533
|
+
|
|
59534
|
+
return storageData;
|
|
59535
|
+
}
|
|
59536
|
+
|
|
59537
|
+
this.ImportStorageData=function(storageData)
|
|
59538
|
+
{
|
|
59539
|
+
if (storageData.Font) this.Font=storageData.Font;
|
|
59540
|
+
if (storageData.LineDash) this.LineDash=storageData.LineDash;
|
|
59541
|
+
if (IFrameSplitOperator.IsBool(storageData.EnableBGColor)) this.EnableBGColor=storageData.EnableBGColor;
|
|
59542
|
+
if (storageData.ExtendLine) this.ExtendLine=storageData.ExtendLine;
|
|
59543
|
+
if (storageData.AreaConfig) this.AreaConfig=storageData.AreaConfig;
|
|
59544
|
+
}
|
|
59545
|
+
|
|
59546
|
+
this.Draw=function()
|
|
59547
|
+
{
|
|
59548
|
+
this.LinePoint=[];
|
|
59549
|
+
if (this.IsFrameMinSize()) return;
|
|
59550
|
+
var bCheckXY=true;
|
|
59551
|
+
if (this.ExtendLine.Left || this.ExtendLine.Right) bCheckXY=false;
|
|
59552
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
|
|
59553
|
+
if (!drawPoint) return;
|
|
59554
|
+
if (drawPoint.length!=2) return;
|
|
59555
|
+
|
|
59556
|
+
this.ClipFrame();
|
|
59557
|
+
|
|
59558
|
+
var ptStart=drawPoint[0];
|
|
59559
|
+
var ptEnd=drawPoint[1];
|
|
59560
|
+
|
|
59561
|
+
this.SetLineWidth();
|
|
59562
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
59563
|
+
this.Canvas.setLineDash(this.LineDash);
|
|
59564
|
+
this.Canvas.beginPath();
|
|
59565
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
59566
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
59567
|
+
this.Canvas.stroke();
|
|
59568
|
+
this.Canvas.setLineDash([]);
|
|
59569
|
+
|
|
59570
|
+
this.DrawBlock(ptStart, ptEnd);
|
|
59571
|
+
|
|
59572
|
+
this.RestoreLineWidth();
|
|
59573
|
+
|
|
59574
|
+
var line={Start:ptStart, End:ptEnd};
|
|
59575
|
+
this.LinePoint.push(line);
|
|
59576
|
+
|
|
59577
|
+
this.DrawPoint(drawPoint); //画点
|
|
59578
|
+
this.Canvas.restore();
|
|
59579
|
+
}
|
|
59580
|
+
|
|
59581
|
+
this.GetArrayAreaConfig=function()
|
|
59582
|
+
{
|
|
59583
|
+
var aryArea=[];
|
|
59584
|
+
for(var i=0;i<this.AreaConfig.AryData.length;++i)
|
|
59585
|
+
{
|
|
59586
|
+
var item=this.AreaConfig.AryData[i];
|
|
59587
|
+
if (item.Enable) aryArea.push(item);
|
|
59588
|
+
}
|
|
59589
|
+
|
|
59590
|
+
aryArea.sort((left,right)=>{ return right.Value-left.Value; })
|
|
59591
|
+
|
|
59592
|
+
return aryArea;
|
|
59593
|
+
}
|
|
59594
|
+
|
|
59595
|
+
this.DrawBlock=function(ptStart, ptEnd)
|
|
59596
|
+
{
|
|
59597
|
+
var yTop=Math.min(ptStart.Y, ptEnd.Y);
|
|
59598
|
+
var yBottom=Math.max(ptStart.Y, ptEnd.Y);
|
|
59599
|
+
var xLeft=Math.min(ptStart.X, ptEnd.X);
|
|
59600
|
+
var xRight=Math.max(ptStart.X, ptEnd.X);
|
|
59601
|
+
var height=yBottom-yTop;
|
|
59602
|
+
//var baseValue=Math.min(this.Value[0].YValue, this.Value[1].YValue);
|
|
59603
|
+
//var diffValue=Math.abs(this.Value[0].YValue-this.Value[1].YValue); //差值
|
|
59604
|
+
|
|
59605
|
+
if (this.ExtendLine.Right) xRight=this.Frame.ChartBorder.GetRight();
|
|
59606
|
+
if (this.ExtendLine.Left) xLeft=this.Frame.ChartBorder.GetLeft();
|
|
59607
|
+
|
|
59608
|
+
var aryArea=this.GetArrayAreaConfig();
|
|
59609
|
+
var yPre=null; //上一个点
|
|
59610
|
+
var clrArea=null;
|
|
59611
|
+
this.Canvas.font=this.Font;
|
|
59612
|
+
if (this.ExtendLine.Left) this.Canvas.textAlign="left";
|
|
59613
|
+
else this.Canvas.textAlign="right";
|
|
59614
|
+
this.Canvas.textBaseline="bottom";
|
|
59615
|
+
|
|
59616
|
+
for(var i=0;i<aryArea.length;++i)
|
|
59617
|
+
{
|
|
59618
|
+
var item=aryArea[i];
|
|
59619
|
+
var y=yBottom-height*item.Value;
|
|
59620
|
+
//var yValue=baseValue+diffValue*item.Value;
|
|
59621
|
+
yValue=this.Frame.GetYData(y,false);
|
|
59622
|
+
y=ToFixedPoint(y);
|
|
59623
|
+
if (this.EnableBGColor && IFrameSplitOperator.IsNumber(yPre))
|
|
59624
|
+
{
|
|
59625
|
+
var rtBG={ Left:xLeft, Right:xRight, Top:yPre, Bottom:y };
|
|
59626
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
59627
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
59628
|
+
this.Canvas.fillStyle=clrArea;
|
|
59629
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
59630
|
+
}
|
|
59631
|
+
|
|
59632
|
+
this.Canvas.strokeStyle=item.Color;
|
|
59633
|
+
this.Canvas.beginPath();
|
|
59634
|
+
this.Canvas.moveTo(xLeft,y);
|
|
59635
|
+
this.Canvas.lineTo(xRight,y);
|
|
59636
|
+
this.Canvas.stroke();
|
|
59637
|
+
|
|
59638
|
+
var line={ Start:{X:xLeft, Y:y}, End:{X:xRight, Y:y} };
|
|
59639
|
+
this.LinePoint.push(line);
|
|
59640
|
+
|
|
59641
|
+
//文字
|
|
59642
|
+
var text=`${item.Value} (${yValue.toFixed(2)})`;
|
|
59643
|
+
this.Canvas.fillStyle=item.Color;
|
|
59644
|
+
if (this.ExtendLine.Left)
|
|
59645
|
+
this.Canvas.fillText(text,xLeft+2,y-2);
|
|
59646
|
+
else
|
|
59647
|
+
this.Canvas.fillText(text,xLeft-2,y-2);
|
|
59648
|
+
|
|
59649
|
+
yPre=y;
|
|
59650
|
+
clrArea=IChartDrawPicture.ColorToRGBA(item.Color, this.AreaConfig.Opacity);
|
|
59651
|
+
}
|
|
59652
|
+
}
|
|
59653
|
+
|
|
59654
|
+
}
|
|
59655
|
+
|
|
59656
|
+
|
|
59657
|
+
function ChartFibSpeedResistanceFan()
|
|
59658
|
+
{
|
|
59659
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
59660
|
+
this.newMethod();
|
|
59661
|
+
delete this.newMethod;
|
|
59662
|
+
|
|
59663
|
+
this.ClassName='ChartFibSpeedResistanceFan';
|
|
59664
|
+
this.PointCount=2;
|
|
59665
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
59666
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
59667
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
59668
|
+
this.PointToValue_Default=this.PointToValue;
|
|
59669
|
+
this.OnlyMoveXIndex=true;
|
|
59670
|
+
this.IsSupportMagnet=true;
|
|
59671
|
+
this.LineWidth=1;
|
|
59672
|
+
this.EnableBGColor=true;
|
|
59673
|
+
|
|
59674
|
+
this.AreaConfig=
|
|
59675
|
+
{
|
|
59676
|
+
AryYData:
|
|
59677
|
+
[
|
|
59678
|
+
{ Value: 0, Color:"rgb(128,128,128)", Enable:true },
|
|
59679
|
+
{ Value: 0.25, Color:"rgb(242,52,69)", Enable:true },
|
|
59680
|
+
{ Value: 0.382, Color:"rgb(255,152,0)",Enable:true },
|
|
59681
|
+
{ Value: 0.5, Color:"rgb(76,175,80)", Enable:true },
|
|
59682
|
+
{ Value: 0.618, Color:"rgb(8,153,129)", Enable:true },
|
|
59683
|
+
{ Value: 0.75, Color:"rgb(0,188,212)" ,Enable:true },
|
|
59684
|
+
{ Value: 1, Color:"rgb(120,123,134)", Enable:true },
|
|
59685
|
+
|
|
59686
|
+
],
|
|
59687
|
+
|
|
59688
|
+
AryXData:
|
|
59689
|
+
[
|
|
59690
|
+
{ Value: 0, Color:"rgb(128,128,128)", Enable:true },
|
|
59691
|
+
{ Value: 0.25, Color:"rgb(242,52,69)", Enable:true },
|
|
59692
|
+
{ Value: 0.382, Color:"rgb(255,152,0)",Enable:true },
|
|
59693
|
+
{ Value: 0.5, Color:"rgb(76,175,80)", Enable:true },
|
|
59694
|
+
{ Value: 0.618, Color:"rgb(8,153,129)", Enable:true },
|
|
59695
|
+
{ Value: 0.75, Color:"rgb(0,188,212)" ,Enable:true },
|
|
59696
|
+
{ Value: 1, Color:"rgb(120,123,134)", Enable:true },
|
|
59697
|
+
],
|
|
59698
|
+
|
|
59699
|
+
Opacity:0.3
|
|
59700
|
+
}
|
|
59701
|
+
|
|
59702
|
+
this.Draw=function()
|
|
59703
|
+
{
|
|
59704
|
+
this.LinePoint=[];
|
|
59705
|
+
if (this.IsFrameMinSize()) return;
|
|
59706
|
+
var bCheckXY=false;
|
|
59707
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
|
|
59708
|
+
if (!drawPoint) return;
|
|
59709
|
+
if (drawPoint.length!=2) return;
|
|
59710
|
+
|
|
59711
|
+
this.ClipFrame();
|
|
59712
|
+
|
|
59713
|
+
var ptStart=drawPoint[0];
|
|
59714
|
+
var ptEnd=drawPoint[1];
|
|
59715
|
+
|
|
59716
|
+
this.SetLineWidth();
|
|
59717
|
+
this.DrawBlock(ptEnd, ptStart);
|
|
59718
|
+
this.RestoreLineWidth();
|
|
59719
|
+
|
|
59720
|
+
this.DrawPoint(drawPoint); //画点
|
|
59721
|
+
this.Canvas.restore();
|
|
59722
|
+
}
|
|
59723
|
+
|
|
59724
|
+
//获取在第几象限
|
|
59725
|
+
this.GetQuadrant=function(ptStart,ptEnd)
|
|
59726
|
+
{
|
|
59727
|
+
if (ptStart.X<ptEnd.X && ptStart.Y>ptEnd.Y) return 1;
|
|
59728
|
+
else if (ptStart.X>ptEnd.X && ptStart.Y>ptEnd.Y) return 2;
|
|
59729
|
+
else if (ptStart.X<ptEnd.X && ptStart.Y< ptEnd.Y) return 4;
|
|
59730
|
+
else return 3;
|
|
59731
|
+
}
|
|
59732
|
+
|
|
59733
|
+
this.DrawBlock=function(ptStart, ptEnd)
|
|
59734
|
+
{
|
|
59735
|
+
var center=ptEnd;
|
|
59736
|
+
var xDiff=ptEnd.X-ptStart.X;
|
|
59737
|
+
var yDiff=ptEnd.Y-ptStart.Y;
|
|
59738
|
+
var quadrant=this.GetQuadrant(center,ptStart); //象限
|
|
59739
|
+
|
|
59740
|
+
var aryYData=this.GetArrayAreaConfig(this.AreaConfig.AryYData);
|
|
59741
|
+
var ptPre=null; //上一个点
|
|
59742
|
+
var clrArea=null;
|
|
59743
|
+
this.Canvas.font=this.Font;
|
|
59744
|
+
var textOffset=4;
|
|
59745
|
+
if (quadrant==1 || quadrant==4)
|
|
59746
|
+
{
|
|
59747
|
+
this.Canvas.textAlign="right";
|
|
59748
|
+
textOffset=-4;
|
|
59749
|
+
}
|
|
59750
|
+
else
|
|
59751
|
+
{
|
|
59752
|
+
this.Canvas.textAlign="left";
|
|
59753
|
+
textOffset=4;
|
|
59754
|
+
}
|
|
59755
|
+
this.Canvas.textBaseline="middle";
|
|
59756
|
+
for(var i=0;i<aryYData.length;++i)
|
|
59757
|
+
{
|
|
59758
|
+
var item=aryYData[i];
|
|
59759
|
+
var y=item.Value*yDiff+ptStart.Y;
|
|
59760
|
+
|
|
59761
|
+
var pt=this.CalculateExtendLineEndPoint([center, {X:ptStart.X, Y:y}]);
|
|
59762
|
+
|
|
59763
|
+
if (ptPre)
|
|
59764
|
+
{
|
|
59765
|
+
this.Canvas.beginPath();
|
|
59766
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
59767
|
+
this.Canvas.lineTo(ptPre.X,ptPre.Y);
|
|
59768
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
59769
|
+
this.Canvas.closePath();
|
|
59770
|
+
this.Canvas.fillStyle=clrArea;
|
|
59771
|
+
this.Canvas.fill();
|
|
59772
|
+
}
|
|
59773
|
+
|
|
59774
|
+
this.Canvas.strokeStyle=item.Color;
|
|
59775
|
+
this.Canvas.beginPath();
|
|
59776
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
59777
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
59778
|
+
this.Canvas.stroke();
|
|
59779
|
+
|
|
59780
|
+
this.LinePoint.push({Start:center, End:pt});
|
|
59781
|
+
|
|
59782
|
+
if (item.Value!=1)
|
|
59783
|
+
{
|
|
59784
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
59785
|
+
this.Canvas.beginPath();
|
|
59786
|
+
this.Canvas.moveTo(center.X,y);
|
|
59787
|
+
this.Canvas.lineTo(ptStart.X,y);
|
|
59788
|
+
this.Canvas.stroke();
|
|
59789
|
+
}
|
|
59790
|
+
|
|
59791
|
+
ptPre=pt;
|
|
59792
|
+
clrArea=IChartDrawPicture.ColorToRGBA(item.Color, this.AreaConfig.Opacity);
|
|
59793
|
+
|
|
59794
|
+
//文字
|
|
59795
|
+
var text=`${item.Value}`;
|
|
59796
|
+
this.Canvas.fillStyle=item.Color;
|
|
59797
|
+
this.Canvas.fillText(text,center.X+textOffset,y);
|
|
59798
|
+
}
|
|
59799
|
+
|
|
59800
|
+
var aryXData=this.GetArrayAreaConfig(this.AreaConfig.AryXData);
|
|
59801
|
+
var ptPre=null;
|
|
59802
|
+
this.Canvas.textAlign="center";
|
|
59803
|
+
if (quadrant==3 || quadrant==4)
|
|
59804
|
+
{
|
|
59805
|
+
this.Canvas.textBaseline="bottom";
|
|
59806
|
+
textOffset=-5;
|
|
59807
|
+
}
|
|
59808
|
+
else
|
|
59809
|
+
{
|
|
59810
|
+
this.Canvas.textBaseline="top";
|
|
59811
|
+
textOffset=5;
|
|
59812
|
+
}
|
|
59813
|
+
|
|
59814
|
+
for(var i=0;i<aryXData.length;++i)
|
|
59815
|
+
{
|
|
59816
|
+
var item=aryXData[i];
|
|
59817
|
+
var x=item.Value*xDiff+ptStart.X;
|
|
59818
|
+
|
|
59819
|
+
var pt=this.CalculateExtendLineEndPoint([center, {X:x, Y:ptStart.Y}]);
|
|
59820
|
+
|
|
59821
|
+
if (ptPre) //面积
|
|
59822
|
+
{
|
|
59823
|
+
this.Canvas.beginPath();
|
|
59824
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
59825
|
+
this.Canvas.lineTo(ptPre.X,ptPre.Y);
|
|
59826
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
59827
|
+
this.Canvas.closePath();
|
|
59828
|
+
this.Canvas.fillStyle=clrArea;
|
|
59829
|
+
this.Canvas.fill();
|
|
59830
|
+
}
|
|
59831
|
+
|
|
59832
|
+
this.Canvas.strokeStyle=item.Color;
|
|
59833
|
+
this.Canvas.beginPath();
|
|
59834
|
+
this.Canvas.moveTo(center.X,center.Y);
|
|
59835
|
+
this.Canvas.lineTo(pt.X,pt.Y);
|
|
59836
|
+
this.Canvas.stroke();
|
|
59837
|
+
|
|
59838
|
+
this.LinePoint.push({Start:center, End:pt});
|
|
59839
|
+
|
|
59840
|
+
if (item.Value!=1)
|
|
59841
|
+
{
|
|
59842
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
59843
|
+
this.Canvas.beginPath();
|
|
59844
|
+
this.Canvas.moveTo(x,center.Y);
|
|
59845
|
+
this.Canvas.lineTo(x,ptStart.Y);
|
|
59846
|
+
this.Canvas.stroke();
|
|
59847
|
+
}
|
|
59848
|
+
|
|
59849
|
+
ptPre=pt;
|
|
59850
|
+
clrArea=IChartDrawPicture.ColorToRGBA(item.Color, this.AreaConfig.Opacity);
|
|
59851
|
+
|
|
59852
|
+
//文字
|
|
59853
|
+
var text=`${item.Value}`;
|
|
59854
|
+
this.Canvas.fillStyle=item.Color;
|
|
59855
|
+
this.Canvas.fillText(text,x,center.Y+textOffset);
|
|
59856
|
+
}
|
|
59857
|
+
}
|
|
59858
|
+
|
|
59859
|
+
this.GetArrayAreaConfig=function(aryData)
|
|
59860
|
+
{
|
|
59861
|
+
var aryArea=[];
|
|
59862
|
+
for(var i=0;i<aryData.length;++i)
|
|
59863
|
+
{
|
|
59864
|
+
var item=aryData[i];
|
|
59865
|
+
if (item.Enable) aryArea.push(item);
|
|
59866
|
+
}
|
|
59867
|
+
|
|
59868
|
+
aryArea.sort((left,right)=>{ return right.Value-left.Value; })
|
|
59869
|
+
|
|
59870
|
+
return aryArea;
|
|
59871
|
+
}
|
|
59872
|
+
|
|
59873
|
+
}
|
|
59874
|
+
|
|
59451
59875
|
function ChartDrawStorage()
|
|
59452
59876
|
{
|
|
59453
59877
|
this.DrawData=new Map(); //画图工具数据 key=symbol-Period, value=Map() Key:Guid, Value:{Guid, Symbol, Period, ClassName, Value}
|