hqchart 1.1.13600 → 1.1.13614

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.
@@ -4617,7 +4617,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4617
4617
 
4618
4618
  if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
4619
4619
  else item.TitleHeight=chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;
4620
- if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) chart.Frame.SubFrame[i].Frame.IsShowTitleArrow=item.IsShowTitleArrow;
4620
+ if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) frame.IsShowTitleArrow=item.IsShowTitleArrow;
4621
+ if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) frame.TitleArrowType=item.TitleArrowType;
4621
4622
  if (item.IsShowIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;
4622
4623
  if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
4623
4624
  if (IFrameSplitOperator.IsNumber(item.IndexParamSpace)) chart.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;
@@ -5086,7 +5087,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5086
5087
  if (IFrameSplitOperator.IsBool(item.IsDrawTitleBG)) chart.Frame.SubFrame[index].Frame.IsDrawTitleBG=item.IsDrawTitleBG;
5087
5088
  if (IFrameSplitOperator.IsBool(item.IsShowNameArrow)) chart.Frame.SubFrame[index].Frame.IsShowNameArrow=item.IsShowNameArrow;
5088
5089
 
5089
- if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) chart.Frame.SubFrame[index].Frame.IsShowTitleArrow=item.IsShowTitleArrow;
5090
+ if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) frame.IsShowTitleArrow=item.IsShowTitleArrow;
5091
+ if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) frame.TitleArrowType=item.TitleArrowType;
5090
5092
  if (item.IsShowIndexName==false) chart.Frame.SubFrame[index].Frame.IsShowIndexName=false;
5091
5093
  if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[index].Frame.IsShowOverlayIndexName=false;
5092
5094
  if (!IFrameSplitOperator.IsUndefined(item.HorizontalReserved)) frame.HorizontalReserved=item.HorizontalReserved;
@@ -5497,7 +5499,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5497
5499
  if (IFrameSplitOperator.IsBool(item.IsShowNameArrow)) chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;
5498
5500
 
5499
5501
  if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
5500
-
5501
5502
  if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) chart.Frame.SubFrame[i].Frame.IsShowTitleArrow=item.IsShowTitleArrow;
5502
5503
  if (item.IsShowIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;
5503
5504
  if (item.IsShowOverlayIndexName==false) chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
@@ -11026,6 +11027,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11026
11027
  if (!subItem || !subItem.Frame) continue;
11027
11028
 
11028
11029
  var frame=subItem.Frame;
11030
+
11031
+ //自定义刻度每次都调用
11032
+ frame.YCustomSplit=true;
11033
+
11029
11034
  var key=frame.Identify;
11030
11035
  var item=
11031
11036
  {
@@ -12317,6 +12322,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12317
12322
  else windowItem.TitleHeight=frame.ChartBorder.TitleHeight;
12318
12323
 
12319
12324
  if (IFrameSplitOperator.IsBool(windowItem.IsShowTitleArrow)) frame.IsShowTitleArrow=windowItem.IsShowTitleArrow;
12325
+ if (IFrameSplitOperator.IsNumber(windowItem.TitleArrowType)) frame.TitleArrowType=windowItem.TitleArrowType;
12320
12326
  if (IFrameSplitOperator.IsBool(windowItem.IsShowIndexName)) frame.IsShowIndexName=windowItem.IsShowIndexName;
12321
12327
  if (IFrameSplitOperator.IsNumber(windowItem.IndexParamSpace)) frame.IndexParamSpace=windowItem.IndexParamSpace;
12322
12328
  if (IFrameSplitOperator.IsNumber(windowItem.IndexTitleSpace)) frame.IndexTitleSpace=windowItem.IndexTitleSpace;
@@ -12379,6 +12385,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12379
12385
  if (IFrameSplitOperator.IsNumber(option.SplitCount)) subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;
12380
12386
  if (IFrameSplitOperator.IsNumber(option.TitleHeight)) subFrame.Frame.ChartBorder.TitleHeight=option.TitleHeight;
12381
12387
  if (IFrameSplitOperator.IsBool(option.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;
12388
+ if (IFrameSplitOperator.IsNumber(option.TitleArrowType)) subFrame.Frame.TitleArrowType=option.TitleArrowType;
12382
12389
  if (IFrameSplitOperator.IsBool(option.IsShowIndexName)) subFrame.Frame.IsShowIndexName=option.IsShowIndexName;
12383
12390
  if (IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName)) subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;
12384
12391
  if (IFrameSplitOperator.IsNumber(option.IndexParamSpace)) subFrame.Frame.IndexParamSpace=option.IndexParamSpace;
@@ -14197,6 +14204,7 @@ function IChartFramePainting()
14197
14204
  this.SizeChange=true; //大小是否改变
14198
14205
  this.XYSplit=true; //XY轴坐标信息改变
14199
14206
  this.XSplit=true; //X轴变化
14207
+ this.YCustomSplit=true; //自定义Y轴分割线
14200
14208
 
14201
14209
  this.HorizontalMax; //Y轴最大值
14202
14210
  this.HorizontalMin; //Y轴最小值
@@ -14218,6 +14226,7 @@ function IChartFramePainting()
14218
14226
  this.YSpecificMaxMin=null; //指定Y轴最大最小值
14219
14227
  this.IsShowBorder = true; //是否显示边框
14220
14228
  this.IsShowTitleArrow=true; //是否显示指标信息上涨下跌箭头
14229
+ this.TitleArrowType=g_JSChartResource.IndexTitle.ArrowType; //指标信息上涨下跌箭头类型 0=独立颜色 1=跟指标名字颜色一致
14221
14230
  this.IsShowIndexName=true; //是否显示指标名字
14222
14231
  this.IsShowOverlayIndexName=true; //是否显示叠加指标名字
14223
14232
  //this.OverlayIndexType= { Position:0, LineSpace:5 };
@@ -14278,6 +14287,7 @@ function IChartFramePainting()
14278
14287
  this.SizeChange=false;
14279
14288
  this.XYSplit=false;
14280
14289
  this.XSplit=false;
14290
+ this.YCustomSplit=false; //自定义Y轴分割线
14281
14291
  }
14282
14292
 
14283
14293
  this.DrawFrame=function() { }
@@ -17433,7 +17443,18 @@ function MinuteFrame()
17433
17443
  //分割x,y轴坐标信息
17434
17444
  this.SplitXYCoordinate=function()
17435
17445
  {
17436
- if (this.XYSplit==false) return;
17446
+ if (this.XYSplit==false)
17447
+ {
17448
+ //计算自定义刻度
17449
+ if (this.YCustomSplit)
17450
+ {
17451
+ if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate)
17452
+ this.YSplitOperator.CustomCoordinate();
17453
+ }
17454
+
17455
+ return;
17456
+ }
17457
+
17437
17458
  if (this.XSplitOperator!=null) this.XSplitOperator.Operator();
17438
17459
  if (this.YSplitOperator!=null) this.YSplitOperator.Operator();
17439
17460
  }
@@ -18891,6 +18912,8 @@ function OverlayMinuteFrame()
18891
18912
 
18892
18913
  this.SizeChange=false;
18893
18914
  this.XYSplit=false;
18915
+ this.XSplit=false;
18916
+ this.YCustomSplit=false; //自定义Y轴分割线
18894
18917
  }
18895
18918
 
18896
18919
  this.DrawToolbar=function()
@@ -18947,6 +18970,8 @@ function OverlayMinuteHScreenFrame()
18947
18970
 
18948
18971
  this.SizeChange=false;
18949
18972
  this.XYSplit=false;
18973
+ this.XSplit=false;
18974
+ this.YCustomSplit=false; //自定义Y轴分割线
18950
18975
  }
18951
18976
 
18952
18977
  //分割x,y轴坐标信息
@@ -19555,7 +19580,13 @@ function KLineFrame()
19555
19580
  if (this.XSplit)
19556
19581
  {
19557
19582
  if (this.XSplitOperator) this.XSplitOperator.Operator();
19558
- if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate) this.YSplitOperator.CustomCoordinate();
19583
+ }
19584
+
19585
+ if (this.YCustomSplit)
19586
+ {
19587
+ //计算自定义刻度
19588
+ if (this.YSplitOperator && this.YSplitOperator.CustomCoordinate)
19589
+ this.YSplitOperator.CustomCoordinate();
19559
19590
  }
19560
19591
 
19561
19592
  return;
@@ -20327,6 +20358,7 @@ function OverlayKLineFrame()
20327
20358
  this.SizeChange=false;
20328
20359
  this.XYSplit=false;
20329
20360
  this.XSplit=false;
20361
+ this.YCustomSplit=false; //自定义Y轴分割线
20330
20362
  }
20331
20363
 
20332
20364
 
@@ -21614,6 +21646,8 @@ function OverlayKLineHScreenFrame()
21614
21646
 
21615
21647
  this.SizeChange=false;
21616
21648
  this.XYSplit=false;
21649
+ this.XSplit=false;
21650
+ this.YCustomSplit=false; //自定义Y轴分割线
21617
21651
  }
21618
21652
 
21619
21653
  this.DrawTitle=function() //画标题
@@ -50325,6 +50359,22 @@ IFrameSplitOperator.IsNumber=function(value)
50325
50359
  return typeof(value)=='number';
50326
50360
  }
50327
50361
 
50362
+ //批量判断是否是数值类型
50363
+ IFrameSplitOperator.IsNumberV2=function(...aryValue)
50364
+ {
50365
+ if (!aryValue) return false;
50366
+ if (aryValue.length==0) return false;
50367
+
50368
+ for(const value of aryValue)
50369
+ {
50370
+ if (value==null) return false;
50371
+ if (isNaN(value)) return false;
50372
+ if (typeof(value)!='number') return false;
50373
+ }
50374
+
50375
+ return true;
50376
+ }
50377
+
50328
50378
  //判断是否是正数
50329
50379
  IFrameSplitOperator.IsPlusNumber=function(value)
50330
50380
  {
@@ -52058,6 +52108,8 @@ function FrameSplitMinutePriceY()
52058
52108
 
52059
52109
  this.CustomCoordinate=function() //自定义刻度
52060
52110
  {
52111
+ this.Frame.CustomHorizontalInfo=[];
52112
+
52061
52113
  var data=this.InvokeCustomYCoordinateCallback();
52062
52114
  if (data && data.PreventDefault==true) return;
52063
52115
 
@@ -57203,9 +57255,11 @@ function DynamicChartTitlePainting()
57203
57255
  this.ColorIndex; //五彩K线名字 {Name:'名字'}
57204
57256
  this.IsShowColorIndexTitle=true;
57205
57257
  this.IsShowUpDownArrow=true; //指标数据是否显示 上涨下跌箭头
57258
+ this.TitleArrowType=0; //指标数据上涨下跌箭头类型 0=独立颜色 1=跟指标颜色一致
57206
57259
  this.IsShowIndexName=true; //是否显示指标名字
57207
57260
  this.IsShowIndexTitle=true; //是否显示指标标题信息
57208
57261
  this.IsShowNameArrow=false;
57262
+ this.NameArrowConfig=CloneData(g_JSChartResource.IndexTitle.NameArrow);
57209
57263
 
57210
57264
  this.TradeIndex; //专家系统名字{Name:'名字', Param:'参数'}
57211
57265
  this.IsShowTradeIndexTitle=true;
@@ -57674,6 +57728,7 @@ function DynamicChartTitlePainting()
57674
57728
  this.IsDrawTitleBG=this.Frame.IsDrawTitleBG;
57675
57729
  this.IsShowNameArrow=this.Frame.IsShowNameArrow;
57676
57730
  this.IsShowUpDownArrow=this.Frame.IsShowTitleArrow;
57731
+ this.TitleArrowType=this.Frame.TitleArrowType;
57677
57732
  this.IsShowIndexName=this.Frame.IsShowIndexName;
57678
57733
  this.IsShowOverlayIndexName=this.Frame.IsShowOverlayIndexName;
57679
57734
  this.OverlayIndexType.Position=this.Frame.OverlayIndexType.Position;
@@ -57958,6 +58013,8 @@ function DynamicChartTitlePainting()
57958
58013
  if (preValue>value) arrowSuper={ Text:'↓', TextColor:this.UpDownArrowConfig.DownColor };
57959
58014
  else if (preValue<value) arrowSuper={ Text:'↑', TextColor:this.UpDownArrowConfig.UpColor};
57960
58015
  else arrowSuper={ Text:'→', TextColor:this.UpDownArrowConfig.UnchangeColor };
58016
+
58017
+ if (this.TitleArrowType==1) arrowSuper.TextColor=item.Color;
57961
58018
  }
57962
58019
  }
57963
58020
 
@@ -58465,10 +58522,16 @@ function DynamicChartTitlePainting()
58465
58522
  if (this.IsDrawTitleBG)
58466
58523
  {
58467
58524
  var title=this.Title;
58468
- if (this.IsShowNameArrow) title+='▼';
58469
58525
  var textWidth=this.Canvas.measureText(title).width;
58526
+ var arrowWidth=0;
58527
+ if (this.IsShowNameArrow && this.NameArrowConfig)
58528
+ {
58529
+ arrowWidth=this.Canvas.measureText(this.NameArrowConfig.Symbol).width;
58530
+ if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) arrowWidth+=this.NameArrowConfig.Space;
58531
+ }
58532
+
58470
58533
  var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;
58471
- var bgWidth=textWidth+4*pixelRatio;
58534
+ var bgWidth=textWidth+arrowWidth+4*pixelRatio;
58472
58535
 
58473
58536
  this.TitleRect=
58474
58537
  {
@@ -58488,15 +58551,24 @@ function DynamicChartTitlePainting()
58488
58551
  this.Canvas.strokeRect(ToFixedPoint(drawRect.Left),ToFixedPoint(drawRect.Top),ToFixedRect(drawRect.Width),ToFixedRect(drawRect.Height));
58489
58552
  }
58490
58553
 
58554
+ var xText=left+2*pixelRatio;
58491
58555
  this.Canvas.fillStyle=this.TitleColor;
58492
- this.Canvas.fillText(title,left+2*pixelRatio,bottom,textWidth);
58556
+ this.Canvas.fillText(title,xText,bottom);
58557
+ xText+=textWidth;
58558
+ if (this.IsShowNameArrow && this.NameArrowConfig)
58559
+ {
58560
+ if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) xText+=this.NameArrowConfig.Space;
58561
+ this.Canvas.fillStyle=this.NameArrowConfig.Color;
58562
+ this.Canvas.fillText(this.NameArrowConfig.Symbol,xText,bottom);
58563
+ }
58564
+
58493
58565
  left+=bgWidth+2*pixelRatio;
58494
58566
  left+=this.TitleSpace;
58495
58567
  }
58496
58568
  else
58497
58569
  {
58498
58570
  this.Canvas.fillStyle=this.TitleColor;
58499
- this.Canvas.fillText(this.Title,left,bottom,textWidth);
58571
+ this.Canvas.fillText(this.Title,left,bottom);
58500
58572
  left+=textWidth;
58501
58573
  left+=this.TitleSpace;
58502
58574
  }
@@ -58609,11 +58681,17 @@ function DynamicChartTitlePainting()
58609
58681
  {
58610
58682
  var pixelRatio=GetDevicePixelRatio();
58611
58683
  var title=this.Title;
58612
- if (this.IsShowNameArrow) title+='▼';
58613
58684
  var textWidth=this.Canvas.measureText(title).width;
58685
+ var arrowWidth=0;
58686
+ if (this.IsShowNameArrow && this.NameArrowConfig)
58687
+ {
58688
+ arrowWidth=this.Canvas.measureText(this.NameArrowConfig.Symbol).width;
58689
+ if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) arrowWidth+=this.NameArrowConfig.Space;
58690
+ }
58691
+
58614
58692
  var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;
58615
58693
  var roundRadius=this.BorderRoundRadius*pixelRatio;
58616
- var bgWidth=textWidth+4*pixelRatio+roundRadius*2;
58694
+ var bgWidth=textWidth+arrowWidth+4*pixelRatio+roundRadius*2;
58617
58695
 
58618
58696
  rtButton.Top=rtButton.YCenter-bgHeight/2-1,
58619
58697
  rtButton.Width=bgWidth;
@@ -58659,8 +58737,16 @@ function DynamicChartTitlePainting()
58659
58737
  }
58660
58738
  }
58661
58739
 
58740
+ var xText=rtButton.Left+roundRadius+2*pixelRatio;
58662
58741
  this.Canvas.fillStyle=this.TitleColor;
58663
- this.Canvas.fillText(title,rtButton.Left+roundRadius+2*pixelRatio,rtButton.YCenter,textWidth);
58742
+ this.Canvas.fillText(title,xText,rtButton.YCenter);
58743
+ xText+=textWidth;
58744
+ if (this.IsShowNameArrow && this.NameArrowConfig)
58745
+ {
58746
+ if (IFrameSplitOperator.IsNumber(this.NameArrowConfig.Space)) xText+=this.NameArrowConfig.Space;
58747
+ this.Canvas.fillStyle=this.NameArrowConfig.Color;
58748
+ this.Canvas.fillText(this.NameArrowConfig.Symbol,xText,rtButton.YCenter);
58749
+ }
58664
58750
  }
58665
58751
 
58666
58752
  //绘制按钮
@@ -60338,6 +60424,7 @@ IChartDrawPicture.ArrayDrawPricture=
60338
60424
  { Name:"FibSpeedResistanceFan", ClassName:"ChartFibSpeedResistanceFan", Create:function() { return new ChartFibSpeedResistanceFan(); }}, //斐波那契扇形
60339
60425
  { Name:"PriceRange", ClassName:"ChartPriceRange", Create:function() { return new ChartPriceRange(); }},
60340
60426
  { Name:"DateRange", ClassName:"ChartDateRange", Create:function() { return new ChartDateRange(); }},
60427
+ { Name:"DatePriceRange", ClassName:"ChartDatePriceRange", Create:function() { return new ChartDatePriceRange(); }},
60341
60428
  { Name:"InfoLine", ClassName:"ChartInfoLine", Create:function() { return new ChartInfoLine(); }},
60342
60429
  { Name:"TrendAngle", ClassName:"ChartTrendAngle", Create:function() { return new ChartTrendAngle(); }},
60343
60430
  { Name:"ArrowMarker", ClassName:"ChartArrowMarker", Create:function() { return new ChartArrowMarker(); } },
@@ -60874,10 +60961,10 @@ function ChartArrowMarker()
60874
60961
  this.ClassName='ChartArrowMarker';
60875
60962
  this.IsPointIn=this.IsPointIn_XYValue_Line;
60876
60963
 
60877
- this.InsideAngle=25;
60964
+ this.InsideLineConfig={ Angle:25, MaxWidth:70, WidthRate:0.3 };
60878
60965
  this.InsideWidth=70;
60879
-
60880
- this.OutAngle=35;
60966
+
60967
+ this.OutLineConfig={ Angle:35, MaxWidth:100, WidthRate:0.4 };
60881
60968
  this.OutWidth=100;
60882
60969
 
60883
60970
  this.GetXYCoordinate=this.GetXYCoordinate_default;
@@ -60910,6 +60997,19 @@ function ChartArrowMarker()
60910
60997
  return { Top:{X:topX+ptEnd.X, Y:topY+ptEnd.Y}, Bottom:{X:botX+ptEnd.X, Y:botY+ptEnd.Y} };
60911
60998
  }
60912
60999
 
61000
+ this.CalculateLineWidth=function(ptStart, ptEnd)
61001
+ {
61002
+ var a=ptStart.X-ptEnd.X;
61003
+ var b=ptStart.Y-ptEnd.Y;
61004
+ var c=Math.sqrt(a*a+b*b);
61005
+
61006
+ this.InsideWidth=c*this.InsideLineConfig.WidthRate;
61007
+ this.OutWidth=c*this.OutLineConfig.WidthRate;
61008
+
61009
+ if (this.InsideWidth>this.InsideLineConfig.MaxWidth) this.InsideWidth=this.InsideLineConfig.MaxWidth;
61010
+ if (this.OutWidth>this.OutLineConfig.MaxWidth) this.OutWidth=this.OutLineConfig.MaxWidth;
61011
+ }
61012
+
60913
61013
  this.Draw=function()
60914
61014
  {
60915
61015
  this.LinePoint=[];
@@ -60925,9 +61025,11 @@ function ChartArrowMarker()
60925
61025
  var ptStart=drawPoint[0];
60926
61026
  var ptEnd=drawPoint[1];
60927
61027
 
61028
+ this.CalculateLineWidth(ptStart, ptEnd);
61029
+
60928
61030
  //计算箭头 的两条边线坐标
60929
- var outArrow=this.CalculatePoint(this.OutAngle, ptStart, ptEnd, this.OutWidth);
60930
- var insideArrow=this.CalculatePoint(this.InsideAngle, ptStart, ptEnd, this.InsideWidth);
61031
+ var outArrow=this.CalculatePoint(this.OutLineConfig.Angle, ptStart, ptEnd, this.OutWidth);
61032
+ var insideArrow=this.CalculatePoint(this.InsideLineConfig.Angle, ptStart, ptEnd, this.InsideWidth);
60931
61033
 
60932
61034
  this.Canvas.beginPath();
60933
61035
  this.Canvas.moveTo(ptStart.X,ptStart.Y);
@@ -69875,8 +69977,12 @@ function ChartDateRange()
69875
69977
 
69876
69978
  //文字输出
69877
69979
  var bottom=this.Frame.ChartBorder.GetBottomEx();
69980
+ var top=this.Frame.ChartBorder.GetTopEx();
69878
69981
  var startIndex=this.Frame.GetXData(ptStart.X,false);
69879
69982
  var endIndex=this.Frame.GetXData(ptEnd.X,false);
69983
+ var startValue=this.Frame.GetYData(ptStart.Y,false);
69984
+ var endValue=this.Frame.GetYData(ptEnd.Y,false);
69985
+ var diffValue=endValue-startValue;
69880
69986
  var barCount=endIndex-startIndex+1;
69881
69987
  var text=`${barCount} bars`;
69882
69988
 
@@ -69884,13 +69990,27 @@ function ChartDateRange()
69884
69990
  var textHeight=this.GetFontHeight();
69885
69991
  var textWidth=this.Canvas.measureText(text).width+4+(this.Label.LeftMargin+this.Label.RightMargin);
69886
69992
  var rtTextBG={ Left:xCenter-textWidth/2, Top:ptEnd.Y+4, Width:textWidth, Height:textHeight+2 };
69993
+ if (diffValue>0) rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;
69994
+ else rtTextBG.Top=ptEnd.Y+4;
69887
69995
  rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
69888
69996
 
69889
- if (rtTextBG.Bottom>=bottom)
69997
+ if (diffValue>0)
69890
69998
  {
69891
- rtTextBG.Bottom=bottom;
69892
- rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
69999
+ if (rtTextBG.Top<=top)
70000
+ {
70001
+ rtTextBG.Top=top;
70002
+ rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
70003
+ }
69893
70004
  }
70005
+ else
70006
+ {
70007
+ if (rtTextBG.Bottom>=bottom)
70008
+ {
70009
+ rtTextBG.Bottom=bottom;
70010
+ rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
70011
+ }
70012
+ }
70013
+
69894
70014
 
69895
70015
  if (this.Label.EnableBGColor)
69896
70016
  {
@@ -69908,6 +70028,169 @@ function ChartDateRange()
69908
70028
  }
69909
70029
  }
69910
70030
 
70031
+ function ChartDatePriceRange()
70032
+ {
70033
+ this.newMethod=IChartDrawPicture; //派生
70034
+ this.newMethod();
70035
+ delete this.newMethod;
70036
+
70037
+ this.ClassName='ChartDatePriceRange';
70038
+ this.PointCount=2;
70039
+ this.Font=12*GetDevicePixelRatio() +"px 微软雅黑";
70040
+ this.TextColor=this.LineColor;
70041
+ this.IsPointIn=this.IsPointIn_XYValue_Line;
70042
+ this.GetXYCoordinate=this.GetXYCoordinate_default;
70043
+ this.PointToValue_Default=this.PointToValue;
70044
+ this.OnlyMoveXIndex=true;
70045
+ this.IsSupportMagnet=true;
70046
+ this.LineWidth=1;
70047
+ this.EnableBGColor=true;
70048
+ this.BGColor=IChartDrawPicture.ColorToRGBA(this.LineColor,0.15);
70049
+ this.ExtendLine={ Top:false, Bottom: false }; //延长线
70050
+
70051
+ this.Label={ TextColor:"rgb(0,0,0)", BGColor:"rgb(211,211,211)", EnableBGColor:true, LeftMargin:5, RightMargin:5 };
70052
+
70053
+ this.Draw=function()
70054
+ {
70055
+ this.LinePoint=[];
70056
+ if (this.IsFrameMinSize()) return;
70057
+ if (!this.IsShow) return;
70058
+
70059
+ var bCheckXY=true;
70060
+ var drawPoint=this.CalculateDrawPoint( {IsCheckX:bCheckXY, IsCheckY:bCheckXY} );
70061
+ if (!drawPoint) return;
70062
+ if (drawPoint.length!=2) return;
70063
+
70064
+ this.ClipFrame();
70065
+
70066
+ var ptStart=drawPoint[0];
70067
+ var ptEnd=drawPoint[1];
70068
+
70069
+ this.SetLineWidth();
70070
+ this.DrawRange(ptStart,ptEnd);
70071
+ this.RestoreLineWidth();
70072
+
70073
+ this.DrawPoint(drawPoint); //画点
70074
+ this.Canvas.restore();
70075
+ }
70076
+
70077
+ this.DrawRange=function(ptStart, ptEnd)
70078
+ {
70079
+ var yTop=Math.min(ptStart.Y, ptEnd.Y);
70080
+ var yBottom=Math.max(ptStart.Y, ptEnd.Y);
70081
+ var xLeft=Math.min(ptStart.X, ptEnd.X);
70082
+ var xRight=Math.max(ptStart.X, ptEnd.X);
70083
+ var height=yBottom-yTop;
70084
+ var width=xRight-xLeft;
70085
+ var yCenter=ptStart.Y+(ptEnd.Y-ptStart.Y)/2;
70086
+ var xCenter=ptStart.X+(ptEnd.X-ptStart.X)/2;
70087
+
70088
+ if (this.ExtendLine.Top) yTop=this.Frame.ChartBorder.GetTopEx();
70089
+ if (this.ExtendLine.Bottom) yBottom=this.Frame.ChartBorder.GetBottomEx();
70090
+
70091
+ if (this.EnableBGColor)
70092
+ {
70093
+ var rtBG={ Left:xLeft, Top:yTop, Right:xRight, Bottom:yBottom };
70094
+ rtBG.Width=rtBG.Right-rtBG.Left;
70095
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
70096
+ this.Canvas.fillStyle=this.BGColor;
70097
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
70098
+ }
70099
+
70100
+ this.Canvas.strokeStyle=this.LineColor;
70101
+ this.Canvas.beginPath();
70102
+ this.Canvas.moveTo(ToFixedPoint(xLeft),yTop);
70103
+ this.Canvas.lineTo(ToFixedPoint(xLeft),yBottom);
70104
+
70105
+ this.Canvas.moveTo(ToFixedPoint(xRight),yTop);
70106
+ this.Canvas.lineTo(ToFixedPoint(xRight),yBottom);
70107
+
70108
+ this.Canvas.moveTo(ToFixedPoint(xLeft),ToFixedPoint(yCenter));
70109
+ this.Canvas.lineTo(ToFixedPoint(xRight),ToFixedPoint(yCenter));
70110
+
70111
+ this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(yTop));
70112
+ this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(yBottom));
70113
+
70114
+ this.Canvas.stroke();
70115
+
70116
+ this.LinePoint.push({ Start:{X:xLeft, Y:yTop}, End:{X:xLeft, Y:yBottom} });
70117
+ this.LinePoint.push({ Start:{X:xRight, Y:yTop}, End:{X:xRight, Y:yBottom} });
70118
+ this.LinePoint.push({ Start:{X:xLeft, Y:yCenter}, End:{X:xRight, Y:yCenter} });
70119
+
70120
+ this.DrawArrow({X:ptStart.X, Y:ToFixedPoint(yCenter)}, {X:ptEnd.X, Y:ToFixedPoint(yCenter)});
70121
+ this.DrawArrow({X:ToFixedPoint(xCenter), Y:ptStart.Y}, {X:ToFixedPoint(xCenter), Y:ptEnd.Y});
70122
+
70123
+ //文字输出
70124
+ var bottom=this.Frame.ChartBorder.GetBottomEx();
70125
+ var top=this.Frame.ChartBorder.GetTopEx();
70126
+ var startIndex=this.Frame.GetXData(ptStart.X,false);
70127
+ var endIndex=this.Frame.GetXData(ptEnd.X,false);
70128
+ var barCount=endIndex-startIndex+1;
70129
+ var startValue=this.Frame.GetYData(ptStart.Y,false);
70130
+ var endValue=this.Frame.GetYData(ptEnd.Y,false);
70131
+ var diffValue=endValue-startValue;
70132
+
70133
+ var rate=(diffValue/startValue)*100;
70134
+ var aryText=
70135
+ [
70136
+ `${diffValue.toFixed(2)} (${rate.toFixed(2)}%)`,
70137
+ `${barCount} bars`
70138
+ ];
70139
+
70140
+ this.Canvas.font=this.Font;
70141
+ var textHeight=this.GetFontHeight();
70142
+ var textWidth=0;
70143
+ for(var i=0;i<aryText.length;++i)
70144
+ {
70145
+ var text=aryText[i];
70146
+ var value=this.Canvas.measureText(text).width;
70147
+ if (textWidth<value) textWidth=value;
70148
+ }
70149
+ textWidth+=(this.Label.LeftMargin+this.Label.RightMargin);
70150
+
70151
+ var rtTextBG={ Left:xCenter-textWidth/2, Top:ptEnd.Y+4, Width:textWidth, Height:aryText.length*textHeight+2 };
70152
+ if (diffValue>0) rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;
70153
+ else rtTextBG.Top=ptEnd.Y+4;
70154
+ rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
70155
+
70156
+ if (diffValue>0)
70157
+ {
70158
+ if (rtTextBG.Top<=top)
70159
+ {
70160
+ rtTextBG.Top=top;
70161
+ rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;
70162
+ }
70163
+ }
70164
+ else
70165
+ {
70166
+ if (rtTextBG.Bottom>=bottom)
70167
+ {
70168
+ rtTextBG.Bottom=bottom;
70169
+ rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;
70170
+ }
70171
+ }
70172
+
70173
+ if (this.Label.EnableBGColor)
70174
+ {
70175
+ var path=new Path2D();
70176
+ path.roundRect(ToFixedPoint(rtTextBG.Left), ToFixedPoint(rtTextBG.Top), ToFixedRect(rtTextBG.Width), ToFixedRect(rtTextBG.Height), [3]);
70177
+ this.Canvas.fillStyle=this.Label.BGColor;
70178
+ this.Canvas.fill(path);
70179
+ }
70180
+
70181
+ this.Canvas.fillStyle=this.Label.TextColor;
70182
+ this.Canvas.textAlign="left";
70183
+ this.Canvas.textBaseline="bottom";
70184
+ var yText=rtTextBG.Bottom-2;
70185
+ for(var i=0;i<aryText.length;++i)
70186
+ {
70187
+ var text=aryText[i];
70188
+ this.Canvas.fillText(text,rtTextBG.Left+2+this.Label.LeftMargin,yText);
70189
+ yText-=textHeight;
70190
+ }
70191
+ }
70192
+ }
70193
+
69911
70194
  //线段信息统计
69912
70195
  function ChartInfoLine()
69913
70196
  {
@@ -70486,7 +70769,11 @@ function JSChartResource()
70486
70769
  UpColor:"rgb(238,21,21)", //上涨
70487
70770
  DownColor:"rgb(25,158,0)", //下跌
70488
70771
  UnchangeColor:"rgb(0,0,0)" //不变
70489
- }
70772
+ },
70773
+
70774
+ ArrowType:0,
70775
+
70776
+ NameArrow:{ Color:"rgb(43,54,69)", Space:2, Symbol:'▼' },
70490
70777
  }
70491
70778
 
70492
70779
  this.Title={
@@ -71784,6 +72071,16 @@ function JSChartResource()
71784
72071
  if (subItem.DownColor) this.IndexTitle.UpDownArrow.DownColor = subItem.DownColor;
71785
72072
  if (subItem.UnchangeColor) this.IndexTitle.UpDownArrow.UnchangeColor = subItem.UnchangeColor;
71786
72073
  }
72074
+
72075
+ if (IFrameSplitOperator.IsNumber(item.ArrowType)) this.IndexTitle.ArrowType=item.ArrowType;
72076
+
72077
+ if (item.NameArrow)
72078
+ {
72079
+ var subItem=item.NameArrow;
72080
+ if (subItem.Color) this.IndexTitle.NameArrow.Color = subItem.Color;
72081
+ if (subItem.Symbol) this.IndexTitle.NameArrow.Symbol = subItem.Symbol;
72082
+ if (IFrameSplitOperator.IsNumber(subItem.Space)) this.IndexTitle.NameArrow.Space = subItem.Space;
72083
+ }
71787
72084
  }
71788
72085
 
71789
72086
  if (style.Frame)
@@ -77755,7 +78052,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
77755
78052
 
77756
78053
  if (IFrameSplitOperator.IsNumber(item.TitleHeight)) this.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
77757
78054
  else item.TitleHeight=this.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;
77758
- if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) this.Frame.SubFrame[i].Frame.IsShowTitleArrow=item.IsShowTitleArrow;
78055
+ if (IFrameSplitOperator.IsBool(item.IsShowTitleArrow)) subFrame.Frame.IsShowTitleArrow=item.IsShowTitleArrow;
78056
+ if (IFrameSplitOperator.IsNumber(item.TitleArrowType)) subFrame.Frame.TitleArrowType=item.TitleArrowType;
77759
78057
  if (item.IsShowIndexName==false) this.Frame.SubFrame[i].Frame.IsShowIndexName=false;
77760
78058
  if (item.IsShowOverlayIndexName==false) this.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;
77761
78059
  if (IFrameSplitOperator.IsNumber(item.IndexParamSpace)) this.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;
@@ -123525,7 +123823,9 @@ function GetBlackStyle()
123525
123823
  UpColor:"rgb(238,21,21)", //上涨
123526
123824
  DownColor:"rgb(25,158,0)", //下跌
123527
123825
  UnchangeColor:"rgb(190, 190 ,190)" //不变
123528
- }
123826
+ },
123827
+
123828
+ NameArrow:{ Color:"rgb(190, 190 ,190)", Space:2, Symbol:'▼' },
123529
123829
  },
123530
123830
 
123531
123831
  Title:
@@ -136867,7 +137167,7 @@ function ScrollBarBGChart()
136867
137167
 
136868
137168
 
136869
137169
 
136870
- var HQCHART_VERSION="1.1.13599";
137170
+ var HQCHART_VERSION="1.1.13613";
136871
137171
 
136872
137172
  function PrintHQChartVersion()
136873
137173
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13599";
8
+ var HQCHART_VERSION="1.1.13613";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {