hqchart 1.1.14860 → 1.1.14864
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 +7 -4
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +8 -0
- package/src/jscommon/umychart.js +178 -67
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +187 -68
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +187 -68
package/lib/umychart.vue.js
CHANGED
|
@@ -2679,9 +2679,12 @@ var textRightPrev=null;//上一次刻度输出右边x坐标
|
|
|
2679
2679
|
for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];var x=null;if(mapX&&mapX.has(item.Value))x=mapX.get(item.Value);else x=this.GetXFromIndex(item.Value);if(x>right)break;if(xPrev!=null&&Math.abs(x-xPrev)<this.MinXDistance)continue;var item=this.VerticalInfo[i];var xFixed=ToFixedPoint(x);if(this.IsShowXLine){if(item.LineType==2)//虚线
|
|
2680
2680
|
{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;if(item.LineDash)this.Canvas.setLineDash(item.LineDash);else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]);this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else if(item.LineType==3){}else if(item.LineType>0)//实线
|
|
2681
2681
|
{if(g_JSChartResource.FrameXLineDash){this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.setLineDash(g_JSChartResource.FrameXLineDash);//虚线
|
|
2682
|
-
this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();}}}if(item.BG&&this.DrawDayVertical){this.DrawDayVertical(item,x,border);}if(
|
|
2682
|
+
this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();}}}if(item.BG&&this.DrawDayVertical){this.DrawDayVertical(item,x,border);}if(item.Message[0]!=null&&this.ChartBorder.Bottom>5*pixelRatio){if(IFrameSplitOperator.IsObject(item.Message[0])){var textObj=item.Message[0];if(!textObj.Font)textObj.Font=item.Font;if(!textObj.TextColor)textObj.TextColor=item.TextColor;var drawInfo=this.GetMultiLineVTextSize(textObj);if(drawInfo){drawInfo.XCenter=x;var rtBottom={Left:0,Right:right,Top:bottom+2*pixelRatio,Bottom:border.Height};rtBottom.Width=rtBottom.Right-rtBottom.Left;rtBottom.Height=rtBottom.Bottom-rtBottom.Top;drawInfo.RectBottom=rtBottom;drawInfo.TextRightPrev=textRightPrev;this.DrawMultiLineVText(drawInfo);if(drawInfo.TextRight)textRightPrev=drawInfo.TextRight;}}else{if(item.Font)this.Canvas.font=item.Font;var textLeft=0;this.Canvas.strokeStyle=item.TextColor;var testWidth=this.Canvas.measureText(item.Message[0]).width;var textHeight=this.Canvas.measureText("擎").width;if(bottomTextExtend&&bottomTextExtend.Align==1){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else{if(x<testWidth/2){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else if(x+testWidth/2>=this.ChartBorder.GetChartWidth()){this.Canvas.textAlign="right";this.Canvas.textBaseline="top";textLeft=x-testWidth;}else{this.Canvas.textAlign="center";this.Canvas.textBaseline="top";textLeft=x-testWidth/2;}}if(textRightPrev==null||textLeft>textRightPrev){var yText=bottom;if(item.LineType==3){var lineLength=this.ShortXLineLength*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2*pixelRatio;}if(bottomLineExtend){if(bottomLineExtend.Mode===1){if(item.Value>1){if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,bottom);this.Canvas.lineTo(xFixed,border.ChartHeight);this.Canvas.stroke();x+=1;}}else if(bottomLineExtend.Mode===2){if(bottomLineExtend.Width>=1){var lineLength=bottomLineExtend.Width;if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2;}}}//item.TextBGColor="rgb(0,255,0)";
|
|
2683
2683
|
if(item.TextBGColor)//文字背景色
|
|
2684
|
-
{var rtText={Left:textLeft,Top:yText+this.XBottomOffset,Width:testWidth,Height:textHeight};this.Canvas.fillStyle=item.TextBGColor;this.Canvas.fillRect(rtText.Left-1,rtText.Top,rtText.Width+2,rtText.Height);}this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);textRightPrev=textLeft+testWidth;}}xPrev=x;}};//
|
|
2684
|
+
{var rtText={Left:textLeft,Top:yText+this.XBottomOffset,Width:testWidth,Height:textHeight};this.Canvas.fillStyle=item.TextBGColor;this.Canvas.fillRect(rtText.Left-1,rtText.Top,rtText.Width+2,rtText.Height);}this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);textRightPrev=textLeft+testWidth;}}}xPrev=x;}};//{Font:, AryText:[ { AryText:[{ Text:, Color: }], }, ] }
|
|
2685
|
+
this.GetMultiLineVTextSize=function(obj){if(obj.Font)this.Canvas.font=obj.Font;var lineHeight=this.Canvas.measureText('擎').width;var aryLine=[];for(var i=0;i<obj.AryText.length;++i){var item=obj.AryText[i];var lineInfo={Width:0,Height:lineHeight,AryText:[],Align:2,Margin:{Top:1,Bottom:1},YOffset:-1};if(item.Margin){if(IFrameSplitOperator.IsNumber(item.Margin.Top))lineInfo.Margin.Top=item.Margin.Top;if(IFrameSplitOperator.IsNumber(item.Margin.Bottom))lineInfo.Margin.Bottom=item.Margin.Bottom;}if(IFrameSplitOperator.IsNumber(item.YOffset))lineInfo.YOffset=item.YOffset;lineInfo.Height=lineHeight+lineInfo.Margin.Top+lineInfo.Margin.Bottom;for(var j=0;j<item.AryText.length;++j){var subItem=item.AryText[j];if(!subItem||!subItem.Text)continue;var width=this.Canvas.measureText(subItem.Text).width;var textItem={Width:width,Text:subItem.Text,Color:obj.TextColor,Margin:{Left:0,Right:0}};if(subItem.Color)textItem.Color=subItem.Color;if(subItem.Margin){if(IFrameSplitOperator.IsNumber(subItem.Margin.Left))textItem.Margin.Left=subItem.Margin.Left;if(IFrameSplitOperator.IsNumber(subItem.Margin.Right))textItem.Margin.Right=subItem.Margin.Right;}textItem.Width=width+textItem.Margin.Right+textItem.Margin.Left;lineInfo.Width+=textItem.Width;lineInfo.AryText.push(textItem);}aryLine.push(lineInfo);}if(aryLine.length<=0)return null;var width=0,height=0;for(var i=0;i<aryLine.length;++i){var item=aryLine[i];if(width<item.Width)width=item.Width;height+=item.Height;}if(width<=0||height<=0)return null;return{Width:width,Height:height,AryLine:aryLine,Align:2};//Align 1=left 2=center 3=right
|
|
2686
|
+
};//X轴底部文字多行输出
|
|
2687
|
+
this.DrawMultiLineVText=function(drawInfo){var xLeft=drawInfo.XCenter-drawInfo.Width/2;if(drawInfo.TextRightPrev!=null&&drawInfo.TextRightPrev>xLeft)return false;this.Canvas.font=drawInfo.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var yText=drawInfo.RectBottom.Top;var textRight=null;for(var i=0,j=0;i<drawInfo.AryLine.length;++i){var lineItem=drawInfo.AryLine[i];if(lineItem.Align==2)var xLeft=drawInfo.XCenter-lineItem.Width/2;if(xLeft<1)xLeft=1;yText+=lineItem.Height;for(j=0;j<lineItem.AryText.length;++j){var item=lineItem.AryText[j];this.Canvas.fillStyle=item.Color;this.Canvas.fillText(item.Text,xLeft+item.Margin.Left,yText+lineItem.YOffset);xLeft+=item.Width;}if(textRight==null||textRight<xLeft)textRight=xLeft;}drawInfo.TextRight=textRight;return true;};//Y坐标转y轴数值
|
|
2685
2688
|
this.GetYData=function(y,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromData){return this.GetYLogarithmicData(y);}if(this.CoordinateType==1)//反转坐标
|
|
2686
2689
|
{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轴数值
|
|
2687
2690
|
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轴坐标信息
|
|
@@ -12563,7 +12566,7 @@ if(IFrameSplitOperator.IsNumber(item.DrawVAlign))outVarItem.DrawVAlign=item.Draw
|
|
|
12563
12566
|
if(item.isexdata==true)outVarItem.IsExData=true;if(item.BreakPoint)outVarItem.BreakPoint=item.BreakPoint;if(item.UpColor)outVarItem.UpColor=item.UpColor;if(item.DownColor)outVarItem.DownColor=item.DownColor;if(IFrameSplitOperator.IsBool(item.isDotLine))outVarItem.IsDotLine=item.isDotLine;if(IFrameSplitOperator.IsNonEmptyArray(item.lineDash))outVarItem.LineDash=item.lineDash;if(IFrameSplitOperator.IsBool(item.isSingleLine))outVarItem.IsSingleLine=item.isSingleLine;if(IFrameSplitOperator.IsNumber(item.StickType))outVarItem.StickType=item.StickType;if(IFrameSplitOperator.IsNumber(item.BarColorType))outVarItem.BarColorType=item.BarColorType;if(IFrameSplitOperator.IsNonEmptyArray(item.AryBreakPoint))outVarItem.AryBreakPoint=item.AryBreakPoint;result.push(outVarItem);}else if(item.Draw){var draw=item.Draw;var drawItem={};if(draw.DrawType=='DRAWICON')//图标
|
|
12564
12567
|
{drawItem.Icon=draw.Icon;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart);outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='DRAWTEXT')//文本
|
|
12565
12568
|
{drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart);outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=="VERTLINE")//竖线
|
|
12566
|
-
{drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData={Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart)};outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='STICKLINE')//柱子
|
|
12569
|
+
{drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData={Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart)};outVarItem.Draw=drawItem;if(draw.Config){var config=draw.Config;if(IFrameSplitOperator.IsString(config.LineWidth))outVarItem.LineWidth=config.LineWidth;if(IFrameSplitOperator.IsNumber(config.LineType))drawItem.DrawData.LineType=config.LineType;if(config.Color)outVarItem.Color=config.Color;}result.push(outVarItem);}else if(draw.DrawType=='STICKLINE')//柱子
|
|
12567
12570
|
{drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.Width=draw.Width;drawItem.DrawType=draw.DrawType;drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart,1);outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=="DRAWBAND"){drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.DrawType=draw.DrawType;drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart,1);drawItem.Color=draw.Color;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='MULTI_LINE'){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData=this.FittingMultiLine(draw.DrawData,date,time,hqChart);if(IFrameSplitOperator.IsNonEmptyArray(drawItem.DrawData)){for(var k=0;k<drawItem.DrawData.length;++k){this.GetKLineData(drawItem.DrawData[k].Point,hqChart);}}outVarItem.Draw=drawItem;if(draw.LineDash)drawItem.LineDash=draw.LineDash;if(IFrameSplitOperator.IsBool(draw.IsFullRangeMaxMin))drawItem.IsFullRangeMaxMin=draw.IsFullRangeMaxMin;if(draw.Arrow)drawItem.Arrow=draw.Arrow;if(IFrameSplitOperator.IsNumber(draw.LineWidth))drawItem.LineWidth=draw.LineWidth;result.push(outVarItem);}else if(draw.DrawType=='MULTI_POINT'){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData=draw.DrawData;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='MULTI_BAR'){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData=draw.DrawData;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType==SCRIPT_CHART_NAME.OVERLAY_BARS){drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.DrawType=draw.DrawType;drawItem.BarName=draw.BarName;drawItem.BarColor=draw.BarColor;drawItem.LineWidth=draw.LineWidth;drawItem.BarType=draw.BarType;drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart,1);outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType==SCRIPT_CHART_NAME.SCATTER_PLOT){drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.DrawType=draw.DrawType;drawItem.DrawData=this.FittingArray(draw.DrawData,date,time,hqChart,1);//默认的值
|
|
12568
12571
|
drawItem.Color=draw.Color;drawItem.Radius=draw.Radius;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType==SCRIPT_CHART_NAME.SCATTER_PLOT_V2){drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.DrawType=draw.DrawType;drawItem.DrawData=draw.DrawData;drawItem.Config=draw.Config;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType==SCRIPT_CHART_NAME.KLINE_TABLE){drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.DrawType=draw.DrawType;drawItem.DrawData=draw.DrawData;drawItem.RowCount=draw.RowCount;drawItem.RowName=draw.RowName;drawItem.Config=draw.Config;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='MULTI_TEXT'){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData=draw.DrawData;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='MULTI_SVGICON'){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData={Icon:draw.DrawData.Icon,Family:draw.DrawData.Family};outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=='DRAWSVG'){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;if(draw.AutoPosition)drawItem.AutoPosition=draw.AutoPosition;drawItem.EnalbeDetailNoOverlap=draw.EnalbeDetailNoOverlap;drawItem.EnableClick=draw.EnableClick;if(draw.BuildKeyCallback)drawItem.BuildKeyCallback=draw.BuildKeyCallback;drawItem.DrawData={Data:draw.Data,Family:draw.Family,TextFont:draw.TextFont,EnableTooltip:draw.EnableTooltip,IsDrawFirst:draw.IsDrawFirst};outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=="DRAWTITLE"){drawItem.Name=draw.Name;drawItem.Type=draw.Type;drawItem.DrawType=draw.DrawType;drawItem.DrawData=draw.DrawData;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=="MULTI_HTMLDOM")//外部自己创建dom
|
|
12569
12572
|
{drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.Callback=draw.Callback;drawItem.DrawData=this.FittingMultiText(draw.DrawData,date,time,hqChart);this.GetKLineData(drawItem.DrawData,hqChart);outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=="COLOR_KLINE"){drawItem.Text=draw.Text;drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;var klineOption=this.FittingMultiText(draw.DrawData.KLine,date,time,hqChart);var mapKLineOption=new _map2.default();for(var i in klineOption){var item=klineOption[i];mapKLineOption.set(item.Index,item);}drawItem.DrawData={KLine:mapKLineOption};if(draw.Color)outVarItem.Color=draw.Color;outVarItem.Draw=drawItem;result.push(outVarItem);}else if(draw.DrawType=="KLINE_BG"){drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData={};drawItem.DrawData.Color=draw.Color;drawItem.DrawData.Angle=draw.Angle;if(draw.Ver==2.0)drawItem.DrawData.Data=this.FittingKLineBG_V2(draw.DrawData,hqChart);else drawItem.DrawData.Data=this.FittingKLineBG(draw.DrawData,hqChart);outVarItem.Draw=drawItem;outVarItem.Name=draw.DrawType;result.push(outVarItem);}else if(draw.DrawType=='MULTI_POINT_LINE'){drawItem.Name=draw.Name;drawItem.DrawType=draw.DrawType;drawItem.DrawData={};drawItem.DrawData.Color=draw.Color;drawItem.DrawData.PointRadius=draw.PointRadius;drawItem.DrawData.PointColor=draw.PointColor;drawItem.DrawData.LineWidth=draw.LineWidth;drawItem.DrawData.Data=this.FittingMultiPointLine(draw.DrawData,hqChart);outVarItem.Draw=drawItem;//outVarItem.Name=draw.DrawType;
|
|
@@ -15093,7 +15096,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15093
15096
|
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);};}/********************************************************************************
|
|
15094
15097
|
* 版本信息输出
|
|
15095
15098
|
*
|
|
15096
|
-
*/var HQCHART_VERSION="1.1.
|
|
15099
|
+
*/var HQCHART_VERSION="1.1.14863";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();//把给外界调用的方法暴露出来
|
|
15097
15100
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15098
15101
|
// BaseIndex:BaseIndex,
|
|
15099
15102
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -25226,7 +25226,15 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
25226
25226
|
drawItem.Name=draw.Name;
|
|
25227
25227
|
drawItem.DrawType=draw.DrawType;
|
|
25228
25228
|
drawItem.DrawData={ Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart) };
|
|
25229
|
+
|
|
25229
25230
|
outVarItem.Draw=drawItem;
|
|
25231
|
+
if (draw.Config)
|
|
25232
|
+
{
|
|
25233
|
+
var config=draw.Config;
|
|
25234
|
+
if (IFrameSplitOperator.IsString(config.LineWidth)) outVarItem.LineWidth=config.LineWidth;
|
|
25235
|
+
if (IFrameSplitOperator.IsNumber(config.LineType)) drawItem.DrawData.LineType=config.LineType;
|
|
25236
|
+
if (config.Color) outVarItem.Color=config.Color;
|
|
25237
|
+
}
|
|
25230
25238
|
|
|
25231
25239
|
result.push(outVarItem);
|
|
25232
25240
|
}
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -14423,98 +14423,118 @@ function AverageWidthFrame()
|
|
|
14423
14423
|
this.DrawDayVertical(item, x, border);
|
|
14424
14424
|
}
|
|
14425
14425
|
|
|
14426
|
-
if (
|
|
14426
|
+
if (item.Message[0]!=null && this.ChartBorder.Bottom>5*pixelRatio)
|
|
14427
14427
|
{
|
|
14428
|
-
if (
|
|
14429
|
-
|
|
14430
|
-
var textLeft=0;
|
|
14431
|
-
|
|
14432
|
-
this.Canvas.strokeStyle=item.TextColor;
|
|
14433
|
-
var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
|
|
14434
|
-
var textHeight=this.Canvas.measureText("擎").width;
|
|
14435
|
-
if (bottomTextExtend && bottomTextExtend.Align==1)
|
|
14428
|
+
if (IFrameSplitOperator.IsObject(item.Message[0]))
|
|
14436
14429
|
{
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
|
|
14430
|
+
var textObj=item.Message[0];
|
|
14431
|
+
if (!textObj.Font) textObj.Font=item.Font;
|
|
14432
|
+
if (!textObj.TextColor) textObj.TextColor=item.TextColor;
|
|
14433
|
+
var drawInfo=this.GetMultiLineVTextSize(textObj);
|
|
14434
|
+
if (drawInfo)
|
|
14435
|
+
{
|
|
14436
|
+
drawInfo.XCenter=x;
|
|
14437
|
+
var rtBottom={ Left:0, Right:right, Top:bottom+2*pixelRatio, Bottom:border.Height };
|
|
14438
|
+
rtBottom.Width=rtBottom.Right-rtBottom.Left;
|
|
14439
|
+
rtBottom.Height=rtBottom.Bottom-rtBottom.Top;
|
|
14440
|
+
drawInfo.RectBottom=rtBottom;
|
|
14441
|
+
drawInfo.TextRightPrev=textRightPrev;
|
|
14442
|
+
this.DrawMultiLineVText(drawInfo);
|
|
14443
|
+
if (drawInfo.TextRight) textRightPrev=drawInfo.TextRight;
|
|
14444
|
+
}
|
|
14440
14445
|
}
|
|
14441
14446
|
else
|
|
14442
14447
|
{
|
|
14443
|
-
if (
|
|
14448
|
+
if (item.Font) this.Canvas.font=item.Font;
|
|
14449
|
+
var textLeft=0;
|
|
14450
|
+
|
|
14451
|
+
this.Canvas.strokeStyle=item.TextColor;
|
|
14452
|
+
var testWidth=this.Canvas.measureText(item.Message[0]).width;
|
|
14453
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
14454
|
+
if (bottomTextExtend && bottomTextExtend.Align==1)
|
|
14444
14455
|
{
|
|
14445
14456
|
this.Canvas.textAlign="left";
|
|
14446
14457
|
this.Canvas.textBaseline="top";
|
|
14447
14458
|
textLeft=x;
|
|
14448
14459
|
}
|
|
14449
|
-
else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
|
|
14450
|
-
{
|
|
14451
|
-
this.Canvas.textAlign = "right";
|
|
14452
|
-
this.Canvas.textBaseline="top";
|
|
14453
|
-
textLeft=x-testWidth;
|
|
14454
|
-
}
|
|
14455
14460
|
else
|
|
14456
14461
|
{
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14462
|
+
if (x<testWidth/2)
|
|
14463
|
+
{
|
|
14464
|
+
this.Canvas.textAlign="left";
|
|
14465
|
+
this.Canvas.textBaseline="top";
|
|
14466
|
+
textLeft=x;
|
|
14467
|
+
}
|
|
14468
|
+
else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
|
|
14469
|
+
{
|
|
14470
|
+
this.Canvas.textAlign = "right";
|
|
14471
|
+
this.Canvas.textBaseline="top";
|
|
14472
|
+
textLeft=x-testWidth;
|
|
14473
|
+
}
|
|
14474
|
+
else
|
|
14475
|
+
{
|
|
14476
|
+
this.Canvas.textAlign="center";
|
|
14477
|
+
this.Canvas.textBaseline="top";
|
|
14478
|
+
textLeft=x-(testWidth/2);
|
|
14479
|
+
}
|
|
14460
14480
|
}
|
|
14461
|
-
}
|
|
14462
14481
|
|
|
14463
|
-
|
|
14464
|
-
{
|
|
14465
|
-
var yText=bottom;
|
|
14466
|
-
if (item.LineType==3)
|
|
14482
|
+
if (textRightPrev==null || textLeft>textRightPrev)
|
|
14467
14483
|
{
|
|
14468
|
-
var
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14484
|
+
var yText=bottom;
|
|
14485
|
+
if (item.LineType==3)
|
|
14486
|
+
{
|
|
14487
|
+
var lineLength=this.ShortXLineLength*pixelRatio;
|
|
14488
|
+
this.Canvas.beginPath();
|
|
14489
|
+
this.Canvas.moveTo(xFixed,yText);
|
|
14490
|
+
this.Canvas.lineTo(xFixed,yText+lineLength);
|
|
14491
|
+
this.Canvas.stroke();
|
|
14473
14492
|
|
|
14474
|
-
|
|
14475
|
-
|
|
14493
|
+
yText+=lineLength+2*pixelRatio;
|
|
14494
|
+
}
|
|
14476
14495
|
|
|
14477
|
-
|
|
14478
|
-
{
|
|
14479
|
-
if (bottomLineExtend.Mode===1)
|
|
14496
|
+
if (bottomLineExtend)
|
|
14480
14497
|
{
|
|
14481
|
-
if (
|
|
14498
|
+
if (bottomLineExtend.Mode===1)
|
|
14482
14499
|
{
|
|
14483
|
-
if (
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14500
|
+
if (item.Value>1)
|
|
14501
|
+
{
|
|
14502
|
+
if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
|
|
14503
|
+
this.Canvas.beginPath();
|
|
14504
|
+
this.Canvas.moveTo(xFixed,bottom);
|
|
14505
|
+
this.Canvas.lineTo(xFixed,border.ChartHeight);
|
|
14506
|
+
this.Canvas.stroke();
|
|
14507
|
+
x+=1;
|
|
14508
|
+
}
|
|
14489
14509
|
}
|
|
14490
|
-
|
|
14491
|
-
else if (bottomLineExtend.Mode===2)
|
|
14492
|
-
{
|
|
14493
|
-
if (bottomLineExtend.Width>=1)
|
|
14510
|
+
else if (bottomLineExtend.Mode===2)
|
|
14494
14511
|
{
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14512
|
+
if (bottomLineExtend.Width>=1)
|
|
14513
|
+
{
|
|
14514
|
+
var lineLength=bottomLineExtend.Width;
|
|
14515
|
+
if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
|
|
14516
|
+
this.Canvas.beginPath();
|
|
14517
|
+
this.Canvas.moveTo(xFixed,yText);
|
|
14518
|
+
this.Canvas.lineTo(xFixed,yText+lineLength);
|
|
14519
|
+
this.Canvas.stroke();
|
|
14520
|
+
|
|
14521
|
+
yText+=lineLength+2;
|
|
14522
|
+
}
|
|
14503
14523
|
}
|
|
14504
14524
|
}
|
|
14505
|
-
}
|
|
14506
14525
|
|
|
14507
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14526
|
+
//item.TextBGColor="rgb(0,255,0)";
|
|
14527
|
+
if (item.TextBGColor) //文字背景色
|
|
14528
|
+
{
|
|
14529
|
+
var rtText={ Left:textLeft, Top:yText+this.XBottomOffset, Width:testWidth, Height:textHeight };
|
|
14530
|
+
this.Canvas.fillStyle=item.TextBGColor;
|
|
14531
|
+
this.Canvas.fillRect(rtText.Left-1, rtText.Top, rtText.Width+2, rtText.Height);
|
|
14532
|
+
}
|
|
14514
14533
|
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14534
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
14535
|
+
this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);
|
|
14536
|
+
textRightPrev=textLeft+testWidth;
|
|
14537
|
+
}
|
|
14518
14538
|
}
|
|
14519
14539
|
}
|
|
14520
14540
|
|
|
@@ -14522,6 +14542,97 @@ function AverageWidthFrame()
|
|
|
14522
14542
|
}
|
|
14523
14543
|
}
|
|
14524
14544
|
|
|
14545
|
+
//{Font:, AryText:[ { AryText:[{ Text:, Color: }], }, ] }
|
|
14546
|
+
this.GetMultiLineVTextSize=function(obj)
|
|
14547
|
+
{
|
|
14548
|
+
if (obj.Font) this.Canvas.font=obj.Font;
|
|
14549
|
+
|
|
14550
|
+
var lineHeight=this.Canvas.measureText('擎').width;
|
|
14551
|
+
var aryLine=[];
|
|
14552
|
+
for(var i=0;i<obj.AryText.length;++i)
|
|
14553
|
+
{
|
|
14554
|
+
var item=obj.AryText[i];
|
|
14555
|
+
var lineInfo={ Width:0, Height:lineHeight, AryText:[], Align:2, Margin:{ Top:1, Bottom:1 } , YOffset:-1 };
|
|
14556
|
+
if (item.Margin)
|
|
14557
|
+
{
|
|
14558
|
+
if (IFrameSplitOperator.IsNumber(item.Margin.Top)) lineInfo.Margin.Top=item.Margin.Top;
|
|
14559
|
+
if (IFrameSplitOperator.IsNumber(item.Margin.Bottom)) lineInfo.Margin.Bottom=item.Margin.Bottom;
|
|
14560
|
+
}
|
|
14561
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) lineInfo.YOffset=item.YOffset;
|
|
14562
|
+
|
|
14563
|
+
lineInfo.Height=lineHeight+lineInfo.Margin.Top+lineInfo.Margin.Bottom;
|
|
14564
|
+
|
|
14565
|
+
for(var j=0; j<item.AryText.length; ++j)
|
|
14566
|
+
{
|
|
14567
|
+
var subItem=item.AryText[j];
|
|
14568
|
+
if (!subItem || !subItem.Text) continue;
|
|
14569
|
+
var width=this.Canvas.measureText(subItem.Text).width;
|
|
14570
|
+
var textItem={ Width: width, Text:subItem.Text, Color:obj.TextColor , Margin:{Left:0, Right:0 }};
|
|
14571
|
+
if (subItem.Color) textItem.Color=subItem.Color;
|
|
14572
|
+
if (subItem.Margin)
|
|
14573
|
+
{
|
|
14574
|
+
if (IFrameSplitOperator.IsNumber(subItem.Margin.Left)) textItem.Margin.Left=subItem.Margin.Left;
|
|
14575
|
+
if (IFrameSplitOperator.IsNumber(subItem.Margin.Right)) textItem.Margin.Right=subItem.Margin.Right;
|
|
14576
|
+
}
|
|
14577
|
+
textItem.Width=width+textItem.Margin.Right+textItem.Margin.Left;
|
|
14578
|
+
|
|
14579
|
+
lineInfo.Width+=textItem.Width;
|
|
14580
|
+
|
|
14581
|
+
lineInfo.AryText.push(textItem);
|
|
14582
|
+
}
|
|
14583
|
+
|
|
14584
|
+
aryLine.push(lineInfo);
|
|
14585
|
+
}
|
|
14586
|
+
|
|
14587
|
+
if (aryLine.length<=0) return null;
|
|
14588
|
+
|
|
14589
|
+
var width=0, height=0;
|
|
14590
|
+
for(var i=0;i<aryLine.length;++i)
|
|
14591
|
+
{
|
|
14592
|
+
var item=aryLine[i];
|
|
14593
|
+
if (width<item.Width) width=item.Width;
|
|
14594
|
+
height+=item.Height;
|
|
14595
|
+
}
|
|
14596
|
+
|
|
14597
|
+
if (width<=0 || height<=0) return null;
|
|
14598
|
+
|
|
14599
|
+
return { Width:width, Height:height, AryLine:aryLine, Align:2 }; //Align 1=left 2=center 3=right
|
|
14600
|
+
}
|
|
14601
|
+
|
|
14602
|
+
//X轴底部文字多行输出
|
|
14603
|
+
this.DrawMultiLineVText=function(drawInfo)
|
|
14604
|
+
{
|
|
14605
|
+
var xLeft=drawInfo.XCenter-drawInfo.Width/2;
|
|
14606
|
+
if (drawInfo.TextRightPrev!=null && drawInfo.TextRightPrev>xLeft)
|
|
14607
|
+
return false;
|
|
14608
|
+
|
|
14609
|
+
this.Canvas.font=drawInfo.Font;
|
|
14610
|
+
this.Canvas.textAlign="left";
|
|
14611
|
+
this.Canvas.textBaseline="bottom";
|
|
14612
|
+
var yText=drawInfo.RectBottom.Top;
|
|
14613
|
+
var textRight=null;
|
|
14614
|
+
for(var i=0, j=0;i<drawInfo.AryLine.length;++i)
|
|
14615
|
+
{
|
|
14616
|
+
var lineItem=drawInfo.AryLine[i];
|
|
14617
|
+
if (lineItem.Align==2)
|
|
14618
|
+
var xLeft=drawInfo.XCenter-lineItem.Width/2;
|
|
14619
|
+
if (xLeft<1) xLeft=1;
|
|
14620
|
+
yText+=lineItem.Height;
|
|
14621
|
+
for(j=0;j<lineItem.AryText.length;++j)
|
|
14622
|
+
{
|
|
14623
|
+
var item=lineItem.AryText[j];
|
|
14624
|
+
this.Canvas.fillStyle=item.Color;
|
|
14625
|
+
this.Canvas.fillText(item.Text,xLeft+item.Margin.Left,yText+lineItem.YOffset);
|
|
14626
|
+
xLeft+=item.Width;
|
|
14627
|
+
}
|
|
14628
|
+
|
|
14629
|
+
if (textRight==null || textRight<xLeft) textRight=xLeft;
|
|
14630
|
+
}
|
|
14631
|
+
|
|
14632
|
+
drawInfo.TextRight=textRight;
|
|
14633
|
+
return true;
|
|
14634
|
+
}
|
|
14635
|
+
|
|
14525
14636
|
//Y坐标转y轴数值
|
|
14526
14637
|
this.GetYData=function(y,isLimit)
|
|
14527
14638
|
{
|
|
@@ -18519,98 +18519,118 @@ function AverageWidthFrame()
|
|
|
18519
18519
|
this.DrawDayVertical(item, x, border);
|
|
18520
18520
|
}
|
|
18521
18521
|
|
|
18522
|
-
if (
|
|
18522
|
+
if (item.Message[0]!=null && this.ChartBorder.Bottom>5*pixelRatio)
|
|
18523
18523
|
{
|
|
18524
|
-
if (
|
|
18525
|
-
|
|
18526
|
-
var textLeft=0;
|
|
18527
|
-
|
|
18528
|
-
this.Canvas.strokeStyle=item.TextColor;
|
|
18529
|
-
var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
|
|
18530
|
-
var textHeight=this.Canvas.measureText("擎").width;
|
|
18531
|
-
if (bottomTextExtend && bottomTextExtend.Align==1)
|
|
18524
|
+
if (IFrameSplitOperator.IsObject(item.Message[0]))
|
|
18532
18525
|
{
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
|
|
18526
|
+
var textObj=item.Message[0];
|
|
18527
|
+
if (!textObj.Font) textObj.Font=item.Font;
|
|
18528
|
+
if (!textObj.TextColor) textObj.TextColor=item.TextColor;
|
|
18529
|
+
var drawInfo=this.GetMultiLineVTextSize(textObj);
|
|
18530
|
+
if (drawInfo)
|
|
18531
|
+
{
|
|
18532
|
+
drawInfo.XCenter=x;
|
|
18533
|
+
var rtBottom={ Left:0, Right:right, Top:bottom+2*pixelRatio, Bottom:border.Height };
|
|
18534
|
+
rtBottom.Width=rtBottom.Right-rtBottom.Left;
|
|
18535
|
+
rtBottom.Height=rtBottom.Bottom-rtBottom.Top;
|
|
18536
|
+
drawInfo.RectBottom=rtBottom;
|
|
18537
|
+
drawInfo.TextRightPrev=textRightPrev;
|
|
18538
|
+
this.DrawMultiLineVText(drawInfo);
|
|
18539
|
+
if (drawInfo.TextRight) textRightPrev=drawInfo.TextRight;
|
|
18540
|
+
}
|
|
18536
18541
|
}
|
|
18537
18542
|
else
|
|
18538
18543
|
{
|
|
18539
|
-
if (
|
|
18544
|
+
if (item.Font) this.Canvas.font=item.Font;
|
|
18545
|
+
var textLeft=0;
|
|
18546
|
+
|
|
18547
|
+
this.Canvas.strokeStyle=item.TextColor;
|
|
18548
|
+
var testWidth=this.Canvas.measureText(item.Message[0]).width;
|
|
18549
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
18550
|
+
if (bottomTextExtend && bottomTextExtend.Align==1)
|
|
18540
18551
|
{
|
|
18541
18552
|
this.Canvas.textAlign="left";
|
|
18542
18553
|
this.Canvas.textBaseline="top";
|
|
18543
18554
|
textLeft=x;
|
|
18544
18555
|
}
|
|
18545
|
-
else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
|
|
18546
|
-
{
|
|
18547
|
-
this.Canvas.textAlign = "right";
|
|
18548
|
-
this.Canvas.textBaseline="top";
|
|
18549
|
-
textLeft=x-testWidth;
|
|
18550
|
-
}
|
|
18551
18556
|
else
|
|
18552
18557
|
{
|
|
18553
|
-
|
|
18554
|
-
|
|
18555
|
-
|
|
18558
|
+
if (x<testWidth/2)
|
|
18559
|
+
{
|
|
18560
|
+
this.Canvas.textAlign="left";
|
|
18561
|
+
this.Canvas.textBaseline="top";
|
|
18562
|
+
textLeft=x;
|
|
18563
|
+
}
|
|
18564
|
+
else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
|
|
18565
|
+
{
|
|
18566
|
+
this.Canvas.textAlign = "right";
|
|
18567
|
+
this.Canvas.textBaseline="top";
|
|
18568
|
+
textLeft=x-testWidth;
|
|
18569
|
+
}
|
|
18570
|
+
else
|
|
18571
|
+
{
|
|
18572
|
+
this.Canvas.textAlign="center";
|
|
18573
|
+
this.Canvas.textBaseline="top";
|
|
18574
|
+
textLeft=x-(testWidth/2);
|
|
18575
|
+
}
|
|
18556
18576
|
}
|
|
18557
|
-
}
|
|
18558
18577
|
|
|
18559
|
-
|
|
18560
|
-
{
|
|
18561
|
-
var yText=bottom;
|
|
18562
|
-
if (item.LineType==3)
|
|
18578
|
+
if (textRightPrev==null || textLeft>textRightPrev)
|
|
18563
18579
|
{
|
|
18564
|
-
var
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18568
|
-
|
|
18580
|
+
var yText=bottom;
|
|
18581
|
+
if (item.LineType==3)
|
|
18582
|
+
{
|
|
18583
|
+
var lineLength=this.ShortXLineLength*pixelRatio;
|
|
18584
|
+
this.Canvas.beginPath();
|
|
18585
|
+
this.Canvas.moveTo(xFixed,yText);
|
|
18586
|
+
this.Canvas.lineTo(xFixed,yText+lineLength);
|
|
18587
|
+
this.Canvas.stroke();
|
|
18569
18588
|
|
|
18570
|
-
|
|
18571
|
-
|
|
18589
|
+
yText+=lineLength+2*pixelRatio;
|
|
18590
|
+
}
|
|
18572
18591
|
|
|
18573
|
-
|
|
18574
|
-
{
|
|
18575
|
-
if (bottomLineExtend.Mode===1)
|
|
18592
|
+
if (bottomLineExtend)
|
|
18576
18593
|
{
|
|
18577
|
-
if (
|
|
18594
|
+
if (bottomLineExtend.Mode===1)
|
|
18578
18595
|
{
|
|
18579
|
-
if (
|
|
18580
|
-
|
|
18581
|
-
|
|
18582
|
-
|
|
18583
|
-
|
|
18584
|
-
|
|
18596
|
+
if (item.Value>1)
|
|
18597
|
+
{
|
|
18598
|
+
if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
|
|
18599
|
+
this.Canvas.beginPath();
|
|
18600
|
+
this.Canvas.moveTo(xFixed,bottom);
|
|
18601
|
+
this.Canvas.lineTo(xFixed,border.ChartHeight);
|
|
18602
|
+
this.Canvas.stroke();
|
|
18603
|
+
x+=1;
|
|
18604
|
+
}
|
|
18585
18605
|
}
|
|
18586
|
-
|
|
18587
|
-
else if (bottomLineExtend.Mode===2)
|
|
18588
|
-
{
|
|
18589
|
-
if (bottomLineExtend.Width>=1)
|
|
18606
|
+
else if (bottomLineExtend.Mode===2)
|
|
18590
18607
|
{
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18608
|
+
if (bottomLineExtend.Width>=1)
|
|
18609
|
+
{
|
|
18610
|
+
var lineLength=bottomLineExtend.Width;
|
|
18611
|
+
if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
|
|
18612
|
+
this.Canvas.beginPath();
|
|
18613
|
+
this.Canvas.moveTo(xFixed,yText);
|
|
18614
|
+
this.Canvas.lineTo(xFixed,yText+lineLength);
|
|
18615
|
+
this.Canvas.stroke();
|
|
18616
|
+
|
|
18617
|
+
yText+=lineLength+2;
|
|
18618
|
+
}
|
|
18599
18619
|
}
|
|
18600
18620
|
}
|
|
18601
|
-
}
|
|
18602
18621
|
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
-
|
|
18622
|
+
//item.TextBGColor="rgb(0,255,0)";
|
|
18623
|
+
if (item.TextBGColor) //文字背景色
|
|
18624
|
+
{
|
|
18625
|
+
var rtText={ Left:textLeft, Top:yText+this.XBottomOffset, Width:testWidth, Height:textHeight };
|
|
18626
|
+
this.Canvas.fillStyle=item.TextBGColor;
|
|
18627
|
+
this.Canvas.fillRect(rtText.Left-1, rtText.Top, rtText.Width+2, rtText.Height);
|
|
18628
|
+
}
|
|
18610
18629
|
|
|
18611
|
-
|
|
18612
|
-
|
|
18613
|
-
|
|
18630
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
18631
|
+
this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);
|
|
18632
|
+
textRightPrev=textLeft+testWidth;
|
|
18633
|
+
}
|
|
18614
18634
|
}
|
|
18615
18635
|
}
|
|
18616
18636
|
|
|
@@ -18618,6 +18638,97 @@ function AverageWidthFrame()
|
|
|
18618
18638
|
}
|
|
18619
18639
|
}
|
|
18620
18640
|
|
|
18641
|
+
//{Font:, AryText:[ { AryText:[{ Text:, Color: }], }, ] }
|
|
18642
|
+
this.GetMultiLineVTextSize=function(obj)
|
|
18643
|
+
{
|
|
18644
|
+
if (obj.Font) this.Canvas.font=obj.Font;
|
|
18645
|
+
|
|
18646
|
+
var lineHeight=this.Canvas.measureText('擎').width;
|
|
18647
|
+
var aryLine=[];
|
|
18648
|
+
for(var i=0;i<obj.AryText.length;++i)
|
|
18649
|
+
{
|
|
18650
|
+
var item=obj.AryText[i];
|
|
18651
|
+
var lineInfo={ Width:0, Height:lineHeight, AryText:[], Align:2, Margin:{ Top:1, Bottom:1 } , YOffset:-1 };
|
|
18652
|
+
if (item.Margin)
|
|
18653
|
+
{
|
|
18654
|
+
if (IFrameSplitOperator.IsNumber(item.Margin.Top)) lineInfo.Margin.Top=item.Margin.Top;
|
|
18655
|
+
if (IFrameSplitOperator.IsNumber(item.Margin.Bottom)) lineInfo.Margin.Bottom=item.Margin.Bottom;
|
|
18656
|
+
}
|
|
18657
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) lineInfo.YOffset=item.YOffset;
|
|
18658
|
+
|
|
18659
|
+
lineInfo.Height=lineHeight+lineInfo.Margin.Top+lineInfo.Margin.Bottom;
|
|
18660
|
+
|
|
18661
|
+
for(var j=0; j<item.AryText.length; ++j)
|
|
18662
|
+
{
|
|
18663
|
+
var subItem=item.AryText[j];
|
|
18664
|
+
if (!subItem || !subItem.Text) continue;
|
|
18665
|
+
var width=this.Canvas.measureText(subItem.Text).width;
|
|
18666
|
+
var textItem={ Width: width, Text:subItem.Text, Color:obj.TextColor , Margin:{Left:0, Right:0 }};
|
|
18667
|
+
if (subItem.Color) textItem.Color=subItem.Color;
|
|
18668
|
+
if (subItem.Margin)
|
|
18669
|
+
{
|
|
18670
|
+
if (IFrameSplitOperator.IsNumber(subItem.Margin.Left)) textItem.Margin.Left=subItem.Margin.Left;
|
|
18671
|
+
if (IFrameSplitOperator.IsNumber(subItem.Margin.Right)) textItem.Margin.Right=subItem.Margin.Right;
|
|
18672
|
+
}
|
|
18673
|
+
textItem.Width=width+textItem.Margin.Right+textItem.Margin.Left;
|
|
18674
|
+
|
|
18675
|
+
lineInfo.Width+=textItem.Width;
|
|
18676
|
+
|
|
18677
|
+
lineInfo.AryText.push(textItem);
|
|
18678
|
+
}
|
|
18679
|
+
|
|
18680
|
+
aryLine.push(lineInfo);
|
|
18681
|
+
}
|
|
18682
|
+
|
|
18683
|
+
if (aryLine.length<=0) return null;
|
|
18684
|
+
|
|
18685
|
+
var width=0, height=0;
|
|
18686
|
+
for(var i=0;i<aryLine.length;++i)
|
|
18687
|
+
{
|
|
18688
|
+
var item=aryLine[i];
|
|
18689
|
+
if (width<item.Width) width=item.Width;
|
|
18690
|
+
height+=item.Height;
|
|
18691
|
+
}
|
|
18692
|
+
|
|
18693
|
+
if (width<=0 || height<=0) return null;
|
|
18694
|
+
|
|
18695
|
+
return { Width:width, Height:height, AryLine:aryLine, Align:2 }; //Align 1=left 2=center 3=right
|
|
18696
|
+
}
|
|
18697
|
+
|
|
18698
|
+
//X轴底部文字多行输出
|
|
18699
|
+
this.DrawMultiLineVText=function(drawInfo)
|
|
18700
|
+
{
|
|
18701
|
+
var xLeft=drawInfo.XCenter-drawInfo.Width/2;
|
|
18702
|
+
if (drawInfo.TextRightPrev!=null && drawInfo.TextRightPrev>xLeft)
|
|
18703
|
+
return false;
|
|
18704
|
+
|
|
18705
|
+
this.Canvas.font=drawInfo.Font;
|
|
18706
|
+
this.Canvas.textAlign="left";
|
|
18707
|
+
this.Canvas.textBaseline="bottom";
|
|
18708
|
+
var yText=drawInfo.RectBottom.Top;
|
|
18709
|
+
var textRight=null;
|
|
18710
|
+
for(var i=0, j=0;i<drawInfo.AryLine.length;++i)
|
|
18711
|
+
{
|
|
18712
|
+
var lineItem=drawInfo.AryLine[i];
|
|
18713
|
+
if (lineItem.Align==2)
|
|
18714
|
+
var xLeft=drawInfo.XCenter-lineItem.Width/2;
|
|
18715
|
+
if (xLeft<1) xLeft=1;
|
|
18716
|
+
yText+=lineItem.Height;
|
|
18717
|
+
for(j=0;j<lineItem.AryText.length;++j)
|
|
18718
|
+
{
|
|
18719
|
+
var item=lineItem.AryText[j];
|
|
18720
|
+
this.Canvas.fillStyle=item.Color;
|
|
18721
|
+
this.Canvas.fillText(item.Text,xLeft+item.Margin.Left,yText+lineItem.YOffset);
|
|
18722
|
+
xLeft+=item.Width;
|
|
18723
|
+
}
|
|
18724
|
+
|
|
18725
|
+
if (textRight==null || textRight<xLeft) textRight=xLeft;
|
|
18726
|
+
}
|
|
18727
|
+
|
|
18728
|
+
drawInfo.TextRight=textRight;
|
|
18729
|
+
return true;
|
|
18730
|
+
}
|
|
18731
|
+
|
|
18621
18732
|
//Y坐标转y轴数值
|
|
18622
18733
|
this.GetYData=function(y,isLimit)
|
|
18623
18734
|
{
|
|
@@ -132335,7 +132446,15 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
132335
132446
|
drawItem.Name=draw.Name;
|
|
132336
132447
|
drawItem.DrawType=draw.DrawType;
|
|
132337
132448
|
drawItem.DrawData={ Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart) };
|
|
132449
|
+
|
|
132338
132450
|
outVarItem.Draw=drawItem;
|
|
132451
|
+
if (draw.Config)
|
|
132452
|
+
{
|
|
132453
|
+
var config=draw.Config;
|
|
132454
|
+
if (IFrameSplitOperator.IsString(config.LineWidth)) outVarItem.LineWidth=config.LineWidth;
|
|
132455
|
+
if (IFrameSplitOperator.IsNumber(config.LineType)) drawItem.DrawData.LineType=config.LineType;
|
|
132456
|
+
if (config.Color) outVarItem.Color=config.Color;
|
|
132457
|
+
}
|
|
132339
132458
|
|
|
132340
132459
|
result.push(outVarItem);
|
|
132341
132460
|
}
|
|
@@ -150314,7 +150433,7 @@ function ScrollBarBGChart()
|
|
|
150314
150433
|
|
|
150315
150434
|
|
|
150316
150435
|
|
|
150317
|
-
var HQCHART_VERSION="1.1.
|
|
150436
|
+
var HQCHART_VERSION="1.1.14863";
|
|
150318
150437
|
|
|
150319
150438
|
function PrintHQChartVersion()
|
|
150320
150439
|
{
|
|
@@ -18563,98 +18563,118 @@ function AverageWidthFrame()
|
|
|
18563
18563
|
this.DrawDayVertical(item, x, border);
|
|
18564
18564
|
}
|
|
18565
18565
|
|
|
18566
|
-
if (
|
|
18566
|
+
if (item.Message[0]!=null && this.ChartBorder.Bottom>5*pixelRatio)
|
|
18567
18567
|
{
|
|
18568
|
-
if (
|
|
18569
|
-
|
|
18570
|
-
var textLeft=0;
|
|
18571
|
-
|
|
18572
|
-
this.Canvas.strokeStyle=item.TextColor;
|
|
18573
|
-
var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
|
|
18574
|
-
var textHeight=this.Canvas.measureText("擎").width;
|
|
18575
|
-
if (bottomTextExtend && bottomTextExtend.Align==1)
|
|
18568
|
+
if (IFrameSplitOperator.IsObject(item.Message[0]))
|
|
18576
18569
|
{
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18570
|
+
var textObj=item.Message[0];
|
|
18571
|
+
if (!textObj.Font) textObj.Font=item.Font;
|
|
18572
|
+
if (!textObj.TextColor) textObj.TextColor=item.TextColor;
|
|
18573
|
+
var drawInfo=this.GetMultiLineVTextSize(textObj);
|
|
18574
|
+
if (drawInfo)
|
|
18575
|
+
{
|
|
18576
|
+
drawInfo.XCenter=x;
|
|
18577
|
+
var rtBottom={ Left:0, Right:right, Top:bottom+2*pixelRatio, Bottom:border.Height };
|
|
18578
|
+
rtBottom.Width=rtBottom.Right-rtBottom.Left;
|
|
18579
|
+
rtBottom.Height=rtBottom.Bottom-rtBottom.Top;
|
|
18580
|
+
drawInfo.RectBottom=rtBottom;
|
|
18581
|
+
drawInfo.TextRightPrev=textRightPrev;
|
|
18582
|
+
this.DrawMultiLineVText(drawInfo);
|
|
18583
|
+
if (drawInfo.TextRight) textRightPrev=drawInfo.TextRight;
|
|
18584
|
+
}
|
|
18580
18585
|
}
|
|
18581
18586
|
else
|
|
18582
18587
|
{
|
|
18583
|
-
if (
|
|
18588
|
+
if (item.Font) this.Canvas.font=item.Font;
|
|
18589
|
+
var textLeft=0;
|
|
18590
|
+
|
|
18591
|
+
this.Canvas.strokeStyle=item.TextColor;
|
|
18592
|
+
var testWidth=this.Canvas.measureText(item.Message[0]).width;
|
|
18593
|
+
var textHeight=this.Canvas.measureText("擎").width;
|
|
18594
|
+
if (bottomTextExtend && bottomTextExtend.Align==1)
|
|
18584
18595
|
{
|
|
18585
18596
|
this.Canvas.textAlign="left";
|
|
18586
18597
|
this.Canvas.textBaseline="top";
|
|
18587
18598
|
textLeft=x;
|
|
18588
18599
|
}
|
|
18589
|
-
else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
|
|
18590
|
-
{
|
|
18591
|
-
this.Canvas.textAlign = "right";
|
|
18592
|
-
this.Canvas.textBaseline="top";
|
|
18593
|
-
textLeft=x-testWidth;
|
|
18594
|
-
}
|
|
18595
18600
|
else
|
|
18596
18601
|
{
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18602
|
+
if (x<testWidth/2)
|
|
18603
|
+
{
|
|
18604
|
+
this.Canvas.textAlign="left";
|
|
18605
|
+
this.Canvas.textBaseline="top";
|
|
18606
|
+
textLeft=x;
|
|
18607
|
+
}
|
|
18608
|
+
else if ((x + testWidth / 2) >= this.ChartBorder.GetChartWidth())
|
|
18609
|
+
{
|
|
18610
|
+
this.Canvas.textAlign = "right";
|
|
18611
|
+
this.Canvas.textBaseline="top";
|
|
18612
|
+
textLeft=x-testWidth;
|
|
18613
|
+
}
|
|
18614
|
+
else
|
|
18615
|
+
{
|
|
18616
|
+
this.Canvas.textAlign="center";
|
|
18617
|
+
this.Canvas.textBaseline="top";
|
|
18618
|
+
textLeft=x-(testWidth/2);
|
|
18619
|
+
}
|
|
18600
18620
|
}
|
|
18601
|
-
}
|
|
18602
18621
|
|
|
18603
|
-
|
|
18604
|
-
{
|
|
18605
|
-
var yText=bottom;
|
|
18606
|
-
if (item.LineType==3)
|
|
18622
|
+
if (textRightPrev==null || textLeft>textRightPrev)
|
|
18607
18623
|
{
|
|
18608
|
-
var
|
|
18609
|
-
|
|
18610
|
-
|
|
18611
|
-
|
|
18612
|
-
|
|
18624
|
+
var yText=bottom;
|
|
18625
|
+
if (item.LineType==3)
|
|
18626
|
+
{
|
|
18627
|
+
var lineLength=this.ShortXLineLength*pixelRatio;
|
|
18628
|
+
this.Canvas.beginPath();
|
|
18629
|
+
this.Canvas.moveTo(xFixed,yText);
|
|
18630
|
+
this.Canvas.lineTo(xFixed,yText+lineLength);
|
|
18631
|
+
this.Canvas.stroke();
|
|
18613
18632
|
|
|
18614
|
-
|
|
18615
|
-
|
|
18633
|
+
yText+=lineLength+2*pixelRatio;
|
|
18634
|
+
}
|
|
18616
18635
|
|
|
18617
|
-
|
|
18618
|
-
{
|
|
18619
|
-
if (bottomLineExtend.Mode===1)
|
|
18636
|
+
if (bottomLineExtend)
|
|
18620
18637
|
{
|
|
18621
|
-
if (
|
|
18638
|
+
if (bottomLineExtend.Mode===1)
|
|
18622
18639
|
{
|
|
18623
|
-
if (
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
18628
|
-
|
|
18640
|
+
if (item.Value>1)
|
|
18641
|
+
{
|
|
18642
|
+
if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
|
|
18643
|
+
this.Canvas.beginPath();
|
|
18644
|
+
this.Canvas.moveTo(xFixed,bottom);
|
|
18645
|
+
this.Canvas.lineTo(xFixed,border.ChartHeight);
|
|
18646
|
+
this.Canvas.stroke();
|
|
18647
|
+
x+=1;
|
|
18648
|
+
}
|
|
18629
18649
|
}
|
|
18630
|
-
|
|
18631
|
-
else if (bottomLineExtend.Mode===2)
|
|
18632
|
-
{
|
|
18633
|
-
if (bottomLineExtend.Width>=1)
|
|
18650
|
+
else if (bottomLineExtend.Mode===2)
|
|
18634
18651
|
{
|
|
18635
|
-
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
|
|
18640
|
-
|
|
18641
|
-
|
|
18642
|
-
|
|
18652
|
+
if (bottomLineExtend.Width>=1)
|
|
18653
|
+
{
|
|
18654
|
+
var lineLength=bottomLineExtend.Width;
|
|
18655
|
+
if (bottomLineExtend.Color) this.Canvas.strokeStyle=bottomLineExtend.Color;
|
|
18656
|
+
this.Canvas.beginPath();
|
|
18657
|
+
this.Canvas.moveTo(xFixed,yText);
|
|
18658
|
+
this.Canvas.lineTo(xFixed,yText+lineLength);
|
|
18659
|
+
this.Canvas.stroke();
|
|
18660
|
+
|
|
18661
|
+
yText+=lineLength+2;
|
|
18662
|
+
}
|
|
18643
18663
|
}
|
|
18644
18664
|
}
|
|
18645
|
-
}
|
|
18646
18665
|
|
|
18647
|
-
|
|
18648
|
-
|
|
18649
|
-
|
|
18650
|
-
|
|
18651
|
-
|
|
18652
|
-
|
|
18653
|
-
|
|
18666
|
+
//item.TextBGColor="rgb(0,255,0)";
|
|
18667
|
+
if (item.TextBGColor) //文字背景色
|
|
18668
|
+
{
|
|
18669
|
+
var rtText={ Left:textLeft, Top:yText+this.XBottomOffset, Width:testWidth, Height:textHeight };
|
|
18670
|
+
this.Canvas.fillStyle=item.TextBGColor;
|
|
18671
|
+
this.Canvas.fillRect(rtText.Left-1, rtText.Top, rtText.Width+2, rtText.Height);
|
|
18672
|
+
}
|
|
18654
18673
|
|
|
18655
|
-
|
|
18656
|
-
|
|
18657
|
-
|
|
18674
|
+
this.Canvas.fillStyle=item.TextColor;
|
|
18675
|
+
this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);
|
|
18676
|
+
textRightPrev=textLeft+testWidth;
|
|
18677
|
+
}
|
|
18658
18678
|
}
|
|
18659
18679
|
}
|
|
18660
18680
|
|
|
@@ -18662,6 +18682,97 @@ function AverageWidthFrame()
|
|
|
18662
18682
|
}
|
|
18663
18683
|
}
|
|
18664
18684
|
|
|
18685
|
+
//{Font:, AryText:[ { AryText:[{ Text:, Color: }], }, ] }
|
|
18686
|
+
this.GetMultiLineVTextSize=function(obj)
|
|
18687
|
+
{
|
|
18688
|
+
if (obj.Font) this.Canvas.font=obj.Font;
|
|
18689
|
+
|
|
18690
|
+
var lineHeight=this.Canvas.measureText('擎').width;
|
|
18691
|
+
var aryLine=[];
|
|
18692
|
+
for(var i=0;i<obj.AryText.length;++i)
|
|
18693
|
+
{
|
|
18694
|
+
var item=obj.AryText[i];
|
|
18695
|
+
var lineInfo={ Width:0, Height:lineHeight, AryText:[], Align:2, Margin:{ Top:1, Bottom:1 } , YOffset:-1 };
|
|
18696
|
+
if (item.Margin)
|
|
18697
|
+
{
|
|
18698
|
+
if (IFrameSplitOperator.IsNumber(item.Margin.Top)) lineInfo.Margin.Top=item.Margin.Top;
|
|
18699
|
+
if (IFrameSplitOperator.IsNumber(item.Margin.Bottom)) lineInfo.Margin.Bottom=item.Margin.Bottom;
|
|
18700
|
+
}
|
|
18701
|
+
if (IFrameSplitOperator.IsNumber(item.YOffset)) lineInfo.YOffset=item.YOffset;
|
|
18702
|
+
|
|
18703
|
+
lineInfo.Height=lineHeight+lineInfo.Margin.Top+lineInfo.Margin.Bottom;
|
|
18704
|
+
|
|
18705
|
+
for(var j=0; j<item.AryText.length; ++j)
|
|
18706
|
+
{
|
|
18707
|
+
var subItem=item.AryText[j];
|
|
18708
|
+
if (!subItem || !subItem.Text) continue;
|
|
18709
|
+
var width=this.Canvas.measureText(subItem.Text).width;
|
|
18710
|
+
var textItem={ Width: width, Text:subItem.Text, Color:obj.TextColor , Margin:{Left:0, Right:0 }};
|
|
18711
|
+
if (subItem.Color) textItem.Color=subItem.Color;
|
|
18712
|
+
if (subItem.Margin)
|
|
18713
|
+
{
|
|
18714
|
+
if (IFrameSplitOperator.IsNumber(subItem.Margin.Left)) textItem.Margin.Left=subItem.Margin.Left;
|
|
18715
|
+
if (IFrameSplitOperator.IsNumber(subItem.Margin.Right)) textItem.Margin.Right=subItem.Margin.Right;
|
|
18716
|
+
}
|
|
18717
|
+
textItem.Width=width+textItem.Margin.Right+textItem.Margin.Left;
|
|
18718
|
+
|
|
18719
|
+
lineInfo.Width+=textItem.Width;
|
|
18720
|
+
|
|
18721
|
+
lineInfo.AryText.push(textItem);
|
|
18722
|
+
}
|
|
18723
|
+
|
|
18724
|
+
aryLine.push(lineInfo);
|
|
18725
|
+
}
|
|
18726
|
+
|
|
18727
|
+
if (aryLine.length<=0) return null;
|
|
18728
|
+
|
|
18729
|
+
var width=0, height=0;
|
|
18730
|
+
for(var i=0;i<aryLine.length;++i)
|
|
18731
|
+
{
|
|
18732
|
+
var item=aryLine[i];
|
|
18733
|
+
if (width<item.Width) width=item.Width;
|
|
18734
|
+
height+=item.Height;
|
|
18735
|
+
}
|
|
18736
|
+
|
|
18737
|
+
if (width<=0 || height<=0) return null;
|
|
18738
|
+
|
|
18739
|
+
return { Width:width, Height:height, AryLine:aryLine, Align:2 }; //Align 1=left 2=center 3=right
|
|
18740
|
+
}
|
|
18741
|
+
|
|
18742
|
+
//X轴底部文字多行输出
|
|
18743
|
+
this.DrawMultiLineVText=function(drawInfo)
|
|
18744
|
+
{
|
|
18745
|
+
var xLeft=drawInfo.XCenter-drawInfo.Width/2;
|
|
18746
|
+
if (drawInfo.TextRightPrev!=null && drawInfo.TextRightPrev>xLeft)
|
|
18747
|
+
return false;
|
|
18748
|
+
|
|
18749
|
+
this.Canvas.font=drawInfo.Font;
|
|
18750
|
+
this.Canvas.textAlign="left";
|
|
18751
|
+
this.Canvas.textBaseline="bottom";
|
|
18752
|
+
var yText=drawInfo.RectBottom.Top;
|
|
18753
|
+
var textRight=null;
|
|
18754
|
+
for(var i=0, j=0;i<drawInfo.AryLine.length;++i)
|
|
18755
|
+
{
|
|
18756
|
+
var lineItem=drawInfo.AryLine[i];
|
|
18757
|
+
if (lineItem.Align==2)
|
|
18758
|
+
var xLeft=drawInfo.XCenter-lineItem.Width/2;
|
|
18759
|
+
if (xLeft<1) xLeft=1;
|
|
18760
|
+
yText+=lineItem.Height;
|
|
18761
|
+
for(j=0;j<lineItem.AryText.length;++j)
|
|
18762
|
+
{
|
|
18763
|
+
var item=lineItem.AryText[j];
|
|
18764
|
+
this.Canvas.fillStyle=item.Color;
|
|
18765
|
+
this.Canvas.fillText(item.Text,xLeft+item.Margin.Left,yText+lineItem.YOffset);
|
|
18766
|
+
xLeft+=item.Width;
|
|
18767
|
+
}
|
|
18768
|
+
|
|
18769
|
+
if (textRight==null || textRight<xLeft) textRight=xLeft;
|
|
18770
|
+
}
|
|
18771
|
+
|
|
18772
|
+
drawInfo.TextRight=textRight;
|
|
18773
|
+
return true;
|
|
18774
|
+
}
|
|
18775
|
+
|
|
18665
18776
|
//Y坐标转y轴数值
|
|
18666
18777
|
this.GetYData=function(y,isLimit)
|
|
18667
18778
|
{
|
|
@@ -132379,7 +132490,15 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
132379
132490
|
drawItem.Name=draw.Name;
|
|
132380
132491
|
drawItem.DrawType=draw.DrawType;
|
|
132381
132492
|
drawItem.DrawData={ Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart) };
|
|
132493
|
+
|
|
132382
132494
|
outVarItem.Draw=drawItem;
|
|
132495
|
+
if (draw.Config)
|
|
132496
|
+
{
|
|
132497
|
+
var config=draw.Config;
|
|
132498
|
+
if (IFrameSplitOperator.IsString(config.LineWidth)) outVarItem.LineWidth=config.LineWidth;
|
|
132499
|
+
if (IFrameSplitOperator.IsNumber(config.LineType)) drawItem.DrawData.LineType=config.LineType;
|
|
132500
|
+
if (config.Color) outVarItem.Color=config.Color;
|
|
132501
|
+
}
|
|
132383
132502
|
|
|
132384
132503
|
result.push(outVarItem);
|
|
132385
132504
|
}
|
|
@@ -161534,7 +161653,7 @@ function HQChartScriptWorker()
|
|
|
161534
161653
|
|
|
161535
161654
|
|
|
161536
161655
|
|
|
161537
|
-
var HQCHART_VERSION="1.1.
|
|
161656
|
+
var HQCHART_VERSION="1.1.14863";
|
|
161538
161657
|
|
|
161539
161658
|
function PrintHQChartVersion()
|
|
161540
161659
|
{
|