hqchart 1.1.13335 → 1.1.13346
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 +38 -20
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +58 -0
- package/src/jscommon/umychart.js +274 -62
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +26 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +7 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +7 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.ttf +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff +0 -0
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.woff2 +0 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +275 -63
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +333 -63
|
@@ -4041,7 +4041,11 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4041
4041
|
return item;
|
|
4042
4042
|
}
|
|
4043
4043
|
|
|
4044
|
-
|
|
4044
|
+
/*
|
|
4045
|
+
{ Type: 1=K线柱子宽度不变 2=K线全部显示
|
|
4046
|
+
Redraw:是否重绘, XYSplit:是否重新计算分割线 }
|
|
4047
|
+
*/
|
|
4048
|
+
this.OnSize=function(option)
|
|
4045
4049
|
{
|
|
4046
4050
|
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
4047
4051
|
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
@@ -4102,10 +4106,14 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4102
4106
|
{
|
|
4103
4107
|
if (option && option.XYSplit===true) this.JSChartContainer.ResetFrameXYSplit();
|
|
4104
4108
|
|
|
4105
|
-
if (this.JSChartContainer.OnSize && option && option.Type==1)
|
|
4109
|
+
if (this.JSChartContainer.OnSize && option && option.Type==1) //K线宽度不变
|
|
4106
4110
|
{
|
|
4107
4111
|
this.JSChartContainer.OnSize();
|
|
4108
4112
|
}
|
|
4113
|
+
else if (this.JSChartContainer.ShowAllKLine && option && option.Type==2)
|
|
4114
|
+
{
|
|
4115
|
+
this.JSChartContainer.ShowAllKLine();
|
|
4116
|
+
}
|
|
4109
4117
|
else
|
|
4110
4118
|
{
|
|
4111
4119
|
if (this.JSChartContainer.Frame) this.JSChartContainer.Frame.SetSizeChage(true);
|
|
@@ -5789,12 +5797,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5789
5797
|
}
|
|
5790
5798
|
}
|
|
5791
5799
|
|
|
5792
|
-
this.ChangMainDataControl=function(dataControl)
|
|
5793
|
-
{
|
|
5794
|
-
if (this.JSChartContainer && typeof(this.JSChartContainer.SetMainDataConotrl)=='function')
|
|
5795
|
-
this.JSChartContainer.SetMainDataConotrl(dataControl);
|
|
5796
|
-
}
|
|
5797
|
-
|
|
5798
5800
|
this.AddOverlayIndex=function(obj) //{WindowIndex:窗口ID, IndexName:指标ID, Identify:叠加指标ID(可选), API}
|
|
5799
5801
|
{
|
|
5800
5802
|
if (this.JSChartContainer && typeof(this.JSChartContainer.AddOverlayIndex)=='function')
|
|
@@ -11999,7 +12001,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11999
12001
|
let sendData={ DrawPicture: drawPicture };
|
|
12000
12002
|
event.Callback(event,sendData,this);
|
|
12001
12003
|
}
|
|
12002
|
-
|
|
12004
|
+
|
|
12005
|
+
//单个回调
|
|
12006
|
+
if (drawPicture.FinishedCallback) drawPicture.FinishedCallback(drawPicture);
|
|
12003
12007
|
|
|
12004
12008
|
if (drawPicture.OnFinish) drawPicture.OnFinish();
|
|
12005
12009
|
|
|
@@ -13533,6 +13537,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13533
13537
|
if (deleteCount>0) this.ChartPaintEx=paint;
|
|
13534
13538
|
}
|
|
13535
13539
|
}
|
|
13540
|
+
|
|
13541
|
+
this.ClearCurrnetDrawPicture=function()
|
|
13542
|
+
{
|
|
13543
|
+
this.CurrentChartDrawPicture=null;
|
|
13544
|
+
}
|
|
13536
13545
|
}
|
|
13537
13546
|
|
|
13538
13547
|
function GetDevicePixelRatio()
|
|
@@ -13687,6 +13696,16 @@ function IsRecvOverlap(rect1, rect2)
|
|
|
13687
13696
|
return Math.max(rect1.Left,rect2.Left) < Math.min(rect1.Right,rect2.Right) && Math.max(rect1.Top,rect2.Top) < Math.min(rect1.Bottom,rect2.Bottom);
|
|
13688
13697
|
}
|
|
13689
13698
|
|
|
13699
|
+
function CopyMerginConfig(dest,src)
|
|
13700
|
+
{
|
|
13701
|
+
if (!src || !dest) return;
|
|
13702
|
+
|
|
13703
|
+
if (IFrameSplitOperator.IsNumber(src.Left)) dest.Left=src.Left;
|
|
13704
|
+
if (IFrameSplitOperator.IsNumber(src.Top)) dest.Top=src.Top;
|
|
13705
|
+
if (IFrameSplitOperator.IsNumber(src.Right)) dest.Right=src.Right;
|
|
13706
|
+
if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
|
|
13707
|
+
}
|
|
13708
|
+
|
|
13690
13709
|
|
|
13691
13710
|
function Point()
|
|
13692
13711
|
{
|
|
@@ -59450,6 +59469,79 @@ function IChartDrawPicture()
|
|
|
59450
59469
|
//复制
|
|
59451
59470
|
//this.CopyData=function() { }
|
|
59452
59471
|
//this.PtInButtons=function(x, y) { }
|
|
59472
|
+
|
|
59473
|
+
|
|
59474
|
+
//计算标签页大小
|
|
59475
|
+
this.CalculateLabelSize=function(labelInfo)
|
|
59476
|
+
{
|
|
59477
|
+
var config=labelInfo.Config;
|
|
59478
|
+
this.Canvas.font=config.Font;
|
|
59479
|
+
this.Canvas.textAlign="left";
|
|
59480
|
+
this.Canvas.textBaseline="top";
|
|
59481
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
59482
|
+
|
|
59483
|
+
var maxWidth=0, lineCount=0, labelHeight=config.Mergin.Top+config.Mergin.Bottom;
|
|
59484
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
59485
|
+
{
|
|
59486
|
+
if (i>0) labelHeight+=config.LineSpace;
|
|
59487
|
+
|
|
59488
|
+
var item=labelInfo.AryText[i];
|
|
59489
|
+
item.NameWidth=0;
|
|
59490
|
+
item.TextWidth=0;
|
|
59491
|
+
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
59492
|
+
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
59493
|
+
|
|
59494
|
+
var itemWidth=item.NameWidth+item.TextWidth;
|
|
59495
|
+
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
59496
|
+
++lineCount;
|
|
59497
|
+
|
|
59498
|
+
labelHeight+=lineHeight;
|
|
59499
|
+
}
|
|
59500
|
+
|
|
59501
|
+
var labelWidth=maxWidth+config.Mergin.Left+config.Mergin.Right;
|
|
59502
|
+
|
|
59503
|
+
labelInfo.Width=labelWidth;
|
|
59504
|
+
labelInfo.Height=labelHeight;
|
|
59505
|
+
labelInfo.LineHeight=lineHeight;
|
|
59506
|
+
}
|
|
59507
|
+
|
|
59508
|
+
this.DrawDefaultLabel=function(labelInfo, rtBG)
|
|
59509
|
+
{
|
|
59510
|
+
var config=labelInfo.Config;
|
|
59511
|
+
|
|
59512
|
+
if (config.BGColor)
|
|
59513
|
+
{
|
|
59514
|
+
this.Canvas.fillStyle=config.BGColor
|
|
59515
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
59516
|
+
}
|
|
59517
|
+
|
|
59518
|
+
var xText=rtBG.Left+config.Mergin.Left;
|
|
59519
|
+
var yText=rtBG.Top+config.Mergin.Top;
|
|
59520
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
59521
|
+
{
|
|
59522
|
+
var item=labelInfo.AryText[i];
|
|
59523
|
+
|
|
59524
|
+
if (i>0) yText+=config.LineSpace;
|
|
59525
|
+
|
|
59526
|
+
if (item.Name)
|
|
59527
|
+
{
|
|
59528
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
59529
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
59530
|
+
}
|
|
59531
|
+
|
|
59532
|
+
if (item.Text)
|
|
59533
|
+
{
|
|
59534
|
+
var xOut=xText+item.NameWidth;
|
|
59535
|
+
if (config.TextAlign==1) //右对齐
|
|
59536
|
+
xOut=rtBG.Right-config.Mergin.Right-item.TextWidth;
|
|
59537
|
+
|
|
59538
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
59539
|
+
this.Canvas.fillText(item.Text,xOut ,yText);
|
|
59540
|
+
}
|
|
59541
|
+
|
|
59542
|
+
yText+=labelInfo.LineHeight;
|
|
59543
|
+
}
|
|
59544
|
+
}
|
|
59453
59545
|
}
|
|
59454
59546
|
|
|
59455
59547
|
IChartDrawPicture.ColorToRGBA=function(color,opacity)
|
|
@@ -59588,7 +59680,8 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
59588
59680
|
{ Name:"FibRetracement", ClassName:"ChartFibRetracement", Create:function() { return new ChartFibRetracement(); }}, //斐波那契回测
|
|
59589
59681
|
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
|
|
59590
59682
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
59591
|
-
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }}
|
|
59683
|
+
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
59684
|
+
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
59592
59685
|
];
|
|
59593
59686
|
|
|
59594
59687
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -64451,9 +64544,13 @@ function ChartDrawMonitorLine()
|
|
|
64451
64544
|
this.LabelConfig=
|
|
64452
64545
|
{
|
|
64453
64546
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
64454
|
-
BGColor:"rgb(30,144,255)",
|
|
64547
|
+
BGColor:"rgb(30,144,255)",
|
|
64455
64548
|
LineColor:"rgba(255,215,0,0.8)",
|
|
64456
64549
|
LineDash:[3,5],
|
|
64550
|
+
|
|
64551
|
+
Mergin:{ Left:5, Right:5, Top:5, Bottom:4 },
|
|
64552
|
+
LineSpace:5, //行间距
|
|
64553
|
+
TextAlign:1, //对齐方式 0=left 1=right
|
|
64457
64554
|
}
|
|
64458
64555
|
|
|
64459
64556
|
this.PointToValue_Backup=this.PointToValue;
|
|
@@ -64487,7 +64584,9 @@ function ChartDrawMonitorLine()
|
|
|
64487
64584
|
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
64488
64585
|
if (item.LineColor) dest.LineColor=item.LineColor;
|
|
64489
64586
|
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
64490
|
-
if (IFrameSplitOperator.IsNumber(item.
|
|
64587
|
+
if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
|
|
64588
|
+
if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
|
|
64589
|
+
if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
|
|
64491
64590
|
}
|
|
64492
64591
|
|
|
64493
64592
|
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
@@ -64601,6 +64700,7 @@ function ChartDrawMonitorLine()
|
|
|
64601
64700
|
this.DrawLabel=function(labelInfo)
|
|
64602
64701
|
{
|
|
64603
64702
|
if (!this.FormatLabelTextCallback) return;
|
|
64703
|
+
labelInfo.Config=this.LabelConfig;
|
|
64604
64704
|
this.FormatLabelTextCallback(labelInfo);
|
|
64605
64705
|
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
64606
64706
|
if (!IFrameSplitOperator.IsNumber(labelInfo.YValue)) return;
|
|
@@ -64617,54 +64717,14 @@ function ChartDrawMonitorLine()
|
|
|
64617
64717
|
]
|
|
64618
64718
|
*/
|
|
64619
64719
|
|
|
64620
|
-
|
|
64621
|
-
this.Canvas.font=this.LabelConfig.Font;
|
|
64622
|
-
this.Canvas.textAlign="left";
|
|
64623
|
-
this.Canvas.textBaseline="top";
|
|
64624
|
-
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
64625
|
-
var maxWidth=0, lineCount=0;
|
|
64626
|
-
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
64627
|
-
{
|
|
64628
|
-
var item=labelInfo.AryText[i];
|
|
64629
|
-
item.NameWidth=0;
|
|
64630
|
-
item.TextWidth=0;
|
|
64631
|
-
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
64632
|
-
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
64633
|
-
|
|
64634
|
-
var itemWidth=item.NameWidth+item.TextWidth;
|
|
64635
|
-
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
64636
|
-
++lineCount;
|
|
64637
|
-
}
|
|
64720
|
+
this.CalculateLabelSize(labelInfo);
|
|
64638
64721
|
|
|
64639
|
-
var
|
|
64722
|
+
var y=this.Frame.GetYFromData(labelInfo.YValue,false);
|
|
64723
|
+
var rtBG={ Left:labelInfo.Left+1, Top:y, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
64640
64724
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64641
64725
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
64642
|
-
|
|
64643
|
-
|
|
64644
|
-
this.Canvas.fillStyle=this.LabelConfig.BGColor
|
|
64645
|
-
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
64646
|
-
}
|
|
64647
|
-
|
|
64648
|
-
var xText=rtBG.Left+2;
|
|
64649
|
-
var yText=rtBG.Top+this.LabelConfig.YTextOffset;
|
|
64650
|
-
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
64651
|
-
{
|
|
64652
|
-
var item=labelInfo.AryText[i];
|
|
64653
|
-
|
|
64654
|
-
if (item.Name)
|
|
64655
|
-
{
|
|
64656
|
-
this.Canvas.fillStyle=item.NameColor;
|
|
64657
|
-
this.Canvas.fillText(item.Name,xText,yText);
|
|
64658
|
-
}
|
|
64659
|
-
|
|
64660
|
-
if (item.Text)
|
|
64661
|
-
{
|
|
64662
|
-
this.Canvas.fillStyle=item.TextColor;
|
|
64663
|
-
this.Canvas.fillText(item.Text,xText+item.NameWidth ,yText);
|
|
64664
|
-
}
|
|
64665
|
-
|
|
64666
|
-
yText+=lineHeight;
|
|
64667
|
-
}
|
|
64726
|
+
|
|
64727
|
+
this.DrawDefaultLabel(labelInfo, rtBG);
|
|
64668
64728
|
}
|
|
64669
64729
|
}
|
|
64670
64730
|
|
|
@@ -68486,6 +68546,139 @@ function ChartDateRange()
|
|
|
68486
68546
|
}
|
|
68487
68547
|
}
|
|
68488
68548
|
|
|
68549
|
+
//线段信息统计
|
|
68550
|
+
function ChartInfoLine()
|
|
68551
|
+
{
|
|
68552
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
68553
|
+
this.newMethod();
|
|
68554
|
+
delete this.newMethod;
|
|
68555
|
+
|
|
68556
|
+
this.ClassName='ChartInfoLine';
|
|
68557
|
+
this.PointCount=2;
|
|
68558
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
68559
|
+
|
|
68560
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
68561
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
68562
|
+
this.IsShowYCoordinate=false;
|
|
68563
|
+
this.CopyData=this.CopyData_default;
|
|
68564
|
+
this.OnlyMoveXIndex=true;
|
|
68565
|
+
this.IsSupportMagnet=true;
|
|
68566
|
+
|
|
68567
|
+
this.LabelConfig=
|
|
68568
|
+
{
|
|
68569
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
68570
|
+
BGColor:"rgba(135, 206 ,250,0.95)",
|
|
68571
|
+
Mergin:{ Left:10, Right:10, Top:10, Bottom:8 },
|
|
68572
|
+
LineSpace:5, //行间距
|
|
68573
|
+
TextAlign:1, //对齐方式 0=left 1=right
|
|
68574
|
+
}
|
|
68575
|
+
|
|
68576
|
+
this.FormatLabelTextCallback=null;
|
|
68577
|
+
|
|
68578
|
+
this.SetOption=function(option)
|
|
68579
|
+
{
|
|
68580
|
+
if (option.LineColor) this.LineColor=option.LineColor;
|
|
68581
|
+
if (option.Label)
|
|
68582
|
+
{
|
|
68583
|
+
var item=option.Label;
|
|
68584
|
+
var dest=this.LabelConfig
|
|
68585
|
+
if (item.Font) dest.Font=item.Font;
|
|
68586
|
+
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
68587
|
+
if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
|
|
68588
|
+
if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
|
|
68589
|
+
if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
|
|
68590
|
+
}
|
|
68591
|
+
|
|
68592
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
68593
|
+
}
|
|
68594
|
+
|
|
68595
|
+
this.Draw=function()
|
|
68596
|
+
{
|
|
68597
|
+
this.LinePoint=[];
|
|
68598
|
+
if (this.IsFrameMinSize()) return;
|
|
68599
|
+
if (!this.IsShow) return;
|
|
68600
|
+
|
|
68601
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:false} );
|
|
68602
|
+
if (!drawPoint) return;
|
|
68603
|
+
if (drawPoint.length!=2) return;
|
|
68604
|
+
|
|
68605
|
+
this.ClipFrame();
|
|
68606
|
+
|
|
68607
|
+
var ptStart=drawPoint[0];
|
|
68608
|
+
var ptEnd=drawPoint[1];
|
|
68609
|
+
|
|
68610
|
+
this.SetLineWidth();
|
|
68611
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
68612
|
+
this.Canvas.beginPath();
|
|
68613
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
68614
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
68615
|
+
this.Canvas.stroke();
|
|
68616
|
+
this.RestoreLineWidth();
|
|
68617
|
+
|
|
68618
|
+
var line={Start:ptStart, End:ptEnd};
|
|
68619
|
+
this.LinePoint.push(line);
|
|
68620
|
+
|
|
68621
|
+
this.DrawPoint(drawPoint); //画点
|
|
68622
|
+
|
|
68623
|
+
var labelInfo={ };
|
|
68624
|
+
labelInfo.Config=this.LabelConfig;
|
|
68625
|
+
labelInfo.PtStart=ptStart;
|
|
68626
|
+
labelInfo.PtEnd=ptEnd;
|
|
68627
|
+
|
|
68628
|
+
this.Canvas.restore();
|
|
68629
|
+
|
|
68630
|
+
this.DrawLabel(labelInfo);
|
|
68631
|
+
}
|
|
68632
|
+
|
|
68633
|
+
this.DrawLabel=function(labelInfo)
|
|
68634
|
+
{
|
|
68635
|
+
if (!this.FormatLabelTextCallback) return;
|
|
68636
|
+
|
|
68637
|
+
labelInfo.AryPoint=this.Point;
|
|
68638
|
+
if (this.Status!=10)
|
|
68639
|
+
{
|
|
68640
|
+
labelInfo.AryValue=this.PointToKLine(this.Point);
|
|
68641
|
+
}
|
|
68642
|
+
else
|
|
68643
|
+
{
|
|
68644
|
+
labelInfo.AryValue=this.Value;
|
|
68645
|
+
}
|
|
68646
|
+
|
|
68647
|
+
labelInfo.Data=this.Frame.Data; //数据
|
|
68648
|
+
|
|
68649
|
+
this.FormatLabelTextCallback(labelInfo);
|
|
68650
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
68651
|
+
|
|
68652
|
+
this.CalculateLabelSize(labelInfo);
|
|
68653
|
+
|
|
68654
|
+
var ptStart=labelInfo.PtStart;
|
|
68655
|
+
var ptEnd=labelInfo.PtEnd;
|
|
68656
|
+
if (ptStart.X>ptEnd.X)
|
|
68657
|
+
{
|
|
68658
|
+
ptStart=labelInfo.PtEnd;
|
|
68659
|
+
ptEnd=labelInfo.PtStart;
|
|
68660
|
+
}
|
|
68661
|
+
|
|
68662
|
+
var config=labelInfo.Config;
|
|
68663
|
+
var xCenter=labelInfo.PtStart.X+(labelInfo.PtEnd.X-labelInfo.PtStart.X)/2;
|
|
68664
|
+
var yCenter=labelInfo.PtStart.Y+(labelInfo.PtEnd.Y-labelInfo.PtStart.Y)/2;
|
|
68665
|
+
if (ptStart.Y<ptEnd.Y)
|
|
68666
|
+
{
|
|
68667
|
+
var rtBG={ Left:xCenter, Bottom:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
68668
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
68669
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
68670
|
+
}
|
|
68671
|
+
else
|
|
68672
|
+
{
|
|
68673
|
+
var rtBG={ Left:xCenter, Top:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
68674
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
68675
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
68676
|
+
}
|
|
68677
|
+
|
|
68678
|
+
this.DrawDefaultLabel(labelInfo, rtBG);
|
|
68679
|
+
}
|
|
68680
|
+
}
|
|
68681
|
+
|
|
68489
68682
|
|
|
68490
68683
|
function ChartDrawStorage()
|
|
68491
68684
|
{
|
|
@@ -73214,6 +73407,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73214
73407
|
}
|
|
73215
73408
|
}
|
|
73216
73409
|
|
|
73410
|
+
this.ShowAllKLine=function()
|
|
73411
|
+
{
|
|
73412
|
+
var chart=this.ChartPaint[0];
|
|
73413
|
+
if (!chart) return false;
|
|
73414
|
+
var kData=chart.Data;
|
|
73415
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
73416
|
+
|
|
73417
|
+
var xCount=kData.Data.length+this.RightSpaceCount;
|
|
73418
|
+
for(var i=0;i<this.Frame.SubFrame.length;++i)
|
|
73419
|
+
{
|
|
73420
|
+
var item =this.Frame.SubFrame[i].Frame;
|
|
73421
|
+
item.XPointCount=xCount;
|
|
73422
|
+
}
|
|
73423
|
+
|
|
73424
|
+
kData.DataOffset=0;
|
|
73425
|
+
this.CursorIndex=0;
|
|
73426
|
+
|
|
73427
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
73428
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
73429
|
+
this.Frame.SetSizeChage(true);
|
|
73430
|
+
this.UpdatePointByCursorIndex(2); //取消十字光标
|
|
73431
|
+
this.Draw();
|
|
73432
|
+
}
|
|
73433
|
+
|
|
73217
73434
|
this.UpdateMainData=function(hisData, lastDataCount)
|
|
73218
73435
|
{
|
|
73219
73436
|
var frameHisdata=null;
|
|
@@ -77246,11 +77463,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
77246
77463
|
return true;
|
|
77247
77464
|
}
|
|
77248
77465
|
|
|
77249
|
-
this.ClearCurrnetDrawPicture=function()
|
|
77250
|
-
{
|
|
77251
|
-
this.CurrentChartDrawPicture=null;
|
|
77252
|
-
}
|
|
77253
|
-
|
|
77254
77466
|
this.AddChartDrawPicture=function(obj)
|
|
77255
77467
|
{
|
|
77256
77468
|
if (!obj) return null;
|
|
@@ -135751,6 +135963,7 @@ function JSDialogDrawTool()
|
|
|
135751
135963
|
AryChart:
|
|
135752
135964
|
[
|
|
135753
135965
|
{ Title: '线段', ClassName: 'hqchart_drawtool icon-draw_line', Type:0, Data:{ ID:"线段" } },
|
|
135966
|
+
{ Title: '线段信息', ClassName: 'hqchart_drawtool icon-infoline', Type:0, Data:{ ID:"InfoLine" } },
|
|
135754
135967
|
{ Title: '射线', ClassName: 'hqchart_drawtool icon-draw_rays', Type:0, Data:{ ID:"射线" } },
|
|
135755
135968
|
{ Title: '标价线', ClassName: 'hqchart_drawtool icon-price_line', Type:0, Data:{ ID:"标价线" } },
|
|
135756
135969
|
{ Title: '垂直线', ClassName: 'hqchart_drawtool icon-vertical_line', Type:0, Data:{ ID:"垂直线" } },
|
|
@@ -136177,6 +136390,9 @@ function JSDialogDrawTool()
|
|
|
136177
136390
|
|
|
136178
136391
|
var name=data.Item.Data.ID;
|
|
136179
136392
|
if (["icon-arrow_up","icon-arrow_down","icon-arrow_left", "icon-arrow_right"].includes(name)) option=null;
|
|
136393
|
+
else if (name=="InfoLine") option.FormatLabelTextCallback=(lableInfo)=>{ this.ChartInfoLine_FormatLabelText(lableInfo); }
|
|
136394
|
+
else if (name=="MonitorLine") option.FormatLabelTextCallback=(lableInfo)=>{ this.ChartDrawMonitorLine_FormatLabelText(lableInfo); }
|
|
136395
|
+
|
|
136180
136396
|
|
|
136181
136397
|
this.HQChart.CreateChartDrawPicture(name, option, (chart)=>{ this.OnFinishDrawPicture(chart, data); });
|
|
136182
136398
|
}
|
|
@@ -136254,6 +136470,60 @@ function JSDialogDrawTool()
|
|
|
136254
136470
|
this.onmousemove = null;
|
|
136255
136471
|
this.onmouseup = null;
|
|
136256
136472
|
}
|
|
136473
|
+
|
|
136474
|
+
this.ChartInfoLine_FormatLabelText=function(labelInfo)
|
|
136475
|
+
{
|
|
136476
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryValue)) return;
|
|
136477
|
+
if (!labelInfo.Data || !IFrameSplitOperator.IsNonEmptyArray(labelInfo.Data.Data)) return;
|
|
136478
|
+
for(var i=0;i<labelInfo.AryValue.length;++i)
|
|
136479
|
+
{
|
|
136480
|
+
var item=labelInfo.AryValue[i];
|
|
136481
|
+
if (!IFrameSplitOperator.IsNumber(item.XValue) || item.XValue<0) return;
|
|
136482
|
+
}
|
|
136483
|
+
|
|
136484
|
+
var startIndex=labelInfo.AryValue[0].XValue;
|
|
136485
|
+
var endIndex=labelInfo.AryValue[1].XValue;
|
|
136486
|
+
var startItem=labelInfo.Data.Data[startIndex];
|
|
136487
|
+
var endItem=labelInfo.Data.Data[endIndex];
|
|
136488
|
+
if (!startItem || !endItem) return;
|
|
136489
|
+
|
|
136490
|
+
var isMinutePeriod=ChartData.IsMinutePeriod(labelInfo.Data.Period, true);
|
|
136491
|
+
labelInfo.AryText=[];
|
|
136492
|
+
labelInfo.AryText.push({ Name:"起始日期: ", Text:IFrameSplitOperator.FormatDateString(startItem.Date), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136493
|
+
if (isMinutePeriod) labelInfo.AryText.push({ Name:"起始时间: ", Text:IFrameSplitOperator.FormatTimeString(startItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136494
|
+
|
|
136495
|
+
labelInfo.AryText.push({ Name:"结束日期: ", Text:IFrameSplitOperator.FormatDateString(endItem.Date), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136496
|
+
if (isMinutePeriod) labelInfo.AryText.push({ Name:"结束时间: ", Text:IFrameSplitOperator.FormatTimeString(endItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136497
|
+
|
|
136498
|
+
//示例:计算一个斜率数据
|
|
136499
|
+
var x=labelInfo.AryPoint[1].X-labelInfo.AryPoint[0].X;
|
|
136500
|
+
var y=labelInfo.AryPoint[1].Y-labelInfo.AryPoint[0].Y;
|
|
136501
|
+
var text="--";
|
|
136502
|
+
if (x!=0) text=`${(y/x).toFixed(4)}`;
|
|
136503
|
+
labelInfo.AryText.push({ Name:"斜率: ", Text:text, NameColor:"rgb(0,0,0)", TextColor:"rgb(238, 0, 238)"});
|
|
136504
|
+
labelInfo.AryText.push({ Name:"其他: ", Text:'......', NameColor:"rgb(0,0,0)", TextColor:"rgb(156, 156, 156)"});
|
|
136505
|
+
}
|
|
136506
|
+
|
|
136507
|
+
this.ChartDrawMonitorLine_FormatLabelText=function(labelInfo)
|
|
136508
|
+
{
|
|
136509
|
+
if (!labelInfo.Data || !IFrameSplitOperator.IsNonEmptyArray(labelInfo.Data.Data)) return;
|
|
136510
|
+
if (!IFrameSplitOperator.IsNumber(labelInfo.StartIndex) || labelInfo.StartIndex<0) return;
|
|
136511
|
+
|
|
136512
|
+
var startItem=labelInfo.Data.Data[labelInfo.StartIndex];
|
|
136513
|
+
var endItem=labelInfo.Data.Data[labelInfo.Data.Data.length-1];
|
|
136514
|
+
labelInfo.YValue=endItem.Close;
|
|
136515
|
+
var isMinutePeriod=ChartData.IsMinutePeriod(labelInfo.Data.Period, true);
|
|
136516
|
+
|
|
136517
|
+
labelInfo.AryText=[];
|
|
136518
|
+
labelInfo.AryText.push({ Name:"起始: ", Text:IFrameSplitOperator.FormatDateString(startItem.Date,"MM-DD"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136519
|
+
if (isMinutePeriod) labelInfo.AryText.push({ Name:"起始: ", Text:IFrameSplitOperator.FormatTimeString(startItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136520
|
+
|
|
136521
|
+
labelInfo.AryText.push({ Name:"最新: ", Text:IFrameSplitOperator.FormatDateString(endItem.Date,"MM-DD"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136522
|
+
if (isMinutePeriod) labelInfo.AryText.push({ Name:"最新: ", Text:IFrameSplitOperator.FormatTimeString(endItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
|
|
136523
|
+
|
|
136524
|
+
labelInfo.AryText.push({ Name:"ɑ: ", Text:"--.--", NameColor:"rgb(0, 0 ,255)", TextColor:"rgb(255, 165, 0)"});
|
|
136525
|
+
labelInfo.AryText.push({ Name:"β: ", Text:"--.--", NameColor:"rgb(0 ,0 ,255)", TextColor:"rgb(238 ,121, 66)"});
|
|
136526
|
+
}
|
|
136257
136527
|
}
|
|
136258
136528
|
|
|
136259
136529
|
|
|
@@ -136715,7 +136985,7 @@ function HQChartScriptWorker()
|
|
|
136715
136985
|
|
|
136716
136986
|
|
|
136717
136987
|
|
|
136718
|
-
var HQCHART_VERSION="1.1.
|
|
136988
|
+
var HQCHART_VERSION="1.1.13345";
|
|
136719
136989
|
|
|
136720
136990
|
function PrintHQChartVersion()
|
|
136721
136991
|
{
|