hqchart 1.1.13758 → 1.1.13760
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.
package/lib/umychart.vue.js
CHANGED
|
@@ -6107,15 +6107,16 @@ var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoin
|
|
|
6107
6107
|
if(bVisibleRange)this.DrawInternalLabel(drawPoint[0].Y);//内部价格标签
|
|
6108
6108
|
//画中心点
|
|
6109
6109
|
if(bVisibleRange){var xCenter=left+(right-left)/2;var point={X:xCenter,Y:drawPoint[0].Y};this.DrawPoint([point]);}this.Canvas.restore();//外部右侧显示价格
|
|
6110
|
-
if(this.ShowPriceTextConfig.IsShow[2]){var rtDraw={};this.CalculateButtonSize();this.
|
|
6110
|
+
if(this.ShowPriceTextConfig.IsShow[2]){var rtDraw={};this.CalculateButtonSize();this.DrawRightLabel(drawPoint[0].Y);if(bVisibleRange)this.DrawCustomHLine(drawPoint[0].Y);}//鼠标是否在按钮上
|
|
6111
6111
|
if(moveonPoint&&mouseStatus){for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];var rtButton=item.Rect;if(moveonPoint.X>=rtButton.Left&&moveonPoint.X<rtButton.Right&&moveonPoint.Y>=rtButton.Top&&moveonPoint.Y<=rtButton.Bottom){mouseStatus.MouseOnToolbar={Rect:rtButton,Item:item,Frame:this.Frame,Point:{X:moveonPoint.X,Y:moveonPoint.Y}};break;}}}};this.CalculateLabSize=function(labInfo){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";this.Canvas.font=this.TextFont;var lineHeight=this.Canvas.measureText("擎").width+2;var maxNameWidth=0,maxTextWidth=0;var lineCount=0;var lineSpace=0;if(IFrameSplitOperator.IsNumber(labInfo.LineSpace))lineSpace=labInfo.LineSpace;var maxNameWidth=0,maxTextWidth=0;var lineCount=0;var maxWidth=0;for(var i=0;i<labInfo.AryText.length;++i){var item=labInfo.AryText[i];item.NameWidth=0;item.TextWidth=0;if(item.Name)item.NameWidth=this.Canvas.measureText(item.Name).width+2;if(item.Text)item.TextWidth=this.Canvas.measureText(item.Text).width+2;if(maxNameWidth<item.NameWidth)maxNameWidth=item.NameWidth;if(maxTextWidth<item.TextWidth)maxTextWidth=item.TextWidth;var itemWidth=item.NameWidth+item.TextWidth;if(maxWidth<itemWidth)maxWidth=itemWidth;++lineCount;}var size={Width:maxWidth,Height:lineCount*lineHeight+(lineCount-1)*lineSpace,NameWidth:maxNameWidth,TextWidth:maxTextWidth,LineHeight:lineHeight};if(labInfo.LabelMargin){var item=labInfo.LabelMargin;if(IFrameSplitOperator.IsNumber(item.Left))size.Width+=item.Left;if(IFrameSplitOperator.IsNumber(item.Right))size.Width+=item.Right;if(IFrameSplitOperator.IsNumber(item.Top))size.Height+=item.Top;if(IFrameSplitOperator.IsNumber(item.Bottom))size.Height+=item.Bottom;}return size;};//绘制窗口内部标签
|
|
6112
6112
|
this.DrawInternalLabel=function(y){if(!this.LableInfo||!IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryText))return;if(this.LableInfo.Position==2)return;var border=this.Frame.GetBorder();var left=border.Left;var right=border.Right;var labSize=this.CalculateLabSize(this.LableInfo);var drawLeft=right-labSize.Width;var drawRight=drawLeft+labSize.Width;var drawTop=y-labSize.Height-1;if(drawTop<=border.TopEx)drawTop=y+1;var rtLabel={Left:drawLeft,Right:drawRight,Top:drawTop,Width:labSize.Width,Height:labSize.Height};rtLabel.Bottom=rtLabel.Top+rtLabel.Height;this.DrawLabel(this.LableInfo,labSize,rtLabel);};//绘制标签页
|
|
6113
6113
|
this.DrawLabel=function(labelInfo,labelSize,rtLabel){//背景色
|
|
6114
|
-
if(labelInfo.BGColor){this.Canvas.fillStyle=labelInfo.BGColor;this.Canvas.fillRect(ToFixedRect(rtLabel.Left),ToFixedRect(rtLabel.Top),ToFixedRect(rtLabel.Width),ToFixedRect(rtLabel.Height));}var labelMargin=labelInfo.LabelMargin;var lineSpace=0;if(IFrameSplitOperator.IsNumber(labelInfo.LineSpace))lineSpace=labelInfo.LineSpace;var yText=rtLabel.Top;var xText=rtLabel.Left;var yRightText=rtLabel.Right;if(labelMargin){if(IFrameSplitOperator.IsNumber(labelMargin.Left))xText+=labelMargin.Left;if(IFrameSplitOperator.IsNumber(labelMargin.Right))yRightText-=labelMargin.Right;if(IFrameSplitOperator.IsNumber(labelMargin.Top))yText+=labelMargin.Top;}this.Canvas.font=this.TextFont;this.Canvas.textBaseline="top";for(var i=0;i<labelInfo.AryText.length;++i){if(i>0)yText+=lineSpace;var item=labelInfo.AryText[i];if(item.Name){this.Canvas.textAlign="left";this.Canvas.fillStyle=item.NameColor;this.Canvas.fillText(item.Name,xText,yText);}if(item.Text){this.Canvas.textAlign="right";this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Text,yRightText,yText);}yText+=labelSize.LineHeight;}};this.DrawRightLabel=function(
|
|
6115
|
-
{
|
|
6114
|
+
if(labelInfo.BGColor){this.Canvas.fillStyle=labelInfo.BGColor;this.Canvas.fillRect(ToFixedRect(rtLabel.Left),ToFixedRect(rtLabel.Top),ToFixedRect(rtLabel.Width),ToFixedRect(rtLabel.Height));}var labelMargin=labelInfo.LabelMargin;var lineSpace=0;if(IFrameSplitOperator.IsNumber(labelInfo.LineSpace))lineSpace=labelInfo.LineSpace;var yText=rtLabel.Top;var xText=rtLabel.Left;var yRightText=rtLabel.Right;if(labelMargin){if(IFrameSplitOperator.IsNumber(labelMargin.Left))xText+=labelMargin.Left;if(IFrameSplitOperator.IsNumber(labelMargin.Right))yRightText-=labelMargin.Right;if(IFrameSplitOperator.IsNumber(labelMargin.Top))yText+=labelMargin.Top;}this.Canvas.font=this.TextFont;this.Canvas.textBaseline="top";for(var i=0;i<labelInfo.AryText.length;++i){if(i>0)yText+=lineSpace;var item=labelInfo.AryText[i];if(item.Name){this.Canvas.textAlign="left";this.Canvas.fillStyle=item.NameColor;this.Canvas.fillText(item.Name,xText,yText);}if(item.Text){this.Canvas.textAlign="right";this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Text,yRightText,yText);}yText+=labelSize.LineHeight;}};this.DrawRightLabel=function(y){var rtDraw={};if(!this.LableInfo||!IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryText)||this.LableInfo.Position!=2){this.DrawValueText(y,rtDraw);return;}var priceSize=this.CalculateValueText(y);var labSize=this.CalculateLabSize(this.LableInfo);var border=this.Frame.GetBorder();var yTop=y-priceSize.Height/2;var totalHeight=priceSize.Height+labSize.Height;var yBottom=yTop+totalHeight;var option={};if(yBottom>border.Bottom)//超过窗口底部, 标签位置不动
|
|
6115
|
+
{yBottom=border.Bottom;yTop=yBottom-totalHeight;option.Top=yTop;}this.DrawValueText(y,rtDraw,option);var drawLeft=rtDraw.Right-labSize.Width;if(drawLeft<rtDraw.Left)drawLeft=rtDraw.Left;var drawRight=drawLeft+labSize.Width;var drawTop=rtDraw.Bottom;var rtLabel={Left:drawLeft,Right:drawRight,Top:drawTop,Width:labSize.Width,Height:labSize.Height};rtLabel.Bottom=rtLabel.Top+rtLabel.Height;this.DrawLabel(this.LableInfo,labSize,rtLabel);this.DrawVerticalButton(rtLabel);};this.DrawCustomHLine=function(yLine){if(!this.LableInfo)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryLine))return;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var pixelRatio=GetDevicePixelRatio();var yMax=yLine,yMin=yLine;for(var i=0;i<this.LableInfo.AryLine.length;++i){var item=this.LableInfo.AryLine[i];if(!IFrameSplitOperator.IsNumber(item.Value))continue;if(item.Width<0)continue;var y=this.Frame.GetYFromData(item.Value);var yFixed=ToFixedPoint(y);var xRight=right;if(IFrameSplitOperator.IsPlusNumber(item.Width)){if(item.Width<1)xRight=left+item.Width*(right-left);//0.3 百分比
|
|
6116
6116
|
else xRight=left+item.Width*pixelRatio;//>1 实际数值就是长度
|
|
6117
|
-
}if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(xRight,yFixed);this.Canvas.stroke();if(yMax<yFixed)yMax=yFixed;if(yMin>yFixed)yMin=yFixed;}if(yMax!=yMin&&this.LableInfo.VLine){var item=this.LableInfo.VLine;var x=left+20*pixelRatio;if(IFrameSplitOperator.IsNumber(item.XOffset))x=left+item.XOffset*pixelRatio;x=ToFixedPoint(x);if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(x,yMax);this.Canvas.lineTo(x,yMin);this.Canvas.stroke();}};this.DrawValueText=function(y,rtDraw){var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var top=this.Frame.ChartBorder.GetTopEx();var bottom=this.Frame.ChartBorder.GetBottomEx();var pixelTatio=GetDevicePixelRatio();var labInfo=this.LabelInfo;if(labInfo&&IFrameSplitOperator.IsNumber(labInfo.TopOffset))top-=labInfo.TopOffset;if(labInfo&&IFrameSplitOperator.IsNumber(labInfo.BottomOffset))bottom+=labInfo.BottomOffset;var yValue=this.Frame.GetYData(y,false);var strValue=yValue.toFixed(this.Precision);if(labInfo&&labInfo.PriceSuffixText)strValue+=labInfo.PriceSuffixText;var bVisibleRange=true;if(y<top){y=top;bVisibleRange=false;}else if(y>bottom){y=bottom;bVisibleRange=false;}if(this.RightSpaceWidth>0){if(!bVisibleRange)this.Canvas.setLineDash([2*pixelTatio,3*pixelTatio]);//虚线
|
|
6118
|
-
this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(right,ToFixedPoint(y));this.Canvas.lineTo(right+this.RightSpaceWidth,ToFixedPoint(y));this.Canvas.stroke();if(!bVisibleRange)this.Canvas.setLineDash([]);}this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var rtBG={Left:right+this.RightSpaceWidth,YCenter:y,Width:textWidth,Height:lineHeight};rtBG.Height+=this.TextMargin.Top+this.TextMargin.Bottom;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;var xText=rtBG.Left+this.TextMargin.Left;var yText=rtBG.Top+this.TextMargin.Top+this.TextMargin.YOffset;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="top";this.Canvas.fillText(strValue,xText,yText);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);}
|
|
6117
|
+
}if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(xRight,yFixed);this.Canvas.stroke();if(yMax<yFixed)yMax=yFixed;if(yMin>yFixed)yMin=yFixed;}if(yMax!=yMin&&this.LableInfo.VLine){var item=this.LableInfo.VLine;var x=left+20*pixelRatio;if(IFrameSplitOperator.IsNumber(item.XOffset))x=left+item.XOffset*pixelRatio;x=ToFixedPoint(x);if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(x,yMax);this.Canvas.lineTo(x,yMin);this.Canvas.stroke();}};this.DrawValueText=function(y,rtDraw,option){var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var top=this.Frame.ChartBorder.GetTopEx();var bottom=this.Frame.ChartBorder.GetBottomEx();var pixelTatio=GetDevicePixelRatio();var labInfo=this.LabelInfo;if(labInfo&&IFrameSplitOperator.IsNumber(labInfo.TopOffset))top-=labInfo.TopOffset;if(labInfo&&IFrameSplitOperator.IsNumber(labInfo.BottomOffset))bottom+=labInfo.BottomOffset;var yValue=this.Frame.GetYData(y,false);var strValue=yValue.toFixed(this.Precision);if(labInfo&&labInfo.PriceSuffixText)strValue+=labInfo.PriceSuffixText;var bVisibleRange=true;if(y<top){y=top;bVisibleRange=false;}else if(y>bottom){y=bottom;bVisibleRange=false;}if(this.RightSpaceWidth>0){if(!bVisibleRange)this.Canvas.setLineDash([2*pixelTatio,3*pixelTatio]);//虚线
|
|
6118
|
+
this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(right,ToFixedPoint(y));this.Canvas.lineTo(right+this.RightSpaceWidth,ToFixedPoint(y));this.Canvas.stroke();if(!bVisibleRange)this.Canvas.setLineDash([]);}this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var rtBG={Left:right+this.RightSpaceWidth,YCenter:y,Width:textWidth,Height:lineHeight};rtBG.Height+=this.TextMargin.Top+this.TextMargin.Bottom;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;if(option&&IFrameSplitOperator.IsNumber(option.Top)){rtBG.Top=option.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;}var xText=rtBG.Left+this.TextMargin.Left;var yText=rtBG.Top+this.TextMargin.Top+this.TextMargin.YOffset;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="top";this.Canvas.fillText(strValue,xText,yText);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);};//计算右侧价格标签大小
|
|
6119
|
+
this.CalculateValueText=function(y){var yValue=this.Frame.GetYData(y,false);var strValue=yValue.toFixed(this.Precision);if(this.LableInfo&&this.LableInfo.PriceSuffixText)strValue+=this.LableInfo.PriceSuffixText;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var size={Width:textWidth,Height:lineHeight};size.Height+=this.TextMargin.Top+this.TextMargin.Bottom;size.Width+=this.TextMargin.Left+this.TextMargin.Right;return size;};this.DrawPriceText=function(text,ptStart,ptEnd,position){if(position!=1&&position!=0)return;var font=this.ShowPriceTextConfig.Font[position];this.Canvas.fillStyle=this.LineColor;this.Canvas.font=font;var textWidth=this.Canvas.measureText(text).width;var lineHeight=this.GetFontHeight();var rtBG=null;if(position==1){var rtBG={Left:ptStart.X,Top:ptStart.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}else if(position==0){var rtBG={Right:ptEnd.X,Top:ptEnd.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);};this.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;var totalWidth=0;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;item.Width=this.Canvas.measureText(icon.Text).width+2;item.Height=item.Width;if(icon.Margin){var margin=icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))item.Height+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))item.Height+=margin.Bottom;}if(this.VerticalButtonInfo.Width<item.Width)this.VerticalButtonInfo.Width=item.Width;this.VerticalButtonInfo.Height+=item.Height;totalWidth+=item.Width;}this.ButtonBGWidth=totalWidth;};//垂直排列按钮
|
|
6119
6120
|
this.DrawVerticalButton=function(rtLab){if(this.ButtonPosition!=3)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.VerticalButtonInfo.Height<=0)return;var rtBG={Left:rtLab.Right,Top:rtLab.Top,Width:this.VerticalButtonInfo.Width,Height:this.VerticalButtonInfo.Height};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));var pixelRatio=GetDevicePixelRatio();var yTop=rtLab.Top;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var rtButton={Left:rtBG.Left,Top:yTop,Width:this.VerticalButtonInfo.Width,Height:item.Height};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(icon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText,Data:icon.Data});yTop=rtButton.Bottom;}};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.ButtonPosition==3)return;//垂直按钮在DrawVerticalButton()调用
|
|
6120
6121
|
if(this.ButtonPosition==1){drawTop-=drawHeight;var chartWidth=this.Frame.ChartBorder.GetChartWidth();var chartLeft=this.Frame.ChartBorder.GetRight()+this.RightSpaceWidth;if(drawLeft+this.ButtonBGWidth>chartWidth)//右边不够了 往左移动
|
|
6121
6122
|
{drawLeft=chartWidth-this.ButtonBGWidth;}if(rtDraw.Left>drawLeft)drawLeft=rtDraw.Left;}else if(this.ButtonPosition==2){drawTop-=drawHeight;drawLeft=rtDraw.Left;}this.Canvas.fillStyle=this.LineColor;var left=drawLeft;var rtBG={Left:drawLeft,Top:drawTop,Width:this.ButtonBGWidth,Height:drawHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));var pixelRatio=GetDevicePixelRatio();for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var rtButton={Left:left,Top:drawTop,Width:item.Width,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(icon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText,Data:icon.Data});left=rtButton.Right;}};this.PtInButtons=function(x,y){for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect,Data:item.Data};}}return null;};}//趋势线
|
|
@@ -13791,7 +13792,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13791
13792
|
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);};}/********************************************************************************
|
|
13792
13793
|
* 版本信息输出
|
|
13793
13794
|
*
|
|
13794
|
-
*/var HQCHART_VERSION="1.1.
|
|
13795
|
+
*/var HQCHART_VERSION="1.1.13759";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();//把给外界调用的方法暴露出来
|
|
13795
13796
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13796
13797
|
// BaseIndex:BaseIndex,
|
|
13797
13798
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -58819,8 +58819,7 @@ function ChartDrawHLine()
|
|
|
58819
58819
|
{
|
|
58820
58820
|
var rtDraw={ };
|
|
58821
58821
|
this.CalculateButtonSize();
|
|
58822
|
-
this.
|
|
58823
|
-
this.DrawRightLabel(rtDraw);
|
|
58822
|
+
this.DrawRightLabel(drawPoint[0].Y);
|
|
58824
58823
|
if (bVisibleRange) this.DrawCustomHLine(drawPoint[0].Y);
|
|
58825
58824
|
}
|
|
58826
58825
|
|
|
@@ -58956,28 +58955,39 @@ function ChartDrawHLine()
|
|
|
58956
58955
|
}
|
|
58957
58956
|
}
|
|
58958
58957
|
|
|
58959
|
-
this.DrawRightLabel=function(
|
|
58958
|
+
this.DrawRightLabel=function(y)
|
|
58960
58959
|
{
|
|
58961
|
-
|
|
58962
|
-
if (this.LableInfo.Position!=2)
|
|
58963
|
-
|
|
58960
|
+
var rtDraw={ };
|
|
58961
|
+
if (!this.LableInfo || !IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryText) || this.LableInfo.Position!=2)
|
|
58962
|
+
{
|
|
58963
|
+
this.DrawValueText(y, rtDraw);
|
|
58964
|
+
return;
|
|
58965
|
+
}
|
|
58966
|
+
|
|
58967
|
+
var priceSize=this.CalculateValueText(y);
|
|
58964
58968
|
var labSize=this.CalculateLabSize(this.LableInfo);
|
|
58965
58969
|
var border=this.Frame.GetBorder();
|
|
58970
|
+
var yTop=y-priceSize.Height/2;
|
|
58971
|
+
var totalHeight=priceSize.Height+labSize.Height;
|
|
58972
|
+
var yBottom=yTop+totalHeight;
|
|
58973
|
+
var option={ };
|
|
58974
|
+
if (yBottom>border.Bottom) //超过窗口底部, 标签位置不动
|
|
58975
|
+
{
|
|
58976
|
+
yBottom=border.Bottom;
|
|
58977
|
+
yTop=yBottom-totalHeight;
|
|
58978
|
+
option.Top=yTop;
|
|
58979
|
+
}
|
|
58966
58980
|
|
|
58967
|
-
|
|
58968
|
-
|
|
58981
|
+
this.DrawValueText(y, rtDraw, option);
|
|
58982
|
+
|
|
58983
|
+
var drawLeft=rtDraw.Right-labSize.Width;
|
|
58984
|
+
if (drawLeft<rtDraw.Left) drawLeft=rtDraw.Left;
|
|
58969
58985
|
var drawRight=drawLeft+labSize.Width;
|
|
58970
|
-
|
|
58971
|
-
var drawTop=rtLeftDraw.Bottom;
|
|
58986
|
+
var drawTop=rtDraw.Bottom;
|
|
58972
58987
|
|
|
58973
58988
|
var rtLabel={ Left:drawLeft, Right:drawRight, Top:drawTop, Width:labSize.Width, Height:labSize.Height };
|
|
58974
58989
|
rtLabel.Bottom=rtLabel.Top+rtLabel.Height;
|
|
58975
|
-
|
|
58976
|
-
{
|
|
58977
|
-
rtLabel.Bottom=rtLeftDraw.Top;
|
|
58978
|
-
rtLabel.Top=rtLabel.Bottom-rtLabel.Height;
|
|
58979
|
-
}
|
|
58980
|
-
|
|
58990
|
+
|
|
58981
58991
|
this.DrawLabel(this.LableInfo, labSize, rtLabel);
|
|
58982
58992
|
|
|
58983
58993
|
this.DrawVerticalButton(rtLabel);
|
|
@@ -59036,7 +59046,7 @@ function ChartDrawHLine()
|
|
|
59036
59046
|
}
|
|
59037
59047
|
}
|
|
59038
59048
|
|
|
59039
|
-
this.DrawValueText=function(y, rtDraw)
|
|
59049
|
+
this.DrawValueText=function(y, rtDraw, option)
|
|
59040
59050
|
{
|
|
59041
59051
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
59042
59052
|
var right=this.Frame.ChartBorder.GetRight();
|
|
@@ -59084,6 +59094,12 @@ function ChartDrawHLine()
|
|
|
59084
59094
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
59085
59095
|
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
59086
59096
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59097
|
+
|
|
59098
|
+
if (option && IFrameSplitOperator.IsNumber(option.Top))
|
|
59099
|
+
{
|
|
59100
|
+
rtBG.Top=option.Top;
|
|
59101
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59102
|
+
}
|
|
59087
59103
|
|
|
59088
59104
|
var xText=rtBG.Left+this.TextMargin.Left;
|
|
59089
59105
|
var yText=rtBG.Top+this.TextMargin.Top+this.TextMargin.YOffset;
|
|
@@ -59110,6 +59126,24 @@ function ChartDrawHLine()
|
|
|
59110
59126
|
this.DrawButton(rtBG.Top, rtBG.Right, lineHeight, rtDraw);
|
|
59111
59127
|
}
|
|
59112
59128
|
|
|
59129
|
+
//计算右侧价格标签大小
|
|
59130
|
+
this.CalculateValueText=function(y)
|
|
59131
|
+
{
|
|
59132
|
+
var yValue=this.Frame.GetYData(y,false);
|
|
59133
|
+
var strValue=yValue.toFixed(this.Precision);
|
|
59134
|
+
if (this.LableInfo &&this.LableInfo.PriceSuffixText) strValue+=this.LableInfo.PriceSuffixText;
|
|
59135
|
+
|
|
59136
|
+
this.Canvas.font=this.Font;
|
|
59137
|
+
var textWidth=this.Canvas.measureText(strValue).width;
|
|
59138
|
+
var lineHeight=this.GetFontHeight();
|
|
59139
|
+
|
|
59140
|
+
var size={ Width:textWidth, Height:lineHeight };
|
|
59141
|
+
size.Height+=(this.TextMargin.Top+this.TextMargin.Bottom);
|
|
59142
|
+
size.Width+=(this.TextMargin.Left+this.TextMargin.Right);
|
|
59143
|
+
|
|
59144
|
+
return size;
|
|
59145
|
+
}
|
|
59146
|
+
|
|
59113
59147
|
this.DrawPriceText=function(text, ptStart, ptEnd, position)
|
|
59114
59148
|
{
|
|
59115
59149
|
if (position!=1 && position!=0) return;
|
|
@@ -62744,8 +62744,7 @@ function ChartDrawHLine()
|
|
|
62744
62744
|
{
|
|
62745
62745
|
var rtDraw={ };
|
|
62746
62746
|
this.CalculateButtonSize();
|
|
62747
|
-
this.
|
|
62748
|
-
this.DrawRightLabel(rtDraw);
|
|
62747
|
+
this.DrawRightLabel(drawPoint[0].Y);
|
|
62749
62748
|
if (bVisibleRange) this.DrawCustomHLine(drawPoint[0].Y);
|
|
62750
62749
|
}
|
|
62751
62750
|
|
|
@@ -62881,28 +62880,39 @@ function ChartDrawHLine()
|
|
|
62881
62880
|
}
|
|
62882
62881
|
}
|
|
62883
62882
|
|
|
62884
|
-
this.DrawRightLabel=function(
|
|
62883
|
+
this.DrawRightLabel=function(y)
|
|
62885
62884
|
{
|
|
62886
|
-
|
|
62887
|
-
if (this.LableInfo.Position!=2)
|
|
62888
|
-
|
|
62885
|
+
var rtDraw={ };
|
|
62886
|
+
if (!this.LableInfo || !IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryText) || this.LableInfo.Position!=2)
|
|
62887
|
+
{
|
|
62888
|
+
this.DrawValueText(y, rtDraw);
|
|
62889
|
+
return;
|
|
62890
|
+
}
|
|
62891
|
+
|
|
62892
|
+
var priceSize=this.CalculateValueText(y);
|
|
62889
62893
|
var labSize=this.CalculateLabSize(this.LableInfo);
|
|
62890
62894
|
var border=this.Frame.GetBorder();
|
|
62895
|
+
var yTop=y-priceSize.Height/2;
|
|
62896
|
+
var totalHeight=priceSize.Height+labSize.Height;
|
|
62897
|
+
var yBottom=yTop+totalHeight;
|
|
62898
|
+
var option={ };
|
|
62899
|
+
if (yBottom>border.Bottom) //超过窗口底部, 标签位置不动
|
|
62900
|
+
{
|
|
62901
|
+
yBottom=border.Bottom;
|
|
62902
|
+
yTop=yBottom-totalHeight;
|
|
62903
|
+
option.Top=yTop;
|
|
62904
|
+
}
|
|
62891
62905
|
|
|
62892
|
-
|
|
62893
|
-
|
|
62906
|
+
this.DrawValueText(y, rtDraw, option);
|
|
62907
|
+
|
|
62908
|
+
var drawLeft=rtDraw.Right-labSize.Width;
|
|
62909
|
+
if (drawLeft<rtDraw.Left) drawLeft=rtDraw.Left;
|
|
62894
62910
|
var drawRight=drawLeft+labSize.Width;
|
|
62895
|
-
|
|
62896
|
-
var drawTop=rtLeftDraw.Bottom;
|
|
62911
|
+
var drawTop=rtDraw.Bottom;
|
|
62897
62912
|
|
|
62898
62913
|
var rtLabel={ Left:drawLeft, Right:drawRight, Top:drawTop, Width:labSize.Width, Height:labSize.Height };
|
|
62899
62914
|
rtLabel.Bottom=rtLabel.Top+rtLabel.Height;
|
|
62900
|
-
|
|
62901
|
-
{
|
|
62902
|
-
rtLabel.Bottom=rtLeftDraw.Top;
|
|
62903
|
-
rtLabel.Top=rtLabel.Bottom-rtLabel.Height;
|
|
62904
|
-
}
|
|
62905
|
-
|
|
62915
|
+
|
|
62906
62916
|
this.DrawLabel(this.LableInfo, labSize, rtLabel);
|
|
62907
62917
|
|
|
62908
62918
|
this.DrawVerticalButton(rtLabel);
|
|
@@ -62961,7 +62971,7 @@ function ChartDrawHLine()
|
|
|
62961
62971
|
}
|
|
62962
62972
|
}
|
|
62963
62973
|
|
|
62964
|
-
this.DrawValueText=function(y, rtDraw)
|
|
62974
|
+
this.DrawValueText=function(y, rtDraw, option)
|
|
62965
62975
|
{
|
|
62966
62976
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
62967
62977
|
var right=this.Frame.ChartBorder.GetRight();
|
|
@@ -63009,6 +63019,12 @@ function ChartDrawHLine()
|
|
|
63009
63019
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
63010
63020
|
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
63011
63021
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
63022
|
+
|
|
63023
|
+
if (option && IFrameSplitOperator.IsNumber(option.Top))
|
|
63024
|
+
{
|
|
63025
|
+
rtBG.Top=option.Top;
|
|
63026
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
63027
|
+
}
|
|
63012
63028
|
|
|
63013
63029
|
var xText=rtBG.Left+this.TextMargin.Left;
|
|
63014
63030
|
var yText=rtBG.Top+this.TextMargin.Top+this.TextMargin.YOffset;
|
|
@@ -63035,6 +63051,24 @@ function ChartDrawHLine()
|
|
|
63035
63051
|
this.DrawButton(rtBG.Top, rtBG.Right, lineHeight, rtDraw);
|
|
63036
63052
|
}
|
|
63037
63053
|
|
|
63054
|
+
//计算右侧价格标签大小
|
|
63055
|
+
this.CalculateValueText=function(y)
|
|
63056
|
+
{
|
|
63057
|
+
var yValue=this.Frame.GetYData(y,false);
|
|
63058
|
+
var strValue=yValue.toFixed(this.Precision);
|
|
63059
|
+
if (this.LableInfo &&this.LableInfo.PriceSuffixText) strValue+=this.LableInfo.PriceSuffixText;
|
|
63060
|
+
|
|
63061
|
+
this.Canvas.font=this.Font;
|
|
63062
|
+
var textWidth=this.Canvas.measureText(strValue).width;
|
|
63063
|
+
var lineHeight=this.GetFontHeight();
|
|
63064
|
+
|
|
63065
|
+
var size={ Width:textWidth, Height:lineHeight };
|
|
63066
|
+
size.Height+=(this.TextMargin.Top+this.TextMargin.Bottom);
|
|
63067
|
+
size.Width+=(this.TextMargin.Left+this.TextMargin.Right);
|
|
63068
|
+
|
|
63069
|
+
return size;
|
|
63070
|
+
}
|
|
63071
|
+
|
|
63038
63072
|
this.DrawPriceText=function(text, ptStart, ptEnd, position)
|
|
63039
63073
|
{
|
|
63040
63074
|
if (position!=1 && position!=0) return;
|
|
@@ -138632,7 +138666,7 @@ function ScrollBarBGChart()
|
|
|
138632
138666
|
|
|
138633
138667
|
|
|
138634
138668
|
|
|
138635
|
-
var HQCHART_VERSION="1.1.
|
|
138669
|
+
var HQCHART_VERSION="1.1.13759";
|
|
138636
138670
|
|
|
138637
138671
|
function PrintHQChartVersion()
|
|
138638
138672
|
{
|
|
@@ -62788,8 +62788,7 @@ function ChartDrawHLine()
|
|
|
62788
62788
|
{
|
|
62789
62789
|
var rtDraw={ };
|
|
62790
62790
|
this.CalculateButtonSize();
|
|
62791
|
-
this.
|
|
62792
|
-
this.DrawRightLabel(rtDraw);
|
|
62791
|
+
this.DrawRightLabel(drawPoint[0].Y);
|
|
62793
62792
|
if (bVisibleRange) this.DrawCustomHLine(drawPoint[0].Y);
|
|
62794
62793
|
}
|
|
62795
62794
|
|
|
@@ -62925,28 +62924,39 @@ function ChartDrawHLine()
|
|
|
62925
62924
|
}
|
|
62926
62925
|
}
|
|
62927
62926
|
|
|
62928
|
-
this.DrawRightLabel=function(
|
|
62927
|
+
this.DrawRightLabel=function(y)
|
|
62929
62928
|
{
|
|
62930
|
-
|
|
62931
|
-
if (this.LableInfo.Position!=2)
|
|
62932
|
-
|
|
62929
|
+
var rtDraw={ };
|
|
62930
|
+
if (!this.LableInfo || !IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryText) || this.LableInfo.Position!=2)
|
|
62931
|
+
{
|
|
62932
|
+
this.DrawValueText(y, rtDraw);
|
|
62933
|
+
return;
|
|
62934
|
+
}
|
|
62935
|
+
|
|
62936
|
+
var priceSize=this.CalculateValueText(y);
|
|
62933
62937
|
var labSize=this.CalculateLabSize(this.LableInfo);
|
|
62934
62938
|
var border=this.Frame.GetBorder();
|
|
62939
|
+
var yTop=y-priceSize.Height/2;
|
|
62940
|
+
var totalHeight=priceSize.Height+labSize.Height;
|
|
62941
|
+
var yBottom=yTop+totalHeight;
|
|
62942
|
+
var option={ };
|
|
62943
|
+
if (yBottom>border.Bottom) //超过窗口底部, 标签位置不动
|
|
62944
|
+
{
|
|
62945
|
+
yBottom=border.Bottom;
|
|
62946
|
+
yTop=yBottom-totalHeight;
|
|
62947
|
+
option.Top=yTop;
|
|
62948
|
+
}
|
|
62935
62949
|
|
|
62936
|
-
|
|
62937
|
-
|
|
62950
|
+
this.DrawValueText(y, rtDraw, option);
|
|
62951
|
+
|
|
62952
|
+
var drawLeft=rtDraw.Right-labSize.Width;
|
|
62953
|
+
if (drawLeft<rtDraw.Left) drawLeft=rtDraw.Left;
|
|
62938
62954
|
var drawRight=drawLeft+labSize.Width;
|
|
62939
|
-
|
|
62940
|
-
var drawTop=rtLeftDraw.Bottom;
|
|
62955
|
+
var drawTop=rtDraw.Bottom;
|
|
62941
62956
|
|
|
62942
62957
|
var rtLabel={ Left:drawLeft, Right:drawRight, Top:drawTop, Width:labSize.Width, Height:labSize.Height };
|
|
62943
62958
|
rtLabel.Bottom=rtLabel.Top+rtLabel.Height;
|
|
62944
|
-
|
|
62945
|
-
{
|
|
62946
|
-
rtLabel.Bottom=rtLeftDraw.Top;
|
|
62947
|
-
rtLabel.Top=rtLabel.Bottom-rtLabel.Height;
|
|
62948
|
-
}
|
|
62949
|
-
|
|
62959
|
+
|
|
62950
62960
|
this.DrawLabel(this.LableInfo, labSize, rtLabel);
|
|
62951
62961
|
|
|
62952
62962
|
this.DrawVerticalButton(rtLabel);
|
|
@@ -63005,7 +63015,7 @@ function ChartDrawHLine()
|
|
|
63005
63015
|
}
|
|
63006
63016
|
}
|
|
63007
63017
|
|
|
63008
|
-
this.DrawValueText=function(y, rtDraw)
|
|
63018
|
+
this.DrawValueText=function(y, rtDraw, option)
|
|
63009
63019
|
{
|
|
63010
63020
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
63011
63021
|
var right=this.Frame.ChartBorder.GetRight();
|
|
@@ -63053,6 +63063,12 @@ function ChartDrawHLine()
|
|
|
63053
63063
|
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
63054
63064
|
rtBG.Top=rtBG.YCenter-rtBG.Height/2;
|
|
63055
63065
|
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
63066
|
+
|
|
63067
|
+
if (option && IFrameSplitOperator.IsNumber(option.Top))
|
|
63068
|
+
{
|
|
63069
|
+
rtBG.Top=option.Top;
|
|
63070
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
63071
|
+
}
|
|
63056
63072
|
|
|
63057
63073
|
var xText=rtBG.Left+this.TextMargin.Left;
|
|
63058
63074
|
var yText=rtBG.Top+this.TextMargin.Top+this.TextMargin.YOffset;
|
|
@@ -63079,6 +63095,24 @@ function ChartDrawHLine()
|
|
|
63079
63095
|
this.DrawButton(rtBG.Top, rtBG.Right, lineHeight, rtDraw);
|
|
63080
63096
|
}
|
|
63081
63097
|
|
|
63098
|
+
//计算右侧价格标签大小
|
|
63099
|
+
this.CalculateValueText=function(y)
|
|
63100
|
+
{
|
|
63101
|
+
var yValue=this.Frame.GetYData(y,false);
|
|
63102
|
+
var strValue=yValue.toFixed(this.Precision);
|
|
63103
|
+
if (this.LableInfo &&this.LableInfo.PriceSuffixText) strValue+=this.LableInfo.PriceSuffixText;
|
|
63104
|
+
|
|
63105
|
+
this.Canvas.font=this.Font;
|
|
63106
|
+
var textWidth=this.Canvas.measureText(strValue).width;
|
|
63107
|
+
var lineHeight=this.GetFontHeight();
|
|
63108
|
+
|
|
63109
|
+
var size={ Width:textWidth, Height:lineHeight };
|
|
63110
|
+
size.Height+=(this.TextMargin.Top+this.TextMargin.Bottom);
|
|
63111
|
+
size.Width+=(this.TextMargin.Left+this.TextMargin.Right);
|
|
63112
|
+
|
|
63113
|
+
return size;
|
|
63114
|
+
}
|
|
63115
|
+
|
|
63082
63116
|
this.DrawPriceText=function(text, ptStart, ptEnd, position)
|
|
63083
63117
|
{
|
|
63084
63118
|
if (position!=1 && position!=0) return;
|
|
@@ -143188,7 +143222,7 @@ function HQChartScriptWorker()
|
|
|
143188
143222
|
|
|
143189
143223
|
|
|
143190
143224
|
|
|
143191
|
-
var HQCHART_VERSION="1.1.
|
|
143225
|
+
var HQCHART_VERSION="1.1.13759";
|
|
143192
143226
|
|
|
143193
143227
|
function PrintHQChartVersion()
|
|
143194
143228
|
{
|