hqchart 1.1.13743 → 1.1.13746
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
|
@@ -4080,15 +4080,21 @@ this.newMethod();delete this.newMethod;this.ClassName="ChartMACD";this.UpColor=g
|
|
|
4080
4080
|
return this.PtInBar(x,y,{BarWidth:barWidth});};this.DrawBars=function(lineWidth,bUpBar){var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var isHSCreen=this.ChartFrame.IsHScreen===true;if(isHSCreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Top;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Left;}if(bUpBar)this.Canvas.strokeStyle=this.UpColor;else this.Canvas.strokeStyle=this.DownColor;var yBottom=this.ChartFrame.GetYFromData(0);this.Canvas.beginPath();var drawCount=0;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(bUpBar){if(value<0)continue;}else{if(value>=0)continue;}if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}if(x>chartright)break;var y=this.ChartFrame.GetYFromData(value);var xFix=ToFixedPoint2(lineWidth,x);//毛边修正
|
|
4081
4081
|
if(isHSCreen){this.Canvas.moveTo(yBottom,ToFixedPoint(x));this.Canvas.lineTo(y,ToFixedPoint(x));}else{this.Canvas.moveTo(xFix,yBottom);this.Canvas.lineTo(xFix,y);}++drawCount;}if(drawCount>0)this.Canvas.stroke();};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}var dataWidth=this.ChartFrame.DataWidth;var lineWidth=this.LineWidth*GetDevicePixelRatio();if(this.LineWidth==50)lineWidth=dataWidth;else if(lineWidth>dataWidth)lineWidth=dataWidth;var backupLineWidth=this.Canvas.lineWidth;this.Canvas.lineWidth=lineWidth;//上下分开画
|
|
4082
4082
|
this.DrawBars(lineWidth,true);this.DrawBars(lineWidth,false);this.Canvas.lineWidth=backupLineWidth;};this.GetItemData=function(indexData){if(!indexData)return null;if(!IFrameSplitOperator.IsNumber(indexData.Index))return null;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var index=indexData.Index;if(index<0||index>=this.Data.Data.length)return null;var item=this.Data.Data[index];return[{Value:item,Color:item>0?this.UpColor:this.DownColor,Name:this.Name}];};}function ChartClipColorStick(){this.newMethod=IChartPainting;//派生
|
|
4083
|
-
this.newMethod();delete this.newMethod;this.ClassName="ChartClipColorStick";this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.LineWidth=1
|
|
4084
|
-
|
|
4083
|
+
this.newMethod();delete this.newMethod;this.ClassName="ChartClipColorStick";this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.LineWidth=1;this.Style=0;//1=同方向 0=上下两个方向
|
|
4084
|
+
//差值线
|
|
4085
|
+
this.DownDiffColor=g_JSChartResource.DownBarColor;this.UpDiffColor=g_JSChartResource.UpBarColor;//文字
|
|
4086
|
+
this.TextLabelConfig={Font:12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',TextMargin:{Left:2,Right:2,Bottom:2,Top:2},TextColor:"rgb(230,230,230)",UpColor:"rgb(137,16,19)",DownColor:"rgb(44,104,57)",UnchangeColor:"rgb(111,112,115)",BorderColor:"rgb(0,0,0)",//缓存
|
|
4087
|
+
LabelWidth:0,TextHeight:0,MaxTextWidth:0};this.BaseLineColor;//基准线
|
|
4085
4088
|
this.BaseValue=0;this.Super_GetMaxMin=this.GetMaxMin;//父类的方法
|
|
4086
4089
|
this.ValueRange;//{ Max:, Min: } //固定最大最小值
|
|
4087
|
-
this.SetOption=function(option){if(!option)return;if(option.UpColor)this.UpColor=option.UpColor;if(option.DownColor)this.DownColor=option.DownColor;if(option.DownDiffColor)this.DownDiffColor=option.DownDiffColor;if(option.UpDiffColor)this.UpDiffColor=option.UpDiffColor;if(option.BaseLineColor)this.BaseLineColor=option.BaseLineColor;if(IFrameSplitOperator.IsNumber(option.BaseValue))this.BaseValue=option.BaseValue;if(option.ValueRange)this.ValueRange=option.ValueRange;};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}this.
|
|
4088
|
-
this.DrawBars(lineWidth,true);this.DrawBars(lineWidth,false);}this.Canvas.restore();};this.DrawBars=function(lineWidth,bUpBar){var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var
|
|
4089
|
-
if(
|
|
4090
|
+
this.IsShowText=false;this.SetOption=function(option){if(!option)return;if(option.UpColor)this.UpColor=option.UpColor;if(option.DownColor)this.DownColor=option.DownColor;if(option.DownDiffColor)this.DownDiffColor=option.DownDiffColor;if(option.UpDiffColor)this.UpDiffColor=option.UpDiffColor;if(option.BaseLineColor)this.BaseLineColor=option.BaseLineColor;if(IFrameSplitOperator.IsNumber(option.BaseValue))this.BaseValue=option.BaseValue;if(IFrameSplitOperator.IsNumber(option.Style))this.Style=option.Style;if(option.ValueRange)this.ValueRange=option.ValueRange;};this.Draw=function(){this.IsShowText=false;this.TextLabelConfig.LabelWidth=0;this.TextLabelConfig.TextHeight=0;this.TextLabelConfig.MaxTextWidth=0;if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var bHScreen=this.ChartFrame.IsHScreen===true;var lineWidth=this.LineWidth*GetDevicePixelRatio();if(this.LineWidth==50)lineWidth=dataWidth;else if(lineWidth>dataWidth)lineWidth=dataWidth;if(!bHScreen){var itemWidth=dataWidth+distanceWidth;var bMinute=this.IsMinuteFrame();if(bMinute){var border=this.ChartBorder.GetBorder();itemWidth=(border.Right-border.Left)/(xPointCount-1);}this.Canvas.font=this.TextLabelConfig.Font;this.TextLabelConfig.MaxTextWidth=this.Canvas.measureText("-888").width;this.TextLabelConfig.LabelWidth=this.TextLabelConfig.MaxTextWidth+this.TextLabelConfig.TextMargin.Left+this.TextLabelConfig.TextMargin.Right;this.IsShowText=itemWidth>this.TextLabelConfig.LabelWidth;this.TextLabelConfig.TextHeight=this.Canvas.measureText("擎").width;}this.Canvas.save();if(IFrameSplitOperator.IsNumber(this.BaseValue)&&this.BaseValue!=0){this.DrawBaseLine();if(this.BaseValue>0)this.DrawBars(lineWidth,true,true);else this.DrawBars(lineWidth,false,true);}else{//上下分开画
|
|
4091
|
+
this.DrawBars(lineWidth,true,true);this.DrawBars(lineWidth,false);}this.Canvas.restore();};this.DrawBars=function(lineWidth,bUpBar,bDrawLabel){var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var bHScreen=this.ChartFrame.IsHScreen===true;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Top;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Left;}var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);var aryBar=[],aryDiffBar=[],aryText=[];var preValue=null;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}if(x>chartright)break;var textItem={X:x,Value:value};if(IFrameSplitOperator.IsNumber(preValue))textItem.DiffValue=value-preValue;aryText.push(textItem);preValue=value;if(bUpBar){if(value<0)continue;}else{if(value>=0)continue;}var bDiffBar=false;var diffValue=null;if(this.BaseValue>0){if(value<this.BaseValue){bDiffBar=true;if(this.Style==1)diffValue=this.BaseValue+(this.BaseValue-value);else diffValue=this.BaseValue-(this.BaseValue-value);}}else if(this.BaseValue<0){if(value>this.BaseValue){bDiffBar=true;if(this.Style==1)diffValue=this.BaseValue-(value-this.BaseValue);else diffValue=this.BaseValue+(value-this.BaseValue);}}if(!bDiffBar){var y=this.ChartFrame.GetYFromData(value);aryBar.push({X:x,Y:y});}else{var y=this.ChartFrame.GetYFromData(diffValue);aryDiffBar.push({X:x,Y:y});}}this.Canvas.lineWidth=lineWidth;if(bUpBar)this.Canvas.strokeStyle=this.UpColor;else this.Canvas.strokeStyle=this.DownColor;this.DrawStick(aryBar,lineWidth,yBottom);if(this.BaseValue>0){this.Canvas.strokeStyle=this.UpDiffColor;this.DrawStick(aryDiffBar,lineWidth,yBottom);}else if(this.BaseValue<0){this.Canvas.strokeStyle=this.DownDiffColor;this.DrawStick(aryDiffBar,lineWidth,yBottom);}if(this.IsShowText&&bDrawLabel)this.DrawStickText(aryText);};this.DrawStick=function(aryData,lineWidth,yBottom){if(!IFrameSplitOperator.IsNonEmptyArray(aryData))return;var bHScreen=this.ChartFrame.IsHScreen===true;var drawCount=0;this.Canvas.beginPath();for(var i=0;i<aryData.length;++i){var item=aryData[i];var y=item.Y;var xFix=ToFixedPoint2(lineWidth,item.X);//毛边修正
|
|
4092
|
+
if(bHScreen){this.Canvas.moveTo(yBottom,ToFixedPoint(x));this.Canvas.lineTo(y,ToFixedPoint(x));}else{this.Canvas.moveTo(xFix,yBottom);this.Canvas.lineTo(xFix,y);}++drawCount;}if(drawCount>0)this.Canvas.stroke();};this.DrawBaseLine=function(){if(!IFrameSplitOperator.IsNumber(this.BaseValue)||this.BaseValue==0)return;if(!this.BaseLineColor)return;var bHScreen=this.ChartFrame.IsHScreen===true;var border=this.ChartFrame.GetBorder();var y=this.ChartFrame.GetYFromData(this.BaseValue);this.Canvas.strokeStyle=this.BaseLineColor;this.Canvas.lineWidth=1*GetDevicePixelRatio();if(bHScreen){}else{var yFix=ToFixedPoint(y);this.Canvas.beginPath();this.Canvas.moveTo(border.Left,yFix);this.Canvas.lineTo(border.Right,yFix);this.Canvas.stroke();}};this.DrawStickText=function(aryData){var config=this.TextLabelConfig;this.Canvas.font=config.Font;var border=this.ChartBorder.GetBorder();var itemHeight=config.TextHeight*2+config.TextMargin.Bottom+config.TextMargin.Top;for(var i=0;i<aryData.length;++i){var item=aryData[i];var value=item.Value;var xCenter=item.X;var xLeft=xCenter-config.LabelWidth/2;var rtDraw={Left:xLeft,Width:config.LabelWidth,Top:border.BottomEx+1,Height:itemHeight};rtDraw.Right=rtDraw.Left+rtDraw.Width;rtDraw.Bottom=rtDraw.Top+rtDraw.Height;if(IFrameSplitOperator.IsNumber(value)){var bgColor=config.UnchangeColor;if(value>0)bgColor=config.UpColor;else if(value<0)bgColor=config.DownColor;this.DrawTextLabel(value,bgColor,config.BorderColor,config.TextColor,rtDraw,config.TextHeight,config.MaxTextWidth,config.TextMargin);}var value=item.DiffValue;var rtDraw={Left:xLeft,Width:config.LabelWidth,Bottom:border.TopEx-1,Height:itemHeight};rtDraw.Right=rtDraw.Left+rtDraw.Width;rtDraw.Top=rtDraw.Bottom-rtDraw.Height;if(IFrameSplitOperator.IsNumber(value)){var bgColor=config.UnchangeColor;if(value>0)bgColor=config.UpColor;else if(value<0)bgColor=config.DownColor;this.DrawTextLabel(value,bgColor,config.BorderColor,config.TextColor,rtDraw,config.TextHeight,config.MaxTextWidth,config.TextMargin);}}};//数值标签
|
|
4093
|
+
this.DrawTextLabel=function(value,clrGB,clrBorder,clrText,rtDraw,textHeight,textWidth,textMargin){if(clrGB){this.Canvas.fillStyle=clrGB;this.Canvas.fillRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}if(clrBorder){this.Canvas.lineWidth=2;this.Canvas.strokeStyle=clrBorder;this.Canvas.strokeRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}else{this.Canvas.lineWidth=1;this.Canvas.strokeStyle="rgb(0,0,0)";this.Canvas.strokeRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}var aryText=[null,null];//大于3位数的 2行输出
|
|
4094
|
+
var sign="";//负数
|
|
4095
|
+
if(value<0){value=Math.abs(value);sign='-';}if(value>999){var thousand=parseInt(value/1000);var hundred=parseInt(value%1000);aryText[0]=''+sign+thousand;aryText[1]=''+hundred;if(hundred<10)aryText[1]='00'+hundred;else if(hundred<100)aryText[1]='0'+hundred;}else{aryText[1]=''+sign+value.toFixed(0);}this.Canvas.textAlign="right";this.Canvas.textBaseline="top";var xRight=rtDraw.Right-(rtDraw.Right-rtDraw.Left-textWidth)/2;this.Canvas.fillStyle=clrText;var yText=textMargin.Top+rtDraw.Top;for(var i=0;i<aryText.length;++i){var text=aryText[i];if(text){this.Canvas.fillText(text,xRight,yText);}yText+=textHeight;}};this.GetMaxMin=function(){if(!IFrameSplitOperator.IsNumber(this.BaseValue)||this.BaseValue==0)return this.Super_GetMaxMin();if(this.ValueRange)//固定最大最小
|
|
4090
4096
|
{var range={Min:this.ValueRange.Min,Max:this.ValueRange.Max};return range;}var xPointCount=this.ChartFrame.XPointCount;var start=this.Data.DataOffset;if(this.ChartFrame.GlobalOption&&this.ChartFrame.GlobalOption.IsValueFullRange){start=0;xPointCount=this.Data.Data.length;}var range={Min:null,Max:null},maxDiffValue=null;//基准值的差值
|
|
4091
|
-
if(!this.Data||!this.Data.Data)return range;if(this.BaseValue>0)range.Min=this.BaseValue;else range.Max=this.BaseValue;for(var i=start,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var value=this.Data.Data[i];if(value==null||isNaN(value))continue;if(this.BaseValue>0){if(value<0)continue;if(value<this.BaseValue){var diffValue=this.BaseValue-value;if(maxDiffValue==null||maxDiffValue<diffValue)maxDiffValue=diffValue;continue;}}else{if(value>0)continue;if(value>this.BaseValue){var diffValue=value-this.BaseValue;if(maxDiffValue==null||maxDiffValue<diffValue)maxDiffValue=diffValue;continue;}}if(range.Max==null)range.Max=value;if(range.Min==null)range.Min=value;if(range.Max<value)range.Max=value;if(range.Min>value)range.Min=value;}if(this.BaseValue>0){if(IFrameSplitOperator.IsNumber(maxDiffValue)&&IFrameSplitOperator.IsNumber(range.Min))range.Min-=maxDiffValue;}else{if(IFrameSplitOperator.IsNumber(maxDiffValue)&&IFrameSplitOperator.IsNumber(range.Max))range.Max+=maxDiffValue;}return range;};}//柱子
|
|
4097
|
+
if(!this.Data||!this.Data.Data)return range;if(this.BaseValue>0)range.Min=this.BaseValue;else range.Max=this.BaseValue;for(var i=start,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var value=this.Data.Data[i];if(value==null||isNaN(value))continue;if(this.BaseValue>0){if(value<0)continue;if(value<this.BaseValue){var diffValue=this.BaseValue-value;if(maxDiffValue==null||maxDiffValue<diffValue)maxDiffValue=diffValue;continue;}}else{if(value>0)continue;if(value>this.BaseValue){var diffValue=value-this.BaseValue;if(maxDiffValue==null||maxDiffValue<diffValue)maxDiffValue=diffValue;continue;}}if(range.Max==null)range.Max=value;if(range.Min==null)range.Min=value;if(range.Max<value)range.Max=value;if(range.Min>value)range.Min=value;}if(this.BaseValue>0){if(this.Style==1){if(IFrameSplitOperator.IsNumber(maxDiffValue)){var value=this.BaseValue+maxDiffValue;if(IFrameSplitOperator.IsNumber(range.Max)||range.Max<value)range.Max=value;}}else{if(IFrameSplitOperator.IsNumber(maxDiffValue)&&IFrameSplitOperator.IsNumber(range.Min))range.Min-=maxDiffValue;}}else{if(this.Style==1){if(IFrameSplitOperator.IsNumber(maxDiffValue)){var value=this.BaseValue-maxDiffValue;if(IFrameSplitOperator.IsNumber(range.Min)||range.Min>value)range.Min=value;}}else{if(IFrameSplitOperator.IsNumber(maxDiffValue)&&IFrameSplitOperator.IsNumber(range.Max))range.Max+=maxDiffValue;}}return range;};}//柱子
|
|
4092
4098
|
function ChartBar(){this.newMethod=IChartPainting;//派生
|
|
4093
4099
|
this.newMethod();delete this.newMethod;this.ClassName="ChartBar";this.UpBarColor=g_JSChartResource.UpBarColor;this.DownBarColor=g_JSChartResource.DownBarColor;this.Draw=function(){if(this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var chartright=this.ChartBorder.GetRight();var xPointCount=this.ChartFrame.XPointCount;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+2.0;var bFirstPoint=true;var drawCount=0;var yBottom=this.ChartFrame.GetYFromData(0);if(dataWidth>=4){yBottom=ToFixedRect(yBottom);//调整为整数
|
|
4094
4100
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null||value==0)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=this.ChartFrame.GetXFromIndex(j);var y=this.ChartFrame.GetYFromData(value);if(value>0)this.Canvas.fillStyle=this.UpBarColor;else this.Canvas.fillStyle=this.DownBarColor;//高度调整为整数
|
|
@@ -13780,7 +13786,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13780
13786
|
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);};}/********************************************************************************
|
|
13781
13787
|
* 版本信息输出
|
|
13782
13788
|
*
|
|
13783
|
-
*/var HQCHART_VERSION="1.1.
|
|
13789
|
+
*/var HQCHART_VERSION="1.1.13745";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();//把给外界调用的方法暴露出来
|
|
13784
13790
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13785
13791
|
// BaseIndex:BaseIndex,
|
|
13786
13792
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -36046,16 +36046,38 @@ function ChartClipColorStick()
|
|
|
36046
36046
|
this.UpColor=g_JSChartResource.UpBarColor;
|
|
36047
36047
|
this.DownColor=g_JSChartResource.DownBarColor;
|
|
36048
36048
|
this.LineWidth=1;
|
|
36049
|
+
this.Style=0; //1=同方向 0=上下两个方向
|
|
36050
|
+
|
|
36049
36051
|
//差值线
|
|
36050
36052
|
this.DownDiffColor=g_JSChartResource.DownBarColor;
|
|
36051
36053
|
this.UpDiffColor=g_JSChartResource.UpBarColor;
|
|
36052
36054
|
|
|
36055
|
+
//文字
|
|
36056
|
+
this.TextLabelConfig=
|
|
36057
|
+
{
|
|
36058
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
36059
|
+
TextMargin:{ Left:2, Right:2, Bottom:2, Top:2 },
|
|
36060
|
+
TextColor:"rgb(230,230,230)",
|
|
36061
|
+
UpColor:"rgb(137,16,19)",
|
|
36062
|
+
DownColor:"rgb(44,104,57)",
|
|
36063
|
+
UnchangeColor:"rgb(111,112,115)",
|
|
36064
|
+
BorderColor:"rgb(0,0,0)",
|
|
36065
|
+
|
|
36066
|
+
//缓存
|
|
36067
|
+
LabelWidth:0,
|
|
36068
|
+
TextHeight:0,
|
|
36069
|
+
MaxTextWidth:0,
|
|
36070
|
+
}
|
|
36071
|
+
|
|
36053
36072
|
this.BaseLineColor; //基准线
|
|
36054
36073
|
|
|
36055
36074
|
this.BaseValue=0;
|
|
36056
36075
|
this.Super_GetMaxMin=this.GetMaxMin; //父类的方法
|
|
36057
36076
|
this.ValueRange; //{ Max:, Min: } //固定最大最小值
|
|
36058
36077
|
|
|
36078
|
+
this.IsShowText=false;
|
|
36079
|
+
|
|
36080
|
+
|
|
36059
36081
|
this.SetOption=function(option)
|
|
36060
36082
|
{
|
|
36061
36083
|
if (!option) return;
|
|
@@ -36066,11 +36088,18 @@ function ChartClipColorStick()
|
|
|
36066
36088
|
if (option.UpDiffColor) this.UpDiffColor=option.UpDiffColor;
|
|
36067
36089
|
if (option.BaseLineColor) this.BaseLineColor=option.BaseLineColor;
|
|
36068
36090
|
if (IFrameSplitOperator.IsNumber(option.BaseValue)) this.BaseValue=option.BaseValue;
|
|
36091
|
+
if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
|
|
36069
36092
|
if (option.ValueRange) this.ValueRange=option.ValueRange;
|
|
36093
|
+
|
|
36070
36094
|
}
|
|
36071
36095
|
|
|
36072
36096
|
this.Draw=function()
|
|
36073
36097
|
{
|
|
36098
|
+
this.IsShowText=false;
|
|
36099
|
+
this.TextLabelConfig.LabelWidth=0;
|
|
36100
|
+
this.TextLabelConfig.TextHeight=0;
|
|
36101
|
+
this.TextLabelConfig.MaxTextWidth=0;
|
|
36102
|
+
|
|
36074
36103
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
36075
36104
|
if (this.IsShowIndexTitleOnly()) return;
|
|
36076
36105
|
if (this.IsHideScriptIndex()) return;
|
|
@@ -36081,23 +36110,44 @@ function ChartClipColorStick()
|
|
|
36081
36110
|
return;
|
|
36082
36111
|
}
|
|
36083
36112
|
|
|
36084
|
-
this.Canvas.save();
|
|
36085
36113
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
36114
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
36115
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
36116
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
36117
|
+
|
|
36086
36118
|
var lineWidth=this.LineWidth*GetDevicePixelRatio();
|
|
36087
36119
|
if (this.LineWidth==50) lineWidth=dataWidth;
|
|
36088
36120
|
else if (lineWidth>dataWidth) lineWidth=dataWidth;
|
|
36089
|
-
|
|
36121
|
+
|
|
36122
|
+
if (!bHScreen)
|
|
36123
|
+
{
|
|
36124
|
+
var itemWidth=dataWidth+distanceWidth;
|
|
36125
|
+
var bMinute=this.IsMinuteFrame();
|
|
36126
|
+
if (bMinute)
|
|
36127
|
+
{
|
|
36128
|
+
var border=this.ChartBorder.GetBorder();
|
|
36129
|
+
itemWidth=(border.Right-border.Left)/(xPointCount-1);
|
|
36130
|
+
}
|
|
36131
|
+
|
|
36132
|
+
this.Canvas.font=this.TextLabelConfig.Font;
|
|
36133
|
+
this.TextLabelConfig.MaxTextWidth=this.Canvas.measureText("-888").width;
|
|
36134
|
+
this.TextLabelConfig.LabelWidth=this.TextLabelConfig.MaxTextWidth+this.TextLabelConfig.TextMargin.Left+this.TextLabelConfig.TextMargin.Right;
|
|
36135
|
+
this.IsShowText=itemWidth>this.TextLabelConfig.LabelWidth;
|
|
36136
|
+
this.TextLabelConfig.TextHeight=this.Canvas.measureText("擎").width;
|
|
36137
|
+
}
|
|
36138
|
+
|
|
36139
|
+
this.Canvas.save();
|
|
36090
36140
|
if (IFrameSplitOperator.IsNumber(this.BaseValue) && this.BaseValue!=0)
|
|
36091
36141
|
{
|
|
36092
36142
|
this.DrawBaseLine();
|
|
36093
36143
|
|
|
36094
|
-
if (this.BaseValue>0) this.DrawBars(lineWidth, true);
|
|
36095
|
-
else this.DrawBars(lineWidth, false);
|
|
36144
|
+
if (this.BaseValue>0) this.DrawBars(lineWidth, true, true);
|
|
36145
|
+
else this.DrawBars(lineWidth, false, true);
|
|
36096
36146
|
}
|
|
36097
36147
|
else
|
|
36098
36148
|
{
|
|
36099
36149
|
//上下分开画
|
|
36100
|
-
this.DrawBars(lineWidth, true);
|
|
36150
|
+
this.DrawBars(lineWidth, true, true);
|
|
36101
36151
|
this.DrawBars(lineWidth, false);
|
|
36102
36152
|
}
|
|
36103
36153
|
|
|
@@ -36105,15 +36155,15 @@ function ChartClipColorStick()
|
|
|
36105
36155
|
this.Canvas.restore();
|
|
36106
36156
|
}
|
|
36107
36157
|
|
|
36108
|
-
this.DrawBars=function(lineWidth, bUpBar)
|
|
36158
|
+
this.DrawBars=function(lineWidth, bUpBar, bDrawLabel)
|
|
36109
36159
|
{
|
|
36110
36160
|
var isMinute=this.IsMinuteFrame();
|
|
36111
36161
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
36112
36162
|
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
36113
36163
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
36114
|
-
var
|
|
36164
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
36115
36165
|
|
|
36116
|
-
if (
|
|
36166
|
+
if (bHScreen)
|
|
36117
36167
|
{
|
|
36118
36168
|
var border=this.ChartBorder.GetHScreenBorder();
|
|
36119
36169
|
var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
@@ -36132,19 +36182,12 @@ function ChartClipColorStick()
|
|
|
36132
36182
|
}
|
|
36133
36183
|
|
|
36134
36184
|
var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
36135
|
-
var aryBar=[], aryDiffBar=[];
|
|
36185
|
+
var aryBar=[], aryDiffBar=[], aryText=[];
|
|
36186
|
+
var preValue=null;
|
|
36136
36187
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
36137
36188
|
{
|
|
36138
36189
|
var value=this.Data.Data[i];
|
|
36139
36190
|
if (value==null) continue;
|
|
36140
|
-
if (bUpBar)
|
|
36141
|
-
{
|
|
36142
|
-
if (value<0) continue;
|
|
36143
|
-
}
|
|
36144
|
-
else
|
|
36145
|
-
{
|
|
36146
|
-
if (value>=0) continue;
|
|
36147
|
-
}
|
|
36148
36191
|
|
|
36149
36192
|
if (isMinute)
|
|
36150
36193
|
{
|
|
@@ -36160,6 +36203,21 @@ function ChartClipColorStick()
|
|
|
36160
36203
|
|
|
36161
36204
|
if (x>chartright) break;
|
|
36162
36205
|
|
|
36206
|
+
var textItem={ X:x, Value:value };
|
|
36207
|
+
if (IFrameSplitOperator.IsNumber(preValue)) textItem.DiffValue=value-preValue;
|
|
36208
|
+
aryText.push(textItem);
|
|
36209
|
+
|
|
36210
|
+
preValue=value;
|
|
36211
|
+
|
|
36212
|
+
if (bUpBar)
|
|
36213
|
+
{
|
|
36214
|
+
if (value<0) continue;
|
|
36215
|
+
}
|
|
36216
|
+
else
|
|
36217
|
+
{
|
|
36218
|
+
if (value>=0) continue;
|
|
36219
|
+
}
|
|
36220
|
+
|
|
36163
36221
|
var bDiffBar=false;
|
|
36164
36222
|
var diffValue=null;
|
|
36165
36223
|
if (this.BaseValue>0)
|
|
@@ -36167,7 +36225,10 @@ function ChartClipColorStick()
|
|
|
36167
36225
|
if (value<this.BaseValue)
|
|
36168
36226
|
{
|
|
36169
36227
|
bDiffBar=true;
|
|
36170
|
-
|
|
36228
|
+
if (this.Style==1)
|
|
36229
|
+
diffValue=this.BaseValue+(this.BaseValue-value);
|
|
36230
|
+
else
|
|
36231
|
+
diffValue=this.BaseValue-(this.BaseValue-value);
|
|
36171
36232
|
}
|
|
36172
36233
|
}
|
|
36173
36234
|
else if (this.BaseValue<0)
|
|
@@ -36175,19 +36236,22 @@ function ChartClipColorStick()
|
|
|
36175
36236
|
if (value>this.BaseValue)
|
|
36176
36237
|
{
|
|
36177
36238
|
bDiffBar=true;
|
|
36178
|
-
|
|
36239
|
+
if (this.Style==1)
|
|
36240
|
+
diffValue=this.BaseValue-(value-this.BaseValue);
|
|
36241
|
+
else
|
|
36242
|
+
diffValue=this.BaseValue+(value-this.BaseValue)
|
|
36179
36243
|
}
|
|
36180
36244
|
}
|
|
36181
36245
|
|
|
36182
36246
|
if (!bDiffBar)
|
|
36183
36247
|
{
|
|
36184
36248
|
var y=this.ChartFrame.GetYFromData(value);
|
|
36185
|
-
aryBar.push({X:x, Y:y});
|
|
36249
|
+
aryBar.push({X:x, Y:y });
|
|
36186
36250
|
}
|
|
36187
36251
|
else
|
|
36188
36252
|
{
|
|
36189
36253
|
var y=this.ChartFrame.GetYFromData(diffValue);
|
|
36190
|
-
aryDiffBar.push({X:x, Y:y});
|
|
36254
|
+
aryDiffBar.push({X:x, Y:y });
|
|
36191
36255
|
}
|
|
36192
36256
|
}
|
|
36193
36257
|
|
|
@@ -36196,6 +36260,7 @@ function ChartClipColorStick()
|
|
|
36196
36260
|
else this.Canvas.strokeStyle=this.DownColor;
|
|
36197
36261
|
|
|
36198
36262
|
this.DrawStick(aryBar,lineWidth,yBottom);
|
|
36263
|
+
|
|
36199
36264
|
|
|
36200
36265
|
if (this.BaseValue>0)
|
|
36201
36266
|
{
|
|
@@ -36208,13 +36273,14 @@ function ChartClipColorStick()
|
|
|
36208
36273
|
this.DrawStick(aryDiffBar,lineWidth,yBottom);
|
|
36209
36274
|
}
|
|
36210
36275
|
|
|
36276
|
+
if (this.IsShowText && bDrawLabel) this.DrawStickText(aryText);
|
|
36211
36277
|
}
|
|
36212
36278
|
|
|
36213
36279
|
this.DrawStick=function(aryData, lineWidth, yBottom)
|
|
36214
36280
|
{
|
|
36215
36281
|
if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) return;
|
|
36216
36282
|
|
|
36217
|
-
var
|
|
36283
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
36218
36284
|
var drawCount=0;
|
|
36219
36285
|
this.Canvas.beginPath();
|
|
36220
36286
|
for(var i=0; i<aryData.length; ++i)
|
|
@@ -36223,7 +36289,7 @@ function ChartClipColorStick()
|
|
|
36223
36289
|
var y=item.Y;
|
|
36224
36290
|
var xFix=ToFixedPoint2(lineWidth, item.X); //毛边修正
|
|
36225
36291
|
|
|
36226
|
-
if (
|
|
36292
|
+
if (bHScreen)
|
|
36227
36293
|
{
|
|
36228
36294
|
this.Canvas.moveTo(yBottom,ToFixedPoint(x));
|
|
36229
36295
|
this.Canvas.lineTo(y,ToFixedPoint(x));
|
|
@@ -36245,14 +36311,14 @@ function ChartClipColorStick()
|
|
|
36245
36311
|
if (!IFrameSplitOperator.IsNumber(this.BaseValue) || this.BaseValue==0) return;
|
|
36246
36312
|
if (!this.BaseLineColor) return;
|
|
36247
36313
|
|
|
36248
|
-
var
|
|
36314
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
36249
36315
|
var border=this.ChartFrame.GetBorder();
|
|
36250
36316
|
var y=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
36251
36317
|
|
|
36252
36318
|
this.Canvas.strokeStyle=this.BaseLineColor;
|
|
36253
36319
|
this.Canvas.lineWidth=1*GetDevicePixelRatio();
|
|
36254
36320
|
|
|
36255
|
-
if (
|
|
36321
|
+
if (bHScreen)
|
|
36256
36322
|
{
|
|
36257
36323
|
|
|
36258
36324
|
}
|
|
@@ -36266,6 +36332,107 @@ function ChartClipColorStick()
|
|
|
36266
36332
|
}
|
|
36267
36333
|
}
|
|
36268
36334
|
|
|
36335
|
+
this.DrawStickText=function(aryData)
|
|
36336
|
+
{
|
|
36337
|
+
var config=this.TextLabelConfig;
|
|
36338
|
+
this.Canvas.font=config.Font;
|
|
36339
|
+
var border=this.ChartBorder.GetBorder();
|
|
36340
|
+
var itemHeight=config.TextHeight*2+config.TextMargin.Bottom+config.TextMargin.Top;
|
|
36341
|
+
for(var i=0; i<aryData.length; ++i)
|
|
36342
|
+
{
|
|
36343
|
+
var item=aryData[i];
|
|
36344
|
+
var value=item.Value;
|
|
36345
|
+
var xCenter=item.X;
|
|
36346
|
+
var xLeft=xCenter-config.LabelWidth/2;
|
|
36347
|
+
|
|
36348
|
+
var rtDraw={ Left:xLeft, Width:config.LabelWidth, Top:border.BottomEx+1, Height:itemHeight };
|
|
36349
|
+
rtDraw.Right=rtDraw.Left+rtDraw.Width;
|
|
36350
|
+
rtDraw.Bottom=rtDraw.Top+rtDraw.Height;
|
|
36351
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
36352
|
+
{
|
|
36353
|
+
var bgColor=config.UnchangeColor;
|
|
36354
|
+
if (value>0) bgColor=config.UpColor;
|
|
36355
|
+
else if (value<0) bgColor=config.DownColor;
|
|
36356
|
+
this.DrawTextLabel(value, bgColor, config.BorderColor, config.TextColor, rtDraw, config.TextHeight, config.MaxTextWidth, config.TextMargin);
|
|
36357
|
+
}
|
|
36358
|
+
|
|
36359
|
+
var value=item.DiffValue;
|
|
36360
|
+
var rtDraw={ Left:xLeft, Width:config.LabelWidth, Bottom:border.TopEx-1, Height:itemHeight };
|
|
36361
|
+
rtDraw.Right=rtDraw.Left+rtDraw.Width;
|
|
36362
|
+
rtDraw.Top=rtDraw.Bottom-rtDraw.Height;
|
|
36363
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
36364
|
+
{
|
|
36365
|
+
var bgColor=config.UnchangeColor;
|
|
36366
|
+
if (value>0) bgColor=config.UpColor;
|
|
36367
|
+
else if (value<0) bgColor=config.DownColor;
|
|
36368
|
+
this.DrawTextLabel(value, bgColor, config.BorderColor, config.TextColor, rtDraw, config.TextHeight, config.MaxTextWidth, config.TextMargin);
|
|
36369
|
+
}
|
|
36370
|
+
}
|
|
36371
|
+
}
|
|
36372
|
+
|
|
36373
|
+
//数值标签
|
|
36374
|
+
this.DrawTextLabel=function(value, clrGB, clrBorder, clrText, rtDraw, textHeight, textWidth, textMargin)
|
|
36375
|
+
{
|
|
36376
|
+
if (clrGB)
|
|
36377
|
+
{
|
|
36378
|
+
this.Canvas.fillStyle=clrGB;
|
|
36379
|
+
this.Canvas.fillRect(rtDraw.Left ,rtDraw.Top, (rtDraw.Width), (rtDraw.Height));
|
|
36380
|
+
}
|
|
36381
|
+
|
|
36382
|
+
if (clrBorder)
|
|
36383
|
+
{
|
|
36384
|
+
this.Canvas.lineWidth=2;
|
|
36385
|
+
this.Canvas.strokeStyle=clrBorder;
|
|
36386
|
+
this.Canvas.strokeRect(rtDraw.Left, rtDraw.Top, rtDraw.Width, rtDraw.Height);
|
|
36387
|
+
}
|
|
36388
|
+
else
|
|
36389
|
+
{
|
|
36390
|
+
this.Canvas.lineWidth=1;
|
|
36391
|
+
this.Canvas.strokeStyle="rgb(0,0,0)";
|
|
36392
|
+
this.Canvas.strokeRect(rtDraw.Left, rtDraw.Top, rtDraw.Width, rtDraw.Height);
|
|
36393
|
+
}
|
|
36394
|
+
|
|
36395
|
+
var aryText=[null, null]; //大于3位数的 2行输出
|
|
36396
|
+
var sign=""; //负数
|
|
36397
|
+
if (value<0)
|
|
36398
|
+
{
|
|
36399
|
+
value=Math.abs(value);
|
|
36400
|
+
sign='-';
|
|
36401
|
+
}
|
|
36402
|
+
|
|
36403
|
+
if (value>999)
|
|
36404
|
+
{
|
|
36405
|
+
var thousand=parseInt(value/1000);
|
|
36406
|
+
var hundred=parseInt(value%1000);
|
|
36407
|
+
|
|
36408
|
+
aryText[0]=`${sign}${thousand}`;
|
|
36409
|
+
aryText[1]=`${hundred}`;
|
|
36410
|
+
if (hundred<10) aryText[1]=`00${hundred}`;
|
|
36411
|
+
else if (hundred<100) aryText[1]=`0${hundred}`;
|
|
36412
|
+
}
|
|
36413
|
+
else
|
|
36414
|
+
{
|
|
36415
|
+
aryText[1]=`${sign}${value.toFixed(0)}`;
|
|
36416
|
+
}
|
|
36417
|
+
|
|
36418
|
+
this.Canvas.textAlign="right";
|
|
36419
|
+
this.Canvas.textBaseline="top";
|
|
36420
|
+
var xRight=rtDraw.Right-(rtDraw.Right-rtDraw.Left-textWidth)/2;
|
|
36421
|
+
|
|
36422
|
+
this.Canvas.fillStyle=clrText;
|
|
36423
|
+
var yText=textMargin.Top+rtDraw.Top;
|
|
36424
|
+
for(var i=0;i<aryText.length;++i)
|
|
36425
|
+
{
|
|
36426
|
+
var text=aryText[i];
|
|
36427
|
+
if (text)
|
|
36428
|
+
{
|
|
36429
|
+
this.Canvas.fillText(text,xRight,yText);
|
|
36430
|
+
}
|
|
36431
|
+
|
|
36432
|
+
yText+=textHeight;
|
|
36433
|
+
}
|
|
36434
|
+
}
|
|
36435
|
+
|
|
36269
36436
|
this.GetMaxMin=function()
|
|
36270
36437
|
{
|
|
36271
36438
|
if (!IFrameSplitOperator.IsNumber(this.BaseValue) || this.BaseValue==0)
|
|
@@ -36328,13 +36495,36 @@ function ChartClipColorStick()
|
|
|
36328
36495
|
|
|
36329
36496
|
if (this.BaseValue>0)
|
|
36330
36497
|
{
|
|
36331
|
-
if (
|
|
36332
|
-
|
|
36498
|
+
if (this.Style==1)
|
|
36499
|
+
{
|
|
36500
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue))
|
|
36501
|
+
{
|
|
36502
|
+
var value=this.BaseValue+maxDiffValue;
|
|
36503
|
+
if (IFrameSplitOperator.IsNumber(range.Max) || range.Max<value) range.Max=value;
|
|
36504
|
+
}
|
|
36505
|
+
}
|
|
36506
|
+
else
|
|
36507
|
+
{
|
|
36508
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue) && IFrameSplitOperator.IsNumber(range.Min))
|
|
36509
|
+
range.Min-=maxDiffValue;
|
|
36510
|
+
}
|
|
36511
|
+
|
|
36333
36512
|
}
|
|
36334
36513
|
else
|
|
36335
36514
|
{
|
|
36336
|
-
if (
|
|
36337
|
-
|
|
36515
|
+
if (this.Style==1)
|
|
36516
|
+
{
|
|
36517
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue))
|
|
36518
|
+
{
|
|
36519
|
+
var value=this.BaseValue-maxDiffValue;
|
|
36520
|
+
if (IFrameSplitOperator.IsNumber(range.Min) || range.Min>value) range.Min=value;
|
|
36521
|
+
}
|
|
36522
|
+
}
|
|
36523
|
+
else
|
|
36524
|
+
{
|
|
36525
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue) && IFrameSplitOperator.IsNumber(range.Max))
|
|
36526
|
+
range.Max+=maxDiffValue;
|
|
36527
|
+
}
|
|
36338
36528
|
}
|
|
36339
36529
|
|
|
36340
36530
|
return range;
|
|
@@ -39971,16 +39971,38 @@ function ChartClipColorStick()
|
|
|
39971
39971
|
this.UpColor=g_JSChartResource.UpBarColor;
|
|
39972
39972
|
this.DownColor=g_JSChartResource.DownBarColor;
|
|
39973
39973
|
this.LineWidth=1;
|
|
39974
|
+
this.Style=0; //1=同方向 0=上下两个方向
|
|
39975
|
+
|
|
39974
39976
|
//差值线
|
|
39975
39977
|
this.DownDiffColor=g_JSChartResource.DownBarColor;
|
|
39976
39978
|
this.UpDiffColor=g_JSChartResource.UpBarColor;
|
|
39977
39979
|
|
|
39980
|
+
//文字
|
|
39981
|
+
this.TextLabelConfig=
|
|
39982
|
+
{
|
|
39983
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
39984
|
+
TextMargin:{ Left:2, Right:2, Bottom:2, Top:2 },
|
|
39985
|
+
TextColor:"rgb(230,230,230)",
|
|
39986
|
+
UpColor:"rgb(137,16,19)",
|
|
39987
|
+
DownColor:"rgb(44,104,57)",
|
|
39988
|
+
UnchangeColor:"rgb(111,112,115)",
|
|
39989
|
+
BorderColor:"rgb(0,0,0)",
|
|
39990
|
+
|
|
39991
|
+
//缓存
|
|
39992
|
+
LabelWidth:0,
|
|
39993
|
+
TextHeight:0,
|
|
39994
|
+
MaxTextWidth:0,
|
|
39995
|
+
}
|
|
39996
|
+
|
|
39978
39997
|
this.BaseLineColor; //基准线
|
|
39979
39998
|
|
|
39980
39999
|
this.BaseValue=0;
|
|
39981
40000
|
this.Super_GetMaxMin=this.GetMaxMin; //父类的方法
|
|
39982
40001
|
this.ValueRange; //{ Max:, Min: } //固定最大最小值
|
|
39983
40002
|
|
|
40003
|
+
this.IsShowText=false;
|
|
40004
|
+
|
|
40005
|
+
|
|
39984
40006
|
this.SetOption=function(option)
|
|
39985
40007
|
{
|
|
39986
40008
|
if (!option) return;
|
|
@@ -39991,11 +40013,18 @@ function ChartClipColorStick()
|
|
|
39991
40013
|
if (option.UpDiffColor) this.UpDiffColor=option.UpDiffColor;
|
|
39992
40014
|
if (option.BaseLineColor) this.BaseLineColor=option.BaseLineColor;
|
|
39993
40015
|
if (IFrameSplitOperator.IsNumber(option.BaseValue)) this.BaseValue=option.BaseValue;
|
|
40016
|
+
if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
|
|
39994
40017
|
if (option.ValueRange) this.ValueRange=option.ValueRange;
|
|
40018
|
+
|
|
39995
40019
|
}
|
|
39996
40020
|
|
|
39997
40021
|
this.Draw=function()
|
|
39998
40022
|
{
|
|
40023
|
+
this.IsShowText=false;
|
|
40024
|
+
this.TextLabelConfig.LabelWidth=0;
|
|
40025
|
+
this.TextLabelConfig.TextHeight=0;
|
|
40026
|
+
this.TextLabelConfig.MaxTextWidth=0;
|
|
40027
|
+
|
|
39999
40028
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
40000
40029
|
if (this.IsShowIndexTitleOnly()) return;
|
|
40001
40030
|
if (this.IsHideScriptIndex()) return;
|
|
@@ -40006,23 +40035,44 @@ function ChartClipColorStick()
|
|
|
40006
40035
|
return;
|
|
40007
40036
|
}
|
|
40008
40037
|
|
|
40009
|
-
this.Canvas.save();
|
|
40010
40038
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
40039
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
40040
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
40041
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40042
|
+
|
|
40011
40043
|
var lineWidth=this.LineWidth*GetDevicePixelRatio();
|
|
40012
40044
|
if (this.LineWidth==50) lineWidth=dataWidth;
|
|
40013
40045
|
else if (lineWidth>dataWidth) lineWidth=dataWidth;
|
|
40014
|
-
|
|
40046
|
+
|
|
40047
|
+
if (!bHScreen)
|
|
40048
|
+
{
|
|
40049
|
+
var itemWidth=dataWidth+distanceWidth;
|
|
40050
|
+
var bMinute=this.IsMinuteFrame();
|
|
40051
|
+
if (bMinute)
|
|
40052
|
+
{
|
|
40053
|
+
var border=this.ChartBorder.GetBorder();
|
|
40054
|
+
itemWidth=(border.Right-border.Left)/(xPointCount-1);
|
|
40055
|
+
}
|
|
40056
|
+
|
|
40057
|
+
this.Canvas.font=this.TextLabelConfig.Font;
|
|
40058
|
+
this.TextLabelConfig.MaxTextWidth=this.Canvas.measureText("-888").width;
|
|
40059
|
+
this.TextLabelConfig.LabelWidth=this.TextLabelConfig.MaxTextWidth+this.TextLabelConfig.TextMargin.Left+this.TextLabelConfig.TextMargin.Right;
|
|
40060
|
+
this.IsShowText=itemWidth>this.TextLabelConfig.LabelWidth;
|
|
40061
|
+
this.TextLabelConfig.TextHeight=this.Canvas.measureText("擎").width;
|
|
40062
|
+
}
|
|
40063
|
+
|
|
40064
|
+
this.Canvas.save();
|
|
40015
40065
|
if (IFrameSplitOperator.IsNumber(this.BaseValue) && this.BaseValue!=0)
|
|
40016
40066
|
{
|
|
40017
40067
|
this.DrawBaseLine();
|
|
40018
40068
|
|
|
40019
|
-
if (this.BaseValue>0) this.DrawBars(lineWidth, true);
|
|
40020
|
-
else this.DrawBars(lineWidth, false);
|
|
40069
|
+
if (this.BaseValue>0) this.DrawBars(lineWidth, true, true);
|
|
40070
|
+
else this.DrawBars(lineWidth, false, true);
|
|
40021
40071
|
}
|
|
40022
40072
|
else
|
|
40023
40073
|
{
|
|
40024
40074
|
//上下分开画
|
|
40025
|
-
this.DrawBars(lineWidth, true);
|
|
40075
|
+
this.DrawBars(lineWidth, true, true);
|
|
40026
40076
|
this.DrawBars(lineWidth, false);
|
|
40027
40077
|
}
|
|
40028
40078
|
|
|
@@ -40030,15 +40080,15 @@ function ChartClipColorStick()
|
|
|
40030
40080
|
this.Canvas.restore();
|
|
40031
40081
|
}
|
|
40032
40082
|
|
|
40033
|
-
this.DrawBars=function(lineWidth, bUpBar)
|
|
40083
|
+
this.DrawBars=function(lineWidth, bUpBar, bDrawLabel)
|
|
40034
40084
|
{
|
|
40035
40085
|
var isMinute=this.IsMinuteFrame();
|
|
40036
40086
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
40037
40087
|
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
40038
40088
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
40039
|
-
var
|
|
40089
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40040
40090
|
|
|
40041
|
-
if (
|
|
40091
|
+
if (bHScreen)
|
|
40042
40092
|
{
|
|
40043
40093
|
var border=this.ChartBorder.GetHScreenBorder();
|
|
40044
40094
|
var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
@@ -40057,19 +40107,12 @@ function ChartClipColorStick()
|
|
|
40057
40107
|
}
|
|
40058
40108
|
|
|
40059
40109
|
var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
40060
|
-
var aryBar=[], aryDiffBar=[];
|
|
40110
|
+
var aryBar=[], aryDiffBar=[], aryText=[];
|
|
40111
|
+
var preValue=null;
|
|
40061
40112
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
40062
40113
|
{
|
|
40063
40114
|
var value=this.Data.Data[i];
|
|
40064
40115
|
if (value==null) continue;
|
|
40065
|
-
if (bUpBar)
|
|
40066
|
-
{
|
|
40067
|
-
if (value<0) continue;
|
|
40068
|
-
}
|
|
40069
|
-
else
|
|
40070
|
-
{
|
|
40071
|
-
if (value>=0) continue;
|
|
40072
|
-
}
|
|
40073
40116
|
|
|
40074
40117
|
if (isMinute)
|
|
40075
40118
|
{
|
|
@@ -40085,6 +40128,21 @@ function ChartClipColorStick()
|
|
|
40085
40128
|
|
|
40086
40129
|
if (x>chartright) break;
|
|
40087
40130
|
|
|
40131
|
+
var textItem={ X:x, Value:value };
|
|
40132
|
+
if (IFrameSplitOperator.IsNumber(preValue)) textItem.DiffValue=value-preValue;
|
|
40133
|
+
aryText.push(textItem);
|
|
40134
|
+
|
|
40135
|
+
preValue=value;
|
|
40136
|
+
|
|
40137
|
+
if (bUpBar)
|
|
40138
|
+
{
|
|
40139
|
+
if (value<0) continue;
|
|
40140
|
+
}
|
|
40141
|
+
else
|
|
40142
|
+
{
|
|
40143
|
+
if (value>=0) continue;
|
|
40144
|
+
}
|
|
40145
|
+
|
|
40088
40146
|
var bDiffBar=false;
|
|
40089
40147
|
var diffValue=null;
|
|
40090
40148
|
if (this.BaseValue>0)
|
|
@@ -40092,7 +40150,10 @@ function ChartClipColorStick()
|
|
|
40092
40150
|
if (value<this.BaseValue)
|
|
40093
40151
|
{
|
|
40094
40152
|
bDiffBar=true;
|
|
40095
|
-
|
|
40153
|
+
if (this.Style==1)
|
|
40154
|
+
diffValue=this.BaseValue+(this.BaseValue-value);
|
|
40155
|
+
else
|
|
40156
|
+
diffValue=this.BaseValue-(this.BaseValue-value);
|
|
40096
40157
|
}
|
|
40097
40158
|
}
|
|
40098
40159
|
else if (this.BaseValue<0)
|
|
@@ -40100,19 +40161,22 @@ function ChartClipColorStick()
|
|
|
40100
40161
|
if (value>this.BaseValue)
|
|
40101
40162
|
{
|
|
40102
40163
|
bDiffBar=true;
|
|
40103
|
-
|
|
40164
|
+
if (this.Style==1)
|
|
40165
|
+
diffValue=this.BaseValue-(value-this.BaseValue);
|
|
40166
|
+
else
|
|
40167
|
+
diffValue=this.BaseValue+(value-this.BaseValue)
|
|
40104
40168
|
}
|
|
40105
40169
|
}
|
|
40106
40170
|
|
|
40107
40171
|
if (!bDiffBar)
|
|
40108
40172
|
{
|
|
40109
40173
|
var y=this.ChartFrame.GetYFromData(value);
|
|
40110
|
-
aryBar.push({X:x, Y:y});
|
|
40174
|
+
aryBar.push({X:x, Y:y });
|
|
40111
40175
|
}
|
|
40112
40176
|
else
|
|
40113
40177
|
{
|
|
40114
40178
|
var y=this.ChartFrame.GetYFromData(diffValue);
|
|
40115
|
-
aryDiffBar.push({X:x, Y:y});
|
|
40179
|
+
aryDiffBar.push({X:x, Y:y });
|
|
40116
40180
|
}
|
|
40117
40181
|
}
|
|
40118
40182
|
|
|
@@ -40121,6 +40185,7 @@ function ChartClipColorStick()
|
|
|
40121
40185
|
else this.Canvas.strokeStyle=this.DownColor;
|
|
40122
40186
|
|
|
40123
40187
|
this.DrawStick(aryBar,lineWidth,yBottom);
|
|
40188
|
+
|
|
40124
40189
|
|
|
40125
40190
|
if (this.BaseValue>0)
|
|
40126
40191
|
{
|
|
@@ -40133,13 +40198,14 @@ function ChartClipColorStick()
|
|
|
40133
40198
|
this.DrawStick(aryDiffBar,lineWidth,yBottom);
|
|
40134
40199
|
}
|
|
40135
40200
|
|
|
40201
|
+
if (this.IsShowText && bDrawLabel) this.DrawStickText(aryText);
|
|
40136
40202
|
}
|
|
40137
40203
|
|
|
40138
40204
|
this.DrawStick=function(aryData, lineWidth, yBottom)
|
|
40139
40205
|
{
|
|
40140
40206
|
if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) return;
|
|
40141
40207
|
|
|
40142
|
-
var
|
|
40208
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40143
40209
|
var drawCount=0;
|
|
40144
40210
|
this.Canvas.beginPath();
|
|
40145
40211
|
for(var i=0; i<aryData.length; ++i)
|
|
@@ -40148,7 +40214,7 @@ function ChartClipColorStick()
|
|
|
40148
40214
|
var y=item.Y;
|
|
40149
40215
|
var xFix=ToFixedPoint2(lineWidth, item.X); //毛边修正
|
|
40150
40216
|
|
|
40151
|
-
if (
|
|
40217
|
+
if (bHScreen)
|
|
40152
40218
|
{
|
|
40153
40219
|
this.Canvas.moveTo(yBottom,ToFixedPoint(x));
|
|
40154
40220
|
this.Canvas.lineTo(y,ToFixedPoint(x));
|
|
@@ -40170,14 +40236,14 @@ function ChartClipColorStick()
|
|
|
40170
40236
|
if (!IFrameSplitOperator.IsNumber(this.BaseValue) || this.BaseValue==0) return;
|
|
40171
40237
|
if (!this.BaseLineColor) return;
|
|
40172
40238
|
|
|
40173
|
-
var
|
|
40239
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40174
40240
|
var border=this.ChartFrame.GetBorder();
|
|
40175
40241
|
var y=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
40176
40242
|
|
|
40177
40243
|
this.Canvas.strokeStyle=this.BaseLineColor;
|
|
40178
40244
|
this.Canvas.lineWidth=1*GetDevicePixelRatio();
|
|
40179
40245
|
|
|
40180
|
-
if (
|
|
40246
|
+
if (bHScreen)
|
|
40181
40247
|
{
|
|
40182
40248
|
|
|
40183
40249
|
}
|
|
@@ -40191,6 +40257,107 @@ function ChartClipColorStick()
|
|
|
40191
40257
|
}
|
|
40192
40258
|
}
|
|
40193
40259
|
|
|
40260
|
+
this.DrawStickText=function(aryData)
|
|
40261
|
+
{
|
|
40262
|
+
var config=this.TextLabelConfig;
|
|
40263
|
+
this.Canvas.font=config.Font;
|
|
40264
|
+
var border=this.ChartBorder.GetBorder();
|
|
40265
|
+
var itemHeight=config.TextHeight*2+config.TextMargin.Bottom+config.TextMargin.Top;
|
|
40266
|
+
for(var i=0; i<aryData.length; ++i)
|
|
40267
|
+
{
|
|
40268
|
+
var item=aryData[i];
|
|
40269
|
+
var value=item.Value;
|
|
40270
|
+
var xCenter=item.X;
|
|
40271
|
+
var xLeft=xCenter-config.LabelWidth/2;
|
|
40272
|
+
|
|
40273
|
+
var rtDraw={ Left:xLeft, Width:config.LabelWidth, Top:border.BottomEx+1, Height:itemHeight };
|
|
40274
|
+
rtDraw.Right=rtDraw.Left+rtDraw.Width;
|
|
40275
|
+
rtDraw.Bottom=rtDraw.Top+rtDraw.Height;
|
|
40276
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
40277
|
+
{
|
|
40278
|
+
var bgColor=config.UnchangeColor;
|
|
40279
|
+
if (value>0) bgColor=config.UpColor;
|
|
40280
|
+
else if (value<0) bgColor=config.DownColor;
|
|
40281
|
+
this.DrawTextLabel(value, bgColor, config.BorderColor, config.TextColor, rtDraw, config.TextHeight, config.MaxTextWidth, config.TextMargin);
|
|
40282
|
+
}
|
|
40283
|
+
|
|
40284
|
+
var value=item.DiffValue;
|
|
40285
|
+
var rtDraw={ Left:xLeft, Width:config.LabelWidth, Bottom:border.TopEx-1, Height:itemHeight };
|
|
40286
|
+
rtDraw.Right=rtDraw.Left+rtDraw.Width;
|
|
40287
|
+
rtDraw.Top=rtDraw.Bottom-rtDraw.Height;
|
|
40288
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
40289
|
+
{
|
|
40290
|
+
var bgColor=config.UnchangeColor;
|
|
40291
|
+
if (value>0) bgColor=config.UpColor;
|
|
40292
|
+
else if (value<0) bgColor=config.DownColor;
|
|
40293
|
+
this.DrawTextLabel(value, bgColor, config.BorderColor, config.TextColor, rtDraw, config.TextHeight, config.MaxTextWidth, config.TextMargin);
|
|
40294
|
+
}
|
|
40295
|
+
}
|
|
40296
|
+
}
|
|
40297
|
+
|
|
40298
|
+
//数值标签
|
|
40299
|
+
this.DrawTextLabel=function(value, clrGB, clrBorder, clrText, rtDraw, textHeight, textWidth, textMargin)
|
|
40300
|
+
{
|
|
40301
|
+
if (clrGB)
|
|
40302
|
+
{
|
|
40303
|
+
this.Canvas.fillStyle=clrGB;
|
|
40304
|
+
this.Canvas.fillRect(rtDraw.Left ,rtDraw.Top, (rtDraw.Width), (rtDraw.Height));
|
|
40305
|
+
}
|
|
40306
|
+
|
|
40307
|
+
if (clrBorder)
|
|
40308
|
+
{
|
|
40309
|
+
this.Canvas.lineWidth=2;
|
|
40310
|
+
this.Canvas.strokeStyle=clrBorder;
|
|
40311
|
+
this.Canvas.strokeRect(rtDraw.Left, rtDraw.Top, rtDraw.Width, rtDraw.Height);
|
|
40312
|
+
}
|
|
40313
|
+
else
|
|
40314
|
+
{
|
|
40315
|
+
this.Canvas.lineWidth=1;
|
|
40316
|
+
this.Canvas.strokeStyle="rgb(0,0,0)";
|
|
40317
|
+
this.Canvas.strokeRect(rtDraw.Left, rtDraw.Top, rtDraw.Width, rtDraw.Height);
|
|
40318
|
+
}
|
|
40319
|
+
|
|
40320
|
+
var aryText=[null, null]; //大于3位数的 2行输出
|
|
40321
|
+
var sign=""; //负数
|
|
40322
|
+
if (value<0)
|
|
40323
|
+
{
|
|
40324
|
+
value=Math.abs(value);
|
|
40325
|
+
sign='-';
|
|
40326
|
+
}
|
|
40327
|
+
|
|
40328
|
+
if (value>999)
|
|
40329
|
+
{
|
|
40330
|
+
var thousand=parseInt(value/1000);
|
|
40331
|
+
var hundred=parseInt(value%1000);
|
|
40332
|
+
|
|
40333
|
+
aryText[0]=`${sign}${thousand}`;
|
|
40334
|
+
aryText[1]=`${hundred}`;
|
|
40335
|
+
if (hundred<10) aryText[1]=`00${hundred}`;
|
|
40336
|
+
else if (hundred<100) aryText[1]=`0${hundred}`;
|
|
40337
|
+
}
|
|
40338
|
+
else
|
|
40339
|
+
{
|
|
40340
|
+
aryText[1]=`${sign}${value.toFixed(0)}`;
|
|
40341
|
+
}
|
|
40342
|
+
|
|
40343
|
+
this.Canvas.textAlign="right";
|
|
40344
|
+
this.Canvas.textBaseline="top";
|
|
40345
|
+
var xRight=rtDraw.Right-(rtDraw.Right-rtDraw.Left-textWidth)/2;
|
|
40346
|
+
|
|
40347
|
+
this.Canvas.fillStyle=clrText;
|
|
40348
|
+
var yText=textMargin.Top+rtDraw.Top;
|
|
40349
|
+
for(var i=0;i<aryText.length;++i)
|
|
40350
|
+
{
|
|
40351
|
+
var text=aryText[i];
|
|
40352
|
+
if (text)
|
|
40353
|
+
{
|
|
40354
|
+
this.Canvas.fillText(text,xRight,yText);
|
|
40355
|
+
}
|
|
40356
|
+
|
|
40357
|
+
yText+=textHeight;
|
|
40358
|
+
}
|
|
40359
|
+
}
|
|
40360
|
+
|
|
40194
40361
|
this.GetMaxMin=function()
|
|
40195
40362
|
{
|
|
40196
40363
|
if (!IFrameSplitOperator.IsNumber(this.BaseValue) || this.BaseValue==0)
|
|
@@ -40253,13 +40420,36 @@ function ChartClipColorStick()
|
|
|
40253
40420
|
|
|
40254
40421
|
if (this.BaseValue>0)
|
|
40255
40422
|
{
|
|
40256
|
-
if (
|
|
40257
|
-
|
|
40423
|
+
if (this.Style==1)
|
|
40424
|
+
{
|
|
40425
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue))
|
|
40426
|
+
{
|
|
40427
|
+
var value=this.BaseValue+maxDiffValue;
|
|
40428
|
+
if (IFrameSplitOperator.IsNumber(range.Max) || range.Max<value) range.Max=value;
|
|
40429
|
+
}
|
|
40430
|
+
}
|
|
40431
|
+
else
|
|
40432
|
+
{
|
|
40433
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue) && IFrameSplitOperator.IsNumber(range.Min))
|
|
40434
|
+
range.Min-=maxDiffValue;
|
|
40435
|
+
}
|
|
40436
|
+
|
|
40258
40437
|
}
|
|
40259
40438
|
else
|
|
40260
40439
|
{
|
|
40261
|
-
if (
|
|
40262
|
-
|
|
40440
|
+
if (this.Style==1)
|
|
40441
|
+
{
|
|
40442
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue))
|
|
40443
|
+
{
|
|
40444
|
+
var value=this.BaseValue-maxDiffValue;
|
|
40445
|
+
if (IFrameSplitOperator.IsNumber(range.Min) || range.Min>value) range.Min=value;
|
|
40446
|
+
}
|
|
40447
|
+
}
|
|
40448
|
+
else
|
|
40449
|
+
{
|
|
40450
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue) && IFrameSplitOperator.IsNumber(range.Max))
|
|
40451
|
+
range.Max+=maxDiffValue;
|
|
40452
|
+
}
|
|
40263
40453
|
}
|
|
40264
40454
|
|
|
40265
40455
|
return range;
|
|
@@ -138395,7 +138585,7 @@ function ScrollBarBGChart()
|
|
|
138395
138585
|
|
|
138396
138586
|
|
|
138397
138587
|
|
|
138398
|
-
var HQCHART_VERSION="1.1.
|
|
138588
|
+
var HQCHART_VERSION="1.1.13745";
|
|
138399
138589
|
|
|
138400
138590
|
function PrintHQChartVersion()
|
|
138401
138591
|
{
|
|
@@ -40015,16 +40015,38 @@ function ChartClipColorStick()
|
|
|
40015
40015
|
this.UpColor=g_JSChartResource.UpBarColor;
|
|
40016
40016
|
this.DownColor=g_JSChartResource.DownBarColor;
|
|
40017
40017
|
this.LineWidth=1;
|
|
40018
|
+
this.Style=0; //1=同方向 0=上下两个方向
|
|
40019
|
+
|
|
40018
40020
|
//差值线
|
|
40019
40021
|
this.DownDiffColor=g_JSChartResource.DownBarColor;
|
|
40020
40022
|
this.UpDiffColor=g_JSChartResource.UpBarColor;
|
|
40021
40023
|
|
|
40024
|
+
//文字
|
|
40025
|
+
this.TextLabelConfig=
|
|
40026
|
+
{
|
|
40027
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
40028
|
+
TextMargin:{ Left:2, Right:2, Bottom:2, Top:2 },
|
|
40029
|
+
TextColor:"rgb(230,230,230)",
|
|
40030
|
+
UpColor:"rgb(137,16,19)",
|
|
40031
|
+
DownColor:"rgb(44,104,57)",
|
|
40032
|
+
UnchangeColor:"rgb(111,112,115)",
|
|
40033
|
+
BorderColor:"rgb(0,0,0)",
|
|
40034
|
+
|
|
40035
|
+
//缓存
|
|
40036
|
+
LabelWidth:0,
|
|
40037
|
+
TextHeight:0,
|
|
40038
|
+
MaxTextWidth:0,
|
|
40039
|
+
}
|
|
40040
|
+
|
|
40022
40041
|
this.BaseLineColor; //基准线
|
|
40023
40042
|
|
|
40024
40043
|
this.BaseValue=0;
|
|
40025
40044
|
this.Super_GetMaxMin=this.GetMaxMin; //父类的方法
|
|
40026
40045
|
this.ValueRange; //{ Max:, Min: } //固定最大最小值
|
|
40027
40046
|
|
|
40047
|
+
this.IsShowText=false;
|
|
40048
|
+
|
|
40049
|
+
|
|
40028
40050
|
this.SetOption=function(option)
|
|
40029
40051
|
{
|
|
40030
40052
|
if (!option) return;
|
|
@@ -40035,11 +40057,18 @@ function ChartClipColorStick()
|
|
|
40035
40057
|
if (option.UpDiffColor) this.UpDiffColor=option.UpDiffColor;
|
|
40036
40058
|
if (option.BaseLineColor) this.BaseLineColor=option.BaseLineColor;
|
|
40037
40059
|
if (IFrameSplitOperator.IsNumber(option.BaseValue)) this.BaseValue=option.BaseValue;
|
|
40060
|
+
if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
|
|
40038
40061
|
if (option.ValueRange) this.ValueRange=option.ValueRange;
|
|
40062
|
+
|
|
40039
40063
|
}
|
|
40040
40064
|
|
|
40041
40065
|
this.Draw=function()
|
|
40042
40066
|
{
|
|
40067
|
+
this.IsShowText=false;
|
|
40068
|
+
this.TextLabelConfig.LabelWidth=0;
|
|
40069
|
+
this.TextLabelConfig.TextHeight=0;
|
|
40070
|
+
this.TextLabelConfig.MaxTextWidth=0;
|
|
40071
|
+
|
|
40043
40072
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
40044
40073
|
if (this.IsShowIndexTitleOnly()) return;
|
|
40045
40074
|
if (this.IsHideScriptIndex()) return;
|
|
@@ -40050,23 +40079,44 @@ function ChartClipColorStick()
|
|
|
40050
40079
|
return;
|
|
40051
40080
|
}
|
|
40052
40081
|
|
|
40053
|
-
this.Canvas.save();
|
|
40054
40082
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
40083
|
+
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
40084
|
+
var xPointCount=this.ChartFrame.XPointCount;
|
|
40085
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40086
|
+
|
|
40055
40087
|
var lineWidth=this.LineWidth*GetDevicePixelRatio();
|
|
40056
40088
|
if (this.LineWidth==50) lineWidth=dataWidth;
|
|
40057
40089
|
else if (lineWidth>dataWidth) lineWidth=dataWidth;
|
|
40058
|
-
|
|
40090
|
+
|
|
40091
|
+
if (!bHScreen)
|
|
40092
|
+
{
|
|
40093
|
+
var itemWidth=dataWidth+distanceWidth;
|
|
40094
|
+
var bMinute=this.IsMinuteFrame();
|
|
40095
|
+
if (bMinute)
|
|
40096
|
+
{
|
|
40097
|
+
var border=this.ChartBorder.GetBorder();
|
|
40098
|
+
itemWidth=(border.Right-border.Left)/(xPointCount-1);
|
|
40099
|
+
}
|
|
40100
|
+
|
|
40101
|
+
this.Canvas.font=this.TextLabelConfig.Font;
|
|
40102
|
+
this.TextLabelConfig.MaxTextWidth=this.Canvas.measureText("-888").width;
|
|
40103
|
+
this.TextLabelConfig.LabelWidth=this.TextLabelConfig.MaxTextWidth+this.TextLabelConfig.TextMargin.Left+this.TextLabelConfig.TextMargin.Right;
|
|
40104
|
+
this.IsShowText=itemWidth>this.TextLabelConfig.LabelWidth;
|
|
40105
|
+
this.TextLabelConfig.TextHeight=this.Canvas.measureText("擎").width;
|
|
40106
|
+
}
|
|
40107
|
+
|
|
40108
|
+
this.Canvas.save();
|
|
40059
40109
|
if (IFrameSplitOperator.IsNumber(this.BaseValue) && this.BaseValue!=0)
|
|
40060
40110
|
{
|
|
40061
40111
|
this.DrawBaseLine();
|
|
40062
40112
|
|
|
40063
|
-
if (this.BaseValue>0) this.DrawBars(lineWidth, true);
|
|
40064
|
-
else this.DrawBars(lineWidth, false);
|
|
40113
|
+
if (this.BaseValue>0) this.DrawBars(lineWidth, true, true);
|
|
40114
|
+
else this.DrawBars(lineWidth, false, true);
|
|
40065
40115
|
}
|
|
40066
40116
|
else
|
|
40067
40117
|
{
|
|
40068
40118
|
//上下分开画
|
|
40069
|
-
this.DrawBars(lineWidth, true);
|
|
40119
|
+
this.DrawBars(lineWidth, true, true);
|
|
40070
40120
|
this.DrawBars(lineWidth, false);
|
|
40071
40121
|
}
|
|
40072
40122
|
|
|
@@ -40074,15 +40124,15 @@ function ChartClipColorStick()
|
|
|
40074
40124
|
this.Canvas.restore();
|
|
40075
40125
|
}
|
|
40076
40126
|
|
|
40077
|
-
this.DrawBars=function(lineWidth, bUpBar)
|
|
40127
|
+
this.DrawBars=function(lineWidth, bUpBar, bDrawLabel)
|
|
40078
40128
|
{
|
|
40079
40129
|
var isMinute=this.IsMinuteFrame();
|
|
40080
40130
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
40081
40131
|
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
40082
40132
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
40083
|
-
var
|
|
40133
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40084
40134
|
|
|
40085
|
-
if (
|
|
40135
|
+
if (bHScreen)
|
|
40086
40136
|
{
|
|
40087
40137
|
var border=this.ChartBorder.GetHScreenBorder();
|
|
40088
40138
|
var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
@@ -40101,19 +40151,12 @@ function ChartClipColorStick()
|
|
|
40101
40151
|
}
|
|
40102
40152
|
|
|
40103
40153
|
var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
40104
|
-
var aryBar=[], aryDiffBar=[];
|
|
40154
|
+
var aryBar=[], aryDiffBar=[], aryText=[];
|
|
40155
|
+
var preValue=null;
|
|
40105
40156
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
40106
40157
|
{
|
|
40107
40158
|
var value=this.Data.Data[i];
|
|
40108
40159
|
if (value==null) continue;
|
|
40109
|
-
if (bUpBar)
|
|
40110
|
-
{
|
|
40111
|
-
if (value<0) continue;
|
|
40112
|
-
}
|
|
40113
|
-
else
|
|
40114
|
-
{
|
|
40115
|
-
if (value>=0) continue;
|
|
40116
|
-
}
|
|
40117
40160
|
|
|
40118
40161
|
if (isMinute)
|
|
40119
40162
|
{
|
|
@@ -40129,6 +40172,21 @@ function ChartClipColorStick()
|
|
|
40129
40172
|
|
|
40130
40173
|
if (x>chartright) break;
|
|
40131
40174
|
|
|
40175
|
+
var textItem={ X:x, Value:value };
|
|
40176
|
+
if (IFrameSplitOperator.IsNumber(preValue)) textItem.DiffValue=value-preValue;
|
|
40177
|
+
aryText.push(textItem);
|
|
40178
|
+
|
|
40179
|
+
preValue=value;
|
|
40180
|
+
|
|
40181
|
+
if (bUpBar)
|
|
40182
|
+
{
|
|
40183
|
+
if (value<0) continue;
|
|
40184
|
+
}
|
|
40185
|
+
else
|
|
40186
|
+
{
|
|
40187
|
+
if (value>=0) continue;
|
|
40188
|
+
}
|
|
40189
|
+
|
|
40132
40190
|
var bDiffBar=false;
|
|
40133
40191
|
var diffValue=null;
|
|
40134
40192
|
if (this.BaseValue>0)
|
|
@@ -40136,7 +40194,10 @@ function ChartClipColorStick()
|
|
|
40136
40194
|
if (value<this.BaseValue)
|
|
40137
40195
|
{
|
|
40138
40196
|
bDiffBar=true;
|
|
40139
|
-
|
|
40197
|
+
if (this.Style==1)
|
|
40198
|
+
diffValue=this.BaseValue+(this.BaseValue-value);
|
|
40199
|
+
else
|
|
40200
|
+
diffValue=this.BaseValue-(this.BaseValue-value);
|
|
40140
40201
|
}
|
|
40141
40202
|
}
|
|
40142
40203
|
else if (this.BaseValue<0)
|
|
@@ -40144,19 +40205,22 @@ function ChartClipColorStick()
|
|
|
40144
40205
|
if (value>this.BaseValue)
|
|
40145
40206
|
{
|
|
40146
40207
|
bDiffBar=true;
|
|
40147
|
-
|
|
40208
|
+
if (this.Style==1)
|
|
40209
|
+
diffValue=this.BaseValue-(value-this.BaseValue);
|
|
40210
|
+
else
|
|
40211
|
+
diffValue=this.BaseValue+(value-this.BaseValue)
|
|
40148
40212
|
}
|
|
40149
40213
|
}
|
|
40150
40214
|
|
|
40151
40215
|
if (!bDiffBar)
|
|
40152
40216
|
{
|
|
40153
40217
|
var y=this.ChartFrame.GetYFromData(value);
|
|
40154
|
-
aryBar.push({X:x, Y:y});
|
|
40218
|
+
aryBar.push({X:x, Y:y });
|
|
40155
40219
|
}
|
|
40156
40220
|
else
|
|
40157
40221
|
{
|
|
40158
40222
|
var y=this.ChartFrame.GetYFromData(diffValue);
|
|
40159
|
-
aryDiffBar.push({X:x, Y:y});
|
|
40223
|
+
aryDiffBar.push({X:x, Y:y });
|
|
40160
40224
|
}
|
|
40161
40225
|
}
|
|
40162
40226
|
|
|
@@ -40165,6 +40229,7 @@ function ChartClipColorStick()
|
|
|
40165
40229
|
else this.Canvas.strokeStyle=this.DownColor;
|
|
40166
40230
|
|
|
40167
40231
|
this.DrawStick(aryBar,lineWidth,yBottom);
|
|
40232
|
+
|
|
40168
40233
|
|
|
40169
40234
|
if (this.BaseValue>0)
|
|
40170
40235
|
{
|
|
@@ -40177,13 +40242,14 @@ function ChartClipColorStick()
|
|
|
40177
40242
|
this.DrawStick(aryDiffBar,lineWidth,yBottom);
|
|
40178
40243
|
}
|
|
40179
40244
|
|
|
40245
|
+
if (this.IsShowText && bDrawLabel) this.DrawStickText(aryText);
|
|
40180
40246
|
}
|
|
40181
40247
|
|
|
40182
40248
|
this.DrawStick=function(aryData, lineWidth, yBottom)
|
|
40183
40249
|
{
|
|
40184
40250
|
if (!IFrameSplitOperator.IsNonEmptyArray(aryData)) return;
|
|
40185
40251
|
|
|
40186
|
-
var
|
|
40252
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40187
40253
|
var drawCount=0;
|
|
40188
40254
|
this.Canvas.beginPath();
|
|
40189
40255
|
for(var i=0; i<aryData.length; ++i)
|
|
@@ -40192,7 +40258,7 @@ function ChartClipColorStick()
|
|
|
40192
40258
|
var y=item.Y;
|
|
40193
40259
|
var xFix=ToFixedPoint2(lineWidth, item.X); //毛边修正
|
|
40194
40260
|
|
|
40195
|
-
if (
|
|
40261
|
+
if (bHScreen)
|
|
40196
40262
|
{
|
|
40197
40263
|
this.Canvas.moveTo(yBottom,ToFixedPoint(x));
|
|
40198
40264
|
this.Canvas.lineTo(y,ToFixedPoint(x));
|
|
@@ -40214,14 +40280,14 @@ function ChartClipColorStick()
|
|
|
40214
40280
|
if (!IFrameSplitOperator.IsNumber(this.BaseValue) || this.BaseValue==0) return;
|
|
40215
40281
|
if (!this.BaseLineColor) return;
|
|
40216
40282
|
|
|
40217
|
-
var
|
|
40283
|
+
var bHScreen=this.ChartFrame.IsHScreen===true;
|
|
40218
40284
|
var border=this.ChartFrame.GetBorder();
|
|
40219
40285
|
var y=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
40220
40286
|
|
|
40221
40287
|
this.Canvas.strokeStyle=this.BaseLineColor;
|
|
40222
40288
|
this.Canvas.lineWidth=1*GetDevicePixelRatio();
|
|
40223
40289
|
|
|
40224
|
-
if (
|
|
40290
|
+
if (bHScreen)
|
|
40225
40291
|
{
|
|
40226
40292
|
|
|
40227
40293
|
}
|
|
@@ -40235,6 +40301,107 @@ function ChartClipColorStick()
|
|
|
40235
40301
|
}
|
|
40236
40302
|
}
|
|
40237
40303
|
|
|
40304
|
+
this.DrawStickText=function(aryData)
|
|
40305
|
+
{
|
|
40306
|
+
var config=this.TextLabelConfig;
|
|
40307
|
+
this.Canvas.font=config.Font;
|
|
40308
|
+
var border=this.ChartBorder.GetBorder();
|
|
40309
|
+
var itemHeight=config.TextHeight*2+config.TextMargin.Bottom+config.TextMargin.Top;
|
|
40310
|
+
for(var i=0; i<aryData.length; ++i)
|
|
40311
|
+
{
|
|
40312
|
+
var item=aryData[i];
|
|
40313
|
+
var value=item.Value;
|
|
40314
|
+
var xCenter=item.X;
|
|
40315
|
+
var xLeft=xCenter-config.LabelWidth/2;
|
|
40316
|
+
|
|
40317
|
+
var rtDraw={ Left:xLeft, Width:config.LabelWidth, Top:border.BottomEx+1, Height:itemHeight };
|
|
40318
|
+
rtDraw.Right=rtDraw.Left+rtDraw.Width;
|
|
40319
|
+
rtDraw.Bottom=rtDraw.Top+rtDraw.Height;
|
|
40320
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
40321
|
+
{
|
|
40322
|
+
var bgColor=config.UnchangeColor;
|
|
40323
|
+
if (value>0) bgColor=config.UpColor;
|
|
40324
|
+
else if (value<0) bgColor=config.DownColor;
|
|
40325
|
+
this.DrawTextLabel(value, bgColor, config.BorderColor, config.TextColor, rtDraw, config.TextHeight, config.MaxTextWidth, config.TextMargin);
|
|
40326
|
+
}
|
|
40327
|
+
|
|
40328
|
+
var value=item.DiffValue;
|
|
40329
|
+
var rtDraw={ Left:xLeft, Width:config.LabelWidth, Bottom:border.TopEx-1, Height:itemHeight };
|
|
40330
|
+
rtDraw.Right=rtDraw.Left+rtDraw.Width;
|
|
40331
|
+
rtDraw.Top=rtDraw.Bottom-rtDraw.Height;
|
|
40332
|
+
if (IFrameSplitOperator.IsNumber(value))
|
|
40333
|
+
{
|
|
40334
|
+
var bgColor=config.UnchangeColor;
|
|
40335
|
+
if (value>0) bgColor=config.UpColor;
|
|
40336
|
+
else if (value<0) bgColor=config.DownColor;
|
|
40337
|
+
this.DrawTextLabel(value, bgColor, config.BorderColor, config.TextColor, rtDraw, config.TextHeight, config.MaxTextWidth, config.TextMargin);
|
|
40338
|
+
}
|
|
40339
|
+
}
|
|
40340
|
+
}
|
|
40341
|
+
|
|
40342
|
+
//数值标签
|
|
40343
|
+
this.DrawTextLabel=function(value, clrGB, clrBorder, clrText, rtDraw, textHeight, textWidth, textMargin)
|
|
40344
|
+
{
|
|
40345
|
+
if (clrGB)
|
|
40346
|
+
{
|
|
40347
|
+
this.Canvas.fillStyle=clrGB;
|
|
40348
|
+
this.Canvas.fillRect(rtDraw.Left ,rtDraw.Top, (rtDraw.Width), (rtDraw.Height));
|
|
40349
|
+
}
|
|
40350
|
+
|
|
40351
|
+
if (clrBorder)
|
|
40352
|
+
{
|
|
40353
|
+
this.Canvas.lineWidth=2;
|
|
40354
|
+
this.Canvas.strokeStyle=clrBorder;
|
|
40355
|
+
this.Canvas.strokeRect(rtDraw.Left, rtDraw.Top, rtDraw.Width, rtDraw.Height);
|
|
40356
|
+
}
|
|
40357
|
+
else
|
|
40358
|
+
{
|
|
40359
|
+
this.Canvas.lineWidth=1;
|
|
40360
|
+
this.Canvas.strokeStyle="rgb(0,0,0)";
|
|
40361
|
+
this.Canvas.strokeRect(rtDraw.Left, rtDraw.Top, rtDraw.Width, rtDraw.Height);
|
|
40362
|
+
}
|
|
40363
|
+
|
|
40364
|
+
var aryText=[null, null]; //大于3位数的 2行输出
|
|
40365
|
+
var sign=""; //负数
|
|
40366
|
+
if (value<0)
|
|
40367
|
+
{
|
|
40368
|
+
value=Math.abs(value);
|
|
40369
|
+
sign='-';
|
|
40370
|
+
}
|
|
40371
|
+
|
|
40372
|
+
if (value>999)
|
|
40373
|
+
{
|
|
40374
|
+
var thousand=parseInt(value/1000);
|
|
40375
|
+
var hundred=parseInt(value%1000);
|
|
40376
|
+
|
|
40377
|
+
aryText[0]=`${sign}${thousand}`;
|
|
40378
|
+
aryText[1]=`${hundred}`;
|
|
40379
|
+
if (hundred<10) aryText[1]=`00${hundred}`;
|
|
40380
|
+
else if (hundred<100) aryText[1]=`0${hundred}`;
|
|
40381
|
+
}
|
|
40382
|
+
else
|
|
40383
|
+
{
|
|
40384
|
+
aryText[1]=`${sign}${value.toFixed(0)}`;
|
|
40385
|
+
}
|
|
40386
|
+
|
|
40387
|
+
this.Canvas.textAlign="right";
|
|
40388
|
+
this.Canvas.textBaseline="top";
|
|
40389
|
+
var xRight=rtDraw.Right-(rtDraw.Right-rtDraw.Left-textWidth)/2;
|
|
40390
|
+
|
|
40391
|
+
this.Canvas.fillStyle=clrText;
|
|
40392
|
+
var yText=textMargin.Top+rtDraw.Top;
|
|
40393
|
+
for(var i=0;i<aryText.length;++i)
|
|
40394
|
+
{
|
|
40395
|
+
var text=aryText[i];
|
|
40396
|
+
if (text)
|
|
40397
|
+
{
|
|
40398
|
+
this.Canvas.fillText(text,xRight,yText);
|
|
40399
|
+
}
|
|
40400
|
+
|
|
40401
|
+
yText+=textHeight;
|
|
40402
|
+
}
|
|
40403
|
+
}
|
|
40404
|
+
|
|
40238
40405
|
this.GetMaxMin=function()
|
|
40239
40406
|
{
|
|
40240
40407
|
if (!IFrameSplitOperator.IsNumber(this.BaseValue) || this.BaseValue==0)
|
|
@@ -40297,13 +40464,36 @@ function ChartClipColorStick()
|
|
|
40297
40464
|
|
|
40298
40465
|
if (this.BaseValue>0)
|
|
40299
40466
|
{
|
|
40300
|
-
if (
|
|
40301
|
-
|
|
40467
|
+
if (this.Style==1)
|
|
40468
|
+
{
|
|
40469
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue))
|
|
40470
|
+
{
|
|
40471
|
+
var value=this.BaseValue+maxDiffValue;
|
|
40472
|
+
if (IFrameSplitOperator.IsNumber(range.Max) || range.Max<value) range.Max=value;
|
|
40473
|
+
}
|
|
40474
|
+
}
|
|
40475
|
+
else
|
|
40476
|
+
{
|
|
40477
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue) && IFrameSplitOperator.IsNumber(range.Min))
|
|
40478
|
+
range.Min-=maxDiffValue;
|
|
40479
|
+
}
|
|
40480
|
+
|
|
40302
40481
|
}
|
|
40303
40482
|
else
|
|
40304
40483
|
{
|
|
40305
|
-
if (
|
|
40306
|
-
|
|
40484
|
+
if (this.Style==1)
|
|
40485
|
+
{
|
|
40486
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue))
|
|
40487
|
+
{
|
|
40488
|
+
var value=this.BaseValue-maxDiffValue;
|
|
40489
|
+
if (IFrameSplitOperator.IsNumber(range.Min) || range.Min>value) range.Min=value;
|
|
40490
|
+
}
|
|
40491
|
+
}
|
|
40492
|
+
else
|
|
40493
|
+
{
|
|
40494
|
+
if (IFrameSplitOperator.IsNumber(maxDiffValue) && IFrameSplitOperator.IsNumber(range.Max))
|
|
40495
|
+
range.Max+=maxDiffValue;
|
|
40496
|
+
}
|
|
40307
40497
|
}
|
|
40308
40498
|
|
|
40309
40499
|
return range;
|
|
@@ -142951,7 +143141,7 @@ function HQChartScriptWorker()
|
|
|
142951
143141
|
|
|
142952
143142
|
|
|
142953
143143
|
|
|
142954
|
-
var HQCHART_VERSION="1.1.
|
|
143144
|
+
var HQCHART_VERSION="1.1.13745";
|
|
142955
143145
|
|
|
142956
143146
|
function PrintHQChartVersion()
|
|
142957
143147
|
{
|