hqchart 1.1.11291 → 1.1.11299

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.
@@ -1943,6 +1943,7 @@ this.Font=g_JSChartResource.FrameSplitTextFont;//字体
1943
1943
  this.LineColor=g_JSChartResource.FrameSplitPen;//线段颜色
1944
1944
  this.LineDash=null;//当线段类型==2时 可以设置虚线样式
1945
1945
  this.LineType=1;//线段类型 -1 不画线段 2 虚线 8,9=集合竞价坐标
1946
+ this.LineWidth;//线段宽度
1946
1947
  this.ExtendData;//扩展属性
1947
1948
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
1948
1949
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -2044,11 +2045,12 @@ this.GetYFromData=function(value,isLimit){if(this.Logarithmic&&this.GetYLogarith
2044
2045
  this.DrawHorizontal=function(){this.RightTextMaxWidth=0;if(!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo))return;var border=this.ChartBorder.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=this.ChartBorder.GetTopTitle();var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var isDrawLeft=borderLeft>10&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderRight>10&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;var yPrev=null;//上一个坐标y的值
2045
2046
  var pixelRatio=GetDevicePixelRatio();var itemHeight=(border.BottomEx-border.TopEx)/this.HorizontalInfo.length;var aryMultiText=[];for(var i=this.HorizontalInfo.length-1;i>=0;--i)//从上往下画分割线
2046
2047
  {var item=this.HorizontalInfo[i];var y=this.GetYFromData(item.Value);if(y!=null&&yPrev!=null&&Math.abs(y-yPrev)<this.MinYDistance)continue;//两个坐标在近了 就不画了
2047
- var yFixed=ToFixedPoint(y);if(y!=bottom&&this.IsShowYLine){this.Canvas.strokeStyle=item.LineColor;if(item.LineType==2){this.Canvas.save();if(item.LineDash)this.Canvas.setLineDash(item.LineDash);else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]);//虚线
2048
- this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();this.Canvas.restore();}else if(item.LineType==3)//只在刻度边上画一个短横线
2048
+ var yFixed=ToFixedPoint(y);if(y!=bottom&&this.IsShowYLine){var bChangeLineWidth=false;if(IFrameSplitOperator.IsPlusNumber(item.LineWidth))//刻度线宽度
2049
+ {this.Canvas.lineWidth=item.LineWidth*pixelRatio;bChangeLineWidth=true;}this.Canvas.strokeStyle=item.LineColor;if(item.LineType==2){if(item.LineDash)this.Canvas.setLineDash(item.LineDash);else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]);//虚线
2050
+ this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();this.Canvas.setLineDash([]);}else if(item.LineType==3)//只在刻度边上画一个短横线
2049
2051
  {}else if(item.LineType==8||item.LineType==9)//集合竞价不画线
2050
2052
  {}else if(item.LineType>0){if(g_JSChartResource.FrameYLineDash){this.Canvas.setLineDash(g_JSChartResource.FrameYLineDash);//虚线
2051
- this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();}}}var yText=y;if(y>=bottom-2){this.Canvas.textBaseline='bottom';}else if(y<=top+2){this.Canvas.textBaseline='top';yText+=this.YTextTopOffset;}else{this.Canvas.textBaseline="middle";}//坐标信息 左边 间距小于10 不画坐标
2053
+ this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();}}if(bChangeLineWidth){this.Canvas.lineWidth=pixelRatio;}}var yText=y;if(y>=bottom-2){this.Canvas.textBaseline='bottom';}else if(y<=top+2){this.Canvas.textBaseline='top';yText+=this.YTextTopOffset;}else{this.Canvas.textBaseline="middle";}//坐标信息 左边 间距小于10 不画坐标
2052
2054
  this.Canvas.strokeStyle=item.TextColor;this.Canvas.fillStyle=item.TextColor;if(item.Message[0]!=null&&isDrawLeft){if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.fillText(item.Message[0],left-this.YTextPadding[0],yText);}//坐标信息 右边 间距小于10 不画坐标
2053
2055
  if(item.Message[1]!=null&&isDrawRight){if(item.Font!=null)this.Canvas.font=item.Font;var xText=right;if(item.LineType==3){var lineLength=this.ShortYLineLength*GetDevicePixelRatio();this.Canvas.beginPath();this.Canvas.moveTo(xText,yFixed);this.Canvas.lineTo(xText+lineLength,yFixed);this.Canvas.stroke();xText+=lineLength;}this.Canvas.textAlign="left";if(Array.isArray(item.Message[1])){if(this.MultiTextFormat==1)//显示1行 格式:价格/百分比
2054
2056
  {if(item.ExtendData){if(item.ExtendData.Font)this.Canvas.font=item.ExtendData.Font;}var textData={Text:[{Text:item.Message[1][0],Width:this.Canvas.measureText(item.Message[1][0]).width},{Text:item.Message[1][1],Width:this.Canvas.measureText(item.Message[1][1]).width}],X:xText+2,Y:yText,TextBaseline:this.Canvas.textBaseline,Item:item};aryMultiText.push(textData);}else if(this.MultiTextFormat==2)//显示2行
@@ -2915,7 +2917,7 @@ else if(data.Open>data.Close)this.Canvas.strokeStyle=this.DownColor;//阳线
2915
2917
  else this.Canvas.strokeStyle=this.UnchagneColor;//平线
2916
2918
  if(this.ColorData)///五彩K线颜色设置
2917
2919
  {if(i<this.ColorData.length)upColor=downColor=unchagneColor=this.ColorData[i]>0?this.UpColor:this.DownColor;else upColor=downColor=unchagneColor=this.DownColor;}this.Canvas.beginPath();//最高-最低
2918
- if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.stroke();if(dataWidth>=4){this.Canvas.beginPath();//开盘
2920
+ if(isHScreen){if(data.High==data.Low&&dataWidth<4){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow-1,ToFixedPoint(x));}else{this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}}else{if(data.High==data.Low&&dataWidth<4){this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow+1);}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}}this.Canvas.stroke();if(dataWidth>=4){this.Canvas.beginPath();//开盘
2919
2921
  if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yOpen),left);this.Canvas.lineTo(ToFixedPoint(yOpen),x);}else{this.Canvas.moveTo(left,ToFixedPoint(yOpen));this.Canvas.lineTo(x,ToFixedPoint(yOpen));}this.Canvas.stroke();this.Canvas.beginPath();//收盘
2920
2922
  if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yClose),right);this.Canvas.lineTo(ToFixedPoint(yClose),x);}else{this.Canvas.moveTo(right,ToFixedPoint(yClose));this.Canvas.lineTo(x,ToFixedPoint(yClose));}this.Canvas.stroke();}if(this.Data.DataType==0){var infoItem={Xleft:left,XRight:right,YMax:yHigh,XCenter:x,YMin:yLow,DayData:data,Index:j};this.DrawInfo(infoItem);}}this.PtMax=ptMax;this.PtMin=ptMin;};this.DrawCloseArea=function()//收盘价面积图
2921
2923
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var borderLeft=border.TopEx;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var borderLeft=border.LeftEx;}var bFirstPoint=true;var firstPoint=null;this.Canvas.beginPath();this.Canvas.strokeStyle=this.CloseLineColor;if(IFrameSplitOperator.IsNumber(this.CloseLineWidth))this.Canvas.lineWidth=this.CloseLineWidth;var ptLast=null;if(this.Data.DataOffset>0)//把最左边的一个点连上
@@ -2950,7 +2952,7 @@ else this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yClose-y)
2950
2952
  {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=downColor;this.Canvas.stroke();}};this.DrawKBar_Unchagne=function(data,dataWidth,unchagneColor,drawType,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen)//平线
2951
2953
  {if(dataWidth>=4){if(dataWidth%2!=0)dataWidth-=1;this.Canvas.strokeStyle=unchagneColor;this.Canvas.beginPath();if(data.High>data.Close)//上影线
2952
2954
  {if(isHScreen){this.Canvas.moveTo(y,ToFixedPoint(x));this.Canvas.lineTo(yOpen,ToFixedPoint(x));}else{var xFixed=ToFixedPoint(left+dataWidth/2);this.Canvas.moveTo(xFixed,y);this.Canvas.lineTo(xFixed,yOpen);}y=yOpen;}else{y=yOpen;}if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(left));this.Canvas.lineTo(ToFixedPoint(y),ToFixedPoint(right));}else{this.Canvas.moveTo(ToFixedPoint(left),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(left+dataWidth),ToFixedPoint(y));}if(data.Open>data.Low)//下影线
2953
- {if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{var xFixed=ToFixedPoint(left+dataWidth/2);this.Canvas.moveTo(xFixed,ToFixedPoint(y));this.Canvas.lineTo(xFixed,ToFixedPoint(yLow));}}this.Canvas.stroke();}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=unchagneColor;this.Canvas.stroke();}};this.DrawKBar_Custom=function(data,dataWidth,barColor,drawType,option,x,y,left,right,yLow,yHigh,yOpen,yClose,border,isHScreen){if(option.BGColor)//画背景色
2955
+ {if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{var xFixed=ToFixedPoint(left+dataWidth/2);this.Canvas.moveTo(xFixed,ToFixedPoint(y));this.Canvas.lineTo(xFixed,ToFixedPoint(yLow));}}this.Canvas.stroke();}else{this.Canvas.beginPath();if(isHScreen){if(data.High==data.Low){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow-1,ToFixedPoint(x));}else{this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}}else{if(data.High==data.Low){this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow+1);}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}}this.Canvas.strokeStyle=unchagneColor;this.Canvas.stroke();}};this.DrawKBar_Custom=function(data,dataWidth,barColor,drawType,option,x,y,left,right,yLow,yHigh,yOpen,yClose,border,isHScreen){if(option.BGColor)//画背景色
2954
2956
  {this.Canvas.fillStyle=option.BGColor;var distanceWidth=this.ChartFrame.DistanceWidth;if(isHScreen){var yLeft=left-distanceWidth/2;var yRight=right+distanceWidth/2;var xTop=border.RightEx;var xBottom=border.LeftEx;this.Canvas.fillRect(ToFixedRect(xBottom),ToFixedRect(yLeft),ToFixedRect(xTop-xBottom),ToFixedRect(yRight-yLeft));}else{var xLeft=left-distanceWidth/2;var xRight=right+distanceWidth/2;var yTop=border.TopEx;var yBottom=border.BottomEx;this.Canvas.fillRect(ToFixedRect(xLeft),ToFixedRect(yTop),ToFixedRect(xRight-xLeft),ToFixedRect(yBottom-yTop));}}if(dataWidth>=4){this.Canvas.strokeStyle=barColor;if(data.High>data.Close)//上影线
2955
2957
  {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(drawType==3?Math.max(yClose,yOpen):yClose),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(drawType==3?Math.min(yClose,yOpen):yClose));}this.Canvas.stroke();y=yClose;}else{y=yClose;}this.Canvas.fillStyle=barColor;if(isHScreen){if(Math.abs(yOpen-y)<1){this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
2956
2958
  }else{if(drawType==3)//空心柱
@@ -2958,30 +2960,16 @@ else this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yClose-y)
2958
2960
  }else{if(drawType==3)//空心柱
2959
2961
  {this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));}}}if(data.Open>data.Low)//下影线
2960
2962
  {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(drawType==3?Math.min(yClose,yOpen):y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(drawType==3?Math.max(yClose,yOpen):y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}this.Canvas.stroke();}}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=barColor;this.Canvas.stroke();}};this.DrawKBarV2=function(data,colorData,dataWidth,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen){var isDrawBorder=false;var isEmptyBar=false;if(colorData.border)isDrawBorder=true;if(colorData.Type===0)isEmptyBar=true;if(dataWidth>=4){if(isDrawBorder){if(dataWidth%2!=0)dataWidth-=1;}if(data.High>data.Close)//上影线
2961
- {if(colorData.Line){this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(isEmptyBar?Math.max(yClose,yOpen):yClose),ToFixedPoint(x));}else{if(isDrawBorder){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));}}this.Canvas.stroke();}y=yClose;}else{y=yClose;}if(isHScreen){/*
2962
- if (Math.abs(yOpen-y)<1)
2963
- {
2964
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
2965
- }
2966
- else
2967
- {
2968
- if (drawType==3) //空心柱
2969
- {
2970
- this.Canvas.beginPath();
2971
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
2972
- this.Canvas.stroke();
2973
- }
2974
- else
2975
- {
2976
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
2977
- }
2978
- }
2979
- */}else{//实心
2963
+ {if(colorData.Line){this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));}else{if(isDrawBorder){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(Math.min(yClose,yOpen)));}}this.Canvas.stroke();}y=yClose;}else{y=yClose;}if(isHScreen){//实心
2964
+ if(!isEmptyBar&&colorData.BarColor){this.Canvas.fillStyle=colorData.BarColor;if(Math.abs(yOpen-y)<1){this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
2965
+ }else{this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));}}if(colorData.Border)//空心
2966
+ {if(Math.abs(yOpen-y)<1){this.Canvas.fillStyle=colorData.Border.Color;this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
2967
+ }else{this.Canvas.strokeStyle=colorData.Border.Color;this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));this.Canvas.stroke();}}}else{//实心
2980
2968
  if(!isEmptyBar&&colorData.BarColor){this.Canvas.fillStyle=colorData.BarColor;if(Math.abs(yOpen-y)<1){this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1);//高度小于1,统一使用高度1
2981
2969
  }else{this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));}}if(colorData.Border)//空心
2982
2970
  {if(Math.abs(yOpen-y)<1){this.Canvas.fillStyle=colorData.Border.Color;this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1);//高度小于1,统一使用高度1
2983
2971
  }else{this.Canvas.strokeStyle=colorData.Border.Color;this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));this.Canvas.stroke();}}}if(data.Open>data.Low)//下影线
2984
- {if(colorData.Line){this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(isEmptyBar?Math.min(yClose,yOpen):y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{if(isDrawBorder){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}}else{var lineColor;if(isEmptyBar&&colorData.Border){lineColor=colorData.Border.Color;}else if(!isEmptyBar&&colorData.BarColor){lineColor=colorData.BarColor;}if(lineColor){this.Canvas.strokeStyle=lineColor;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.stroke();}}};this.DrawTrade=function()//交易系统
2972
+ {if(colorData.Line){this.Canvas.strokeStyle=colorData.Line.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{if(isDrawBorder){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}}else{var lineColor;if(isEmptyBar&&colorData.Border){lineColor=colorData.Border.Color;}else if(!isEmptyBar&&colorData.BarColor){lineColor=colorData.BarColor;}if(lineColor){this.Canvas.strokeStyle=lineColor;this.Canvas.beginPath();if(isHScreen){if(data.High==data.Low){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow-1,ToFixedPoint(x));}else{this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}}else{if(data.High==data.Low){this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow+1);}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}}this.Canvas.stroke();}}};this.DrawTrade=function()//交易系统
2985
2973
  {if(!this.TradeData)return;var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+2.0;var chartright=this.ChartBorder.GetRight();var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+2.0;chartright=this.ChartBorder.GetBottom();}var sellData=this.TradeData.Sell;var buyData=this.TradeData.Buy;var arrowWidth=dataWidth;if(arrowWidth>10)arrowWidth=10;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var data=this.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var buy=false,sell=false;if(sellData&&i<sellData.length)sell=sellData[i]>0;if(buyData&&i<buyData.length)buy=buyData[i]>0;if(!sell&&!buy)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var yClose=this.GetYFromData(data.Close,false);var y=yHigh;if(buy){this.Canvas.fillStyle=this.UpColor;this.Canvas.strokeStyle=this.UnchagneColor;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yLow-1,x);this.Canvas.lineTo(yLow-arrowWidth-1,x-arrowWidth/2);this.Canvas.lineTo(yLow-arrowWidth-1,x+arrowWidth/2);}else{this.Canvas.moveTo(x,yLow+1);this.Canvas.lineTo(x-arrowWidth/2,yLow+arrowWidth+1);this.Canvas.lineTo(x+arrowWidth/2,yLow+arrowWidth+1);}this.Canvas.closePath();this.Canvas.fill();this.Canvas.stroke();}if(sell){this.Canvas.fillStyle=this.DownColor;this.Canvas.strokeStyle=this.UnchagneColor;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh+1,x);this.Canvas.lineTo(yHigh+arrowWidth+1,x-arrowWidth/2);this.Canvas.lineTo(yHigh+arrowWidth+1,x+arrowWidth/2);}else{this.Canvas.moveTo(x,yHigh-1);this.Canvas.lineTo(x-arrowWidth/2,yHigh-arrowWidth-1);this.Canvas.lineTo(x+arrowWidth/2,yHigh-arrowWidth-1);}this.Canvas.closePath();this.Canvas.fill();this.Canvas.stroke();}}};this.DrawTick=function()//分笔图
2986
2974
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+2.0;if(isHScreen)xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+2.0;var chartright=this.ChartBorder.GetRight();if(isHScreen)chartright=this.ChartBorder.GetBottom();var xPointCount=this.ChartFrame.XPointCount;var fontSize=parseInt(dataWidth);if(fontSize<=1)fontSize=2;else if(fontSize>=18)fontSize=18;var bFirstPoint=true;var pixelRatio=GetDevicePixelRatio();var textSize=fontSize*pixelRatio;this.Canvas.beginPath();this.Canvas.font=fontSize*pixelRatio+'px '+this.TickFontName;this.ShowRange.Start=this.Data.DataOffset;this.ShowRange.End=this.ShowRange.Start;this.ShowRange.DataCount=0;this.ShowRange.ShowCount=xPointCount;this.DrawKRange.Start=this.Data.DataOffset;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var data=this.Data.Data[i];this.ShowRange.End=i;if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yClose=this.ChartFrame.GetYFromData(data.Close,false);this.DrawKRange.End=i;if(data.Flag===0)this.Canvas.fillStyle=this.UpColor;else if(data.Flag==1)this.Canvas.fillStyle=this.DownColor;else this.Canvas.fillStyle=this.UnchagneColor;this.Canvas.textAlign='center';this.Canvas.textBaseline='middle';if(isHScreen)this.Canvas.fillText(this.TickSymbol,yClose,x);else this.Canvas.fillText(this.TickSymbol,x,yClose);if(this.IsShowKTooltip&&!isHScreen)//添加tooltip区域
2987
2975
  {var rect=new Rect(x-textSize/2,yClose-textSize/2,textSize,textSize);//this.Canvas.fillStyle="rgb(0,0,100)";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "hqchart",
3
3
  "description": "stock chart",
4
4
  "author": "jones2000",
5
- "version": "1.1.11291",
5
+ "version": "1.1.11299",
6
6
  "main": "lib/main.js",
7
7
  "private": false,
8
8
  "license": "Apache License 2.0",
@@ -11238,6 +11238,7 @@ function CoordinateInfo()
11238
11238
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
11239
11239
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
11240
11240
  this.LineType=1; //线段类型 -1 不画线段 2 虚线 8,9=集合竞价坐标
11241
+ this.LineWidth; //线段宽度
11241
11242
  this.ExtendData; //扩展属性
11242
11243
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
11243
11244
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -12039,17 +12040,23 @@ function AverageWidthFrame()
12039
12040
  var yFixed=ToFixedPoint(y);
12040
12041
  if (y!=bottom && this.IsShowYLine)
12041
12042
  {
12043
+ var bChangeLineWidth=false;
12044
+ if (IFrameSplitOperator.IsPlusNumber(item.LineWidth)) //刻度线宽度
12045
+ {
12046
+ this.Canvas.lineWidth=item.LineWidth*pixelRatio;
12047
+ bChangeLineWidth=true;
12048
+ }
12049
+
12042
12050
  this.Canvas.strokeStyle=item.LineColor;
12043
12051
  if (item.LineType==2)
12044
12052
  {
12045
- this.Canvas.save();
12046
12053
  if (item.LineDash) this.Canvas.setLineDash(item.LineDash);
12047
12054
  else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]); //虚线
12048
12055
  this.Canvas.beginPath();
12049
12056
  this.Canvas.moveTo(left,yFixed);
12050
12057
  this.Canvas.lineTo(right,yFixed);
12051
12058
  this.Canvas.stroke();
12052
- this.Canvas.restore();
12059
+ this.Canvas.setLineDash([]);
12053
12060
  }
12054
12061
  else if (item.LineType==3) //只在刻度边上画一个短横线
12055
12062
  {
@@ -12078,6 +12085,11 @@ function AverageWidthFrame()
12078
12085
  this.Canvas.stroke();
12079
12086
  }
12080
12087
  }
12088
+
12089
+ if (bChangeLineWidth)
12090
+ {
12091
+ this.Canvas.lineWidth=pixelRatio;
12092
+ }
12081
12093
  }
12082
12094
 
12083
12095
  var yText=y;
@@ -22347,13 +22359,29 @@ function ChartKLine()
22347
22359
  this.Canvas.beginPath(); //最高-最低
22348
22360
  if (isHScreen)
22349
22361
  {
22350
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
22351
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
22362
+ if (data.High==data.Low && dataWidth<4)
22363
+ {
22364
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
22365
+ this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
22366
+ }
22367
+ else
22368
+ {
22369
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
22370
+ this.Canvas.lineTo(yLow,ToFixedPoint(x));
22371
+ }
22352
22372
  }
22353
22373
  else
22354
22374
  {
22355
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
22356
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
22375
+ if (data.High==data.Low && dataWidth<4)
22376
+ {
22377
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
22378
+ this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
22379
+ }
22380
+ else
22381
+ {
22382
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
22383
+ this.Canvas.lineTo(ToFixedPoint(x),yLow);
22384
+ }
22357
22385
  }
22358
22386
 
22359
22387
  this.Canvas.stroke();
@@ -23032,13 +23060,29 @@ function ChartKLine()
23032
23060
  this.Canvas.beginPath();
23033
23061
  if (isHScreen)
23034
23062
  {
23035
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23036
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
23063
+ if (data.High==data.Low)
23064
+ {
23065
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23066
+ this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
23067
+ }
23068
+ else
23069
+ {
23070
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23071
+ this.Canvas.lineTo(yLow,ToFixedPoint(x));
23072
+ }
23037
23073
  }
23038
23074
  else
23039
23075
  {
23040
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23041
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
23076
+ if (data.High==data.Low)
23077
+ {
23078
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23079
+ this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
23080
+ }
23081
+ else
23082
+ {
23083
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23084
+ this.Canvas.lineTo(ToFixedPoint(x),yLow);
23085
+ }
23042
23086
  }
23043
23087
  this.Canvas.strokeStyle=unchagneColor;
23044
23088
  this.Canvas.stroke();
@@ -23194,7 +23238,7 @@ function ChartKLine()
23194
23238
  if (isHScreen)
23195
23239
  {
23196
23240
  this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
23197
- this.Canvas.lineTo(ToFixedPoint(isEmptyBar?Math.max(yClose,yOpen):yClose),ToFixedPoint(x));
23241
+ this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
23198
23242
  }
23199
23243
  else
23200
23244
  {
@@ -23222,25 +23266,35 @@ function ChartKLine()
23222
23266
 
23223
23267
  if (isHScreen)
23224
23268
  {
23225
- /*
23226
- if (Math.abs(yOpen-y)<1)
23269
+ //实心
23270
+ if (!isEmptyBar && colorData.BarColor)
23227
23271
  {
23228
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
23272
+ this.Canvas.fillStyle=colorData.BarColor;
23273
+ if (Math.abs(yOpen-y)<1)
23274
+ {
23275
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
23276
+ }
23277
+ else
23278
+ {
23279
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23280
+ }
23229
23281
  }
23230
- else
23282
+
23283
+ if (colorData.Border) //空心
23231
23284
  {
23232
- if (drawType==3) //空心柱
23285
+ if (Math.abs(yOpen-y)<1)
23233
23286
  {
23234
- this.Canvas.beginPath();
23235
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23236
- this.Canvas.stroke();
23287
+ this.Canvas.fillStyle=colorData.Border.Color;
23288
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
23237
23289
  }
23238
23290
  else
23239
23291
  {
23240
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23292
+ this.Canvas.strokeStyle=colorData.Border.Color;
23293
+ this.Canvas.beginPath();
23294
+ this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23295
+ this.Canvas.stroke();
23241
23296
  }
23242
23297
  }
23243
- */
23244
23298
  }
23245
23299
  else
23246
23300
  {
@@ -23284,7 +23338,7 @@ function ChartKLine()
23284
23338
  this.Canvas.beginPath();
23285
23339
  if (isHScreen)
23286
23340
  {
23287
- this.Canvas.moveTo(ToFixedPoint(isEmptyBar?Math.min(yClose,yOpen):y),ToFixedPoint(x));
23341
+ this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
23288
23342
  this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
23289
23343
  }
23290
23344
  else
@@ -23323,13 +23377,30 @@ function ChartKLine()
23323
23377
  this.Canvas.beginPath();
23324
23378
  if (isHScreen)
23325
23379
  {
23326
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23327
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
23380
+ if (data.High==data.Low)
23381
+ {
23382
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23383
+ this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
23384
+ }
23385
+ else
23386
+ {
23387
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23388
+ this.Canvas.lineTo(yLow,ToFixedPoint(x));
23389
+ }
23328
23390
  }
23329
23391
  else
23330
23392
  {
23331
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23332
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
23393
+ if (data.High==data.Low)
23394
+ {
23395
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23396
+ this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
23397
+ }
23398
+ else
23399
+ {
23400
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23401
+ this.Canvas.lineTo(ToFixedPoint(x),yLow);
23402
+ }
23403
+
23333
23404
  }
23334
23405
  this.Canvas.stroke();
23335
23406
  }
@@ -11282,6 +11282,7 @@ function CoordinateInfo()
11282
11282
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
11283
11283
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
11284
11284
  this.LineType=1; //线段类型 -1 不画线段 2 虚线 8,9=集合竞价坐标
11285
+ this.LineWidth; //线段宽度
11285
11286
  this.ExtendData; //扩展属性
11286
11287
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
11287
11288
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -12083,17 +12084,23 @@ function AverageWidthFrame()
12083
12084
  var yFixed=ToFixedPoint(y);
12084
12085
  if (y!=bottom && this.IsShowYLine)
12085
12086
  {
12087
+ var bChangeLineWidth=false;
12088
+ if (IFrameSplitOperator.IsPlusNumber(item.LineWidth)) //刻度线宽度
12089
+ {
12090
+ this.Canvas.lineWidth=item.LineWidth*pixelRatio;
12091
+ bChangeLineWidth=true;
12092
+ }
12093
+
12086
12094
  this.Canvas.strokeStyle=item.LineColor;
12087
12095
  if (item.LineType==2)
12088
12096
  {
12089
- this.Canvas.save();
12090
12097
  if (item.LineDash) this.Canvas.setLineDash(item.LineDash);
12091
12098
  else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]); //虚线
12092
12099
  this.Canvas.beginPath();
12093
12100
  this.Canvas.moveTo(left,yFixed);
12094
12101
  this.Canvas.lineTo(right,yFixed);
12095
12102
  this.Canvas.stroke();
12096
- this.Canvas.restore();
12103
+ this.Canvas.setLineDash([]);
12097
12104
  }
12098
12105
  else if (item.LineType==3) //只在刻度边上画一个短横线
12099
12106
  {
@@ -12122,6 +12129,11 @@ function AverageWidthFrame()
12122
12129
  this.Canvas.stroke();
12123
12130
  }
12124
12131
  }
12132
+
12133
+ if (bChangeLineWidth)
12134
+ {
12135
+ this.Canvas.lineWidth=pixelRatio;
12136
+ }
12125
12137
  }
12126
12138
 
12127
12139
  var yText=y;
@@ -22391,13 +22403,29 @@ function ChartKLine()
22391
22403
  this.Canvas.beginPath(); //最高-最低
22392
22404
  if (isHScreen)
22393
22405
  {
22394
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
22395
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
22406
+ if (data.High==data.Low && dataWidth<4)
22407
+ {
22408
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
22409
+ this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
22410
+ }
22411
+ else
22412
+ {
22413
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
22414
+ this.Canvas.lineTo(yLow,ToFixedPoint(x));
22415
+ }
22396
22416
  }
22397
22417
  else
22398
22418
  {
22399
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
22400
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
22419
+ if (data.High==data.Low && dataWidth<4)
22420
+ {
22421
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
22422
+ this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
22423
+ }
22424
+ else
22425
+ {
22426
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
22427
+ this.Canvas.lineTo(ToFixedPoint(x),yLow);
22428
+ }
22401
22429
  }
22402
22430
 
22403
22431
  this.Canvas.stroke();
@@ -23076,13 +23104,29 @@ function ChartKLine()
23076
23104
  this.Canvas.beginPath();
23077
23105
  if (isHScreen)
23078
23106
  {
23079
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23080
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
23107
+ if (data.High==data.Low)
23108
+ {
23109
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23110
+ this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
23111
+ }
23112
+ else
23113
+ {
23114
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23115
+ this.Canvas.lineTo(yLow,ToFixedPoint(x));
23116
+ }
23081
23117
  }
23082
23118
  else
23083
23119
  {
23084
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23085
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
23120
+ if (data.High==data.Low)
23121
+ {
23122
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23123
+ this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
23124
+ }
23125
+ else
23126
+ {
23127
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23128
+ this.Canvas.lineTo(ToFixedPoint(x),yLow);
23129
+ }
23086
23130
  }
23087
23131
  this.Canvas.strokeStyle=unchagneColor;
23088
23132
  this.Canvas.stroke();
@@ -23238,7 +23282,7 @@ function ChartKLine()
23238
23282
  if (isHScreen)
23239
23283
  {
23240
23284
  this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
23241
- this.Canvas.lineTo(ToFixedPoint(isEmptyBar?Math.max(yClose,yOpen):yClose),ToFixedPoint(x));
23285
+ this.Canvas.lineTo(ToFixedPoint(Math.max(yClose,yOpen)),ToFixedPoint(x));
23242
23286
  }
23243
23287
  else
23244
23288
  {
@@ -23266,25 +23310,35 @@ function ChartKLine()
23266
23310
 
23267
23311
  if (isHScreen)
23268
23312
  {
23269
- /*
23270
- if (Math.abs(yOpen-y)<1)
23313
+ //实心
23314
+ if (!isEmptyBar && colorData.BarColor)
23271
23315
  {
23272
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
23316
+ this.Canvas.fillStyle=colorData.BarColor;
23317
+ if (Math.abs(yOpen-y)<1)
23318
+ {
23319
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
23320
+ }
23321
+ else
23322
+ {
23323
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23324
+ }
23273
23325
  }
23274
- else
23326
+
23327
+ if (colorData.Border) //空心
23275
23328
  {
23276
- if (drawType==3) //空心柱
23329
+ if (Math.abs(yOpen-y)<1)
23277
23330
  {
23278
- this.Canvas.beginPath();
23279
- this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23280
- this.Canvas.stroke();
23331
+ this.Canvas.fillStyle=colorData.Border.Color;
23332
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
23281
23333
  }
23282
23334
  else
23283
23335
  {
23284
- this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23336
+ this.Canvas.strokeStyle=colorData.Border.Color;
23337
+ this.Canvas.beginPath();
23338
+ this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));
23339
+ this.Canvas.stroke();
23285
23340
  }
23286
23341
  }
23287
- */
23288
23342
  }
23289
23343
  else
23290
23344
  {
@@ -23328,7 +23382,7 @@ function ChartKLine()
23328
23382
  this.Canvas.beginPath();
23329
23383
  if (isHScreen)
23330
23384
  {
23331
- this.Canvas.moveTo(ToFixedPoint(isEmptyBar?Math.min(yClose,yOpen):y),ToFixedPoint(x));
23385
+ this.Canvas.moveTo(ToFixedPoint(Math.min(yClose,yOpen)),ToFixedPoint(x));
23332
23386
  this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
23333
23387
  }
23334
23388
  else
@@ -23367,13 +23421,30 @@ function ChartKLine()
23367
23421
  this.Canvas.beginPath();
23368
23422
  if (isHScreen)
23369
23423
  {
23370
- this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23371
- this.Canvas.lineTo(yLow,ToFixedPoint(x));
23424
+ if (data.High==data.Low)
23425
+ {
23426
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23427
+ this.Canvas.lineTo(yLow-1,ToFixedPoint(x));
23428
+ }
23429
+ else
23430
+ {
23431
+ this.Canvas.moveTo(yHigh,ToFixedPoint(x));
23432
+ this.Canvas.lineTo(yLow,ToFixedPoint(x));
23433
+ }
23372
23434
  }
23373
23435
  else
23374
23436
  {
23375
- this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23376
- this.Canvas.lineTo(ToFixedPoint(x),yLow);
23437
+ if (data.High==data.Low)
23438
+ {
23439
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23440
+ this.Canvas.lineTo(ToFixedPoint(x),yLow+1);
23441
+ }
23442
+ else
23443
+ {
23444
+ this.Canvas.moveTo(ToFixedPoint(x),yHigh);
23445
+ this.Canvas.lineTo(ToFixedPoint(x),yLow);
23446
+ }
23447
+
23377
23448
  }
23378
23449
  this.Canvas.stroke();
23379
23450
  }