hqchart 1.1.14962 → 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.
@@ -4525,6 +4525,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4525
4525
  {
4526
4526
  var item=option.KeyboardMove;
4527
4527
  if (IFrameSplitOperator.IsPlusNumber(item.Delay)) chart.KeyboardMove.Delay=item.Delay;
4528
+ if (IFrameSplitOperator.IsPlusNumber(item.PressTime)) chart.KeyboardMove.PressTime=item.PressTime;
4528
4529
  }
4529
4530
 
4530
4531
  if (IFrameSplitOperator.IsNumber(option.StepPixel)) chart.StepPixel=option.StepPixel;
@@ -6927,7 +6928,9 @@ var JSCHART_EVENT_ID=
6927
6928
  ON_RELOAD_RESOURCE:173,
6928
6929
 
6929
6930
  ON_REPORT_DATA_FILTER:174, //数据筛选
6930
- ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息
6931
+ ON_REPORT_SHOW_TOOLTIP:175, //报价列表 提示信息\
6932
+
6933
+ ON_FORMAT_TVLONGPOSITION_LABEL:176,
6931
6934
  }
6932
6935
 
6933
6936
  var JSCHART_OPERATOR_ID=
@@ -7418,7 +7421,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7418
7421
  this.AryHotKey=[]; //热键 { KeyID:87, SecondKeyID:1, CMD:JSCHART_MENU_ID.CMD_FULLSCREEN_SUMMARY_ID, Args:null, Description:"Alt+W 全屏区间统计" },
7419
7422
 
7420
7423
  this.FastSlideConfig={ MinDistance:500, MinSpeed:3, MaxTime:250, Enable:false }; //快速滑动配置 MinDistance=最小的距离 MinSpeed=最小速度 MaxTime=最大间隔时间(ms)
7421
- this.KeyboardMove={ Timer:null, Delay:100 , Enable:false, Event:null }; //键盘左右移动
7424
+ this.KeyboardMove={ Timer:null, Delay:100 , PressTime:500, Enable:false, Event:null }; //键盘左右移动 PressTime=长按时间
7422
7425
 
7423
7426
  this.MapEventListenerCache=new Map(); //addEventListener 监听事件 key=type:"keydown|keyup ....", value:{ Callback:, Option: }
7424
7427
 
@@ -9090,9 +9093,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9090
9093
  {
9091
9094
  drawPicture.PointStatus=drawPicture.Status;
9092
9095
  if (this.FinishChartDrawPicturePoint())
9096
+ {
9097
+ if (drawPicture.IsDrawMain) this.Draw();
9093
9098
  this.DrawDynamicInfo();
9099
+ }
9094
9100
  else
9101
+ {
9095
9102
  bClearDrawPicture=false;
9103
+ }
9096
9104
  }
9097
9105
  else if (drawPicture.Status==20)
9098
9106
  {
@@ -10647,7 +10655,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10647
10655
  {
10648
10656
  var item=this.ChartDrawPicture[i];
10649
10657
  if (item.IsDrawFirst) continue;
10650
- if (item.IsDrawMain && item.IsDrawMain()) continue;
10658
+ if (item.IsDrawMain && item.IsDrawMain())
10659
+ {
10660
+ if (item.MainPartDraw) item.MainPartDraw();
10661
+ continue;
10662
+ }
10663
+
10651
10664
  if (this.SelectChartDrawPicture && this.SelectChartDrawPicture.Guid==item.Guid) continue; //当前选中在最后画
10652
10665
 
10653
10666
  item.Draw();
@@ -11211,7 +11224,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11211
11224
  {
11212
11225
  var item=this.ChartDrawPicture[i];
11213
11226
  if (item.IsDrawFirst) continue;
11214
- if (item.IsDrawMain && item.IsDrawMain()) continue;
11227
+ if (item.IsDrawMain && item.IsDrawMain())
11228
+ {
11229
+ if (item.MainPartDraw) item.MainPartDraw();
11230
+ continue;
11231
+ }
11215
11232
  if (this.SelectChartDrawPicture &&item.Guid==this.SelectChartDrawPicture.Guid) continue; //选中画图最后画 确保显示在最外面
11216
11233
 
11217
11234
  item.Draw(moveonPoint, this.LastMouseStatus);
@@ -11961,19 +11978,22 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11961
11978
 
11962
11979
  JSConsole.Chart.Log(`[JSChartContainer::StartKeyboardMoveTimer] Start` );
11963
11980
 
11964
- this.AutoKeyboardMove();
11981
+ this.AutoKeyboardMove({ Delay:this.KeyboardMove.PressTime });
11965
11982
  }
11966
11983
 
11967
- this.AutoKeyboardMove=function()
11984
+ this.AutoKeyboardMove=function(option)
11968
11985
  {
11969
11986
  if (!this.KeyboardMove) return false;
11970
11987
  if (!this.KeyboardMove.Enable) return false;
11971
11988
  if (!this.KeyboardMove.Event) return false;
11972
11989
 
11990
+ var delay=this.KeyboardMove.Delay;
11991
+ if (option && IFrameSplitOperator.IsNumber(option.Delay)) delay=option.Delay;
11992
+
11973
11993
  this.KeyboardMove.Timer=setTimeout(()=>
11974
11994
  {
11975
11995
  this.OnKeyboardMoveTimerProc();
11976
- },this.KeyboardMove.Delay);
11996
+ },delay);
11977
11997
  }
11978
11998
 
11979
11999
 
@@ -65862,13 +65882,24 @@ function DynamicChartTitlePainting()
65862
65882
 
65863
65883
 
65864
65884
  //动态标题
65865
- //动态标题
65885
+ //叠加指标动态标题
65866
65886
  this.DynamicTitle={ OutName:null, OutValue:null };
65867
65887
  this.OverlayDynamicTitle=new Map(); //key , value={ OutName, OutValue }
65868
65888
 
65869
65889
  this.IsShowMainIndexTitle=true; //是否显示主图指标标题
65870
65890
  this.MainTitlePaint=null; //主标题
65871
65891
 
65892
+ //option={ DynamicTitle:true/false }
65893
+ this.Clear=function(option)
65894
+ {
65895
+ this.Data=[];
65896
+ this.Title=null;
65897
+ if (option)
65898
+ {
65899
+ if (option.DynamicTitle===true) this.DynamicTitle={ OutName:null, OutValue:null }; //主图胴动态标题
65900
+ }
65901
+ }
65902
+
65872
65903
  //十字线是否显示
65873
65904
  this.IsShowCorssLine=function()
65874
65905
  {
@@ -69216,6 +69247,17 @@ function IChartDrawPicture()
69216
69247
  yText+=labelInfo.LineHeight;
69217
69248
  }
69218
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
+ }
69219
69261
  }
69220
69262
 
69221
69263
  IChartDrawPicture.ColorToRGBA=function(color,opacity)
@@ -69363,6 +69405,8 @@ IChartDrawPicture.ArrayDrawPricture=
69363
69405
  { Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
69364
69406
  { Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
69365
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(); } },
69366
69410
  ];
69367
69411
 
69368
69412
  IChartDrawPicture.MapIonFont=new Map(
@@ -79333,6 +79377,483 @@ function ChartBarsPattern()
79333
79377
  }
79334
79378
  }
79335
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
+ if (active.Select.Guid==this.Guid) return true;
79493
+
79494
+ return false;
79495
+ }
79496
+
79497
+ this.MainDraw=function()
79498
+ {
79499
+ this.Draw();
79500
+ }
79501
+
79502
+
79503
+ this.MainPartDraw=function()
79504
+ {
79505
+ if (this.IsFrameMinSize()) 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
+ this.ChartBorder=this.Frame.ChartBorder;
79515
+
79516
+ if (this.Status==10 || this.Status==20)
79517
+ {
79518
+ this.DrawLabel(drawPoint);
79519
+ this.DrawPoint(drawPoint);
79520
+ }
79521
+
79522
+ this.Canvas.restore();
79523
+ }
79524
+
79525
+ this.Draw=function()
79526
+ {
79527
+ this.AryRectArea=[]
79528
+ if (this.IsFrameMinSize()) return;
79529
+
79530
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:true} );
79531
+ if (!drawPoint) return;
79532
+ if (drawPoint.length<2) return;
79533
+ this.IsHScreen=this.Frame.IsHScreen;
79534
+ if (this.IsHScreen) return;
79535
+
79536
+ this.ClipFrame();
79537
+ this.ChartBorder=this.Frame.ChartBorder;
79538
+
79539
+ if (this.Status==10 || this.Status==20) //0=开始画 1=完成第1个点 2=完成第2个点 3=完成第3个点 10=完成 20=移动)
79540
+ {
79541
+ this.DrawArea(drawPoint);
79542
+ this.DrawLabel(drawPoint);
79543
+ this.DrawPoint(drawPoint);
79544
+ }
79545
+ else
79546
+ {
79547
+ var ptStart=drawPoint[0];
79548
+ var ptEnd=drawPoint[1];
79549
+ this.Canvas.strokeStyle=this.LineColor;
79550
+ this.DrawVerticalLine(ptStart,ptEnd);
79551
+ }
79552
+
79553
+ this.Canvas.restore();
79554
+ }
79555
+
79556
+ this.DrawVerticalLine=function(ptStart, ptEnd)
79557
+ {
79558
+ var data=this.Frame.Data;
79559
+ if (this.IsHScreen)
79560
+ {
79561
+ var left=this.ChartBorder.GetLeft();
79562
+ var right=this.ChartBorder.GetRight();
79563
+ var xValue=Math.round(this.Frame.GetXData(ptStart.Y,false))+data.DataOffset;
79564
+ if (xValue<0) xValue=0;
79565
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79566
+ var yStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79567
+
79568
+ xValue=Math.round(this.Frame.GetXData(ptEnd.Y,false))+data.DataOffset;
79569
+ if (xValue<0) xValue=0;
79570
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79571
+ var yEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79572
+
79573
+ this.Canvas.beginPath();
79574
+ this.Canvas.moveTo(left,yStart);
79575
+ this.Canvas.lineTo(right,yStart);
79576
+
79577
+ this.Canvas.moveTo(left,yEnd);
79578
+ this.Canvas.lineTo(right,yEnd);
79579
+ this.Canvas.stroke();
79580
+
79581
+ this.Canvas.beginPath();
79582
+ this.Canvas.moveTo(ptStart.X,yStart);
79583
+ this.Canvas.lineTo(ptStart.X,yEnd);
79584
+ this.Canvas.stroke();
79585
+ }
79586
+ else
79587
+ {
79588
+ var top=this.ChartBorder.GetTopEx();
79589
+ var bottom=this.ChartBorder.GetBottomEx();
79590
+
79591
+ var xValue=Math.round(this.Frame.GetXData(ptStart.X,false))+data.DataOffset;
79592
+ if (xValue<0) xValue=0;
79593
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79594
+ var xStart=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79595
+
79596
+ xValue=Math.round(this.Frame.GetXData(ptEnd.X,false))+data.DataOffset;
79597
+ if (xValue<0) xValue=0;
79598
+ else if (xValue>=data.Data.length) xValue=data.Data.length-1;
79599
+ var xEnd=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);
79600
+
79601
+ this.Canvas.beginPath();
79602
+ this.Canvas.moveTo(xStart,top);
79603
+ this.Canvas.lineTo(xStart,bottom);
79604
+
79605
+ this.Canvas.moveTo(xEnd,top);
79606
+ this.Canvas.lineTo(xEnd,bottom);
79607
+ this.Canvas.stroke();
79608
+
79609
+ this.Canvas.beginPath();
79610
+ this.Canvas.moveTo(xStart,ptStart.Y);
79611
+ this.Canvas.lineTo(xEnd,ptStart.Y);
79612
+ this.Canvas.stroke();
79613
+ }
79614
+ }
79615
+
79616
+ this.GetCursorType=function(ptIndex)
79617
+ {
79618
+ if (ptIndex==100) return "pointer";
79619
+ else if (ptIndex==0) return "move";
79620
+ else if (ptIndex==1) return "ew-resize";
79621
+ else if (ptIndex==2 || ptIndex==3) return "ns-resize";
79622
+
79623
+ return null;
79624
+ }
79625
+
79626
+ this.DrawArea=function(drawPoint)
79627
+ {
79628
+ var ptCenter=drawPoint[0];
79629
+ var ptRight=drawPoint[1]
79630
+ var ptTop=drawPoint[2];
79631
+ var ptBottom=drawPoint[3];
79632
+ var bSelected=this.IsSelected();
79633
+
79634
+ var rtTopArea={ Left:ptCenter.X, Top: ptTop.Y, Right:ptRight.X, Bottom:ptCenter.Y};
79635
+ rtTopArea.Width=rtTopArea.Right-rtTopArea.Left;
79636
+ rtTopArea.Height=rtTopArea.Bottom-rtTopArea.Top;
79637
+
79638
+ this.Canvas.fillStyle=bSelected ? this.TopAreaConfig.SelectedAreaColor: this.TopAreaConfig.AreaColor;
79639
+ this.Canvas.beginPath();
79640
+ this.Canvas.fillRect(rtTopArea.Left,rtTopArea.Top,rtTopArea.Width,rtTopArea.Height);
79641
+ this.AryRectArea[0]={ ID:100, Rect:rtTopArea };
79642
+
79643
+ var rtBottomArea={Left:ptCenter.X, Top: ptCenter.Y, Right:ptRight.X, Bottom:ptBottom.Y};
79644
+ rtBottomArea.Width=rtBottomArea.Right-rtBottomArea.Left;
79645
+ rtBottomArea.Height=rtBottomArea.Bottom-rtBottomArea.Top;
79646
+ this.Canvas.fillStyle=bSelected? this.BottomAreaConfig.SelectedAreaColor:this.BottomAreaConfig.AreaColor;
79647
+ this.Canvas.beginPath();
79648
+ this.Canvas.fillRect(rtBottomArea.Left,rtBottomArea.Top,rtBottomArea.Width,rtBottomArea.Height);
79649
+ this.AryRectArea[1]={ ID:100, Rect:rtBottomArea };
79650
+
79651
+ //线段
79652
+ this.Canvas.strokeStyle=this.LineColor;
79653
+ this.Canvas.beginPath();
79654
+ this.Canvas.moveTo(ptCenter.X,ToFixedPoint(ptCenter.Y));
79655
+ this.Canvas.lineTo(ptRight.X,ToFixedPoint(ptRight.Y));
79656
+ this.Canvas.stroke();
79657
+ }
79658
+
79659
+ this.DrawLabel=function(drawPoint)
79660
+ {
79661
+ if (!this.IsActive()) return; //激活状态下才显示
79662
+
79663
+ var aryLabel=this.FormatLabelText(drawPoint);
79664
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryLabel)) return;
79665
+
79666
+ this.TextFontHeight=this.GetFontHeight(this.LabelConfig.Font,"擎");
79667
+
79668
+ for(var i=0;i<aryLabel.length;++i)
79669
+ {
79670
+ var item=aryLabel[i];
79671
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AryText)) continue;
79672
+
79673
+ this.CalculateLabelSize(item);
79674
+ this.DrawLabelItem(item, drawPoint);
79675
+ }
79676
+ }
79677
+
79678
+ this.DrawLabelItem=function(lableItem, drawPoint)
79679
+ {
79680
+ var ptCenter=drawPoint[0];
79681
+ var ptRight=drawPoint[1];
79682
+ var ptTop=drawPoint[2];
79683
+ var ptBottom=drawPoint[3];
79684
+ var clientWidth=ptRight.X-ptCenter.X;
79685
+ var config=this.LabelConfig;
79686
+ var margin=config.Margin;
79687
+
79688
+ var rtText={ Width:lableItem.Width+margin.Left+margin.Right, Height:lableItem.Height+margin.Top+margin.Bottom };
79689
+ if (lableItem.Type==0) //中间
79690
+ {
79691
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79692
+ rtText.Right=rtText.Left+rtText.Width;
79693
+ rtText.Top=ptCenter.Y-rtText.Height/2;
79694
+ rtText.Bottom=rtText.Top+rtText.Height;
79695
+ }
79696
+ else if (lableItem.Type==1) //顶部
79697
+ {
79698
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79699
+ rtText.Right=rtText.Left+rtText.Width;
79700
+ rtText.Top=ptTop.Y-rtText.Height;
79701
+ rtText.Bottom=rtText.Top+rtText.Height;
79702
+ }
79703
+ else if (lableItem.Type==2)
79704
+ {
79705
+ rtText.Left=ptCenter.X+clientWidth/2-rtText.Width/2;
79706
+ rtText.Right=rtText.Left+rtText.Width;
79707
+ rtText.Top=ptBottom.Y;
79708
+ rtText.Bottom=rtText.Top+rtText.Height;
79709
+ }
79710
+ else
79711
+ {
79712
+ return;
79713
+ }
79714
+
79715
+ this.Canvas.fillStyle=lableItem.BGColor;
79716
+ this.Canvas.fillRect(rtText.Left, rtText.Top, rtText.Width, rtText.Height);
79717
+
79718
+ this.Canvas.textAlign = 'left';
79719
+ this.Canvas.textBaseline = 'bottom';
79720
+ this.Canvas.fillStyle=lableItem.TextColor;
79721
+ var x=rtText.Left+margin.Left;
79722
+ var y=rtText.Top+margin.Top+this.TextFontHeight;
79723
+ for(var i=0;i<lableItem.AryText.length;++i)
79724
+ {
79725
+ var item=lableItem.AryText[i];
79726
+ var xText=x;
79727
+ var yText=y;
79728
+ if (IFrameSplitOperator.IsNumber(item.YOffset)) yText+=item.YOffset;
79729
+
79730
+ this.Canvas.fillText(item.Text, xText, yText);
79731
+
79732
+ y+=this.TextFontHeight;
79733
+ }
79734
+ }
79735
+
79736
+ this.FormatLabelText=function(drawPoint)
79737
+ {
79738
+ if (this.HQChart)
79739
+ {
79740
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_TVLONGPOSITION_LABEL);
79741
+ if (event && event.Callback)
79742
+ {
79743
+ var sendData={ Frame:this.Frame, AryLabel:null, AryPoint:drawPoint, PreventDefault:false };
79744
+ event.Callback(event, sendData, this);
79745
+ if (sendData.PreventDefault) return sendData.AryLabel;
79746
+ }
79747
+ }
79748
+
79749
+ var ptCenter=drawPoint[0];
79750
+ var ptTop=drawPoint[2];
79751
+ var ptBottom=drawPoint[3];
79752
+ var aryData=[];
79753
+ var yValue=this.Frame.GetYData(ptCenter.Y,false);
79754
+ aryData.push(
79755
+ {
79756
+ Type:0,
79757
+ AryText:
79758
+ [
79759
+ { Text:`Open: ${yValue.toFixed(2)}`},
79760
+ //{ Text:"第2行:xxx"}
79761
+ ],
79762
+ BGColor:"rgb(112,128,144)", TextColor:"rgb(255,255,255)"
79763
+ });
79764
+
79765
+ var yValue=this.Frame.GetYData(ptTop.Y,false);
79766
+ aryData.push({ Type:1, AryText:[{ Text:`Target: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.TopAreaConfig.TextBGColor, TextColor:this.TopAreaConfig.TextColor });
79767
+
79768
+ var yValue=this.Frame.GetYData(ptBottom.Y,false);
79769
+ aryData.push({ Type:2, AryText:[{ Text:`Stop: ${yValue.toFixed(2)}`, YOffset:-1 } ], BGColor:this.BottomAreaConfig.TextBGColor, TextColor:this.BottomAreaConfig.TextColor });
79770
+
79771
+ return aryData;
79772
+ }
79773
+
79774
+ this.CalculateLabelSize=function(lableItem)
79775
+ {
79776
+ lableItem.Width=0;
79777
+ lableItem.Height=0;
79778
+ for(var i=0;i<lableItem.AryText.length;++i)
79779
+ {
79780
+ var item=lableItem.AryText[i];
79781
+ var textWidth=this.Canvas.measureText(item.Text).width;
79782
+
79783
+ item.TextWidth=textWidth;
79784
+ if (lableItem.Width<textWidth) lableItem.Width=textWidth;
79785
+ lableItem.Height+=this.TextFontHeight;
79786
+ }
79787
+ }
79788
+
79789
+ this.Move=function(xStep,yStep)
79790
+ {
79791
+ if (this.Status!=20) return false;
79792
+ if (!this.Frame) return false;
79793
+ var data=this.Frame.Data;
79794
+ if (!data) return false;
79795
+
79796
+ if (this.MovePointIndex==100) //整体移动
79797
+ {
79798
+ for(var i=0; i<this.Point.length;++i)
79799
+ {
79800
+ var item= this.Point[i];
79801
+ item.X+=xStep;
79802
+ item.Y+=yStep;
79803
+ }
79804
+ }
79805
+ else if (this.MovePointIndex===0)
79806
+ {
79807
+ for(var i=0;i<this.Point.length;++i)
79808
+ {
79809
+ var item=this.Point[i];
79810
+ if (i==0)
79811
+ {
79812
+ item.X+=xStep;
79813
+ item.Y+=yStep;
79814
+ }
79815
+ else if (i==1)
79816
+ {
79817
+ item.Y+=yStep;
79818
+ }
79819
+ else if (i==2 || i==3)
79820
+ {
79821
+ item.X+=xStep;
79822
+ }
79823
+ }
79824
+ }
79825
+ else if (this.MovePointIndex==1)
79826
+ {
79827
+ this.Point[1].X+=xStep;
79828
+ }
79829
+ else if (this.MovePointIndex==2)
79830
+ {
79831
+ var ptCenter=this.Point[0];
79832
+ var item=this.Point[2];
79833
+ if (item.Y+yStep<ptCenter.Y) item.Y+=yStep;
79834
+ }
79835
+ else if (this.MovePointIndex==3)
79836
+ {
79837
+ var ptCenter=this.Point[0];
79838
+ var item=this.Point[3];
79839
+ if (item.Y+yStep>ptCenter.Y) item.Y+=yStep;
79840
+ }
79841
+
79842
+ }
79843
+ }
79844
+
79845
+
79846
+ function ChartDrawTVShortPosition()
79847
+ {
79848
+ this.newMethod=ChartDrawTVLongPosition; //派生
79849
+ this.newMethod();
79850
+ delete this.newMethod;
79851
+
79852
+ this.ClassName='ChartDrawTVShortPosition';
79853
+ this.TopAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.BottomArea);
79854
+ this.BottomAreaConfig=CloneData(g_JSChartResource.ChartDrawTVLongPosition.TopArea);
79855
+ }
79856
+
79336
79857
 
79337
79858
  function ChartDrawStorage()
79338
79859
  {
@@ -80402,6 +80923,31 @@ function JSChartResource()
80402
80923
  DownColor:"rgb(25,158,0)"
80403
80924
  }
80404
80925
 
80926
+ this.ChartDrawTVLongPosition=
80927
+ {
80928
+ TopArea:
80929
+ {
80930
+ AreaColor:"rgba(214, 234, 230,0.8)",
80931
+ SelectedAreaColor:"rgba(214, 234, 230,0.55)",
80932
+ TextBGColor:"rgb(80, 150, 130)",
80933
+ TextColor:"rgb(255,255,255)"
80934
+ },
80935
+
80936
+ BottomArea:
80937
+ {
80938
+ AreaColor:"rgb(243, 217, 218,0.8)",
80939
+ SelectedAreaColor:"rgba(243, 217, 218,0.55)",
80940
+ TextBGColor:"rgb(214, 75, 75)",
80941
+ TextColor:"rgb(255,255,255)"
80942
+ },
80943
+
80944
+ Label:
80945
+ {
80946
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
80947
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
80948
+ }
80949
+ }
80950
+
80405
80951
  //手机端tooltip
80406
80952
  this.TooltipPaint = {
80407
80953
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -82229,6 +82775,42 @@ function JSChartResource()
82229
82775
 
82230
82776
  if (style.IndexLock) this.SetIndexLock(style.IndexLock);
82231
82777
  if (style.ChartScatterPlotV2) this.SetChartScatterPlotV2(style.ChartScatterPlotV2);
82778
+
82779
+ if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
82780
+ }
82781
+
82782
+
82783
+ this.SetChartDrawTVLongPosition=function(style)
82784
+ {
82785
+ if (style.TopArea)
82786
+ {
82787
+ var item=style.TopArea;
82788
+ var dest=this.ChartDrawTVLongPosition.TopArea;
82789
+
82790
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
82791
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
82792
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
82793
+ if (item.TextColor) dest.BorderColor=item.TextColor;
82794
+ }
82795
+
82796
+ if (style.BottomArea)
82797
+ {
82798
+ var item=style.BottomArea;
82799
+ var dest=this.ChartDrawTVLongPosition.BottomArea;
82800
+
82801
+ if (item.AreaColor) dest.AreaColor=item.AreaColor;
82802
+ if (item.SelectedAreaColor) dest.SelectedAreaColor=item.SelectedAreaColor;
82803
+ if (item.TextBGColor) dest.TextBGColor=item.TextBGColor;
82804
+ if (item.TextColor) dest.BorderColor=item.TextColor;
82805
+ }
82806
+
82807
+ if (style.Label)
82808
+ {
82809
+ var item=style.Label;
82810
+ var dest=this.ChartDrawTVLongPosition.Label;
82811
+ if (item.Font) dest.Font=item.Font;
82812
+ CopyMarginConfig(dest.Margin, item.Margin);
82813
+ }
82232
82814
  }
82233
82815
 
82234
82816
 
@@ -88033,8 +88615,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
88033
88615
 
88034
88616
  //清空东条标题
88035
88617
  var titleIndex=windowIndex+1;
88036
- this.TitlePaint[titleIndex].Data=[];
88037
- this.TitlePaint[titleIndex].Title=null;
88618
+ var chartTitle=this.TitlePaint[titleIndex];
88619
+ if (chartTitle) chartTitle.Clear({ DynamicTitle:true });
88038
88620
  }
88039
88621
 
88040
88622
  //显示隐藏主图K线
@@ -88297,6 +88879,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
88297
88879
  if (windowIndex == 0) windowIndex = 1; //幅图指标,不能再主图显示
88298
88880
  }
88299
88881
 
88882
+ if (this.Frame.SubFrame.length<=windowIndex) return;
88883
+
88300
88884
  JSIndexScript.ModifyAttribute(indexInfo, option);
88301
88885
  return this.ChangeScriptIndex(windowIndex, indexInfo, option);
88302
88886
  }
@@ -88329,8 +88913,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
88329
88913
 
88330
88914
  //清空东条标题
88331
88915
  var titleIndex=windowIndex+1;
88332
- this.TitlePaint[titleIndex].Data=[];
88333
- this.TitlePaint[titleIndex].Title=null;
88916
+ var chartTitle=this.TitlePaint[titleIndex];
88917
+ chartTitle.Clear({ DynamicTitle:true });
88334
88918
 
88335
88919
  this.WindowIndex[windowIndex]=indexItem.Create(option);
88336
88920
  this.CreateWindowIndex(windowIndex);
@@ -89983,7 +90567,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89983
90567
  if (item)
89984
90568
  {
89985
90569
  drawPicture=item.Create();
89986
- if (drawPicture.ClassName=='ChartDrawPictureText' || drawPicture.ClassName=="ChartDrawVolProfile") drawPicture.HQChart=this;
90570
+ drawPicture.HQChart=this;
89987
90571
  }
89988
90572
 
89989
90573
  if (!drawPicture) //iconfont图标
@@ -107946,6 +108530,15 @@ Path2DHelper.FormatRadian=function(angle)
107946
108530
  }
107947
108531
 
107948
108532
 
108533
+ Path2DHelper.PtInRect=function(x, y, rect)
108534
+ {
108535
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
108536
+
108537
+ return false;
108538
+ }
108539
+
108540
+
108541
+
107949
108542
 
107950
108543
 
107951
108544
 
@@ -135333,6 +135926,31 @@ function GetBlackStyle()
135333
135926
 
135334
135927
  Text:{ Color: "rgb(0,0,0)" , Family:'Arial', FontMaxSize:18, FontMinSize:6 }, //文字
135335
135928
  },
135929
+
135930
+ ChartDrawTVLongPosition:
135931
+ {
135932
+ TopArea:
135933
+ {
135934
+ AreaColor:"rgba(34, 52, 48,0.8)",
135935
+ SelectedAreaColor:"rgba(34, 52, 48,0.55)",
135936
+ TextBGColor:"rgb(80, 150, 130)",
135937
+ TextColor:"rgb(255,255,255)"
135938
+ },
135939
+
135940
+ BottomArea:
135941
+ {
135942
+ AreaColor:"rgb(63, 35, 37,0.8)",
135943
+ SelectedAreaColor:"rgba(63, 35, 37,0.55)",
135944
+ TextBGColor:"rgb(214, 75, 75)",
135945
+ TextColor:"rgb(255,255,255)"
135946
+ },
135947
+
135948
+ Label:
135949
+ {
135950
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
135951
+ Margin:{ Left:2, Top:2, Bottom:2, Right:2 },
135952
+ }
135953
+ },
135336
135954
 
135337
135955
  //区间选择
135338
135956
  RectSelect:
@@ -151525,7 +152143,7 @@ function ScrollBarBGChart()
151525
152143
 
151526
152144
 
151527
152145
 
151528
- var HQCHART_VERSION="1.1.14961";
152146
+ var HQCHART_VERSION="1.1.14970";
151529
152147
 
151530
152148
  function PrintHQChartVersion()
151531
152149
  {