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
|
@@ -4661,7 +4661,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4661
4661
|
|
|
4662
4662
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
4663
4663
|
else item.TitleHeight=chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;
|
|
4664
|
-
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow))
|
|
4664
|
+
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
4665
|
+
if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) frame.TitleArrowType=item.TitleArrowType;
|
|
4665
4666
|
if (item.IsShowIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;
|
|
4666
4667
|
if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
|
|
4667
4668
|
if (IFrameSplitOperator.IsNumber(item.IndexParamSpace)) chart.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;
|
|
@@ -5130,7 +5131,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5130
5131
|
if (IFrameSplitOperator.IsBool(item.IsDrawTitleBG)) chart.Frame.SubFrame[index].Frame.IsDrawTitleBG=item.IsDrawTitleBG;
|
|
5131
5132
|
if (IFrameSplitOperator.IsBool(item.IsShowNameArrow)) chart.Frame.SubFrame[index].Frame.IsShowNameArrow=item.IsShowNameArrow;
|
|
5132
5133
|
|
|
5133
|
-
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow))
|
|
5134
|
+
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
5135
|
+
if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) frame.TitleArrowType=item.TitleArrowType;
|
|
5134
5136
|
if (item.IsShowIndexName==false) chart.Frame.SubFrame[index].Frame.IsShowIndexName=false;
|
|
5135
5137
|
if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[index].Frame.IsShowOverlayIndexName=false;
|
|
5136
5138
|
if (!IFrameSplitOperator.IsUndefined(item.HorizontalReserved)) frame.HorizontalReserved=item.HorizontalReserved;
|
|
@@ -5541,7 +5543,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5541
5543
|
if (IFrameSplitOperator.IsBool(item.IsShowNameArrow)) chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;
|
|
5542
5544
|
|
|
5543
5545
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
5544
|
-
|
|
5545
5546
|
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) chart.Frame.SubFrame[i].Frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
5546
5547
|
if (item.IsShowIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;
|
|
5547
5548
|
if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
|
|
@@ -11070,6 +11071,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11070
11071
|
if (!subItem || !subItem.Frame) continue;
|
|
11071
11072
|
|
|
11072
11073
|
var frame=subItem.Frame;
|
|
11074
|
+
|
|
11075
|
+
//自定义刻度每次都调用
|
|
11076
|
+
frame.YCustomSplit=true;
|
|
11077
|
+
|
|
11073
11078
|
var key=frame.Identify;
|
|
11074
11079
|
var item=
|
|
11075
11080
|
{
|
|
@@ -12361,6 +12366,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12361
12366
|
else windowItem.TitleHeight=frame.ChartBorder.TitleHeight;
|
|
12362
12367
|
|
|
12363
12368
|
if (IFrameSplitOperator.IsBool(windowItem.IsShowTitleArrow)) frame.IsShowTitleArrow=windowItem.IsShowTitleArrow;
|
|
12369
|
+
if (IFrameSplitOperator.IsNumber(windowItem.TitleArrowType)) frame.TitleArrowType=windowItem.TitleArrowType;
|
|
12364
12370
|
if (IFrameSplitOperator.IsBool(windowItem.IsShowIndexName)) frame.IsShowIndexName=windowItem.IsShowIndexName;
|
|
12365
12371
|
if (IFrameSplitOperator.IsNumber(windowItem.IndexParamSpace)) frame.IndexParamSpace=windowItem.IndexParamSpace;
|
|
12366
12372
|
if (IFrameSplitOperator.IsNumber(windowItem.IndexTitleSpace)) frame.IndexTitleSpace=windowItem.IndexTitleSpace;
|
|
@@ -12423,6 +12429,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
12423
12429
|
if (IFrameSplitOperator.IsNumber(option.SplitCount)) subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;
|
|
12424
12430
|
if (IFrameSplitOperator.IsNumber(option.TitleHeight)) subFrame.Frame.ChartBorder.TitleHeight=option.TitleHeight;
|
|
12425
12431
|
if (IFrameSplitOperator.IsBool(option.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;
|
|
12432
|
+
if (IFrameSplitOperator.IsNumber(option.TitleArrowType)) subFrame.Frame.TitleArrowType=option.TitleArrowType;
|
|
12426
12433
|
if (IFrameSplitOperator.IsBool(option.IsShowIndexName)) subFrame.Frame.IsShowIndexName=option.IsShowIndexName;
|
|
12427
12434
|
if (IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName)) subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;
|
|
12428
12435
|
if (IFrameSplitOperator.IsNumber(option.IndexParamSpace)) subFrame.Frame.IndexParamSpace=option.IndexParamSpace;
|
|
@@ -14241,6 +14248,7 @@ function IChartFramePainting()
|
|
|
14241
14248
|
this.SizeChange=true; //大小是否改变
|
|
14242
14249
|
this.XYSplit=true; //XY轴坐标信息改变
|
|
14243
14250
|
this.XSplit=true; //X轴变化
|
|
14251
|
+
this.YCustomSplit=true; //自定义Y轴分割线
|
|
14244
14252
|
|
|
14245
14253
|
this.HorizontalMax; //Y轴最大值
|
|
14246
14254
|
this.HorizontalMin; //Y轴最小值
|
|
@@ -14262,6 +14270,7 @@ function IChartFramePainting()
|
|
|
14262
14270
|
this.YSpecificMaxMin=null; //指定Y轴最大最小值
|
|
14263
14271
|
this.IsShowBorder = true; //是否显示边框
|
|
14264
14272
|
this.IsShowTitleArrow=true; //是否显示指标信息上涨下跌箭头
|
|
14273
|
+
this.TitleArrowType=g_JSChartResource.IndexTitle.ArrowType; //指标信息上涨下跌箭头类型 0=独立颜色 1=跟指标名字颜色一致
|
|
14265
14274
|
this.IsShowIndexName=true; //是否显示指标名字
|
|
14266
14275
|
this.IsShowOverlayIndexName=true; //是否显示叠加指标名字
|
|
14267
14276
|
//this.OverlayIndexType= { Position:0, LineSpace:5 };
|
|
@@ -14322,6 +14331,7 @@ function IChartFramePainting()
|
|
|
14322
14331
|
this.SizeChange=false;
|
|
14323
14332
|
this.XYSplit=false;
|
|
14324
14333
|
this.XSplit=false;
|
|
14334
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
14325
14335
|
}
|
|
14326
14336
|
|
|
14327
14337
|
this.DrawFrame=function() { }
|
|
@@ -17477,7 +17487,18 @@ function MinuteFrame()
|
|
|
17477
17487
|
//分割x,y轴坐标信息
|
|
17478
17488
|
this.SplitXYCoordinate=function()
|
|
17479
17489
|
{
|
|
17480
|
-
if (this.XYSplit==false)
|
|
17490
|
+
if (this.XYSplit==false)
|
|
17491
|
+
{
|
|
17492
|
+
//计算自定义刻度
|
|
17493
|
+
if (this.YCustomSplit)
|
|
17494
|
+
{
|
|
17495
|
+
if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate)
|
|
17496
|
+
this.YSplitOperator.CustomCoordinate();
|
|
17497
|
+
}
|
|
17498
|
+
|
|
17499
|
+
return;
|
|
17500
|
+
}
|
|
17501
|
+
|
|
17481
17502
|
if (this.XSplitOperator!=null) this.XSplitOperator.Operator();
|
|
17482
17503
|
if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
|
|
17483
17504
|
}
|
|
@@ -18935,6 +18956,8 @@ function OverlayMinuteFrame()
|
|
|
18935
18956
|
|
|
18936
18957
|
this.SizeChange=false;
|
|
18937
18958
|
this.XYSplit=false;
|
|
18959
|
+
this.XSplit=false;
|
|
18960
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
18938
18961
|
}
|
|
18939
18962
|
|
|
18940
18963
|
this.DrawToolbar=function()
|
|
@@ -18991,6 +19014,8 @@ function OverlayMinuteHScreenFrame()
|
|
|
18991
19014
|
|
|
18992
19015
|
this.SizeChange=false;
|
|
18993
19016
|
this.XYSplit=false;
|
|
19017
|
+
this.XSplit=false;
|
|
19018
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
18994
19019
|
}
|
|
18995
19020
|
|
|
18996
19021
|
//分割x,y轴坐标信息
|
|
@@ -19599,7 +19624,13 @@ function KLineFrame()
|
|
|
19599
19624
|
if (this.XSplit)
|
|
19600
19625
|
{
|
|
19601
19626
|
if (this.XSplitOperator) this.XSplitOperator.Operator();
|
|
19602
|
-
|
|
19627
|
+
}
|
|
19628
|
+
|
|
19629
|
+
if (this.YCustomSplit)
|
|
19630
|
+
{
|
|
19631
|
+
//计算自定义刻度
|
|
19632
|
+
if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate)
|
|
19633
|
+
this.YSplitOperator.CustomCoordinate();
|
|
19603
19634
|
}
|
|
19604
19635
|
|
|
19605
19636
|
return;
|
|
@@ -20371,6 +20402,7 @@ function OverlayKLineFrame()
|
|
|
20371
20402
|
this.SizeChange=false;
|
|
20372
20403
|
this.XYSplit=false;
|
|
20373
20404
|
this.XSplit=false;
|
|
20405
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
20374
20406
|
}
|
|
20375
20407
|
|
|
20376
20408
|
|
|
@@ -21658,6 +21690,8 @@ function OverlayKLineHScreenFrame()
|
|
|
21658
21690
|
|
|
21659
21691
|
this.SizeChange=false;
|
|
21660
21692
|
this.XYSplit=false;
|
|
21693
|
+
this.XSplit=false;
|
|
21694
|
+
this.YCustomSplit=false; //自定义Y轴分割线
|
|
21661
21695
|
}
|
|
21662
21696
|
|
|
21663
21697
|
this.DrawTitle=function() //画标题
|
|
@@ -50369,6 +50403,22 @@ IFrameSplitOperator.IsNumber=function(value)
|
|
|
50369
50403
|
return typeof(value)=='number';
|
|
50370
50404
|
}
|
|
50371
50405
|
|
|
50406
|
+
//批量判断是否是数值类型
|
|
50407
|
+
IFrameSplitOperator.IsNumberV2=function(...aryValue)
|
|
50408
|
+
{
|
|
50409
|
+
if (!aryValue) return false;
|
|
50410
|
+
if (aryValue.length==0) return false;
|
|
50411
|
+
|
|
50412
|
+
for(const value of aryValue)
|
|
50413
|
+
{
|
|
50414
|
+
if (value==null) return false;
|
|
50415
|
+
if (isNaN(value)) return false;
|
|
50416
|
+
if (typeof(value)!='number') return false;
|
|
50417
|
+
}
|
|
50418
|
+
|
|
50419
|
+
return true;
|
|
50420
|
+
}
|
|
50421
|
+
|
|
50372
50422
|
//判断是否是正数
|
|
50373
50423
|
IFrameSplitOperator.IsPlusNumber=function(value)
|
|
50374
50424
|
{
|
|
@@ -52102,6 +52152,8 @@ function FrameSplitMinutePriceY()
|
|
|
52102
52152
|
|
|
52103
52153
|
this.CustomCoordinate=function() //自定义刻度
|
|
52104
52154
|
{
|
|
52155
|
+
this.Frame.CustomHorizontalInfo=[];
|
|
52156
|
+
|
|
52105
52157
|
var data=this.InvokeCustomYCoordinateCallback();
|
|
52106
52158
|
if (data && data.PreventDefault==true) return;
|
|
52107
52159
|
|
|
@@ -57247,9 +57299,11 @@ function DynamicChartTitlePainting()
|
|
|
57247
57299
|
this.ColorIndex; //五彩K线名字 {Name:'名字'}
|
|
57248
57300
|
this.IsShowColorIndexTitle=true;
|
|
57249
57301
|
this.IsShowUpDownArrow=true; //指标数据是否显示 上涨下跌箭头
|
|
57302
|
+
this.TitleArrowType=0; //指标数据上涨下跌箭头类型 0=独立颜色 1=跟指标颜色一致
|
|
57250
57303
|
this.IsShowIndexName=true; //是否显示指标名字
|
|
57251
57304
|
this.IsShowIndexTitle=true; //是否显示指标标题信息
|
|
57252
57305
|
this.IsShowNameArrow=false;
|
|
57306
|
+
this.NameArrowConfig=CloneData(g_JSChartResource.IndexTitle.NameArrow);
|
|
57253
57307
|
|
|
57254
57308
|
this.TradeIndex; //专家系统名字{Name:'名字', Param:'参数'}
|
|
57255
57309
|
this.IsShowTradeIndexTitle=true;
|
|
@@ -57718,6 +57772,7 @@ function DynamicChartTitlePainting()
|
|
|
57718
57772
|
this.IsDrawTitleBG=this.Frame.IsDrawTitleBG;
|
|
57719
57773
|
this.IsShowNameArrow=this.Frame.IsShowNameArrow;
|
|
57720
57774
|
this.IsShowUpDownArrow=this.Frame.IsShowTitleArrow;
|
|
57775
|
+
this.TitleArrowType=this.Frame.TitleArrowType;
|
|
57721
57776
|
this.IsShowIndexName=this.Frame.IsShowIndexName;
|
|
57722
57777
|
this.IsShowOverlayIndexName=this.Frame.IsShowOverlayIndexName;
|
|
57723
57778
|
this.OverlayIndexType.Position=this.Frame.OverlayIndexType.Position;
|
|
@@ -58002,6 +58057,8 @@ function DynamicChartTitlePainting()
|
|
|
58002
58057
|
if (preValue>value) arrowSuper={ Text:'↓', TextColor:this.UpDownArrowConfig.DownColor };
|
|
58003
58058
|
else if (preValue<value) arrowSuper={ Text:'↑', TextColor:this.UpDownArrowConfig.UpColor};
|
|
58004
58059
|
else arrowSuper={ Text:'→', TextColor:this.UpDownArrowConfig.UnchangeColor };
|
|
58060
|
+
|
|
58061
|
+
if (this.TitleArrowType==1) arrowSuper.TextColor=item.Color;
|
|
58005
58062
|
}
|
|
58006
58063
|
}
|
|
58007
58064
|
|
|
@@ -58509,10 +58566,16 @@ function DynamicChartTitlePainting()
|
|
|
58509
58566
|
if (this.IsDrawTitleBG)
|
|
58510
58567
|
{
|
|
58511
58568
|
var title=this.Title;
|
|
58512
|
-
if (this.IsShowNameArrow) title+='▼';
|
|
58513
58569
|
var textWidth=this.Canvas.measureText(title).width;
|
|
58570
|
+
var arrowWidth=0;
|
|
58571
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
58572
|
+
{
|
|
58573
|
+
arrowWidth=this.Canvas.measureText(this.NameArrowConfig.Symbol).width;
|
|
58574
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) arrowWidth+=this.NameArrowConfig.Space;
|
|
58575
|
+
}
|
|
58576
|
+
|
|
58514
58577
|
var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;
|
|
58515
|
-
var bgWidth=textWidth+4*pixelRatio;
|
|
58578
|
+
var bgWidth=textWidth+arrowWidth+4*pixelRatio;
|
|
58516
58579
|
|
|
58517
58580
|
this.TitleRect=
|
|
58518
58581
|
{
|
|
@@ -58532,15 +58595,24 @@ function DynamicChartTitlePainting()
|
|
|
58532
58595
|
this.Canvas.strokeRect(ToFixedPoint(drawRect.Left),ToFixedPoint(drawRect.Top),ToFixedRect(drawRect.Width),ToFixedRect(drawRect.Height));
|
|
58533
58596
|
}
|
|
58534
58597
|
|
|
58598
|
+
var xText=left+2*pixelRatio;
|
|
58535
58599
|
this.Canvas.fillStyle=this.TitleColor;
|
|
58536
|
-
this.Canvas.fillText(title,
|
|
58600
|
+
this.Canvas.fillText(title,xText,bottom);
|
|
58601
|
+
xText+=textWidth;
|
|
58602
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
58603
|
+
{
|
|
58604
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) xText+=this.NameArrowConfig.Space;
|
|
58605
|
+
this.Canvas.fillStyle=this.NameArrowConfig.Color;
|
|
58606
|
+
this.Canvas.fillText(this.NameArrowConfig.Symbol,xText,bottom);
|
|
58607
|
+
}
|
|
58608
|
+
|
|
58537
58609
|
left+=bgWidth+2*pixelRatio;
|
|
58538
58610
|
left+=this.TitleSpace;
|
|
58539
58611
|
}
|
|
58540
58612
|
else
|
|
58541
58613
|
{
|
|
58542
58614
|
this.Canvas.fillStyle=this.TitleColor;
|
|
58543
|
-
this.Canvas.fillText(this.Title,left,bottom
|
|
58615
|
+
this.Canvas.fillText(this.Title,left,bottom);
|
|
58544
58616
|
left+=textWidth;
|
|
58545
58617
|
left+=this.TitleSpace;
|
|
58546
58618
|
}
|
|
@@ -58653,11 +58725,17 @@ function DynamicChartTitlePainting()
|
|
|
58653
58725
|
{
|
|
58654
58726
|
var pixelRatio=GetDevicePixelRatio();
|
|
58655
58727
|
var title=this.Title;
|
|
58656
|
-
if (this.IsShowNameArrow) title+='▼';
|
|
58657
58728
|
var textWidth=this.Canvas.measureText(title).width;
|
|
58729
|
+
var arrowWidth=0;
|
|
58730
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
58731
|
+
{
|
|
58732
|
+
arrowWidth=this.Canvas.measureText(this.NameArrowConfig.Symbol).width;
|
|
58733
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) arrowWidth+=this.NameArrowConfig.Space;
|
|
58734
|
+
}
|
|
58735
|
+
|
|
58658
58736
|
var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;
|
|
58659
58737
|
var roundRadius=this.BorderRoundRadius*pixelRatio;
|
|
58660
|
-
var bgWidth=textWidth+4*pixelRatio+roundRadius*2;
|
|
58738
|
+
var bgWidth=textWidth+arrowWidth+4*pixelRatio+roundRadius*2;
|
|
58661
58739
|
|
|
58662
58740
|
rtButton.Top=rtButton.YCenter-bgHeight/2-1,
|
|
58663
58741
|
rtButton.Width=bgWidth;
|
|
@@ -58703,8 +58781,16 @@ function DynamicChartTitlePainting()
|
|
|
58703
58781
|
}
|
|
58704
58782
|
}
|
|
58705
58783
|
|
|
58784
|
+
var xText=rtButton.Left+roundRadius+2*pixelRatio;
|
|
58706
58785
|
this.Canvas.fillStyle=this.TitleColor;
|
|
58707
|
-
this.Canvas.fillText(title,
|
|
58786
|
+
this.Canvas.fillText(title,xText,rtButton.YCenter);
|
|
58787
|
+
xText+=textWidth;
|
|
58788
|
+
if (this.IsShowNameArrow && this.NameArrowConfig)
|
|
58789
|
+
{
|
|
58790
|
+
if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) xText+=this.NameArrowConfig.Space;
|
|
58791
|
+
this.Canvas.fillStyle=this.NameArrowConfig.Color;
|
|
58792
|
+
this.Canvas.fillText(this.NameArrowConfig.Symbol,xText,rtButton.YCenter);
|
|
58793
|
+
}
|
|
58708
58794
|
}
|
|
58709
58795
|
|
|
58710
58796
|
//绘制按钮
|
|
@@ -60382,6 +60468,7 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
60382
60468
|
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
|
|
60383
60469
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
60384
60470
|
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
60471
|
+
{ Name:"DatePriceRange", ClassName:"ChartDatePriceRange", Create:function() { return new ChartDatePriceRange(); }},
|
|
60385
60472
|
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
60386
60473
|
{ Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
|
|
60387
60474
|
{ Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
|
|
@@ -60918,10 +61005,10 @@ function ChartArrowMarker()
|
|
|
60918
61005
|
this.ClassName='ChartArrowMarker';
|
|
60919
61006
|
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
60920
61007
|
|
|
60921
|
-
this.
|
|
61008
|
+
this.InsideLineConfig={ Angle:25, MaxWidth:70, WidthRate:0.3 };
|
|
60922
61009
|
this.InsideWidth=70;
|
|
60923
|
-
|
|
60924
|
-
this.
|
|
61010
|
+
|
|
61011
|
+
this.OutLineConfig={ Angle:35, MaxWidth:100, WidthRate:0.4 };
|
|
60925
61012
|
this.OutWidth=100;
|
|
60926
61013
|
|
|
60927
61014
|
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
@@ -60954,6 +61041,19 @@ function ChartArrowMarker()
|
|
|
60954
61041
|
return { Top:{X:topX+ptEnd.X, Y:topY+ptEnd.Y}, Bottom:{X:botX+ptEnd.X, Y:botY+ptEnd.Y} };
|
|
60955
61042
|
}
|
|
60956
61043
|
|
|
61044
|
+
this.CalculateLineWidth=function(ptStart, ptEnd)
|
|
61045
|
+
{
|
|
61046
|
+
var a=ptStart.X-ptEnd.X;
|
|
61047
|
+
var b=ptStart.Y-ptEnd.Y;
|
|
61048
|
+
var c=Math.sqrt(a*a+b*b);
|
|
61049
|
+
|
|
61050
|
+
this.InsideWidth=c*this.InsideLineConfig.WidthRate;
|
|
61051
|
+
this.OutWidth=c*this.OutLineConfig.WidthRate;
|
|
61052
|
+
|
|
61053
|
+
if (this.InsideWidth>this.InsideLineConfig.MaxWidth) this.InsideWidth=this.InsideLineConfig.MaxWidth;
|
|
61054
|
+
if (this.OutWidth>this.OutLineConfig.MaxWidth) this.OutWidth=this.OutLineConfig.MaxWidth;
|
|
61055
|
+
}
|
|
61056
|
+
|
|
60957
61057
|
this.Draw=function()
|
|
60958
61058
|
{
|
|
60959
61059
|
this.LinePoint=[];
|
|
@@ -60969,9 +61069,11 @@ function ChartArrowMarker()
|
|
|
60969
61069
|
var ptStart=drawPoint[0];
|
|
60970
61070
|
var ptEnd=drawPoint[1];
|
|
60971
61071
|
|
|
61072
|
+
this.CalculateLineWidth(ptStart, ptEnd);
|
|
61073
|
+
|
|
60972
61074
|
//计算箭头 的两条边线坐标
|
|
60973
|
-
var outArrow=this.CalculatePoint(this.
|
|
60974
|
-
var insideArrow=this.CalculatePoint(this.
|
|
61075
|
+
var outArrow=this.CalculatePoint(this.OutLineConfig.Angle, ptStart, ptEnd, this.OutWidth);
|
|
61076
|
+
var insideArrow=this.CalculatePoint(this.InsideLineConfig.Angle, ptStart, ptEnd, this.InsideWidth);
|
|
60975
61077
|
|
|
60976
61078
|
this.Canvas.beginPath();
|
|
60977
61079
|
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
@@ -69919,8 +70021,12 @@ function ChartDateRange()
|
|
|
69919
70021
|
|
|
69920
70022
|
//文字输出
|
|
69921
70023
|
var bottom=this.Frame.ChartBorder.GetBottomEx();
|
|
70024
|
+
var top=this.Frame.ChartBorder.GetTopEx();
|
|
69922
70025
|
var startIndex=this.Frame.GetXData(ptStart.X,false);
|
|
69923
70026
|
var endIndex=this.Frame.GetXData(ptEnd.X,false);
|
|
70027
|
+
var startValue=this.Frame.GetYData(ptStart.Y,false);
|
|
70028
|
+
var endValue=this.Frame.GetYData(ptEnd.Y,false);
|
|
70029
|
+
var diffValue=endValue-startValue;
|
|
69924
70030
|
var barCount=endIndex-startIndex+1;
|
|
69925
70031
|
var text=`${barCount} bars`;
|
|
69926
70032
|
|
|
@@ -69928,13 +70034,27 @@ function ChartDateRange()
|
|
|
69928
70034
|
var textHeight=this.GetFontHeight();
|
|
69929
70035
|
var textWidth=this.Canvas.measureText(text).width+4+(this.Label.LeftMargin+this.Label.RightMargin);
|
|
69930
70036
|
var rtTextBG={ Left:xCenter-textWidth/2, Top:ptEnd.Y+4, Width:textWidth, Height:textHeight+2 };
|
|
70037
|
+
if (diffValue>0) rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;
|
|
70038
|
+
else rtTextBG.Top=ptEnd.Y+4;
|
|
69931
70039
|
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
69932
70040
|
|
|
69933
|
-
if (
|
|
70041
|
+
if (diffValue>0)
|
|
69934
70042
|
{
|
|
69935
|
-
rtTextBG.
|
|
69936
|
-
|
|
70043
|
+
if (rtTextBG.Top<=top)
|
|
70044
|
+
{
|
|
70045
|
+
rtTextBG.Top=top;
|
|
70046
|
+
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
70047
|
+
}
|
|
69937
70048
|
}
|
|
70049
|
+
else
|
|
70050
|
+
{
|
|
70051
|
+
if (rtTextBG.Bottom>=bottom)
|
|
70052
|
+
{
|
|
70053
|
+
rtTextBG.Bottom=bottom;
|
|
70054
|
+
rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
|
|
70055
|
+
}
|
|
70056
|
+
}
|
|
70057
|
+
|
|
69938
70058
|
|
|
69939
70059
|
if (this.Label.EnableBGColor)
|
|
69940
70060
|
{
|
|
@@ -69952,6 +70072,169 @@ function ChartDateRange()
|
|
|
69952
70072
|
}
|
|
69953
70073
|
}
|
|
69954
70074
|
|
|
70075
|
+
function ChartDatePriceRange()
|
|
70076
|
+
{
|
|
70077
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
70078
|
+
this.newMethod();
|
|
70079
|
+
delete this.newMethod;
|
|
70080
|
+
|
|
70081
|
+
this.ClassName='ChartDatePriceRange';
|
|
70082
|
+
this.PointCount=2;
|
|
70083
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
70084
|
+
this.TextColor=this.LineColor;
|
|
70085
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
70086
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
70087
|
+
this.PointToValue_Default=this.PointToValue;
|
|
70088
|
+
this.OnlyMoveXIndex=true;
|
|
70089
|
+
this.IsSupportMagnet=true;
|
|
70090
|
+
this.LineWidth=1;
|
|
70091
|
+
this.EnableBGColor=true;
|
|
70092
|
+
this.BGColor=IChartDrawPicture.ColorToRGBA(this.LineColor,0.15);
|
|
70093
|
+
this.ExtendLine={ Top:false, Bottom: false }; //延长线
|
|
70094
|
+
|
|
70095
|
+
this.Label={ TextColor:"rgb(0,0,0)", BGColor:"rgb(211,211,211)", EnableBGColor:true, LeftMargin:5, RightMargin:5 };
|
|
70096
|
+
|
|
70097
|
+
this.Draw=function()
|
|
70098
|
+
{
|
|
70099
|
+
this.LinePoint=[];
|
|
70100
|
+
if (this.IsFrameMinSize()) return;
|
|
70101
|
+
if (!this.IsShow) return;
|
|
70102
|
+
|
|
70103
|
+
var bCheckXY=true;
|
|
70104
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
|
|
70105
|
+
if (!drawPoint) return;
|
|
70106
|
+
if (drawPoint.length!=2) return;
|
|
70107
|
+
|
|
70108
|
+
this.ClipFrame();
|
|
70109
|
+
|
|
70110
|
+
var ptStart=drawPoint[0];
|
|
70111
|
+
var ptEnd=drawPoint[1];
|
|
70112
|
+
|
|
70113
|
+
this.SetLineWidth();
|
|
70114
|
+
this.DrawRange(ptStart,ptEnd);
|
|
70115
|
+
this.RestoreLineWidth();
|
|
70116
|
+
|
|
70117
|
+
this.DrawPoint(drawPoint); //画点
|
|
70118
|
+
this.Canvas.restore();
|
|
70119
|
+
}
|
|
70120
|
+
|
|
70121
|
+
this.DrawRange=function(ptStart, ptEnd)
|
|
70122
|
+
{
|
|
70123
|
+
var yTop=Math.min(ptStart.Y, ptEnd.Y);
|
|
70124
|
+
var yBottom=Math.max(ptStart.Y, ptEnd.Y);
|
|
70125
|
+
var xLeft=Math.min(ptStart.X, ptEnd.X);
|
|
70126
|
+
var xRight=Math.max(ptStart.X, ptEnd.X);
|
|
70127
|
+
var height=yBottom-yTop;
|
|
70128
|
+
var width=xRight-xLeft;
|
|
70129
|
+
var yCenter=ptStart.Y+(ptEnd.Y-ptStart.Y)/2;
|
|
70130
|
+
var xCenter=ptStart.X+(ptEnd.X-ptStart.X)/2;
|
|
70131
|
+
|
|
70132
|
+
if (this.ExtendLine.Top) yTop=this.Frame.ChartBorder.GetTopEx();
|
|
70133
|
+
if (this.ExtendLine.Bottom) yBottom=this.Frame.ChartBorder.GetBottomEx();
|
|
70134
|
+
|
|
70135
|
+
if (this.EnableBGColor)
|
|
70136
|
+
{
|
|
70137
|
+
var rtBG={ Left:xLeft, Top:yTop, Right:xRight, Bottom:yBottom };
|
|
70138
|
+
rtBG.Width=rtBG.Right-rtBG.Left;
|
|
70139
|
+
rtBG.Height=rtBG.Bottom-rtBG.Top;
|
|
70140
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
70141
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
70142
|
+
}
|
|
70143
|
+
|
|
70144
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
70145
|
+
this.Canvas.beginPath();
|
|
70146
|
+
this.Canvas.moveTo(ToFixedPoint(xLeft),yTop);
|
|
70147
|
+
this.Canvas.lineTo(ToFixedPoint(xLeft),yBottom);
|
|
70148
|
+
|
|
70149
|
+
this.Canvas.moveTo(ToFixedPoint(xRight),yTop);
|
|
70150
|
+
this.Canvas.lineTo(ToFixedPoint(xRight),yBottom);
|
|
70151
|
+
|
|
70152
|
+
this.Canvas.moveTo(ToFixedPoint(xLeft),ToFixedPoint(yCenter));
|
|
70153
|
+
this.Canvas.lineTo(ToFixedPoint(xRight),ToFixedPoint(yCenter));
|
|
70154
|
+
|
|
70155
|
+
this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(yTop));
|
|
70156
|
+
this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(yBottom));
|
|
70157
|
+
|
|
70158
|
+
this.Canvas.stroke();
|
|
70159
|
+
|
|
70160
|
+
this.LinePoint.push({ Start:{X:xLeft, Y:yTop}, End:{X:xLeft, Y:yBottom} });
|
|
70161
|
+
this.LinePoint.push({ Start:{X:xRight, Y:yTop}, End:{X:xRight, Y:yBottom} });
|
|
70162
|
+
this.LinePoint.push({ Start:{X:xLeft, Y:yCenter}, End:{X:xRight, Y:yCenter} });
|
|
70163
|
+
|
|
70164
|
+
this.DrawArrow({X:ptStart.X, Y:ToFixedPoint(yCenter)}, {X:ptEnd.X, Y:ToFixedPoint(yCenter)});
|
|
70165
|
+
this.DrawArrow({X:ToFixedPoint(xCenter), Y:ptStart.Y}, {X:ToFixedPoint(xCenter), Y:ptEnd.Y});
|
|
70166
|
+
|
|
70167
|
+
//文字输出
|
|
70168
|
+
var bottom=this.Frame.ChartBorder.GetBottomEx();
|
|
70169
|
+
var top=this.Frame.ChartBorder.GetTopEx();
|
|
70170
|
+
var startIndex=this.Frame.GetXData(ptStart.X,false);
|
|
70171
|
+
var endIndex=this.Frame.GetXData(ptEnd.X,false);
|
|
70172
|
+
var barCount=endIndex-startIndex+1;
|
|
70173
|
+
var startValue=this.Frame.GetYData(ptStart.Y,false);
|
|
70174
|
+
var endValue=this.Frame.GetYData(ptEnd.Y,false);
|
|
70175
|
+
var diffValue=endValue-startValue;
|
|
70176
|
+
|
|
70177
|
+
var rate=(diffValue/startValue)*100;
|
|
70178
|
+
var aryText=
|
|
70179
|
+
[
|
|
70180
|
+
`${diffValue.toFixed(2)} (${rate.toFixed(2)}%)`,
|
|
70181
|
+
`${barCount} bars`
|
|
70182
|
+
];
|
|
70183
|
+
|
|
70184
|
+
this.Canvas.font=this.Font;
|
|
70185
|
+
var textHeight=this.GetFontHeight();
|
|
70186
|
+
var textWidth=0;
|
|
70187
|
+
for(var i=0;i<aryText.length;++i)
|
|
70188
|
+
{
|
|
70189
|
+
var text=aryText[i];
|
|
70190
|
+
var value=this.Canvas.measureText(text).width;
|
|
70191
|
+
if (textWidth<value) textWidth=value;
|
|
70192
|
+
}
|
|
70193
|
+
textWidth+=(this.Label.LeftMargin+this.Label.RightMargin);
|
|
70194
|
+
|
|
70195
|
+
var rtTextBG={ Left:xCenter-textWidth/2, Top:ptEnd.Y+4, Width:textWidth, Height:aryText.length*textHeight+2 };
|
|
70196
|
+
if (diffValue>0) rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;
|
|
70197
|
+
else rtTextBG.Top=ptEnd.Y+4;
|
|
70198
|
+
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
70199
|
+
|
|
70200
|
+
if (diffValue>0)
|
|
70201
|
+
{
|
|
70202
|
+
if (rtTextBG.Top<=top)
|
|
70203
|
+
{
|
|
70204
|
+
rtTextBG.Top=top;
|
|
70205
|
+
rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
|
|
70206
|
+
}
|
|
70207
|
+
}
|
|
70208
|
+
else
|
|
70209
|
+
{
|
|
70210
|
+
if (rtTextBG.Bottom>=bottom)
|
|
70211
|
+
{
|
|
70212
|
+
rtTextBG.Bottom=bottom;
|
|
70213
|
+
rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
|
|
70214
|
+
}
|
|
70215
|
+
}
|
|
70216
|
+
|
|
70217
|
+
if (this.Label.EnableBGColor)
|
|
70218
|
+
{
|
|
70219
|
+
var path=new Path2D();
|
|
70220
|
+
path.roundRect(ToFixedPoint(rtTextBG.Left), ToFixedPoint(rtTextBG.Top), ToFixedRect(rtTextBG.Width), ToFixedRect(rtTextBG.Height), [3]);
|
|
70221
|
+
this.Canvas.fillStyle=this.Label.BGColor;
|
|
70222
|
+
this.Canvas.fill(path);
|
|
70223
|
+
}
|
|
70224
|
+
|
|
70225
|
+
this.Canvas.fillStyle=this.Label.TextColor;
|
|
70226
|
+
this.Canvas.textAlign="left";
|
|
70227
|
+
this.Canvas.textBaseline="bottom";
|
|
70228
|
+
var yText=rtTextBG.Bottom-2;
|
|
70229
|
+
for(var i=0;i<aryText.length;++i)
|
|
70230
|
+
{
|
|
70231
|
+
var text=aryText[i];
|
|
70232
|
+
this.Canvas.fillText(text,rtTextBG.Left+2+this.Label.LeftMargin,yText);
|
|
70233
|
+
yText-=textHeight;
|
|
70234
|
+
}
|
|
70235
|
+
}
|
|
70236
|
+
}
|
|
70237
|
+
|
|
69955
70238
|
//线段信息统计
|
|
69956
70239
|
function ChartInfoLine()
|
|
69957
70240
|
{
|
|
@@ -70530,7 +70813,11 @@ function JSChartResource()
|
|
|
70530
70813
|
UpColor:"rgb(238,21,21)", //上涨
|
|
70531
70814
|
DownColor:"rgb(25,158,0)", //下跌
|
|
70532
70815
|
UnchangeColor:"rgb(0,0,0)" //不变
|
|
70533
|
-
}
|
|
70816
|
+
},
|
|
70817
|
+
|
|
70818
|
+
ArrowType:0,
|
|
70819
|
+
|
|
70820
|
+
NameArrow:{ Color:"rgb(43,54,69)", Space:2, Symbol:'▼' },
|
|
70534
70821
|
}
|
|
70535
70822
|
|
|
70536
70823
|
this.Title={
|
|
@@ -71828,6 +72115,16 @@ function JSChartResource()
|
|
|
71828
72115
|
if (subItem.DownColor) this.IndexTitle.UpDownArrow.DownColor = subItem.DownColor;
|
|
71829
72116
|
if (subItem.UnchangeColor) this.IndexTitle.UpDownArrow.UnchangeColor = subItem.UnchangeColor;
|
|
71830
72117
|
}
|
|
72118
|
+
|
|
72119
|
+
if (IFrameSplitOperator.IsNumber(item.ArrowType)) this.IndexTitle.ArrowType=item.ArrowType;
|
|
72120
|
+
|
|
72121
|
+
if (item.NameArrow)
|
|
72122
|
+
{
|
|
72123
|
+
var subItem=item.NameArrow;
|
|
72124
|
+
if (subItem.Color) this.IndexTitle.NameArrow.Color = subItem.Color;
|
|
72125
|
+
if (subItem.Symbol) this.IndexTitle.NameArrow.Symbol = subItem.Symbol;
|
|
72126
|
+
if (IFrameSplitOperator.IsNumber(subItem.Space)) this.IndexTitle.NameArrow.Space = subItem.Space;
|
|
72127
|
+
}
|
|
71831
72128
|
}
|
|
71832
72129
|
|
|
71833
72130
|
if (style.Frame)
|
|
@@ -77799,7 +78096,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
77799
78096
|
|
|
77800
78097
|
if (IFrameSplitOperator.IsNumber(item.TitleHeight)) this.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
|
|
77801
78098
|
else item.TitleHeight=this.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;
|
|
77802
|
-
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow))
|
|
78099
|
+
if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=item.IsShowTitleArrow;
|
|
78100
|
+
if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) subFrame.Frame.TitleArrowType=item.TitleArrowType;
|
|
77803
78101
|
if (item.IsShowIndexName==false) this.Frame.SubFrame[i].Frame.IsShowIndexName=false;
|
|
77804
78102
|
if (item.IsShowOverlayIndexName==false) this.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
|
|
77805
78103
|
if (IFrameSplitOperator.IsNumber(item.IndexParamSpace)) this.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;
|
|
@@ -123569,7 +123867,9 @@ function GetBlackStyle()
|
|
|
123569
123867
|
UpColor:"rgb(238,21,21)", //上涨
|
|
123570
123868
|
DownColor:"rgb(25,158,0)", //下跌
|
|
123571
123869
|
UnchangeColor:"rgb(190, 190 ,190)" //不变
|
|
123572
|
-
}
|
|
123870
|
+
},
|
|
123871
|
+
|
|
123872
|
+
NameArrow:{ Color:"rgb(190, 190 ,190)", Space:2, Symbol:'▼' },
|
|
123573
123873
|
},
|
|
123574
123874
|
|
|
123575
123875
|
Title:
|
|
@@ -139805,6 +140105,7 @@ function JSDialogDrawTool()
|
|
|
139805
140105
|
[
|
|
139806
140106
|
{ Title: '价格范围', ClassName: 'hqchart_drawtool icon-shijianfanwei', Type:0, Data:{ ID:"PriceRange" } },
|
|
139807
140107
|
{ Title: '时间范围', ClassName: 'hqchart_drawtool icon-jiagefanwei', Type:0, Data:{ ID:"DateRange" } },
|
|
140108
|
+
{ Title: "价格和时间范围", ClassName:"hqchart_drawtool icon-jiagefanwei", Type:0, Data:{ ID:"DatePriceRange" } },
|
|
139808
140109
|
{ Title: "监测线", ClassName:"hqchart_drawtool icon-jiance", Type:0, Data:{ ID:"MonitorLine"} },
|
|
139809
140110
|
]
|
|
139810
140111
|
},
|
|
@@ -140824,7 +141125,7 @@ function HQChartScriptWorker()
|
|
|
140824
141125
|
|
|
140825
141126
|
|
|
140826
141127
|
|
|
140827
|
-
var HQCHART_VERSION="1.1.
|
|
141128
|
+
var HQCHART_VERSION="1.1.13613";
|
|
140828
141129
|
|
|
140829
141130
|
function PrintHQChartVersion()
|
|
140830
141131
|
{
|