hqchart 1.1.13389 → 1.1.13401

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.13389",
3
+ "version": "1.1.13401",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -10456,6 +10456,11 @@ function JSDraw(errorHandler,symbolData)
10456
10456
  return color;
10457
10457
  }
10458
10458
 
10459
+ this.STICKTYPE=function(value)
10460
+ {
10461
+ return value;
10462
+ }
10463
+
10459
10464
  //数据左右偏移
10460
10465
  this.XMOVE=function(offset)
10461
10466
  {
@@ -17211,7 +17216,7 @@ function JSExecute(ast,option)
17211
17216
  {
17212
17217
  let varName;
17213
17218
  let draw;
17214
- let color, upColor, downColor;
17219
+ let color, upColor, downColor, stickType;
17215
17220
  let lineWidth;
17216
17221
  let colorStick=false;
17217
17222
  let pointDot=false;
@@ -17356,6 +17361,10 @@ function JSExecute(ast,option)
17356
17361
  {
17357
17362
  downColor=itemExpression.Out;
17358
17363
  }
17364
+ else if (itemExpression.Callee.Name=="STICKTYPE")
17365
+ {
17366
+ stickType=itemExpression.Out;
17367
+ }
17359
17368
  else if (itemExpression.Callee.Name=="XMOVE")
17360
17369
  {
17361
17370
  xOffset=itemExpression.Out;
@@ -17496,6 +17505,7 @@ function JSExecute(ast,option)
17496
17505
  if (upColor) value.UpColor=upColor;
17497
17506
  if (downColor) value.DownColor=downColor;
17498
17507
  if (lineWidth) value.LineWidth=lineWidth;
17508
+ if (IFrameSplitOperator.IsNumber(stickType)) value.StickType=stickType;
17499
17509
  this.OutVarTable.push(value);
17500
17510
  }
17501
17511
  else if (lineArea && varName) //LINEAREA 面积
@@ -18030,6 +18040,9 @@ function JSExecute(ast,option)
18030
18040
  case "DOWNCOLOR":
18031
18041
  node.Out=this.Draw.DOWNCOLOR(args[0]);
18032
18042
  break;
18043
+ case "STICKTYPE": //柱子类型
18044
+ node.Out=this.Draw.STICKTYPE(args[0]);
18045
+ break;
18033
18046
  case "XMOVE":
18034
18047
  node.Out=this.Draw.XMOVE(args[0]);
18035
18048
  break;
@@ -19183,6 +19196,7 @@ function JSExplainer(ast,option)
19183
19196
  return `上涨颜色${args[0]}`;
19184
19197
  case "DOWNCOLOR":
19185
19198
  return `下跌颜色${args[0]}`;
19199
+ case "STICKTYPE":
19186
19200
  case "FIRSTDRAW":
19187
19201
  return "";
19188
19202
 
@@ -20711,6 +20725,7 @@ function ScriptIndex(name,script,args,option)
20711
20725
 
20712
20726
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
20713
20727
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
20728
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
20714
20729
  if (varItem.LineWidth)
20715
20730
  {
20716
20731
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -22622,6 +22637,7 @@ function OverlayScriptIndex(name,script,args,option)
22622
22637
 
22623
22638
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
22624
22639
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
22640
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
22625
22641
  if (varItem.LineWidth)
22626
22642
  {
22627
22643
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -79,7 +79,7 @@ function JSIndexScript()
79
79
  ['BOLL', this.BOLL],['BOLL副图', this.BOLL2],['BBI', this.BBI],
80
80
  ['DKX', this.DKX],['MIKE', this.MIKE],['PBX', this.PBX],
81
81
  ['ENE', this.ENE],['MACD', this.MACD],['KDJ', this.KDJ],["MACD2", this.MACD2],
82
- ['VOL', this.VOL],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
82
+ ['VOL', this.VOL],['VOL2', this.VOL2],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
83
83
  ['WR', this.WR],['BIAS', this.BIAS],['OBV', this.OBV],
84
84
  ['DMI', this.DMI],['CR', this.CR],['PSY', this.PSY],
85
85
  ['CCI', this.CCI],['DMA', this.DMA],['TRIX', this.TRIX],
@@ -643,6 +643,23 @@ MA2:MA(VOL,M2);'
643
643
  return data;
644
644
  }
645
645
 
646
+ JSIndexScript.prototype.VOL2=function()
647
+ {
648
+ let data=
649
+ {
650
+ Name:'VOL', Description:'成交量', IsMainIndex:false,FloatPrecision:0,
651
+ Args:[ { Name:'M1', Value:5}, { Name:'M2', Value:10} ],
652
+ OutName:[ {Name:'MA1',DynamicName:"MA{M1}" }, {Name:'MA2',DynamicName:"MA{M2}" }],
653
+ Script: //脚本
654
+ 'VOL:VOL,VOLSTICK,STICKTYPE(1);\n\
655
+ MA1:MA(VOL,M1);\n\
656
+ MA2:MA(VOL,M2);'
657
+
658
+ };
659
+
660
+ return data;
661
+ }
662
+
646
663
  JSIndexScript.prototype.VOL_OVERLAY=function()
647
664
  {
648
665
  let data=
@@ -23612,6 +23612,14 @@ function ChartKLine()
23612
23612
  RightMargin:g_JSChartResource.OrderFlow_Style4.RightMargin,
23613
23613
  }
23614
23614
 
23615
+ this.OrderFlow_Style5=
23616
+ {
23617
+ AskBarColor:g_JSChartResource.OrderFlow_Style5.AskBarColor, //左
23618
+ BidBarColor:g_JSChartResource.OrderFlow_Style5.BidBarColor, //右
23619
+ LeftMargin:g_JSChartResource.OrderFlow_Style5.LeftMargin,
23620
+ RightMargin:g_JSChartResource.OrderFlow_Style5.RightMargin,
23621
+ }
23622
+
23615
23623
  this.IsShowOrderText=false;
23616
23624
 
23617
23625
  this.AryOrderFlowBorder=[]; //订单流边框 临时变量
@@ -27790,7 +27798,175 @@ function ChartKLine()
27790
27798
  //订单流样式5
27791
27799
  this.DrawOrderFlow_Style5=function()
27792
27800
  {
27801
+ var isHScreen=(this.ChartFrame.IsHScreen===true);
27802
+ var dataWidth=this.ChartFrame.DataWidth;
27803
+ var distanceWidth=this.ChartFrame.DistanceWidth;
27804
+ var border=this.ChartBorder.GetBorder();
27805
+ var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
27806
+ var chartright=border.RightEx;
27807
+ var xPointCount=this.ChartFrame.XPointCount;
27808
+ this.AryOrderFlowBorder=[];
27809
+
27810
+ if (isHScreen)
27811
+ {
27812
+ var border=this.ChartBorder.GetHScreenBorder();
27813
+ xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
27814
+ chartright=border.BottomEx;
27815
+ }
27816
+
27817
+ var upColor=this.OrderFlow_Style2.UpColor;
27818
+ var downColor=this.OrderFlow_Style2.DownColor;
27819
+ var unchagneColor=this.OrderFlow_Style2.UnchagneColor;
27820
+ var barWidth=ToFixedRect(this.OrderFlow_Style2.BarWidth);
27821
+ var textWidth=dataWidth-barWidth;
27822
+ if (textWidth/7<barWidth) barWidth=textWidth/7;
27823
+ if (barWidth<=1) barWidth=2;
27824
+
27825
+ this.ShowRange.Start=this.Data.DataOffset;
27826
+ this.ShowRange.End=this.ShowRange.Start;
27827
+ this.ShowRange.DataCount=0;
27828
+ this.ShowRange.ShowCount=xPointCount;
27829
+ this.DrawKRange.Start=this.Data.DataOffset;
27830
+
27831
+ this.DrawOrderFlowHBar(); //横向柱子
27832
+
27833
+ for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
27834
+ {
27835
+ var data=this.Data.Data[i];
27836
+ this.ShowRange.End=i;
27837
+ if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
27838
+
27839
+ var left=xOffset;
27840
+ var right=xOffset+dataWidth;
27841
+ if (right>chartright) break;
27842
+ var x=left+(right-left)/2;
27843
+ var yLow=this.GetYFromData(data.Low, false);
27844
+ var yHigh=this.GetYFromData(data.High, false);
27845
+ var yOpen=this.GetYFromData(data.Open, false);
27846
+ var yClose=this.GetYFromData(data.Close, false);
27847
+ var y=yHigh;
27848
+
27849
+ this.DrawKRange.End=i;
27850
+
27851
+ var barTop=Math.min(yOpen,yClose);
27852
+ var barBottom=Math.max(yOpen,yClose);
27853
+ var barLeft=ToFixedRect(left);
27854
+ var barRight=barLeft+barWidth
27855
+ if (data.Open<data.Close) this.Canvas.fillStyle=upColor;
27856
+ else if (data.Open>data.Close) this.Canvas.fillStyle=downColor;
27857
+ else this.Canvas.fillStyle=unchagneColor;
27858
+
27859
+ var cellHeight=0;
27860
+ if (data.OrderFlow && IFrameSplitOperator.IsNumber(data.OrderFlow.PriceOffset)) cellHeight=this.GetPriceYOffset(data.OrderFlow.PriceOffset);
27861
+
27862
+ this.Canvas.fillRect(barLeft,ToFixedRect(barTop-cellHeight/2),barWidth,ToFixedRect(barBottom-barTop+cellHeight));
27863
+ var yKline={ Low:yLow, High:yHigh, Open:yOpen, Close:yClose };
27864
+ var xKLine={ Left:barRight, Center:x, Right:right, DataWidth:(right-barRight) };
27865
+ xKLine.Center=xKLine.Left+xKLine.DataWidth/2;
27866
+ this.DrawOrderFlowBar_Style5(data.OrderFlow, data, xKLine, yKline, isHScreen);
27867
+ }
27868
+ }
27869
+
27870
+ this.DrawOrderFlowBar_Style5=function(orderFlow, kItem, xKLine, yKline, isHScreen)
27871
+ {
27872
+ var top=Math.min(yKline.Open, yKline.Close)
27873
+ var bottom=Math.max(yKline.Open, yKline.Close);
27874
+ var barHeight=Math.abs(yKline.Open-yKline.Close);
27875
+ var cellHeight=0;
27876
+ if (orderFlow && IFrameSplitOperator.IsNumber(orderFlow.PriceOffset)) cellHeight=this.GetPriceYOffset(orderFlow.PriceOffset);
27877
+ var textFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2);
27878
+ this.IsShowOrderText=(cellHeight>5 && xKLine.DataWidth>10);
27879
+ if (this.OrderFlow.AlwaysShowOrderText) this.IsShowOrderText=true;
27880
+
27881
+ this.Canvas.textBaseline='middle';
27882
+
27883
+ this.Canvas.font=textFont;
27884
+ var textWidth=xKLine.DataWidth/2;
27885
+ if (orderFlow && IFrameSplitOperator.IsNonEmptyArray(orderFlow.Order))
27886
+ {
27887
+ var maxValue=orderFlow.MaxValue;
27888
+ for(var i=0;i<orderFlow.Order.length;++i)
27889
+ {
27890
+ var item=orderFlow.Order[i];
27891
+ var yPrice=this.GetYFromData(item.Price, false);
27892
+
27893
+ var rect={ Left:xKLine.Left, Right:xKLine.Center, Bottom:yPrice+cellHeight/2, Top:yPrice-cellHeight/2 };
27894
+ rect.Width=rect.Right-rect.Left;
27895
+ rect.Height=rect.Bottom-rect.Top;
27896
+
27897
+ if (IFrameSplitOperator.IsNumber(item.Ask.Value))
27898
+ {
27899
+ var color=this.OrderFlow_Style5.AskBarColor;
27900
+ if (item.Ask.BG) color=item.Ask.BG;
27901
+ this.Canvas.fillStyle=color;
27902
+ var barWidth=rect.Width*item.Ask.Value/maxValue;
27903
+ this.Canvas.fillRect(ToFixedRect(rect.Right),ToFixedRect(rect.Top),ToFixedRect(-barWidth),ToFixedRect(rect.Height));
27904
+
27905
+ var text=null;
27906
+ if (IFrameSplitOperator.IsString(item.Ask.Text)) text=item.Ask.Text;
27907
+ else text=item.Ask.Value.toString();
27908
+ if (text && this.IsShowOrderText)
27909
+ {
27910
+ var textColor=this.OrderFlow.Text.Color;
27911
+ if (item.Ask.Color) textColor=item.Ask.Color;
27912
+
27913
+ this.Canvas.fillStyle=textColor;
27914
+ this.Canvas.textAlign='right';
27915
+ var xText=rect.Right-this.OrderFlow_Style5.LeftMargin;
27916
+ if (item.Ask.Font)
27917
+ {
27918
+ var itemFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2, item.Ask.Font);
27919
+ this.Canvas.font=itemFont;
27920
+ this.Canvas.fillText(text,xText,yPrice);
27921
+ this.Canvas.font=textFont;
27922
+ }
27923
+ else
27924
+ {
27925
+ this.Canvas.fillText(text,xText,yPrice);
27926
+ }
27927
+ }
27928
+ }
27929
+
27930
+
27931
+ var rect={ Left:xKLine.Center, Right:xKLine.Right, Bottom:yPrice+cellHeight/2, Top:yPrice-cellHeight/2 };
27932
+ rect.Width=rect.Right-rect.Left;
27933
+ rect.Height=rect.Bottom-rect.Top;
27934
+
27935
+ if (IFrameSplitOperator.IsNumber(item.Bid.Value))
27936
+ {
27937
+ var color=this.OrderFlow_Style5.BidBarColor;
27938
+ if (item.Bid.BG) color=item.Bid.BG;
27939
+ this.Canvas.fillStyle=color;
27940
+ var barWidth=rect.Width*item.Bid.Value/maxValue;
27941
+ this.Canvas.fillRect(ToFixedRect(rect.Left),ToFixedRect(rect.Top),ToFixedRect(barWidth),ToFixedRect(rect.Height));
27942
+
27943
+ var text=null;
27944
+ if (IFrameSplitOperator.IsString(item.Bid.Text)) text=item.Bid.Text;
27945
+ else text=item.Bid.Value.toString();
27946
+ if (text && this.IsShowOrderText)
27947
+ {
27948
+ var textColor=this.OrderFlow.Text.Color;
27949
+ if (item.Bid.Color)textColor=item.Bid.Color;
27793
27950
 
27951
+ this.Canvas.fillStyle=textColor;
27952
+ this.Canvas.textAlign='left';
27953
+ var xText=rect.Left+this.OrderFlow_Style5.RightMargin
27954
+ if (item.Bid.Font)
27955
+ {
27956
+ var itemFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2, item.Bid.Font);
27957
+ this.Canvas.font=itemFont;
27958
+ this.Canvas.fillText(text,xText,yPrice);
27959
+ this.Canvas.font=textFont;
27960
+ }
27961
+ else
27962
+ {
27963
+ this.Canvas.fillText(text,xText,yPrice);
27964
+ }
27965
+
27966
+ }
27967
+ }
27968
+ }
27969
+ }
27794
27970
  }
27795
27971
 
27796
27972
  //////////////////////////////////////////////////////////////
@@ -31602,10 +31778,11 @@ function ChartVolStick()
31602
31778
  this.DownColor=g_JSChartResource.DownBarColor;
31603
31779
  this.HistoryData; //历史数据
31604
31780
  this.KLineDrawType=0;
31781
+
31605
31782
  this.ClassName='ChartVolStick';
31606
31783
 
31607
- this.BarWidth; //固定宽度 目前只支持宽度为1
31608
-
31784
+ this.BarWidth; //固定宽度 目前只支持宽度为1
31785
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
31609
31786
  this.PtInChart=this.PtInBar;
31610
31787
  this.DrawSelectedStatus=this.DrawLinePoint;
31611
31788
 
@@ -31652,28 +31829,24 @@ function ChartVolStick()
31652
31829
  var y=this.ChartFrame.GetYFromData(value);
31653
31830
  var barColor=this.GetBarColor(kItem);
31654
31831
  var bUp=barColor.IsUp;
31655
- this.Canvas.fillStyle=barColor.Color;
31832
+
31656
31833
 
31657
31834
  var height=ToFixedRect(Math.abs(yBottom-y)>=1?yBottom-y:1);//高度调整为整数, 如果小于1, 统一使用1
31658
31835
  y=yBottom-height;
31659
- if (this.KLineDrawType==6) //完全空心柱
31836
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
31837
+
31838
+ if (bSolidBar)
31660
31839
  {
31661
- this.Canvas.strokeStyle=barColor.Color;
31662
- this.Canvas.beginPath();
31663
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
31664
- this.Canvas.stroke();
31840
+ this.Canvas.fillStyle=barColor.Color;
31841
+ this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
31665
31842
  }
31666
- else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
31843
+ else
31667
31844
  {
31668
- this.Canvas.strokeStyle=this.UpColor;
31845
+ this.Canvas.strokeStyle=barColor.Color;
31669
31846
  this.Canvas.beginPath();
31670
31847
  this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
31671
31848
  this.Canvas.stroke();
31672
31849
  }
31673
- else
31674
- {
31675
- this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
31676
- }
31677
31850
  }
31678
31851
  }
31679
31852
  else //太细了直接话线
@@ -31746,19 +31919,21 @@ function ChartVolStick()
31746
31919
  var y=this.ChartFrame.GetYFromData(value);
31747
31920
  var barColor=this.GetBarColor(kItem);
31748
31921
  var bUp=barColor.IsUp;
31749
- this.Canvas.fillStyle=barColor.Color;
31750
31922
 
31751
31923
  var height=ToFixedRect(y-yBottom); //高度调整为整数
31752
- if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
31924
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
31925
+
31926
+ if (bSolidBar)
31753
31927
  {
31754
- this.Canvas.strokeStyle=this.UpColor;
31755
- this.Canvas.beginPath();
31756
- this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
31757
- this.Canvas.stroke();
31928
+ this.Canvas.fillStyle=barColor.Color;
31929
+ this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
31758
31930
  }
31759
31931
  else
31760
31932
  {
31761
- this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
31933
+ this.Canvas.strokeStyle=barColor.Color;
31934
+ this.Canvas.beginPath();
31935
+ this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
31936
+ this.Canvas.stroke();
31762
31937
  }
31763
31938
  }
31764
31939
  }
@@ -31834,6 +32009,29 @@ function ChartVolStick()
31834
32009
  else return { Color:this.DownColor, IsUp:false };
31835
32010
  }
31836
32011
 
32012
+ //true=实心 false=空心
32013
+ this.IsSolidBar=function(bUp)
32014
+ {
32015
+ var bSolidBar=true; //实心柱子
32016
+
32017
+ if (this.BarType===0 || this.BarType===1 || this.BarType===2)
32018
+ {
32019
+ if (this.BarType===0) //空心
32020
+ bSolidBar=false;
32021
+ else if (this.BarType===2) //涨实跌空
32022
+ bSolidBar=bUp;
32023
+ }
32024
+ else
32025
+ {
32026
+ if (this.KLineDrawType==6) //完全空心柱
32027
+ bSolidBar=false;
32028
+ else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
32029
+ bSolidBar=false;
32030
+ }
32031
+
32032
+ return bSolidBar;
32033
+ }
32034
+
31837
32035
  this.GetMinuteBarColor=function(kItem, preItem)
31838
32036
  {
31839
32037
  var prePrice=kItem.YClose;
@@ -37548,6 +37746,8 @@ function ChartMultiText()
37548
37746
  var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
37549
37747
  var left=this.ChartBorder.GetTop();
37550
37748
  var right=this.ChartBorder.GetBottom();
37749
+ var top=border.RightEx;
37750
+ var bottom=border.LeftEx;
37551
37751
  }
37552
37752
  else
37553
37753
  {
@@ -37556,6 +37756,8 @@ function ChartMultiText()
37556
37756
  var chartright=border.RightEx;
37557
37757
  var left=this.ChartBorder.GetLeft();
37558
37758
  var right=this.ChartBorder.GetRight();
37759
+ var top=border.TopEx;
37760
+ var bottom=border.BottomEx;
37559
37761
  }
37560
37762
 
37561
37763
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
@@ -37690,6 +37892,8 @@ function ChartMultiText()
37690
37892
  for(var i in this.Texts)
37691
37893
  {
37692
37894
  var item=this.Texts[i];
37895
+ if (!IFrameSplitOperator.IsNumber(item.Value)) continue;
37896
+
37693
37897
  if (item.Index>=start && item.Index<end)
37694
37898
  {
37695
37899
  if (range.Max==null) range.Max=item.Value;
@@ -46295,7 +46499,7 @@ function FrameSplitKLinePriceY()
46295
46499
  this.Frame.HorizontalInfo[i]= new CoordinateInfo();
46296
46500
  this.Frame.HorizontalInfo[i].Value=value;
46297
46501
  if (this.IsShowLeftText) this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);
46298
- if (this.IsShowRightText) this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);
46502
+ if (this.IsShowRightText) this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);
46299
46503
  }
46300
46504
  }
46301
46505
 
@@ -56729,6 +56933,8 @@ function ChartDrawHLine()
56729
56933
 
56730
56934
  this.TextMargin={ Left:0, Right:0 };
56731
56935
 
56936
+ this.AlwaysShowLab=false; //总是显示标签
56937
+
56732
56938
  this.Button=
56733
56939
  {
56734
56940
  CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null, Margin:{ Left:2, Right:2 } },
@@ -56775,7 +56981,9 @@ function ChartDrawHLine()
56775
56981
  if (option.ButtonBGColor) this.ButtonBGColor=option.ButtonBGColor;
56776
56982
  if (IFrameSplitOperator.IsNumber(option.ButtonPosition)) this.ButtonPosition=option.ButtonPosition;
56777
56983
  if (IFrameSplitOperator.IsNumber(option.RightSpaceWidth)) this.RightSpaceWidth=option.RightSpaceWidth;
56984
+ if (IFrameSplitOperator.IsBool(option.AlwaysShowLab)) this.AlwaysShowLab=option.AlwaysShowLab;
56778
56985
 
56986
+
56779
56987
  if (option.Button)
56780
56988
  {
56781
56989
  var item=option.Button;
@@ -56903,7 +57111,8 @@ function ChartDrawHLine()
56903
57111
  if (!drawPoint || drawPoint.length!=1) return;
56904
57112
  if (!this.Frame) return;
56905
57113
  if (this.Value.length!=1) return;
56906
- if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
57114
+ var bVisibleRange=this.IsYValueInFrame(this.Value[0].YValue); //是否在可视范围
57115
+ if (!this.AlwaysShowLab && !bVisibleRange) return;
56907
57116
 
56908
57117
  var isHScreen=this.Frame.IsHScreen;
56909
57118
  var left=this.Frame.ChartBorder.GetLeft();
@@ -56913,71 +57122,80 @@ function ChartDrawHLine()
56913
57122
  left=this.Frame.ChartBorder.GetTop();
56914
57123
  right=this.Frame.ChartBorder.GetBottom();
56915
57124
  }
57125
+
56916
57126
  this.ClipFrame();
56917
57127
 
56918
57128
  //画线段
56919
- this.Canvas.strokeStyle=this.LineColor;
56920
- this.SetLineWidth();
56921
- this.Canvas.beginPath();
56922
- if (isHScreen)
56923
- {
56924
- this.Canvas.moveTo(drawPoint[0].X,left);
56925
- this.Canvas.lineTo(drawPoint[0].X,right);
56926
- }
56927
- else
57129
+ if (bVisibleRange)
56928
57130
  {
56929
- this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));
56930
- this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));
57131
+ this.Canvas.strokeStyle=this.LineColor;
57132
+ this.SetLineWidth();
57133
+ this.Canvas.beginPath();
57134
+ if (isHScreen)
57135
+ {
57136
+ this.Canvas.moveTo(drawPoint[0].X,left);
57137
+ this.Canvas.lineTo(drawPoint[0].X,right);
57138
+ }
57139
+ else
57140
+ {
57141
+ this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));
57142
+ this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));
57143
+ }
57144
+ this.Canvas.stroke();
57145
+ this.RestoreLineWidth();
56931
57146
  }
56932
- this.Canvas.stroke();
56933
- this.RestoreLineWidth();
56934
57147
 
56935
57148
  //画水平线段
56936
- var line={Start:new Point(), End:new Point()};
56937
- if (isHScreen)
56938
- {
56939
- line.Start.X=drawPoint[0].X;
56940
- line.Start.Y=left;
56941
- line.End.X=drawPoint[0].X;
56942
- line.End.Y=right;
56943
- }
56944
- else
56945
- {
56946
- line.Start.X=left;
56947
- line.Start.Y=drawPoint[0].Y;
56948
- line.End.X=right;
56949
- line.End.Y=drawPoint[0].Y;
56950
- }
56951
- this.LinePoint.push(line);
56952
-
56953
- var yValue=this.Frame.GetYData(drawPoint[0].Y);
56954
- var strPrice=yValue.toFixed(this.Precision);
56955
- if (this.ShowPriceTextConfig.IsShow[0])
56956
- {
56957
- this.DrawPriceText(strPrice, line.Start, line.End, 0);
56958
- }
56959
-
56960
- if (this.ShowPriceTextConfig.IsShow[1])
57149
+ if (bVisibleRange)
56961
57150
  {
56962
- this.DrawPriceText(strPrice, line.Start, line.End, 1);
57151
+ var line={Start:new Point(), End:new Point()};
57152
+ if (isHScreen)
57153
+ {
57154
+ line.Start.X=drawPoint[0].X;
57155
+ line.Start.Y=left;
57156
+ line.End.X=drawPoint[0].X;
57157
+ line.End.Y=right;
57158
+ }
57159
+ else
57160
+ {
57161
+ line.Start.X=left;
57162
+ line.Start.Y=drawPoint[0].Y;
57163
+ line.End.X=right;
57164
+ line.End.Y=drawPoint[0].Y;
57165
+ }
57166
+ this.LinePoint.push(line);
57167
+
57168
+ var yValue=this.Frame.GetYData(drawPoint[0].Y, false);
57169
+ var strPrice=yValue.toFixed(this.Precision);
57170
+ if (this.ShowPriceTextConfig.IsShow[0])
57171
+ {
57172
+ this.DrawPriceText(strPrice, line.Start, line.End, 0);
57173
+ }
57174
+
57175
+ if (this.ShowPriceTextConfig.IsShow[1])
57176
+ {
57177
+ this.DrawPriceText(strPrice, line.Start, line.End, 1);
57178
+ }
56963
57179
  }
56964
-
57180
+
56965
57181
  var labInfo;
56966
57182
  if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
56967
57183
 
56968
57184
  this.AryShowButton=this.GetShowButton(); //获取按钮
56969
57185
 
56970
- //描述信息
56971
- if (labInfo)
57186
+ //框架内的描述信息
57187
+ if (labInfo && bVisibleRange)
56972
57188
  this.DrawLab(labInfo, drawPoint[0].Y);
56973
57189
 
56974
57190
  //画中心点
56975
- var xCenter=left+(right-left)/2;
56976
- var point={ X:xCenter, Y: drawPoint[0].Y };
56977
- this.DrawPoint([point]);
57191
+ if (bVisibleRange)
57192
+ {
57193
+ var xCenter=left+(right-left)/2;
57194
+ var point={ X:xCenter, Y: drawPoint[0].Y };
57195
+ this.DrawPoint([point]);
57196
+ }
56978
57197
 
56979
57198
  this.Canvas.restore();
56980
-
56981
57199
 
56982
57200
  //外部右侧显示价格
56983
57201
  if (this.ShowPriceTextConfig.IsShow[2])
@@ -56986,9 +57204,8 @@ function ChartDrawHLine()
56986
57204
  this.CalculateButtonSize();
56987
57205
  this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
56988
57206
  if (labInfo) this.DrawRightLab(labInfo, rtDraw);
56989
- if (labInfo) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
57207
+ if (labInfo && bVisibleRange) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
56990
57208
  }
56991
-
56992
57209
 
56993
57210
  //鼠标是否在按钮上
56994
57211
  if (moveonPoint && mouseStatus)
@@ -57188,9 +57405,32 @@ function ChartDrawHLine()
57188
57405
  {
57189
57406
  var left=this.Frame.ChartBorder.GetLeft();
57190
57407
  var right=this.Frame.ChartBorder.GetRight();
57408
+ var top=this.Frame.ChartBorder.GetTopEx();
57409
+ var bottom=this.Frame.ChartBorder.GetBottomEx();
57410
+ var pixelTatio = GetDevicePixelRatio();
57411
+
57412
+ if (IFrameSplitOperator.IsNumber(labInfo.TopOffset)) top-=labInfo.TopOffset;
57413
+ if (IFrameSplitOperator.IsNumber(labInfo.BottomOffset)) bottom+=labInfo.BottomOffset;
57414
+
57415
+ var yValue=this.Frame.GetYData(y,false);
57416
+ var strValue=yValue.toFixed(this.Precision);
57417
+ if (labInfo &&labInfo.PriceSuffixText) strValue+=labInfo.PriceSuffixText;
57418
+
57419
+ var bVisibleRange=true;
57420
+ if (y<top)
57421
+ {
57422
+ y=top;
57423
+ bVisibleRange=false;
57424
+ }
57425
+ else if (y>bottom)
57426
+ {
57427
+ y=bottom;
57428
+ bVisibleRange=false;
57429
+ }
57191
57430
 
57192
57431
  if (this.RightSpaceWidth>0)
57193
57432
  {
57433
+ if (!bVisibleRange) this.Canvas.setLineDash([2*pixelTatio,3*pixelTatio]); //虚线
57194
57434
  this.Canvas.strokeStyle=this.LineColor;
57195
57435
  this.Canvas.beginPath();
57196
57436
  this.Canvas.moveTo(right,ToFixedPoint(y));
@@ -57198,10 +57438,6 @@ function ChartDrawHLine()
57198
57438
  this.Canvas.stroke();
57199
57439
  }
57200
57440
 
57201
- var yValue=this.Frame.GetYData(y);
57202
- var strValue=yValue.toFixed(this.Precision);
57203
- if (labInfo &&labInfo.PriceSuffixText) strValue+=labInfo.PriceSuffixText;
57204
-
57205
57441
  this.Canvas.fillStyle=this.LineColor;
57206
57442
  this.Canvas.font=this.Font;
57207
57443
  var textWidth=this.Canvas.measureText(strValue).width;
@@ -65697,6 +65933,15 @@ function JSChartResource()
65697
65933
  LeftMargin:1,
65698
65934
  RightMargin:1
65699
65935
  };
65936
+
65937
+
65938
+ this.OrderFlow_Style5=
65939
+ {
65940
+ AskBarColor:"rgb(176,22,22)", //左
65941
+ BidBarColor:"rgb(98,126,176)", //右
65942
+ LeftMargin:3,
65943
+ RightMargin:2,
65944
+ };
65700
65945
 
65701
65946
 
65702
65947
  this.Index={};