hqchart 1.1.12734 → 1.1.12741

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.12734",
3
+ "version": "1.1.12741",
4
4
  "description": "stock chart",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -2852,7 +2852,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
2852
2852
  {
2853
2853
  IsValueFullRange:false ,
2854
2854
  IsDisplayLatest:false,
2855
- SelectedBorder:{ Mode:0, SelFrame:0 } //边框选中模式
2855
+ SelectedBorder:{ Mode:0, SelFrame:0 } //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
2856
2856
  //XDateFormat (多日分时图x轴底部日期格式)
2857
2857
  };
2858
2858
 
@@ -5312,12 +5312,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5312
5312
  {
5313
5313
  if (!this.GlobalOption.SelectedBorder) return;
5314
5314
  var item=this.GlobalOption.SelectedBorder;
5315
+ if (!IFrameSplitOperator.IsPlusNumber(item.Mode)) return;
5315
5316
  if (!IFrameSplitOperator.IsNumber(item.SelFrame) && item.SelFrame<0) return;
5316
5317
 
5317
5318
  var subFrame=this.Frame.SubFrame[item.SelFrame];
5318
5319
  if (!subFrame) return;
5319
5320
 
5320
- if (subFrame.Frame.DrawSelectedBorder) subFrame.Frame.DrawSelectedBorder();
5321
+ if (subFrame.Frame.DrawSelectedBorder) subFrame.Frame.DrawSelectedBorder(item);
5321
5322
  }
5322
5323
 
5323
5324
  //当前屏K线涨幅Y轴刻度
@@ -8437,14 +8438,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8437
8438
 
8438
8439
  overlayFrame.Frame=frame;
8439
8440
 
8440
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
8441
- if (event && event.Callback)
8442
- {
8443
- var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
8444
- event.Callback(event, sendData, this);
8445
- }
8446
-
8447
-
8448
8441
  var scriptIndex;
8449
8442
  if (findItem)
8450
8443
  {
@@ -8458,6 +8451,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8458
8451
  }
8459
8452
 
8460
8453
  overlayFrame.Script=scriptIndex;
8454
+
8455
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
8456
+ if (event && event.Callback)
8457
+ {
8458
+ var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
8459
+ event.Callback(event, sendData, this);
8460
+ }
8461
+
8461
8462
  subFrame.OverlayIndex.push(overlayFrame);
8462
8463
 
8463
8464
  var updateWindowIndex=dest.WindowIndex;
@@ -9736,7 +9737,11 @@ function AverageWidthFrame()
9736
9737
  //Y轴刻度长线
9737
9738
  this.YLineExtend; //[0]=左 [1]=右 { Width:5, Color:颜色, }
9738
9739
  this.YTextExtend; //[0]=左 [1]=右 { Align:0=默认 1=左对齐 2=右对齐 }
9739
- this.YRightTextInfo;
9740
+ this.YRightTextInfo;
9741
+
9742
+ //X轴延长线
9743
+ this.XTextExtend; //[0]=底部 { Align:0=默认(居中), 1=左对齐 }
9744
+ this.XLineExtend; //[0]=底部 { Mode:1, Color: } Mode=1 分割线 Mode=2短线
9740
9745
 
9741
9746
  //画图工具刻度
9742
9747
 
@@ -10554,6 +10559,18 @@ function AverageWidthFrame()
10554
10559
  //JSConsole.Chart.Log('[AverageWidthFrame.DrawVertical] bottom',bottom);
10555
10560
  if (this.ChartBorder.Bottom<=5*GetDevicePixelRatio()) return; //高度不够 不显示
10556
10561
 
10562
+ var bottomTextExtend=null;
10563
+ if (this.XTextExtend)
10564
+ {
10565
+ bottomTextExtend=this.XTextExtend[0];
10566
+ }
10567
+
10568
+ var bottomLineExtend=null;
10569
+ if (this.XLineExtend)
10570
+ {
10571
+ bottomLineExtend=this.XLineExtend[0];
10572
+ }
10573
+
10557
10574
  var xPrev=null; //上一个坐标x的值
10558
10575
  var textRightPrev=null; //上一次刻度输出右边x坐标
10559
10576
  for(var i=0; i<this.VerticalInfo.length; ++i)
@@ -10597,7 +10614,7 @@ function AverageWidthFrame()
10597
10614
  {
10598
10615
  this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;
10599
10616
  this.Canvas.beginPath();
10600
- this.Canvas.moveTo(xFixed,top);
10617
+ this.Canvas.moveTo(xFiixed,top);
10601
10618
  this.Canvas.lineTo(xFixed,bottom);
10602
10619
  this.Canvas.stroke();
10603
10620
  }
@@ -10618,31 +10635,39 @@ function AverageWidthFrame()
10618
10635
 
10619
10636
  if (this.VerticalInfo[i].Message[0]!=null)
10620
10637
  {
10621
- if (this.VerticalInfo[i].Font!=null)
10622
- this.Canvas.font=this.VerticalInfo[i].Font;
10623
-
10638
+ if (this.VerticalInfo[i].Font) this.Canvas.font=this.VerticalInfo[i].Font;
10639
+
10624
10640
  var textLeft=0;
10625
10641
 
10626
10642
  this.Canvas.strokeStyle=item.TextColor;
10627
10643
  var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
10628
10644
  var textHeight=this.Canvas.measureText("擎").width;
10629
- if (x<testWidth/2)
10645
+ if (bottomTextExtend && bottomTextExtend.Align==1)
10630
10646
  {
10631
10647
  this.Canvas.textAlign="left";
10632
10648
  this.Canvas.textBaseline="top";
10633
10649
  textLeft=x;
10634
10650
  }
10635
- else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
10636
- {
10637
- this.Canvas.textAlign = "right";
10638
- this.Canvas.textBaseline="top";
10639
- textLeft=x-testWidth;
10640
- }
10641
10651
  else
10642
10652
  {
10643
- this.Canvas.textAlign="center";
10644
- this.Canvas.textBaseline="top";
10645
- textLeft=x-(testWidth/2);
10653
+ if (x<testWidth/2)
10654
+ {
10655
+ this.Canvas.textAlign="left";
10656
+ this.Canvas.textBaseline="top";
10657
+ textLeft=x;
10658
+ }
10659
+ else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
10660
+ {
10661
+ this.Canvas.textAlign = "right";
10662
+ this.Canvas.textBaseline="top";
10663
+ textLeft=x-testWidth;
10664
+ }
10665
+ else
10666
+ {
10667
+ this.Canvas.textAlign="center";
10668
+ this.Canvas.textBaseline="top";
10669
+ textLeft=x-(testWidth/2);
10670
+ }
10646
10671
  }
10647
10672
 
10648
10673
  if (textRightPrev==null || textLeft>textRightPrev)
@@ -10659,6 +10684,36 @@ function AverageWidthFrame()
10659
10684
  yText+=lineLength+2*pixelRatio;
10660
10685
  }
10661
10686
 
10687
+ if (bottomLineExtend)
10688
+ {
10689
+ if (bottomLineExtend.Mode===1)
10690
+ {
10691
+ if (item.Value>1)
10692
+ {
10693
+ if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
10694
+ this.Canvas.beginPath();
10695
+ this.Canvas.moveTo(xFixed,bottom);
10696
+ this.Canvas.lineTo(xFixed,border.ChartHeight);
10697
+ this.Canvas.stroke();
10698
+ x+=1;
10699
+ }
10700
+ }
10701
+ else if (bottomLineExtend.Mode===2)
10702
+ {
10703
+ if (bottomLineExtend.Width>=1)
10704
+ {
10705
+ var lineLength=bottomLineExtend.Width;
10706
+ if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
10707
+ this.Canvas.beginPath();
10708
+ this.Canvas.moveTo(xFixed,yText);
10709
+ this.Canvas.lineTo(xFixed,yText+lineLength);
10710
+ this.Canvas.stroke();
10711
+
10712
+ yText+=lineLength+2;
10713
+ }
10714
+ }
10715
+ }
10716
+
10662
10717
  //item.TextBGColor="rgb(0,255,0)";
10663
10718
  if (item.TextBGColor) //文字背景色
10664
10719
  {
@@ -14829,13 +14884,13 @@ function KLineFrame()
14829
14884
  }
14830
14885
  }
14831
14886
 
14832
- this.DrawSelectedBorder=function()
14887
+ this.DrawSelectedBorder=function(option)
14833
14888
  {
14834
14889
  if (this.Identify===0) return;
14835
14890
 
14836
14891
  var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();
14837
14892
 
14838
- //var left=ToFixedPoint(border.Left);
14893
+ var left=ToFixedPoint(border.Left);
14839
14894
  var top=ToFixedPoint(border.Top);
14840
14895
  var right=ToFixedPoint(border.Right);
14841
14896
  var bottom=ToFixedPoint(border.Bottom);
@@ -14843,9 +14898,15 @@ function KLineFrame()
14843
14898
 
14844
14899
  this.Canvas.strokeStyle=this.SelBorderColor;
14845
14900
 
14846
- var xRight=ToFixedPoint(border.ChartWidth);
14847
- this.Canvas.strokeRect(right,top,xRight-right-1,height); //少一个像素让边框显示出来
14848
-
14901
+ if (option.Mode==1)
14902
+ {
14903
+ var xRight=ToFixedPoint(border.ChartWidth);
14904
+ this.Canvas.strokeRect(right,top,xRight-right-1,height); //少一个像素让边框显示出来
14905
+ }
14906
+ else
14907
+ {
14908
+ this.Canvas.strokeRect(left,top,right-left-1,height); //少一个像素让边框显示出来
14909
+ }
14849
14910
  }
14850
14911
 
14851
14912
  //是否在X轴坐标上
@@ -61869,7 +61930,7 @@ function JSChartResource()
61869
61930
  this.FrameTitleBGColor="rgb(246,251,253)"; //标题栏背景色
61870
61931
  this.SelFrameBorderColor='rgb(130, 130, 130)';
61871
61932
  this.Frame={
61872
- XBottomOffset:1*GetDevicePixelRatio(), //X轴文字向下偏移
61933
+ XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
61873
61934
  YTopOffset:2*GetDevicePixelRatio(), //Y轴顶部文字向下偏移
61874
61935
  YTextPadding:[2,2]
61875
61936
  };
@@ -68899,13 +68960,6 @@ function KLineChartContainer(uielement,OffscreenElement)
68899
68960
 
68900
68961
  overlayFrame.Frame=frame;
68901
68962
 
68902
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
68903
- if (event && event.Callback)
68904
- {
68905
- var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
68906
- event.Callback(event, sendData, this);
68907
- }
68908
-
68909
68963
  if (apiItem)
68910
68964
  {
68911
68965
  var apiIndex=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,obj, true);
@@ -68940,6 +68994,13 @@ function KLineChartContainer(uielement,OffscreenElement)
68940
68994
  overlayFrame.Script=scriptIndex;
68941
68995
  }
68942
68996
 
68997
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
68998
+ if (event && event.Callback)
68999
+ {
69000
+ var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
69001
+ event.Callback(event, sendData, this);
69002
+ }
69003
+
68943
69004
  subFrame.OverlayIndex.push(overlayFrame);
68944
69005
  return overlayFrame;
68945
69006
  }
@@ -116,7 +116,7 @@ function GetBlackStyle()
116
116
 
117
117
  Frame:
118
118
  {
119
- XBottomOffset:1*GetDevicePixelRatio(), //X轴文字向下偏移
119
+ XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
120
120
 
121
121
  PercentageText: //百分比坐标文字颜色
122
122
  {
@@ -4439,6 +4439,11 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4439
4439
  {
4440
4440
  var item=option.GlobalOption;
4441
4441
  if (IFrameSplitOperator.IsBool(item.IsValueFullRange)) chart.GlobalOption.IsValueFullRange=item.IsValueFullRange;
4442
+ if (item.SelectedBorder)
4443
+ {
4444
+ var subItem=item.SelectedBorder;
4445
+ if (IFrameSplitOperator.IsNumber(subItem.Mode)) chart.GlobalOption.SelectedBorder.Mode=subItem.Mode;
4446
+ }
4442
4447
  }
4443
4448
 
4444
4449
  if (option.EnableYDrag)
@@ -6987,7 +6992,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6987
6992
  this.IndexChartDrag; //拖拽指标图形
6988
6993
  this.EnableIndexChartDrag=false;
6989
6994
 
6990
- this.GlobalOption={ IsValueFullRange:false , IsDisplayLatest:false }; //XDateFormat (多日分时图x轴底部日期格式)
6995
+ this.GlobalOption=
6996
+ {
6997
+ IsValueFullRange:false ,
6998
+ IsDisplayLatest:false,
6999
+ SelectedBorder:{ Mode:0, SelFrame:0 } //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
7000
+ //XDateFormat (多日分时图x轴底部日期格式)
7001
+ };
6991
7002
 
6992
7003
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
6993
7004
  this.EnableVerticalDrag=false;
@@ -7415,6 +7426,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7415
7426
  return;
7416
7427
  }
7417
7428
 
7429
+ var bDrawDynamicInfo=false;
7430
+ if (this.GlobalOption.SelectedBorder && this.GlobalOption.SelectedBorder.Mode>=1)
7431
+ {
7432
+ var item=this.GlobalOption.SelectedBorder;
7433
+ var frameId=this.Frame.PtInFrame(x,y);
7434
+ if (frameId>=0 && frameId!=item.SelFrame)
7435
+ {
7436
+ item.SelFrame=frameId;
7437
+ bDrawDynamicInfo=true;
7438
+ }
7439
+ }
7440
+
7418
7441
  if (this.TryClickCrossCursor(x,y, e))
7419
7442
  {
7420
7443
  return;
@@ -7684,12 +7707,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7684
7707
  else
7685
7708
  this.DrawDynamicInfo();
7686
7709
  }
7710
+ else if (bDrawDynamicInfo)
7711
+ {
7712
+ this.DrawDynamicInfo();
7713
+ }
7687
7714
 
7688
7715
  }
7689
7716
  }
7690
7717
 
7691
7718
  document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
7692
7719
  document.onmouseup=(e)=> { this.DocOnMouseUp(e); }
7720
+
7721
+
7693
7722
  }
7694
7723
 
7695
7724
  this.DocOnMouseMove=function(e)
@@ -9206,6 +9235,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9206
9235
  if (this.Frame.DrawToolbar) this.Frame.DrawToolbar(this.LastMouseStatus);
9207
9236
  this.DrawSelectedStatus();
9208
9237
 
9238
+ this.DrawSelectedBorder();
9239
+
9209
9240
  var moveonPoint=null;
9210
9241
  if (this.LastMouseStatus && this.LastMouseStatus.MoveOnPoint) moveonPoint=this.LastMouseStatus.MoveOnPoint;
9211
9242
  for(var i=0;i<this.ExtendChartPaint.length;++i) //动态扩展图形
@@ -9421,6 +9452,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9421
9452
  }
9422
9453
  }
9423
9454
 
9455
+ this.DrawSelectedBorder=function()
9456
+ {
9457
+ if (!this.GlobalOption.SelectedBorder) return;
9458
+ var item=this.GlobalOption.SelectedBorder;
9459
+ if (!IFrameSplitOperator.IsPlusNumber(item.Mode)) return;
9460
+ if (!IFrameSplitOperator.IsNumber(item.SelFrame) && item.SelFrame<0) return;
9461
+
9462
+ var subFrame=this.Frame.SubFrame[item.SelFrame];
9463
+ if (!subFrame) return;
9464
+
9465
+ if (subFrame.Frame.DrawSelectedBorder) subFrame.Frame.DrawSelectedBorder(item);
9466
+ }
9467
+
9424
9468
  //当前屏K线涨幅Y轴刻度
9425
9469
  this.KLineIncreaseCustomHorizontal=function()
9426
9470
  {
@@ -9575,6 +9619,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9575
9619
  if (this.Frame.DrawToolbar) this.Frame.DrawToolbar(this.LastMouseStatus);
9576
9620
 
9577
9621
  this.DrawSelectedStatus();
9622
+ this.DrawSelectedBorder();
9578
9623
 
9579
9624
  var moveonPoint=null;
9580
9625
  if (this.LastMouseStatus && this.LastMouseStatus.MoveOnPoint) moveonPoint=this.LastMouseStatus.MoveOnPoint;
@@ -12537,14 +12582,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12537
12582
 
12538
12583
  overlayFrame.Frame=frame;
12539
12584
 
12540
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
12541
- if (event && event.Callback)
12542
- {
12543
- var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
12544
- event.Callback(event, sendData, this);
12545
- }
12546
-
12547
-
12548
12585
  var scriptIndex;
12549
12586
  if (findItem)
12550
12587
  {
@@ -12558,6 +12595,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12558
12595
  }
12559
12596
 
12560
12597
  overlayFrame.Script=scriptIndex;
12598
+
12599
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
12600
+ if (event && event.Callback)
12601
+ {
12602
+ var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
12603
+ event.Callback(event, sendData, this);
12604
+ }
12605
+
12561
12606
  subFrame.OverlayIndex.push(overlayFrame);
12562
12607
 
12563
12608
  var updateWindowIndex=dest.WindowIndex;
@@ -13836,7 +13881,11 @@ function AverageWidthFrame()
13836
13881
  //Y轴刻度长线
13837
13882
  this.YLineExtend; //[0]=左 [1]=右 { Width:5, Color:颜色, }
13838
13883
  this.YTextExtend; //[0]=左 [1]=右 { Align:0=默认 1=左对齐 2=右对齐 }
13839
- this.YRightTextInfo;
13884
+ this.YRightTextInfo;
13885
+
13886
+ //X轴延长线
13887
+ this.XTextExtend; //[0]=底部 { Align:0=默认(居中), 1=左对齐 }
13888
+ this.XLineExtend; //[0]=底部 { Mode:1, Color: } Mode=1 分割线 Mode=2短线
13840
13889
 
13841
13890
  //画图工具刻度
13842
13891
 
@@ -14654,6 +14703,18 @@ function AverageWidthFrame()
14654
14703
  //JSConsole.Chart.Log('[AverageWidthFrame.DrawVertical] bottom',bottom);
14655
14704
  if (this.ChartBorder.Bottom<=5*GetDevicePixelRatio()) return; //高度不够 不显示
14656
14705
 
14706
+ var bottomTextExtend=null;
14707
+ if (this.XTextExtend)
14708
+ {
14709
+ bottomTextExtend=this.XTextExtend[0];
14710
+ }
14711
+
14712
+ var bottomLineExtend=null;
14713
+ if (this.XLineExtend)
14714
+ {
14715
+ bottomLineExtend=this.XLineExtend[0];
14716
+ }
14717
+
14657
14718
  var xPrev=null; //上一个坐标x的值
14658
14719
  var textRightPrev=null; //上一次刻度输出右边x坐标
14659
14720
  for(var i=0; i<this.VerticalInfo.length; ++i)
@@ -14697,7 +14758,7 @@ function AverageWidthFrame()
14697
14758
  {
14698
14759
  this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;
14699
14760
  this.Canvas.beginPath();
14700
- this.Canvas.moveTo(xFixed,top);
14761
+ this.Canvas.moveTo(xFiixed,top);
14701
14762
  this.Canvas.lineTo(xFixed,bottom);
14702
14763
  this.Canvas.stroke();
14703
14764
  }
@@ -14718,31 +14779,39 @@ function AverageWidthFrame()
14718
14779
 
14719
14780
  if (this.VerticalInfo[i].Message[0]!=null)
14720
14781
  {
14721
- if (this.VerticalInfo[i].Font!=null)
14722
- this.Canvas.font=this.VerticalInfo[i].Font;
14723
-
14782
+ if (this.VerticalInfo[i].Font) this.Canvas.font=this.VerticalInfo[i].Font;
14783
+
14724
14784
  var textLeft=0;
14725
14785
 
14726
14786
  this.Canvas.strokeStyle=item.TextColor;
14727
14787
  var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
14728
14788
  var textHeight=this.Canvas.measureText("擎").width;
14729
- if (x<testWidth/2)
14789
+ if (bottomTextExtend && bottomTextExtend.Align==1)
14730
14790
  {
14731
14791
  this.Canvas.textAlign="left";
14732
14792
  this.Canvas.textBaseline="top";
14733
14793
  textLeft=x;
14734
14794
  }
14735
- else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
14736
- {
14737
- this.Canvas.textAlign = "right";
14738
- this.Canvas.textBaseline="top";
14739
- textLeft=x-testWidth;
14740
- }
14741
14795
  else
14742
14796
  {
14743
- this.Canvas.textAlign="center";
14744
- this.Canvas.textBaseline="top";
14745
- textLeft=x-(testWidth/2);
14797
+ if (x<testWidth/2)
14798
+ {
14799
+ this.Canvas.textAlign="left";
14800
+ this.Canvas.textBaseline="top";
14801
+ textLeft=x;
14802
+ }
14803
+ else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
14804
+ {
14805
+ this.Canvas.textAlign = "right";
14806
+ this.Canvas.textBaseline="top";
14807
+ textLeft=x-testWidth;
14808
+ }
14809
+ else
14810
+ {
14811
+ this.Canvas.textAlign="center";
14812
+ this.Canvas.textBaseline="top";
14813
+ textLeft=x-(testWidth/2);
14814
+ }
14746
14815
  }
14747
14816
 
14748
14817
  if (textRightPrev==null || textLeft>textRightPrev)
@@ -14759,6 +14828,36 @@ function AverageWidthFrame()
14759
14828
  yText+=lineLength+2*pixelRatio;
14760
14829
  }
14761
14830
 
14831
+ if (bottomLineExtend)
14832
+ {
14833
+ if (bottomLineExtend.Mode===1)
14834
+ {
14835
+ if (item.Value>1)
14836
+ {
14837
+ if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
14838
+ this.Canvas.beginPath();
14839
+ this.Canvas.moveTo(xFixed,bottom);
14840
+ this.Canvas.lineTo(xFixed,border.ChartHeight);
14841
+ this.Canvas.stroke();
14842
+ x+=1;
14843
+ }
14844
+ }
14845
+ else if (bottomLineExtend.Mode===2)
14846
+ {
14847
+ if (bottomLineExtend.Width>=1)
14848
+ {
14849
+ var lineLength=bottomLineExtend.Width;
14850
+ if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
14851
+ this.Canvas.beginPath();
14852
+ this.Canvas.moveTo(xFixed,yText);
14853
+ this.Canvas.lineTo(xFixed,yText+lineLength);
14854
+ this.Canvas.stroke();
14855
+
14856
+ yText+=lineLength+2;
14857
+ }
14858
+ }
14859
+ }
14860
+
14762
14861
  //item.TextBGColor="rgb(0,255,0)";
14763
14862
  if (item.TextBGColor) //文字背景色
14764
14863
  {
@@ -17748,6 +17847,8 @@ function KLineFrame()
17748
17847
  this.TitleWindow=g_JSChartResource.KLineToolbar.TitleWindow;
17749
17848
  this.ExportData=g_JSChartResource.KLineToolbar.ExportData; //是否显示'导出数据'菜单
17750
17849
 
17850
+ this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
17851
+
17751
17852
  this.ModifyIndexEvent; //改参数 点击事件
17752
17853
  this.ChangeIndexEvent; //换指标 点击事件
17753
17854
  this.ToolbarRect=null; //保存工具条的位置
@@ -18927,6 +19028,31 @@ function KLineFrame()
18927
19028
  }
18928
19029
  }
18929
19030
 
19031
+ this.DrawSelectedBorder=function(option)
19032
+ {
19033
+ if (this.Identify===0) return;
19034
+
19035
+ var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();
19036
+
19037
+ var left=ToFixedPoint(border.Left);
19038
+ var top=ToFixedPoint(border.Top);
19039
+ var right=ToFixedPoint(border.Right);
19040
+ var bottom=ToFixedPoint(border.Bottom);
19041
+ var height=bottom-top;
19042
+
19043
+ this.Canvas.strokeStyle=this.SelBorderColor;
19044
+
19045
+ if (option.Mode==1)
19046
+ {
19047
+ var xRight=ToFixedPoint(border.ChartWidth);
19048
+ this.Canvas.strokeRect(right,top,xRight-right-1,height); //少一个像素让边框显示出来
19049
+ }
19050
+ else
19051
+ {
19052
+ this.Canvas.strokeRect(left,top,right-left-1,height); //少一个像素让边框显示出来
19053
+ }
19054
+ }
19055
+
18930
19056
  //是否在X轴坐标上
18931
19057
  //this.PtInVertical=function(x,y) { return false; }
18932
19058
  }
@@ -18961,6 +19087,7 @@ function OverlayKLineFrame()
18961
19087
 
18962
19088
  this.CloseButton=CloneData(g_JSChartResource.Buttons.CloseOverlayIndex);
18963
19089
  this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);
19090
+ this.DrawSelectedBorder=null;
18964
19091
 
18965
19092
  this.KLineFrame_ReloadResource=this.ReloadResource;
18966
19093
  this.ReloadResource=function(resource)
@@ -19689,6 +19816,8 @@ function KLineHScreenFrame()
19689
19816
  this.ClassName='KLineHScreenFrame';
19690
19817
  this.IsHScreen=true; //是否是横屏
19691
19818
 
19819
+ this.DrawSelectedBorder=null;
19820
+
19692
19821
  //画标题背景色
19693
19822
  this.DrawTitleBG=function()
19694
19823
  {
@@ -40536,7 +40665,7 @@ function ChartDrawSVG()
40536
40665
  x=this.ChartFrame.GetXFromIndex(index);
40537
40666
  if (item.Value=="Top") y=top;
40538
40667
  else if (item.Value=="Bottom") y=bottom;
40539
- else y=this.ChartFrame.GetYFromData(item.Value);
40668
+ else y=this.ChartFrame.GetYFromData(item.Value, false);
40540
40669
  if (IFrameSplitOperator.IsNumber(item.YOffset)) y+=item.YOffset; //Y轴偏移
40541
40670
 
40542
40671
  var svgItem=item.SVG;
@@ -65943,8 +66072,9 @@ function JSChartResource()
65943
66072
  this.FrameSplitTextColor="rgb(117,125,129)"; //刻度文字颜色
65944
66073
  this.FrameSplitTextFont=14*GetDevicePixelRatio() +"px 微软雅黑"; //坐标刻度文字字体
65945
66074
  this.FrameTitleBGColor="rgb(246,251,253)"; //标题栏背景色
66075
+ this.SelFrameBorderColor='rgb(130, 130, 130)';
65946
66076
  this.Frame={
65947
- XBottomOffset:1*GetDevicePixelRatio(), //X轴文字向下偏移
66077
+ XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
65948
66078
  YTopOffset:2*GetDevicePixelRatio(), //Y轴顶部文字向下偏移
65949
66079
  YTextPadding:[2,2]
65950
66080
  };
@@ -67000,6 +67130,7 @@ function JSChartResource()
67000
67130
  if (style.FrameSplitTextColor) this.FrameSplitTextColor = style.FrameSplitTextColor;
67001
67131
  if (style.FrameSplitTextFont) this.FrameSplitTextFont = style.FrameSplitTextFont;
67002
67132
  if (style.FrameTitleBGColor) this.FrameTitleBGColor = style.FrameTitleBGColor;
67133
+ if (style.SelFrameBorderColor) this.SelFrameBorderColor=style.SelFrameBorderColor;
67003
67134
  if (IFrameSplitOperator.IsNumber(style.IndexTitleMerginLeft)) this.IndexTitleMerginLeft = style.IndexTitleMerginLeft;
67004
67135
 
67005
67136
  if (style.Frame)
@@ -72973,13 +73104,6 @@ function KLineChartContainer(uielement,OffscreenElement)
72973
73104
 
72974
73105
  overlayFrame.Frame=frame;
72975
73106
 
72976
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
72977
- if (event && event.Callback)
72978
- {
72979
- var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
72980
- event.Callback(event, sendData, this);
72981
- }
72982
-
72983
73107
  if (apiItem)
72984
73108
  {
72985
73109
  var apiIndex=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,obj, true);
@@ -73014,6 +73138,13 @@ function KLineChartContainer(uielement,OffscreenElement)
73014
73138
  overlayFrame.Script=scriptIndex;
73015
73139
  }
73016
73140
 
73141
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
73142
+ if (event && event.Callback)
73143
+ {
73144
+ var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
73145
+ event.Callback(event, sendData, this);
73146
+ }
73147
+
73017
73148
  subFrame.OverlayIndex.push(overlayFrame);
73018
73149
  return overlayFrame;
73019
73150
  }
@@ -116418,6 +116549,9 @@ function OverlayScriptIndex(name,script,args,option)
116418
116549
  case 'DRAWICON':
116419
116550
  this.CreateIcon(hqChart,windowIndex,item,i);
116420
116551
  break;
116552
+ case "TIPICON":
116553
+ this.CreateTipIcon(hqChart,windowIndex,item,i);
116554
+ break;
116421
116555
  case 'DRAWCHANNEL':
116422
116556
  this.CreateChannel(hqChart,windowIndex,item,i);
116423
116557
  break;
@@ -117130,6 +117264,74 @@ function OverlayScriptIndex(name,script,args,option)
117130
117264
  frame.ChartPaint.push(chart);
117131
117265
  }
117132
117266
 
117267
+ this.CreateTipIcon=function(hqChart,windowIndex,varItem,id)
117268
+ {
117269
+ var overlayIndex=this.OverlayIndex;
117270
+ var frame=overlayIndex.Frame;
117271
+ var chart=new ChartDrawSVG();
117272
+ chart.Canvas=hqChart.Canvas;
117273
+
117274
+ chart.Name=varItem.Name;
117275
+ chart.ChartBorder=frame.Frame.ChartBorder;
117276
+ chart.ChartFrame=frame.Frame;
117277
+ chart.Identify=overlayIndex.Identify;
117278
+
117279
+ if (hqChart.ChartPaint[0].IsMinuteFrame())
117280
+ chart.Data=hqChart.SourceData;
117281
+ else
117282
+ chart.Data=hqChart.ChartPaint[0].Data; //绑定K线
117283
+
117284
+ chart.Family=varItem.Draw.Icon.Family;
117285
+ chart.TextFont=g_JSChartResource.TIPICON.TextFont;
117286
+
117287
+ var svgSize=g_JSChartResource.TIPICON.Size;
117288
+ var svgColor=g_JSChartResource.TIPICON.Color;
117289
+ var svgYOffset=0;
117290
+ var svgVAlign=2; //上下对齐方式
117291
+ if (IFrameSplitOperator.IsNumber(varItem.YOffset)) svgYOffset=varItem.YOffset;
117292
+ if (varItem.Color) svgColor=this.GetColor(varItem.Color);
117293
+ if (varItem.DrawFontSize>0) svgSize=varItem.DrawFontSize;
117294
+ if (varItem.DrawVAlign>=0) svgVAlign=varItem.DrawVAlign;
117295
+
117296
+ if (varItem.Draw && IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.DrawData) && varItem.Draw.Icon)
117297
+ {
117298
+ var drawData=varItem.Draw.DrawData;
117299
+ var aryData=[];
117300
+ var isArrayTip=Array.isArray(varItem.Draw.Text);
117301
+ var singleTip=null;
117302
+ if (!isArrayTip && varItem.Draw.Text) singleTip={ Text:varItem.Draw.Text };
117303
+
117304
+ for(var j=0;j<drawData.length;++j)
117305
+ {
117306
+ var item=drawData[j];
117307
+ if (!IFrameSplitOperator.IsNumber(item)) continue;
117308
+
117309
+ var svgItem=
117310
+ {
117311
+ Index:j, Value:item,
117312
+ SVG:{ Symbol:varItem.Draw.Icon.Symbol, Size:svgSize, Color:svgColor, YOffset:svgYOffset, VAlign:svgVAlign }
117313
+ };
117314
+
117315
+ if (isArrayTip)
117316
+ {
117317
+ var text=varItem.Draw.Text[j];
117318
+ if (text) svgItem.Tooltip={ Text:text };
117319
+ }
117320
+ else
117321
+ {
117322
+ svgItem.Tooltip=singleTip;
117323
+ }
117324
+
117325
+ aryData.push(svgItem);
117326
+ }
117327
+
117328
+ chart.Texts= aryData;
117329
+ }
117330
+
117331
+ frame.ChartPaint.push(chart);
117332
+ }
117333
+
117334
+
117133
117335
  //创建通道
117134
117336
  this.CreateChannel=function(hqChart,windowIndex,varItem,id)
117135
117337
  {
@@ -120261,7 +120463,7 @@ function GetBlackStyle()
120261
120463
 
120262
120464
  Frame:
120263
120465
  {
120264
- XBottomOffset:1*GetDevicePixelRatio(), //X轴文字向下偏移
120466
+ XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
120265
120467
 
120266
120468
  PercentageText: //百分比坐标文字颜色
120267
120469
  {
@@ -131034,7 +131236,7 @@ function ScrollBarBGChart()
131034
131236
 
131035
131237
 
131036
131238
 
131037
- var HQCHART_VERSION="1.1.12732";
131239
+ var HQCHART_VERSION="1.1.12740";
131038
131240
 
131039
131241
  function PrintHQChartVersion()
131040
131242
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12732";
8
+ var HQCHART_VERSION="1.1.12740";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -4483,6 +4483,11 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4483
4483
  {
4484
4484
  var item=option.GlobalOption;
4485
4485
  if (IFrameSplitOperator.IsBool(item.IsValueFullRange)) chart.GlobalOption.IsValueFullRange=item.IsValueFullRange;
4486
+ if (item.SelectedBorder)
4487
+ {
4488
+ var subItem=item.SelectedBorder;
4489
+ if (IFrameSplitOperator.IsNumber(subItem.Mode)) chart.GlobalOption.SelectedBorder.Mode=subItem.Mode;
4490
+ }
4486
4491
  }
4487
4492
 
4488
4493
  if (option.EnableYDrag)
@@ -7031,7 +7036,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7031
7036
  this.IndexChartDrag; //拖拽指标图形
7032
7037
  this.EnableIndexChartDrag=false;
7033
7038
 
7034
- this.GlobalOption={ IsValueFullRange:false , IsDisplayLatest:false }; //XDateFormat (多日分时图x轴底部日期格式)
7039
+ this.GlobalOption=
7040
+ {
7041
+ IsValueFullRange:false ,
7042
+ IsDisplayLatest:false,
7043
+ SelectedBorder:{ Mode:0, SelFrame:0 } //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
7044
+ //XDateFormat (多日分时图x轴底部日期格式)
7045
+ };
7035
7046
 
7036
7047
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
7037
7048
  this.EnableVerticalDrag=false;
@@ -7459,6 +7470,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7459
7470
  return;
7460
7471
  }
7461
7472
 
7473
+ var bDrawDynamicInfo=false;
7474
+ if (this.GlobalOption.SelectedBorder && this.GlobalOption.SelectedBorder.Mode>=1)
7475
+ {
7476
+ var item=this.GlobalOption.SelectedBorder;
7477
+ var frameId=this.Frame.PtInFrame(x,y);
7478
+ if (frameId>=0 && frameId!=item.SelFrame)
7479
+ {
7480
+ item.SelFrame=frameId;
7481
+ bDrawDynamicInfo=true;
7482
+ }
7483
+ }
7484
+
7462
7485
  if (this.TryClickCrossCursor(x,y, e))
7463
7486
  {
7464
7487
  return;
@@ -7728,12 +7751,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7728
7751
  else
7729
7752
  this.DrawDynamicInfo();
7730
7753
  }
7754
+ else if (bDrawDynamicInfo)
7755
+ {
7756
+ this.DrawDynamicInfo();
7757
+ }
7731
7758
 
7732
7759
  }
7733
7760
  }
7734
7761
 
7735
7762
  document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
7736
7763
  document.onmouseup=(e)=> { this.DocOnMouseUp(e); }
7764
+
7765
+
7737
7766
  }
7738
7767
 
7739
7768
  this.DocOnMouseMove=function(e)
@@ -9250,6 +9279,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9250
9279
  if (this.Frame.DrawToolbar) this.Frame.DrawToolbar(this.LastMouseStatus);
9251
9280
  this.DrawSelectedStatus();
9252
9281
 
9282
+ this.DrawSelectedBorder();
9283
+
9253
9284
  var moveonPoint=null;
9254
9285
  if (this.LastMouseStatus && this.LastMouseStatus.MoveOnPoint) moveonPoint=this.LastMouseStatus.MoveOnPoint;
9255
9286
  for(var i=0;i<this.ExtendChartPaint.length;++i) //动态扩展图形
@@ -9465,6 +9496,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9465
9496
  }
9466
9497
  }
9467
9498
 
9499
+ this.DrawSelectedBorder=function()
9500
+ {
9501
+ if (!this.GlobalOption.SelectedBorder) return;
9502
+ var item=this.GlobalOption.SelectedBorder;
9503
+ if (!IFrameSplitOperator.IsPlusNumber(item.Mode)) return;
9504
+ if (!IFrameSplitOperator.IsNumber(item.SelFrame) && item.SelFrame<0) return;
9505
+
9506
+ var subFrame=this.Frame.SubFrame[item.SelFrame];
9507
+ if (!subFrame) return;
9508
+
9509
+ if (subFrame.Frame.DrawSelectedBorder) subFrame.Frame.DrawSelectedBorder(item);
9510
+ }
9511
+
9468
9512
  //当前屏K线涨幅Y轴刻度
9469
9513
  this.KLineIncreaseCustomHorizontal=function()
9470
9514
  {
@@ -9619,6 +9663,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9619
9663
  if (this.Frame.DrawToolbar) this.Frame.DrawToolbar(this.LastMouseStatus);
9620
9664
 
9621
9665
  this.DrawSelectedStatus();
9666
+ this.DrawSelectedBorder();
9622
9667
 
9623
9668
  var moveonPoint=null;
9624
9669
  if (this.LastMouseStatus && this.LastMouseStatus.MoveOnPoint) moveonPoint=this.LastMouseStatus.MoveOnPoint;
@@ -12581,14 +12626,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12581
12626
 
12582
12627
  overlayFrame.Frame=frame;
12583
12628
 
12584
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
12585
- if (event && event.Callback)
12586
- {
12587
- var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
12588
- event.Callback(event, sendData, this);
12589
- }
12590
-
12591
-
12592
12629
  var scriptIndex;
12593
12630
  if (findItem)
12594
12631
  {
@@ -12602,6 +12639,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12602
12639
  }
12603
12640
 
12604
12641
  overlayFrame.Script=scriptIndex;
12642
+
12643
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
12644
+ if (event && event.Callback)
12645
+ {
12646
+ var sendData={ OverlayFrame:overlayFrame, WindowIndex:dest.WindowIndex, SubFrame:subFrame };
12647
+ event.Callback(event, sendData, this);
12648
+ }
12649
+
12605
12650
  subFrame.OverlayIndex.push(overlayFrame);
12606
12651
 
12607
12652
  var updateWindowIndex=dest.WindowIndex;
@@ -13880,7 +13925,11 @@ function AverageWidthFrame()
13880
13925
  //Y轴刻度长线
13881
13926
  this.YLineExtend; //[0]=左 [1]=右 { Width:5, Color:颜色, }
13882
13927
  this.YTextExtend; //[0]=左 [1]=右 { Align:0=默认 1=左对齐 2=右对齐 }
13883
- this.YRightTextInfo;
13928
+ this.YRightTextInfo;
13929
+
13930
+ //X轴延长线
13931
+ this.XTextExtend; //[0]=底部 { Align:0=默认(居中), 1=左对齐 }
13932
+ this.XLineExtend; //[0]=底部 { Mode:1, Color: } Mode=1 分割线 Mode=2短线
13884
13933
 
13885
13934
  //画图工具刻度
13886
13935
 
@@ -14698,6 +14747,18 @@ function AverageWidthFrame()
14698
14747
  //JSConsole.Chart.Log('[AverageWidthFrame.DrawVertical] bottom',bottom);
14699
14748
  if (this.ChartBorder.Bottom<=5*GetDevicePixelRatio()) return; //高度不够 不显示
14700
14749
 
14750
+ var bottomTextExtend=null;
14751
+ if (this.XTextExtend)
14752
+ {
14753
+ bottomTextExtend=this.XTextExtend[0];
14754
+ }
14755
+
14756
+ var bottomLineExtend=null;
14757
+ if (this.XLineExtend)
14758
+ {
14759
+ bottomLineExtend=this.XLineExtend[0];
14760
+ }
14761
+
14701
14762
  var xPrev=null; //上一个坐标x的值
14702
14763
  var textRightPrev=null; //上一次刻度输出右边x坐标
14703
14764
  for(var i=0; i<this.VerticalInfo.length; ++i)
@@ -14741,7 +14802,7 @@ function AverageWidthFrame()
14741
14802
  {
14742
14803
  this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;
14743
14804
  this.Canvas.beginPath();
14744
- this.Canvas.moveTo(xFixed,top);
14805
+ this.Canvas.moveTo(xFiixed,top);
14745
14806
  this.Canvas.lineTo(xFixed,bottom);
14746
14807
  this.Canvas.stroke();
14747
14808
  }
@@ -14762,31 +14823,39 @@ function AverageWidthFrame()
14762
14823
 
14763
14824
  if (this.VerticalInfo[i].Message[0]!=null)
14764
14825
  {
14765
- if (this.VerticalInfo[i].Font!=null)
14766
- this.Canvas.font=this.VerticalInfo[i].Font;
14767
-
14826
+ if (this.VerticalInfo[i].Font) this.Canvas.font=this.VerticalInfo[i].Font;
14827
+
14768
14828
  var textLeft=0;
14769
14829
 
14770
14830
  this.Canvas.strokeStyle=item.TextColor;
14771
14831
  var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
14772
14832
  var textHeight=this.Canvas.measureText("擎").width;
14773
- if (x<testWidth/2)
14833
+ if (bottomTextExtend && bottomTextExtend.Align==1)
14774
14834
  {
14775
14835
  this.Canvas.textAlign="left";
14776
14836
  this.Canvas.textBaseline="top";
14777
14837
  textLeft=x;
14778
14838
  }
14779
- else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
14780
- {
14781
- this.Canvas.textAlign = "right";
14782
- this.Canvas.textBaseline="top";
14783
- textLeft=x-testWidth;
14784
- }
14785
14839
  else
14786
14840
  {
14787
- this.Canvas.textAlign="center";
14788
- this.Canvas.textBaseline="top";
14789
- textLeft=x-(testWidth/2);
14841
+ if (x<testWidth/2)
14842
+ {
14843
+ this.Canvas.textAlign="left";
14844
+ this.Canvas.textBaseline="top";
14845
+ textLeft=x;
14846
+ }
14847
+ else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
14848
+ {
14849
+ this.Canvas.textAlign = "right";
14850
+ this.Canvas.textBaseline="top";
14851
+ textLeft=x-testWidth;
14852
+ }
14853
+ else
14854
+ {
14855
+ this.Canvas.textAlign="center";
14856
+ this.Canvas.textBaseline="top";
14857
+ textLeft=x-(testWidth/2);
14858
+ }
14790
14859
  }
14791
14860
 
14792
14861
  if (textRightPrev==null || textLeft>textRightPrev)
@@ -14803,6 +14872,36 @@ function AverageWidthFrame()
14803
14872
  yText+=lineLength+2*pixelRatio;
14804
14873
  }
14805
14874
 
14875
+ if (bottomLineExtend)
14876
+ {
14877
+ if (bottomLineExtend.Mode===1)
14878
+ {
14879
+ if (item.Value>1)
14880
+ {
14881
+ if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
14882
+ this.Canvas.beginPath();
14883
+ this.Canvas.moveTo(xFixed,bottom);
14884
+ this.Canvas.lineTo(xFixed,border.ChartHeight);
14885
+ this.Canvas.stroke();
14886
+ x+=1;
14887
+ }
14888
+ }
14889
+ else if (bottomLineExtend.Mode===2)
14890
+ {
14891
+ if (bottomLineExtend.Width>=1)
14892
+ {
14893
+ var lineLength=bottomLineExtend.Width;
14894
+ if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
14895
+ this.Canvas.beginPath();
14896
+ this.Canvas.moveTo(xFixed,yText);
14897
+ this.Canvas.lineTo(xFixed,yText+lineLength);
14898
+ this.Canvas.stroke();
14899
+
14900
+ yText+=lineLength+2;
14901
+ }
14902
+ }
14903
+ }
14904
+
14806
14905
  //item.TextBGColor="rgb(0,255,0)";
14807
14906
  if (item.TextBGColor) //文字背景色
14808
14907
  {
@@ -17792,6 +17891,8 @@ function KLineFrame()
17792
17891
  this.TitleWindow=g_JSChartResource.KLineToolbar.TitleWindow;
17793
17892
  this.ExportData=g_JSChartResource.KLineToolbar.ExportData; //是否显示'导出数据'菜单
17794
17893
 
17894
+ this.SelBorderColor=g_JSChartResource.SelFrameBorderColor;
17895
+
17795
17896
  this.ModifyIndexEvent; //改参数 点击事件
17796
17897
  this.ChangeIndexEvent; //换指标 点击事件
17797
17898
  this.ToolbarRect=null; //保存工具条的位置
@@ -18971,6 +19072,31 @@ function KLineFrame()
18971
19072
  }
18972
19073
  }
18973
19074
 
19075
+ this.DrawSelectedBorder=function(option)
19076
+ {
19077
+ if (this.Identify===0) return;
19078
+
19079
+ var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();
19080
+
19081
+ var left=ToFixedPoint(border.Left);
19082
+ var top=ToFixedPoint(border.Top);
19083
+ var right=ToFixedPoint(border.Right);
19084
+ var bottom=ToFixedPoint(border.Bottom);
19085
+ var height=bottom-top;
19086
+
19087
+ this.Canvas.strokeStyle=this.SelBorderColor;
19088
+
19089
+ if (option.Mode==1)
19090
+ {
19091
+ var xRight=ToFixedPoint(border.ChartWidth);
19092
+ this.Canvas.strokeRect(right,top,xRight-right-1,height); //少一个像素让边框显示出来
19093
+ }
19094
+ else
19095
+ {
19096
+ this.Canvas.strokeRect(left,top,right-left-1,height); //少一个像素让边框显示出来
19097
+ }
19098
+ }
19099
+
18974
19100
  //是否在X轴坐标上
18975
19101
  //this.PtInVertical=function(x,y) { return false; }
18976
19102
  }
@@ -19005,6 +19131,7 @@ function OverlayKLineFrame()
19005
19131
 
19006
19132
  this.CloseButton=CloneData(g_JSChartResource.Buttons.CloseOverlayIndex);
19007
19133
  this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);
19134
+ this.DrawSelectedBorder=null;
19008
19135
 
19009
19136
  this.KLineFrame_ReloadResource=this.ReloadResource;
19010
19137
  this.ReloadResource=function(resource)
@@ -19733,6 +19860,8 @@ function KLineHScreenFrame()
19733
19860
  this.ClassName='KLineHScreenFrame';
19734
19861
  this.IsHScreen=true; //是否是横屏
19735
19862
 
19863
+ this.DrawSelectedBorder=null;
19864
+
19736
19865
  //画标题背景色
19737
19866
  this.DrawTitleBG=function()
19738
19867
  {
@@ -40580,7 +40709,7 @@ function ChartDrawSVG()
40580
40709
  x=this.ChartFrame.GetXFromIndex(index);
40581
40710
  if (item.Value=="Top") y=top;
40582
40711
  else if (item.Value=="Bottom") y=bottom;
40583
- else y=this.ChartFrame.GetYFromData(item.Value);
40712
+ else y=this.ChartFrame.GetYFromData(item.Value, false);
40584
40713
  if (IFrameSplitOperator.IsNumber(item.YOffset)) y+=item.YOffset; //Y轴偏移
40585
40714
 
40586
40715
  var svgItem=item.SVG;
@@ -65987,8 +66116,9 @@ function JSChartResource()
65987
66116
  this.FrameSplitTextColor="rgb(117,125,129)"; //刻度文字颜色
65988
66117
  this.FrameSplitTextFont=14*GetDevicePixelRatio() +"px 微软雅黑"; //坐标刻度文字字体
65989
66118
  this.FrameTitleBGColor="rgb(246,251,253)"; //标题栏背景色
66119
+ this.SelFrameBorderColor='rgb(130, 130, 130)';
65990
66120
  this.Frame={
65991
- XBottomOffset:1*GetDevicePixelRatio(), //X轴文字向下偏移
66121
+ XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
65992
66122
  YTopOffset:2*GetDevicePixelRatio(), //Y轴顶部文字向下偏移
65993
66123
  YTextPadding:[2,2]
65994
66124
  };
@@ -67044,6 +67174,7 @@ function JSChartResource()
67044
67174
  if (style.FrameSplitTextColor) this.FrameSplitTextColor = style.FrameSplitTextColor;
67045
67175
  if (style.FrameSplitTextFont) this.FrameSplitTextFont = style.FrameSplitTextFont;
67046
67176
  if (style.FrameTitleBGColor) this.FrameTitleBGColor = style.FrameTitleBGColor;
67177
+ if (style.SelFrameBorderColor) this.SelFrameBorderColor=style.SelFrameBorderColor;
67047
67178
  if (IFrameSplitOperator.IsNumber(style.IndexTitleMerginLeft)) this.IndexTitleMerginLeft = style.IndexTitleMerginLeft;
67048
67179
 
67049
67180
  if (style.Frame)
@@ -73017,13 +73148,6 @@ function KLineChartContainer(uielement,OffscreenElement)
73017
73148
 
73018
73149
  overlayFrame.Frame=frame;
73019
73150
 
73020
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
73021
- if (event && event.Callback)
73022
- {
73023
- var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
73024
- event.Callback(event, sendData, this);
73025
- }
73026
-
73027
73151
  if (apiItem)
73028
73152
  {
73029
73153
  var apiIndex=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,obj, true);
@@ -73058,6 +73182,13 @@ function KLineChartContainer(uielement,OffscreenElement)
73058
73182
  overlayFrame.Script=scriptIndex;
73059
73183
  }
73060
73184
 
73185
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_OVERLAY_FRAME);
73186
+ if (event && event.Callback)
73187
+ {
73188
+ var sendData={ OverlayFrame:overlayFrame, WindowIndex:windowIndex, SubFrame:subFrame };
73189
+ event.Callback(event, sendData, this);
73190
+ }
73191
+
73061
73192
  subFrame.OverlayIndex.push(overlayFrame);
73062
73193
  return overlayFrame;
73063
73194
  }
@@ -116462,6 +116593,9 @@ function OverlayScriptIndex(name,script,args,option)
116462
116593
  case 'DRAWICON':
116463
116594
  this.CreateIcon(hqChart,windowIndex,item,i);
116464
116595
  break;
116596
+ case "TIPICON":
116597
+ this.CreateTipIcon(hqChart,windowIndex,item,i);
116598
+ break;
116465
116599
  case 'DRAWCHANNEL':
116466
116600
  this.CreateChannel(hqChart,windowIndex,item,i);
116467
116601
  break;
@@ -117174,6 +117308,74 @@ function OverlayScriptIndex(name,script,args,option)
117174
117308
  frame.ChartPaint.push(chart);
117175
117309
  }
117176
117310
 
117311
+ this.CreateTipIcon=function(hqChart,windowIndex,varItem,id)
117312
+ {
117313
+ var overlayIndex=this.OverlayIndex;
117314
+ var frame=overlayIndex.Frame;
117315
+ var chart=new ChartDrawSVG();
117316
+ chart.Canvas=hqChart.Canvas;
117317
+
117318
+ chart.Name=varItem.Name;
117319
+ chart.ChartBorder=frame.Frame.ChartBorder;
117320
+ chart.ChartFrame=frame.Frame;
117321
+ chart.Identify=overlayIndex.Identify;
117322
+
117323
+ if (hqChart.ChartPaint[0].IsMinuteFrame())
117324
+ chart.Data=hqChart.SourceData;
117325
+ else
117326
+ chart.Data=hqChart.ChartPaint[0].Data; //绑定K线
117327
+
117328
+ chart.Family=varItem.Draw.Icon.Family;
117329
+ chart.TextFont=g_JSChartResource.TIPICON.TextFont;
117330
+
117331
+ var svgSize=g_JSChartResource.TIPICON.Size;
117332
+ var svgColor=g_JSChartResource.TIPICON.Color;
117333
+ var svgYOffset=0;
117334
+ var svgVAlign=2; //上下对齐方式
117335
+ if (IFrameSplitOperator.IsNumber(varItem.YOffset)) svgYOffset=varItem.YOffset;
117336
+ if (varItem.Color) svgColor=this.GetColor(varItem.Color);
117337
+ if (varItem.DrawFontSize>0) svgSize=varItem.DrawFontSize;
117338
+ if (varItem.DrawVAlign>=0) svgVAlign=varItem.DrawVAlign;
117339
+
117340
+ if (varItem.Draw && IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.DrawData) && varItem.Draw.Icon)
117341
+ {
117342
+ var drawData=varItem.Draw.DrawData;
117343
+ var aryData=[];
117344
+ var isArrayTip=Array.isArray(varItem.Draw.Text);
117345
+ var singleTip=null;
117346
+ if (!isArrayTip && varItem.Draw.Text) singleTip={ Text:varItem.Draw.Text };
117347
+
117348
+ for(var j=0;j<drawData.length;++j)
117349
+ {
117350
+ var item=drawData[j];
117351
+ if (!IFrameSplitOperator.IsNumber(item)) continue;
117352
+
117353
+ var svgItem=
117354
+ {
117355
+ Index:j, Value:item,
117356
+ SVG:{ Symbol:varItem.Draw.Icon.Symbol, Size:svgSize, Color:svgColor, YOffset:svgYOffset, VAlign:svgVAlign }
117357
+ };
117358
+
117359
+ if (isArrayTip)
117360
+ {
117361
+ var text=varItem.Draw.Text[j];
117362
+ if (text) svgItem.Tooltip={ Text:text };
117363
+ }
117364
+ else
117365
+ {
117366
+ svgItem.Tooltip=singleTip;
117367
+ }
117368
+
117369
+ aryData.push(svgItem);
117370
+ }
117371
+
117372
+ chart.Texts= aryData;
117373
+ }
117374
+
117375
+ frame.ChartPaint.push(chart);
117376
+ }
117377
+
117378
+
117177
117379
  //创建通道
117178
117380
  this.CreateChannel=function(hqChart,windowIndex,varItem,id)
117179
117381
  {
@@ -120305,7 +120507,7 @@ function GetBlackStyle()
120305
120507
 
120306
120508
  Frame:
120307
120509
  {
120308
- XBottomOffset:1*GetDevicePixelRatio(), //X轴文字向下偏移
120510
+ XBottomOffset:2*GetDevicePixelRatio(), //X轴文字向下偏移
120309
120511
 
120310
120512
  PercentageText: //百分比坐标文字颜色
120311
120513
  {
@@ -131192,7 +131394,7 @@ function HQChartScriptWorker()
131192
131394
 
131193
131395
 
131194
131396
 
131195
- var HQCHART_VERSION="1.1.12732";
131397
+ var HQCHART_VERSION="1.1.12740";
131196
131398
 
131197
131399
  function PrintHQChartVersion()
131198
131400
  {