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
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);
|
|
@@ -1853,12 +1861,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1853
1861
|
}
|
|
1854
1862
|
}
|
|
1855
1863
|
|
|
1856
|
-
this.ChangMainDataControl=function(dataControl)
|
|
1857
|
-
{
|
|
1858
|
-
if (this.JSChartContainer && typeof(this.JSChartContainer.SetMainDataConotrl)=='function')
|
|
1859
|
-
this.JSChartContainer.SetMainDataConotrl(dataControl);
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
1864
|
this.AddOverlayIndex=function(obj) //{WindowIndex:窗口ID, IndexName:指标ID, Identify:叠加指标ID(可选), API}
|
|
1863
1865
|
{
|
|
1864
1866
|
if (this.JSChartContainer && typeof(this.JSChartContainer.AddOverlayIndex)=='function')
|
|
@@ -8063,7 +8065,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8063
8065
|
let sendData={ DrawPicture: drawPicture };
|
|
8064
8066
|
event.Callback(event,sendData,this);
|
|
8065
8067
|
}
|
|
8066
|
-
|
|
8068
|
+
|
|
8069
|
+
//单个回调
|
|
8070
|
+
if (drawPicture.FinishedCallback) drawPicture.FinishedCallback(drawPicture);
|
|
8067
8071
|
|
|
8068
8072
|
if (drawPicture.OnFinish) drawPicture.OnFinish();
|
|
8069
8073
|
|
|
@@ -9597,6 +9601,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9597
9601
|
if (deleteCount>0) this.ChartPaintEx=paint;
|
|
9598
9602
|
}
|
|
9599
9603
|
}
|
|
9604
|
+
|
|
9605
|
+
this.ClearCurrnetDrawPicture=function()
|
|
9606
|
+
{
|
|
9607
|
+
this.CurrentChartDrawPicture=null;
|
|
9608
|
+
}
|
|
9600
9609
|
}
|
|
9601
9610
|
|
|
9602
9611
|
function GetDevicePixelRatio()
|
|
@@ -9751,6 +9760,16 @@ function IsRecvOverlap(rect1, rect2)
|
|
|
9751
9760
|
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
9761
|
}
|
|
9753
9762
|
|
|
9763
|
+
function CopyMerginConfig(dest,src)
|
|
9764
|
+
{
|
|
9765
|
+
if (!src || !dest) return;
|
|
9766
|
+
|
|
9767
|
+
if (IFrameSplitOperator.IsNumber(src.Left)) dest.Left=src.Left;
|
|
9768
|
+
if (IFrameSplitOperator.IsNumber(src.Top)) dest.Top=src.Top;
|
|
9769
|
+
if (IFrameSplitOperator.IsNumber(src.Right)) dest.Right=src.Right;
|
|
9770
|
+
if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
|
|
9771
|
+
}
|
|
9772
|
+
|
|
9754
9773
|
|
|
9755
9774
|
function Point()
|
|
9756
9775
|
{
|
|
@@ -55514,6 +55533,79 @@ function IChartDrawPicture()
|
|
|
55514
55533
|
//复制
|
|
55515
55534
|
//this.CopyData=function() { }
|
|
55516
55535
|
//this.PtInButtons=function(x, y) { }
|
|
55536
|
+
|
|
55537
|
+
|
|
55538
|
+
//计算标签页大小
|
|
55539
|
+
this.CalculateLabelSize=function(labelInfo)
|
|
55540
|
+
{
|
|
55541
|
+
var config=labelInfo.Config;
|
|
55542
|
+
this.Canvas.font=config.Font;
|
|
55543
|
+
this.Canvas.textAlign="left";
|
|
55544
|
+
this.Canvas.textBaseline="top";
|
|
55545
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
55546
|
+
|
|
55547
|
+
var maxWidth=0, lineCount=0, labelHeight=config.Mergin.Top+config.Mergin.Bottom;
|
|
55548
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
55549
|
+
{
|
|
55550
|
+
if (i>0) labelHeight+=config.LineSpace;
|
|
55551
|
+
|
|
55552
|
+
var item=labelInfo.AryText[i];
|
|
55553
|
+
item.NameWidth=0;
|
|
55554
|
+
item.TextWidth=0;
|
|
55555
|
+
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
55556
|
+
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
55557
|
+
|
|
55558
|
+
var itemWidth=item.NameWidth+item.TextWidth;
|
|
55559
|
+
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
55560
|
+
++lineCount;
|
|
55561
|
+
|
|
55562
|
+
labelHeight+=lineHeight;
|
|
55563
|
+
}
|
|
55564
|
+
|
|
55565
|
+
var labelWidth=maxWidth+config.Mergin.Left+config.Mergin.Right;
|
|
55566
|
+
|
|
55567
|
+
labelInfo.Width=labelWidth;
|
|
55568
|
+
labelInfo.Height=labelHeight;
|
|
55569
|
+
labelInfo.LineHeight=lineHeight;
|
|
55570
|
+
}
|
|
55571
|
+
|
|
55572
|
+
this.DrawDefaultLabel=function(labelInfo, rtBG)
|
|
55573
|
+
{
|
|
55574
|
+
var config=labelInfo.Config;
|
|
55575
|
+
|
|
55576
|
+
if (config.BGColor)
|
|
55577
|
+
{
|
|
55578
|
+
this.Canvas.fillStyle=config.BGColor
|
|
55579
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
55580
|
+
}
|
|
55581
|
+
|
|
55582
|
+
var xText=rtBG.Left+config.Mergin.Left;
|
|
55583
|
+
var yText=rtBG.Top+config.Mergin.Top;
|
|
55584
|
+
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
55585
|
+
{
|
|
55586
|
+
var item=labelInfo.AryText[i];
|
|
55587
|
+
|
|
55588
|
+
if (i>0) yText+=config.LineSpace;
|
|
55589
|
+
|
|
55590
|
+
if (item.Name)
|
|
55591
|
+
{
|
|
55592
|
+
this.Canvas.fillStyle=item.NameColor;
|
|
55593
|
+
this.Canvas.fillText(item.Name,xText,yText);
|
|
55594
|
+
}
|
|
55595
|
+
|
|
55596
|
+
if (item.Text)
|
|
55597
|
+
{
|
|
55598
|
+
var xOut=xText+item.NameWidth;
|
|
55599
|
+
if (config.TextAlign==1) //右对齐
|
|
55600
|
+
xOut=rtBG.Right-config.Mergin.Right-item.TextWidth;
|
|
55601
|
+
|
|
55602
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
55603
|
+
this.Canvas.fillText(item.Text,xOut ,yText);
|
|
55604
|
+
}
|
|
55605
|
+
|
|
55606
|
+
yText+=labelInfo.LineHeight;
|
|
55607
|
+
}
|
|
55608
|
+
}
|
|
55517
55609
|
}
|
|
55518
55610
|
|
|
55519
55611
|
IChartDrawPicture.ColorToRGBA=function(color,opacity)
|
|
@@ -55652,7 +55744,8 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
55652
55744
|
{ Name:"FibRetracement", ClassName:"ChartFibRetracement", Create:function() { return new ChartFibRetracement(); }}, //斐波那契回测
|
|
55653
55745
|
{ Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
|
|
55654
55746
|
{ Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
|
|
55655
|
-
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }}
|
|
55747
|
+
{ Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
|
|
55748
|
+
{ Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
|
|
55656
55749
|
];
|
|
55657
55750
|
|
|
55658
55751
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -60515,9 +60608,13 @@ function ChartDrawMonitorLine()
|
|
|
60515
60608
|
this.LabelConfig=
|
|
60516
60609
|
{
|
|
60517
60610
|
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
60518
|
-
BGColor:"rgb(30,144,255)",
|
|
60611
|
+
BGColor:"rgb(30,144,255)",
|
|
60519
60612
|
LineColor:"rgba(255,215,0,0.8)",
|
|
60520
60613
|
LineDash:[3,5],
|
|
60614
|
+
|
|
60615
|
+
Mergin:{ Left:5, Right:5, Top:5, Bottom:4 },
|
|
60616
|
+
LineSpace:5, //行间距
|
|
60617
|
+
TextAlign:1, //对齐方式 0=left 1=right
|
|
60521
60618
|
}
|
|
60522
60619
|
|
|
60523
60620
|
this.PointToValue_Backup=this.PointToValue;
|
|
@@ -60551,7 +60648,9 @@ function ChartDrawMonitorLine()
|
|
|
60551
60648
|
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
60552
60649
|
if (item.LineColor) dest.LineColor=item.LineColor;
|
|
60553
60650
|
if (item.LineDash) dest.LineDash=item.LineDash;
|
|
60554
|
-
if (IFrameSplitOperator.IsNumber(item.
|
|
60651
|
+
if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
|
|
60652
|
+
if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
|
|
60653
|
+
if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
|
|
60555
60654
|
}
|
|
60556
60655
|
|
|
60557
60656
|
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
@@ -60665,6 +60764,7 @@ function ChartDrawMonitorLine()
|
|
|
60665
60764
|
this.DrawLabel=function(labelInfo)
|
|
60666
60765
|
{
|
|
60667
60766
|
if (!this.FormatLabelTextCallback) return;
|
|
60767
|
+
labelInfo.Config=this.LabelConfig;
|
|
60668
60768
|
this.FormatLabelTextCallback(labelInfo);
|
|
60669
60769
|
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
60670
60770
|
if (!IFrameSplitOperator.IsNumber(labelInfo.YValue)) return;
|
|
@@ -60681,54 +60781,14 @@ function ChartDrawMonitorLine()
|
|
|
60681
60781
|
]
|
|
60682
60782
|
*/
|
|
60683
60783
|
|
|
60684
|
-
|
|
60685
|
-
this.Canvas.font=this.LabelConfig.Font;
|
|
60686
|
-
this.Canvas.textAlign="left";
|
|
60687
|
-
this.Canvas.textBaseline="top";
|
|
60688
|
-
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
60689
|
-
var maxWidth=0, lineCount=0;
|
|
60690
|
-
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
60691
|
-
{
|
|
60692
|
-
var item=labelInfo.AryText[i];
|
|
60693
|
-
item.NameWidth=0;
|
|
60694
|
-
item.TextWidth=0;
|
|
60695
|
-
if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
|
|
60696
|
-
if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
|
|
60697
|
-
|
|
60698
|
-
var itemWidth=item.NameWidth+item.TextWidth;
|
|
60699
|
-
if (maxWidth<itemWidth) maxWidth=itemWidth;
|
|
60700
|
-
++lineCount;
|
|
60701
|
-
}
|
|
60784
|
+
this.CalculateLabelSize(labelInfo);
|
|
60702
60785
|
|
|
60703
|
-
var
|
|
60786
|
+
var y=this.Frame.GetYFromData(labelInfo.YValue,false);
|
|
60787
|
+
var rtBG={ Left:labelInfo.Left+1, Top:y, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
60704
60788
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60705
60789
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60706
|
-
|
|
60707
|
-
|
|
60708
|
-
this.Canvas.fillStyle=this.LabelConfig.BGColor
|
|
60709
|
-
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
60710
|
-
}
|
|
60711
|
-
|
|
60712
|
-
var xText=rtBG.Left+2;
|
|
60713
|
-
var yText=rtBG.Top+this.LabelConfig.YTextOffset;
|
|
60714
|
-
for(var i=0;i<labelInfo.AryText.length;++i)
|
|
60715
|
-
{
|
|
60716
|
-
var item=labelInfo.AryText[i];
|
|
60717
|
-
|
|
60718
|
-
if (item.Name)
|
|
60719
|
-
{
|
|
60720
|
-
this.Canvas.fillStyle=item.NameColor;
|
|
60721
|
-
this.Canvas.fillText(item.Name,xText,yText);
|
|
60722
|
-
}
|
|
60723
|
-
|
|
60724
|
-
if (item.Text)
|
|
60725
|
-
{
|
|
60726
|
-
this.Canvas.fillStyle=item.TextColor;
|
|
60727
|
-
this.Canvas.fillText(item.Text,xText+item.NameWidth ,yText);
|
|
60728
|
-
}
|
|
60729
|
-
|
|
60730
|
-
yText+=lineHeight;
|
|
60731
|
-
}
|
|
60790
|
+
|
|
60791
|
+
this.DrawDefaultLabel(labelInfo, rtBG);
|
|
60732
60792
|
}
|
|
60733
60793
|
}
|
|
60734
60794
|
|
|
@@ -64550,6 +64610,139 @@ function ChartDateRange()
|
|
|
64550
64610
|
}
|
|
64551
64611
|
}
|
|
64552
64612
|
|
|
64613
|
+
//线段信息统计
|
|
64614
|
+
function ChartInfoLine()
|
|
64615
|
+
{
|
|
64616
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
64617
|
+
this.newMethod();
|
|
64618
|
+
delete this.newMethod;
|
|
64619
|
+
|
|
64620
|
+
this.ClassName='ChartInfoLine';
|
|
64621
|
+
this.PointCount=2;
|
|
64622
|
+
this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
64623
|
+
|
|
64624
|
+
this.IsPointIn=this.IsPointIn_XYValue_Line;
|
|
64625
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
64626
|
+
this.IsShowYCoordinate=false;
|
|
64627
|
+
this.CopyData=this.CopyData_default;
|
|
64628
|
+
this.OnlyMoveXIndex=true;
|
|
64629
|
+
this.IsSupportMagnet=true;
|
|
64630
|
+
|
|
64631
|
+
this.LabelConfig=
|
|
64632
|
+
{
|
|
64633
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
64634
|
+
BGColor:"rgba(135, 206 ,250,0.95)",
|
|
64635
|
+
Mergin:{ Left:10, Right:10, Top:10, Bottom:8 },
|
|
64636
|
+
LineSpace:5, //行间距
|
|
64637
|
+
TextAlign:1, //对齐方式 0=left 1=right
|
|
64638
|
+
}
|
|
64639
|
+
|
|
64640
|
+
this.FormatLabelTextCallback=null;
|
|
64641
|
+
|
|
64642
|
+
this.SetOption=function(option)
|
|
64643
|
+
{
|
|
64644
|
+
if (option.LineColor) this.LineColor=option.LineColor;
|
|
64645
|
+
if (option.Label)
|
|
64646
|
+
{
|
|
64647
|
+
var item=option.Label;
|
|
64648
|
+
var dest=this.LabelConfig
|
|
64649
|
+
if (item.Font) dest.Font=item.Font;
|
|
64650
|
+
if (item.BGColor) dest.BGColor=item.BGColor;
|
|
64651
|
+
if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
|
|
64652
|
+
if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
|
|
64653
|
+
if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
|
|
64654
|
+
}
|
|
64655
|
+
|
|
64656
|
+
if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
|
|
64657
|
+
}
|
|
64658
|
+
|
|
64659
|
+
this.Draw=function()
|
|
64660
|
+
{
|
|
64661
|
+
this.LinePoint=[];
|
|
64662
|
+
if (this.IsFrameMinSize()) return;
|
|
64663
|
+
if (!this.IsShow) return;
|
|
64664
|
+
|
|
64665
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:false} );
|
|
64666
|
+
if (!drawPoint) return;
|
|
64667
|
+
if (drawPoint.length!=2) return;
|
|
64668
|
+
|
|
64669
|
+
this.ClipFrame();
|
|
64670
|
+
|
|
64671
|
+
var ptStart=drawPoint[0];
|
|
64672
|
+
var ptEnd=drawPoint[1];
|
|
64673
|
+
|
|
64674
|
+
this.SetLineWidth();
|
|
64675
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
64676
|
+
this.Canvas.beginPath();
|
|
64677
|
+
this.Canvas.moveTo(ptStart.X,ptStart.Y);
|
|
64678
|
+
this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
|
|
64679
|
+
this.Canvas.stroke();
|
|
64680
|
+
this.RestoreLineWidth();
|
|
64681
|
+
|
|
64682
|
+
var line={Start:ptStart, End:ptEnd};
|
|
64683
|
+
this.LinePoint.push(line);
|
|
64684
|
+
|
|
64685
|
+
this.DrawPoint(drawPoint); //画点
|
|
64686
|
+
|
|
64687
|
+
var labelInfo={ };
|
|
64688
|
+
labelInfo.Config=this.LabelConfig;
|
|
64689
|
+
labelInfo.PtStart=ptStart;
|
|
64690
|
+
labelInfo.PtEnd=ptEnd;
|
|
64691
|
+
|
|
64692
|
+
this.Canvas.restore();
|
|
64693
|
+
|
|
64694
|
+
this.DrawLabel(labelInfo);
|
|
64695
|
+
}
|
|
64696
|
+
|
|
64697
|
+
this.DrawLabel=function(labelInfo)
|
|
64698
|
+
{
|
|
64699
|
+
if (!this.FormatLabelTextCallback) return;
|
|
64700
|
+
|
|
64701
|
+
labelInfo.AryPoint=this.Point;
|
|
64702
|
+
if (this.Status!=10)
|
|
64703
|
+
{
|
|
64704
|
+
labelInfo.AryValue=this.PointToKLine(this.Point);
|
|
64705
|
+
}
|
|
64706
|
+
else
|
|
64707
|
+
{
|
|
64708
|
+
labelInfo.AryValue=this.Value;
|
|
64709
|
+
}
|
|
64710
|
+
|
|
64711
|
+
labelInfo.Data=this.Frame.Data; //数据
|
|
64712
|
+
|
|
64713
|
+
this.FormatLabelTextCallback(labelInfo);
|
|
64714
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
|
|
64715
|
+
|
|
64716
|
+
this.CalculateLabelSize(labelInfo);
|
|
64717
|
+
|
|
64718
|
+
var ptStart=labelInfo.PtStart;
|
|
64719
|
+
var ptEnd=labelInfo.PtEnd;
|
|
64720
|
+
if (ptStart.X>ptEnd.X)
|
|
64721
|
+
{
|
|
64722
|
+
ptStart=labelInfo.PtEnd;
|
|
64723
|
+
ptEnd=labelInfo.PtStart;
|
|
64724
|
+
}
|
|
64725
|
+
|
|
64726
|
+
var config=labelInfo.Config;
|
|
64727
|
+
var xCenter=labelInfo.PtStart.X+(labelInfo.PtEnd.X-labelInfo.PtStart.X)/2;
|
|
64728
|
+
var yCenter=labelInfo.PtStart.Y+(labelInfo.PtEnd.Y-labelInfo.PtStart.Y)/2;
|
|
64729
|
+
if (ptStart.Y<ptEnd.Y)
|
|
64730
|
+
{
|
|
64731
|
+
var rtBG={ Left:xCenter, Bottom:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
64732
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64733
|
+
rtBG.Top=rtBG.Bottom-rtBG.Height;
|
|
64734
|
+
}
|
|
64735
|
+
else
|
|
64736
|
+
{
|
|
64737
|
+
var rtBG={ Left:xCenter, Top:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
|
|
64738
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
64739
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
64740
|
+
}
|
|
64741
|
+
|
|
64742
|
+
this.DrawDefaultLabel(labelInfo, rtBG);
|
|
64743
|
+
}
|
|
64744
|
+
}
|
|
64745
|
+
|
|
64553
64746
|
|
|
64554
64747
|
function ChartDrawStorage()
|
|
64555
64748
|
{
|
|
@@ -69278,6 +69471,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
69278
69471
|
}
|
|
69279
69472
|
}
|
|
69280
69473
|
|
|
69474
|
+
this.ShowAllKLine=function()
|
|
69475
|
+
{
|
|
69476
|
+
var chart=this.ChartPaint[0];
|
|
69477
|
+
if (!chart) return false;
|
|
69478
|
+
var kData=chart.Data;
|
|
69479
|
+
if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
|
|
69480
|
+
|
|
69481
|
+
var xCount=kData.Data.length+this.RightSpaceCount;
|
|
69482
|
+
for(var i=0;i<this.Frame.SubFrame.length;++i)
|
|
69483
|
+
{
|
|
69484
|
+
var item =this.Frame.SubFrame[i].Frame;
|
|
69485
|
+
item.XPointCount=xCount;
|
|
69486
|
+
}
|
|
69487
|
+
|
|
69488
|
+
kData.DataOffset=0;
|
|
69489
|
+
this.CursorIndex=0;
|
|
69490
|
+
|
|
69491
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
69492
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
69493
|
+
this.Frame.SetSizeChage(true);
|
|
69494
|
+
this.UpdatePointByCursorIndex(2); //取消十字光标
|
|
69495
|
+
this.Draw();
|
|
69496
|
+
}
|
|
69497
|
+
|
|
69281
69498
|
this.UpdateMainData=function(hisData, lastDataCount)
|
|
69282
69499
|
{
|
|
69283
69500
|
var frameHisdata=null;
|
|
@@ -73310,11 +73527,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
73310
73527
|
return true;
|
|
73311
73528
|
}
|
|
73312
73529
|
|
|
73313
|
-
this.ClearCurrnetDrawPicture=function()
|
|
73314
|
-
{
|
|
73315
|
-
this.CurrentChartDrawPicture=null;
|
|
73316
|
-
}
|
|
73317
|
-
|
|
73318
73530
|
this.AddChartDrawPicture=function(obj)
|
|
73319
73531
|
{
|
|
73320
73532
|
if (!obj) return 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
|
}
|