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.
@@ -91,7 +91,7 @@ function JSIndexScript()
91
91
  ['BOLL', this.BOLL],['BOLL副图', this.BOLL2],['BBI', this.BBI],
92
92
  ['DKX', this.DKX],['MIKE', this.MIKE],['PBX', this.PBX],
93
93
  ['ENE', this.ENE],['MACD', this.MACD],['KDJ', this.KDJ],["MACD2", this.MACD2],
94
- ['VOL', this.VOL],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
94
+ ['VOL', this.VOL],['VOL2', this.VOL2],["VOL_OVERLAY", this.VOL_OVERLAY], ['RSI', this.RSI],['BRAR', this.BRAR],
95
95
  ['WR', this.WR],['BIAS', this.BIAS],['OBV', this.OBV],
96
96
  ['DMI', this.DMI],['CR', this.CR],['PSY', this.PSY],
97
97
  ['CCI', this.CCI],['DMA', this.DMA],['TRIX', this.TRIX],
@@ -655,6 +655,23 @@ MA2:MA(VOL,M2);'
655
655
  return data;
656
656
  }
657
657
 
658
+ JSIndexScript.prototype.VOL2=function()
659
+ {
660
+ let data=
661
+ {
662
+ Name:'VOL', Description:'成交量', IsMainIndex:false,FloatPrecision:0,
663
+ Args:[ { Name:'M1', Value:5}, { Name:'M2', Value:10} ],
664
+ OutName:[ {Name:'MA1',DynamicName:"MA{M1}" }, {Name:'MA2',DynamicName:"MA{M2}" }],
665
+ Script: //脚本
666
+ 'VOL:VOL,VOLSTICK,STICKTYPE(1);\n\
667
+ MA1:MA(VOL,M1);\n\
668
+ MA2:MA(VOL,M2);'
669
+
670
+ };
671
+
672
+ return data;
673
+ }
674
+
658
675
  JSIndexScript.prototype.VOL_OVERLAY=function()
659
676
  {
660
677
  let data=
@@ -27504,6 +27521,14 @@ function ChartKLine()
27504
27521
  RightMargin:g_JSChartResource.OrderFlow_Style4.RightMargin,
27505
27522
  }
27506
27523
 
27524
+ this.OrderFlow_Style5=
27525
+ {
27526
+ AskBarColor:g_JSChartResource.OrderFlow_Style5.AskBarColor, //左
27527
+ BidBarColor:g_JSChartResource.OrderFlow_Style5.BidBarColor, //右
27528
+ LeftMargin:g_JSChartResource.OrderFlow_Style5.LeftMargin,
27529
+ RightMargin:g_JSChartResource.OrderFlow_Style5.RightMargin,
27530
+ }
27531
+
27507
27532
  this.IsShowOrderText=false;
27508
27533
 
27509
27534
  this.AryOrderFlowBorder=[]; //订单流边框 临时变量
@@ -31682,7 +31707,175 @@ function ChartKLine()
31682
31707
  //订单流样式5
31683
31708
  this.DrawOrderFlow_Style5=function()
31684
31709
  {
31710
+ var isHScreen=(this.ChartFrame.IsHScreen===true);
31711
+ var dataWidth=this.ChartFrame.DataWidth;
31712
+ var distanceWidth=this.ChartFrame.DistanceWidth;
31713
+ var border=this.ChartBorder.GetBorder();
31714
+ var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
31715
+ var chartright=border.RightEx;
31716
+ var xPointCount=this.ChartFrame.XPointCount;
31717
+ this.AryOrderFlowBorder=[];
31685
31718
 
31719
+ if (isHScreen)
31720
+ {
31721
+ var border=this.ChartBorder.GetHScreenBorder();
31722
+ xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
31723
+ chartright=border.BottomEx;
31724
+ }
31725
+
31726
+ var upColor=this.OrderFlow_Style2.UpColor;
31727
+ var downColor=this.OrderFlow_Style2.DownColor;
31728
+ var unchagneColor=this.OrderFlow_Style2.UnchagneColor;
31729
+ var barWidth=ToFixedRect(this.OrderFlow_Style2.BarWidth);
31730
+ var textWidth=dataWidth-barWidth;
31731
+ if (textWidth/7<barWidth) barWidth=textWidth/7;
31732
+ if (barWidth<=1) barWidth=2;
31733
+
31734
+ this.ShowRange.Start=this.Data.DataOffset;
31735
+ this.ShowRange.End=this.ShowRange.Start;
31736
+ this.ShowRange.DataCount=0;
31737
+ this.ShowRange.ShowCount=xPointCount;
31738
+ this.DrawKRange.Start=this.Data.DataOffset;
31739
+
31740
+ this.DrawOrderFlowHBar(); //横向柱子
31741
+
31742
+ for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth),++this.ShowRange.DataCount)
31743
+ {
31744
+ var data=this.Data.Data[i];
31745
+ this.ShowRange.End=i;
31746
+ if (data.Open==null || data.High==null || data.Low==null || data.Close==null) continue;
31747
+
31748
+ var left=xOffset;
31749
+ var right=xOffset+dataWidth;
31750
+ if (right>chartright) break;
31751
+ var x=left+(right-left)/2;
31752
+ var yLow=this.GetYFromData(data.Low, false);
31753
+ var yHigh=this.GetYFromData(data.High, false);
31754
+ var yOpen=this.GetYFromData(data.Open, false);
31755
+ var yClose=this.GetYFromData(data.Close, false);
31756
+ var y=yHigh;
31757
+
31758
+ this.DrawKRange.End=i;
31759
+
31760
+ var barTop=Math.min(yOpen,yClose);
31761
+ var barBottom=Math.max(yOpen,yClose);
31762
+ var barLeft=ToFixedRect(left);
31763
+ var barRight=barLeft+barWidth
31764
+ if (data.Open<data.Close) this.Canvas.fillStyle=upColor;
31765
+ else if (data.Open>data.Close) this.Canvas.fillStyle=downColor;
31766
+ else this.Canvas.fillStyle=unchagneColor;
31767
+
31768
+ var cellHeight=0;
31769
+ if (data.OrderFlow && IFrameSplitOperator.IsNumber(data.OrderFlow.PriceOffset)) cellHeight=this.GetPriceYOffset(data.OrderFlow.PriceOffset);
31770
+
31771
+ this.Canvas.fillRect(barLeft,ToFixedRect(barTop-cellHeight/2),barWidth,ToFixedRect(barBottom-barTop+cellHeight));
31772
+ var yKline={ Low:yLow, High:yHigh, Open:yOpen, Close:yClose };
31773
+ var xKLine={ Left:barRight, Center:x, Right:right, DataWidth:(right-barRight) };
31774
+ xKLine.Center=xKLine.Left+xKLine.DataWidth/2;
31775
+ this.DrawOrderFlowBar_Style5(data.OrderFlow, data, xKLine, yKline, isHScreen);
31776
+ }
31777
+ }
31778
+
31779
+ this.DrawOrderFlowBar_Style5=function(orderFlow, kItem, xKLine, yKline, isHScreen)
31780
+ {
31781
+ var top=Math.min(yKline.Open, yKline.Close)
31782
+ var bottom=Math.max(yKline.Open, yKline.Close);
31783
+ var barHeight=Math.abs(yKline.Open-yKline.Close);
31784
+ var cellHeight=0;
31785
+ if (orderFlow && IFrameSplitOperator.IsNumber(orderFlow.PriceOffset)) cellHeight=this.GetPriceYOffset(orderFlow.PriceOffset);
31786
+ var textFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2);
31787
+ this.IsShowOrderText=(cellHeight>5 && xKLine.DataWidth>10);
31788
+ if (this.OrderFlow.AlwaysShowOrderText) this.IsShowOrderText=true;
31789
+
31790
+ this.Canvas.textBaseline='middle';
31791
+
31792
+ this.Canvas.font=textFont;
31793
+ var textWidth=xKLine.DataWidth/2;
31794
+ if (orderFlow && IFrameSplitOperator.IsNonEmptyArray(orderFlow.Order))
31795
+ {
31796
+ var maxValue=orderFlow.MaxValue;
31797
+ for(var i=0;i<orderFlow.Order.length;++i)
31798
+ {
31799
+ var item=orderFlow.Order[i];
31800
+ var yPrice=this.GetYFromData(item.Price, false);
31801
+
31802
+ var rect={ Left:xKLine.Left, Right:xKLine.Center, Bottom:yPrice+cellHeight/2, Top:yPrice-cellHeight/2 };
31803
+ rect.Width=rect.Right-rect.Left;
31804
+ rect.Height=rect.Bottom-rect.Top;
31805
+
31806
+ if (IFrameSplitOperator.IsNumber(item.Ask.Value))
31807
+ {
31808
+ var color=this.OrderFlow_Style5.AskBarColor;
31809
+ if (item.Ask.BG) color=item.Ask.BG;
31810
+ this.Canvas.fillStyle=color;
31811
+ var barWidth=rect.Width*item.Ask.Value/maxValue;
31812
+ this.Canvas.fillRect(ToFixedRect(rect.Right),ToFixedRect(rect.Top),ToFixedRect(-barWidth),ToFixedRect(rect.Height));
31813
+
31814
+ var text=null;
31815
+ if (IFrameSplitOperator.IsString(item.Ask.Text)) text=item.Ask.Text;
31816
+ else text=item.Ask.Value.toString();
31817
+ if (text && this.IsShowOrderText)
31818
+ {
31819
+ var textColor=this.OrderFlow.Text.Color;
31820
+ if (item.Ask.Color) textColor=item.Ask.Color;
31821
+
31822
+ this.Canvas.fillStyle=textColor;
31823
+ this.Canvas.textAlign='right';
31824
+ var xText=rect.Right-this.OrderFlow_Style5.LeftMargin;
31825
+ if (item.Ask.Font)
31826
+ {
31827
+ var itemFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2, item.Ask.Font);
31828
+ this.Canvas.font=itemFont;
31829
+ this.Canvas.fillText(text,xText,yPrice);
31830
+ this.Canvas.font=textFont;
31831
+ }
31832
+ else
31833
+ {
31834
+ this.Canvas.fillText(text,xText,yPrice);
31835
+ }
31836
+ }
31837
+ }
31838
+
31839
+
31840
+ var rect={ Left:xKLine.Center, Right:xKLine.Right, Bottom:yPrice+cellHeight/2, Top:yPrice-cellHeight/2 };
31841
+ rect.Width=rect.Right-rect.Left;
31842
+ rect.Height=rect.Bottom-rect.Top;
31843
+
31844
+ if (IFrameSplitOperator.IsNumber(item.Bid.Value))
31845
+ {
31846
+ var color=this.OrderFlow_Style5.BidBarColor;
31847
+ if (item.Bid.BG) color=item.Bid.BG;
31848
+ this.Canvas.fillStyle=color;
31849
+ var barWidth=rect.Width*item.Bid.Value/maxValue;
31850
+ this.Canvas.fillRect(ToFixedRect(rect.Left),ToFixedRect(rect.Top),ToFixedRect(barWidth),ToFixedRect(rect.Height));
31851
+
31852
+ var text=null;
31853
+ if (IFrameSplitOperator.IsString(item.Bid.Text)) text=item.Bid.Text;
31854
+ else text=item.Bid.Value.toString();
31855
+ if (text && this.IsShowOrderText)
31856
+ {
31857
+ var textColor=this.OrderFlow.Text.Color;
31858
+ if (item.Bid.Color)textColor=item.Bid.Color;
31859
+
31860
+ this.Canvas.fillStyle=textColor;
31861
+ this.Canvas.textAlign='left';
31862
+ var xText=rect.Left+this.OrderFlow_Style5.RightMargin
31863
+ if (item.Bid.Font)
31864
+ {
31865
+ var itemFont=this.GetDynamicOrderFlowFont(cellHeight, xKLine.DataWidth/2, item.Bid.Font);
31866
+ this.Canvas.font=itemFont;
31867
+ this.Canvas.fillText(text,xText,yPrice);
31868
+ this.Canvas.font=textFont;
31869
+ }
31870
+ else
31871
+ {
31872
+ this.Canvas.fillText(text,xText,yPrice);
31873
+ }
31874
+
31875
+ }
31876
+ }
31877
+ }
31878
+ }
31686
31879
  }
31687
31880
 
31688
31881
  //////////////////////////////////////////////////////////////
@@ -35494,10 +35687,11 @@ function ChartVolStick()
35494
35687
  this.DownColor=g_JSChartResource.DownBarColor;
35495
35688
  this.HistoryData; //历史数据
35496
35689
  this.KLineDrawType=0;
35690
+
35497
35691
  this.ClassName='ChartVolStick';
35498
35692
 
35499
- this.BarWidth; //固定宽度 目前只支持宽度为1
35500
-
35693
+ this.BarWidth; //固定宽度 目前只支持宽度为1
35694
+ this.BarType; //柱子状态 1=实心 0=空心 2=涨实跌空 如果设置了这个属性, 属性KLineDrawType无效
35501
35695
  this.PtInChart=this.PtInBar;
35502
35696
  this.DrawSelectedStatus=this.DrawLinePoint;
35503
35697
 
@@ -35544,28 +35738,24 @@ function ChartVolStick()
35544
35738
  var y=this.ChartFrame.GetYFromData(value);
35545
35739
  var barColor=this.GetBarColor(kItem);
35546
35740
  var bUp=barColor.IsUp;
35547
- this.Canvas.fillStyle=barColor.Color;
35741
+
35548
35742
 
35549
35743
  var height=ToFixedRect(Math.abs(yBottom-y)>=1?yBottom-y:1);//高度调整为整数, 如果小于1, 统一使用1
35550
35744
  y=yBottom-height;
35551
- if (this.KLineDrawType==6) //完全空心柱
35745
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35746
+
35747
+ if (bSolidBar)
35552
35748
  {
35553
- this.Canvas.strokeStyle=barColor.Color;
35554
- this.Canvas.beginPath();
35555
- this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35556
- this.Canvas.stroke();
35749
+ this.Canvas.fillStyle=barColor.Color;
35750
+ this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35557
35751
  }
35558
- else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35752
+ else
35559
35753
  {
35560
- this.Canvas.strokeStyle=this.UpColor;
35754
+ this.Canvas.strokeStyle=barColor.Color;
35561
35755
  this.Canvas.beginPath();
35562
35756
  this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),height);
35563
35757
  this.Canvas.stroke();
35564
35758
  }
35565
- else
35566
- {
35567
- this.Canvas.fillRect(ToFixedRect(left),y,ToFixedRect(dataWidth),height);
35568
- }
35569
35759
  }
35570
35760
  }
35571
35761
  else //太细了直接话线
@@ -35638,19 +35828,21 @@ function ChartVolStick()
35638
35828
  var y=this.ChartFrame.GetYFromData(value);
35639
35829
  var barColor=this.GetBarColor(kItem);
35640
35830
  var bUp=barColor.IsUp;
35641
- this.Canvas.fillStyle=barColor.Color;
35642
35831
 
35643
35832
  var height=ToFixedRect(y-yBottom); //高度调整为整数
35644
- if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35833
+ var bSolidBar=this.IsSolidBar(bUp); //实心柱子
35834
+
35835
+ if (bSolidBar)
35645
35836
  {
35646
- this.Canvas.strokeStyle=this.UpColor;
35647
- this.Canvas.beginPath();
35648
- this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35649
- this.Canvas.stroke();
35837
+ this.Canvas.fillStyle=barColor.Color;
35838
+ this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35650
35839
  }
35651
35840
  else
35652
35841
  {
35653
- this.Canvas.fillRect(yBottom,ToFixedRect(left),height,ToFixedRect(dataWidth));
35842
+ this.Canvas.strokeStyle=barColor.Color;
35843
+ this.Canvas.beginPath();
35844
+ this.Canvas.rect(ToFixedPoint(yBottom),ToFixedPoint(left),height,ToFixedRect(dataWidth));
35845
+ this.Canvas.stroke();
35654
35846
  }
35655
35847
  }
35656
35848
  }
@@ -35726,6 +35918,29 @@ function ChartVolStick()
35726
35918
  else return { Color:this.DownColor, IsUp:false };
35727
35919
  }
35728
35920
 
35921
+ //true=实心 false=空心
35922
+ this.IsSolidBar=function(bUp)
35923
+ {
35924
+ var bSolidBar=true; //实心柱子
35925
+
35926
+ if (this.BarType===0 || this.BarType===1 || this.BarType===2)
35927
+ {
35928
+ if (this.BarType===0) //空心
35929
+ bSolidBar=false;
35930
+ else if (this.BarType===2) //涨实跌空
35931
+ bSolidBar=bUp;
35932
+ }
35933
+ else
35934
+ {
35935
+ if (this.KLineDrawType==6) //完全空心柱
35936
+ bSolidBar=false;
35937
+ else if (bUp && (this.KLineDrawType==1 || this.KLineDrawType==2 || this.KLineDrawType==3)) //空心柱子
35938
+ bSolidBar=false;
35939
+ }
35940
+
35941
+ return bSolidBar;
35942
+ }
35943
+
35729
35944
  this.GetMinuteBarColor=function(kItem, preItem)
35730
35945
  {
35731
35946
  var prePrice=kItem.YClose;
@@ -41440,6 +41655,8 @@ function ChartMultiText()
41440
41655
  var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
41441
41656
  var left=this.ChartBorder.GetTop();
41442
41657
  var right=this.ChartBorder.GetBottom();
41658
+ var top=border.RightEx;
41659
+ var bottom=border.LeftEx;
41443
41660
  }
41444
41661
  else
41445
41662
  {
@@ -41448,6 +41665,8 @@ function ChartMultiText()
41448
41665
  var chartright=border.RightEx;
41449
41666
  var left=this.ChartBorder.GetLeft();
41450
41667
  var right=this.ChartBorder.GetRight();
41668
+ var top=border.TopEx;
41669
+ var bottom=border.BottomEx;
41451
41670
  }
41452
41671
 
41453
41672
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
@@ -41582,6 +41801,8 @@ function ChartMultiText()
41582
41801
  for(var i in this.Texts)
41583
41802
  {
41584
41803
  var item=this.Texts[i];
41804
+ if (!IFrameSplitOperator.IsNumber(item.Value)) continue;
41805
+
41585
41806
  if (item.Index>=start && item.Index<end)
41586
41807
  {
41587
41808
  if (range.Max==null) range.Max=item.Value;
@@ -50187,7 +50408,7 @@ function FrameSplitKLinePriceY()
50187
50408
  this.Frame.HorizontalInfo[i]= new CoordinateInfo();
50188
50409
  this.Frame.HorizontalInfo[i].Value=value;
50189
50410
  if (this.IsShowLeftText) this.Frame.HorizontalInfo[i].Message[0]=value.toFixed(floatPrecision);
50190
- if (this.IsShowRightText) this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);
50411
+ if (this.IsShowRightText) this.Frame.HorizontalInfo[i].Message[1]=value.toFixed(floatPrecision);
50191
50412
  }
50192
50413
  }
50193
50414
 
@@ -60621,6 +60842,8 @@ function ChartDrawHLine()
60621
60842
 
60622
60843
  this.TextMargin={ Left:0, Right:0 };
60623
60844
 
60845
+ this.AlwaysShowLab=false; //总是显示标签
60846
+
60624
60847
  this.Button=
60625
60848
  {
60626
60849
  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 } },
@@ -60667,7 +60890,9 @@ function ChartDrawHLine()
60667
60890
  if (option.ButtonBGColor) this.ButtonBGColor=option.ButtonBGColor;
60668
60891
  if (IFrameSplitOperator.IsNumber(option.ButtonPosition)) this.ButtonPosition=option.ButtonPosition;
60669
60892
  if (IFrameSplitOperator.IsNumber(option.RightSpaceWidth)) this.RightSpaceWidth=option.RightSpaceWidth;
60893
+ if (IFrameSplitOperator.IsBool(option.AlwaysShowLab)) this.AlwaysShowLab=option.AlwaysShowLab;
60670
60894
 
60895
+
60671
60896
  if (option.Button)
60672
60897
  {
60673
60898
  var item=option.Button;
@@ -60795,7 +61020,8 @@ function ChartDrawHLine()
60795
61020
  if (!drawPoint || drawPoint.length!=1) return;
60796
61021
  if (!this.Frame) return;
60797
61022
  if (this.Value.length!=1) return;
60798
- if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
61023
+ var bVisibleRange=this.IsYValueInFrame(this.Value[0].YValue); //是否在可视范围
61024
+ if (!this.AlwaysShowLab && !bVisibleRange) return;
60799
61025
 
60800
61026
  var isHScreen=this.Frame.IsHScreen;
60801
61027
  var left=this.Frame.ChartBorder.GetLeft();
@@ -60805,71 +61031,80 @@ function ChartDrawHLine()
60805
61031
  left=this.Frame.ChartBorder.GetTop();
60806
61032
  right=this.Frame.ChartBorder.GetBottom();
60807
61033
  }
61034
+
60808
61035
  this.ClipFrame();
60809
61036
 
60810
61037
  //画线段
60811
- this.Canvas.strokeStyle=this.LineColor;
60812
- this.SetLineWidth();
60813
- this.Canvas.beginPath();
60814
- if (isHScreen)
61038
+ if (bVisibleRange)
60815
61039
  {
60816
- this.Canvas.moveTo(drawPoint[0].X,left);
60817
- this.Canvas.lineTo(drawPoint[0].X,right);
60818
- }
60819
- else
60820
- {
60821
- this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));
60822
- this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));
61040
+ this.Canvas.strokeStyle=this.LineColor;
61041
+ this.SetLineWidth();
61042
+ this.Canvas.beginPath();
61043
+ if (isHScreen)
61044
+ {
61045
+ this.Canvas.moveTo(drawPoint[0].X,left);
61046
+ this.Canvas.lineTo(drawPoint[0].X,right);
61047
+ }
61048
+ else
61049
+ {
61050
+ this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));
61051
+ this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));
61052
+ }
61053
+ this.Canvas.stroke();
61054
+ this.RestoreLineWidth();
60823
61055
  }
60824
- this.Canvas.stroke();
60825
- this.RestoreLineWidth();
60826
61056
 
60827
61057
  //画水平线段
60828
- var line={Start:new Point(), End:new Point()};
60829
- if (isHScreen)
60830
- {
60831
- line.Start.X=drawPoint[0].X;
60832
- line.Start.Y=left;
60833
- line.End.X=drawPoint[0].X;
60834
- line.End.Y=right;
60835
- }
60836
- else
60837
- {
60838
- line.Start.X=left;
60839
- line.Start.Y=drawPoint[0].Y;
60840
- line.End.X=right;
60841
- line.End.Y=drawPoint[0].Y;
60842
- }
60843
- this.LinePoint.push(line);
60844
-
60845
- var yValue=this.Frame.GetYData(drawPoint[0].Y);
60846
- var strPrice=yValue.toFixed(this.Precision);
60847
- if (this.ShowPriceTextConfig.IsShow[0])
61058
+ if (bVisibleRange)
60848
61059
  {
60849
- this.DrawPriceText(strPrice, line.Start, line.End, 0);
60850
- }
60851
-
60852
- if (this.ShowPriceTextConfig.IsShow[1])
60853
- {
60854
- this.DrawPriceText(strPrice, line.Start, line.End, 1);
61060
+ var line={Start:new Point(), End:new Point()};
61061
+ if (isHScreen)
61062
+ {
61063
+ line.Start.X=drawPoint[0].X;
61064
+ line.Start.Y=left;
61065
+ line.End.X=drawPoint[0].X;
61066
+ line.End.Y=right;
61067
+ }
61068
+ else
61069
+ {
61070
+ line.Start.X=left;
61071
+ line.Start.Y=drawPoint[0].Y;
61072
+ line.End.X=right;
61073
+ line.End.Y=drawPoint[0].Y;
61074
+ }
61075
+ this.LinePoint.push(line);
61076
+
61077
+ var yValue=this.Frame.GetYData(drawPoint[0].Y, false);
61078
+ var strPrice=yValue.toFixed(this.Precision);
61079
+ if (this.ShowPriceTextConfig.IsShow[0])
61080
+ {
61081
+ this.DrawPriceText(strPrice, line.Start, line.End, 0);
61082
+ }
61083
+
61084
+ if (this.ShowPriceTextConfig.IsShow[1])
61085
+ {
61086
+ this.DrawPriceText(strPrice, line.Start, line.End, 1);
61087
+ }
60855
61088
  }
60856
-
61089
+
60857
61090
  var labInfo;
60858
61091
  if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
60859
61092
 
60860
61093
  this.AryShowButton=this.GetShowButton(); //获取按钮
60861
61094
 
60862
- //描述信息
60863
- if (labInfo)
61095
+ //框架内的描述信息
61096
+ if (labInfo && bVisibleRange)
60864
61097
  this.DrawLab(labInfo, drawPoint[0].Y);
60865
61098
 
60866
61099
  //画中心点
60867
- var xCenter=left+(right-left)/2;
60868
- var point={ X:xCenter, Y: drawPoint[0].Y };
60869
- this.DrawPoint([point]);
61100
+ if (bVisibleRange)
61101
+ {
61102
+ var xCenter=left+(right-left)/2;
61103
+ var point={ X:xCenter, Y: drawPoint[0].Y };
61104
+ this.DrawPoint([point]);
61105
+ }
60870
61106
 
60871
61107
  this.Canvas.restore();
60872
-
60873
61108
 
60874
61109
  //外部右侧显示价格
60875
61110
  if (this.ShowPriceTextConfig.IsShow[2])
@@ -60878,9 +61113,8 @@ function ChartDrawHLine()
60878
61113
  this.CalculateButtonSize();
60879
61114
  this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
60880
61115
  if (labInfo) this.DrawRightLab(labInfo, rtDraw);
60881
- if (labInfo) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
61116
+ if (labInfo && bVisibleRange) this.DrawCustomHLine(labInfo, drawPoint[0].Y);
60882
61117
  }
60883
-
60884
61118
 
60885
61119
  //鼠标是否在按钮上
60886
61120
  if (moveonPoint && mouseStatus)
@@ -61080,9 +61314,32 @@ function ChartDrawHLine()
61080
61314
  {
61081
61315
  var left=this.Frame.ChartBorder.GetLeft();
61082
61316
  var right=this.Frame.ChartBorder.GetRight();
61317
+ var top=this.Frame.ChartBorder.GetTopEx();
61318
+ var bottom=this.Frame.ChartBorder.GetBottomEx();
61319
+ var pixelTatio = GetDevicePixelRatio();
61320
+
61321
+ if (IFrameSplitOperator.IsNumber(labInfo.TopOffset)) top-=labInfo.TopOffset;
61322
+ if (IFrameSplitOperator.IsNumber(labInfo.BottomOffset)) bottom+=labInfo.BottomOffset;
61323
+
61324
+ var yValue=this.Frame.GetYData(y,false);
61325
+ var strValue=yValue.toFixed(this.Precision);
61326
+ if (labInfo &&labInfo.PriceSuffixText) strValue+=labInfo.PriceSuffixText;
61327
+
61328
+ var bVisibleRange=true;
61329
+ if (y<top)
61330
+ {
61331
+ y=top;
61332
+ bVisibleRange=false;
61333
+ }
61334
+ else if (y>bottom)
61335
+ {
61336
+ y=bottom;
61337
+ bVisibleRange=false;
61338
+ }
61083
61339
 
61084
61340
  if (this.RightSpaceWidth>0)
61085
61341
  {
61342
+ if (!bVisibleRange) this.Canvas.setLineDash([2*pixelTatio,3*pixelTatio]); //虚线
61086
61343
  this.Canvas.strokeStyle=this.LineColor;
61087
61344
  this.Canvas.beginPath();
61088
61345
  this.Canvas.moveTo(right,ToFixedPoint(y));
@@ -61090,10 +61347,6 @@ function ChartDrawHLine()
61090
61347
  this.Canvas.stroke();
61091
61348
  }
61092
61349
 
61093
- var yValue=this.Frame.GetYData(y);
61094
- var strValue=yValue.toFixed(this.Precision);
61095
- if (labInfo &&labInfo.PriceSuffixText) strValue+=labInfo.PriceSuffixText;
61096
-
61097
61350
  this.Canvas.fillStyle=this.LineColor;
61098
61351
  this.Canvas.font=this.Font;
61099
61352
  var textWidth=this.Canvas.measureText(strValue).width;
@@ -69589,6 +69842,15 @@ function JSChartResource()
69589
69842
  LeftMargin:1,
69590
69843
  RightMargin:1
69591
69844
  };
69845
+
69846
+
69847
+ this.OrderFlow_Style5=
69848
+ {
69849
+ AskBarColor:"rgb(176,22,22)", //左
69850
+ BidBarColor:"rgb(98,126,176)", //右
69851
+ LeftMargin:3,
69852
+ RightMargin:2,
69853
+ };
69592
69854
 
69593
69855
 
69594
69856
  this.Index={};
@@ -106503,6 +106765,11 @@ function JSDraw(errorHandler,symbolData)
106503
106765
  return color;
106504
106766
  }
106505
106767
 
106768
+ this.STICKTYPE=function(value)
106769
+ {
106770
+ return value;
106771
+ }
106772
+
106506
106773
  //数据左右偏移
106507
106774
  this.XMOVE=function(offset)
106508
106775
  {
@@ -113258,7 +113525,7 @@ function JSExecute(ast,option)
113258
113525
  {
113259
113526
  let varName;
113260
113527
  let draw;
113261
- let color, upColor, downColor;
113528
+ let color, upColor, downColor, stickType;
113262
113529
  let lineWidth;
113263
113530
  let colorStick=false;
113264
113531
  let pointDot=false;
@@ -113403,6 +113670,10 @@ function JSExecute(ast,option)
113403
113670
  {
113404
113671
  downColor=itemExpression.Out;
113405
113672
  }
113673
+ else if (itemExpression.Callee.Name=="STICKTYPE")
113674
+ {
113675
+ stickType=itemExpression.Out;
113676
+ }
113406
113677
  else if (itemExpression.Callee.Name=="XMOVE")
113407
113678
  {
113408
113679
  xOffset=itemExpression.Out;
@@ -113543,6 +113814,7 @@ function JSExecute(ast,option)
113543
113814
  if (upColor) value.UpColor=upColor;
113544
113815
  if (downColor) value.DownColor=downColor;
113545
113816
  if (lineWidth) value.LineWidth=lineWidth;
113817
+ if (IFrameSplitOperator.IsNumber(stickType)) value.StickType=stickType;
113546
113818
  this.OutVarTable.push(value);
113547
113819
  }
113548
113820
  else if (lineArea && varName) //LINEAREA 面积
@@ -114077,6 +114349,9 @@ function JSExecute(ast,option)
114077
114349
  case "DOWNCOLOR":
114078
114350
  node.Out=this.Draw.DOWNCOLOR(args[0]);
114079
114351
  break;
114352
+ case "STICKTYPE": //柱子类型
114353
+ node.Out=this.Draw.STICKTYPE(args[0]);
114354
+ break;
114080
114355
  case "XMOVE":
114081
114356
  node.Out=this.Draw.XMOVE(args[0]);
114082
114357
  break;
@@ -115230,6 +115505,7 @@ function JSExplainer(ast,option)
115230
115505
  return `上涨颜色${args[0]}`;
115231
115506
  case "DOWNCOLOR":
115232
115507
  return `下跌颜色${args[0]}`;
115508
+ case "STICKTYPE":
115233
115509
  case "FIRSTDRAW":
115234
115510
  return "";
115235
115511
 
@@ -116758,6 +117034,7 @@ function ScriptIndex(name,script,args,option)
116758
117034
 
116759
117035
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
116760
117036
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
117037
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
116761
117038
  if (varItem.LineWidth)
116762
117039
  {
116763
117040
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -118669,6 +118946,7 @@ function OverlayScriptIndex(name,script,args,option)
118669
118946
 
118670
118947
  if (varItem.UpColor) chart.UpColor=varItem.UpColor;
118671
118948
  if (varItem.DownColor) chart.DownColor=varItem.DownColor;
118949
+ if (IFrameSplitOperator.IsNumber(varItem.StickType)) chart.BarType=varItem.StickType;
118672
118950
  if (varItem.LineWidth)
118673
118951
  {
118674
118952
  let width=parseInt(varItem.LineWidth.replace("LINETHICK",""));
@@ -133450,7 +133728,7 @@ function ScrollBarBGChart()
133450
133728
 
133451
133729
 
133452
133730
 
133453
- var HQCHART_VERSION="1.1.13388";
133731
+ var HQCHART_VERSION="1.1.13400";
133454
133732
 
133455
133733
  function PrintHQChartVersion()
133456
133734
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13388";
8
+ var HQCHART_VERSION="1.1.13400";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {