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.
@@ -2832,7 +2832,9 @@ var JSCHART_EVENT_ID=
2832
2832
  ON_RELOAD_RESOURCE:173,
2833
2833
 
2834
2834
  ON_REPORT_DATA_FILTER:174, //数据筛选
2835
- ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息
2835
+ ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息\
2836
+
2837
+ ON_FORMAT_TVLONGPOSITION_LABEL:176,
2836
2838
  }
2837
2839
 
2838
2840
  var JSCHART_OPERATOR_ID=
@@ -4995,9 +4997,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
4995
4997
  {
4996
4998
  drawPicture.PointStatus=drawPicture.Status;
4997
4999
  if (this.FinishChartDrawPicturePoint())
5000
+ {
5001
+ if (drawPicture.IsDrawMain) this.Draw();
4998
5002
  this.DrawDynamicInfo();
5003
+ }
4999
5004
  else
5005
+ {
5000
5006
  bClearDrawPicture=false;
5007
+ }
5001
5008
  }
5002
5009
  else if (drawPicture.Status==20)
5003
5010
  {
@@ -6552,7 +6559,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6552
6559
  {
6553
6560
  var item=this.ChartDrawPicture[i];
6554
6561
  if (item.IsDrawFirst) continue;
6555
- if (item.IsDrawMain && item.IsDrawMain()) continue;
6562
+ if (item.IsDrawMain && item.IsDrawMain())
6563
+ {
6564
+ if (item.MainPartDraw) item.MainPartDraw();
6565
+ continue;
6566
+ }
6567
+
6556
6568
  if (this.SelectChartDrawPicture && this.SelectChartDrawPicture.Guid==item.Guid) continue; //当前选中在最后画
6557
6569
 
6558
6570
  item.Draw();
@@ -7116,7 +7128,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7116
7128
  {
7117
7129
  var item=this.ChartDrawPicture[i];
7118
7130
  if (item.IsDrawFirst) continue;
7119
- if (item.IsDrawMain && item.IsDrawMain()) continue;
7131
+ if (item.IsDrawMain && item.IsDrawMain())
7132
+ {
7133
+ if (item.MainPartDraw) item.MainPartDraw();
7134
+ continue;
7135
+ }
7120
7136
  if (this.SelectChartDrawPicture &&item.Guid==this.SelectChartDrawPicture.Guid) continue; //选中画图最后画 确保显示在最外面
7121
7137
 
7122
7138
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -65135,6 +65151,17 @@ function IChartDrawPicture()
65135
65151
  yText+=labelInfo.LineHeight;
65136
65152
  }
65137
65153
  }
65154
+
65155
+ this.IsActive=function()
65156
+ {
65157
+ if (!this.GetActiveDrawPicture) return false;
65158
+
65159
+ var active=this.GetActiveDrawPicture();
65160
+ if (active.Move.Guid!=this.Guid && active.Select.Guid!=this.Guid && active.MoveOn.Guid!=this.Guid)
65161
+ return false;
65162
+
65163
+ return true;
65164
+ }
65138
65165
  }
65139
65166
 
65140
65167
  IChartDrawPicture.ColorToRGBA=function(color,opacity)
@@ -65282,6 +65309,8 @@ IChartDrawPicture.ArrayDrawPricture=
65282
65309
  { Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
65283
65310
  { Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
65284
65311
  { Name:"BarsPattern", ClassName:"ChartBarsPattern", Create:function() { return new ChartBarsPattern(); } },
65312
+ { Name:"TVLongPosition", ClassName:"ChartDrawTVLongPosition", Create:function() { return new ChartDrawTVLongPosition(); } },
65313
+ { Name:"TVShortPosition", ClassName:"ChartDrawTVShortPositionn", Create:function() { return new ChartDrawTVShortPosition(); } },
65285
65314
  ];
65286
65315
 
65287
65316
  IChartDrawPicture.MapIonFont=new Map(
@@ -75252,6 +75281,483 @@ function ChartBarsPattern()
75252
75281
  }
75253
75282
  }
75254
75283
 
75284
+ function ChartDrawTVLongPosition()
75285
+ {
75286
+ this.newMethod=IChartDrawPicture; //派生
75287
+ this.newMethod();
75288
+ delete this.newMethod;
75289
+
75290
+ this.ClassName='ChartDrawTVLongPosition';
75291
+ this.PointCount=2; //起始2个点 画完4个点
75292
+
75293
+ this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
75294
+ this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
75295
+ this.LabelConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.Label);
75296
+
75297
+ //内部变量
75298
+ this.AryRectArea=[];
75299
+
75300
+ this.GetXYCoordinate=this.GetXYCoordinate_default;
75301
+ this.SetOption_Backup=this.SetOption;
75302
+ this.PointToValue_Backup=this.PointToValue;
75303
+
75304
+ this.SetOption=function(option)
75305
+ {
75306
+ this.SetOption_Backup();
75307
+
75308
+ if (option)
75309
+ {
75310
+
75311
+ }
75312
+ }
75313
+
75314
+ this.PointToValue=function()
75315
+ {
75316
+ //拖拽完成 把点移动到线段头尾
75317
+ if (this.Frame.IsHScreen)
75318
+ {
75319
+ this.Point[1].X=this.Point[0].X;
75320
+ }
75321
+ else
75322
+ {
75323
+ this.Point[1].Y=this.Point[0].Y;
75324
+ }
75325
+
75326
+ this.PointToValue_Backup();
75327
+ }
75328
+
75329
+ //0-10 鼠标对应的点索引 100=鼠标在正个图形上 -1 鼠标不在图形上
75330
+ this.IsPointIn=function(x,y, option)
75331
+ {
75332
+ if (this.Status!=10) return -1;
75333
+
75334
+ var value=this.IsPointInXYValue(x,y,option);
75335
+ if (value>=0) return value;
75336
+
75337
+ for(var i=0;i<this.AryRectArea.length;++i)
75338
+ {
75339
+ var item=this.AryRectArea[i];
75340
+ if (!item) continue;
75341
+
75342
+ if (Path2DHelper.PtInRect(x, y, item.Rect))
75343
+ {
75344
+ return item.ID;
75345
+ }
75346
+ }
75347
+
75348
+ return -1;
75349
+ }
75350
+
75351
+ this.OnFinish=function()
75352
+ {
75353
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Value)) return false;
75354
+
75355
+ if (!this.Frame) return false;
75356
+ var data=this.Frame.Data;
75357
+ if (!data) return false;
75358
+
75359
+ var firstPoint=this.Point[0];
75360
+ var firstValue=this.Value[0];
75361
+ var entryPrice=firstValue.YValue;
75362
+
75363
+ var topPrice=entryPrice*(1+0.05);
75364
+ var bottomPrice=entryPrice*(1-0.05);
75365
+
75366
+ this.Value[2]={ XValue:firstValue.XValue, YValue:topPrice };
75367
+ this.Value[3]={ XValue:firstValue.XValue, YValue:bottomPrice };
75368
+ if (firstValue.DateTime)
75369
+ {
75370
+ var item=firstValue.DateTime;
75371
+ this.Value[2].DateTime={ Date:item.Date, Time:item.Time };
75372
+ this.Value[3].DateTime={ Date:item.Date, Time:item.Time };
75373
+ }
75374
+
75375
+ this.Point[2]={ X:firstPoint.X, Y:this.Frame.GetYFromData(topPrice,false)};
75376
+ this.Point[3]={ X:firstPoint.X, Y:this.Frame.GetYFromData(bottomPrice,false)};
75377
+
75378
+ this.PointCount=4;
75379
+ }
75380
+
75381
+ this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
75382
+ {
75383
+ if (!this.GetActiveDrawPicture) return true;
75384
+
75385
+ var active=this.GetActiveDrawPicture();
75386
+ if (active.Select.Guid==this.Guid) return false;
75387
+
75388
+ return true;
75389
+ }
75390
+
75391
+ this.IsSelected=function()
75392
+ {
75393
+ if (!this.GetActiveDrawPicture) return false;
75394
+
75395
+ var active=this.GetActiveDrawPicture();
75396
+ if (active.Select.Guid==this.Guid) return true;
75397
+
75398
+ return false;
75399
+ }
75400
+
75401
+ this.MainDraw=function()
75402
+ {
75403
+ this.Draw();
75404
+ }
75405
+
75406
+
75407
+ this.MainPartDraw=function()
75408
+ {
75409
+ if (this.IsFrameMinSize()) return;
75410
+
75411
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
75412
+ if (!drawPoint) return;
75413
+ if (drawPoint.length<2) return;
75414
+ this.IsHScreen=this.Frame.IsHScreen;
75415
+ if (this.IsHScreen) return;
75416
+
75417
+ this.ClipFrame();
75418
+ this.ChartBorder=this.Frame.ChartBorder;
75419
+
75420
+ if (this.Status==10 || this.Status==20)
75421
+ {
75422
+ this.DrawLabel(drawPoint);
75423
+ this.DrawPoint(drawPoint);
75424
+ }
75425
+
75426
+ this.Canvas.restore();
75427
+ }
75428
+
75429
+ this.Draw=function()
75430
+ {
75431
+ this.AryRectArea=[]
75432
+ if (this.IsFrameMinSize()) return;
75433
+
75434
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
75435
+ if (!drawPoint) return;
75436
+ if (drawPoint.length<2) return;
75437
+ this.IsHScreen=this.Frame.IsHScreen;
75438
+ if (this.IsHScreen) return;
75439
+
75440
+ this.ClipFrame();
75441
+ this.ChartBorder=this.Frame.ChartBorder;
75442
+
75443
+ if (this.Status==10 || this.Status==20) //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
75444
+ {
75445
+ this.DrawArea(drawPoint);
75446
+ this.DrawLabel(drawPoint);
75447
+ this.DrawPoint(drawPoint);
75448
+ }
75449
+ else
75450
+ {
75451
+ var ptStart=drawPoint[0];
75452
+ var ptEnd=drawPoint[1];
75453
+ this.Canvas.strokeStyle=this.LineColor;
75454
+ this.DrawVerticalLine(ptStart,ptEnd);
75455
+ }
75456
+
75457
+ this.Canvas.restore();
75458
+ }
75459
+
75460
+ this.DrawVerticalLine=function(ptStart, ptEnd)
75461
+ {
75462
+ var data=this.Frame.Data;
75463
+ if (this.IsHScreen)
75464
+ {
75465
+ var left=this.ChartBorder.GetLeft();
75466
+ var right=this.ChartBorder.GetRight();
75467
+ var xValue=Math.round(this.Frame.GetXData(ptStart.Y,false))+data.DataOffset;
75468
+ if (xValue<0) xValue=0;
75469
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
75470
+ var yStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
75471
+
75472
+ xValue=Math.round(this.Frame.GetXData(ptEnd.Y,false))+data.DataOffset;
75473
+ if (xValue<0) xValue=0;
75474
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
75475
+ var yEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
75476
+
75477
+ this.Canvas.beginPath();
75478
+ this.Canvas.moveTo(left,yStart);
75479
+ this.Canvas.lineTo(right,yStart);
75480
+
75481
+ this.Canvas.moveTo(left,yEnd);
75482
+ this.Canvas.lineTo(right,yEnd);
75483
+ this.Canvas.stroke();
75484
+
75485
+ this.Canvas.beginPath();
75486
+ this.Canvas.moveTo(ptStart.X,yStart);
75487
+ this.Canvas.lineTo(ptStart.X,yEnd);
75488
+ this.Canvas.stroke();
75489
+ }
75490
+ else
75491
+ {
75492
+ var top=this.ChartBorder.GetTopEx();
75493
+ var bottom=this.ChartBorder.GetBottomEx();
75494
+
75495
+ var xValue=Math.round(this.Frame.GetXData(ptStart.X,false))+data.DataOffset;
75496
+ if (xValue<0) xValue=0;
75497
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
75498
+ var xStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
75499
+
75500
+ xValue=Math.round(this.Frame.GetXData(ptEnd.X,false))+data.DataOffset;
75501
+ if (xValue<0) xValue=0;
75502
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
75503
+ var xEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
75504
+
75505
+ this.Canvas.beginPath();
75506
+ this.Canvas.moveTo(xStart,top);
75507
+ this.Canvas.lineTo(xStart,bottom);
75508
+
75509
+ this.Canvas.moveTo(xEnd,top);
75510
+ this.Canvas.lineTo(xEnd,bottom);
75511
+ this.Canvas.stroke();
75512
+
75513
+ this.Canvas.beginPath();
75514
+ this.Canvas.moveTo(xStart,ptStart.Y);
75515
+ this.Canvas.lineTo(xEnd,ptStart.Y);
75516
+ this.Canvas.stroke();
75517
+ }
75518
+ }
75519
+
75520
+ this.GetCursorType=function(ptIndex)
75521
+ {
75522
+ if (ptIndex==100) return "pointer";
75523
+ else if (ptIndex==0) return "move";
75524
+ else if (ptIndex==1) return "ew-resize";
75525
+ else if (ptIndex==2 || ptIndex==3) return "ns-resize";
75526
+
75527
+ return null;
75528
+ }
75529
+
75530
+ this.DrawArea=function(drawPoint)
75531
+ {
75532
+ var ptCenter=drawPoint[0];
75533
+ var ptRight=drawPoint[1]
75534
+ var ptTop=drawPoint[2];
75535
+ var ptBottom=drawPoint[3];
75536
+ var bSelected=this.IsSelected();
75537
+
75538
+ var rtTopArea={ Left:ptCenter.X, Top: ptTop.Y, Right:ptRight.X, Bottom:ptCenter.Y};
75539
+ rtTopArea.Width=rtTopArea.Right-rtTopArea.Left;
75540
+ rtTopArea.Height=rtTopArea.Bottom-rtTopArea.Top;
75541
+
75542
+ this.Canvas.fillStyle=bSelected ? this.TopAreaConfig.SelectedAreaColor: this.TopAreaConfig.AreaColor;
75543
+ this.Canvas.beginPath();
75544
+ this.Canvas.fillRect(rtTopArea.Left,rtTopArea.Top,rtTopArea.Width,rtTopArea.Height);
75545
+ this.AryRectArea[0]={ ID:100, Rect:rtTopArea };
75546
+
75547
+ var rtBottomArea={Left:ptCenter.X, Top: ptCenter.Y, Right:ptRight.X, Bottom:ptBottom.Y};
75548
+ rtBottomArea.Width=rtBottomArea.Right-rtBottomArea.Left;
75549
+ rtBottomArea.Height=rtBottomArea.Bottom-rtBottomArea.Top;
75550
+ this.Canvas.fillStyle=bSelected? this.BottomAreaConfig.SelectedAreaColor:this.BottomAreaConfig.AreaColor;
75551
+ this.Canvas.beginPath();
75552
+ this.Canvas.fillRect(rtBottomArea.Left,rtBottomArea.Top,rtBottomArea.Width,rtBottomArea.Height);
75553
+ this.AryRectArea[1]={ ID:100, Rect:rtBottomArea };
75554
+
75555
+ //线段
75556
+ this.Canvas.strokeStyle=this.LineColor;
75557
+ this.Canvas.beginPath();
75558
+ this.Canvas.moveTo(ptCenter.X,ToFixedPoint(ptCenter.Y));
75559
+ this.Canvas.lineTo(ptRight.X,ToFixedPoint(ptRight.Y));
75560
+ this.Canvas.stroke();
75561
+ }
75562
+
75563
+ this.DrawLabel=function(drawPoint)
75564
+ {
75565
+ if (!this.IsActive()) return; //激活状态下才显示
75566
+
75567
+ var aryLabel=this.FormatLabelText(drawPoint);
75568
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryLabel)) return;
75569
+
75570
+ this.TextFontHeight=this.GetFontHeight(this.LabelConfig.Font,"擎");
75571
+
75572
+ for(var i=0;i<aryLabel.length;++i)
75573
+ {
75574
+ var item=aryLabel[i];
75575
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AryText)) continue;
75576
+
75577
+ this.CalculateLabelSize(item);
75578
+ this.DrawLabelItem(item, drawPoint);
75579
+ }
75580
+ }
75581
+
75582
+ this.DrawLabelItem=function(lableItem, drawPoint)
75583
+ {
75584
+ var ptCenter=drawPoint[0];
75585
+ var ptRight=drawPoint[1];
75586
+ var ptTop=drawPoint[2];
75587
+ var ptBottom=drawPoint[3];
75588
+ var clientWidth=ptRight.X-ptCenter.X;
75589
+ var config=this.LabelConfig;
75590
+ var margin=config.Margin;
75591
+
75592
+ var rtText={ Width:lableItem.Width+margin.Left+margin.Right, Height:lableItem.Height+margin.Top+margin.Bottom };
75593
+ if (lableItem.Type==0) //中间
75594
+ {
75595
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
75596
+ rtText.Right=rtText.Left+rtText.Width;
75597
+ rtText.Top=ptCenter.Y-rtText.Height/2;
75598
+ rtText.Bottom=rtText.Top+rtText.Height;
75599
+ }
75600
+ else if (lableItem.Type==1) //顶部
75601
+ {
75602
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
75603
+ rtText.Right=rtText.Left+rtText.Width;
75604
+ rtText.Top=ptTop.Y-rtText.Height;
75605
+ rtText.Bottom=rtText.Top+rtText.Height;
75606
+ }
75607
+ else if (lableItem.Type==2)
75608
+ {
75609
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
75610
+ rtText.Right=rtText.Left+rtText.Width;
75611
+ rtText.Top=ptBottom.Y;
75612
+ rtText.Bottom=rtText.Top+rtText.Height;
75613
+ }
75614
+ else
75615
+ {
75616
+ return;
75617
+ }
75618
+
75619
+ this.Canvas.fillStyle=lableItem.BGColor;
75620
+ this.Canvas.fillRect(rtText.Left, rtText.Top, rtText.Width, rtText.Height);
75621
+
75622
+ this.Canvas.textAlign = 'left';
75623
+ this.Canvas.textBaseline = 'bottom';
75624
+ this.Canvas.fillStyle=lableItem.TextColor;
75625
+ var x=rtText.Left+margin.Left;
75626
+ var y=rtText.Top+margin.Top+this.TextFontHeight;
75627
+ for(var i=0;i<lableItem.AryText.length;++i)
75628
+ {
75629
+ var item=lableItem.AryText[i];
75630
+ var xText=x;
75631
+ var yText=y;
75632
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) yText+=item.YOffset;
75633
+
75634
+ this.Canvas.fillText(item.Text, xText, yText);
75635
+
75636
+ y+=this.TextFontHeight;
75637
+ }
75638
+ }
75639
+
75640
+ this.FormatLabelText=function(drawPoint)
75641
+ {
75642
+ if (this.HQChart)
75643
+ {
75644
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_TVLONGPOSITION_LABEL);
75645
+ if (event && event.Callback)
75646
+ {
75647
+ var sendData={ Frame:this.Frame, AryLabel:null, AryPoint:drawPoint, PreventDefault:false };
75648
+ event.Callback(event, sendData, this);
75649
+ if (sendData.PreventDefault) return sendData.AryLabel;
75650
+ }
75651
+ }
75652
+
75653
+ var ptCenter=drawPoint[0];
75654
+ var ptTop=drawPoint[2];
75655
+ var ptBottom=drawPoint[3];
75656
+ var aryData=[];
75657
+ var yValue=this.Frame.GetYData(ptCenter.Y,false);
75658
+ aryData.push(
75659
+ {
75660
+ Type:0,
75661
+ AryText:
75662
+ [
75663
+ { Text:`Open: ${yValue.toFixed(2)}`},
75664
+ //{ Text:"第2行:xxx"}
75665
+ ],
75666
+ BGColor:"rgb(112,128,144)", TextColor:"rgb(255,255,255)"
75667
+ });
75668
+
75669
+ var yValue=this.Frame.GetYData(ptTop.Y,false);
75670
+ aryData.push({ Type:1, AryText:[{ Text:`Target: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.TopAreaConfig.TextBGColor, TextColor:this.TopAreaConfig.TextColor });
75671
+
75672
+ var yValue=this.Frame.GetYData(ptBottom.Y,false);
75673
+ aryData.push({ Type:2, AryText:[{ Text:`Stop: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.BottomAreaConfig.TextBGColor, TextColor:this.BottomAreaConfig.TextColor });
75674
+
75675
+ return aryData;
75676
+ }
75677
+
75678
+ this.CalculateLabelSize=function(lableItem)
75679
+ {
75680
+ lableItem.Width=0;
75681
+ lableItem.Height=0;
75682
+ for(var i=0;i<lableItem.AryText.length;++i)
75683
+ {
75684
+ var item=lableItem.AryText[i];
75685
+ var textWidth=this.Canvas.measureText(item.Text).width;
75686
+
75687
+ item.TextWidth=textWidth;
75688
+ if (lableItem.Width<textWidth) lableItem.Width=textWidth;
75689
+ lableItem.Height+=this.TextFontHeight;
75690
+ }
75691
+ }
75692
+
75693
+ this.Move=function(xStep,yStep)
75694
+ {
75695
+ if (this.Status!=20) return false;
75696
+ if (!this.Frame) return false;
75697
+ var data=this.Frame.Data;
75698
+ if (!data) return false;
75699
+
75700
+ if (this.MovePointIndex==100) //整体移动
75701
+ {
75702
+ for(var i=0; i<this.Point.length;++i)
75703
+ {
75704
+ var item= this.Point[i];
75705
+ item.X+=xStep;
75706
+ item.Y+=yStep;
75707
+ }
75708
+ }
75709
+ else if (this.MovePointIndex===0)
75710
+ {
75711
+ for(var i=0;i<this.Point.length;++i)
75712
+ {
75713
+ var item=this.Point[i];
75714
+ if (i==0)
75715
+ {
75716
+ item.X+=xStep;
75717
+ item.Y+=yStep;
75718
+ }
75719
+ else if (i==1)
75720
+ {
75721
+ item.Y+=yStep;
75722
+ }
75723
+ else if (i==2 || i==3)
75724
+ {
75725
+ item.X+=xStep;
75726
+ }
75727
+ }
75728
+ }
75729
+ else if (this.MovePointIndex==1)
75730
+ {
75731
+ this.Point[1].X+=xStep;
75732
+ }
75733
+ else if (this.MovePointIndex==2)
75734
+ {
75735
+ var ptCenter=this.Point[0];
75736
+ var item=this.Point[2];
75737
+ if (item.Y+yStep<ptCenter.Y) item.Y+=yStep;
75738
+ }
75739
+ else if (this.MovePointIndex==3)
75740
+ {
75741
+ var ptCenter=this.Point[0];
75742
+ var item=this.Point[3];
75743
+ if (item.Y+yStep>ptCenter.Y) item.Y+=yStep;
75744
+ }
75745
+
75746
+ }
75747
+ }
75748
+
75749
+
75750
+ function ChartDrawTVShortPosition()
75751
+ {
75752
+ this.newMethod=ChartDrawTVLongPosition; //派生
75753
+ this.newMethod();
75754
+ delete this.newMethod;
75755
+
75756
+ this.ClassName='ChartDrawTVShortPosition';
75757
+ this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
75758
+ this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
75759
+ }
75760
+
75255
75761
 
75256
75762
  function ChartDrawStorage()
75257
75763
  {
@@ -76321,6 +76827,31 @@ function JSChartResource()
76321
76827
  DownColor:"rgb(25,158,0)"
76322
76828
  }
76323
76829
 
76830
+ this.ChartDrawTVLongPosition=
76831
+ {
76832
+ TopArea:
76833
+ {
76834
+ AreaColor:"rgba(214, 234, 230,0.8)",
76835
+ SelectedAreaColor:"rgba(214, 234, 230,0.55)",
76836
+ TextBGColor:"rgb(80, 150, 130)",
76837
+ TextColor:"rgb(255,255,255)"
76838
+ },
76839
+
76840
+ BottomArea:
76841
+ {
76842
+ AreaColor:"rgb(243, 217, 218,0.8)",
76843
+ SelectedAreaColor:"rgba(243, 217, 218,0.55)",
76844
+ TextBGColor:"rgb(214, 75, 75)",
76845
+ TextColor:"rgb(255,255,255)"
76846
+ },
76847
+
76848
+ Label:
76849
+ {
76850
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
76851
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
76852
+ }
76853
+ }
76854
+
76324
76855
  //手机端tooltip
76325
76856
  this.TooltipPaint = {
76326
76857
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -78148,6 +78679,42 @@ function JSChartResource()
78148
78679
 
78149
78680
  if (style.IndexLock) this.SetIndexLock(style.IndexLock);
78150
78681
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
78682
+
78683
+ if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
78684
+ }
78685
+
78686
+
78687
+ this.SetChartDrawTVLongPosition=function(style)
78688
+ {
78689
+ if (style.TopArea)
78690
+ {
78691
+ var item=style.TopArea;
78692
+ var dest=this.ChartDrawTVLongPosition.TopArea;
78693
+
78694
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
78695
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
78696
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
78697
+ if (item.TextColor) dest.BorderColor=item.TextColor;
78698
+ }
78699
+
78700
+ if (style.BottomArea)
78701
+ {
78702
+ var item=style.BottomArea;
78703
+ var dest=this.ChartDrawTVLongPosition.BottomArea;
78704
+
78705
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
78706
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
78707
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
78708
+ if (item.TextColor) dest.BorderColor=item.TextColor;
78709
+ }
78710
+
78711
+ if (style.Label)
78712
+ {
78713
+ var item=style.Label;
78714
+ var dest=this.ChartDrawTVLongPosition.Label;
78715
+ if (item.Font) dest.Font=item.Font;
78716
+ CopyMarginConfig(dest.Margin, item.Margin);
78717
+ }
78151
78718
  }
78152
78719
 
78153
78720
 
@@ -85904,7 +86471,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
85904
86471
  if (item)
85905
86472
  {
85906
86473
  drawPicture=item.Create();
85907
- if (drawPicture.ClassName=='ChartDrawPictureText' || drawPicture.ClassName=="ChartDrawVolProfile") drawPicture.HQChart=this;
86474
+ drawPicture.HQChart=this;
85908
86475
  }
85909
86476
 
85910
86477
  if (!drawPicture) //iconfont图标
@@ -103867,6 +104434,15 @@ Path2DHelper.FormatRadian=function(angle)
103867
104434
  }
103868
104435
 
103869
104436
 
104437
+ Path2DHelper.PtInRect=function(x, y, rect)
104438
+ {
104439
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
104440
+
104441
+ return false;
104442
+ }
104443
+
104444
+
104445
+
103870
104446
 
103871
104447
 
103872
104448