hqchart 1.1.14965 → 1.1.14975

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.
@@ -1292,7 +1292,7 @@ LONG := SUM(RC,0);\n\
1292
1292
  DIFF := SMA(LONG,10,1);\n\
1293
1293
  DEA := SMA(LONG,20,1);\n\
1294
1294
  LON : DIFF-DEA;\n\
1295
- LONMA : MA(LON,10);\n\
1295
+ LONMA : MA(LON,N);\n\
1296
1296
  LONT : LON, COLORSTICK;'
1297
1297
 
1298
1298
  };
@@ -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()) continue;
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()) continue;
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,500 @@ 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
+ //console.log(`[IsSelected] Select=${active.Select.Guid} MoveOn=${active.MoveOn.Guid}`);
79537
+ if (active.Select.Guid==this.Guid || active.MoveOn.Guid==this.Guid) return true;
79538
+
79539
+ return false;
79540
+ }
79541
+
79542
+ //未选中 作为背景色绘制
79543
+ this.MainDraw=function()
79544
+ {
79545
+ this.AryRectArea=[]
79546
+ if (this.IsFrameMinSize()) return;
79547
+
79548
+ //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
79549
+ if (this.Status!=10 && this.Status!=20) 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
+
79559
+ this.ChartBorder=this.Frame.ChartBorder;
79560
+ this.DrawArea(drawPoint);
79561
+
79562
+ this.Canvas.restore();
79563
+ }
79564
+
79565
+ //鼠标在上面 动态绘制点和文字信息
79566
+ this.MainPartDraw=function()
79567
+ {
79568
+ if (this.IsFrameMinSize()) return;
79569
+ if (this.Status!=10 && this.Status!=20) return;
79570
+
79571
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
79572
+ if (!drawPoint) return;
79573
+ if (drawPoint.length<2) return;
79574
+ this.IsHScreen=this.Frame.IsHScreen;
79575
+ if (this.IsHScreen) return;
79576
+
79577
+ this.ClipFrame();
79578
+
79579
+ this.ChartBorder=this.Frame.ChartBorder;
79580
+ this.DrawLabel(drawPoint);
79581
+ this.DrawPoint(drawPoint);
79582
+
79583
+ this.Canvas.restore();
79584
+ }
79585
+
79586
+ this.Draw=function()
79587
+ {
79588
+ this.AryRectArea=[]
79589
+ if (this.IsFrameMinSize()) return;
79590
+
79591
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
79592
+ if (!drawPoint) return;
79593
+ if (drawPoint.length<2) return;
79594
+ this.IsHScreen=this.Frame.IsHScreen;
79595
+ if (this.IsHScreen) return;
79596
+
79597
+ this.ClipFrame();
79598
+ this.ChartBorder=this.Frame.ChartBorder;
79599
+
79600
+ if (this.Status==10 || this.Status==20) //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
79601
+ {
79602
+ this.DrawArea(drawPoint);
79603
+ this.DrawLabel(drawPoint);
79604
+ this.DrawPoint(drawPoint);
79605
+ }
79606
+ else
79607
+ {
79608
+ var ptStart=drawPoint[0];
79609
+ var ptEnd=drawPoint[1];
79610
+ this.Canvas.strokeStyle=this.LineColor;
79611
+ this.DrawVerticalLine(ptStart,ptEnd);
79612
+ }
79613
+
79614
+ this.Canvas.restore();
79615
+ }
79616
+
79617
+ this.DrawVerticalLine=function(ptStart, ptEnd)
79618
+ {
79619
+ var data=this.Frame.Data;
79620
+ if (this.IsHScreen)
79621
+ {
79622
+ var left=this.ChartBorder.GetLeft();
79623
+ var right=this.ChartBorder.GetRight();
79624
+ var xValue=Math.round(this.Frame.GetXData(ptStart.Y,false))+data.DataOffset;
79625
+ if (xValue<0) xValue=0;
79626
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79627
+ var yStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79628
+
79629
+ xValue=Math.round(this.Frame.GetXData(ptEnd.Y,false))+data.DataOffset;
79630
+ if (xValue<0) xValue=0;
79631
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79632
+ var yEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79633
+
79634
+ this.Canvas.beginPath();
79635
+ this.Canvas.moveTo(left,yStart);
79636
+ this.Canvas.lineTo(right,yStart);
79637
+
79638
+ this.Canvas.moveTo(left,yEnd);
79639
+ this.Canvas.lineTo(right,yEnd);
79640
+ this.Canvas.stroke();
79641
+
79642
+ this.Canvas.beginPath();
79643
+ this.Canvas.moveTo(ptStart.X,yStart);
79644
+ this.Canvas.lineTo(ptStart.X,yEnd);
79645
+ this.Canvas.stroke();
79646
+ }
79647
+ else
79648
+ {
79649
+ var top=this.ChartBorder.GetTopEx();
79650
+ var bottom=this.ChartBorder.GetBottomEx();
79651
+
79652
+ var xValue=Math.round(this.Frame.GetXData(ptStart.X,false))+data.DataOffset;
79653
+ if (xValue<0) xValue=0;
79654
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79655
+ var xStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79656
+
79657
+ xValue=Math.round(this.Frame.GetXData(ptEnd.X,false))+data.DataOffset;
79658
+ if (xValue<0) xValue=0;
79659
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79660
+ var xEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79661
+
79662
+ this.Canvas.beginPath();
79663
+ this.Canvas.moveTo(xStart,top);
79664
+ this.Canvas.lineTo(xStart,bottom);
79665
+
79666
+ this.Canvas.moveTo(xEnd,top);
79667
+ this.Canvas.lineTo(xEnd,bottom);
79668
+ this.Canvas.stroke();
79669
+
79670
+ this.Canvas.beginPath();
79671
+ this.Canvas.moveTo(xStart,ptStart.Y);
79672
+ this.Canvas.lineTo(xEnd,ptStart.Y);
79673
+ this.Canvas.stroke();
79674
+ }
79675
+ }
79676
+
79677
+ this.GetCursorType=function(ptIndex)
79678
+ {
79679
+ if (ptIndex==100) return "pointer";
79680
+ else if (ptIndex==0) return "move";
79681
+ else if (ptIndex==1) return "ew-resize";
79682
+ else if (ptIndex==2 || ptIndex==3) return "ns-resize";
79683
+
79684
+ return null;
79685
+ }
79686
+
79687
+ this.DrawArea=function(drawPoint)
79688
+ {
79689
+ var ptCenter=drawPoint[0];
79690
+ var ptRight=drawPoint[1]
79691
+ var ptTop=drawPoint[2];
79692
+ var ptBottom=drawPoint[3];
79693
+ var bSelected=this.IsSelected();
79694
+
79695
+ var rtTopArea={ Left:ptCenter.X, Top: ptTop.Y, Right:ptRight.X, Bottom:ptCenter.Y};
79696
+ rtTopArea.Width=rtTopArea.Right-rtTopArea.Left;
79697
+ rtTopArea.Height=rtTopArea.Bottom-rtTopArea.Top;
79698
+
79699
+ this.Canvas.fillStyle=bSelected ? this.TopAreaConfig.SelectedAreaColor: this.TopAreaConfig.AreaColor;
79700
+ this.Canvas.beginPath();
79701
+ this.Canvas.fillRect(rtTopArea.Left,rtTopArea.Top,rtTopArea.Width,rtTopArea.Height);
79702
+ this.AryRectArea[0]={ ID:100, Rect:rtTopArea };
79703
+
79704
+ var rtBottomArea={Left:ptCenter.X, Top: ptCenter.Y, Right:ptRight.X, Bottom:ptBottom.Y};
79705
+ rtBottomArea.Width=rtBottomArea.Right-rtBottomArea.Left;
79706
+ rtBottomArea.Height=rtBottomArea.Bottom-rtBottomArea.Top;
79707
+ this.Canvas.fillStyle=bSelected? this.BottomAreaConfig.SelectedAreaColor:this.BottomAreaConfig.AreaColor;
79708
+ this.Canvas.beginPath();
79709
+ this.Canvas.fillRect(rtBottomArea.Left,rtBottomArea.Top,rtBottomArea.Width,rtBottomArea.Height);
79710
+ this.AryRectArea[1]={ ID:100, Rect:rtBottomArea };
79711
+
79712
+ //线段
79713
+ this.Canvas.strokeStyle=this.LineColor;
79714
+ this.Canvas.beginPath();
79715
+ this.Canvas.moveTo(ptCenter.X,ToFixedPoint(ptCenter.Y));
79716
+ this.Canvas.lineTo(ptRight.X,ToFixedPoint(ptRight.Y));
79717
+ this.Canvas.stroke();
79718
+ }
79719
+
79720
+ this.DrawLabel=function(drawPoint)
79721
+ {
79722
+ if (!this.IsActive()) return; //激活状态下才显示
79723
+
79724
+ var aryLabel=this.FormatLabelText(drawPoint);
79725
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryLabel)) return;
79726
+
79727
+ this.TextFontHeight=this.GetFontHeight(this.LabelConfig.Font,"擎");
79728
+
79729
+ for(var i=0;i<aryLabel.length;++i)
79730
+ {
79731
+ var item=aryLabel[i];
79732
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AryText)) continue;
79733
+
79734
+ this.CalculateLabelSize(item);
79735
+ this.DrawLabelItem(item, drawPoint);
79736
+ }
79737
+ }
79738
+
79739
+ this.DrawLabelItem=function(lableItem, drawPoint)
79740
+ {
79741
+ var ptCenter=drawPoint[0];
79742
+ var ptRight=drawPoint[1];
79743
+ var ptTop=drawPoint[2];
79744
+ var ptBottom=drawPoint[3];
79745
+ var clientWidth=ptRight.X-ptCenter.X;
79746
+ var config=this.LabelConfig;
79747
+ var margin=config.Margin;
79748
+
79749
+ var rtText={ Width:lableItem.Width+margin.Left+margin.Right, Height:lableItem.Height+margin.Top+margin.Bottom };
79750
+ if (lableItem.Type==0) //中间
79751
+ {
79752
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79753
+ rtText.Right=rtText.Left+rtText.Width;
79754
+ rtText.Top=ptCenter.Y-rtText.Height/2;
79755
+ rtText.Bottom=rtText.Top+rtText.Height;
79756
+ }
79757
+ else if (lableItem.Type==1) //顶部
79758
+ {
79759
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79760
+ rtText.Right=rtText.Left+rtText.Width;
79761
+ rtText.Top=ptTop.Y-rtText.Height;
79762
+ rtText.Bottom=rtText.Top+rtText.Height;
79763
+ }
79764
+ else if (lableItem.Type==2)
79765
+ {
79766
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79767
+ rtText.Right=rtText.Left+rtText.Width;
79768
+ rtText.Top=ptBottom.Y;
79769
+ rtText.Bottom=rtText.Top+rtText.Height;
79770
+ }
79771
+ else
79772
+ {
79773
+ return;
79774
+ }
79775
+
79776
+ this.Canvas.fillStyle=lableItem.BGColor;
79777
+ this.Canvas.fillRect(rtText.Left, rtText.Top, rtText.Width, rtText.Height);
79778
+
79779
+ this.Canvas.textAlign = 'left';
79780
+ this.Canvas.textBaseline = 'bottom';
79781
+ this.Canvas.fillStyle=lableItem.TextColor;
79782
+ var x=rtText.Left+margin.Left;
79783
+ var y=rtText.Top+margin.Top+this.TextFontHeight;
79784
+ for(var i=0;i<lableItem.AryText.length;++i)
79785
+ {
79786
+ var item=lableItem.AryText[i];
79787
+ var xText=x;
79788
+ var yText=y;
79789
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) yText+=item.YOffset;
79790
+
79791
+ this.Canvas.fillText(item.Text, xText, yText);
79792
+
79793
+ y+=this.TextFontHeight;
79794
+ }
79795
+ }
79796
+
79797
+ this.FormatLabelText=function(drawPoint)
79798
+ {
79799
+ if (this.HQChart)
79800
+ {
79801
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_TVLONGPOSITION_LABEL);
79802
+ if (event && event.Callback)
79803
+ {
79804
+ var sendData={ Frame:this.Frame, AryLabel:null, AryPoint:drawPoint, PreventDefault:false };
79805
+ event.Callback(event, sendData, this);
79806
+ if (sendData.PreventDefault) return sendData.AryLabel;
79807
+ }
79808
+ }
79809
+
79810
+ var ptCenter=drawPoint[0];
79811
+ var ptTop=drawPoint[2];
79812
+ var ptBottom=drawPoint[3];
79813
+ var aryData=[];
79814
+ var yValue=this.Frame.GetYData(ptCenter.Y,false);
79815
+ aryData.push(
79816
+ {
79817
+ Type:0,
79818
+ AryText:
79819
+ [
79820
+ { Text:`Open: ${yValue.toFixed(2)}`},
79821
+ //{ Text:"第2行:xxx"}
79822
+ ],
79823
+ BGColor:"rgb(112,128,144)", TextColor:"rgb(255,255,255)"
79824
+ });
79825
+
79826
+ var yValue=this.Frame.GetYData(ptTop.Y,false);
79827
+ aryData.push({ Type:1, AryText:[{ Text:`Target: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.TopAreaConfig.TextBGColor, TextColor:this.TopAreaConfig.TextColor });
79828
+
79829
+ var yValue=this.Frame.GetYData(ptBottom.Y,false);
79830
+ aryData.push({ Type:2, AryText:[{ Text:`Stop: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.BottomAreaConfig.TextBGColor, TextColor:this.BottomAreaConfig.TextColor });
79831
+
79832
+ return aryData;
79833
+ }
79834
+
79835
+ this.CalculateLabelSize=function(lableItem)
79836
+ {
79837
+ lableItem.Width=0;
79838
+ lableItem.Height=0;
79839
+ for(var i=0;i<lableItem.AryText.length;++i)
79840
+ {
79841
+ var item=lableItem.AryText[i];
79842
+ var textWidth=this.Canvas.measureText(item.Text).width;
79843
+
79844
+ item.TextWidth=textWidth;
79845
+ if (lableItem.Width<textWidth) lableItem.Width=textWidth;
79846
+ lableItem.Height+=this.TextFontHeight;
79847
+ }
79848
+ }
79849
+
79850
+ this.Move=function(xStep,yStep)
79851
+ {
79852
+ if (this.Status!=20) return false;
79853
+ if (!this.Frame) return false;
79854
+ var data=this.Frame.Data;
79855
+ if (!data) return false;
79856
+
79857
+ if (this.MovePointIndex==100) //整体移动
79858
+ {
79859
+ for(var i=0; i<this.Point.length;++i)
79860
+ {
79861
+ var item= this.Point[i];
79862
+ item.X+=xStep;
79863
+ item.Y+=yStep;
79864
+ }
79865
+ }
79866
+ else if (this.MovePointIndex===0)
79867
+ {
79868
+ for(var i=0;i<this.Point.length;++i)
79869
+ {
79870
+ var item=this.Point[i];
79871
+ if (i==0)
79872
+ {
79873
+ item.X+=xStep;
79874
+ item.Y+=yStep;
79875
+ }
79876
+ else if (i==1)
79877
+ {
79878
+ item.Y+=yStep;
79879
+ }
79880
+ else if (i==2 || i==3)
79881
+ {
79882
+ item.X+=xStep;
79883
+ }
79884
+ }
79885
+ }
79886
+ else if (this.MovePointIndex==1)
79887
+ {
79888
+ this.Point[1].X+=xStep;
79889
+ }
79890
+ else if (this.MovePointIndex==2)
79891
+ {
79892
+ var ptCenter=this.Point[0];
79893
+ var item=this.Point[2];
79894
+ if (item.Y+yStep<ptCenter.Y) item.Y+=yStep;
79895
+ }
79896
+ else if (this.MovePointIndex==3)
79897
+ {
79898
+ var ptCenter=this.Point[0];
79899
+ var item=this.Point[3];
79900
+ if (item.Y+yStep>ptCenter.Y) item.Y+=yStep;
79901
+ }
79902
+
79903
+ }
79904
+ }
79905
+
79906
+
79907
+ function ChartDrawTVShortPosition()
79908
+ {
79909
+ this.newMethod=ChartDrawTVLongPosition; //派生
79910
+ this.newMethod();
79911
+ delete this.newMethod;
79912
+
79913
+ this.ClassName='ChartDrawTVShortPosition';
79914
+ this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
79915
+ this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
79916
+ }
79917
+
79395
79918
 
79396
79919
  function ChartDrawStorage()
79397
79920
  {
@@ -80461,6 +80984,31 @@ function JSChartResource()
80461
80984
  DownColor:"rgb(25,158,0)"
80462
80985
  }
80463
80986
 
80987
+ this.ChartDrawTVLongPosition=
80988
+ {
80989
+ TopArea:
80990
+ {
80991
+ AreaColor:"rgba(214, 234, 230,0.8)",
80992
+ SelectedAreaColor:"rgba(214, 234, 230,0.55)",
80993
+ TextBGColor:"rgb(80, 150, 130)",
80994
+ TextColor:"rgb(255,255,255)"
80995
+ },
80996
+
80997
+ BottomArea:
80998
+ {
80999
+ AreaColor:"rgb(243, 217, 218,0.8)",
81000
+ SelectedAreaColor:"rgba(243, 217, 218,0.55)",
81001
+ TextBGColor:"rgb(214, 75, 75)",
81002
+ TextColor:"rgb(255,255,255)"
81003
+ },
81004
+
81005
+ Label:
81006
+ {
81007
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
81008
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
81009
+ }
81010
+ }
81011
+
80464
81012
  //手机端tooltip
80465
81013
  this.TooltipPaint = {
80466
81014
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -82288,6 +82836,42 @@ function JSChartResource()
82288
82836
 
82289
82837
  if (style.IndexLock) this.SetIndexLock(style.IndexLock);
82290
82838
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
82839
+
82840
+ if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
82841
+ }
82842
+
82843
+
82844
+ this.SetChartDrawTVLongPosition=function(style)
82845
+ {
82846
+ if (style.TopArea)
82847
+ {
82848
+ var item=style.TopArea;
82849
+ var dest=this.ChartDrawTVLongPosition.TopArea;
82850
+
82851
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
82852
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
82853
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
82854
+ if (item.TextColor) dest.BorderColor=item.TextColor;
82855
+ }
82856
+
82857
+ if (style.BottomArea)
82858
+ {
82859
+ var item=style.BottomArea;
82860
+ var dest=this.ChartDrawTVLongPosition.BottomArea;
82861
+
82862
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
82863
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
82864
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
82865
+ if (item.TextColor) dest.BorderColor=item.TextColor;
82866
+ }
82867
+
82868
+ if (style.Label)
82869
+ {
82870
+ var item=style.Label;
82871
+ var dest=this.ChartDrawTVLongPosition.Label;
82872
+ if (item.Font) dest.Font=item.Font;
82873
+ CopyMarginConfig(dest.Margin, item.Margin);
82874
+ }
82291
82875
  }
82292
82876
 
82293
82877
 
@@ -90044,7 +90628,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90044
90628
  if (item)
90045
90629
  {
90046
90630
  drawPicture=item.Create();
90047
- if (drawPicture.ClassName=='ChartDrawPictureText' || drawPicture.ClassName=="ChartDrawVolProfile") drawPicture.HQChart=this;
90631
+ drawPicture.HQChart=this;
90048
90632
  }
90049
90633
 
90050
90634
  if (!drawPicture) //iconfont图标
@@ -108007,6 +108591,15 @@ Path2DHelper.FormatRadian=function(angle)
108007
108591
  }
108008
108592
 
108009
108593
 
108594
+ Path2DHelper.PtInRect=function(x, y, rect)
108595
+ {
108596
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
108597
+
108598
+ return false;
108599
+ }
108600
+
108601
+
108602
+
108010
108603
 
108011
108604
 
108012
108605
 
@@ -135394,6 +135987,31 @@ function GetBlackStyle()
135394
135987
 
135395
135988
  Text:{ Color: "rgb(0,0,0)" , Family:'Arial', FontMaxSize:18, FontMinSize:6 }, //文字
135396
135989
  },
135990
+
135991
+ ChartDrawTVLongPosition:
135992
+ {
135993
+ TopArea:
135994
+ {
135995
+ AreaColor:"rgba(34, 52, 48,0.8)",
135996
+ SelectedAreaColor:"rgba(34, 52, 48,0.55)",
135997
+ TextBGColor:"rgb(80, 150, 130)",
135998
+ TextColor:"rgb(255,255,255)"
135999
+ },
136000
+
136001
+ BottomArea:
136002
+ {
136003
+ AreaColor:"rgb(63, 35, 37,0.8)",
136004
+ SelectedAreaColor:"rgba(63, 35, 37,0.55)",
136005
+ TextBGColor:"rgb(214, 75, 75)",
136006
+ TextColor:"rgb(255,255,255)"
136007
+ },
136008
+
136009
+ Label:
136010
+ {
136011
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
136012
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
136013
+ }
136014
+ },
135397
136015
 
135398
136016
  //区间选择
135399
136017
  RectSelect:
@@ -155320,6 +155938,9 @@ function JSDialogDrawTool()
155320
155938
  { Title: "线形回归线", ClassName:'hqchart_drawtool icon-linear_3', Type:0, Data:{ ID:"线形回归线" } },
155321
155939
  { Title: "线形回归带", ClassName:'hqchart_drawtool icon-linear_1', Type:0, Data:{ ID:"线形回归带" } },
155322
155940
  { Title: "延长线形回归带", ClassName:'hqchart_drawtool icon-linear_2', Type:0, Data:{ ID:"延长线形回归带" } },
155941
+
155942
+ { Title: "Long Position", ClassName:'hqchart_drawtool icon-chart-long-position', Type:0, Data:{ ID:"TVLongPosition" } },
155943
+ { Title: "Short Position", ClassName:'hqchart_drawtool icon-chart-short-position', Type:0, Data:{ ID:"TVShortPosition" } },
155323
155944
  ]
155324
155945
  },
155325
155946
  {
@@ -162918,7 +163539,7 @@ function HQChartScriptWorker()
162918
163539
 
162919
163540
 
162920
163541
 
162921
- var HQCHART_VERSION="1.1.14964";
163542
+ var HQCHART_VERSION="1.1.14974";
162922
163543
 
162923
163544
  function PrintHQChartVersion()
162924
163545
  {