hqchart 1.1.13600 → 1.1.13614
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 +99 -83
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +1 -0
- package/src/jscommon/umychart.js +320 -22
- package/src/jscommon/umychart.style.js +3 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +324 -24
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +325 -24
package/package.json
CHANGED
|
@@ -112,6 +112,7 @@ function JSDialogDrawTool()
|
|
|
112
112
|
[
|
|
113
113
|
{ Title: '价格范围', ClassName: 'hqchart_drawtool icon-shijianfanwei', Type:0, Data:{ ID:"PriceRange" } },
|
|
114
114
|
{ Title: '时间范围', ClassName: 'hqchart_drawtool icon-jiagefanwei', Type:0, Data:{ ID:"DateRange" } },
|
|
115
|
+
{ Title: "价格和时间范围", ClassName:"hqchart_drawtool icon-jiagefanwei", Type:0, Data:{ ID:"DatePriceRange" } },
|
|
115
116
|
{ Title: "监测线", ClassName:"hqchart_drawtool icon-jiance", Type:0, Data:{ ID:"MonitorLine"} },
|
|
116
117
|
]
|
|
117
118
|
},
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -692,7 +692,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
692
692
|
|
|
693
693
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
694
694
|
else item.TitleHeight=chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;
|
|
695
|
-
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow))
|
|
695
|
+
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
696
|
+
if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) frame.TitleArrowType=item.TitleArrowType;
|
|
696
697
|
if (item.IsShowIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;
|
|
697
698
|
if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
|
|
698
699
|
if (IFrameSplitOperator.IsNumber(item.IndexParamSpace)) chart.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;
|
|
@@ -1161,7 +1162,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1161
1162
|
if (IFrameSplitOperator.IsBool(item.IsDrawTitleBG)) chart.Frame.SubFrame[index].Frame.IsDrawTitleBG=item.IsDrawTitleBG;
|
|
1162
1163
|
if (IFrameSplitOperator.IsBool(item.IsShowNameArrow)) chart.Frame.SubFrame[index].Frame.IsShowNameArrow=item.IsShowNameArrow;
|
|
1163
1164
|
|
|
1164
|
-
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow))
|
|
1165
|
+
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
1166
|
+
if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) frame.TitleArrowType=item.TitleArrowType;
|
|
1165
1167
|
if (item.IsShowIndexName==false) chart.Frame.SubFrame[index].Frame.IsShowIndexName=false;
|
|
1166
1168
|
if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[index].Frame.IsShowOverlayIndexName=false;
|
|
1167
1169
|
if (!IFrameSplitOperator.IsUndefined(item.HorizontalReserved)) frame.HorizontalReserved=item.HorizontalReserved;
|
|
@@ -1572,7 +1574,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1572
1574
|
if (IFrameSplitOperator.IsBool(item.IsShowNameArrow)) chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;
|
|
1573
1575
|
|
|
1574
1576
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
1575
|
-
|
|
1576
1577
|
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) chart.Frame.SubFrame[i].Frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
1577
1578
|
if (item.IsShowIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;
|
|
1578
1579
|
if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
|
|
@@ -7101,6 +7102,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7101
7102
|
if (!subItem || !subItem.Frame) continue;
|
|
7102
7103
|
|
|
7103
7104
|
var frame=subItem.Frame;
|
|
7105
|
+
|
|
7106
|
+
//自定义刻度每次都调用
|
|
7107
|
+
frame.YCustomSplit=true;
|
|
7108
|
+
|
|
7104
7109
|
var key=frame.Identify;
|
|
7105
7110
|
var item=
|
|
7106
7111
|
{
|
|
@@ -8392,6 +8397,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8392
8397
|
else windowItem.TitleHeight=frame.ChartBorder.TitleHeight;
|
|
8393
8398
|
|
|
8394
8399
|
if (IFrameSplitOperator.IsBool(windowItem.IsShowTitleArrow)) frame.IsShowTitleArrow=windowItem.IsShowTitleArrow;
|
|
8400
|
+
if (IFrameSplitOperator.IsNumber(windowItem.TitleArrowType)) frame.TitleArrowType=windowItem.TitleArrowType;
|
|
8395
8401
|
if (IFrameSplitOperator.IsBool(windowItem.IsShowIndexName)) frame.IsShowIndexName=windowItem.IsShowIndexName;
|
|
8396
8402
|
if (IFrameSplitOperator.IsNumber(windowItem.IndexParamSpace)) frame.IndexParamSpace=windowItem.IndexParamSpace;
|
|
8397
8403
|
if (IFrameSplitOperator.IsNumber(windowItem.IndexTitleSpace)) frame.IndexTitleSpace=windowItem.IndexTitleSpace;
|
|
@@ -8454,6 +8460,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8454
8460
|
if (IFrameSplitOperator.IsNumber(option.SplitCount)) subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;
|
|
8455
8461
|
if (IFrameSplitOperator.IsNumber(option.TitleHeight)) subFrame.Frame.ChartBorder.TitleHeight=option.TitleHeight;
|
|
8456
8462
|
if (IFrameSplitOperator.IsBool(option.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;
|
|
8463
|
+
if (IFrameSplitOperator.IsNumber(option.TitleArrowType)) subFrame.Frame.TitleArrowType=option.TitleArrowType;
|
|
8457
8464
|
if (IFrameSplitOperator.IsBool(option.IsShowIndexName)) subFrame.Frame.IsShowIndexName=option.IsShowIndexName;
|
|
8458
8465
|
if (IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName)) subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;
|
|
8459
8466
|
if (IFrameSplitOperator.IsNumber(option.IndexParamSpace)) subFrame.Frame.IndexParamSpace=option.IndexParamSpace;
|
|
@@ -10272,6 +10279,7 @@ function IChartFramePainting()
|
|
|
10272
10279
|
this.SizeChange=true; //大小是否改变
|
|
10273
10280
|
this.XYSplit=true; //XY轴坐标信息改变
|
|
10274
10281
|
this.XSplit=true; //X轴变化
|
|
10282
|
+
this.YCustomSplit=true; //自定义Y轴分割线
|
|
10275
10283
|
|
|
10276
10284
|
this.HorizontalMax; //Y轴最大值
|
|
10277
10285
|
this.HorizontalMin; //Y轴最小值
|
|
@@ -10293,6 +10301,7 @@ function IChartFramePainting()
|
|
|
10293
10301
|
this.YSpecificMaxMin=null; //指定Y轴最大最小值
|
|
10294
10302
|
this.IsShowBorder = true; //是否显示边框
|
|
10295
10303
|
this.IsShowTitleArrow=true; //是否显示指标信息上涨下跌箭头
|
|
10304
|
+
this.TitleArrowType=g_JSChartResource.IndexTitle.ArrowType; //指标信息上涨下跌箭头类型 0=独立颜色 1=跟指标名字颜色一致
|
|
10296
10305
|
this.IsShowIndexName=true; //是否显示指标名字
|
|
10297
10306
|
this.IsShowOverlayIndexName=true; //是否显示叠加指标名字
|
|
10298
10307
|
//this.OverlayIndexType= { Position:0, LineSpace:5 };
|
|
@@ -10353,6 +10362,7 @@ function IChartFramePainting()
|
|
|
10353
10362
|
this.SizeChange=false;
|
|
10354
10363
|
this.XYSplit=false;
|
|
10355
10364
|
this.XSplit=false;
|
|
10365
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
10356
10366
|
}
|
|
10357
10367
|
|
|
10358
10368
|
this.DrawFrame=function() { }
|
|
@@ -13508,7 +13518,18 @@ function MinuteFrame()
|
|
|
13508
13518
|
//分割x,y轴坐标信息
|
|
13509
13519
|
this.SplitXYCoordinate=function()
|
|
13510
13520
|
{
|
|
13511
|
-
if (this.XYSplit==false)
|
|
13521
|
+
if (this.XYSplit==false)
|
|
13522
|
+
{
|
|
13523
|
+
//计算自定义刻度
|
|
13524
|
+
if (this.YCustomSplit)
|
|
13525
|
+
{
|
|
13526
|
+
if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate)
|
|
13527
|
+
this.YSplitOperator.CustomCoordinate();
|
|
13528
|
+
}
|
|
13529
|
+
|
|
13530
|
+
return;
|
|
13531
|
+
}
|
|
13532
|
+
|
|
13512
13533
|
if (this.XSplitOperator!=null) this.XSplitOperator.Operator();
|
|
13513
13534
|
if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
|
|
13514
13535
|
}
|
|
@@ -14966,6 +14987,8 @@ function OverlayMinuteFrame()
|
|
|
14966
14987
|
|
|
14967
14988
|
this.SizeChange=false;
|
|
14968
14989
|
this.XYSplit=false;
|
|
14990
|
+
this.XSplit=false;
|
|
14991
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
14969
14992
|
}
|
|
14970
14993
|
|
|
14971
14994
|
this.DrawToolbar=function()
|
|
@@ -15022,6 +15045,8 @@ function OverlayMinuteHScreenFrame()
|
|
|
15022
15045
|
|
|
15023
15046
|
this.SizeChange=false;
|
|
15024
15047
|
this.XYSplit=false;
|
|
15048
|
+
this.XSplit=false;
|
|
15049
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
15025
15050
|
}
|
|
15026
15051
|
|
|
15027
15052
|
//分割x,y轴坐标信息
|
|
@@ -15630,7 +15655,13 @@ function KLineFrame()
|
|
|
15630
15655
|
if (this.XSplit)
|
|
15631
15656
|
{
|
|
15632
15657
|
if (this.XSplitOperator) this.XSplitOperator.Operator();
|
|
15633
|
-
|
|
15658
|
+
}
|
|
15659
|
+
|
|
15660
|
+
if (this.YCustomSplit)
|
|
15661
|
+
{
|
|
15662
|
+
//计算自定义刻度
|
|
15663
|
+
if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate)
|
|
15664
|
+
this.YSplitOperator.CustomCoordinate();
|
|
15634
15665
|
}
|
|
15635
15666
|
|
|
15636
15667
|
return;
|
|
@@ -16402,6 +16433,7 @@ function OverlayKLineFrame()
|
|
|
16402
16433
|
this.SizeChange=false;
|
|
16403
16434
|
this.XYSplit=false;
|
|
16404
16435
|
this.XSplit=false;
|
|
16436
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
16405
16437
|
}
|
|
16406
16438
|
|
|
16407
16439
|
|
|
@@ -17689,6 +17721,8 @@ function OverlayKLineHScreenFrame()
|
|
|
17689
17721
|
|
|
17690
17722
|
this.SizeChange=false;
|
|
17691
17723
|
this.XYSplit=false;
|
|
17724
|
+
this.XSplit=false;
|
|
17725
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
17692
17726
|
}
|
|
17693
17727
|
|
|
17694
17728
|
this.DrawTitle=function() //画标题
|
|
@@ -46400,6 +46434,22 @@ IFrameSplitOperator.IsNumber=function(value)
|
|
|
46400
46434
|
return typeof(value)=='number';
|
|
46401
46435
|
}
|
|
46402
46436
|
|
|
46437
|
+
//批量判断是否是数值类型
|
|
46438
|
+
IFrameSplitOperator.IsNumberV2=function(...aryValue)
|
|
46439
|
+
{
|
|
46440
|
+
if (!aryValue) return false;
|
|
46441
|
+
if (aryValue.length==0) return false;
|
|
46442
|
+
|
|
46443
|
+
for(const value of aryValue)
|
|
46444
|
+
{
|
|
46445
|
+
if (value==null) return false;
|
|
46446
|
+
if (isNaN(value)) return false;
|
|
46447
|
+
if (typeof(value)!='number') return false;
|
|
46448
|
+
}
|
|
46449
|
+
|
|
46450
|
+
return true;
|
|
46451
|
+
}
|
|
46452
|
+
|
|
46403
46453
|
//判断是否是正数
|
|
46404
46454
|
IFrameSplitOperator.IsPlusNumber=function(value)
|
|
46405
46455
|
{
|
|
@@ -48133,6 +48183,8 @@ function FrameSplitMinutePriceY()
|
|
|
48133
48183
|
|
|
48134
48184
|
this.CustomCoordinate=function() //自定义刻度
|
|
48135
48185
|
{
|
|
48186
|
+
this.Frame.CustomHorizontalInfo=[];
|
|
48187
|
+
|
|
48136
48188
|
var data=this.InvokeCustomYCoordinateCallback();
|
|
48137
48189
|
if (data && data.PreventDefault==true) return;
|
|
48138
48190
|
|
|
@@ -53278,9 +53330,11 @@ function DynamicChartTitlePainting()
|
|
|
53278
53330
|
this.ColorIndex; //五彩K线名字 {Name:'名字'}
|
|
53279
53331
|
this.IsShowColorIndexTitle=true;
|
|
53280
53332
|
this.IsShowUpDownArrow=true; //指标数据是否显示 上涨下跌箭头
|
|
53333
|
+
this.TitleArrowType=0; //指标数据上涨下跌箭头类型 0=独立颜色 1=跟指标颜色一致
|
|
53281
53334
|
this.IsShowIndexName=true; //是否显示指标名字
|
|
53282
53335
|
this.IsShowIndexTitle=true; //是否显示指标标题信息
|
|
53283
53336
|
this.IsShowNameArrow=false;
|
|
53337
|
+
this.NameArrowConfig=CloneData(g_JSChartResource.IndexTitle.NameArrow);
|
|
53284
53338
|
|
|
53285
53339
|
this.TradeIndex; //专家系统名字{Name:'名字', Param:'参数'}
|
|
53286
53340
|
this.IsShowTradeIndexTitle=true;
|
|
@@ -53749,6 +53803,7 @@ function DynamicChartTitlePainting()
|
|
|
53749
53803
|
this.IsDrawTitleBG=this.Frame.IsDrawTitleBG;
|
|
53750
53804
|
this.IsShowNameArrow=this.Frame.IsShowNameArrow;
|
|
53751
53805
|
this.IsShowUpDownArrow=this.Frame.IsShowTitleArrow;
|
|
53806
|
+
this.TitleArrowType=this.Frame.TitleArrowType;
|
|
53752
53807
|
this.IsShowIndexName=this.Frame.IsShowIndexName;
|
|
53753
53808
|
this.IsShowOverlayIndexName=this.Frame.IsShowOverlayIndexName;
|
|
53754
53809
|
this.OverlayIndexType.Position=this.Frame.OverlayIndexType.Position;
|
|
@@ -54033,6 +54088,8 @@ function DynamicChartTitlePainting()
|
|
|
54033
54088
|
if (preValue>value) arrowSuper={ Text:'↓', TextColor:this.UpDownArrowConfig.DownColor };
|
|
54034
54089
|
else if (preValue<value) arrowSuper={ Text:'↑', TextColor:this.UpDownArrowConfig.UpColor};
|
|
54035
54090
|
else arrowSuper={ Text:'→', TextColor:this.UpDownArrowConfig.UnchangeColor };
|
|
54091
|
+
|
|
54092
|
+
if (this.TitleArrowType==1) arrowSuper.TextColor=item.Color;
|
|
54036
54093
|
}
|
|
54037
54094
|
}
|
|
54038
54095
|
|
|
@@ -54540,10 +54597,16 @@ function DynamicChartTitlePainting()
|
|
|
54540
54597
|
if (this.IsDrawTitleBG)
|
|
54541
54598
|
{
|
|
54542
54599
|
var title=this.Title;
|
|
54543
|
-
if (this.IsShowNameArrow) title+='▼';
|
|
54544
54600
|
var textWidth=this.Canvas.measureText(title).width;
|
|
54601
|
+
var arrowWidth=0;
|
|
54602
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
54603
|
+
{
|
|
54604
|
+
arrowWidth=this.Canvas.measureText(this.NameArrowConfig.Symbol).width;
|
|
54605
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) arrowWidth+=this.NameArrowConfig.Space;
|
|
54606
|
+
}
|
|
54607
|
+
|
|
54545
54608
|
var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;
|
|
54546
|
-
var bgWidth=textWidth+4*pixelRatio;
|
|
54609
|
+
var bgWidth=textWidth+arrowWidth+4*pixelRatio;
|
|
54547
54610
|
|
|
54548
54611
|
this.TitleRect=
|
|
54549
54612
|
{
|
|
@@ -54563,15 +54626,24 @@ function DynamicChartTitlePainting()
|
|
|
54563
54626
|
this.Canvas.strokeRect(ToFixedPoint(drawRect.Left),ToFixedPoint(drawRect.Top),ToFixedRect(drawRect.Width),ToFixedRect(drawRect.Height));
|
|
54564
54627
|
}
|
|
54565
54628
|
|
|
54629
|
+
var xText=left+2*pixelRatio;
|
|
54566
54630
|
this.Canvas.fillStyle=this.TitleColor;
|
|
54567
|
-
this.Canvas.fillText(title,
|
|
54631
|
+
this.Canvas.fillText(title,xText,bottom);
|
|
54632
|
+
xText+=textWidth;
|
|
54633
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
54634
|
+
{
|
|
54635
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) xText+=this.NameArrowConfig.Space;
|
|
54636
|
+
this.Canvas.fillStyle=this.NameArrowConfig.Color;
|
|
54637
|
+
this.Canvas.fillText(this.NameArrowConfig.Symbol,xText,bottom);
|
|
54638
|
+
}
|
|
54639
|
+
|
|
54568
54640
|
left+=bgWidth+2*pixelRatio;
|
|
54569
54641
|
left+=this.TitleSpace;
|
|
54570
54642
|
}
|
|
54571
54643
|
else
|
|
54572
54644
|
{
|
|
54573
54645
|
this.Canvas.fillStyle=this.TitleColor;
|
|
54574
|
-
this.Canvas.fillText(this.Title,left,bottom
|
|
54646
|
+
this.Canvas.fillText(this.Title,left,bottom);
|
|
54575
54647
|
left+=textWidth;
|
|
54576
54648
|
left+=this.TitleSpace;
|
|
54577
54649
|
}
|
|
@@ -54684,11 +54756,17 @@ function DynamicChartTitlePainting()
|
|
|
54684
54756
|
{
|
|
54685
54757
|
var pixelRatio=GetDevicePixelRatio();
|
|
54686
54758
|
var title=this.Title;
|
|
54687
|
-
if (this.IsShowNameArrow) title+='▼';
|
|
54688
54759
|
var textWidth=this.Canvas.measureText(title).width;
|
|
54760
|
+
var arrowWidth=0;
|
|
54761
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
54762
|
+
{
|
|
54763
|
+
arrowWidth=this.Canvas.measureText(this.NameArrowConfig.Symbol).width;
|
|
54764
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) arrowWidth+=this.NameArrowConfig.Space;
|
|
54765
|
+
}
|
|
54766
|
+
|
|
54689
54767
|
var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;
|
|
54690
54768
|
var roundRadius=this.BorderRoundRadius*pixelRatio;
|
|
54691
|
-
var bgWidth=textWidth+4*pixelRatio+roundRadius*2;
|
|
54769
|
+
var bgWidth=textWidth+arrowWidth+4*pixelRatio+roundRadius*2;
|
|
54692
54770
|
|
|
54693
54771
|
rtButton.Top=rtButton.YCenter-bgHeight/2-1,
|
|
54694
54772
|
rtButton.Width=bgWidth;
|
|
@@ -54734,8 +54812,16 @@ function DynamicChartTitlePainting()
|
|
|
54734
54812
|
}
|
|
54735
54813
|
}
|
|
54736
54814
|
|
|
54815
|
+
var xText=rtButton.Left+roundRadius+2*pixelRatio;
|
|
54737
54816
|
this.Canvas.fillStyle=this.TitleColor;
|
|
54738
|
-
this.Canvas.fillText(title,
|
|
54817
|
+
this.Canvas.fillText(title,xText,rtButton.YCenter);
|
|
54818
|
+
xText+=textWidth;
|
|
54819
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
54820
|
+
{
|
|
54821
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) xText+=this.NameArrowConfig.Space;
|
|
54822
|
+
this.Canvas.fillStyle=this.NameArrowConfig.Color;
|
|
54823
|
+
this.Canvas.fillText(this.NameArrowConfig.Symbol,xText,rtButton.YCenter);
|
|
54824
|
+
}
|
|
54739
54825
|
}
|
|
54740
54826
|
|
|
54741
54827
|
//绘制按钮
|
|
@@ -56413,6 +56499,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
56413
56499
|
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
|
|
56414
56500
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
56415
56501
|
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
56502
|
+
{ Name:"DatePriceRange", ClassName:"ChartDatePriceRange", Create:function() { return new ChartDatePriceRange(); }},
|
|
56416
56503
|
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
56417
56504
|
{ Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
|
|
56418
56505
|
{ Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
|
|
@@ -56949,10 +57036,10 @@ function ChartArrowMarker()
|
|
|
56949
57036
|
this.ClassName='ChartArrowMarker';
|
|
56950
57037
|
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
56951
57038
|
|
|
56952
|
-
this.
|
|
57039
|
+
this.InsideLineConfig={ Angle:25, MaxWidth:70, WidthRate:0.3 };
|
|
56953
57040
|
this.InsideWidth=70;
|
|
56954
|
-
|
|
56955
|
-
this.
|
|
57041
|
+
|
|
57042
|
+
this.OutLineConfig={ Angle:35, MaxWidth:100, WidthRate:0.4 };
|
|
56956
57043
|
this.OutWidth=100;
|
|
56957
57044
|
|
|
56958
57045
|
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
@@ -56985,6 +57072,19 @@ function ChartArrowMarker()
|
|
|
56985
57072
|
return { Top:{X:topX+ptEnd.X, Y:topY+ptEnd.Y}, Bottom:{X:botX+ptEnd.X, Y:botY+ptEnd.Y} };
|
|
56986
57073
|
}
|
|
56987
57074
|
|
|
57075
|
+
this.CalculateLineWidth=function(ptStart, ptEnd)
|
|
57076
|
+
{
|
|
57077
|
+
var a=ptStart.X-ptEnd.X;
|
|
57078
|
+
var b=ptStart.Y-ptEnd.Y;
|
|
57079
|
+
var c=Math.sqrt(a*a+b*b);
|
|
57080
|
+
|
|
57081
|
+
this.InsideWidth=c*this.InsideLineConfig.WidthRate;
|
|
57082
|
+
this.OutWidth=c*this.OutLineConfig.WidthRate;
|
|
57083
|
+
|
|
57084
|
+
if (this.InsideWidth>this.InsideLineConfig.MaxWidth) this.InsideWidth=this.InsideLineConfig.MaxWidth;
|
|
57085
|
+
if (this.OutWidth>this.OutLineConfig.MaxWidth) this.OutWidth=this.OutLineConfig.MaxWidth;
|
|
57086
|
+
}
|
|
57087
|
+
|
|
56988
57088
|
this.Draw=function()
|
|
56989
57089
|
{
|
|
56990
57090
|
this.LinePoint=[];
|
|
@@ -57000,9 +57100,11 @@ function ChartArrowMarker()
|
|
|
57000
57100
|
var ptStart=drawPoint[0];
|
|
57001
57101
|
var ptEnd=drawPoint[1];
|
|
57002
57102
|
|
|
57103
|
+
this.CalculateLineWidth(ptStart, ptEnd);
|
|
57104
|
+
|
|
57003
57105
|
//计算箭头 的两条边线坐标
|
|
57004
|
-
var outArrow=this.CalculatePoint(this.
|
|
57005
|
-
var insideArrow=this.CalculatePoint(this.
|
|
57106
|
+
var outArrow=this.CalculatePoint(this.OutLineConfig.Angle, ptStart, ptEnd, this.OutWidth);
|
|
57107
|
+
var insideArrow=this.CalculatePoint(this.InsideLineConfig.Angle, ptStart, ptEnd, this.InsideWidth);
|
|
57006
57108
|
|
|
57007
57109
|
this.Canvas.beginPath();
|
|
57008
57110
|
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
@@ -65950,8 +66052,12 @@ function ChartDateRange()
|
|
|
65950
66052
|
|
|
65951
66053
|
//文字输出
|
|
65952
66054
|
var bottom=this.Frame.ChartBorder.GetBottomEx();
|
|
66055
|
+
var top=this.Frame.ChartBorder.GetTopEx();
|
|
65953
66056
|
var startIndex=this.Frame.GetXData(ptStart.X,false);
|
|
65954
66057
|
var endIndex=this.Frame.GetXData(ptEnd.X,false);
|
|
66058
|
+
var startValue=this.Frame.GetYData(ptStart.Y,false);
|
|
66059
|
+
var endValue=this.Frame.GetYData(ptEnd.Y,false);
|
|
66060
|
+
var diffValue=endValue-startValue;
|
|
65955
66061
|
var barCount=endIndex-startIndex+1;
|
|
65956
66062
|
var text=`${barCount} bars`;
|
|
65957
66063
|
|
|
@@ -65959,13 +66065,27 @@ function ChartDateRange()
|
|
|
65959
66065
|
var textHeight=this.GetFontHeight();
|
|
65960
66066
|
var textWidth=this.Canvas.measureText(text).width+4+(this.Label.LeftMargin+this.Label.RightMargin);
|
|
65961
66067
|
var rtTextBG={ Left:xCenter-textWidth/2, Top:ptEnd.Y+4, Width:textWidth, Height:textHeight+2 };
|
|
66068
|
+
if (diffValue>0) rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;
|
|
66069
|
+
else rtTextBG.Top=ptEnd.Y+4;
|
|
65962
66070
|
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
65963
66071
|
|
|
65964
|
-
if (
|
|
66072
|
+
if (diffValue>0)
|
|
66073
|
+
{
|
|
66074
|
+
if (rtTextBG.Top<=top)
|
|
66075
|
+
{
|
|
66076
|
+
rtTextBG.Top=top;
|
|
66077
|
+
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
66078
|
+
}
|
|
66079
|
+
}
|
|
66080
|
+
else
|
|
65965
66081
|
{
|
|
65966
|
-
rtTextBG.Bottom
|
|
65967
|
-
|
|
66082
|
+
if (rtTextBG.Bottom>=bottom)
|
|
66083
|
+
{
|
|
66084
|
+
rtTextBG.Bottom=bottom;
|
|
66085
|
+
rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
|
|
66086
|
+
}
|
|
65968
66087
|
}
|
|
66088
|
+
|
|
65969
66089
|
|
|
65970
66090
|
if (this.Label.EnableBGColor)
|
|
65971
66091
|
{
|
|
@@ -65983,6 +66103,169 @@ function ChartDateRange()
|
|
|
65983
66103
|
}
|
|
65984
66104
|
}
|
|
65985
66105
|
|
|
66106
|
+
function ChartDatePriceRange()
|
|
66107
|
+
{
|
|
66108
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
66109
|
+
this.newMethod();
|
|
66110
|
+
delete this.newMethod;
|
|
66111
|
+
|
|
66112
|
+
this.ClassName='ChartDatePriceRange';
|
|
66113
|
+
this.PointCount=2;
|
|
66114
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
66115
|
+
this.TextColor=this.LineColor;
|
|
66116
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
66117
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
66118
|
+
this.PointToValue_Default=this.PointToValue;
|
|
66119
|
+
this.OnlyMoveXIndex=true;
|
|
66120
|
+
this.IsSupportMagnet=true;
|
|
66121
|
+
this.LineWidth=1;
|
|
66122
|
+
this.EnableBGColor=true;
|
|
66123
|
+
this.BGColor=IChartDrawPicture.ColorToRGBA(this.LineColor,0.15);
|
|
66124
|
+
this.ExtendLine={ Top:false, Bottom: false }; //延长线
|
|
66125
|
+
|
|
66126
|
+
this.Label={ TextColor:"rgb(0,0,0)", BGColor:"rgb(211,211,211)", EnableBGColor:true, LeftMargin:5, RightMargin:5 };
|
|
66127
|
+
|
|
66128
|
+
this.Draw=function()
|
|
66129
|
+
{
|
|
66130
|
+
this.LinePoint=[];
|
|
66131
|
+
if (this.IsFrameMinSize()) return;
|
|
66132
|
+
if (!this.IsShow) return;
|
|
66133
|
+
|
|
66134
|
+
var bCheckXY=true;
|
|
66135
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
|
|
66136
|
+
if (!drawPoint) return;
|
|
66137
|
+
if (drawPoint.length!=2) return;
|
|
66138
|
+
|
|
66139
|
+
this.ClipFrame();
|
|
66140
|
+
|
|
66141
|
+
var ptStart=drawPoint[0];
|
|
66142
|
+
var ptEnd=drawPoint[1];
|
|
66143
|
+
|
|
66144
|
+
this.SetLineWidth();
|
|
66145
|
+
this.DrawRange(ptStart,ptEnd);
|
|
66146
|
+
this.RestoreLineWidth();
|
|
66147
|
+
|
|
66148
|
+
this.DrawPoint(drawPoint); //画点
|
|
66149
|
+
this.Canvas.restore();
|
|
66150
|
+
}
|
|
66151
|
+
|
|
66152
|
+
this.DrawRange=function(ptStart, ptEnd)
|
|
66153
|
+
{
|
|
66154
|
+
var yTop=Math.min(ptStart.Y, ptEnd.Y);
|
|
66155
|
+
var yBottom=Math.max(ptStart.Y, ptEnd.Y);
|
|
66156
|
+
var xLeft=Math.min(ptStart.X, ptEnd.X);
|
|
66157
|
+
var xRight=Math.max(ptStart.X, ptEnd.X);
|
|
66158
|
+
var height=yBottom-yTop;
|
|
66159
|
+
var width=xRight-xLeft;
|
|
66160
|
+
var yCenter=ptStart.Y+(ptEnd.Y-ptStart.Y)/2;
|
|
66161
|
+
var xCenter=ptStart.X+(ptEnd.X-ptStart.X)/2;
|
|
66162
|
+
|
|
66163
|
+
if (this.ExtendLine.Top) yTop=this.Frame.ChartBorder.GetTopEx();
|
|
66164
|
+
if (this.ExtendLine.Bottom) yBottom=this.Frame.ChartBorder.GetBottomEx();
|
|
66165
|
+
|
|
66166
|
+
if (this.EnableBGColor)
|
|
66167
|
+
{
|
|
66168
|
+
var rtBG={ Left:xLeft, Top:yTop, Right:xRight, Bottom:yBottom };
|
|
66169
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
66170
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
66171
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
66172
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
66173
|
+
}
|
|
66174
|
+
|
|
66175
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
66176
|
+
this.Canvas.beginPath();
|
|
66177
|
+
this.Canvas.moveTo(ToFixedPoint(xLeft),yTop);
|
|
66178
|
+
this.Canvas.lineTo(ToFixedPoint(xLeft),yBottom);
|
|
66179
|
+
|
|
66180
|
+
this.Canvas.moveTo(ToFixedPoint(xRight),yTop);
|
|
66181
|
+
this.Canvas.lineTo(ToFixedPoint(xRight),yBottom);
|
|
66182
|
+
|
|
66183
|
+
this.Canvas.moveTo(ToFixedPoint(xLeft),ToFixedPoint(yCenter));
|
|
66184
|
+
this.Canvas.lineTo(ToFixedPoint(xRight),ToFixedPoint(yCenter));
|
|
66185
|
+
|
|
66186
|
+
this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(yTop));
|
|
66187
|
+
this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(yBottom));
|
|
66188
|
+
|
|
66189
|
+
this.Canvas.stroke();
|
|
66190
|
+
|
|
66191
|
+
this.LinePoint.push({ Start:{X:xLeft, Y:yTop}, End:{X:xLeft, Y:yBottom} });
|
|
66192
|
+
this.LinePoint.push({ Start:{X:xRight, Y:yTop}, End:{X:xRight, Y:yBottom} });
|
|
66193
|
+
this.LinePoint.push({ Start:{X:xLeft, Y:yCenter}, End:{X:xRight, Y:yCenter} });
|
|
66194
|
+
|
|
66195
|
+
this.DrawArrow({X:ptStart.X, Y:ToFixedPoint(yCenter)}, {X:ptEnd.X, Y:ToFixedPoint(yCenter)});
|
|
66196
|
+
this.DrawArrow({X:ToFixedPoint(xCenter), Y:ptStart.Y}, {X:ToFixedPoint(xCenter), Y:ptEnd.Y});
|
|
66197
|
+
|
|
66198
|
+
//文字输出
|
|
66199
|
+
var bottom=this.Frame.ChartBorder.GetBottomEx();
|
|
66200
|
+
var top=this.Frame.ChartBorder.GetTopEx();
|
|
66201
|
+
var startIndex=this.Frame.GetXData(ptStart.X,false);
|
|
66202
|
+
var endIndex=this.Frame.GetXData(ptEnd.X,false);
|
|
66203
|
+
var barCount=endIndex-startIndex+1;
|
|
66204
|
+
var startValue=this.Frame.GetYData(ptStart.Y,false);
|
|
66205
|
+
var endValue=this.Frame.GetYData(ptEnd.Y,false);
|
|
66206
|
+
var diffValue=endValue-startValue;
|
|
66207
|
+
|
|
66208
|
+
var rate=(diffValue/startValue)*100;
|
|
66209
|
+
var aryText=
|
|
66210
|
+
[
|
|
66211
|
+
`${diffValue.toFixed(2)} (${rate.toFixed(2)}%)`,
|
|
66212
|
+
`${barCount} bars`
|
|
66213
|
+
];
|
|
66214
|
+
|
|
66215
|
+
this.Canvas.font=this.Font;
|
|
66216
|
+
var textHeight=this.GetFontHeight();
|
|
66217
|
+
var textWidth=0;
|
|
66218
|
+
for(var i=0;i<aryText.length;++i)
|
|
66219
|
+
{
|
|
66220
|
+
var text=aryText[i];
|
|
66221
|
+
var value=this.Canvas.measureText(text).width;
|
|
66222
|
+
if (textWidth<value) textWidth=value;
|
|
66223
|
+
}
|
|
66224
|
+
textWidth+=(this.Label.LeftMargin+this.Label.RightMargin);
|
|
66225
|
+
|
|
66226
|
+
var rtTextBG={ Left:xCenter-textWidth/2, Top:ptEnd.Y+4, Width:textWidth, Height:aryText.length*textHeight+2 };
|
|
66227
|
+
if (diffValue>0) rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;
|
|
66228
|
+
else rtTextBG.Top=ptEnd.Y+4;
|
|
66229
|
+
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
66230
|
+
|
|
66231
|
+
if (diffValue>0)
|
|
66232
|
+
{
|
|
66233
|
+
if (rtTextBG.Top<=top)
|
|
66234
|
+
{
|
|
66235
|
+
rtTextBG.Top=top;
|
|
66236
|
+
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
66237
|
+
}
|
|
66238
|
+
}
|
|
66239
|
+
else
|
|
66240
|
+
{
|
|
66241
|
+
if (rtTextBG.Bottom>=bottom)
|
|
66242
|
+
{
|
|
66243
|
+
rtTextBG.Bottom=bottom;
|
|
66244
|
+
rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
|
|
66245
|
+
}
|
|
66246
|
+
}
|
|
66247
|
+
|
|
66248
|
+
if (this.Label.EnableBGColor)
|
|
66249
|
+
{
|
|
66250
|
+
var path=new Path2D();
|
|
66251
|
+
path.roundRect(ToFixedPoint(rtTextBG.Left), ToFixedPoint(rtTextBG.Top), ToFixedRect(rtTextBG.Width), ToFixedRect(rtTextBG.Height), [3]);
|
|
66252
|
+
this.Canvas.fillStyle=this.Label.BGColor;
|
|
66253
|
+
this.Canvas.fill(path);
|
|
66254
|
+
}
|
|
66255
|
+
|
|
66256
|
+
this.Canvas.fillStyle=this.Label.TextColor;
|
|
66257
|
+
this.Canvas.textAlign="left";
|
|
66258
|
+
this.Canvas.textBaseline="bottom";
|
|
66259
|
+
var yText=rtTextBG.Bottom-2;
|
|
66260
|
+
for(var i=0;i<aryText.length;++i)
|
|
66261
|
+
{
|
|
66262
|
+
var text=aryText[i];
|
|
66263
|
+
this.Canvas.fillText(text,rtTextBG.Left+2+this.Label.LeftMargin,yText);
|
|
66264
|
+
yText-=textHeight;
|
|
66265
|
+
}
|
|
66266
|
+
}
|
|
66267
|
+
}
|
|
66268
|
+
|
|
65986
66269
|
//线段信息统计
|
|
65987
66270
|
function ChartInfoLine()
|
|
65988
66271
|
{
|
|
@@ -66561,7 +66844,11 @@ function JSChartResource()
|
|
|
66561
66844
|
UpColor:"rgb(238,21,21)", //上涨
|
|
66562
66845
|
DownColor:"rgb(25,158,0)", //下跌
|
|
66563
66846
|
UnchangeColor:"rgb(0,0,0)" //不变
|
|
66564
|
-
}
|
|
66847
|
+
},
|
|
66848
|
+
|
|
66849
|
+
ArrowType:0,
|
|
66850
|
+
|
|
66851
|
+
NameArrow:{ Color:"rgb(43,54,69)", Space:2, Symbol:'▼' },
|
|
66565
66852
|
}
|
|
66566
66853
|
|
|
66567
66854
|
this.Title={
|
|
@@ -67859,6 +68146,16 @@ function JSChartResource()
|
|
|
67859
68146
|
if (subItem.DownColor) this.IndexTitle.UpDownArrow.DownColor = subItem.DownColor;
|
|
67860
68147
|
if (subItem.UnchangeColor) this.IndexTitle.UpDownArrow.UnchangeColor = subItem.UnchangeColor;
|
|
67861
68148
|
}
|
|
68149
|
+
|
|
68150
|
+
if (IFrameSplitOperator.IsNumber(item.ArrowType)) this.IndexTitle.ArrowType=item.ArrowType;
|
|
68151
|
+
|
|
68152
|
+
if (item.NameArrow)
|
|
68153
|
+
{
|
|
68154
|
+
var subItem=item.NameArrow;
|
|
68155
|
+
if (subItem.Color) this.IndexTitle.NameArrow.Color = subItem.Color;
|
|
68156
|
+
if (subItem.Symbol) this.IndexTitle.NameArrow.Symbol = subItem.Symbol;
|
|
68157
|
+
if (IFrameSplitOperator.IsNumber(subItem.Space)) this.IndexTitle.NameArrow.Space = subItem.Space;
|
|
68158
|
+
}
|
|
67862
68159
|
}
|
|
67863
68160
|
|
|
67864
68161
|
if (style.Frame)
|
|
@@ -73830,7 +74127,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73830
74127
|
|
|
73831
74128
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) this.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
73832
74129
|
else item.TitleHeight=this.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;
|
|
73833
|
-
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow))
|
|
74130
|
+
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
74131
|
+
if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) subFrame.Frame.TitleArrowType=item.TitleArrowType;
|
|
73834
74132
|
if (item.IsShowIndexName==false) this.Frame.SubFrame[i].Frame.IsShowIndexName=false;
|
|
73835
74133
|
if (item.IsShowOverlayIndexName==false) this.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
|
|
73836
74134
|
if (IFrameSplitOperator.IsNumber(item.IndexParamSpace)) this.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;
|