hqchart 1.1.13330 → 1.1.13339
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 +89 -5
- package/src/jscommon/umychart.js +289 -52
- 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 +290 -53
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +379 -58
package/src/jscommon/umychart.js
CHANGED
|
@@ -105,7 +105,11 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
105
105
|
return item;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
/*
|
|
109
|
+
{ Type: 1=K线柱子宽度不变 2=K线全部显示
|
|
110
|
+
Redraw:是否重绘, XYSplit:是否重新计算分割线 }
|
|
111
|
+
*/
|
|
112
|
+
this.OnSize=function(option)
|
|
109
113
|
{
|
|
110
114
|
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
111
115
|
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
@@ -166,10 +170,14 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
166
170
|
{
|
|
167
171
|
if (option && option.XYSplit===true) this.JSChartContainer.ResetFrameXYSplit();
|
|
168
172
|
|
|
169
|
-
if (this.JSChartContainer.OnSize && option && option.Type==1)
|
|
173
|
+
if (this.JSChartContainer.OnSize && option && option.Type==1) //K线宽度不变
|
|
170
174
|
{
|
|
171
175
|
this.JSChartContainer.OnSize();
|
|
172
176
|
}
|
|
177
|
+
else if (this.JSChartContainer.ShowAllKLine && option && option.Type==2)
|
|
178
|
+
{
|
|
179
|
+
this.JSChartContainer.ShowAllKLine();
|
|
180
|
+
}
|
|
173
181
|
else
|
|
174
182
|
{
|
|
175
183
|
if (this.JSChartContainer.Frame) this.JSChartContainer.Frame.SetSizeChage(true);
|
|
@@ -9751,6 +9759,16 @@ function IsRecvOverlap(rect1, rect2)
|
|
|
9751
9759
|
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);
|
|
9752
9760
|
}
|
|
9753
9761
|
|
|
9762
|
+
function CopyMerginConfig(dest,src)
|
|
9763
|
+
{
|
|
9764
|
+
if (!src || !dest) return;
|
|
9765
|
+
|
|
9766
|
+
if (IFrameSplitOperator.IsNumber(src.Left)) dest.Left=src.Left;
|
|
9767
|
+
if (IFrameSplitOperator.IsNumber(src.Top)) dest.Top=src.Top;
|
|
9768
|
+
if (IFrameSplitOperator.IsNumber(src.Right)) dest.Right=src.Right;
|
|
9769
|
+
if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
|
|
9770
|
+
}
|
|
9771
|
+
|
|
9754
9772
|
|
|
9755
9773
|
function Point()
|
|
9756
9774
|
{
|
|
@@ -11785,6 +11803,7 @@ function AverageWidthFrame()
|
|
|
11785
11803
|
{
|
|
11786
11804
|
var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);
|
|
11787
11805
|
if (ChartData.IsMinutePeriod(option.Period)) text+=" " + IFrameSplitOperator.FormatTimeString(kItem.Time, "HH:MM");
|
|
11806
|
+
else if (ChartData.IsMilliSecondPeriod(option.Period)) text+=" " + IFrameSplitOperator.FormatTimeString(kItem.Time, "HH:MM:SS.fff");
|
|
11788
11807
|
var textWidth=this.Canvas.measureText(text).width+2;
|
|
11789
11808
|
|
|
11790
11809
|
var textLeft=item.X-textWidth/2;
|
|
@@ -54402,7 +54421,7 @@ function IChartDrawPicture()
|
|
|
54402
54421
|
var isHScreen=this.Frame.IsHScreen;
|
|
54403
54422
|
if (isHScreen)
|
|
54404
54423
|
{
|
|
54405
|
-
for(var i
|
|
54424
|
+
for(var i=0; i<this.Point.length; ++i)
|
|
54406
54425
|
{
|
|
54407
54426
|
var item=this.Point[i];
|
|
54408
54427
|
var xValue=parseInt(this.Frame.GetXData(item.Y,false))+data.DataOffset;
|
|
@@ -54418,7 +54437,7 @@ function IChartDrawPicture()
|
|
|
54418
54437
|
}
|
|
54419
54438
|
else
|
|
54420
54439
|
{
|
|
54421
|
-
for(var i
|
|
54440
|
+
for(var i=0; i<this.Point.length; ++i)
|
|
54422
54441
|
{
|
|
54423
54442
|
var item=this.Point[i];
|
|
54424
54443
|
var xValue=parseInt(this.Frame.GetXData(item.X,false))+data.DataOffset;
|
|
@@ -55513,6 +55532,79 @@ function IChartDrawPicture()
|
|
|
55513
55532
|
//复制
|
|
55514
55533
|
//this.CopyData=function() { }
|
|
55515
55534
|
//this.PtInButtons=function(x, y) { }
|
|
55535
|
+
|
|
55536
|
+
|
|
55537
|
+
//计算标签页大小
|
|
55538
|
+
this.CalculateLabelSize=function(labelInfo)
|
|
55539
|
+
{
|
|
55540
|
+
var config=labelInfo.Config;
|
|
55541
|
+
this.Canvas.font=config.Font;
|
|
55542
|
+
this.Canvas.textAlign="left";
|
|
55543
|
+
this.Canvas.textBaseline="top";
|
|
55544
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
55545
|
+
|
|
55546
|
+
var maxWidth=0, lineCount=0, labelHeight=config.Mergin.Top+config.Mergin.Bottom;
|
|
55547
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
55548
|
+
{
|
|
55549
|
+
if (i>0) labelHeight+=config.LineSpace;
|
|
55550
|
+
|
|
55551
|
+
var item=labelInfo.AryText[i];
|
|
55552
|
+
item.NameWidth=0;
|
|
55553
|
+
item.TextWidth=0;
|
|
55554
|
+
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
55555
|
+
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
55556
|
+
|
|
55557
|
+
var itemWidth=item.NameWidth+item.TextWidth;
|
|
55558
|
+
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
55559
|
+
++lineCount;
|
|
55560
|
+
|
|
55561
|
+
labelHeight+=lineHeight;
|
|
55562
|
+
}
|
|
55563
|
+
|
|
55564
|
+
var labelWidth=maxWidth+config.Mergin.Left+config.Mergin.Right;
|
|
55565
|
+
|
|
55566
|
+
labelInfo.Width=labelWidth;
|
|
55567
|
+
labelInfo.Height=labelHeight;
|
|
55568
|
+
labelInfo.LineHeight=lineHeight;
|
|
55569
|
+
}
|
|
55570
|
+
|
|
55571
|
+
this.DrawDefaultLabel=function(labelInfo, rtBG)
|
|
55572
|
+
{
|
|
55573
|
+
var config=labelInfo.Config;
|
|
55574
|
+
|
|
55575
|
+
if (config.BGColor)
|
|
55576
|
+
{
|
|
55577
|
+
this.Canvas.fillStyle=config.BGColor
|
|
55578
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
55579
|
+
}
|
|
55580
|
+
|
|
55581
|
+
var xText=rtBG.Left+config.Mergin.Left;
|
|
55582
|
+
var yText=rtBG.Top+config.Mergin.Top;
|
|
55583
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
55584
|
+
{
|
|
55585
|
+
var item=labelInfo.AryText[i];
|
|
55586
|
+
|
|
55587
|
+
if (i>0) yText+=config.LineSpace;
|
|
55588
|
+
|
|
55589
|
+
if (item.Name)
|
|
55590
|
+
{
|
|
55591
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
55592
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
55593
|
+
}
|
|
55594
|
+
|
|
55595
|
+
if (item.Text)
|
|
55596
|
+
{
|
|
55597
|
+
var xOut=xText+item.NameWidth;
|
|
55598
|
+
if (config.TextAlign==1) //右对齐
|
|
55599
|
+
xOut=rtBG.Right-config.Mergin.Right-item.TextWidth;
|
|
55600
|
+
|
|
55601
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
55602
|
+
this.Canvas.fillText(item.Text,xOut ,yText);
|
|
55603
|
+
}
|
|
55604
|
+
|
|
55605
|
+
yText+=labelInfo.LineHeight;
|
|
55606
|
+
}
|
|
55607
|
+
}
|
|
55516
55608
|
}
|
|
55517
55609
|
|
|
55518
55610
|
IChartDrawPicture.ColorToRGBA=function(color,opacity)
|
|
@@ -55651,7 +55743,8 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
55651
55743
|
{ Name:"FibRetracement", ClassName:"ChartFibRetracement", Create:function() { return new ChartFibRetracement(); }}, //斐波那契回测
|
|
55652
55744
|
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
|
|
55653
55745
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
55654
|
-
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }}
|
|
55746
|
+
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
55747
|
+
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
55655
55748
|
];
|
|
55656
55749
|
|
|
55657
55750
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -60514,9 +60607,33 @@ function ChartDrawMonitorLine()
|
|
|
60514
60607
|
this.LabelConfig=
|
|
60515
60608
|
{
|
|
60516
60609
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
60517
|
-
BGColor:"rgb(30,144,255)",
|
|
60610
|
+
BGColor:"rgb(30,144,255)",
|
|
60518
60611
|
LineColor:"rgba(255,215,0,0.8)",
|
|
60519
60612
|
LineDash:[3,5],
|
|
60613
|
+
|
|
60614
|
+
Mergin:{ Left:5, Right:5, Top:5, Bottom:4 },
|
|
60615
|
+
LineSpace:5, //行间距
|
|
60616
|
+
TextAlign:1, //对齐方式 0=left 1=right
|
|
60617
|
+
}
|
|
60618
|
+
|
|
60619
|
+
this.PointToValue_Backup=this.PointToValue;
|
|
60620
|
+
|
|
60621
|
+
this.PointToValue=function()
|
|
60622
|
+
{
|
|
60623
|
+
if (!this.PointToValue_Backup()) return false;
|
|
60624
|
+
|
|
60625
|
+
if (this.Frame.IsKLineFrame(false))
|
|
60626
|
+
{
|
|
60627
|
+
if (this.Frame.Identify===0)
|
|
60628
|
+
{
|
|
60629
|
+
var dataIndex=this.Value[0].XValue;
|
|
60630
|
+
var data=this.Frame.Data;
|
|
60631
|
+
var kItem=data.Data[dataIndex];
|
|
60632
|
+
this.Value[0].YValue=kItem.Close; //使用收盘价
|
|
60633
|
+
}
|
|
60634
|
+
}
|
|
60635
|
+
|
|
60636
|
+
return true;
|
|
60520
60637
|
}
|
|
60521
60638
|
|
|
60522
60639
|
this.SetOption=function(option)
|
|
@@ -60530,7 +60647,9 @@ function ChartDrawMonitorLine()
|
|
|
60530
60647
|
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
60531
60648
|
if (item.LineColor) dest.LineColor=item.LineColor;
|
|
60532
60649
|
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
60533
|
-
if (IFrameSplitOperator.IsNumber(item.
|
|
60650
|
+
if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
|
|
60651
|
+
if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
|
|
60652
|
+
if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
|
|
60534
60653
|
}
|
|
60535
60654
|
|
|
60536
60655
|
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
@@ -60644,6 +60763,7 @@ function ChartDrawMonitorLine()
|
|
|
60644
60763
|
this.DrawLabel=function(labelInfo)
|
|
60645
60764
|
{
|
|
60646
60765
|
if (!this.FormatLabelTextCallback) return;
|
|
60766
|
+
labelInfo.Config=this.LabelConfig;
|
|
60647
60767
|
this.FormatLabelTextCallback(labelInfo);
|
|
60648
60768
|
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
60649
60769
|
if (!IFrameSplitOperator.IsNumber(labelInfo.YValue)) return;
|
|
@@ -60660,54 +60780,14 @@ function ChartDrawMonitorLine()
|
|
|
60660
60780
|
]
|
|
60661
60781
|
*/
|
|
60662
60782
|
|
|
60663
|
-
|
|
60664
|
-
this.Canvas.font=this.LabelConfig.Font;
|
|
60665
|
-
this.Canvas.textAlign="left";
|
|
60666
|
-
this.Canvas.textBaseline="top";
|
|
60667
|
-
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
60668
|
-
var maxWidth=0, lineCount=0;
|
|
60669
|
-
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
60670
|
-
{
|
|
60671
|
-
var item=labelInfo.AryText[i];
|
|
60672
|
-
item.NameWidth=0;
|
|
60673
|
-
item.TextWidth=0;
|
|
60674
|
-
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
60675
|
-
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
60676
|
-
|
|
60677
|
-
var itemWidth=item.NameWidth+item.TextWidth;
|
|
60678
|
-
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
60679
|
-
++lineCount;
|
|
60680
|
-
}
|
|
60783
|
+
this.CalculateLabelSize(labelInfo);
|
|
60681
60784
|
|
|
60682
|
-
var
|
|
60785
|
+
var y=this.Frame.GetYFromData(labelInfo.YValue,false);
|
|
60786
|
+
var rtBG={ Left:labelInfo.Left+1, Top:y, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
60683
60787
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60684
60788
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60685
|
-
|
|
60686
|
-
|
|
60687
|
-
this.Canvas.fillStyle=this.LabelConfig.BGColor
|
|
60688
|
-
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
60689
|
-
}
|
|
60690
|
-
|
|
60691
|
-
var xText=rtBG.Left+2;
|
|
60692
|
-
var yText=rtBG.Top+this.LabelConfig.YTextOffset;
|
|
60693
|
-
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
60694
|
-
{
|
|
60695
|
-
var item=labelInfo.AryText[i];
|
|
60696
|
-
|
|
60697
|
-
if (item.Name)
|
|
60698
|
-
{
|
|
60699
|
-
this.Canvas.fillStyle=item.NameColor;
|
|
60700
|
-
this.Canvas.fillText(item.Name,xText,yText);
|
|
60701
|
-
}
|
|
60702
|
-
|
|
60703
|
-
if (item.Text)
|
|
60704
|
-
{
|
|
60705
|
-
this.Canvas.fillStyle=item.TextColor;
|
|
60706
|
-
this.Canvas.fillText(item.Text,xText+item.NameWidth ,yText);
|
|
60707
|
-
}
|
|
60708
|
-
|
|
60709
|
-
yText+=lineHeight;
|
|
60710
|
-
}
|
|
60789
|
+
|
|
60790
|
+
this.DrawDefaultLabel(labelInfo, rtBG);
|
|
60711
60791
|
}
|
|
60712
60792
|
}
|
|
60713
60793
|
|
|
@@ -64529,6 +64609,139 @@ function ChartDateRange()
|
|
|
64529
64609
|
}
|
|
64530
64610
|
}
|
|
64531
64611
|
|
|
64612
|
+
//线段信息统计
|
|
64613
|
+
function ChartInfoLine()
|
|
64614
|
+
{
|
|
64615
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
64616
|
+
this.newMethod();
|
|
64617
|
+
delete this.newMethod;
|
|
64618
|
+
|
|
64619
|
+
this.ClassName='ChartInfoLine';
|
|
64620
|
+
this.PointCount=2;
|
|
64621
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
64622
|
+
|
|
64623
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
64624
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
64625
|
+
this.IsShowYCoordinate=false;
|
|
64626
|
+
this.CopyData=this.CopyData_default;
|
|
64627
|
+
this.OnlyMoveXIndex=true;
|
|
64628
|
+
this.IsSupportMagnet=true;
|
|
64629
|
+
|
|
64630
|
+
this.LabelConfig=
|
|
64631
|
+
{
|
|
64632
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
64633
|
+
BGColor:"rgba(135, 206 ,250,0.95)",
|
|
64634
|
+
Mergin:{ Left:10, Right:10, Top:10, Bottom:8 },
|
|
64635
|
+
LineSpace:5, //行间距
|
|
64636
|
+
TextAlign:1, //对齐方式 0=left 1=right
|
|
64637
|
+
}
|
|
64638
|
+
|
|
64639
|
+
this.FormatLabelTextCallback=null;
|
|
64640
|
+
|
|
64641
|
+
this.SetOption=function(option)
|
|
64642
|
+
{
|
|
64643
|
+
if (option.LineColor) this.LineColor=option.LineColor;
|
|
64644
|
+
if (option.Label)
|
|
64645
|
+
{
|
|
64646
|
+
var item=option.Label;
|
|
64647
|
+
var dest=this.LabelConfig
|
|
64648
|
+
if (item.Font) dest.Font=item.Font;
|
|
64649
|
+
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
64650
|
+
if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
|
|
64651
|
+
if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
|
|
64652
|
+
if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
|
|
64653
|
+
}
|
|
64654
|
+
|
|
64655
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
64656
|
+
}
|
|
64657
|
+
|
|
64658
|
+
this.Draw=function()
|
|
64659
|
+
{
|
|
64660
|
+
this.LinePoint=[];
|
|
64661
|
+
if (this.IsFrameMinSize()) return;
|
|
64662
|
+
if (!this.IsShow) return;
|
|
64663
|
+
|
|
64664
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:false} );
|
|
64665
|
+
if (!drawPoint) return;
|
|
64666
|
+
if (drawPoint.length!=2) return;
|
|
64667
|
+
|
|
64668
|
+
this.ClipFrame();
|
|
64669
|
+
|
|
64670
|
+
var ptStart=drawPoint[0];
|
|
64671
|
+
var ptEnd=drawPoint[1];
|
|
64672
|
+
|
|
64673
|
+
this.SetLineWidth();
|
|
64674
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
64675
|
+
this.Canvas.beginPath();
|
|
64676
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
64677
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
64678
|
+
this.Canvas.stroke();
|
|
64679
|
+
this.RestoreLineWidth();
|
|
64680
|
+
|
|
64681
|
+
var line={Start:ptStart, End:ptEnd};
|
|
64682
|
+
this.LinePoint.push(line);
|
|
64683
|
+
|
|
64684
|
+
this.DrawPoint(drawPoint); //画点
|
|
64685
|
+
|
|
64686
|
+
var labelInfo={ };
|
|
64687
|
+
labelInfo.Config=this.LabelConfig;
|
|
64688
|
+
labelInfo.PtStart=ptStart;
|
|
64689
|
+
labelInfo.PtEnd=ptEnd;
|
|
64690
|
+
|
|
64691
|
+
this.DrawLabel(labelInfo);
|
|
64692
|
+
|
|
64693
|
+
this.Canvas.restore();
|
|
64694
|
+
}
|
|
64695
|
+
|
|
64696
|
+
this.DrawLabel=function(labelInfo)
|
|
64697
|
+
{
|
|
64698
|
+
if (!this.FormatLabelTextCallback) return;
|
|
64699
|
+
|
|
64700
|
+
labelInfo.AryPoint=this.Point;
|
|
64701
|
+
if (this.Status!=10)
|
|
64702
|
+
{
|
|
64703
|
+
labelInfo.AryValue=this.PointToKLine(this.Point);
|
|
64704
|
+
}
|
|
64705
|
+
else
|
|
64706
|
+
{
|
|
64707
|
+
labelInfo.AryValue=this.Value;
|
|
64708
|
+
}
|
|
64709
|
+
|
|
64710
|
+
labelInfo.Data=this.Frame.Data; //数据
|
|
64711
|
+
|
|
64712
|
+
this.FormatLabelTextCallback(labelInfo);
|
|
64713
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
64714
|
+
|
|
64715
|
+
this.CalculateLabelSize(labelInfo);
|
|
64716
|
+
|
|
64717
|
+
var ptStart=labelInfo.PtStart;
|
|
64718
|
+
var ptEnd=labelInfo.PtEnd;
|
|
64719
|
+
if (ptStart.X>ptEnd.X)
|
|
64720
|
+
{
|
|
64721
|
+
ptStart=labelInfo.PtEnd;
|
|
64722
|
+
ptEnd=labelInfo.PtStart;
|
|
64723
|
+
}
|
|
64724
|
+
|
|
64725
|
+
var config=labelInfo.Config;
|
|
64726
|
+
var xCenter=labelInfo.PtStart.X+(labelInfo.PtEnd.X-labelInfo.PtStart.X)/2;
|
|
64727
|
+
var yCenter=labelInfo.PtStart.Y+(labelInfo.PtEnd.Y-labelInfo.PtStart.Y)/2;
|
|
64728
|
+
if (ptStart.Y<ptEnd.Y)
|
|
64729
|
+
{
|
|
64730
|
+
var rtBG={ Left:xCenter, Bottom:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
64731
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64732
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
64733
|
+
}
|
|
64734
|
+
else
|
|
64735
|
+
{
|
|
64736
|
+
var rtBG={ Left:xCenter, Top:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
64737
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64738
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
64739
|
+
}
|
|
64740
|
+
|
|
64741
|
+
this.DrawDefaultLabel(labelInfo, rtBG);
|
|
64742
|
+
}
|
|
64743
|
+
}
|
|
64744
|
+
|
|
64532
64745
|
|
|
64533
64746
|
function ChartDrawStorage()
|
|
64534
64747
|
{
|
|
@@ -69257,6 +69470,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
69257
69470
|
}
|
|
69258
69471
|
}
|
|
69259
69472
|
|
|
69473
|
+
this.ShowAllKLine=function()
|
|
69474
|
+
{
|
|
69475
|
+
var chart=this.ChartPaint[0];
|
|
69476
|
+
if (!chart) return false;
|
|
69477
|
+
var kData=chart.Data;
|
|
69478
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
69479
|
+
|
|
69480
|
+
var xCount=kData.Data.length+this.RightSpaceCount;
|
|
69481
|
+
for(var i=0;i<this.Frame.SubFrame.length;++i)
|
|
69482
|
+
{
|
|
69483
|
+
var item =this.Frame.SubFrame[i].Frame;
|
|
69484
|
+
item.XPointCount=xCount;
|
|
69485
|
+
}
|
|
69486
|
+
|
|
69487
|
+
kData.DataOffset=0;
|
|
69488
|
+
this.CursorIndex=0;
|
|
69489
|
+
|
|
69490
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
69491
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
69492
|
+
this.Frame.SetSizeChage(true);
|
|
69493
|
+
this.UpdatePointByCursorIndex(2); //取消十字光标
|
|
69494
|
+
this.Draw();
|
|
69495
|
+
}
|
|
69496
|
+
|
|
69260
69497
|
this.UpdateMainData=function(hisData, lastDataCount)
|
|
69261
69498
|
{
|
|
69262
69499
|
var frameHisdata=null;
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<div class="content unicode" style="display: block;">
|
|
55
55
|
<ul class="icon_lists dib-box">
|
|
56
56
|
|
|
57
|
+
<li class="dib">
|
|
58
|
+
<span class="icon hqchart_drawtool"></span>
|
|
59
|
+
<div class="name">info line</div>
|
|
60
|
+
<div class="code-name">&#xe64a;</div>
|
|
61
|
+
</li>
|
|
62
|
+
|
|
57
63
|
<li class="dib">
|
|
58
64
|
<span class="icon hqchart_drawtool"></span>
|
|
59
65
|
<div class="name">字体背景色</div>
|
|
@@ -432,9 +438,9 @@
|
|
|
432
438
|
<pre><code class="language-css"
|
|
433
439
|
>@font-face {
|
|
434
440
|
font-family: 'hqchart_drawtool';
|
|
435
|
-
src: url('iconfont.woff2?t=
|
|
436
|
-
url('iconfont.woff?t=
|
|
437
|
-
url('iconfont.ttf?t=
|
|
441
|
+
src: url('iconfont.woff2?t=1716274976221') format('woff2'),
|
|
442
|
+
url('iconfont.woff?t=1716274976221') format('woff'),
|
|
443
|
+
url('iconfont.ttf?t=1716274976221') format('truetype');
|
|
438
444
|
}
|
|
439
445
|
</code></pre>
|
|
440
446
|
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
|
@@ -460,6 +466,15 @@
|
|
|
460
466
|
<div class="content font-class">
|
|
461
467
|
<ul class="icon_lists dib-box">
|
|
462
468
|
|
|
469
|
+
<li class="dib">
|
|
470
|
+
<span class="icon hqchart_drawtool icon-infoline"></span>
|
|
471
|
+
<div class="name">
|
|
472
|
+
info line
|
|
473
|
+
</div>
|
|
474
|
+
<div class="code-name">.icon-infoline
|
|
475
|
+
</div>
|
|
476
|
+
</li>
|
|
477
|
+
|
|
463
478
|
<li class="dib">
|
|
464
479
|
<span class="icon hqchart_drawtool icon-zitibeijingse"></span>
|
|
465
480
|
<div class="name">
|
|
@@ -1027,6 +1042,14 @@
|
|
|
1027
1042
|
<div class="content symbol">
|
|
1028
1043
|
<ul class="icon_lists dib-box">
|
|
1029
1044
|
|
|
1045
|
+
<li class="dib">
|
|
1046
|
+
<svg class="icon svg-icon" aria-hidden="true">
|
|
1047
|
+
<use xlink:href="#icon-infoline"></use>
|
|
1048
|
+
</svg>
|
|
1049
|
+
<div class="name">info line</div>
|
|
1050
|
+
<div class="code-name">#icon-infoline</div>
|
|
1051
|
+
</li>
|
|
1052
|
+
|
|
1030
1053
|
<li class="dib">
|
|
1031
1054
|
<svg class="icon svg-icon" aria-hidden="true">
|
|
1032
1055
|
<use xlink:href="#icon-zitibeijingse"></use>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "hqchart_drawtool"; /* Project id 4529603 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1716274976221') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1716274976221') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1716274976221') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.hqchart_drawtool {
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.icon-infoline:before {
|
|
17
|
+
content: "\e64a";
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.icon-zitibeijingse:before {
|
|
17
21
|
content: "\e656";
|
|
18
22
|
}
|