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.
@@ -1248,7 +1248,7 @@ LONG := SUM(RC,0);\n\
1248
1248
  DIFF := SMA(LONG,10,1);\n\
1249
1249
  DEA := SMA(LONG,20,1);\n\
1250
1250
  LON : DIFF-DEA;\n\
1251
- LONMA : MA(LON,10);\n\
1251
+ LONMA : MA(LON,N);\n\
1252
1252
  LONT : LON, COLORSTICK;'
1253
1253
 
1254
1254
  };
@@ -6928,7 +6928,9 @@ var JSCHART_EVENT_ID=
6928
6928
  ON_RELOAD_RESOURCE:173,
6929
6929
 
6930
6930
  ON_REPORT_DATA_FILTER:174, //数据筛选
6931
- ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息
6931
+ ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息\
6932
+
6933
+ ON_FORMAT_TVLONGPOSITION_LABEL:176,
6932
6934
  }
6933
6935
 
6934
6936
  var JSCHART_OPERATOR_ID=
@@ -9091,9 +9093,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9091
9093
  {
9092
9094
  drawPicture.PointStatus=drawPicture.Status;
9093
9095
  if (this.FinishChartDrawPicturePoint())
9096
+ {
9097
+ if (drawPicture.IsDrawMain) this.Draw();
9094
9098
  this.DrawDynamicInfo();
9099
+ }
9095
9100
  else
9101
+ {
9096
9102
  bClearDrawPicture=false;
9103
+ }
9097
9104
  }
9098
9105
  else if (drawPicture.Status==20)
9099
9106
  {
@@ -10648,7 +10655,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10648
10655
  {
10649
10656
  var item=this.ChartDrawPicture[i];
10650
10657
  if (item.IsDrawFirst) continue;
10651
- if (item.IsDrawMain && item.IsDrawMain()) continue;
10658
+ if (item.IsDrawMain && item.IsDrawMain())
10659
+ {
10660
+ if (item.MainPartDraw) item.MainPartDraw();
10661
+ continue;
10662
+ }
10663
+
10652
10664
  if (this.SelectChartDrawPicture && this.SelectChartDrawPicture.Guid==item.Guid) continue; //当前选中在最后画
10653
10665
 
10654
10666
  item.Draw();
@@ -11212,7 +11224,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11212
11224
  {
11213
11225
  var item=this.ChartDrawPicture[i];
11214
11226
  if (item.IsDrawFirst) continue;
11215
- if (item.IsDrawMain && item.IsDrawMain()) continue;
11227
+ if (item.IsDrawMain && item.IsDrawMain())
11228
+ {
11229
+ if (item.MainPartDraw) item.MainPartDraw();
11230
+ continue;
11231
+ }
11216
11232
  if (this.SelectChartDrawPicture &&item.Guid==this.SelectChartDrawPicture.Guid) continue; //选中画图最后画 确保显示在最外面
11217
11233
 
11218
11234
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -69231,6 +69247,17 @@ function IChartDrawPicture()
69231
69247
  yText+=labelInfo.LineHeight;
69232
69248
  }
69233
69249
  }
69250
+
69251
+ this.IsActive=function()
69252
+ {
69253
+ if (!this.GetActiveDrawPicture) return false;
69254
+
69255
+ var active=this.GetActiveDrawPicture();
69256
+ if (active.Move.Guid!=this.Guid && active.Select.Guid!=this.Guid && active.MoveOn.Guid!=this.Guid)
69257
+ return false;
69258
+
69259
+ return true;
69260
+ }
69234
69261
  }
69235
69262
 
69236
69263
  IChartDrawPicture.ColorToRGBA=function(color,opacity)
@@ -69378,6 +69405,8 @@ IChartDrawPicture.ArrayDrawPricture=
69378
69405
  { Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
69379
69406
  { Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
69380
69407
  { Name:"BarsPattern", ClassName:"ChartBarsPattern", Create:function() { return new ChartBarsPattern(); } },
69408
+ { Name:"TVLongPosition", ClassName:"ChartDrawTVLongPosition", Create:function() { return new ChartDrawTVLongPosition(); } },
69409
+ { Name:"TVShortPosition", ClassName:"ChartDrawTVShortPositionn", Create:function() { return new ChartDrawTVShortPosition(); } },
69381
69410
  ];
69382
69411
 
69383
69412
  IChartDrawPicture.MapIonFont=new Map(
@@ -79348,6 +79377,500 @@ function ChartBarsPattern()
79348
79377
  }
79349
79378
  }
79350
79379
 
79380
+ function ChartDrawTVLongPosition()
79381
+ {
79382
+ this.newMethod=IChartDrawPicture; //派生
79383
+ this.newMethod();
79384
+ delete this.newMethod;
79385
+
79386
+ this.ClassName='ChartDrawTVLongPosition';
79387
+ this.PointCount=2; //起始2个点 画完4个点
79388
+
79389
+ this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
79390
+ this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
79391
+ this.LabelConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.Label);
79392
+
79393
+ //内部变量
79394
+ this.AryRectArea=[];
79395
+
79396
+ this.GetXYCoordinate=this.GetXYCoordinate_default;
79397
+ this.SetOption_Backup=this.SetOption;
79398
+ this.PointToValue_Backup=this.PointToValue;
79399
+
79400
+ this.SetOption=function(option)
79401
+ {
79402
+ this.SetOption_Backup();
79403
+
79404
+ if (option)
79405
+ {
79406
+
79407
+ }
79408
+ }
79409
+
79410
+ this.PointToValue=function()
79411
+ {
79412
+ //拖拽完成 把点移动到线段头尾
79413
+ if (this.Frame.IsHScreen)
79414
+ {
79415
+ this.Point[1].X=this.Point[0].X;
79416
+ }
79417
+ else
79418
+ {
79419
+ this.Point[1].Y=this.Point[0].Y;
79420
+ }
79421
+
79422
+ this.PointToValue_Backup();
79423
+ }
79424
+
79425
+ //0-10 鼠标对应的点索引 100=鼠标在正个图形上 -1 鼠标不在图形上
79426
+ this.IsPointIn=function(x,y, option)
79427
+ {
79428
+ if (this.Status!=10) return -1;
79429
+
79430
+ var value=this.IsPointInXYValue(x,y,option);
79431
+ if (value>=0) return value;
79432
+
79433
+ for(var i=0;i<this.AryRectArea.length;++i)
79434
+ {
79435
+ var item=this.AryRectArea[i];
79436
+ if (!item) continue;
79437
+
79438
+ if (Path2DHelper.PtInRect(x, y, item.Rect))
79439
+ {
79440
+ return item.ID;
79441
+ }
79442
+ }
79443
+
79444
+ return -1;
79445
+ }
79446
+
79447
+ this.OnFinish=function()
79448
+ {
79449
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Value)) return false;
79450
+
79451
+ if (!this.Frame) return false;
79452
+ var data=this.Frame.Data;
79453
+ if (!data) return false;
79454
+
79455
+ var firstPoint=this.Point[0];
79456
+ var firstValue=this.Value[0];
79457
+ var entryPrice=firstValue.YValue;
79458
+
79459
+ var topPrice=entryPrice*(1+0.05);
79460
+ var bottomPrice=entryPrice*(1-0.05);
79461
+
79462
+ this.Value[2]={ XValue:firstValue.XValue, YValue:topPrice };
79463
+ this.Value[3]={ XValue:firstValue.XValue, YValue:bottomPrice };
79464
+ if (firstValue.DateTime)
79465
+ {
79466
+ var item=firstValue.DateTime;
79467
+ this.Value[2].DateTime={ Date:item.Date, Time:item.Time };
79468
+ this.Value[3].DateTime={ Date:item.Date, Time:item.Time };
79469
+ }
79470
+
79471
+ this.Point[2]={ X:firstPoint.X, Y:this.Frame.GetYFromData(topPrice,false)};
79472
+ this.Point[3]={ X:firstPoint.X, Y:this.Frame.GetYFromData(bottomPrice,false)};
79473
+
79474
+ this.PointCount=4;
79475
+ }
79476
+
79477
+ this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
79478
+ {
79479
+ if (!this.GetActiveDrawPicture) return true;
79480
+
79481
+ var active=this.GetActiveDrawPicture();
79482
+ if (active.Select.Guid==this.Guid) return false;
79483
+
79484
+ return true;
79485
+ }
79486
+
79487
+ this.IsSelected=function()
79488
+ {
79489
+ if (!this.GetActiveDrawPicture) return false;
79490
+
79491
+ var active=this.GetActiveDrawPicture();
79492
+ //console.log(`[IsSelected] Select=${active.Select.Guid} MoveOn=${active.MoveOn.Guid}`);
79493
+ if (active.Select.Guid==this.Guid || active.MoveOn.Guid==this.Guid) return true;
79494
+
79495
+ return false;
79496
+ }
79497
+
79498
+ //未选中 作为背景色绘制
79499
+ this.MainDraw=function()
79500
+ {
79501
+ this.AryRectArea=[]
79502
+ if (this.IsFrameMinSize()) return;
79503
+
79504
+ //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
79505
+ if (this.Status!=10 && this.Status!=20) return;
79506
+
79507
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
79508
+ if (!drawPoint) return;
79509
+ if (drawPoint.length<2) return;
79510
+ this.IsHScreen=this.Frame.IsHScreen;
79511
+ if (this.IsHScreen) return;
79512
+
79513
+ this.ClipFrame();
79514
+
79515
+ this.ChartBorder=this.Frame.ChartBorder;
79516
+ this.DrawArea(drawPoint);
79517
+
79518
+ this.Canvas.restore();
79519
+ }
79520
+
79521
+ //鼠标在上面 动态绘制点和文字信息
79522
+ this.MainPartDraw=function()
79523
+ {
79524
+ if (this.IsFrameMinSize()) return;
79525
+ if (this.Status!=10 && this.Status!=20) return;
79526
+
79527
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
79528
+ if (!drawPoint) return;
79529
+ if (drawPoint.length<2) return;
79530
+ this.IsHScreen=this.Frame.IsHScreen;
79531
+ if (this.IsHScreen) return;
79532
+
79533
+ this.ClipFrame();
79534
+
79535
+ this.ChartBorder=this.Frame.ChartBorder;
79536
+ this.DrawLabel(drawPoint);
79537
+ this.DrawPoint(drawPoint);
79538
+
79539
+ this.Canvas.restore();
79540
+ }
79541
+
79542
+ this.Draw=function()
79543
+ {
79544
+ this.AryRectArea=[]
79545
+ if (this.IsFrameMinSize()) return;
79546
+
79547
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
79548
+ if (!drawPoint) return;
79549
+ if (drawPoint.length<2) return;
79550
+ this.IsHScreen=this.Frame.IsHScreen;
79551
+ if (this.IsHScreen) return;
79552
+
79553
+ this.ClipFrame();
79554
+ this.ChartBorder=this.Frame.ChartBorder;
79555
+
79556
+ if (this.Status==10 || this.Status==20) //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
79557
+ {
79558
+ this.DrawArea(drawPoint);
79559
+ this.DrawLabel(drawPoint);
79560
+ this.DrawPoint(drawPoint);
79561
+ }
79562
+ else
79563
+ {
79564
+ var ptStart=drawPoint[0];
79565
+ var ptEnd=drawPoint[1];
79566
+ this.Canvas.strokeStyle=this.LineColor;
79567
+ this.DrawVerticalLine(ptStart,ptEnd);
79568
+ }
79569
+
79570
+ this.Canvas.restore();
79571
+ }
79572
+
79573
+ this.DrawVerticalLine=function(ptStart, ptEnd)
79574
+ {
79575
+ var data=this.Frame.Data;
79576
+ if (this.IsHScreen)
79577
+ {
79578
+ var left=this.ChartBorder.GetLeft();
79579
+ var right=this.ChartBorder.GetRight();
79580
+ var xValue=Math.round(this.Frame.GetXData(ptStart.Y,false))+data.DataOffset;
79581
+ if (xValue<0) xValue=0;
79582
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79583
+ var yStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79584
+
79585
+ xValue=Math.round(this.Frame.GetXData(ptEnd.Y,false))+data.DataOffset;
79586
+ if (xValue<0) xValue=0;
79587
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79588
+ var yEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79589
+
79590
+ this.Canvas.beginPath();
79591
+ this.Canvas.moveTo(left,yStart);
79592
+ this.Canvas.lineTo(right,yStart);
79593
+
79594
+ this.Canvas.moveTo(left,yEnd);
79595
+ this.Canvas.lineTo(right,yEnd);
79596
+ this.Canvas.stroke();
79597
+
79598
+ this.Canvas.beginPath();
79599
+ this.Canvas.moveTo(ptStart.X,yStart);
79600
+ this.Canvas.lineTo(ptStart.X,yEnd);
79601
+ this.Canvas.stroke();
79602
+ }
79603
+ else
79604
+ {
79605
+ var top=this.ChartBorder.GetTopEx();
79606
+ var bottom=this.ChartBorder.GetBottomEx();
79607
+
79608
+ var xValue=Math.round(this.Frame.GetXData(ptStart.X,false))+data.DataOffset;
79609
+ if (xValue<0) xValue=0;
79610
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79611
+ var xStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79612
+
79613
+ xValue=Math.round(this.Frame.GetXData(ptEnd.X,false))+data.DataOffset;
79614
+ if (xValue<0) xValue=0;
79615
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79616
+ var xEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79617
+
79618
+ this.Canvas.beginPath();
79619
+ this.Canvas.moveTo(xStart,top);
79620
+ this.Canvas.lineTo(xStart,bottom);
79621
+
79622
+ this.Canvas.moveTo(xEnd,top);
79623
+ this.Canvas.lineTo(xEnd,bottom);
79624
+ this.Canvas.stroke();
79625
+
79626
+ this.Canvas.beginPath();
79627
+ this.Canvas.moveTo(xStart,ptStart.Y);
79628
+ this.Canvas.lineTo(xEnd,ptStart.Y);
79629
+ this.Canvas.stroke();
79630
+ }
79631
+ }
79632
+
79633
+ this.GetCursorType=function(ptIndex)
79634
+ {
79635
+ if (ptIndex==100) return "pointer";
79636
+ else if (ptIndex==0) return "move";
79637
+ else if (ptIndex==1) return "ew-resize";
79638
+ else if (ptIndex==2 || ptIndex==3) return "ns-resize";
79639
+
79640
+ return null;
79641
+ }
79642
+
79643
+ this.DrawArea=function(drawPoint)
79644
+ {
79645
+ var ptCenter=drawPoint[0];
79646
+ var ptRight=drawPoint[1]
79647
+ var ptTop=drawPoint[2];
79648
+ var ptBottom=drawPoint[3];
79649
+ var bSelected=this.IsSelected();
79650
+
79651
+ var rtTopArea={ Left:ptCenter.X, Top: ptTop.Y, Right:ptRight.X, Bottom:ptCenter.Y};
79652
+ rtTopArea.Width=rtTopArea.Right-rtTopArea.Left;
79653
+ rtTopArea.Height=rtTopArea.Bottom-rtTopArea.Top;
79654
+
79655
+ this.Canvas.fillStyle=bSelected ? this.TopAreaConfig.SelectedAreaColor: this.TopAreaConfig.AreaColor;
79656
+ this.Canvas.beginPath();
79657
+ this.Canvas.fillRect(rtTopArea.Left,rtTopArea.Top,rtTopArea.Width,rtTopArea.Height);
79658
+ this.AryRectArea[0]={ ID:100, Rect:rtTopArea };
79659
+
79660
+ var rtBottomArea={Left:ptCenter.X, Top: ptCenter.Y, Right:ptRight.X, Bottom:ptBottom.Y};
79661
+ rtBottomArea.Width=rtBottomArea.Right-rtBottomArea.Left;
79662
+ rtBottomArea.Height=rtBottomArea.Bottom-rtBottomArea.Top;
79663
+ this.Canvas.fillStyle=bSelected? this.BottomAreaConfig.SelectedAreaColor:this.BottomAreaConfig.AreaColor;
79664
+ this.Canvas.beginPath();
79665
+ this.Canvas.fillRect(rtBottomArea.Left,rtBottomArea.Top,rtBottomArea.Width,rtBottomArea.Height);
79666
+ this.AryRectArea[1]={ ID:100, Rect:rtBottomArea };
79667
+
79668
+ //线段
79669
+ this.Canvas.strokeStyle=this.LineColor;
79670
+ this.Canvas.beginPath();
79671
+ this.Canvas.moveTo(ptCenter.X,ToFixedPoint(ptCenter.Y));
79672
+ this.Canvas.lineTo(ptRight.X,ToFixedPoint(ptRight.Y));
79673
+ this.Canvas.stroke();
79674
+ }
79675
+
79676
+ this.DrawLabel=function(drawPoint)
79677
+ {
79678
+ if (!this.IsActive()) return; //激活状态下才显示
79679
+
79680
+ var aryLabel=this.FormatLabelText(drawPoint);
79681
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryLabel)) return;
79682
+
79683
+ this.TextFontHeight=this.GetFontHeight(this.LabelConfig.Font,"擎");
79684
+
79685
+ for(var i=0;i<aryLabel.length;++i)
79686
+ {
79687
+ var item=aryLabel[i];
79688
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AryText)) continue;
79689
+
79690
+ this.CalculateLabelSize(item);
79691
+ this.DrawLabelItem(item, drawPoint);
79692
+ }
79693
+ }
79694
+
79695
+ this.DrawLabelItem=function(lableItem, drawPoint)
79696
+ {
79697
+ var ptCenter=drawPoint[0];
79698
+ var ptRight=drawPoint[1];
79699
+ var ptTop=drawPoint[2];
79700
+ var ptBottom=drawPoint[3];
79701
+ var clientWidth=ptRight.X-ptCenter.X;
79702
+ var config=this.LabelConfig;
79703
+ var margin=config.Margin;
79704
+
79705
+ var rtText={ Width:lableItem.Width+margin.Left+margin.Right, Height:lableItem.Height+margin.Top+margin.Bottom };
79706
+ if (lableItem.Type==0) //中间
79707
+ {
79708
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79709
+ rtText.Right=rtText.Left+rtText.Width;
79710
+ rtText.Top=ptCenter.Y-rtText.Height/2;
79711
+ rtText.Bottom=rtText.Top+rtText.Height;
79712
+ }
79713
+ else if (lableItem.Type==1) //顶部
79714
+ {
79715
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79716
+ rtText.Right=rtText.Left+rtText.Width;
79717
+ rtText.Top=ptTop.Y-rtText.Height;
79718
+ rtText.Bottom=rtText.Top+rtText.Height;
79719
+ }
79720
+ else if (lableItem.Type==2)
79721
+ {
79722
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79723
+ rtText.Right=rtText.Left+rtText.Width;
79724
+ rtText.Top=ptBottom.Y;
79725
+ rtText.Bottom=rtText.Top+rtText.Height;
79726
+ }
79727
+ else
79728
+ {
79729
+ return;
79730
+ }
79731
+
79732
+ this.Canvas.fillStyle=lableItem.BGColor;
79733
+ this.Canvas.fillRect(rtText.Left, rtText.Top, rtText.Width, rtText.Height);
79734
+
79735
+ this.Canvas.textAlign = 'left';
79736
+ this.Canvas.textBaseline = 'bottom';
79737
+ this.Canvas.fillStyle=lableItem.TextColor;
79738
+ var x=rtText.Left+margin.Left;
79739
+ var y=rtText.Top+margin.Top+this.TextFontHeight;
79740
+ for(var i=0;i<lableItem.AryText.length;++i)
79741
+ {
79742
+ var item=lableItem.AryText[i];
79743
+ var xText=x;
79744
+ var yText=y;
79745
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) yText+=item.YOffset;
79746
+
79747
+ this.Canvas.fillText(item.Text, xText, yText);
79748
+
79749
+ y+=this.TextFontHeight;
79750
+ }
79751
+ }
79752
+
79753
+ this.FormatLabelText=function(drawPoint)
79754
+ {
79755
+ if (this.HQChart)
79756
+ {
79757
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_TVLONGPOSITION_LABEL);
79758
+ if (event && event.Callback)
79759
+ {
79760
+ var sendData={ Frame:this.Frame, AryLabel:null, AryPoint:drawPoint, PreventDefault:false };
79761
+ event.Callback(event, sendData, this);
79762
+ if (sendData.PreventDefault) return sendData.AryLabel;
79763
+ }
79764
+ }
79765
+
79766
+ var ptCenter=drawPoint[0];
79767
+ var ptTop=drawPoint[2];
79768
+ var ptBottom=drawPoint[3];
79769
+ var aryData=[];
79770
+ var yValue=this.Frame.GetYData(ptCenter.Y,false);
79771
+ aryData.push(
79772
+ {
79773
+ Type:0,
79774
+ AryText:
79775
+ [
79776
+ { Text:`Open: ${yValue.toFixed(2)}`},
79777
+ //{ Text:"第2行:xxx"}
79778
+ ],
79779
+ BGColor:"rgb(112,128,144)", TextColor:"rgb(255,255,255)"
79780
+ });
79781
+
79782
+ var yValue=this.Frame.GetYData(ptTop.Y,false);
79783
+ aryData.push({ Type:1, AryText:[{ Text:`Target: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.TopAreaConfig.TextBGColor, TextColor:this.TopAreaConfig.TextColor });
79784
+
79785
+ var yValue=this.Frame.GetYData(ptBottom.Y,false);
79786
+ aryData.push({ Type:2, AryText:[{ Text:`Stop: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.BottomAreaConfig.TextBGColor, TextColor:this.BottomAreaConfig.TextColor });
79787
+
79788
+ return aryData;
79789
+ }
79790
+
79791
+ this.CalculateLabelSize=function(lableItem)
79792
+ {
79793
+ lableItem.Width=0;
79794
+ lableItem.Height=0;
79795
+ for(var i=0;i<lableItem.AryText.length;++i)
79796
+ {
79797
+ var item=lableItem.AryText[i];
79798
+ var textWidth=this.Canvas.measureText(item.Text).width;
79799
+
79800
+ item.TextWidth=textWidth;
79801
+ if (lableItem.Width<textWidth) lableItem.Width=textWidth;
79802
+ lableItem.Height+=this.TextFontHeight;
79803
+ }
79804
+ }
79805
+
79806
+ this.Move=function(xStep,yStep)
79807
+ {
79808
+ if (this.Status!=20) return false;
79809
+ if (!this.Frame) return false;
79810
+ var data=this.Frame.Data;
79811
+ if (!data) return false;
79812
+
79813
+ if (this.MovePointIndex==100) //整体移动
79814
+ {
79815
+ for(var i=0; i<this.Point.length;++i)
79816
+ {
79817
+ var item= this.Point[i];
79818
+ item.X+=xStep;
79819
+ item.Y+=yStep;
79820
+ }
79821
+ }
79822
+ else if (this.MovePointIndex===0)
79823
+ {
79824
+ for(var i=0;i<this.Point.length;++i)
79825
+ {
79826
+ var item=this.Point[i];
79827
+ if (i==0)
79828
+ {
79829
+ item.X+=xStep;
79830
+ item.Y+=yStep;
79831
+ }
79832
+ else if (i==1)
79833
+ {
79834
+ item.Y+=yStep;
79835
+ }
79836
+ else if (i==2 || i==3)
79837
+ {
79838
+ item.X+=xStep;
79839
+ }
79840
+ }
79841
+ }
79842
+ else if (this.MovePointIndex==1)
79843
+ {
79844
+ this.Point[1].X+=xStep;
79845
+ }
79846
+ else if (this.MovePointIndex==2)
79847
+ {
79848
+ var ptCenter=this.Point[0];
79849
+ var item=this.Point[2];
79850
+ if (item.Y+yStep<ptCenter.Y) item.Y+=yStep;
79851
+ }
79852
+ else if (this.MovePointIndex==3)
79853
+ {
79854
+ var ptCenter=this.Point[0];
79855
+ var item=this.Point[3];
79856
+ if (item.Y+yStep>ptCenter.Y) item.Y+=yStep;
79857
+ }
79858
+
79859
+ }
79860
+ }
79861
+
79862
+
79863
+ function ChartDrawTVShortPosition()
79864
+ {
79865
+ this.newMethod=ChartDrawTVLongPosition; //派生
79866
+ this.newMethod();
79867
+ delete this.newMethod;
79868
+
79869
+ this.ClassName='ChartDrawTVShortPosition';
79870
+ this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
79871
+ this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
79872
+ }
79873
+
79351
79874
 
79352
79875
  function ChartDrawStorage()
79353
79876
  {
@@ -80417,6 +80940,31 @@ function JSChartResource()
80417
80940
  DownColor:"rgb(25,158,0)"
80418
80941
  }
80419
80942
 
80943
+ this.ChartDrawTVLongPosition=
80944
+ {
80945
+ TopArea:
80946
+ {
80947
+ AreaColor:"rgba(214, 234, 230,0.8)",
80948
+ SelectedAreaColor:"rgba(214, 234, 230,0.55)",
80949
+ TextBGColor:"rgb(80, 150, 130)",
80950
+ TextColor:"rgb(255,255,255)"
80951
+ },
80952
+
80953
+ BottomArea:
80954
+ {
80955
+ AreaColor:"rgb(243, 217, 218,0.8)",
80956
+ SelectedAreaColor:"rgba(243, 217, 218,0.55)",
80957
+ TextBGColor:"rgb(214, 75, 75)",
80958
+ TextColor:"rgb(255,255,255)"
80959
+ },
80960
+
80961
+ Label:
80962
+ {
80963
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
80964
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
80965
+ }
80966
+ }
80967
+
80420
80968
  //手机端tooltip
80421
80969
  this.TooltipPaint = {
80422
80970
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -82244,6 +82792,42 @@ function JSChartResource()
82244
82792
 
82245
82793
  if (style.IndexLock) this.SetIndexLock(style.IndexLock);
82246
82794
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
82795
+
82796
+ if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
82797
+ }
82798
+
82799
+
82800
+ this.SetChartDrawTVLongPosition=function(style)
82801
+ {
82802
+ if (style.TopArea)
82803
+ {
82804
+ var item=style.TopArea;
82805
+ var dest=this.ChartDrawTVLongPosition.TopArea;
82806
+
82807
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
82808
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
82809
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
82810
+ if (item.TextColor) dest.BorderColor=item.TextColor;
82811
+ }
82812
+
82813
+ if (style.BottomArea)
82814
+ {
82815
+ var item=style.BottomArea;
82816
+ var dest=this.ChartDrawTVLongPosition.BottomArea;
82817
+
82818
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
82819
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
82820
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
82821
+ if (item.TextColor) dest.BorderColor=item.TextColor;
82822
+ }
82823
+
82824
+ if (style.Label)
82825
+ {
82826
+ var item=style.Label;
82827
+ var dest=this.ChartDrawTVLongPosition.Label;
82828
+ if (item.Font) dest.Font=item.Font;
82829
+ CopyMarginConfig(dest.Margin, item.Margin);
82830
+ }
82247
82831
  }
82248
82832
 
82249
82833
 
@@ -90000,7 +90584,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90000
90584
  if (item)
90001
90585
  {
90002
90586
  drawPicture=item.Create();
90003
- if (drawPicture.ClassName=='ChartDrawPictureText' || drawPicture.ClassName=="ChartDrawVolProfile") drawPicture.HQChart=this;
90587
+ drawPicture.HQChart=this;
90004
90588
  }
90005
90589
 
90006
90590
  if (!drawPicture) //iconfont图标
@@ -107963,6 +108547,15 @@ Path2DHelper.FormatRadian=function(angle)
107963
108547
  }
107964
108548
 
107965
108549
 
108550
+ Path2DHelper.PtInRect=function(x, y, rect)
108551
+ {
108552
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
108553
+
108554
+ return false;
108555
+ }
108556
+
108557
+
108558
+
107966
108559
 
107967
108560
 
107968
108561
 
@@ -135350,6 +135943,31 @@ function GetBlackStyle()
135350
135943
 
135351
135944
  Text:{ Color: "rgb(0,0,0)" , Family:'Arial', FontMaxSize:18, FontMinSize:6 }, //文字
135352
135945
  },
135946
+
135947
+ ChartDrawTVLongPosition:
135948
+ {
135949
+ TopArea:
135950
+ {
135951
+ AreaColor:"rgba(34, 52, 48,0.8)",
135952
+ SelectedAreaColor:"rgba(34, 52, 48,0.55)",
135953
+ TextBGColor:"rgb(80, 150, 130)",
135954
+ TextColor:"rgb(255,255,255)"
135955
+ },
135956
+
135957
+ BottomArea:
135958
+ {
135959
+ AreaColor:"rgb(63, 35, 37,0.8)",
135960
+ SelectedAreaColor:"rgba(63, 35, 37,0.55)",
135961
+ TextBGColor:"rgb(214, 75, 75)",
135962
+ TextColor:"rgb(255,255,255)"
135963
+ },
135964
+
135965
+ Label:
135966
+ {
135967
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
135968
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
135969
+ }
135970
+ },
135353
135971
 
135354
135972
  //区间选择
135355
135973
  RectSelect:
@@ -151542,7 +152160,7 @@ function ScrollBarBGChart()
151542
152160
 
151543
152161
 
151544
152162
 
151545
- var HQCHART_VERSION="1.1.14964";
152163
+ var HQCHART_VERSION="1.1.14974";
151546
152164
 
151547
152165
  function PrintHQChartVersion()
151548
152166
  {