hqchart 1.1.11295 → 1.1.11297

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行
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.11295",
5
+ "version": "1.1.11297",
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;
@@ -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;