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.
@@ -135,7 +135,7 @@ function JSIndexScript()
135
135
  ['BOLL', this.BOLL],['BOLL副图', this.BOLL2],['BBI', this.BBI],
136
136
  ['DKX', this.DKX],['MIKE', this.MIKE],['PBX', this.PBX],
137
137
  ['ENE', this.ENE],['MACD', this.MACD],['KDJ', this.KDJ],["MACD2", this.MACD2],
138
- ['VOL', this.VOL],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
138
+ ['VOL', this.VOL],['VOL2', this.VOL2],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
139
139
  ['WR', this.WR],['BIAS', this.BIAS],['OBV', this.OBV],
140
140
  ['DMI', this.DMI],['CR', this.CR],['PSY', this.PSY],
141
141
  ['CCI', this.CCI],['DMA', this.DMA],['TRIX', this.TRIX],
@@ -699,6 +699,23 @@ MA2:MA(VOL,M2);'
699
699
  return data;
700
700
  }
701
701
 
702
+ JSIndexScript.prototype.VOL2=function()
703
+ {
704
+ let data=
705
+ {
706
+ Name:'VOL', Description:'成交量', IsMainIndex:false,FloatPrecision:0,
707
+ Args:[ { Name:'M1', Value:5}, { Name:'M2', Value:10} ],
708
+ OutName:[ {Name:'MA1',DynamicName:"MA{M1}" }, {Name:'MA2',DynamicName:"MA{M2}" }],
709
+ Script: //脚本
710
+ 'VOL:VOL,VOLSTICK,STICKTYPE(1);\n\
711
+ MA1:MA(VOL,M1);\n\
712
+ MA2:MA(VOL,M2);'
713
+
714
+ };
715
+
716
+ return data;
717
+ }
718
+
702
719
  JSIndexScript.prototype.VOL_OVERLAY=function()
703
720
  {
704
721
  let data=
@@ -27548,6 +27565,14 @@ function ChartKLine()
27548
27565
  RightMargin:g_JSChartResource.OrderFlow_Style4.RightMargin,
27549
27566
  }
27550
27567
 
27568
+ this.OrderFlow_Style5=
27569
+ {
27570
+ AskBarColor:g_JSChartResource.OrderFlow_Style5.AskBarColor, //左
27571
+ BidBarColor:g_JSChartResource.OrderFlow_Style5.BidBarColor, //右
27572
+ LeftMargin:g_JSChartResource.OrderFlow_Style5.LeftMargin,
27573
+ RightMargin:g_JSChartResource.OrderFlow_Style5.RightMargin,
27574
+ }
27575
+
27551
27576
  this.IsShowOrderText=false;
27552
27577
 
27553
27578
  this.AryOrderFlowBorder=[]; //订单流边框 临时变量
@@ -31726,7 +31751,175 @@ function ChartKLine()
31726
31751
  //订单流样式5
31727
31752
  this.DrawOrderFlow_Style5=function()
31728
31753
  {
31754
+ var isHScreen=(this.ChartFrame.IsHScreen===true);
31755
+ var dataWidth=this.ChartFrame.DataWidth;
31756
+ var distanceWidth=this.ChartFrame.DistanceWidth;
31757
+ var border=this.ChartBorder.GetBorder();
31758
+ var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
31759
+ var chartright=border.RightEx;
31760
+ var xPointCount=this.ChartFrame.XPointCount;
31761
+ this.AryOrderFlowBorder=[];
31729
31762
 
31763
+ if (isHScreen)
31764
+ {
31765
+ var border=this.ChartBorder.GetHScreenBorder();
31766
+ xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
31767
+ chartright=border.BottomEx;
31768
+ }
31769
+
31770
+ var upColor=this.OrderFlow_Style2.UpColor;
31771
+ var downColor=this.OrderFlow_Style2.DownColor;
31772
+ var unchagneColor=this.OrderFlow_Style2.UnchagneColor;
31773
+ var barWidth=ToFixedRect(this.OrderFlow_Style2.BarWidth);
31774
+ var textWidth=dataWidth-barWidth;
31775
+ if (textWidth/7<barWidth) barWidth=textWidth/7;
31776
+ if (barWidth<=1) barWidth=2;
31777
+
31778
+ this.ShowRange.Start=this.Data.DataOffset;
31779
+ this.ShowRange.End=this.ShowRange.Start;
31780
+ this.ShowRange.DataCount=0;
31781
+ this.ShowRange.ShowCount=xPointCount;
31782
+ this.DrawKRange.Start=this.Data.DataOffset;
31783
+
31784
+ this.DrawOrderFlowHBar(); //横向柱子
31785
+
31786
+ for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
31787
+ {
31788
+ var data=this.Data.Data[i];
31789
+ this.ShowRange.End=i;
31790
+ if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
31791
+
31792
+ var left=xOffset;
31793
+ var right=xOffset+dataWidth;
31794
+ if (right>chartright) break;
31795
+ var x=left+(right-left)/2;
31796
+ var yLow=this.GetYFromData(data.Low, false);
31797
+ var yHigh=this.GetYFromData(data.High, false);
31798
+ var yOpen=this.GetYFromData(data.Open, false);
31799
+ var yClose=this.GetYFromData(data.Close, false);
31800
+ var y=yHigh;
31801
+
31802
+ this.DrawKRange.End=i;
31803
+
31804
+ var barTop=Math.min(yOpen,yClose);
31805
+ var barBottom=Math.max(yOpen,yClose);
31806
+ var barLeft=ToFixedRect(left);
31807
+ var barRight=barLeft+barWidth
31808
+ if (data.Open<data.Close) this.Canvas.fillStyle=upColor;
31809
+ else if (data.Open>data.Close) this.Canvas.fillStyle=downColor;
31810
+ else this.Canvas.fillStyle=unchagneColor;
31811
+
31812
+ var cellHeight=0;
31813
+ if (data.OrderFlow && IFrameSplitOperator.IsNumber(data.OrderFlow.PriceOffset)) cellHeight=this.GetPriceYOffset(data.OrderFlow.PriceOffset);
31814
+
31815
+ this.Canvas.fillRect(barLeft,ToFixedRect(barTop-cellHeight/2),barWidth,ToFixedRect(barBottom-barTop+cellHeight));
31816
+ var yKline={ Low:yLow, High:yHigh, Open:yOpen, Close:yClose };
31817
+ var xKLine={ Left:barRight, Center:x, Right:right, DataWidth:(right-barRight) };
31818
+ xKLine.Center=xKLine.Left+xKLine.DataWidth/2;
31819
+ this.DrawOrderFlowBar_Style5(data.OrderFlow, data, xKLine, yKline, isHScreen);
31820
+ }
31821
+ }
31822
+
31823
+ this.DrawOrderFlowBar_Style5=function(orderFlow, kItem, xKLine, yKline, isHScreen)
31824
+ {
31825
+ var top=Math.min(yKline.Open, yKline.Close)
31826
+ var bottom=Math.max(yKline.Open, yKline.Close);
31827
+ var barHeight=Math.abs(yKline.Open-yKline.Close);
31828
+ var cellHeight=0;
31829
+ if (orderFlow && IFrameSplitOperator.IsNumber(orderFlow.PriceOffset)) cellHeight=this.GetPriceYOffset(orderFlow.PriceOffset);
31830
+ var textFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2);
31831
+ this.IsShowOrderText=(cellHeight>5 && xKLine.DataWidth>10);
31832
+ if (this.OrderFlow.AlwaysShowOrderText) this.IsShowOrderText=true;
31833
+
31834
+ this.Canvas.textBaseline='middle';
31835
+
31836
+ this.Canvas.font=textFont;
31837
+ var textWidth=xKLine.DataWidth/2;
31838
+ if (orderFlow && IFrameSplitOperator.IsNonEmptyArray(orderFlow.Order))
31839
+ {
31840
+ var maxValue=orderFlow.MaxValue;
31841
+ for(var i=0;i<orderFlow.Order.length;++i)
31842
+ {
31843
+ var item=orderFlow.Order[i];
31844
+ var yPrice=this.GetYFromData(item.Price, false);
31845
+
31846
+ var rect={ Left:xKLine.Left, Right:xKLine.Center, Bottom:yPrice+cellHeight/2, Top:yPrice-cellHeight/2 };
31847
+ rect.Width=rect.Right-rect.Left;
31848
+ rect.Height=rect.Bottom-rect.Top;
31849
+
31850
+ if (IFrameSplitOperator.IsNumber(item.Ask.Value))
31851
+ {
31852
+ var color=this.OrderFlow_Style5.AskBarColor;
31853
+ if (item.Ask.BG) color=item.Ask.BG;
31854
+ this.Canvas.fillStyle=color;
31855
+ var barWidth=rect.Width*item.Ask.Value/maxValue;
31856
+ this.Canvas.fillRect(ToFixedRect(rect.Right),ToFixedRect(rect.Top),ToFixedRect(-barWidth),ToFixedRect(rect.Height));
31857
+
31858
+ var text=null;
31859
+ if (IFrameSplitOperator.IsString(item.Ask.Text)) text=item.Ask.Text;
31860
+ else text=item.Ask.Value.toString();
31861
+ if (text && this.IsShowOrderText)
31862
+ {
31863
+ var textColor=this.OrderFlow.Text.Color;
31864
+ if (item.Ask.Color) textColor=item.Ask.Color;
31865
+
31866
+ this.Canvas.fillStyle=textColor;
31867
+ this.Canvas.textAlign='right';
31868
+ var xText=rect.Right-this.OrderFlow_Style5.LeftMargin;
31869
+ if (item.Ask.Font)
31870
+ {
31871
+ var itemFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2, item.Ask.Font);
31872
+ this.Canvas.font=itemFont;
31873
+ this.Canvas.fillText(text,xText,yPrice);
31874
+ this.Canvas.font=textFont;
31875
+ }
31876
+ else
31877
+ {
31878
+ this.Canvas.fillText(text,xText,yPrice);
31879
+ }
31880
+ }
31881
+ }
31882
+
31883
+
31884
+ var rect={ Left:xKLine.Center, Right:xKLine.Right, Bottom:yPrice+cellHeight/2, Top:yPrice-cellHeight/2 };
31885
+ rect.Width=rect.Right-rect.Left;
31886
+ rect.Height=rect.Bottom-rect.Top;
31887
+
31888
+ if (IFrameSplitOperator.IsNumber(item.Bid.Value))
31889
+ {
31890
+ var color=this.OrderFlow_Style5.BidBarColor;
31891
+ if (item.Bid.BG) color=item.Bid.BG;
31892
+ this.Canvas.fillStyle=color;
31893
+ var barWidth=rect.Width*item.Bid.Value/maxValue;
31894
+ this.Canvas.fillRect(ToFixedRect(rect.Left),ToFixedRect(rect.Top),ToFixedRect(barWidth),ToFixedRect(rect.Height));
31895
+
31896
+ var text=null;
31897
+ if (IFrameSplitOperator.IsString(item.Bid.Text)) text=item.Bid.Text;
31898
+ else text=item.Bid.Value.toString();
31899
+ if (text && this.IsShowOrderText)
31900
+ {
31901
+ var textColor=this.OrderFlow.Text.Color;
31902
+ if (item.Bid.Color)textColor=item.Bid.Color;
31903
+
31904
+ this.Canvas.fillStyle=textColor;
31905
+ this.Canvas.textAlign='left';
31906
+ var xText=rect.Left+this.OrderFlow_Style5.RightMargin
31907
+ if (item.Bid.Font)
31908
+ {
31909
+ var itemFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2, item.Bid.Font);
31910
+ this.Canvas.font=itemFont;
31911
+ this.Canvas.fillText(text,xText,yPrice);
31912
+ this.Canvas.font=textFont;
31913
+ }
31914
+ else
31915
+ {
31916
+ this.Canvas.fillText(text,xText,yPrice);
31917
+ }
31918
+
31919
+ }
31920
+ }
31921
+ }
31922
+ }
31730
31923
  }
31731
31924
 
31732
31925
  //////////////////////////////////////////////////////////////
@@ -35538,10 +35731,11 @@ function ChartVolStick()
35538
35731
  this.DownColor=g_JSChartResource.DownBarColor;
35539
35732
  this.HistoryData; //历史数据
35540
35733
  this.KLineDrawType=0;
35734
+
35541
35735
  this.ClassName='ChartVolStick';
35542
35736
 
35543
- this.BarWidth; //固定宽度 目前只支持宽度为1
35544
-
35737
+ this.BarWidth; //固定宽度 目前只支持宽度为1
35738
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
35545
35739
  this.PtInChart=this.PtInBar;
35546
35740
  this.DrawSelectedStatus=this.DrawLinePoint;
35547
35741
 
@@ -35588,28 +35782,24 @@ function ChartVolStick()
35588
35782
  var y=this.ChartFrame.GetYFromData(value);
35589
35783
  var barColor=this.GetBarColor(kItem);
35590
35784
  var bUp=barColor.IsUp;
35591
- this.Canvas.fillStyle=barColor.Color;
35785
+
35592
35786
 
35593
35787
  var height=ToFixedRect(Math.abs(yBottom-y)>=1?yBottom-y:1);//高度调整为整数, 如果小于1, 统一使用1
35594
35788
  y=yBottom-height;
35595
- if (this.KLineDrawType==6) //完全空心柱
35789
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35790
+
35791
+ if (bSolidBar)
35596
35792
  {
35597
- this.Canvas.strokeStyle=barColor.Color;
35598
- this.Canvas.beginPath();
35599
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35600
- this.Canvas.stroke();
35793
+ this.Canvas.fillStyle=barColor.Color;
35794
+ this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35601
35795
  }
35602
- else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35796
+ else
35603
35797
  {
35604
- this.Canvas.strokeStyle=this.UpColor;
35798
+ this.Canvas.strokeStyle=barColor.Color;
35605
35799
  this.Canvas.beginPath();
35606
35800
  this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35607
35801
  this.Canvas.stroke();
35608
35802
  }
35609
- else
35610
- {
35611
- this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35612
- }
35613
35803
  }
35614
35804
  }
35615
35805
  else //太细了直接话线
@@ -35682,19 +35872,21 @@ function ChartVolStick()
35682
35872
  var y=this.ChartFrame.GetYFromData(value);
35683
35873
  var barColor=this.GetBarColor(kItem);
35684
35874
  var bUp=barColor.IsUp;
35685
- this.Canvas.fillStyle=barColor.Color;
35686
35875
 
35687
35876
  var height=ToFixedRect(y-yBottom); //高度调整为整数
35688
- if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35877
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35878
+
35879
+ if (bSolidBar)
35689
35880
  {
35690
- this.Canvas.strokeStyle=this.UpColor;
35691
- this.Canvas.beginPath();
35692
- this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35693
- this.Canvas.stroke();
35881
+ this.Canvas.fillStyle=barColor.Color;
35882
+ this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35694
35883
  }
35695
35884
  else
35696
35885
  {
35697
- this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35886
+ this.Canvas.strokeStyle=barColor.Color;
35887
+ this.Canvas.beginPath();
35888
+ this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35889
+ this.Canvas.stroke();
35698
35890
  }
35699
35891
  }
35700
35892
  }
@@ -35770,6 +35962,29 @@ function ChartVolStick()
35770
35962
  else return { Color:this.DownColor, IsUp:false };
35771
35963
  }
35772
35964
 
35965
+ //true=实心 false=空心
35966
+ this.IsSolidBar=function(bUp)
35967
+ {
35968
+ var bSolidBar=true; //实心柱子
35969
+
35970
+ if (this.BarType===0 || this.BarType===1 || this.BarType===2)
35971
+ {
35972
+ if (this.BarType===0) //空心
35973
+ bSolidBar=false;
35974
+ else if (this.BarType===2) //涨实跌空
35975
+ bSolidBar=bUp;
35976
+ }
35977
+ else
35978
+ {
35979
+ if (this.KLineDrawType==6) //完全空心柱
35980
+ bSolidBar=false;
35981
+ else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35982
+ bSolidBar=false;
35983
+ }
35984
+
35985
+ return bSolidBar;
35986
+ }
35987
+
35773
35988
  this.GetMinuteBarColor=function(kItem, preItem)
35774
35989
  {
35775
35990
  var prePrice=kItem.YClose;
@@ -41484,6 +41699,8 @@ function ChartMultiText()
41484
41699
  var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
41485
41700
  var left=this.ChartBorder.GetTop();
41486
41701
  var right=this.ChartBorder.GetBottom();
41702
+ var top=border.RightEx;
41703
+ var bottom=border.LeftEx;
41487
41704
  }
41488
41705
  else
41489
41706
  {
@@ -41492,6 +41709,8 @@ function ChartMultiText()
41492
41709
  var chartright=border.RightEx;
41493
41710
  var left=this.ChartBorder.GetLeft();
41494
41711
  var right=this.ChartBorder.GetRight();
41712
+ var top=border.TopEx;
41713
+ var bottom=border.BottomEx;
41495
41714
  }
41496
41715
 
41497
41716
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
@@ -41626,6 +41845,8 @@ function ChartMultiText()
41626
41845
  for(var i in this.Texts)
41627
41846
  {
41628
41847
  var item=this.Texts[i];
41848
+ if (!IFrameSplitOperator.IsNumber(item.Value)) continue;
41849
+
41629
41850
  if (item.Index>=start && item.Index<end)
41630
41851
  {
41631
41852
  if (range.Max==null) range.Max=item.Value;
@@ -50231,7 +50452,7 @@ function FrameSplitKLinePriceY()
50231
50452
  this.Frame.HorizontalInfo[i]= new CoordinateInfo();
50232
50453
  this.Frame.HorizontalInfo[i].Value=value;
50233
50454
  if (this.IsShowLeftText) this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);
50234
- if (this.IsShowRightText) this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);
50455
+ if (this.IsShowRightText) this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);
50235
50456
  }
50236
50457
  }
50237
50458
 
@@ -60665,6 +60886,8 @@ function ChartDrawHLine()
60665
60886
 
60666
60887
  this.TextMargin={ Left:0, Right:0 };
60667
60888
 
60889
+ this.AlwaysShowLab=false; //总是显示标签
60890
+
60668
60891
  this.Button=
60669
60892
  {
60670
60893
  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 } },
@@ -60711,7 +60934,9 @@ function ChartDrawHLine()
60711
60934
  if (option.ButtonBGColor) this.ButtonBGColor=option.ButtonBGColor;
60712
60935
  if (IFrameSplitOperator.IsNumber(option.ButtonPosition)) this.ButtonPosition=option.ButtonPosition;
60713
60936
  if (IFrameSplitOperator.IsNumber(option.RightSpaceWidth)) this.RightSpaceWidth=option.RightSpaceWidth;
60937
+ if (IFrameSplitOperator.IsBool(option.AlwaysShowLab)) this.AlwaysShowLab=option.AlwaysShowLab;
60714
60938
 
60939
+
60715
60940
  if (option.Button)
60716
60941
  {
60717
60942
  var item=option.Button;
@@ -60839,7 +61064,8 @@ function ChartDrawHLine()
60839
61064
  if (!drawPoint || drawPoint.length!=1) return;
60840
61065
  if (!this.Frame) return;
60841
61066
  if (this.Value.length!=1) return;
60842
- if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
61067
+ var bVisibleRange=this.IsYValueInFrame(this.Value[0].YValue); //是否在可视范围
61068
+ if (!this.AlwaysShowLab && !bVisibleRange) return;
60843
61069
 
60844
61070
  var isHScreen=this.Frame.IsHScreen;
60845
61071
  var left=this.Frame.ChartBorder.GetLeft();
@@ -60849,71 +61075,80 @@ function ChartDrawHLine()
60849
61075
  left=this.Frame.ChartBorder.GetTop();
60850
61076
  right=this.Frame.ChartBorder.GetBottom();
60851
61077
  }
61078
+
60852
61079
  this.ClipFrame();
60853
61080
 
60854
61081
  //画线段
60855
- this.Canvas.strokeStyle=this.LineColor;
60856
- this.SetLineWidth();
60857
- this.Canvas.beginPath();
60858
- if (isHScreen)
61082
+ if (bVisibleRange)
60859
61083
  {
60860
- this.Canvas.moveTo(drawPoint[0].X,left);
60861
- this.Canvas.lineTo(drawPoint[0].X,right);
60862
- }
60863
- else
60864
- {
60865
- this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));
60866
- this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));
61084
+ this.Canvas.strokeStyle=this.LineColor;
61085
+ this.SetLineWidth();
61086
+ this.Canvas.beginPath();
61087
+ if (isHScreen)
61088
+ {
61089
+ this.Canvas.moveTo(drawPoint[0].X,left);
61090
+ this.Canvas.lineTo(drawPoint[0].X,right);
61091
+ }
61092
+ else
61093
+ {
61094
+ this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));
61095
+ this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));
61096
+ }
61097
+ this.Canvas.stroke();
61098
+ this.RestoreLineWidth();
60867
61099
  }
60868
- this.Canvas.stroke();
60869
- this.RestoreLineWidth();
60870
61100
 
60871
61101
  //画水平线段
60872
- var line={Start:new Point(), End:new Point()};
60873
- if (isHScreen)
60874
- {
60875
- line.Start.X=drawPoint[0].X;
60876
- line.Start.Y=left;
60877
- line.End.X=drawPoint[0].X;
60878
- line.End.Y=right;
60879
- }
60880
- else
60881
- {
60882
- line.Start.X=left;
60883
- line.Start.Y=drawPoint[0].Y;
60884
- line.End.X=right;
60885
- line.End.Y=drawPoint[0].Y;
60886
- }
60887
- this.LinePoint.push(line);
60888
-
60889
- var yValue=this.Frame.GetYData(drawPoint[0].Y);
60890
- var strPrice=yValue.toFixed(this.Precision);
60891
- if (this.ShowPriceTextConfig.IsShow[0])
61102
+ if (bVisibleRange)
60892
61103
  {
60893
- this.DrawPriceText(strPrice, line.Start, line.End, 0);
60894
- }
60895
-
60896
- if (this.ShowPriceTextConfig.IsShow[1])
60897
- {
60898
- this.DrawPriceText(strPrice, line.Start, line.End, 1);
61104
+ var line={Start:new Point(), End:new Point()};
61105
+ if (isHScreen)
61106
+ {
61107
+ line.Start.X=drawPoint[0].X;
61108
+ line.Start.Y=left;
61109
+ line.End.X=drawPoint[0].X;
61110
+ line.End.Y=right;
61111
+ }
61112
+ else
61113
+ {
61114
+ line.Start.X=left;
61115
+ line.Start.Y=drawPoint[0].Y;
61116
+ line.End.X=right;
61117
+ line.End.Y=drawPoint[0].Y;
61118
+ }
61119
+ this.LinePoint.push(line);
61120
+
61121
+ var yValue=this.Frame.GetYData(drawPoint[0].Y, false);
61122
+ var strPrice=yValue.toFixed(this.Precision);
61123
+ if (this.ShowPriceTextConfig.IsShow[0])
61124
+ {
61125
+ this.DrawPriceText(strPrice, line.Start, line.End, 0);
61126
+ }
61127
+
61128
+ if (this.ShowPriceTextConfig.IsShow[1])
61129
+ {
61130
+ this.DrawPriceText(strPrice, line.Start, line.End, 1);
61131
+ }
60899
61132
  }
60900
-
61133
+
60901
61134
  var labInfo;
60902
61135
  if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
60903
61136
 
60904
61137
  this.AryShowButton=this.GetShowButton(); //获取按钮
60905
61138
 
60906
- //描述信息
60907
- if (labInfo)
61139
+ //框架内的描述信息
61140
+ if (labInfo && bVisibleRange)
60908
61141
  this.DrawLab(labInfo, drawPoint[0].Y);
60909
61142
 
60910
61143
  //画中心点
60911
- var xCenter=left+(right-left)/2;
60912
- var point={ X:xCenter, Y: drawPoint[0].Y };
60913
- this.DrawPoint([point]);
61144
+ if (bVisibleRange)
61145
+ {
61146
+ var xCenter=left+(right-left)/2;
61147
+ var point={ X:xCenter, Y: drawPoint[0].Y };
61148
+ this.DrawPoint([point]);
61149
+ }
60914
61150
 
60915
61151
  this.Canvas.restore();
60916
-
60917
61152
 
60918
61153
  //外部右侧显示价格
60919
61154
  if (this.ShowPriceTextConfig.IsShow[2])
@@ -60922,9 +61157,8 @@ function ChartDrawHLine()
60922
61157
  this.CalculateButtonSize();
60923
61158
  this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
60924
61159
  if (labInfo) this.DrawRightLab(labInfo, rtDraw);
60925
- if (labInfo) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
61160
+ if (labInfo && bVisibleRange) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
60926
61161
  }
60927
-
60928
61162
 
60929
61163
  //鼠标是否在按钮上
60930
61164
  if (moveonPoint && mouseStatus)
@@ -61124,9 +61358,32 @@ function ChartDrawHLine()
61124
61358
  {
61125
61359
  var left=this.Frame.ChartBorder.GetLeft();
61126
61360
  var right=this.Frame.ChartBorder.GetRight();
61361
+ var top=this.Frame.ChartBorder.GetTopEx();
61362
+ var bottom=this.Frame.ChartBorder.GetBottomEx();
61363
+ var pixelTatio = GetDevicePixelRatio();
61364
+
61365
+ if (IFrameSplitOperator.IsNumber(labInfo.TopOffset)) top-=labInfo.TopOffset;
61366
+ if (IFrameSplitOperator.IsNumber(labInfo.BottomOffset)) bottom+=labInfo.BottomOffset;
61367
+
61368
+ var yValue=this.Frame.GetYData(y,false);
61369
+ var strValue=yValue.toFixed(this.Precision);
61370
+ if (labInfo &&labInfo.PriceSuffixText) strValue+=labInfo.PriceSuffixText;
61371
+
61372
+ var bVisibleRange=true;
61373
+ if (y<top)
61374
+ {
61375
+ y=top;
61376
+ bVisibleRange=false;
61377
+ }
61378
+ else if (y>bottom)
61379
+ {
61380
+ y=bottom;
61381
+ bVisibleRange=false;
61382
+ }
61127
61383
 
61128
61384
  if (this.RightSpaceWidth>0)
61129
61385
  {
61386
+ if (!bVisibleRange) this.Canvas.setLineDash([2*pixelTatio,3*pixelTatio]); //虚线
61130
61387
  this.Canvas.strokeStyle=this.LineColor;
61131
61388
  this.Canvas.beginPath();
61132
61389
  this.Canvas.moveTo(right,ToFixedPoint(y));
@@ -61134,10 +61391,6 @@ function ChartDrawHLine()
61134
61391
  this.Canvas.stroke();
61135
61392
  }
61136
61393
 
61137
- var yValue=this.Frame.GetYData(y);
61138
- var strValue=yValue.toFixed(this.Precision);
61139
- if (labInfo &&labInfo.PriceSuffixText) strValue+=labInfo.PriceSuffixText;
61140
-
61141
61394
  this.Canvas.fillStyle=this.LineColor;
61142
61395
  this.Canvas.font=this.Font;
61143
61396
  var textWidth=this.Canvas.measureText(strValue).width;
@@ -69633,6 +69886,15 @@ function JSChartResource()
69633
69886
  LeftMargin:1,
69634
69887
  RightMargin:1
69635
69888
  };
69889
+
69890
+
69891
+ this.OrderFlow_Style5=
69892
+ {
69893
+ AskBarColor:"rgb(176,22,22)", //左
69894
+ BidBarColor:"rgb(98,126,176)", //右
69895
+ LeftMargin:3,
69896
+ RightMargin:2,
69897
+ };
69636
69898
 
69637
69899
 
69638
69900
  this.Index={};
@@ -106547,6 +106809,11 @@ function JSDraw(errorHandler,symbolData)
106547
106809
  return color;
106548
106810
  }
106549
106811
 
106812
+ this.STICKTYPE=function(value)
106813
+ {
106814
+ return value;
106815
+ }
106816
+
106550
106817
  //数据左右偏移
106551
106818
  this.XMOVE=function(offset)
106552
106819
  {
@@ -113302,7 +113569,7 @@ function JSExecute(ast,option)
113302
113569
  {
113303
113570
  let varName;
113304
113571
  let draw;
113305
- let color, upColor, downColor;
113572
+ let color, upColor, downColor, stickType;
113306
113573
  let lineWidth;
113307
113574
  let colorStick=false;
113308
113575
  let pointDot=false;
@@ -113447,6 +113714,10 @@ function JSExecute(ast,option)
113447
113714
  {
113448
113715
  downColor=itemExpression.Out;
113449
113716
  }
113717
+ else if (itemExpression.Callee.Name=="STICKTYPE")
113718
+ {
113719
+ stickType=itemExpression.Out;
113720
+ }
113450
113721
  else if (itemExpression.Callee.Name=="XMOVE")
113451
113722
  {
113452
113723
  xOffset=itemExpression.Out;
@@ -113587,6 +113858,7 @@ function JSExecute(ast,option)
113587
113858
  if (upColor) value.UpColor=upColor;
113588
113859
  if (downColor) value.DownColor=downColor;
113589
113860
  if (lineWidth) value.LineWidth=lineWidth;
113861
+ if (IFrameSplitOperator.IsNumber(stickType)) value.StickType=stickType;
113590
113862
  this.OutVarTable.push(value);
113591
113863
  }
113592
113864
  else if (lineArea && varName) //LINEAREA 面积
@@ -114121,6 +114393,9 @@ function JSExecute(ast,option)
114121
114393
  case "DOWNCOLOR":
114122
114394
  node.Out=this.Draw.DOWNCOLOR(args[0]);
114123
114395
  break;
114396
+ case "STICKTYPE": //柱子类型
114397
+ node.Out=this.Draw.STICKTYPE(args[0]);
114398
+ break;
114124
114399
  case "XMOVE":
114125
114400
  node.Out=this.Draw.XMOVE(args[0]);
114126
114401
  break;
@@ -115274,6 +115549,7 @@ function JSExplainer(ast,option)
115274
115549
  return `上涨颜色${args[0]}`;
115275
115550
  case "DOWNCOLOR":
115276
115551
  return `下跌颜色${args[0]}`;
115552
+ case "STICKTYPE":
115277
115553
  case "FIRSTDRAW":
115278
115554
  return "";
115279
115555
 
@@ -116802,6 +117078,7 @@ function ScriptIndex(name,script,args,option)
116802
117078
 
116803
117079
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
116804
117080
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
117081
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
116805
117082
  if (varItem.LineWidth)
116806
117083
  {
116807
117084
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -118713,6 +118990,7 @@ function OverlayScriptIndex(name,script,args,option)
118713
118990
 
118714
118991
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
118715
118992
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
118993
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
118716
118994
  if (varItem.LineWidth)
118717
118995
  {
118718
118996
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -137391,7 +137669,7 @@ function HQChartScriptWorker()
137391
137669
 
137392
137670
 
137393
137671
 
137394
- var HQCHART_VERSION="1.1.13388";
137672
+ var HQCHART_VERSION="1.1.13400";
137395
137673
 
137396
137674
  function PrintHQChartVersion()
137397
137675
  {