hqchart 1.1.14965 → 1.1.14971
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 +28 -15
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogDrawTool.js +3 -0
- package/src/jscommon/umychart.NetworkFilterTest.js +76 -2
- package/src/jscommon/umychart.js +580 -4
- package/src/jscommon/umychart.resource/font/drawtool/demo_index.html +49 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.css +11 -3
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.js +1 -1
- package/src/jscommon/umychart.resource/font/drawtool/iconfont.json +14 -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.style.js +25 -0
- package/src/jscommon/umychart.testdata.js +76 -2
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +606 -5
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +76 -2
- package/src/jscommon/umychart.vue/umychart.vue.js +609 -5
|
@@ -6972,7 +6972,9 @@ var JSCHART_EVENT_ID=
|
|
|
6972
6972
|
ON_RELOAD_RESOURCE:173,
|
|
6973
6973
|
|
|
6974
6974
|
ON_REPORT_DATA_FILTER:174, //数据筛选
|
|
6975
|
-
ON_REPORT_SHOW_TOOLTIP:175, //报价列表
|
|
6975
|
+
ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息\
|
|
6976
|
+
|
|
6977
|
+
ON_FORMAT_TVLONGPOSITION_LABEL:176,
|
|
6976
6978
|
}
|
|
6977
6979
|
|
|
6978
6980
|
var JSCHART_OPERATOR_ID=
|
|
@@ -9135,9 +9137,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9135
9137
|
{
|
|
9136
9138
|
drawPicture.PointStatus=drawPicture.Status;
|
|
9137
9139
|
if (this.FinishChartDrawPicturePoint())
|
|
9140
|
+
{
|
|
9141
|
+
if (drawPicture.IsDrawMain) this.Draw();
|
|
9138
9142
|
this.DrawDynamicInfo();
|
|
9143
|
+
}
|
|
9139
9144
|
else
|
|
9145
|
+
{
|
|
9140
9146
|
bClearDrawPicture=false;
|
|
9147
|
+
}
|
|
9141
9148
|
}
|
|
9142
9149
|
else if (drawPicture.Status==20)
|
|
9143
9150
|
{
|
|
@@ -10692,7 +10699,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10692
10699
|
{
|
|
10693
10700
|
var item=this.ChartDrawPicture[i];
|
|
10694
10701
|
if (item.IsDrawFirst) continue;
|
|
10695
|
-
if (item.IsDrawMain && item.IsDrawMain())
|
|
10702
|
+
if (item.IsDrawMain && item.IsDrawMain())
|
|
10703
|
+
{
|
|
10704
|
+
if (item.MainPartDraw) item.MainPartDraw();
|
|
10705
|
+
continue;
|
|
10706
|
+
}
|
|
10707
|
+
|
|
10696
10708
|
if (this.SelectChartDrawPicture && this.SelectChartDrawPicture.Guid==item.Guid) continue; //当前选中在最后画
|
|
10697
10709
|
|
|
10698
10710
|
item.Draw();
|
|
@@ -11256,7 +11268,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11256
11268
|
{
|
|
11257
11269
|
var item=this.ChartDrawPicture[i];
|
|
11258
11270
|
if (item.IsDrawFirst) continue;
|
|
11259
|
-
if (item.IsDrawMain && item.IsDrawMain())
|
|
11271
|
+
if (item.IsDrawMain && item.IsDrawMain())
|
|
11272
|
+
{
|
|
11273
|
+
if (item.MainPartDraw) item.MainPartDraw();
|
|
11274
|
+
continue;
|
|
11275
|
+
}
|
|
11260
11276
|
if (this.SelectChartDrawPicture &&item.Guid==this.SelectChartDrawPicture.Guid) continue; //选中画图最后画 确保显示在最外面
|
|
11261
11277
|
|
|
11262
11278
|
item.Draw(moveonPoint, this.LastMouseStatus);
|
|
@@ -69275,6 +69291,17 @@ function IChartDrawPicture()
|
|
|
69275
69291
|
yText+=labelInfo.LineHeight;
|
|
69276
69292
|
}
|
|
69277
69293
|
}
|
|
69294
|
+
|
|
69295
|
+
this.IsActive=function()
|
|
69296
|
+
{
|
|
69297
|
+
if (!this.GetActiveDrawPicture) return false;
|
|
69298
|
+
|
|
69299
|
+
var active=this.GetActiveDrawPicture();
|
|
69300
|
+
if (active.Move.Guid!=this.Guid && active.Select.Guid!=this.Guid && active.MoveOn.Guid!=this.Guid)
|
|
69301
|
+
return false;
|
|
69302
|
+
|
|
69303
|
+
return true;
|
|
69304
|
+
}
|
|
69278
69305
|
}
|
|
69279
69306
|
|
|
69280
69307
|
IChartDrawPicture.ColorToRGBA=function(color,opacity)
|
|
@@ -69422,6 +69449,8 @@ IChartDrawPicture.ArrayDrawPricture=
|
|
|
69422
69449
|
{ Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
|
|
69423
69450
|
{ Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
|
|
69424
69451
|
{ Name:"BarsPattern", ClassName:"ChartBarsPattern", Create:function() { return new ChartBarsPattern(); } },
|
|
69452
|
+
{ Name:"TVLongPosition", ClassName:"ChartDrawTVLongPosition", Create:function() { return new ChartDrawTVLongPosition(); } },
|
|
69453
|
+
{ Name:"TVShortPosition", ClassName:"ChartDrawTVShortPositionn", Create:function() { return new ChartDrawTVShortPosition(); } },
|
|
69425
69454
|
];
|
|
69426
69455
|
|
|
69427
69456
|
IChartDrawPicture.MapIonFont=new Map(
|
|
@@ -79392,6 +79421,483 @@ function ChartBarsPattern()
|
|
|
79392
79421
|
}
|
|
79393
79422
|
}
|
|
79394
79423
|
|
|
79424
|
+
function ChartDrawTVLongPosition()
|
|
79425
|
+
{
|
|
79426
|
+
this.newMethod=IChartDrawPicture; //派生
|
|
79427
|
+
this.newMethod();
|
|
79428
|
+
delete this.newMethod;
|
|
79429
|
+
|
|
79430
|
+
this.ClassName='ChartDrawTVLongPosition';
|
|
79431
|
+
this.PointCount=2; //起始2个点 画完4个点
|
|
79432
|
+
|
|
79433
|
+
this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
|
|
79434
|
+
this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
|
|
79435
|
+
this.LabelConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.Label);
|
|
79436
|
+
|
|
79437
|
+
//内部变量
|
|
79438
|
+
this.AryRectArea=[];
|
|
79439
|
+
|
|
79440
|
+
this.GetXYCoordinate=this.GetXYCoordinate_default;
|
|
79441
|
+
this.SetOption_Backup=this.SetOption;
|
|
79442
|
+
this.PointToValue_Backup=this.PointToValue;
|
|
79443
|
+
|
|
79444
|
+
this.SetOption=function(option)
|
|
79445
|
+
{
|
|
79446
|
+
this.SetOption_Backup();
|
|
79447
|
+
|
|
79448
|
+
if (option)
|
|
79449
|
+
{
|
|
79450
|
+
|
|
79451
|
+
}
|
|
79452
|
+
}
|
|
79453
|
+
|
|
79454
|
+
this.PointToValue=function()
|
|
79455
|
+
{
|
|
79456
|
+
//拖拽完成 把点移动到线段头尾
|
|
79457
|
+
if (this.Frame.IsHScreen)
|
|
79458
|
+
{
|
|
79459
|
+
this.Point[1].X=this.Point[0].X;
|
|
79460
|
+
}
|
|
79461
|
+
else
|
|
79462
|
+
{
|
|
79463
|
+
this.Point[1].Y=this.Point[0].Y;
|
|
79464
|
+
}
|
|
79465
|
+
|
|
79466
|
+
this.PointToValue_Backup();
|
|
79467
|
+
}
|
|
79468
|
+
|
|
79469
|
+
//0-10 鼠标对应的点索引 100=鼠标在正个图形上 -1 鼠标不在图形上
|
|
79470
|
+
this.IsPointIn=function(x,y, option)
|
|
79471
|
+
{
|
|
79472
|
+
if (this.Status!=10) return -1;
|
|
79473
|
+
|
|
79474
|
+
var value=this.IsPointInXYValue(x,y,option);
|
|
79475
|
+
if (value>=0) return value;
|
|
79476
|
+
|
|
79477
|
+
for(var i=0;i<this.AryRectArea.length;++i)
|
|
79478
|
+
{
|
|
79479
|
+
var item=this.AryRectArea[i];
|
|
79480
|
+
if (!item) continue;
|
|
79481
|
+
|
|
79482
|
+
if (Path2DHelper.PtInRect(x, y, item.Rect))
|
|
79483
|
+
{
|
|
79484
|
+
return item.ID;
|
|
79485
|
+
}
|
|
79486
|
+
}
|
|
79487
|
+
|
|
79488
|
+
return -1;
|
|
79489
|
+
}
|
|
79490
|
+
|
|
79491
|
+
this.OnFinish=function()
|
|
79492
|
+
{
|
|
79493
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Value)) return false;
|
|
79494
|
+
|
|
79495
|
+
if (!this.Frame) return false;
|
|
79496
|
+
var data=this.Frame.Data;
|
|
79497
|
+
if (!data) return false;
|
|
79498
|
+
|
|
79499
|
+
var firstPoint=this.Point[0];
|
|
79500
|
+
var firstValue=this.Value[0];
|
|
79501
|
+
var entryPrice=firstValue.YValue;
|
|
79502
|
+
|
|
79503
|
+
var topPrice=entryPrice*(1+0.05);
|
|
79504
|
+
var bottomPrice=entryPrice*(1-0.05);
|
|
79505
|
+
|
|
79506
|
+
this.Value[2]={ XValue:firstValue.XValue, YValue:topPrice };
|
|
79507
|
+
this.Value[3]={ XValue:firstValue.XValue, YValue:bottomPrice };
|
|
79508
|
+
if (firstValue.DateTime)
|
|
79509
|
+
{
|
|
79510
|
+
var item=firstValue.DateTime;
|
|
79511
|
+
this.Value[2].DateTime={ Date:item.Date, Time:item.Time };
|
|
79512
|
+
this.Value[3].DateTime={ Date:item.Date, Time:item.Time };
|
|
79513
|
+
}
|
|
79514
|
+
|
|
79515
|
+
this.Point[2]={ X:firstPoint.X, Y:this.Frame.GetYFromData(topPrice,false)};
|
|
79516
|
+
this.Point[3]={ X:firstPoint.X, Y:this.Frame.GetYFromData(bottomPrice,false)};
|
|
79517
|
+
|
|
79518
|
+
this.PointCount=4;
|
|
79519
|
+
}
|
|
79520
|
+
|
|
79521
|
+
this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
79522
|
+
{
|
|
79523
|
+
if (!this.GetActiveDrawPicture) return true;
|
|
79524
|
+
|
|
79525
|
+
var active=this.GetActiveDrawPicture();
|
|
79526
|
+
if (active.Select.Guid==this.Guid) return false;
|
|
79527
|
+
|
|
79528
|
+
return true;
|
|
79529
|
+
}
|
|
79530
|
+
|
|
79531
|
+
this.IsSelected=function()
|
|
79532
|
+
{
|
|
79533
|
+
if (!this.GetActiveDrawPicture) return false;
|
|
79534
|
+
|
|
79535
|
+
var active=this.GetActiveDrawPicture();
|
|
79536
|
+
if (active.Select.Guid==this.Guid) return true;
|
|
79537
|
+
|
|
79538
|
+
return false;
|
|
79539
|
+
}
|
|
79540
|
+
|
|
79541
|
+
this.MainDraw=function()
|
|
79542
|
+
{
|
|
79543
|
+
this.Draw();
|
|
79544
|
+
}
|
|
79545
|
+
|
|
79546
|
+
|
|
79547
|
+
this.MainPartDraw=function()
|
|
79548
|
+
{
|
|
79549
|
+
if (this.IsFrameMinSize()) return;
|
|
79550
|
+
|
|
79551
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
|
|
79552
|
+
if (!drawPoint) return;
|
|
79553
|
+
if (drawPoint.length<2) return;
|
|
79554
|
+
this.IsHScreen=this.Frame.IsHScreen;
|
|
79555
|
+
if (this.IsHScreen) return;
|
|
79556
|
+
|
|
79557
|
+
this.ClipFrame();
|
|
79558
|
+
this.ChartBorder=this.Frame.ChartBorder;
|
|
79559
|
+
|
|
79560
|
+
if (this.Status==10 || this.Status==20)
|
|
79561
|
+
{
|
|
79562
|
+
this.DrawLabel(drawPoint);
|
|
79563
|
+
this.DrawPoint(drawPoint);
|
|
79564
|
+
}
|
|
79565
|
+
|
|
79566
|
+
this.Canvas.restore();
|
|
79567
|
+
}
|
|
79568
|
+
|
|
79569
|
+
this.Draw=function()
|
|
79570
|
+
{
|
|
79571
|
+
this.AryRectArea=[]
|
|
79572
|
+
if (this.IsFrameMinSize()) return;
|
|
79573
|
+
|
|
79574
|
+
var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
|
|
79575
|
+
if (!drawPoint) return;
|
|
79576
|
+
if (drawPoint.length<2) return;
|
|
79577
|
+
this.IsHScreen=this.Frame.IsHScreen;
|
|
79578
|
+
if (this.IsHScreen) return;
|
|
79579
|
+
|
|
79580
|
+
this.ClipFrame();
|
|
79581
|
+
this.ChartBorder=this.Frame.ChartBorder;
|
|
79582
|
+
|
|
79583
|
+
if (this.Status==10 || this.Status==20) //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
|
|
79584
|
+
{
|
|
79585
|
+
this.DrawArea(drawPoint);
|
|
79586
|
+
this.DrawLabel(drawPoint);
|
|
79587
|
+
this.DrawPoint(drawPoint);
|
|
79588
|
+
}
|
|
79589
|
+
else
|
|
79590
|
+
{
|
|
79591
|
+
var ptStart=drawPoint[0];
|
|
79592
|
+
var ptEnd=drawPoint[1];
|
|
79593
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
79594
|
+
this.DrawVerticalLine(ptStart,ptEnd);
|
|
79595
|
+
}
|
|
79596
|
+
|
|
79597
|
+
this.Canvas.restore();
|
|
79598
|
+
}
|
|
79599
|
+
|
|
79600
|
+
this.DrawVerticalLine=function(ptStart, ptEnd)
|
|
79601
|
+
{
|
|
79602
|
+
var data=this.Frame.Data;
|
|
79603
|
+
if (this.IsHScreen)
|
|
79604
|
+
{
|
|
79605
|
+
var left=this.ChartBorder.GetLeft();
|
|
79606
|
+
var right=this.ChartBorder.GetRight();
|
|
79607
|
+
var xValue=Math.round(this.Frame.GetXData(ptStart.Y,false))+data.DataOffset;
|
|
79608
|
+
if (xValue<0) xValue=0;
|
|
79609
|
+
else if (xValue>=data.Data.length) xValue=data.Data.length-1;
|
|
79610
|
+
var yStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
|
|
79611
|
+
|
|
79612
|
+
xValue=Math.round(this.Frame.GetXData(ptEnd.Y,false))+data.DataOffset;
|
|
79613
|
+
if (xValue<0) xValue=0;
|
|
79614
|
+
else if (xValue>=data.Data.length) xValue=data.Data.length-1;
|
|
79615
|
+
var yEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
|
|
79616
|
+
|
|
79617
|
+
this.Canvas.beginPath();
|
|
79618
|
+
this.Canvas.moveTo(left,yStart);
|
|
79619
|
+
this.Canvas.lineTo(right,yStart);
|
|
79620
|
+
|
|
79621
|
+
this.Canvas.moveTo(left,yEnd);
|
|
79622
|
+
this.Canvas.lineTo(right,yEnd);
|
|
79623
|
+
this.Canvas.stroke();
|
|
79624
|
+
|
|
79625
|
+
this.Canvas.beginPath();
|
|
79626
|
+
this.Canvas.moveTo(ptStart.X,yStart);
|
|
79627
|
+
this.Canvas.lineTo(ptStart.X,yEnd);
|
|
79628
|
+
this.Canvas.stroke();
|
|
79629
|
+
}
|
|
79630
|
+
else
|
|
79631
|
+
{
|
|
79632
|
+
var top=this.ChartBorder.GetTopEx();
|
|
79633
|
+
var bottom=this.ChartBorder.GetBottomEx();
|
|
79634
|
+
|
|
79635
|
+
var xValue=Math.round(this.Frame.GetXData(ptStart.X,false))+data.DataOffset;
|
|
79636
|
+
if (xValue<0) xValue=0;
|
|
79637
|
+
else if (xValue>=data.Data.length) xValue=data.Data.length-1;
|
|
79638
|
+
var xStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
|
|
79639
|
+
|
|
79640
|
+
xValue=Math.round(this.Frame.GetXData(ptEnd.X,false))+data.DataOffset;
|
|
79641
|
+
if (xValue<0) xValue=0;
|
|
79642
|
+
else if (xValue>=data.Data.length) xValue=data.Data.length-1;
|
|
79643
|
+
var xEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
|
|
79644
|
+
|
|
79645
|
+
this.Canvas.beginPath();
|
|
79646
|
+
this.Canvas.moveTo(xStart,top);
|
|
79647
|
+
this.Canvas.lineTo(xStart,bottom);
|
|
79648
|
+
|
|
79649
|
+
this.Canvas.moveTo(xEnd,top);
|
|
79650
|
+
this.Canvas.lineTo(xEnd,bottom);
|
|
79651
|
+
this.Canvas.stroke();
|
|
79652
|
+
|
|
79653
|
+
this.Canvas.beginPath();
|
|
79654
|
+
this.Canvas.moveTo(xStart,ptStart.Y);
|
|
79655
|
+
this.Canvas.lineTo(xEnd,ptStart.Y);
|
|
79656
|
+
this.Canvas.stroke();
|
|
79657
|
+
}
|
|
79658
|
+
}
|
|
79659
|
+
|
|
79660
|
+
this.GetCursorType=function(ptIndex)
|
|
79661
|
+
{
|
|
79662
|
+
if (ptIndex==100) return "pointer";
|
|
79663
|
+
else if (ptIndex==0) return "move";
|
|
79664
|
+
else if (ptIndex==1) return "ew-resize";
|
|
79665
|
+
else if (ptIndex==2 || ptIndex==3) return "ns-resize";
|
|
79666
|
+
|
|
79667
|
+
return null;
|
|
79668
|
+
}
|
|
79669
|
+
|
|
79670
|
+
this.DrawArea=function(drawPoint)
|
|
79671
|
+
{
|
|
79672
|
+
var ptCenter=drawPoint[0];
|
|
79673
|
+
var ptRight=drawPoint[1]
|
|
79674
|
+
var ptTop=drawPoint[2];
|
|
79675
|
+
var ptBottom=drawPoint[3];
|
|
79676
|
+
var bSelected=this.IsSelected();
|
|
79677
|
+
|
|
79678
|
+
var rtTopArea={ Left:ptCenter.X, Top: ptTop.Y, Right:ptRight.X, Bottom:ptCenter.Y};
|
|
79679
|
+
rtTopArea.Width=rtTopArea.Right-rtTopArea.Left;
|
|
79680
|
+
rtTopArea.Height=rtTopArea.Bottom-rtTopArea.Top;
|
|
79681
|
+
|
|
79682
|
+
this.Canvas.fillStyle=bSelected ? this.TopAreaConfig.SelectedAreaColor: this.TopAreaConfig.AreaColor;
|
|
79683
|
+
this.Canvas.beginPath();
|
|
79684
|
+
this.Canvas.fillRect(rtTopArea.Left,rtTopArea.Top,rtTopArea.Width,rtTopArea.Height);
|
|
79685
|
+
this.AryRectArea[0]={ ID:100, Rect:rtTopArea };
|
|
79686
|
+
|
|
79687
|
+
var rtBottomArea={Left:ptCenter.X, Top: ptCenter.Y, Right:ptRight.X, Bottom:ptBottom.Y};
|
|
79688
|
+
rtBottomArea.Width=rtBottomArea.Right-rtBottomArea.Left;
|
|
79689
|
+
rtBottomArea.Height=rtBottomArea.Bottom-rtBottomArea.Top;
|
|
79690
|
+
this.Canvas.fillStyle=bSelected? this.BottomAreaConfig.SelectedAreaColor:this.BottomAreaConfig.AreaColor;
|
|
79691
|
+
this.Canvas.beginPath();
|
|
79692
|
+
this.Canvas.fillRect(rtBottomArea.Left,rtBottomArea.Top,rtBottomArea.Width,rtBottomArea.Height);
|
|
79693
|
+
this.AryRectArea[1]={ ID:100, Rect:rtBottomArea };
|
|
79694
|
+
|
|
79695
|
+
//线段
|
|
79696
|
+
this.Canvas.strokeStyle=this.LineColor;
|
|
79697
|
+
this.Canvas.beginPath();
|
|
79698
|
+
this.Canvas.moveTo(ptCenter.X,ToFixedPoint(ptCenter.Y));
|
|
79699
|
+
this.Canvas.lineTo(ptRight.X,ToFixedPoint(ptRight.Y));
|
|
79700
|
+
this.Canvas.stroke();
|
|
79701
|
+
}
|
|
79702
|
+
|
|
79703
|
+
this.DrawLabel=function(drawPoint)
|
|
79704
|
+
{
|
|
79705
|
+
if (!this.IsActive()) return; //激活状态下才显示
|
|
79706
|
+
|
|
79707
|
+
var aryLabel=this.FormatLabelText(drawPoint);
|
|
79708
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryLabel)) return;
|
|
79709
|
+
|
|
79710
|
+
this.TextFontHeight=this.GetFontHeight(this.LabelConfig.Font,"擎");
|
|
79711
|
+
|
|
79712
|
+
for(var i=0;i<aryLabel.length;++i)
|
|
79713
|
+
{
|
|
79714
|
+
var item=aryLabel[i];
|
|
79715
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(item.AryText)) continue;
|
|
79716
|
+
|
|
79717
|
+
this.CalculateLabelSize(item);
|
|
79718
|
+
this.DrawLabelItem(item, drawPoint);
|
|
79719
|
+
}
|
|
79720
|
+
}
|
|
79721
|
+
|
|
79722
|
+
this.DrawLabelItem=function(lableItem, drawPoint)
|
|
79723
|
+
{
|
|
79724
|
+
var ptCenter=drawPoint[0];
|
|
79725
|
+
var ptRight=drawPoint[1];
|
|
79726
|
+
var ptTop=drawPoint[2];
|
|
79727
|
+
var ptBottom=drawPoint[3];
|
|
79728
|
+
var clientWidth=ptRight.X-ptCenter.X;
|
|
79729
|
+
var config=this.LabelConfig;
|
|
79730
|
+
var margin=config.Margin;
|
|
79731
|
+
|
|
79732
|
+
var rtText={ Width:lableItem.Width+margin.Left+margin.Right, Height:lableItem.Height+margin.Top+margin.Bottom };
|
|
79733
|
+
if (lableItem.Type==0) //中间
|
|
79734
|
+
{
|
|
79735
|
+
rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
|
|
79736
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
79737
|
+
rtText.Top=ptCenter.Y-rtText.Height/2;
|
|
79738
|
+
rtText.Bottom=rtText.Top+rtText.Height;
|
|
79739
|
+
}
|
|
79740
|
+
else if (lableItem.Type==1) //顶部
|
|
79741
|
+
{
|
|
79742
|
+
rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
|
|
79743
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
79744
|
+
rtText.Top=ptTop.Y-rtText.Height;
|
|
79745
|
+
rtText.Bottom=rtText.Top+rtText.Height;
|
|
79746
|
+
}
|
|
79747
|
+
else if (lableItem.Type==2)
|
|
79748
|
+
{
|
|
79749
|
+
rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
|
|
79750
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
79751
|
+
rtText.Top=ptBottom.Y;
|
|
79752
|
+
rtText.Bottom=rtText.Top+rtText.Height;
|
|
79753
|
+
}
|
|
79754
|
+
else
|
|
79755
|
+
{
|
|
79756
|
+
return;
|
|
79757
|
+
}
|
|
79758
|
+
|
|
79759
|
+
this.Canvas.fillStyle=lableItem.BGColor;
|
|
79760
|
+
this.Canvas.fillRect(rtText.Left, rtText.Top, rtText.Width, rtText.Height);
|
|
79761
|
+
|
|
79762
|
+
this.Canvas.textAlign = 'left';
|
|
79763
|
+
this.Canvas.textBaseline = 'bottom';
|
|
79764
|
+
this.Canvas.fillStyle=lableItem.TextColor;
|
|
79765
|
+
var x=rtText.Left+margin.Left;
|
|
79766
|
+
var y=rtText.Top+margin.Top+this.TextFontHeight;
|
|
79767
|
+
for(var i=0;i<lableItem.AryText.length;++i)
|
|
79768
|
+
{
|
|
79769
|
+
var item=lableItem.AryText[i];
|
|
79770
|
+
var xText=x;
|
|
79771
|
+
var yText=y;
|
|
79772
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) yText+=item.YOffset;
|
|
79773
|
+
|
|
79774
|
+
this.Canvas.fillText(item.Text, xText, yText);
|
|
79775
|
+
|
|
79776
|
+
y+=this.TextFontHeight;
|
|
79777
|
+
}
|
|
79778
|
+
}
|
|
79779
|
+
|
|
79780
|
+
this.FormatLabelText=function(drawPoint)
|
|
79781
|
+
{
|
|
79782
|
+
if (this.HQChart)
|
|
79783
|
+
{
|
|
79784
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_TVLONGPOSITION_LABEL);
|
|
79785
|
+
if (event && event.Callback)
|
|
79786
|
+
{
|
|
79787
|
+
var sendData={ Frame:this.Frame, AryLabel:null, AryPoint:drawPoint, PreventDefault:false };
|
|
79788
|
+
event.Callback(event, sendData, this);
|
|
79789
|
+
if (sendData.PreventDefault) return sendData.AryLabel;
|
|
79790
|
+
}
|
|
79791
|
+
}
|
|
79792
|
+
|
|
79793
|
+
var ptCenter=drawPoint[0];
|
|
79794
|
+
var ptTop=drawPoint[2];
|
|
79795
|
+
var ptBottom=drawPoint[3];
|
|
79796
|
+
var aryData=[];
|
|
79797
|
+
var yValue=this.Frame.GetYData(ptCenter.Y,false);
|
|
79798
|
+
aryData.push(
|
|
79799
|
+
{
|
|
79800
|
+
Type:0,
|
|
79801
|
+
AryText:
|
|
79802
|
+
[
|
|
79803
|
+
{ Text:`Open: ${yValue.toFixed(2)}`},
|
|
79804
|
+
//{ Text:"第2行:xxx"}
|
|
79805
|
+
],
|
|
79806
|
+
BGColor:"rgb(112,128,144)", TextColor:"rgb(255,255,255)"
|
|
79807
|
+
});
|
|
79808
|
+
|
|
79809
|
+
var yValue=this.Frame.GetYData(ptTop.Y,false);
|
|
79810
|
+
aryData.push({ Type:1, AryText:[{ Text:`Target: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.TopAreaConfig.TextBGColor, TextColor:this.TopAreaConfig.TextColor });
|
|
79811
|
+
|
|
79812
|
+
var yValue=this.Frame.GetYData(ptBottom.Y,false);
|
|
79813
|
+
aryData.push({ Type:2, AryText:[{ Text:`Stop: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.BottomAreaConfig.TextBGColor, TextColor:this.BottomAreaConfig.TextColor });
|
|
79814
|
+
|
|
79815
|
+
return aryData;
|
|
79816
|
+
}
|
|
79817
|
+
|
|
79818
|
+
this.CalculateLabelSize=function(lableItem)
|
|
79819
|
+
{
|
|
79820
|
+
lableItem.Width=0;
|
|
79821
|
+
lableItem.Height=0;
|
|
79822
|
+
for(var i=0;i<lableItem.AryText.length;++i)
|
|
79823
|
+
{
|
|
79824
|
+
var item=lableItem.AryText[i];
|
|
79825
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
79826
|
+
|
|
79827
|
+
item.TextWidth=textWidth;
|
|
79828
|
+
if (lableItem.Width<textWidth) lableItem.Width=textWidth;
|
|
79829
|
+
lableItem.Height+=this.TextFontHeight;
|
|
79830
|
+
}
|
|
79831
|
+
}
|
|
79832
|
+
|
|
79833
|
+
this.Move=function(xStep,yStep)
|
|
79834
|
+
{
|
|
79835
|
+
if (this.Status!=20) return false;
|
|
79836
|
+
if (!this.Frame) return false;
|
|
79837
|
+
var data=this.Frame.Data;
|
|
79838
|
+
if (!data) return false;
|
|
79839
|
+
|
|
79840
|
+
if (this.MovePointIndex==100) //整体移动
|
|
79841
|
+
{
|
|
79842
|
+
for(var i=0; i<this.Point.length;++i)
|
|
79843
|
+
{
|
|
79844
|
+
var item= this.Point[i];
|
|
79845
|
+
item.X+=xStep;
|
|
79846
|
+
item.Y+=yStep;
|
|
79847
|
+
}
|
|
79848
|
+
}
|
|
79849
|
+
else if (this.MovePointIndex===0)
|
|
79850
|
+
{
|
|
79851
|
+
for(var i=0;i<this.Point.length;++i)
|
|
79852
|
+
{
|
|
79853
|
+
var item=this.Point[i];
|
|
79854
|
+
if (i==0)
|
|
79855
|
+
{
|
|
79856
|
+
item.X+=xStep;
|
|
79857
|
+
item.Y+=yStep;
|
|
79858
|
+
}
|
|
79859
|
+
else if (i==1)
|
|
79860
|
+
{
|
|
79861
|
+
item.Y+=yStep;
|
|
79862
|
+
}
|
|
79863
|
+
else if (i==2 || i==3)
|
|
79864
|
+
{
|
|
79865
|
+
item.X+=xStep;
|
|
79866
|
+
}
|
|
79867
|
+
}
|
|
79868
|
+
}
|
|
79869
|
+
else if (this.MovePointIndex==1)
|
|
79870
|
+
{
|
|
79871
|
+
this.Point[1].X+=xStep;
|
|
79872
|
+
}
|
|
79873
|
+
else if (this.MovePointIndex==2)
|
|
79874
|
+
{
|
|
79875
|
+
var ptCenter=this.Point[0];
|
|
79876
|
+
var item=this.Point[2];
|
|
79877
|
+
if (item.Y+yStep<ptCenter.Y) item.Y+=yStep;
|
|
79878
|
+
}
|
|
79879
|
+
else if (this.MovePointIndex==3)
|
|
79880
|
+
{
|
|
79881
|
+
var ptCenter=this.Point[0];
|
|
79882
|
+
var item=this.Point[3];
|
|
79883
|
+
if (item.Y+yStep>ptCenter.Y) item.Y+=yStep;
|
|
79884
|
+
}
|
|
79885
|
+
|
|
79886
|
+
}
|
|
79887
|
+
}
|
|
79888
|
+
|
|
79889
|
+
|
|
79890
|
+
function ChartDrawTVShortPosition()
|
|
79891
|
+
{
|
|
79892
|
+
this.newMethod=ChartDrawTVLongPosition; //派生
|
|
79893
|
+
this.newMethod();
|
|
79894
|
+
delete this.newMethod;
|
|
79895
|
+
|
|
79896
|
+
this.ClassName='ChartDrawTVShortPosition';
|
|
79897
|
+
this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
|
|
79898
|
+
this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
|
|
79899
|
+
}
|
|
79900
|
+
|
|
79395
79901
|
|
|
79396
79902
|
function ChartDrawStorage()
|
|
79397
79903
|
{
|
|
@@ -80461,6 +80967,31 @@ function JSChartResource()
|
|
|
80461
80967
|
DownColor:"rgb(25,158,0)"
|
|
80462
80968
|
}
|
|
80463
80969
|
|
|
80970
|
+
this.ChartDrawTVLongPosition=
|
|
80971
|
+
{
|
|
80972
|
+
TopArea:
|
|
80973
|
+
{
|
|
80974
|
+
AreaColor:"rgba(214, 234, 230,0.8)",
|
|
80975
|
+
SelectedAreaColor:"rgba(214, 234, 230,0.55)",
|
|
80976
|
+
TextBGColor:"rgb(80, 150, 130)",
|
|
80977
|
+
TextColor:"rgb(255,255,255)"
|
|
80978
|
+
},
|
|
80979
|
+
|
|
80980
|
+
BottomArea:
|
|
80981
|
+
{
|
|
80982
|
+
AreaColor:"rgb(243, 217, 218,0.8)",
|
|
80983
|
+
SelectedAreaColor:"rgba(243, 217, 218,0.55)",
|
|
80984
|
+
TextBGColor:"rgb(214, 75, 75)",
|
|
80985
|
+
TextColor:"rgb(255,255,255)"
|
|
80986
|
+
},
|
|
80987
|
+
|
|
80988
|
+
Label:
|
|
80989
|
+
{
|
|
80990
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
80991
|
+
Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
|
|
80992
|
+
}
|
|
80993
|
+
}
|
|
80994
|
+
|
|
80464
80995
|
//手机端tooltip
|
|
80465
80996
|
this.TooltipPaint = {
|
|
80466
80997
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -82288,6 +82819,42 @@ function JSChartResource()
|
|
|
82288
82819
|
|
|
82289
82820
|
if (style.IndexLock) this.SetIndexLock(style.IndexLock);
|
|
82290
82821
|
if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
|
|
82822
|
+
|
|
82823
|
+
if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
|
|
82824
|
+
}
|
|
82825
|
+
|
|
82826
|
+
|
|
82827
|
+
this.SetChartDrawTVLongPosition=function(style)
|
|
82828
|
+
{
|
|
82829
|
+
if (style.TopArea)
|
|
82830
|
+
{
|
|
82831
|
+
var item=style.TopArea;
|
|
82832
|
+
var dest=this.ChartDrawTVLongPosition.TopArea;
|
|
82833
|
+
|
|
82834
|
+
if (item.AreaColor) dest.AreaColor=item.AreaColor;
|
|
82835
|
+
if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
|
|
82836
|
+
if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
|
|
82837
|
+
if (item.TextColor) dest.BorderColor=item.TextColor;
|
|
82838
|
+
}
|
|
82839
|
+
|
|
82840
|
+
if (style.BottomArea)
|
|
82841
|
+
{
|
|
82842
|
+
var item=style.BottomArea;
|
|
82843
|
+
var dest=this.ChartDrawTVLongPosition.BottomArea;
|
|
82844
|
+
|
|
82845
|
+
if (item.AreaColor) dest.AreaColor=item.AreaColor;
|
|
82846
|
+
if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
|
|
82847
|
+
if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
|
|
82848
|
+
if (item.TextColor) dest.BorderColor=item.TextColor;
|
|
82849
|
+
}
|
|
82850
|
+
|
|
82851
|
+
if (style.Label)
|
|
82852
|
+
{
|
|
82853
|
+
var item=style.Label;
|
|
82854
|
+
var dest=this.ChartDrawTVLongPosition.Label;
|
|
82855
|
+
if (item.Font) dest.Font=item.Font;
|
|
82856
|
+
CopyMarginConfig(dest.Margin, item.Margin);
|
|
82857
|
+
}
|
|
82291
82858
|
}
|
|
82292
82859
|
|
|
82293
82860
|
|
|
@@ -90044,7 +90611,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
90044
90611
|
if (item)
|
|
90045
90612
|
{
|
|
90046
90613
|
drawPicture=item.Create();
|
|
90047
|
-
|
|
90614
|
+
drawPicture.HQChart=this;
|
|
90048
90615
|
}
|
|
90049
90616
|
|
|
90050
90617
|
if (!drawPicture) //iconfont图标
|
|
@@ -108007,6 +108574,15 @@ Path2DHelper.FormatRadian=function(angle)
|
|
|
108007
108574
|
}
|
|
108008
108575
|
|
|
108009
108576
|
|
|
108577
|
+
Path2DHelper.PtInRect=function(x, y, rect)
|
|
108578
|
+
{
|
|
108579
|
+
if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
|
|
108580
|
+
|
|
108581
|
+
return false;
|
|
108582
|
+
}
|
|
108583
|
+
|
|
108584
|
+
|
|
108585
|
+
|
|
108010
108586
|
|
|
108011
108587
|
|
|
108012
108588
|
|
|
@@ -135394,6 +135970,31 @@ function GetBlackStyle()
|
|
|
135394
135970
|
|
|
135395
135971
|
Text:{ Color: "rgb(0,0,0)" , Family:'Arial', FontMaxSize:18, FontMinSize:6 }, //文字
|
|
135396
135972
|
},
|
|
135973
|
+
|
|
135974
|
+
ChartDrawTVLongPosition:
|
|
135975
|
+
{
|
|
135976
|
+
TopArea:
|
|
135977
|
+
{
|
|
135978
|
+
AreaColor:"rgba(34, 52, 48,0.8)",
|
|
135979
|
+
SelectedAreaColor:"rgba(34, 52, 48,0.55)",
|
|
135980
|
+
TextBGColor:"rgb(80, 150, 130)",
|
|
135981
|
+
TextColor:"rgb(255,255,255)"
|
|
135982
|
+
},
|
|
135983
|
+
|
|
135984
|
+
BottomArea:
|
|
135985
|
+
{
|
|
135986
|
+
AreaColor:"rgb(63, 35, 37,0.8)",
|
|
135987
|
+
SelectedAreaColor:"rgba(63, 35, 37,0.55)",
|
|
135988
|
+
TextBGColor:"rgb(214, 75, 75)",
|
|
135989
|
+
TextColor:"rgb(255,255,255)"
|
|
135990
|
+
},
|
|
135991
|
+
|
|
135992
|
+
Label:
|
|
135993
|
+
{
|
|
135994
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
135995
|
+
Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
|
|
135996
|
+
}
|
|
135997
|
+
},
|
|
135397
135998
|
|
|
135398
135999
|
//区间选择
|
|
135399
136000
|
RectSelect:
|
|
@@ -155320,6 +155921,9 @@ function JSDialogDrawTool()
|
|
|
155320
155921
|
{ Title: "线形回归线", ClassName:'hqchart_drawtool icon-linear_3', Type:0, Data:{ ID:"线形回归线" } },
|
|
155321
155922
|
{ Title: "线形回归带", ClassName:'hqchart_drawtool icon-linear_1', Type:0, Data:{ ID:"线形回归带" } },
|
|
155322
155923
|
{ Title: "延长线形回归带", ClassName:'hqchart_drawtool icon-linear_2', Type:0, Data:{ ID:"延长线形回归带" } },
|
|
155924
|
+
|
|
155925
|
+
{ Title: "Long Position", ClassName:'hqchart_drawtool icon-chart-long-position', Type:0, Data:{ ID:"TVLongPosition" } },
|
|
155926
|
+
{ Title: "Short Position", ClassName:'hqchart_drawtool icon-chart-short-position', Type:0, Data:{ ID:"TVShortPosition" } },
|
|
155323
155927
|
]
|
|
155324
155928
|
},
|
|
155325
155929
|
{
|
|
@@ -162918,7 +163522,7 @@ function HQChartScriptWorker()
|
|
|
162918
163522
|
|
|
162919
163523
|
|
|
162920
163524
|
|
|
162921
|
-
var HQCHART_VERSION="1.1.
|
|
163525
|
+
var HQCHART_VERSION="1.1.14970";
|
|
162922
163526
|
|
|
162923
163527
|
function PrintHQChartVersion()
|
|
162924
163528
|
{
|