hqchart 1.1.13821 → 1.1.13825

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.
@@ -2375,10 +2375,10 @@ this.Canvas.strokeStyle=outRange.Border.Color;this.Canvas.strokeRect(ToFixedPoin
2375
2375
  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刻度
2376
2376
  {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 集合竞价右侧
2377
2377
  {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+')';//内部刻度 背景增加透明度
2378
- 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)//左侧延长线
2378
+ 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)//左侧延长线
2379
2379
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2380
- if(i==0)this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);textLeft-=exLine.Width;//rectLeft-=exLine.Width
2381
- }}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)this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);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])//右侧延长线
2380
+ 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
2381
+ }}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);}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])//右侧延长线
2382
2382
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2383
2383
  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);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
2384
2384
  {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+')';//内部刻度 背景增加透明度
@@ -2395,7 +2395,8 @@ if(!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value)||item.AreaData.Valu
2395
2395
  {var rtBG={Left:right+1,Top:yTop,Bottom:yBottom};rtBG.Height=rtBG.Bottom-rtBG.Top;if(this.YRightTextInfo&&IFrameSplitOperator.IsNumber(this.YRightTextInfo.MainTextWidth))//右侧自动调整 可以获取宽度
2396
2396
  {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=右
2397
2397
  {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]);//虚线
2398
- 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{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();//获取设备的分辨率
2398
+ 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)//绘制短线
2399
+ {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();//获取设备的分辨率
2399
2400
  if(this.IsHScreen){var borderTop=this.ChartBorder.Top;var borderBottom=this.ChartBorder.Bottom;var isDrawLeft=borderTop>10*pixelTatio&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderBottom>10*pixelTatio&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}else{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;}if(!isDrawRight&&!isDrawLeft)return null;var width={Left:null,Right:null};var rightExtendWidth=0;var isYPercentage=false;//是否是百分比坐标
2400
2401
  if(this.YSplitOperator&&this.YSplitOperator.CoordinateType==1)isYPercentage=true;var leftExtendLineWidth=0;var rightExtendLineWidth=0;if(IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend)){if(this.YLineExtend[0]&&this.YLineExtend[0].Width>1)leftExtendLineWidth=this.YLineExtend[0].Width;if(this.YLineExtend[1]&&this.YLineExtend[1].Width>1)rightExtendLineWidth=this.YLineExtend[1].Width;}for(var i=0;i<this.HorizontalInfo.length;++i){var textWidth=null;var item=this.HorizontalInfo[i];if(!item)continue;if(item.Font!=null)this.Canvas.font=item.Font;if(item.Message[0]!=null&&isDrawLeft){if(Array.isArray(item.Message[0])){textWidth=this.GetMulitTextMaxWidth(item.Message[0]);}else{textWidth=this.Canvas.measureText(item.Message[0]).width;}if(width.Left==null||width.Left<textWidth)width.Left=textWidth;//JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[0]} ${textWidth}`);
2401
2402
  }if(item.Message[1]!=null&&isDrawRight){if(item.Font!=null)this.Canvas.font=item.Font;if(Array.isArray(item.Message[1])){if(this.MultiTextFormat==1)//显示1行 格式:价格/百分比
@@ -13740,7 +13741,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13740
13741
  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);};}/********************************************************************************
13741
13742
  * 版本信息输出
13742
13743
  *
13743
- */var HQCHART_VERSION="1.1.13820";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();//把给外界调用的方法暴露出来
13744
+ */var HQCHART_VERSION="1.1.13824";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();//把给外界调用的方法暴露出来
13744
13745
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13745
13746
  // BaseIndex:BaseIndex,
13746
13747
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13821",
3
+ "version": "1.1.13825",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -12552,6 +12552,7 @@ function AverageWidthFrame()
12552
12552
  var bgColor=item.LineColor;
12553
12553
  var rgb=this.RGBToStruct(item.LineColor);
12554
12554
  if (rgb) bgColor=`rgba(${rgb.R}, ${rgb.G}, ${rgb.B}, ${g_JSChartResource.FrameLatestPrice.BGAlpha})`; //内部刻度 背景增加透明度
12555
+ if (item.BGColor) bgColor=item.BGColor;
12555
12556
 
12556
12557
  var yText=y;
12557
12558
  for(var i=0;i<textInfo.Text.length;++i)
@@ -12588,7 +12589,11 @@ function AverageWidthFrame()
12588
12589
  {
12589
12590
  var lineType=item.LineType;
12590
12591
  if (IFrameSplitOperator.IsNumber(exLine.Type)) lineType=exLine.Type; //外部设置延长线样式
12591
- if (i==0) this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);
12592
+ if (i==0)
12593
+ {
12594
+ var yLine=border.LeftEx-exLine.Width;
12595
+ this.DrawLine(yLine,yLine+exLine.Width,y,item.LineColor,lineType,item);
12596
+ }
12592
12597
  textLeft-=exLine.Width;
12593
12598
  //rectLeft-=exLine.Width
12594
12599
  }
@@ -12598,7 +12603,11 @@ function AverageWidthFrame()
12598
12603
  this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
12599
12604
  this.Canvas.fillStyle = item.TextColor;
12600
12605
  this.Canvas.fillText(itemText.Text, textLeft + 1*pixelTatio, yText);
12601
- if (i==0) this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
12606
+ if (i==0)
12607
+ {
12608
+ if (position==2) this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);
12609
+ else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
12610
+ }
12602
12611
 
12603
12612
  yText+=textHeight+1*pixelTatio;
12604
12613
  }
@@ -13064,6 +13073,23 @@ function AverageWidthFrame()
13064
13073
  this.Canvas.lineWidth=pixelRatio;
13065
13074
  }
13066
13075
  }
13076
+ else if (lineType==2) //绘制短线
13077
+ {
13078
+ var lineWidth=10*GetDevicePixelRatio();
13079
+ this.Canvas.strokeStyle=color;
13080
+ this.Canvas.beginPath();
13081
+ if (this.IsHScreen)
13082
+ {
13083
+ this.Canvas.moveTo(ToFixedPoint(y),left);
13084
+ this.Canvas.lineTo(ToFixedPoint(y),left+lineWidth);
13085
+ }
13086
+ else
13087
+ {
13088
+ this.Canvas.moveTo(left,ToFixedPoint(y));
13089
+ this.Canvas.lineTo(left+lineWidth,ToFixedPoint(y));
13090
+ }
13091
+ this.Canvas.stroke();
13092
+ }
13067
13093
  else
13068
13094
  {
13069
13095
  this.DrawDotLine(left,right,y, color, option);
@@ -16477,6 +16477,7 @@ function AverageWidthFrame()
16477
16477
  var bgColor=item.LineColor;
16478
16478
  var rgb=this.RGBToStruct(item.LineColor);
16479
16479
  if (rgb) bgColor=`rgba(${rgb.R}, ${rgb.G}, ${rgb.B}, ${g_JSChartResource.FrameLatestPrice.BGAlpha})`; //内部刻度 背景增加透明度
16480
+ if (item.BGColor) bgColor=item.BGColor;
16480
16481
 
16481
16482
  var yText=y;
16482
16483
  for(var i=0;i<textInfo.Text.length;++i)
@@ -16513,7 +16514,11 @@ function AverageWidthFrame()
16513
16514
  {
16514
16515
  var lineType=item.LineType;
16515
16516
  if (IFrameSplitOperator.IsNumber(exLine.Type)) lineType=exLine.Type; //外部设置延长线样式
16516
- if (i==0) this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);
16517
+ if (i==0)
16518
+ {
16519
+ var yLine=border.LeftEx-exLine.Width;
16520
+ this.DrawLine(yLine,yLine+exLine.Width,y,item.LineColor,lineType,item);
16521
+ }
16517
16522
  textLeft-=exLine.Width;
16518
16523
  //rectLeft-=exLine.Width
16519
16524
  }
@@ -16523,7 +16528,11 @@ function AverageWidthFrame()
16523
16528
  this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
16524
16529
  this.Canvas.fillStyle = item.TextColor;
16525
16530
  this.Canvas.fillText(itemText.Text, textLeft + 1*pixelTatio, yText);
16526
- if (i==0) this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
16531
+ if (i==0)
16532
+ {
16533
+ if (position==2) this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);
16534
+ else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
16535
+ }
16527
16536
 
16528
16537
  yText+=textHeight+1*pixelTatio;
16529
16538
  }
@@ -16989,6 +16998,23 @@ function AverageWidthFrame()
16989
16998
  this.Canvas.lineWidth=pixelRatio;
16990
16999
  }
16991
17000
  }
17001
+ else if (lineType==2) //绘制短线
17002
+ {
17003
+ var lineWidth=10*GetDevicePixelRatio();
17004
+ this.Canvas.strokeStyle=color;
17005
+ this.Canvas.beginPath();
17006
+ if (this.IsHScreen)
17007
+ {
17008
+ this.Canvas.moveTo(ToFixedPoint(y),left);
17009
+ this.Canvas.lineTo(ToFixedPoint(y),left+lineWidth);
17010
+ }
17011
+ else
17012
+ {
17013
+ this.Canvas.moveTo(left,ToFixedPoint(y));
17014
+ this.Canvas.lineTo(left+lineWidth,ToFixedPoint(y));
17015
+ }
17016
+ this.Canvas.stroke();
17017
+ }
16992
17018
  else
16993
17019
  {
16994
17020
  this.DrawDotLine(left,right,y, color, option);
@@ -138258,7 +138284,7 @@ function ScrollBarBGChart()
138258
138284
 
138259
138285
 
138260
138286
 
138261
- var HQCHART_VERSION="1.1.13820";
138287
+ var HQCHART_VERSION="1.1.13824";
138262
138288
 
138263
138289
  function PrintHQChartVersion()
138264
138290
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13820";
8
+ var HQCHART_VERSION="1.1.13824";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -16521,6 +16521,7 @@ function AverageWidthFrame()
16521
16521
  var bgColor=item.LineColor;
16522
16522
  var rgb=this.RGBToStruct(item.LineColor);
16523
16523
  if (rgb) bgColor=`rgba(${rgb.R}, ${rgb.G}, ${rgb.B}, ${g_JSChartResource.FrameLatestPrice.BGAlpha})`; //内部刻度 背景增加透明度
16524
+ if (item.BGColor) bgColor=item.BGColor;
16524
16525
 
16525
16526
  var yText=y;
16526
16527
  for(var i=0;i<textInfo.Text.length;++i)
@@ -16557,7 +16558,11 @@ function AverageWidthFrame()
16557
16558
  {
16558
16559
  var lineType=item.LineType;
16559
16560
  if (IFrameSplitOperator.IsNumber(exLine.Type)) lineType=exLine.Type; //外部设置延长线样式
16560
- if (i==0) this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);
16561
+ if (i==0)
16562
+ {
16563
+ var yLine=border.LeftEx-exLine.Width;
16564
+ this.DrawLine(yLine,yLine+exLine.Width,y,item.LineColor,lineType,item);
16565
+ }
16561
16566
  textLeft-=exLine.Width;
16562
16567
  //rectLeft-=exLine.Width
16563
16568
  }
@@ -16567,7 +16572,11 @@ function AverageWidthFrame()
16567
16572
  this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
16568
16573
  this.Canvas.fillStyle = item.TextColor;
16569
16574
  this.Canvas.fillText(itemText.Text, textLeft + 1*pixelTatio, yText);
16570
- if (i==0) this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
16575
+ if (i==0)
16576
+ {
16577
+ if (position==2) this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);
16578
+ else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
16579
+ }
16571
16580
 
16572
16581
  yText+=textHeight+1*pixelTatio;
16573
16582
  }
@@ -17033,6 +17042,23 @@ function AverageWidthFrame()
17033
17042
  this.Canvas.lineWidth=pixelRatio;
17034
17043
  }
17035
17044
  }
17045
+ else if (lineType==2) //绘制短线
17046
+ {
17047
+ var lineWidth=10*GetDevicePixelRatio();
17048
+ this.Canvas.strokeStyle=color;
17049
+ this.Canvas.beginPath();
17050
+ if (this.IsHScreen)
17051
+ {
17052
+ this.Canvas.moveTo(ToFixedPoint(y),left);
17053
+ this.Canvas.lineTo(ToFixedPoint(y),left+lineWidth);
17054
+ }
17055
+ else
17056
+ {
17057
+ this.Canvas.moveTo(left,ToFixedPoint(y));
17058
+ this.Canvas.lineTo(left+lineWidth,ToFixedPoint(y));
17059
+ }
17060
+ this.Canvas.stroke();
17061
+ }
17036
17062
  else
17037
17063
  {
17038
17064
  this.DrawDotLine(left,right,y, color, option);
@@ -142814,7 +142840,7 @@ function HQChartScriptWorker()
142814
142840
 
142815
142841
 
142816
142842
 
142817
- var HQCHART_VERSION="1.1.13820";
142843
+ var HQCHART_VERSION="1.1.13824";
142818
142844
 
142819
142845
  function PrintHQChartVersion()
142820
142846
  {