hqchart 1.1.13991 → 1.1.13998

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.
@@ -2397,20 +2397,22 @@ this.GetYData=function(y,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromD
2397
2397
  {if(isLimit==false){return(y-this.ChartBorder.GetTopEx())/this.ChartBorder.GetHeightEx()*(this.HorizontalMax-this.HorizontalMin)+this.HorizontalMin;}else{if(y<this.ChartBorder.GetTopEx())return this.HorizontalMin;if(y>this.ChartBorder.GetBottomEx())return this.HorizontalMax;return(y-this.ChartBorder.GetTopEx())/this.ChartBorder.GetHeightEx()*(this.HorizontalMax-this.HorizontalMin)+this.HorizontalMin;}}else{if(isLimit==false){return(this.ChartBorder.GetBottomEx()-y)/this.ChartBorder.GetHeightEx()*(this.HorizontalMax-this.HorizontalMin)+this.HorizontalMin;}else{if(y<this.ChartBorder.GetTopEx())return this.HorizontalMax;if(y>this.ChartBorder.GetBottomEx())return this.HorizontalMin;return(this.ChartBorder.GetBottomEx()-y)/this.ChartBorder.GetHeightEx()*(this.HorizontalMax-this.HorizontalMin)+this.HorizontalMin;}}};//X坐标转x轴数值
2398
2398
  this.GetXData=function(x){if(x<=this.ChartBorder.GetLeft())return 0;if(x>=this.ChartBorder.GetRight())return this.XPointCount;return(x-this.ChartBorder.GetLeft())*(this.XPointCount*1.0/this.ChartBorder.GetWidth());};//选中的画图工具X,Y轴坐标信息
2399
2399
  this.DrawPictureXCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var left=border.Left;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";if(range.X){var xRange=range.X;var xLeft=xRange.Min.X;var xRight=xRange.Max.X;if(xLeft<left)xLeft=left;if(xRight>right)xRight=right;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(xLeft,border.Bottom,xRight-xLeft,fontHeight);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.X<left||item.X>right)continue;var index=this.GetXData(item.X,false);var index=Math.round(index);var kItem=this.GetKItem(index);if(kItem){var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);if(ChartData.IsMinutePeriod(option.Period))text+=" "+IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");else if(ChartData.IsMilliSecondPeriod(option.Period))text+=" "+IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM:SS.fff");var textWidth=this.Canvas.measureText(text).width+2;var textLeft=item.X-textWidth/2;if(textLeft<left)textLeft=left;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(textLeft,border.Bottom,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yCenter=border.Bottom+fontHeight;this.Canvas.fillText(text,textLeft+1,yCenter);}}};this.GetKItem=function(currentIndex){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var index=this.Data.DataOffset+currentIndex;return this.Data.Data[index];};this.DrawPictureYCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var top=border.TopEx;var bottom=border.BottomEx;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var defaultfloatPrecision=2;if(option&&option.Symbol)defaultfloatPrecision=GetfloatPrecision(option.Symbol);var textWidth=0;for(var i=0;i<range.Points.length;++i){var item=range.Points[i];var Value=this.GetYData(item.Y);var text=Value.toFixed(defaultfloatPrecision);var value=this.Canvas.measureText(text).width;if(textWidth<value)textWidth=value;range.Points[i].Text=text;}textWidth+=this.YTextPadding[1]+2;if(range.Y){var yRange=range.Y;var yTop=yRange.Min.Y;var yBottom=yRange.Max.Y;if(yRange.Min.Y<top)yTop=top;if(yRange.Max.Y>bottom)yBottom=bottom;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(right,yTop,textWidth+5,yBottom-yTop);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.Y<top||item.Y>bottom)continue;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(right,item.Y-fontHeight/2,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yText=item.Y+fontHeight/2;this.Canvas.fillText(item.Text,right+this.YTextPadding[1],yText);}};this.DrawPicturePointYCoordinate=function(drawPicture,option){if(this.IsHScreen)return;if(!drawPicture.GetYCoordinatePoint)return;var aryPoint=drawPicture.GetYCoordinatePoint();if(!IFrameSplitOperator.IsNonEmptyArray(aryPoint))return;var border=this.GetBorder();var top=border.TopEx;var bottom=border.BottomEx;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var defaultfloatPrecision=2;if(option&&option.Symbol)defaultfloatPrecision=GetfloatPrecision(option.Symbol);for(var i=0;i<aryPoint.length;++i){var item=aryPoint[i];if(!item)continue;if(item.Y<top||item.Y>bottom)continue;var text=item.YValue.toFixed(defaultfloatPrecision);var textWidth=this.Canvas.measureText(text).width+2;textWidth+=this.YTextPadding[1];this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(right,item.Y-fontHeight/2,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yText=item.Y+fontHeight/2;this.Canvas.fillText(text,right+this.YTextPadding[1],yText);}};//字体外部设置好
2400
- this.GetCustomItemTextInfo=function(item,bLeft,pixelTatio){var text=bLeft?item.Message[0]:item.Message[1];var aryText=[];var width=0;if(Array.isArray(text)){for(var i=0;i<text.length;++i){var item=text[i];if(item.Type===1){aryText.push({Type:item.Type});}else{var value=this.Canvas.measureText(text[i].Text).width;if(value>width)width=value;var outItem={Text:text[i].Text,Width:value+2*pixelTatio};if(item.TextColor)outItem.TextColor=item.TextColor;aryText.push(outItem);}}if(width>0)width+=2*pixelTatio;}else{width=this.Canvas.measureText(text).width+2*pixelTatio;aryText.push({Text:text,Width:width});}return{MaxWidth:width,Text:aryText};};this.DrawOutRangeCustomItem=function(item,mapTextRect){if(this.IsHScreen===true)return;if(!this.IsShow&&!this.IsYDrawMainFrame)return;if(!item.Message[1]&&!item.Message[0])return;if(!item.OutRange)return;var position=0;//1=top 2=bottom
2400
+ this.GetCustomItemTextInfo=function(item,bLeft,pixelTatio){var text=bLeft?item.Message[0]:item.Message[1];var aryText=[];var width=0;if(Array.isArray(text)){for(var i=0;i<text.length;++i){var item=text[i];if(item.Type===1){aryText.push({Type:item.Type});}else{var value=this.Canvas.measureText(text[i].Text).width;if(value>width)width=value;var outItem={Text:text[i].Text,Width:value+2*pixelTatio};if(item.TextColor)outItem.TextColor=item.TextColor;if(item.BGColor)outItem.BGColor=item.BGColor;if(IFrameSplitOperator.IsBool(item.EnableBGColor))outItem.EnableBGColor=item.EnableBGColor;//是否启用背景色
2401
+ aryText.push(outItem);}}if(width>0)width+=2*pixelTatio;}else{width=this.Canvas.measureText(text).width+2*pixelTatio;aryText.push({Text:text,Width:width});}return{MaxWidth:width,Text:aryText};};this.DrawOutRangeCustomItem=function(item,mapTextRect){if(this.IsHScreen===true)return;if(!this.IsShow&&!this.IsYDrawMainFrame)return;if(!item.Message[1]&&!item.Message[0])return;if(!item.OutRange)return;var position=0;//1=top 2=bottom
2401
2402
  if(item.Value>this.HorizontalMax)position=1;else if(item.Value<this.HorizontalMin)position=2;else return;this.Canvas.save();var outRange=item.OutRange;var border=this.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=border.Top;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var titleHeight=this.ChartBorder.TitleHeight;if(this.IsHScreen){borderLeft=this.ChartBorder.Top;borderRight=this.ChartBorder.Bottom;top=border.Top;bottom=border.Bottom;}var pixelTatio=GetDevicePixelRatio();var defaultTextHeight=18*pixelTatio;var textHeight=defaultTextHeight;if(item.Message[0]&&borderLeft>=10){if(item.Font!=null)this.Canvas.font=item.Font;var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var itemLeft=left-textWidth;var fontHeight=this.GetFontHeight();var textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var yText=null;if(position==1){yText=border.TopEx;if(IFrameSplitOperator.IsNumber(outRange.TopYOffset))yText+=outRange.TopYOffset;}else if(position==2){yText=border.BottomEx+textHeight;if(IFrameSplitOperator.IsNumber(outRange.BottomYOffset))yText+=outRange.BottomYOffset;}for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];var rtBG={Left:itemLeft,Width:itemText.Width,Bottom:yText,Height:textHeight};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(item.ExtendLine&&item.ExtendLine[0])//右侧延长线
2402
2403
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var yLine=rtBG.Bottom;if(position==2)yLine=rtBG.Top;var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(outRange.ExtendLine.Type))lineType=outRange.ExtendLine.Type;if(i==0)this.DrawLine(left,left-exLine.Width,yLine,item.LineColor,lineType,item);rtBG.Left-=exLine.Width;rtBG.Right-=exLine.Width;}}this.Canvas.fillStyle=outRange.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);if(outRange.Border&&outRange.Border.Color){if(IFrameSplitOperator.IsNonEmptyArray(outRange.Border.LineDash))this.Canvas.setLineDash(outRange.Border.LineDash);//虚线
2403
2404
  this.Canvas.strokeStyle=outRange.Border.Color;this.Canvas.strokeRect(ToFixedPoint(rtBG.Left),ToFixedPoint(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=outRange.TextColor;this.Canvas.fillText(itemText.Text,rtBG.Right-1*pixelTatio,rtBG.Top+rtBG.Height/2+1*pixelTatio);yText+=textHeight+1;}}else if(item.Message[1]&&borderRight>=10){if(item.Font!=null)this.Canvas.font=item.Font;var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var itemRight=right+textWidth;var fontHeight=this.GetFontHeight();var textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var yText=null;if(position==1){yText=border.TopEx;if(IFrameSplitOperator.IsNumber(outRange.TopYOffset))yText+=outRange.TopYOffset;}else if(position==2){yText=border.BottomEx+textHeight;if(IFrameSplitOperator.IsNumber(outRange.BottomYOffset))yText+=outRange.BottomYOffset;}for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];var rtBG={Right:itemRight,Width:itemText.Width,Bottom:yText,Height:textHeight};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Left=rtBG.Right-rtBG.Width;if(item.ExtendLine&&item.ExtendLine[1])//右侧延长线
2404
2405
  {var exLine=item.ExtendLine[1];if(IFrameSplitOperator.IsNumber(exLine.Width)){var yLine=rtBG.Bottom;if(position==2)yLine=rtBG.Top;var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(outRange.ExtendLine.Type))lineType=outRange.ExtendLine.Type;if(i==0)this.DrawLine(right,right+exLine.Width,yLine,item.LineColor,lineType,item);rtBG.Left+=exLine.Width;rtBG.Right+=exLine.Width;}}this.Canvas.fillStyle=outRange.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);if(outRange.Border&&outRange.Border.Color){if(IFrameSplitOperator.IsNonEmptyArray(outRange.Border.LineDash))this.Canvas.setLineDash(outRange.Border.LineDash);//虚线
2405
2406
  this.Canvas.strokeStyle=outRange.Border.Color;this.Canvas.strokeRect(ToFixedPoint(rtBG.Left),ToFixedPoint(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=outRange.TextColor;this.Canvas.fillText(itemText.Text,rtBG.Left+1*pixelTatio,rtBG.Top+rtBG.Height/2+1*pixelTatio);yText+=textHeight+1;}}this.Canvas.restore();};this.DrawCustomItem=function(item,mapTextRect)//显示自定义Y刻度
2406
- {if(!item.Message[1]&&!item.Message[0])return;if(item.Value>this.HorizontalMax||item.Value<this.HorizontalMin){this.DrawOutRangeCustomItem(item,mapTextRect);this.SendDrawCountDownEvent({IsShow:false});return;}var border=this.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=border.Top;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var titleHeight=this.ChartBorder.TitleHeight;if(this.IsHScreen){borderLeft=this.ChartBorder.Top;borderRight=this.ChartBorder.Bottom;top=border.Top;bottom=border.Bottom;}var pixelTatio=GetDevicePixelRatio();var defaultTextHeight=18*pixelTatio;var textHeight=defaultTextHeight;var y;if(item.Value=="TopEx")y=border.TopEx;else if(item.Value=="TopTitle")y=border.TopTitle;else if(item.Value=="Top")y=border.Top;else if(item.Value=="BottomEx")y=border.BottomEx;else if(item.Value=="Bottom")y=border.Bottom;else y=this.GetYFromData(item.Value);if(IFrameSplitOperator.IsNumber(item.YOffset))y+=item.YOffset;var position=0;var emptyBGColor;if(item.ExtendData&&item.ExtendData.Custom){var customItem=item.ExtendData.Custom;if(IFrameSplitOperator.IsNumber(customItem.Position))position=customItem.Position;if(customItem.EmptyBGColor)emptyBGColor=customItem.EmptyBGColor;}if(item.Message[0])// 左 position=2 集合竞价右侧
2407
+ {if(!item.Message[1]&&!item.Message[0])return;if(item.Value>this.HorizontalMax||item.Value<this.HorizontalMin){this.DrawOutRangeCustomItem(item,mapTextRect);this.SendDrawCountDownEvent({IsShow:false});return;}var border=this.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=border.Top;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var titleHeight=this.ChartBorder.TitleHeight;if(this.IsHScreen){borderLeft=this.ChartBorder.Top;borderRight=this.ChartBorder.Bottom;top=border.Top;bottom=border.Bottom;}var pixelTatio=GetDevicePixelRatio();var defaultTextHeight=5*pixelTatio;var textHeight=defaultTextHeight;var y;if(item.Value=="TopEx")y=border.TopEx;else if(item.Value=="TopTitle")y=border.TopTitle;else if(item.Value=="Top")y=border.Top;else if(item.Value=="BottomEx")y=border.BottomEx;else if(item.Value=="Bottom")y=border.Bottom;else y=this.GetYFromData(item.Value);if(IFrameSplitOperator.IsNumber(item.YOffset))y+=item.YOffset;var position=0;var emptyBGColor;if(item.ExtendData&&item.ExtendData.Custom){var customItem=item.ExtendData.Custom;if(IFrameSplitOperator.IsNumber(customItem.Position))position=customItem.Position;if(customItem.EmptyBGColor)emptyBGColor=customItem.EmptyBGColor;}if(item.Message[0])// 左 position=2 集合竞价右侧
2407
2408
  {if(borderLeft<10||position==1||position==2){if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2408
2409
  if(item.BGColor)bgColor=item.BGColor;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=top;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){}else{if(position==2)left=border.LeftEx-textInfo.MaxWidth;var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=left+1*pixelTatio;if(item.ExtendLine&&item.ExtendLine[0]&&position==2)//左侧延长线
2409
2410
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2410
2411
  if(i==0){var yLine=border.LeftEx-exLine.Width;this.DrawLine(yLine,yLine+exLine.Width,y,item.LineColor,lineType,item);}textLeft-=exLine.Width;//rectLeft-=exLine.Width
2411
2412
  }}this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0){if(position==2)this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);}if(item.ClickData)this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);yText+=textHeight+1*pixelTatio;}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){if(i==0)var bgTop=top-itemText.Width;else var bgTop=top-textWidth;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var rectLeft=left-itemText.Width;var textLeft=left;}else{var rectLeft=left-textWidth;var textLeft=left-(textWidth-itemText.Width);}if(item.ExtendLine&&item.ExtendLine[0])//右侧延长线
2412
2413
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2413
- if(i==0)this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);textLeft-=exLine.Width;rectLeft-=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);if(item.ClickData)//点击事件
2414
+ var exLineColor=item.LineColor;if(exLine.LineColor)exLineColor=exLine.LineColor;//设置线段颜色
2415
+ if(i==0)this.DrawLine(left,left-exLine.Width,y,exLineColor,lineType,item);textLeft-=exLine.Width;rectLeft-=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{if(!(itemText.EnableBGColor===false)){var textBGColor=item.LineColor;if(itemText.BGColor)textBGColor=itemText.BGColor;this.Canvas.fillStyle=textBGColor;this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);}this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);if(item.ClickData)//点击事件
2414
2416
  this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
2415
2417
  {if(borderRight<10||position==1){if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2416
2418
  var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom-itemText.Width;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Right:right,Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:true};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=right-itemText.Width;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);//文本背景区域
@@ -2421,11 +2423,13 @@ if(i==0)this.DrawLine(right,textLeft+exLine.Width,y,item.LineColor,lineType,item
2421
2423
  this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);yText+=textHeight+1*pixelTatio;rtText.Bottom=yText;}}}if(mapTextRect&&IFrameSplitOperator.IsNumber(rtText.Left)&&IFrameSplitOperator.IsNumber(rtText.Bottom)){mapTextRect.set(3,{Rect:rtText,Item:item});}if(item.Type==3||item.Type==4){if(item.Title){var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2422
2424
  var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.AddHorizontalLabel=function(left,top,width,height,item,lineID){var rtLabel={Left:left,Top:top,Width:width,Height:height};rtLabel.Right=rtLabel.Left+rtLabel.Width;rtLabel.Bottom=rtLabel.Top+rtLabel.Height;var lableItem={Rect:rtLabel,Item:item,ID:item.ClickData.ID,Args:item.ClickData.Args,LineID:lineID};this.HorizontalLabel.push(lableItem);};this.DrawCustomAreaItem=function(item)//自定义Y轴区域
2423
2425
  {if(!item.AreaData)return;if(this.IsHScreen)return;//暂时不支持横屏
2424
- //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
2426
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右], Width:[左, 右] }
2425
2427
  if(!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value)||item.AreaData.Value.length!=2)return;var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);var min=Math.min(item.AreaData.Value[0],item.AreaData.Value[1]);if(min>=this.HorizontalMax)return;if(max<=this.HorizontalMin)return;if(max>this.HorizontalMax)max=this.HorizontalMax;if(min<this.HorizontalMin)min=this.HorizontalMin;var border=this.GetBorder();var left=border.Left;var right=border.Right;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var yTop=this.GetYFromData(max);var yBottom=this.GetYFromData(min);if(item.AreaData.Position.includes(0)&&borderLeft>10)//左
2426
- {var rtBG={Left:0,Right:left-1,Top:yTop,Bottom:yBottom};rtBG.Height=rtBG.Bottom-rtBG.Top;rtBG.Width=rtBG.Right-rtBG.Left;this.Canvas.fillStyle=item.AreaData.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawCustomAreaText(rtBG,item,0);}if(item.AreaData.Position.includes(1)&&borderRight>10)//右
2428
+ {var rtBG={Left:0,Right:left-1,Top:yTop,Bottom:yBottom};rtBG.Height=rtBG.Bottom-rtBG.Top;rtBG.Width=rtBG.Right-rtBG.Left;if(IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width))//指定宽度
2429
+ {var bgWidth=item.AreaData.Width[0];if(IFrameSplitOperator.IsNumber(bgWidth)){if(rtBG.Width>bgWidth){rtBG.Width=bgWidth;rtBG.Left=rtBG.Right-rtBG.Width;}}}this.Canvas.fillStyle=item.AreaData.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawCustomAreaText(rtBG,item,0);}if(item.AreaData.Position.includes(1)&&borderRight>10)//右
2427
2430
  {var rtBG={Left:right+1,Top:yTop,Bottom:yBottom};rtBG.Height=rtBG.Bottom-rtBG.Top;if(this.YRightTextInfo&&IFrameSplitOperator.IsNumber(this.YRightTextInfo.MainTextWidth))//右侧自动调整 可以获取宽度
2428
- {rtBG.Width=this.YRightTextInfo.MainTextWidth-1;rtBG.Right=rtBG.Left+rtBG.Width;}else{rtBG.Right=border.ChartWidth;rtBG.Width=rtBG.Right-rtBG.Left;}this.Canvas.fillStyle=item.AreaData.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawCustomAreaText(rtBG,item,1);}};this.DrawCustomAreaText=function(rtBG,item,position)//position 0=左 1=右
2431
+ {rtBG.Width=this.YRightTextInfo.MainTextWidth-1;rtBG.Right=rtBG.Left+rtBG.Width;}else{rtBG.Right=border.ChartWidth;rtBG.Width=rtBG.Right-rtBG.Left;}if(IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width))//指定宽度
2432
+ {var bgWidth=item.AreaData.Width[1];if(IFrameSplitOperator.IsNumber(bgWidth)){if(rtBG.Width>bgWidth){rtBG.Width=bgWidth;rtBG.Right=rtBG.Left+rtBG.Width;}}}this.Canvas.fillStyle=item.AreaData.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawCustomAreaText(rtBG,item,1);}};this.DrawCustomAreaText=function(rtBG,item,position)//position 0=左 1=右
2429
2433
  {if(item.Font!=null)this.Canvas.font=item.Font;var fontHeight=this.GetFontHeight();if(rtBG.Height<fontHeight)return;var pixelTatio=GetDevicePixelRatio();var text,xText;if(position==0){if(!item.Message[0])return;this.Canvas.textAlign="right";text=item.Message[0];xText=rtBG.Right-2*pixelTatio;}else if(position==1){if(!item.Message[1])return;this.Canvas.textAlign="left";text=item.Message[1];xText=rtBG.Left+2*pixelTatio;}var yText=rtBG.Top+rtBG.Height/2;this.Canvas.textBaseline="middle";this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(text,xText,yText);};this.SendDrawCountDownEvent=function(sendData){if(!this.GetEventCallback)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_COUNTDOWN);if(!event||!event.Callback)return false;event.Callback(event,sendData,this);return true;};this.DrawDotLine=function(left,right,y,color,option){var pixelTatio=GetDevicePixelRatio();this.Canvas.save();this.Canvas.strokeStyle=color;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth))this.Canvas.lineWidth=option.LineWidth*pixelTatio;if(option.LineDash)this.Canvas.setLineDash(option.LineDash);else this.Canvas.setLineDash([5*pixelTatio,5*pixelTatio]);//虚线
2430
2434
  this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.restore();};this.DrawLine=function(left,right,y,color,lineType,option){if(lineType==-1)return;if(lineType==0){var pixelRatio=GetDevicePixelRatio();this.Canvas.strokeStyle=color;var bChangeLineWidth=false;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth)){this.Canvas.lineWidth=option.LineWidth*pixelRatio;bChangeLineWidth=true;}this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();if(bChangeLineWidth){this.Canvas.lineWidth=pixelRatio;}}else if(lineType==2)//绘制短线
2431
2435
  {var lineWidth=10*GetDevicePixelRatio();this.Canvas.strokeStyle=color;this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),left+lineWidth);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(left+lineWidth,ToFixedPoint(y));}this.Canvas.stroke();}else{this.DrawDotLine(left,right,y,color,option);}};this.DrawHScreenText=function(center,data){this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=data.Color;this.Canvas.save();this.Canvas.translate(center.X,center.Y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(data.Text,data.XOffset,data.YOffset);this.Canvas.restore();};this.RGBToStruct=function(rgb){if(/^(rgb|RGB)/.test(rgb)){var aColor=rgb.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");var result={};if(aColor.length!=3)return null;result.R=Number(aColor[0]);result.G=Number(aColor[1]);result.B=Number(aColor[2]);return result;}return null;};this.GetMulitTextMaxWidth=function(aryData){var width=null;for(var i=0;i<aryData.length;++i){var item=aryData[i];var text=item.Text;if(!text)continue;var value=this.Canvas.measureText(text).width;if(width==null)width=value;else if(width<value)width=value;}return width;};this.GetScaleTextWidth=function(){var border=this.ChartBorder.GetBorder();var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
@@ -2457,8 +2461,10 @@ this.AfterCloseVerticalInfo=[];//收盘集合竞价X轴
2457
2461
  this.NightDayConfig=CloneData(g_JSChartResource.Minute.NightDay);this.MinuteFrame_ReloadResource=this.ReloadResource;this.ReloadResource=function(resource){this.MinuteFrame_ReloadResource(resource);//集合竞价配色修改
2458
2462
  this.BeforeBGColor=g_JSChartResource.Minute.Before.BGColor;this.AfterBGColor=g_JSChartResource.Minute.After.BGColor;this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;};this.DrawFrame=function(){if(!this.IsMinSize){this.SplitXYCoordinate();this.DrawBeforeDataBG();this.YInsideOffset=0;if(this.BeforeDrawXYCallback)this.BeforeDrawXYCallback(this);this.DrawNightDayBG();//绘制夜盘 日盘背景
2459
2463
  this.DrawCustomBG();//绘制自定义背景色
2460
- this.DrawTitleBG();this.DrawHorizontal();this.DrawVertical();}if(this.SizeChange==true||this.ReDrawToolbar==true){this.DrawToolbar();//大小变动才画工具条
2461
- this.ReDrawToolbar=false;}};//画边框
2464
+ this.DrawTitleBG();this.DrawCustomHorizontalArea();//Y轴背景区域 在刻度前面绘制
2465
+ this.DrawHorizontal();this.DrawVertical();}if(this.SizeChange==true||this.ReDrawToolbar==true){this.DrawToolbar();//大小变动才画工具条
2466
+ this.ReDrawToolbar=false;}};//Y轴面积背景
2467
+ this.DrawCustomHorizontalArea=function(){if(this.IsMinSize)return;if(this.ChartBorder.IsShowTitleOnly)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.CustomHorizontalInfo))return;for(var i=0;i<this.CustomHorizontalInfo.length;++i){var item=this.CustomHorizontalInfo[i];if(item.Type==5)this.DrawCustomAreaItem(item);}};//画边框
2462
2468
  this.SuperDrawBorder=this.DrawBorder;this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;this.SuperDrawBorder();if(this.Identify==1)//走势图和成交量中间用粗线分割开
2463
2469
  {var border=this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,top);this.Canvas.lineTo(right,top);this.Canvas.save();this.Canvas.lineWidth=2*GetDevicePixelRatio();this.Canvas.stroke();this.Canvas.restore();}};this.DrawVolTitle=function(symbol){if(!MARKET_SUFFIX_NAME.IsShowMinuteVolTitle(symbol))return;if(this.Identify==1)//显示"成交量"
2464
2470
  {var pixelRatio=GetDevicePixelRatio();var left=this.ChartBorder.GetLeft()+2*pixelRatio+this.YInsideOffset;var top=this.ChartBorder.GetTopEx()+2*pixelRatio;this.Canvas.textAlign='left';this.Canvas.textBaseline='top';if(g_JSChartResource.Minute.VolBarColor||g_JSChartResource.Minute.VolTitleColor){if(g_JSChartResource.Minute.VolBarColor)this.Canvas.fillStyle=g_JSChartResource.Minute.VolBarColor;else this.Canvas.fillStyle=g_JSChartResource.Minute.VolTitleColor;var languageID=this.YSplitOperator.LanguageID;var text=g_JSChartLocalization.GetText('MVol-Vol',languageID);this.Canvas.fillText(text,left,top);left+=this.Canvas.measureText(text).width;left+=6*GetDevicePixelRatio();}if(this.IsShowPositionTitle){text=g_JSChartLocalization.GetText('MVol-Position',languageID);this.Canvas.fillStyle=g_JSChartResource.Minute.PositionColor;this.Canvas.fillText(text,left,top);}}};this.DrawToolbar=function(){if(this.ToolbarButtonStyle==1)return;if(g_JSChartResource.IsDOMFrameToolbar===true)return;if(typeof _jquery2.default=="undefined")return;if(this.Identify<2)return;if(!this.ChartBorder.UIElement)return;var divToolbar=document.getElementById(this.ToolbarID);if(divToolbar&&this.SizeChange==false&&this.ReDrawToolbar==false)return;if(!divToolbar){divToolbar=document.createElement("div");divToolbar.className='klineframe-toolbar';divToolbar.id=this.ToolbarID;divToolbar.oncontextmenu=function(){return false;};//屏蔽右键系统菜单
@@ -13873,7 +13879,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13873
13879
  this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
13874
13880
  * 版本信息输出
13875
13881
  *
13876
- */var HQCHART_VERSION="1.1.13990";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13882
+ */var HQCHART_VERSION="1.1.13997";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13877
13883
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13878
13884
  // BaseIndex:BaseIndex,
13879
13885
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13991",
3
+ "version": "1.1.13998",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -12660,6 +12660,8 @@ function AverageWidthFrame()
12660
12660
  if (value>width) width=value;
12661
12661
  var outItem={ Text:text[i].Text, Width:value+2*pixelTatio };
12662
12662
  if (item.TextColor) outItem.TextColor=item.TextColor;
12663
+ if (item.BGColor) outItem.BGColor=item.BGColor;
12664
+ if (IFrameSplitOperator.IsBool(item.EnableBGColor)) outItem.EnableBGColor=item.EnableBGColor; //是否启用背景色
12663
12665
  aryText.push(outItem);
12664
12666
  }
12665
12667
  }
@@ -12868,7 +12870,7 @@ function AverageWidthFrame()
12868
12870
  }
12869
12871
 
12870
12872
  var pixelTatio = GetDevicePixelRatio();
12871
- var defaultTextHeight=18*pixelTatio;
12873
+ var defaultTextHeight=5*pixelTatio;
12872
12874
  var textHeight=defaultTextHeight;
12873
12875
  var y;
12874
12876
 
@@ -13018,9 +13020,11 @@ function AverageWidthFrame()
13018
13020
  {
13019
13021
  var lineType=item.LineType;
13020
13022
  if (IFrameSplitOperator.IsNumber(exLine.Type)) lineType=exLine.Type; //外部设置延长线样式
13021
- if (i==0) this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);
13023
+ var exLineColor=item.LineColor;
13024
+ if (exLine.LineColor) exLineColor=exLine.LineColor; //设置线段颜色
13025
+ if (i==0) this.DrawLine(left,left-exLine.Width,y,exLineColor,lineType,item);
13022
13026
  textLeft-=exLine.Width;
13023
- rectLeft-=exLine.Width
13027
+ rectLeft-=exLine.Width;
13024
13028
  }
13025
13029
  }
13026
13030
 
@@ -13035,8 +13039,14 @@ function AverageWidthFrame()
13035
13039
  }
13036
13040
  else
13037
13041
  {
13038
- this.Canvas.fillStyle=item.LineColor;
13039
- this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
13042
+ if (!(itemText.EnableBGColor===false))
13043
+ {
13044
+ var textBGColor=item.LineColor;
13045
+ if (itemText.BGColor) textBGColor=itemText.BGColor;
13046
+ this.Canvas.fillStyle=textBGColor;
13047
+ this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
13048
+ }
13049
+
13040
13050
  this.Canvas.fillStyle = item.TextColor;
13041
13051
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
13042
13052
  }
@@ -13297,7 +13307,7 @@ function AverageWidthFrame()
13297
13307
  if (!item.AreaData) return;
13298
13308
  if (this.IsHScreen) return; //暂时不支持横屏
13299
13309
 
13300
- //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
13310
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右], Width:[左, 右] }
13301
13311
  if (!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value) || item.AreaData.Value.length!=2) return;
13302
13312
 
13303
13313
  var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);
@@ -13322,6 +13332,18 @@ function AverageWidthFrame()
13322
13332
  var rtBG={ Left:0, Right:left-1, Top:yTop, Bottom:yBottom };
13323
13333
  rtBG.Height=rtBG.Bottom-rtBG.Top;
13324
13334
  rtBG.Width=rtBG.Right-rtBG.Left;
13335
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width)) //指定宽度
13336
+ {
13337
+ var bgWidth=item.AreaData.Width[0];
13338
+ if (IFrameSplitOperator.IsNumber(bgWidth))
13339
+ {
13340
+ if (rtBG.Width>bgWidth)
13341
+ {
13342
+ rtBG.Width=bgWidth;
13343
+ rtBG.Left=rtBG.Right-rtBG.Width;
13344
+ }
13345
+ }
13346
+ }
13325
13347
  this.Canvas.fillStyle=item.AreaData.BGColor;
13326
13348
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
13327
13349
  this.DrawCustomAreaText(rtBG, item, 0);
@@ -13342,6 +13364,19 @@ function AverageWidthFrame()
13342
13364
  rtBG.Width=rtBG.Right-rtBG.Left;
13343
13365
  }
13344
13366
 
13367
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width)) //指定宽度
13368
+ {
13369
+ var bgWidth=item.AreaData.Width[1];
13370
+ if (IFrameSplitOperator.IsNumber(bgWidth))
13371
+ {
13372
+ if (rtBG.Width>bgWidth)
13373
+ {
13374
+ rtBG.Width=bgWidth;
13375
+ rtBG.Right=rtBG.Left+rtBG.Width;
13376
+ }
13377
+ }
13378
+ }
13379
+
13345
13380
  this.Canvas.fillStyle=item.AreaData.BGColor;
13346
13381
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
13347
13382
  this.DrawCustomAreaText(rtBG, item, 1);
@@ -13742,8 +13777,10 @@ function MinuteFrame()
13742
13777
 
13743
13778
  this.DrawNightDayBG(); //绘制夜盘 日盘背景
13744
13779
  this.DrawCustomBG(); //绘制自定义背景色
13745
-
13780
+
13746
13781
  this.DrawTitleBG();
13782
+ this.DrawCustomHorizontalArea(); //Y轴背景区域 在刻度前面绘制
13783
+
13747
13784
  this.DrawHorizontal();
13748
13785
  this.DrawVertical();
13749
13786
  }
@@ -13755,6 +13792,20 @@ function MinuteFrame()
13755
13792
  }
13756
13793
  }
13757
13794
 
13795
+ //Y轴面积背景
13796
+ this.DrawCustomHorizontalArea=function()
13797
+ {
13798
+ if (this.IsMinSize) return;
13799
+ if (this.ChartBorder.IsShowTitleOnly) return;
13800
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.CustomHorizontalInfo)) return;
13801
+
13802
+ for(var i=0;i<this.CustomHorizontalInfo.length;++i)
13803
+ {
13804
+ var item=this.CustomHorizontalInfo[i];
13805
+ if (item.Type==5) this.DrawCustomAreaItem(item);
13806
+ }
13807
+ }
13808
+
13758
13809
  //画边框
13759
13810
  this.SuperDrawBorder=this.DrawBorder;
13760
13811
  this.DrawBorder=function()
@@ -16585,6 +16585,8 @@ function AverageWidthFrame()
16585
16585
  if (value>width) width=value;
16586
16586
  var outItem={ Text:text[i].Text, Width:value+2*pixelTatio };
16587
16587
  if (item.TextColor) outItem.TextColor=item.TextColor;
16588
+ if (item.BGColor) outItem.BGColor=item.BGColor;
16589
+ if (IFrameSplitOperator.IsBool(item.EnableBGColor)) outItem.EnableBGColor=item.EnableBGColor; //是否启用背景色
16588
16590
  aryText.push(outItem);
16589
16591
  }
16590
16592
  }
@@ -16793,7 +16795,7 @@ function AverageWidthFrame()
16793
16795
  }
16794
16796
 
16795
16797
  var pixelTatio = GetDevicePixelRatio();
16796
- var defaultTextHeight=18*pixelTatio;
16798
+ var defaultTextHeight=5*pixelTatio;
16797
16799
  var textHeight=defaultTextHeight;
16798
16800
  var y;
16799
16801
 
@@ -16943,9 +16945,11 @@ function AverageWidthFrame()
16943
16945
  {
16944
16946
  var lineType=item.LineType;
16945
16947
  if (IFrameSplitOperator.IsNumber(exLine.Type)) lineType=exLine.Type; //外部设置延长线样式
16946
- if (i==0) this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);
16948
+ var exLineColor=item.LineColor;
16949
+ if (exLine.LineColor) exLineColor=exLine.LineColor; //设置线段颜色
16950
+ if (i==0) this.DrawLine(left,left-exLine.Width,y,exLineColor,lineType,item);
16947
16951
  textLeft-=exLine.Width;
16948
- rectLeft-=exLine.Width
16952
+ rectLeft-=exLine.Width;
16949
16953
  }
16950
16954
  }
16951
16955
 
@@ -16960,8 +16964,14 @@ function AverageWidthFrame()
16960
16964
  }
16961
16965
  else
16962
16966
  {
16963
- this.Canvas.fillStyle=item.LineColor;
16964
- this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
16967
+ if (!(itemText.EnableBGColor===false))
16968
+ {
16969
+ var textBGColor=item.LineColor;
16970
+ if (itemText.BGColor) textBGColor=itemText.BGColor;
16971
+ this.Canvas.fillStyle=textBGColor;
16972
+ this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
16973
+ }
16974
+
16965
16975
  this.Canvas.fillStyle = item.TextColor;
16966
16976
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
16967
16977
  }
@@ -17222,7 +17232,7 @@ function AverageWidthFrame()
17222
17232
  if (!item.AreaData) return;
17223
17233
  if (this.IsHScreen) return; //暂时不支持横屏
17224
17234
 
17225
- //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
17235
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右], Width:[左, 右] }
17226
17236
  if (!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value) || item.AreaData.Value.length!=2) return;
17227
17237
 
17228
17238
  var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);
@@ -17247,6 +17257,18 @@ function AverageWidthFrame()
17247
17257
  var rtBG={ Left:0, Right:left-1, Top:yTop, Bottom:yBottom };
17248
17258
  rtBG.Height=rtBG.Bottom-rtBG.Top;
17249
17259
  rtBG.Width=rtBG.Right-rtBG.Left;
17260
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width)) //指定宽度
17261
+ {
17262
+ var bgWidth=item.AreaData.Width[0];
17263
+ if (IFrameSplitOperator.IsNumber(bgWidth))
17264
+ {
17265
+ if (rtBG.Width>bgWidth)
17266
+ {
17267
+ rtBG.Width=bgWidth;
17268
+ rtBG.Left=rtBG.Right-rtBG.Width;
17269
+ }
17270
+ }
17271
+ }
17250
17272
  this.Canvas.fillStyle=item.AreaData.BGColor;
17251
17273
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
17252
17274
  this.DrawCustomAreaText(rtBG, item, 0);
@@ -17267,6 +17289,19 @@ function AverageWidthFrame()
17267
17289
  rtBG.Width=rtBG.Right-rtBG.Left;
17268
17290
  }
17269
17291
 
17292
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width)) //指定宽度
17293
+ {
17294
+ var bgWidth=item.AreaData.Width[1];
17295
+ if (IFrameSplitOperator.IsNumber(bgWidth))
17296
+ {
17297
+ if (rtBG.Width>bgWidth)
17298
+ {
17299
+ rtBG.Width=bgWidth;
17300
+ rtBG.Right=rtBG.Left+rtBG.Width;
17301
+ }
17302
+ }
17303
+ }
17304
+
17270
17305
  this.Canvas.fillStyle=item.AreaData.BGColor;
17271
17306
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
17272
17307
  this.DrawCustomAreaText(rtBG, item, 1);
@@ -17667,8 +17702,10 @@ function MinuteFrame()
17667
17702
 
17668
17703
  this.DrawNightDayBG(); //绘制夜盘 日盘背景
17669
17704
  this.DrawCustomBG(); //绘制自定义背景色
17670
-
17705
+
17671
17706
  this.DrawTitleBG();
17707
+ this.DrawCustomHorizontalArea(); //Y轴背景区域 在刻度前面绘制
17708
+
17672
17709
  this.DrawHorizontal();
17673
17710
  this.DrawVertical();
17674
17711
  }
@@ -17680,6 +17717,20 @@ function MinuteFrame()
17680
17717
  }
17681
17718
  }
17682
17719
 
17720
+ //Y轴面积背景
17721
+ this.DrawCustomHorizontalArea=function()
17722
+ {
17723
+ if (this.IsMinSize) return;
17724
+ if (this.ChartBorder.IsShowTitleOnly) return;
17725
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.CustomHorizontalInfo)) return;
17726
+
17727
+ for(var i=0;i<this.CustomHorizontalInfo.length;++i)
17728
+ {
17729
+ var item=this.CustomHorizontalInfo[i];
17730
+ if (item.Type==5) this.DrawCustomAreaItem(item);
17731
+ }
17732
+ }
17733
+
17683
17734
  //画边框
17684
17735
  this.SuperDrawBorder=this.DrawBorder;
17685
17736
  this.DrawBorder=function()
@@ -138761,7 +138812,7 @@ function ScrollBarBGChart()
138761
138812
 
138762
138813
 
138763
138814
 
138764
- var HQCHART_VERSION="1.1.13990";
138815
+ var HQCHART_VERSION="1.1.13997";
138765
138816
 
138766
138817
  function PrintHQChartVersion()
138767
138818
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13990";
8
+ var HQCHART_VERSION="1.1.13997";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -16629,6 +16629,8 @@ function AverageWidthFrame()
16629
16629
  if (value>width) width=value;
16630
16630
  var outItem={ Text:text[i].Text, Width:value+2*pixelTatio };
16631
16631
  if (item.TextColor) outItem.TextColor=item.TextColor;
16632
+ if (item.BGColor) outItem.BGColor=item.BGColor;
16633
+ if (IFrameSplitOperator.IsBool(item.EnableBGColor)) outItem.EnableBGColor=item.EnableBGColor; //是否启用背景色
16632
16634
  aryText.push(outItem);
16633
16635
  }
16634
16636
  }
@@ -16837,7 +16839,7 @@ function AverageWidthFrame()
16837
16839
  }
16838
16840
 
16839
16841
  var pixelTatio = GetDevicePixelRatio();
16840
- var defaultTextHeight=18*pixelTatio;
16842
+ var defaultTextHeight=5*pixelTatio;
16841
16843
  var textHeight=defaultTextHeight;
16842
16844
  var y;
16843
16845
 
@@ -16987,9 +16989,11 @@ function AverageWidthFrame()
16987
16989
  {
16988
16990
  var lineType=item.LineType;
16989
16991
  if (IFrameSplitOperator.IsNumber(exLine.Type)) lineType=exLine.Type; //外部设置延长线样式
16990
- if (i==0) this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);
16992
+ var exLineColor=item.LineColor;
16993
+ if (exLine.LineColor) exLineColor=exLine.LineColor; //设置线段颜色
16994
+ if (i==0) this.DrawLine(left,left-exLine.Width,y,exLineColor,lineType,item);
16991
16995
  textLeft-=exLine.Width;
16992
- rectLeft-=exLine.Width
16996
+ rectLeft-=exLine.Width;
16993
16997
  }
16994
16998
  }
16995
16999
 
@@ -17004,8 +17008,14 @@ function AverageWidthFrame()
17004
17008
  }
17005
17009
  else
17006
17010
  {
17007
- this.Canvas.fillStyle=item.LineColor;
17008
- this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
17011
+ if (!(itemText.EnableBGColor===false))
17012
+ {
17013
+ var textBGColor=item.LineColor;
17014
+ if (itemText.BGColor) textBGColor=itemText.BGColor;
17015
+ this.Canvas.fillStyle=textBGColor;
17016
+ this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
17017
+ }
17018
+
17009
17019
  this.Canvas.fillStyle = item.TextColor;
17010
17020
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
17011
17021
  }
@@ -17266,7 +17276,7 @@ function AverageWidthFrame()
17266
17276
  if (!item.AreaData) return;
17267
17277
  if (this.IsHScreen) return; //暂时不支持横屏
17268
17278
 
17269
- //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
17279
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右], Width:[左, 右] }
17270
17280
  if (!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value) || item.AreaData.Value.length!=2) return;
17271
17281
 
17272
17282
  var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);
@@ -17291,6 +17301,18 @@ function AverageWidthFrame()
17291
17301
  var rtBG={ Left:0, Right:left-1, Top:yTop, Bottom:yBottom };
17292
17302
  rtBG.Height=rtBG.Bottom-rtBG.Top;
17293
17303
  rtBG.Width=rtBG.Right-rtBG.Left;
17304
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width)) //指定宽度
17305
+ {
17306
+ var bgWidth=item.AreaData.Width[0];
17307
+ if (IFrameSplitOperator.IsNumber(bgWidth))
17308
+ {
17309
+ if (rtBG.Width>bgWidth)
17310
+ {
17311
+ rtBG.Width=bgWidth;
17312
+ rtBG.Left=rtBG.Right-rtBG.Width;
17313
+ }
17314
+ }
17315
+ }
17294
17316
  this.Canvas.fillStyle=item.AreaData.BGColor;
17295
17317
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
17296
17318
  this.DrawCustomAreaText(rtBG, item, 0);
@@ -17311,6 +17333,19 @@ function AverageWidthFrame()
17311
17333
  rtBG.Width=rtBG.Right-rtBG.Left;
17312
17334
  }
17313
17335
 
17336
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Width)) //指定宽度
17337
+ {
17338
+ var bgWidth=item.AreaData.Width[1];
17339
+ if (IFrameSplitOperator.IsNumber(bgWidth))
17340
+ {
17341
+ if (rtBG.Width>bgWidth)
17342
+ {
17343
+ rtBG.Width=bgWidth;
17344
+ rtBG.Right=rtBG.Left+rtBG.Width;
17345
+ }
17346
+ }
17347
+ }
17348
+
17314
17349
  this.Canvas.fillStyle=item.AreaData.BGColor;
17315
17350
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
17316
17351
  this.DrawCustomAreaText(rtBG, item, 1);
@@ -17711,8 +17746,10 @@ function MinuteFrame()
17711
17746
 
17712
17747
  this.DrawNightDayBG(); //绘制夜盘 日盘背景
17713
17748
  this.DrawCustomBG(); //绘制自定义背景色
17714
-
17749
+
17715
17750
  this.DrawTitleBG();
17751
+ this.DrawCustomHorizontalArea(); //Y轴背景区域 在刻度前面绘制
17752
+
17716
17753
  this.DrawHorizontal();
17717
17754
  this.DrawVertical();
17718
17755
  }
@@ -17724,6 +17761,20 @@ function MinuteFrame()
17724
17761
  }
17725
17762
  }
17726
17763
 
17764
+ //Y轴面积背景
17765
+ this.DrawCustomHorizontalArea=function()
17766
+ {
17767
+ if (this.IsMinSize) return;
17768
+ if (this.ChartBorder.IsShowTitleOnly) return;
17769
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.CustomHorizontalInfo)) return;
17770
+
17771
+ for(var i=0;i<this.CustomHorizontalInfo.length;++i)
17772
+ {
17773
+ var item=this.CustomHorizontalInfo[i];
17774
+ if (item.Type==5) this.DrawCustomAreaItem(item);
17775
+ }
17776
+ }
17777
+
17727
17778
  //画边框
17728
17779
  this.SuperDrawBorder=this.DrawBorder;
17729
17780
  this.DrawBorder=function()
@@ -145143,7 +145194,7 @@ function HQChartScriptWorker()
145143
145194
 
145144
145195
 
145145
145196
 
145146
- var HQCHART_VERSION="1.1.13990";
145197
+ var HQCHART_VERSION="1.1.13997";
145147
145198
 
145148
145199
  function PrintHQChartVersion()
145149
145200
  {