hqchart 1.1.13330 → 1.1.13339

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.
@@ -4041,7 +4041,11 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4041
4041
  return item;
4042
4042
  }
4043
4043
 
4044
- this.OnSize=function(option) //{ Type:1 新版本OnSize Redraw:是否重绘, XYSplit:是否重新计算分割线 }
4044
+ /*
4045
+ { Type: 1=K线柱子宽度不变 2=K线全部显示
4046
+ Redraw:是否重绘, XYSplit:是否重新计算分割线 }
4047
+ */
4048
+ this.OnSize=function(option)
4045
4049
  {
4046
4050
  //画布大小通过div获取 如果有style里的大小 使用style里的
4047
4051
  if (this.DivElement.style.height && this.DivElement.style.width)
@@ -4102,10 +4106,14 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4102
4106
  {
4103
4107
  if (option && option.XYSplit===true) this.JSChartContainer.ResetFrameXYSplit();
4104
4108
 
4105
- if (this.JSChartContainer.OnSize && option && option.Type==1)
4109
+ if (this.JSChartContainer.OnSize && option && option.Type==1) //K线宽度不变
4106
4110
  {
4107
4111
  this.JSChartContainer.OnSize();
4108
4112
  }
4113
+ else if (this.JSChartContainer.ShowAllKLine && option && option.Type==2)
4114
+ {
4115
+ this.JSChartContainer.ShowAllKLine();
4116
+ }
4109
4117
  else
4110
4118
  {
4111
4119
  if (this.JSChartContainer.Frame) this.JSChartContainer.Frame.SetSizeChage(true);
@@ -13687,6 +13695,16 @@ function IsRecvOverlap(rect1, rect2)
13687
13695
  return Math.max(rect1.Left,rect2.Left) < Math.min(rect1.Right,rect2.Right) && Math.max(rect1.Top,rect2.Top) < Math.min(rect1.Bottom,rect2.Bottom);
13688
13696
  }
13689
13697
 
13698
+ function CopyMerginConfig(dest,src)
13699
+ {
13700
+ if (!src || !dest) return;
13701
+
13702
+ if (IFrameSplitOperator.IsNumber(src.Left)) dest.Left=src.Left;
13703
+ if (IFrameSplitOperator.IsNumber(src.Top)) dest.Top=src.Top;
13704
+ if (IFrameSplitOperator.IsNumber(src.Right)) dest.Right=src.Right;
13705
+ if (IFrameSplitOperator.IsNumber(src.Bottom)) dest.Bottom=src.Bottom;
13706
+ }
13707
+
13690
13708
 
13691
13709
  function Point()
13692
13710
  {
@@ -15721,6 +15739,7 @@ function AverageWidthFrame()
15721
15739
  {
15722
15740
  var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);
15723
15741
  if (ChartData.IsMinutePeriod(option.Period)) text+=" " + IFrameSplitOperator.FormatTimeString(kItem.Time, "HH:MM");
15742
+ else if (ChartData.IsMilliSecondPeriod(option.Period)) text+=" " + IFrameSplitOperator.FormatTimeString(kItem.Time, "HH:MM:SS.fff");
15724
15743
  var textWidth=this.Canvas.measureText(text).width+2;
15725
15744
 
15726
15745
  var textLeft=item.X-textWidth/2;
@@ -58338,7 +58357,7 @@ function IChartDrawPicture()
58338
58357
  var isHScreen=this.Frame.IsHScreen;
58339
58358
  if (isHScreen)
58340
58359
  {
58341
- for(var i in this.Point)
58360
+ for(var i=0; i<this.Point.length; ++i)
58342
58361
  {
58343
58362
  var item=this.Point[i];
58344
58363
  var xValue=parseInt(this.Frame.GetXData(item.Y,false))+data.DataOffset;
@@ -58354,7 +58373,7 @@ function IChartDrawPicture()
58354
58373
  }
58355
58374
  else
58356
58375
  {
58357
- for(var i in this.Point)
58376
+ for(var i=0; i<this.Point.length; ++i)
58358
58377
  {
58359
58378
  var item=this.Point[i];
58360
58379
  var xValue=parseInt(this.Frame.GetXData(item.X,false))+data.DataOffset;
@@ -59449,6 +59468,79 @@ function IChartDrawPicture()
59449
59468
  //复制
59450
59469
  //this.CopyData=function() { }
59451
59470
  //this.PtInButtons=function(x, y) { }
59471
+
59472
+
59473
+ //计算标签页大小
59474
+ this.CalculateLabelSize=function(labelInfo)
59475
+ {
59476
+ var config=labelInfo.Config;
59477
+ this.Canvas.font=config.Font;
59478
+ this.Canvas.textAlign="left";
59479
+ this.Canvas.textBaseline="top";
59480
+ var lineHeight=this.Canvas.measureText("擎").width+2;
59481
+
59482
+ var maxWidth=0, lineCount=0, labelHeight=config.Mergin.Top+config.Mergin.Bottom;
59483
+ for(var i=0;i<labelInfo.AryText.length;++i)
59484
+ {
59485
+ if (i>0) labelHeight+=config.LineSpace;
59486
+
59487
+ var item=labelInfo.AryText[i];
59488
+ item.NameWidth=0;
59489
+ item.TextWidth=0;
59490
+ if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
59491
+ if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
59492
+
59493
+ var itemWidth=item.NameWidth+item.TextWidth;
59494
+ if (maxWidth<itemWidth) maxWidth=itemWidth;
59495
+ ++lineCount;
59496
+
59497
+ labelHeight+=lineHeight;
59498
+ }
59499
+
59500
+ var labelWidth=maxWidth+config.Mergin.Left+config.Mergin.Right;
59501
+
59502
+ labelInfo.Width=labelWidth;
59503
+ labelInfo.Height=labelHeight;
59504
+ labelInfo.LineHeight=lineHeight;
59505
+ }
59506
+
59507
+ this.DrawDefaultLabel=function(labelInfo, rtBG)
59508
+ {
59509
+ var config=labelInfo.Config;
59510
+
59511
+ if (config.BGColor)
59512
+ {
59513
+ this.Canvas.fillStyle=config.BGColor
59514
+ this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
59515
+ }
59516
+
59517
+ var xText=rtBG.Left+config.Mergin.Left;
59518
+ var yText=rtBG.Top+config.Mergin.Top;
59519
+ for(var i=0;i<labelInfo.AryText.length;++i)
59520
+ {
59521
+ var item=labelInfo.AryText[i];
59522
+
59523
+ if (i>0) yText+=config.LineSpace;
59524
+
59525
+ if (item.Name)
59526
+ {
59527
+ this.Canvas.fillStyle=item.NameColor;
59528
+ this.Canvas.fillText(item.Name,xText,yText);
59529
+ }
59530
+
59531
+ if (item.Text)
59532
+ {
59533
+ var xOut=xText+item.NameWidth;
59534
+ if (config.TextAlign==1) //右对齐
59535
+ xOut=rtBG.Right-config.Mergin.Right-item.TextWidth;
59536
+
59537
+ this.Canvas.fillStyle=item.TextColor;
59538
+ this.Canvas.fillText(item.Text,xOut ,yText);
59539
+ }
59540
+
59541
+ yText+=labelInfo.LineHeight;
59542
+ }
59543
+ }
59452
59544
  }
59453
59545
 
59454
59546
  IChartDrawPicture.ColorToRGBA=function(color,opacity)
@@ -59587,7 +59679,8 @@ IChartDrawPicture.ArrayDrawPricture=
59587
59679
  { Name:"FibRetracement", ClassName:"ChartFibRetracement", Create:function() { return new ChartFibRetracement(); }}, //斐波那契回测
59588
59680
  { Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
59589
59681
  { Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
59590
- { Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }}
59682
+ { Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
59683
+ { Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
59591
59684
  ];
59592
59685
 
59593
59686
  IChartDrawPicture.MapIonFont=new Map(
@@ -64450,9 +64543,33 @@ function ChartDrawMonitorLine()
64450
64543
  this.LabelConfig=
64451
64544
  {
64452
64545
  Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
64453
- BGColor:"rgb(30,144,255)", YTextOffset:4,
64546
+ BGColor:"rgb(30,144,255)",
64454
64547
  LineColor:"rgba(255,215,0,0.8)",
64455
64548
  LineDash:[3,5],
64549
+
64550
+ Mergin:{ Left:5, Right:5, Top:5, Bottom:4 },
64551
+ LineSpace:5, //行间距
64552
+ TextAlign:1, //对齐方式 0=left 1=right
64553
+ }
64554
+
64555
+ this.PointToValue_Backup=this.PointToValue;
64556
+
64557
+ this.PointToValue=function()
64558
+ {
64559
+ if (!this.PointToValue_Backup()) return false;
64560
+
64561
+ if (this.Frame.IsKLineFrame(false))
64562
+ {
64563
+ if (this.Frame.Identify===0)
64564
+ {
64565
+ var dataIndex=this.Value[0].XValue;
64566
+ var data=this.Frame.Data;
64567
+ var kItem=data.Data[dataIndex];
64568
+ this.Value[0].YValue=kItem.Close; //使用收盘价
64569
+ }
64570
+ }
64571
+
64572
+ return true;
64456
64573
  }
64457
64574
 
64458
64575
  this.SetOption=function(option)
@@ -64466,7 +64583,9 @@ function ChartDrawMonitorLine()
64466
64583
  if (item.BGColor) dest.BGColor=item.BGColor;
64467
64584
  if (item.LineColor) dest.LineColor=item.LineColor;
64468
64585
  if (item.LineDash) dest.LineDash=item.LineDash;
64469
- if (IFrameSplitOperator.IsNumber(item.YTextOffset)) dest.YTextOffset=item.YTextOffset;
64586
+ if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
64587
+ if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
64588
+ if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
64470
64589
  }
64471
64590
 
64472
64591
  if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
@@ -64580,6 +64699,7 @@ function ChartDrawMonitorLine()
64580
64699
  this.DrawLabel=function(labelInfo)
64581
64700
  {
64582
64701
  if (!this.FormatLabelTextCallback) return;
64702
+ labelInfo.Config=this.LabelConfig;
64583
64703
  this.FormatLabelTextCallback(labelInfo);
64584
64704
  if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
64585
64705
  if (!IFrameSplitOperator.IsNumber(labelInfo.YValue)) return;
@@ -64596,54 +64716,14 @@ function ChartDrawMonitorLine()
64596
64716
  ]
64597
64717
  */
64598
64718
 
64599
- var y=this.Frame.GetYFromData(labelInfo.YValue,false);
64600
- this.Canvas.font=this.LabelConfig.Font;
64601
- this.Canvas.textAlign="left";
64602
- this.Canvas.textBaseline="top";
64603
- var lineHeight=this.Canvas.measureText("擎").width+2;
64604
- var maxWidth=0, lineCount=0;
64605
- for(var i=0;i<labelInfo.AryText.length;++i)
64606
- {
64607
- var item=labelInfo.AryText[i];
64608
- item.NameWidth=0;
64609
- item.TextWidth=0;
64610
- if (item.Name) item.NameWidth=this.Canvas.measureText(item.Name).width+2;
64611
- if (item.Text) item.TextWidth=this.Canvas.measureText(item.Text).width+2;
64612
-
64613
- var itemWidth=item.NameWidth+item.TextWidth;
64614
- if (maxWidth<itemWidth) maxWidth=itemWidth;
64615
- ++lineCount;
64616
- }
64719
+ this.CalculateLabelSize(labelInfo);
64617
64720
 
64618
- var rtBG={ Left:labelInfo.Left+1, Top:y, Width:maxWidth+4, Height:lineHeight*lineCount+4 };
64721
+ var y=this.Frame.GetYFromData(labelInfo.YValue,false);
64722
+ var rtBG={ Left:labelInfo.Left+1, Top:y, Width:labelInfo.Width, Height:labelInfo.Height };
64619
64723
  rtBG.Right=rtBG.Left+rtBG.Width;
64620
64724
  rtBG.Bottom=rtBG.Top+rtBG.Height;
64621
- if (this.LabelConfig.BGColor)
64622
- {
64623
- this.Canvas.fillStyle=this.LabelConfig.BGColor
64624
- this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
64625
- }
64626
-
64627
- var xText=rtBG.Left+2;
64628
- var yText=rtBG.Top+this.LabelConfig.YTextOffset;
64629
- for(var i=0;i<labelInfo.AryText.length;++i)
64630
- {
64631
- var item=labelInfo.AryText[i];
64632
-
64633
- if (item.Name)
64634
- {
64635
- this.Canvas.fillStyle=item.NameColor;
64636
- this.Canvas.fillText(item.Name,xText,yText);
64637
- }
64638
-
64639
- if (item.Text)
64640
- {
64641
- this.Canvas.fillStyle=item.TextColor;
64642
- this.Canvas.fillText(item.Text,xText+item.NameWidth ,yText);
64643
- }
64644
-
64645
- yText+=lineHeight;
64646
- }
64725
+
64726
+ this.DrawDefaultLabel(labelInfo, rtBG);
64647
64727
  }
64648
64728
  }
64649
64729
 
@@ -68465,6 +68545,139 @@ function ChartDateRange()
68465
68545
  }
68466
68546
  }
68467
68547
 
68548
+ //线段信息统计
68549
+ function ChartInfoLine()
68550
+ {
68551
+ this.newMethod=IChartDrawPicture; //派生
68552
+ this.newMethod();
68553
+ delete this.newMethod;
68554
+
68555
+ this.ClassName='ChartInfoLine';
68556
+ this.PointCount=2;
68557
+ this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
68558
+
68559
+ this.IsPointIn=this.IsPointIn_XYValue_Line;
68560
+ this.GetXYCoordinate=this.GetXYCoordinate_default;
68561
+ this.IsShowYCoordinate=false;
68562
+ this.CopyData=this.CopyData_default;
68563
+ this.OnlyMoveXIndex=true;
68564
+ this.IsSupportMagnet=true;
68565
+
68566
+ this.LabelConfig=
68567
+ {
68568
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
68569
+ BGColor:"rgba(135, 206 ,250,0.95)",
68570
+ Mergin:{ Left:10, Right:10, Top:10, Bottom:8 },
68571
+ LineSpace:5, //行间距
68572
+ TextAlign:1, //对齐方式 0=left 1=right
68573
+ }
68574
+
68575
+ this.FormatLabelTextCallback=null;
68576
+
68577
+ this.SetOption=function(option)
68578
+ {
68579
+ if (option.LineColor) this.LineColor=option.LineColor;
68580
+ if (option.Label)
68581
+ {
68582
+ var item=option.Label;
68583
+ var dest=this.LabelConfig
68584
+ if (item.Font) dest.Font=item.Font;
68585
+ if (item.BGColor) dest.BGColor=item.BGColor;
68586
+ if (IFrameSplitOperator.IsNumber(item.LineSpace)) dest.LineSpace=item.LineSpace;
68587
+ if (IFrameSplitOperator.IsNumber(item.TextAlign)) dest.TextAlign=item.TextAlign;
68588
+ if (item.Mergin) CopyMerginConfig(dest.Mergin, item.Mergin);
68589
+ }
68590
+
68591
+ if (option.FormatLabelTextCallback) this.FormatLabelTextCallback=option.FormatLabelTextCallback;
68592
+ }
68593
+
68594
+ this.Draw=function()
68595
+ {
68596
+ this.LinePoint=[];
68597
+ if (this.IsFrameMinSize()) return;
68598
+ if (!this.IsShow) return;
68599
+
68600
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:true, IsCheckY:false} );
68601
+ if (!drawPoint) return;
68602
+ if (drawPoint.length!=2) return;
68603
+
68604
+ this.ClipFrame();
68605
+
68606
+ var ptStart=drawPoint[0];
68607
+ var ptEnd=drawPoint[1];
68608
+
68609
+ this.SetLineWidth();
68610
+ this.Canvas.strokeStyle=this.LineColor;
68611
+ this.Canvas.beginPath();
68612
+ this.Canvas.moveTo(ptStart.X,ptStart.Y);
68613
+ this.Canvas.lineTo(ptEnd.X,ptEnd.Y);
68614
+ this.Canvas.stroke();
68615
+ this.RestoreLineWidth();
68616
+
68617
+ var line={Start:ptStart, End:ptEnd};
68618
+ this.LinePoint.push(line);
68619
+
68620
+ this.DrawPoint(drawPoint); //画点
68621
+
68622
+ var labelInfo={ };
68623
+ labelInfo.Config=this.LabelConfig;
68624
+ labelInfo.PtStart=ptStart;
68625
+ labelInfo.PtEnd=ptEnd;
68626
+
68627
+ this.DrawLabel(labelInfo);
68628
+
68629
+ this.Canvas.restore();
68630
+ }
68631
+
68632
+ this.DrawLabel=function(labelInfo)
68633
+ {
68634
+ if (!this.FormatLabelTextCallback) return;
68635
+
68636
+ labelInfo.AryPoint=this.Point;
68637
+ if (this.Status!=10)
68638
+ {
68639
+ labelInfo.AryValue=this.PointToKLine(this.Point);
68640
+ }
68641
+ else
68642
+ {
68643
+ labelInfo.AryValue=this.Value;
68644
+ }
68645
+
68646
+ labelInfo.Data=this.Frame.Data; //数据
68647
+
68648
+ this.FormatLabelTextCallback(labelInfo);
68649
+ if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryText)) return;
68650
+
68651
+ this.CalculateLabelSize(labelInfo);
68652
+
68653
+ var ptStart=labelInfo.PtStart;
68654
+ var ptEnd=labelInfo.PtEnd;
68655
+ if (ptStart.X>ptEnd.X)
68656
+ {
68657
+ ptStart=labelInfo.PtEnd;
68658
+ ptEnd=labelInfo.PtStart;
68659
+ }
68660
+
68661
+ var config=labelInfo.Config;
68662
+ var xCenter=labelInfo.PtStart.X+(labelInfo.PtEnd.X-labelInfo.PtStart.X)/2;
68663
+ var yCenter=labelInfo.PtStart.Y+(labelInfo.PtEnd.Y-labelInfo.PtStart.Y)/2;
68664
+ if (ptStart.Y<ptEnd.Y)
68665
+ {
68666
+ var rtBG={ Left:xCenter, Bottom:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
68667
+ rtBG.Right=rtBG.Left+rtBG.Width;
68668
+ rtBG.Top=rtBG.Bottom-rtBG.Height;
68669
+ }
68670
+ else
68671
+ {
68672
+ var rtBG={ Left:xCenter, Top:yCenter, Width:labelInfo.Width, Height:labelInfo.Height };
68673
+ rtBG.Right=rtBG.Left+rtBG.Width;
68674
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
68675
+ }
68676
+
68677
+ this.DrawDefaultLabel(labelInfo, rtBG);
68678
+ }
68679
+ }
68680
+
68468
68681
 
68469
68682
  function ChartDrawStorage()
68470
68683
  {
@@ -73193,6 +73406,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73193
73406
  }
73194
73407
  }
73195
73408
 
73409
+ this.ShowAllKLine=function()
73410
+ {
73411
+ var chart=this.ChartPaint[0];
73412
+ if (!chart) return false;
73413
+ var kData=chart.Data;
73414
+ if (!kData || !IFrameSplitOperator.IsNonEmptyArray(kData.Data)) return false;
73415
+
73416
+ var xCount=kData.Data.length+this.RightSpaceCount;
73417
+ for(var i=0;i<this.Frame.SubFrame.length;++i)
73418
+ {
73419
+ var item =this.Frame.SubFrame[i].Frame;
73420
+ item.XPointCount=xCount;
73421
+ }
73422
+
73423
+ kData.DataOffset=0;
73424
+ this.CursorIndex=0;
73425
+
73426
+ this.UpdataDataoffset(); //更新数据偏移
73427
+ this.UpdateFrameMaxMin(); //调整坐标最大 最小值
73428
+ this.Frame.SetSizeChage(true);
73429
+ this.UpdatePointByCursorIndex(2); //取消十字光标
73430
+ this.Draw();
73431
+ }
73432
+
73196
73433
  this.UpdateMainData=function(hisData, lastDataCount)
73197
73434
  {
73198
73435
  var frameHisdata=null;
@@ -135730,6 +135967,7 @@ function JSDialogDrawTool()
135730
135967
  AryChart:
135731
135968
  [
135732
135969
  { Title: '线段', ClassName: 'hqchart_drawtool icon-draw_line', Type:0, Data:{ ID:"线段" } },
135970
+ { Title: '线段信息', ClassName: 'hqchart_drawtool icon-infoline', Type:0, Data:{ ID:"InfoLine" } },
135733
135971
  { Title: '射线', ClassName: 'hqchart_drawtool icon-draw_rays', Type:0, Data:{ ID:"射线" } },
135734
135972
  { Title: '标价线', ClassName: 'hqchart_drawtool icon-price_line', Type:0, Data:{ ID:"标价线" } },
135735
135973
  { Title: '垂直线', ClassName: 'hqchart_drawtool icon-vertical_line', Type:0, Data:{ ID:"垂直线" } },
@@ -136156,6 +136394,9 @@ function JSDialogDrawTool()
136156
136394
 
136157
136395
  var name=data.Item.Data.ID;
136158
136396
  if (["icon-arrow_up","icon-arrow_down","icon-arrow_left", "icon-arrow_right"].includes(name)) option=null;
136397
+ else if (name=="InfoLine") option.FormatLabelTextCallback=(lableInfo)=>{ this.ChartInfoLine_FormatLabelText(lableInfo); }
136398
+ else if (name=="MonitorLine") option.FormatLabelTextCallback=(lableInfo)=>{ this.ChartDrawMonitorLine_FormatLabelText(lableInfo); }
136399
+
136159
136400
 
136160
136401
  this.HQChart.CreateChartDrawPicture(name, option, (chart)=>{ this.OnFinishDrawPicture(chart, data); });
136161
136402
  }
@@ -136233,6 +136474,60 @@ function JSDialogDrawTool()
136233
136474
  this.onmousemove = null;
136234
136475
  this.onmouseup = null;
136235
136476
  }
136477
+
136478
+ this.ChartInfoLine_FormatLabelText=function(labelInfo)
136479
+ {
136480
+ if (!IFrameSplitOperator.IsNonEmptyArray(labelInfo.AryValue)) return;
136481
+ if (!labelInfo.Data || !IFrameSplitOperator.IsNonEmptyArray(labelInfo.Data.Data)) return;
136482
+ for(var i=0;i<labelInfo.AryValue.length;++i)
136483
+ {
136484
+ var item=labelInfo.AryValue[i];
136485
+ if (!IFrameSplitOperator.IsNumber(item.XValue) || item.XValue<0) return;
136486
+ }
136487
+
136488
+ var startIndex=labelInfo.AryValue[0].XValue;
136489
+ var endIndex=labelInfo.AryValue[1].XValue;
136490
+ var startItem=labelInfo.Data.Data[startIndex];
136491
+ var endItem=labelInfo.Data.Data[endIndex];
136492
+ if (!startItem || !endItem) return;
136493
+
136494
+ var isMinutePeriod=ChartData.IsMinutePeriod(labelInfo.Data.Period, true);
136495
+ labelInfo.AryText=[];
136496
+ labelInfo.AryText.push({ Name:"起始日期: ", Text:IFrameSplitOperator.FormatDateString(startItem.Date), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136497
+ if (isMinutePeriod) labelInfo.AryText.push({ Name:"起始时间: ", Text:IFrameSplitOperator.FormatTimeString(startItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136498
+
136499
+ labelInfo.AryText.push({ Name:"结束日期: ", Text:IFrameSplitOperator.FormatDateString(endItem.Date), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136500
+ if (isMinutePeriod) labelInfo.AryText.push({ Name:"结束时间: ", Text:IFrameSplitOperator.FormatTimeString(endItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136501
+
136502
+ //示例:计算一个斜率数据
136503
+ var x=labelInfo.AryPoint[1].X-labelInfo.AryPoint[0].X;
136504
+ var y=labelInfo.AryPoint[1].Y-labelInfo.AryPoint[0].Y;
136505
+ var text="--";
136506
+ if (x!=0) text=`${(y/x).toFixed(4)}`;
136507
+ labelInfo.AryText.push({ Name:"斜率: ", Text:text, NameColor:"rgb(0,0,0)", TextColor:"rgb(238, 0, 238)"});
136508
+ labelInfo.AryText.push({ Name:"其他: ", Text:'......', NameColor:"rgb(0,0,0)", TextColor:"rgb(156, 156, 156)"});
136509
+ }
136510
+
136511
+ this.ChartDrawMonitorLine_FormatLabelText=function(labelInfo)
136512
+ {
136513
+ if (!labelInfo.Data || !IFrameSplitOperator.IsNonEmptyArray(labelInfo.Data.Data)) return;
136514
+ if (!IFrameSplitOperator.IsNumber(labelInfo.StartIndex) || labelInfo.StartIndex<0) return;
136515
+
136516
+ var startItem=labelInfo.Data.Data[labelInfo.StartIndex];
136517
+ var endItem=labelInfo.Data.Data[labelInfo.Data.Data.length-1];
136518
+ labelInfo.YValue=endItem.Close;
136519
+ var isMinutePeriod=ChartData.IsMinutePeriod(labelInfo.Data.Period, true);
136520
+
136521
+ labelInfo.AryText=[];
136522
+ labelInfo.AryText.push({ Name:"起始: ", Text:IFrameSplitOperator.FormatDateString(startItem.Date,"MM-DD"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136523
+ if (isMinutePeriod) labelInfo.AryText.push({ Name:"起始: ", Text:IFrameSplitOperator.FormatTimeString(startItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136524
+
136525
+ labelInfo.AryText.push({ Name:"最新: ", Text:IFrameSplitOperator.FormatDateString(endItem.Date,"MM-DD"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136526
+ if (isMinutePeriod) labelInfo.AryText.push({ Name:"最新: ", Text:IFrameSplitOperator.FormatTimeString(endItem.Time, "HH:MM"), NameColor:"rgb(0,0,0)", TextColor:"rgb(30,10,30)" });
136527
+
136528
+ labelInfo.AryText.push({ Name:"ɑ: ", Text:"--.--", NameColor:"rgb(0, 0 ,255)", TextColor:"rgb(255, 165, 0)"});
136529
+ labelInfo.AryText.push({ Name:"β: ", Text:"--.--", NameColor:"rgb(0 ,0 ,255)", TextColor:"rgb(238 ,121, 66)"});
136530
+ }
136236
136531
  }
136237
136532
 
136238
136533
 
@@ -136425,8 +136720,18 @@ function JSDialogModifyDraw()
136425
136720
  {
136426
136721
  if (!this.ChartPicture || !this.HQChart) return;
136427
136722
 
136428
- var color=this.GetRandomColor(this.ChartPicture.TextColor, this.RandomFontColor);
136429
- this.ChartPicture.TextColor=color;
136723
+
136724
+ if (this.ChartPicture.ClassName=="ChartDrawNote")
136725
+ {
136726
+ var color=this.GetRandomColor(this.ChartPicture.NoteTextColor, this.RandomFontColor);
136727
+ this.ChartPicture.NoteTextColor=color;
136728
+ }
136729
+ else
136730
+ {
136731
+ var color=this.GetRandomColor(this.ChartPicture.TextColor, this.RandomFontColor);
136732
+ this.ChartPicture.TextColor=color;
136733
+ }
136734
+
136430
136735
 
136431
136736
  if (this.FontColorButton) this.FontColorButton.Span.style['color']=color;
136432
136737
 
@@ -136438,9 +136743,18 @@ function JSDialogModifyDraw()
136438
136743
  this.ModifyBGColor=function()
136439
136744
  {
136440
136745
  if (!this.ChartPicture || !this.HQChart) return;
136441
- var color=this.GetRandomColor(this.ChartPicture.BGColor, this.RandomBGColor);
136442
136746
 
136443
- this.ChartPicture.BGColor=color;
136747
+ if (this.ChartPicture.ClassName=="ChartDrawNote")
136748
+ {
136749
+ var color=this.GetRandomColor(this.ChartPicture.NoteBGColor, this.RandomBGColor);
136750
+ this.ChartPicture.NoteBGColor=color;
136751
+ }
136752
+ else
136753
+ {
136754
+ var color=this.GetRandomColor(this.ChartPicture.BGColor, this.RandomBGColor);
136755
+ this.ChartPicture.BGColor=color;
136756
+ }
136757
+
136444
136758
  if (this.BGColorButton) this.BGColorButton.Span.style['color']=color;
136445
136759
  if (this.HQChart.ChartDrawStorage) this.HQChart.ChartDrawStorage.SaveDrawData(this.ChartPicture); //保存下
136446
136760
 
@@ -136462,7 +136776,7 @@ function JSDialogModifyDraw()
136462
136776
 
136463
136777
  var bShowLineColor=true, bShowBGColor=false, bShowFontColor=false;
136464
136778
  var bgColor=null, fontColor=null;
136465
- var ARRAY_TEXT_CHART=['ChartDrawPriceLabel', "ChartDrawAnchoredText","ChartDrawPriceNote","ChartDrawNote"];
136779
+ var ARRAY_TEXT_CHART=['ChartDrawPriceLabel', "ChartDrawAnchoredText","ChartDrawPriceNote"];
136466
136780
  if (ARRAY_TEXT_CHART.includes(chart.ClassName))
136467
136781
  {
136468
136782
  bShowBGColor=true;
@@ -136470,6 +136784,13 @@ function JSDialogModifyDraw()
136470
136784
  bgColor=chart.BGColor;
136471
136785
  fontColor=chart.TextColor;
136472
136786
  }
136787
+ else if (chart.ClassName=="ChartDrawNote")
136788
+ {
136789
+ bShowBGColor=true;
136790
+ bShowFontColor=true;
136791
+ bgColor=chart.NoteBGColor;
136792
+ fontColor=chart.NoteTextColor;
136793
+ }
136473
136794
 
136474
136795
  if (this.ColorButton)
136475
136796
  {
@@ -136668,7 +136989,7 @@ function HQChartScriptWorker()
136668
136989
 
136669
136990
 
136670
136991
 
136671
- var HQCHART_VERSION="1.1.13329";
136992
+ var HQCHART_VERSION="1.1.13338";
136672
136993
 
136673
136994
  function PrintHQChartVersion()
136674
136995
  {