hqchart 1.1.14542 → 1.1.14552
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
|
@@ -1706,9 +1706,10 @@ this.RestoreFocus=function(delay){var _this4=this;var value=1000;if(IFrameSplitO
|
|
|
1706
1706
|
{var upperSymbol=this.Symbol?this.Symbol.toUpperCase():null;var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);return unit;};this.ClearStockCache=function(){this.StockCache.Data=null;};this.InitalPopMenu=function()//初始化弹出窗口
|
|
1707
1707
|
{if(this.JSPopMenu)return;this.JSPopMenu=new JSPopMenu();//内置菜单
|
|
1708
1708
|
this.JSPopMenu.Inital(this);};this.InitalDrawToolDialog=function(){if(this.DialogDrawTool)return;this.DialogDrawTool=new JSDialogDrawTool();this.DialogDrawTool.Inital(this);this.DialogDrawTool.Create();};this.InitalTooltipDialog=function(option){if(this.DialogTooltip)return;this.DialogTooltip=new JSDialogTooltip();this.DialogTooltip.Inital(this,option);this.DialogTooltip.Create();};this.InitalFloatTooltip=function(option){if(this.FloatTooltip)return;this.FloatTooltip=new JSFloatTooltip();this.FloatTooltip.Inital(this,option);this.FloatTooltip.Create();};this.InitalModifyDrawDialog=function(){if(this.DialogModifyDraw)return;this.DialogModifyDraw=new JSDialogModifyDraw();this.DialogModifyDraw.Inital(this);this.DialogModifyDraw.Create();};this.InitalSelectRectDialog=function(option){if(this.DialogSelectRect)return;this.DialogSelectRect=new JSDialogSelectRect();this.DialogSelectRect.Inital(this,option);this.DialogSelectRect.Create();};this.InitalSearchIndexDialog=function(option){if(this.DialogSearchIndex)return;this.DialogSearchIndex=new JSDialogSearchIndex();this.DialogSearchIndex.Inital(this,option);this.DialogSearchIndex.Create();};this.InitalModifyIndexParamDialog=function(option){if(this.DialogModifyIndexParam)return;this.DialogModifyIndexParam=new JSDialogModifyIndexParam();this.DialogModifyIndexParam.Inital(this,option);this.DialogModifyIndexParam.Create();};this.ShowChangeIndexDialog=function(data){if(!data)return;if(!this.DialogSearchIndex)return;data.Title='\u5207\u6362\u6307\u6807 [\u7A97\u53E3'+(data.WindowIndex+1)+']';this.DialogSearchIndex.SetOpData(data);this.DialogSearchIndex.Show();};this.ShowAddOverlayIndexDialog=function(data){if(!data)return;if(!this.DialogSearchIndex)return;data.Title='\u6DFB\u52A0\u53E0\u52A0\u6307\u6807 [\u7A97\u53E3'+(data.WindowIndex+1)+']';this.DialogSearchIndex.SetOpData(data);this.DialogSearchIndex.Show();};//添加指标窗口
|
|
1709
|
-
this.ShowAddIndexWindowDialog=function(option){if(!this.DialogSearchIndex)return;var data=option;if(!data)data={};data.OpType=3;data.Title='\u589E\u52A0\u6307\u6807\u7A97\u53E3';this.DialogSearchIndex.SetOpData(data);this.DialogSearchIndex.Show();};this.ShowModifyIndexParamDialog=function(data){if(!this.DialogModifyIndexParam)return;if(data.Type==1){var indexScript=this.WindowIndex[data.WindowIndex];if(!indexScript)return;data.IndexScript=indexScript;data.Title='['+indexScript.Name+']\u53C2\u6570\u4FEE\u6539 \u7A97\u53E3['+(data.WindowIndex+1)+']';}else if(data.Type==2){var overlayIndex=this.GetOverlayIndexByIdentify(data.Identify);if(!overlayIndex||!overlayIndex.OverlayItem.Script)return;var indexScript=overlayIndex.OverlayItem.Script;data.IndexScript=indexScript;data.Title='['+indexScript.Name+']\u53C2\u6570\u4FEE\u6539 \u53E0\u52A0\u7A97\u53E3['+(data.WindowIndex+1)+']';}this.DialogModifyIndexParam.SetIndexData(data);this.DialogModifyIndexParam.Show();};this.DrawSelectRectDialog=function(){};this.IsShowSelectRectDialog=function(){if(!this.DialogSelectRect)return false;return this.DialogSelectRect.IsShow();};this.ShowDrawToolDialog=function(x,y){if(!this.DialogDrawTool)return;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var top=this.UIElement.offsetTop+15;var left=this.UIElement.offsetWidth-this.DialogDrawTool.DivDialog.offsetWidth-15;left+=rtClient.left+rtScroll.Left;top+=rtClient.top+rtScroll.Top;this.DialogDrawTool.Show(left,top);};this.IsShowDrawToolDialog=function(){if(!this.DialogDrawTool)return false;return this.DialogDrawTool.IsShow();};this.ShowModifyDrawDialog=function(chart,x,y){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.SetChartPicture(chart);if(this.DialogModifyDraw.IsShow())return;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var top=this.UIElement.offsetTop+15;var left=(this.UIElement.offsetWidth-this.DialogModifyDraw.DivDialog.offsetWidth)/2;left+=rtClient.left+rtScroll.Left;top+=rtClient.top+rtScroll.Top;this.DialogModifyDraw.Show(left,top);};this.CloseModifyDrawDialog=function(){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.Close();};this.IsShowTooltipDialog=function(){if(!this.DialogTooltip)return false;return this.DialogTooltip.IsShow();};this.CloseTooltipDialog=function(){if(!this.DialogTooltip)return;this.DialogTooltip.Close();};this.HideFloatTooltip=function(){if(!this.FloatTooltip)return;this.FloatTooltip.Hide();};this.DestroyTooltipDialog=function(){if(!this.DialogTooltip)return;this.DialogTooltip.Destroy();this.DialogTooltip=null;};this.DestroyFloatTooltip=function(){if(!this.FloatTooltip)return;this.FloatTooltip.Destroy();this.FloatTooltip=null;};this.DestroySearchIndexDialog=function(){if(!this.DialogSearchIndex)return;this.DialogSearchIndex.Destroy();this.DialogSearchIndex=null;}
|
|
1709
|
+
this.ShowAddIndexWindowDialog=function(option){if(!this.DialogSearchIndex)return;var data=option;if(!data)data={};data.OpType=3;data.Title='\u589E\u52A0\u6307\u6807\u7A97\u53E3';this.DialogSearchIndex.SetOpData(data);this.DialogSearchIndex.Show();};this.ShowModifyIndexParamDialog=function(data){if(!this.DialogModifyIndexParam)return;if(data.Type==1){var indexScript=this.WindowIndex[data.WindowIndex];if(!indexScript)return;data.IndexScript=indexScript;data.Title='['+indexScript.Name+']\u53C2\u6570\u4FEE\u6539 \u7A97\u53E3['+(data.WindowIndex+1)+']';}else if(data.Type==2){var overlayIndex=this.GetOverlayIndexByIdentify(data.Identify);if(!overlayIndex||!overlayIndex.OverlayItem.Script)return;var indexScript=overlayIndex.OverlayItem.Script;data.IndexScript=indexScript;data.Title='['+indexScript.Name+']\u53C2\u6570\u4FEE\u6539 \u53E0\u52A0\u7A97\u53E3['+(data.WindowIndex+1)+']';}this.DialogModifyIndexParam.SetIndexData(data);this.DialogModifyIndexParam.Show();};this.DrawSelectRectDialog=function(){};this.IsShowSelectRectDialog=function(){if(!this.DialogSelectRect)return false;return this.DialogSelectRect.IsShow();};this.ShowDrawToolDialog=function(x,y){if(!this.DialogDrawTool)return;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var top=this.UIElement.offsetTop+15;var left=this.UIElement.offsetWidth-this.DialogDrawTool.DivDialog.offsetWidth-15;left+=rtClient.left+rtScroll.Left;top+=rtClient.top+rtScroll.Top;this.DialogDrawTool.Show(left,top);};this.IsShowDrawToolDialog=function(){if(!this.DialogDrawTool)return false;return this.DialogDrawTool.IsShow();};this.ShowModifyDrawDialog=function(chart,x,y){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.SetChartPicture(chart);if(this.DialogModifyDraw.IsShow())return;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var top=this.UIElement.offsetTop+15;var left=(this.UIElement.offsetWidth-this.DialogModifyDraw.DivDialog.offsetWidth)/2;left+=rtClient.left+rtScroll.Left;top+=rtClient.top+rtScroll.Top;this.DialogModifyDraw.Show(left,top);};this.CloseModifyDrawDialog=function(){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.Close();};this.IsShowTooltipDialog=function(){if(!this.DialogTooltip)return false;return this.DialogTooltip.IsShow();};this.CloseTooltipDialog=function(){if(!this.DialogTooltip)return;this.DialogTooltip.Close();};this.HideFloatTooltip=function(){if(!this.FloatTooltip)return;this.FloatTooltip.Hide();};this.DestroyTooltipDialog=function(){if(!this.DialogTooltip)return;this.DialogTooltip.Destroy();this.DialogTooltip=null;};this.DestroyFloatTooltip=function(){if(!this.FloatTooltip)return;this.FloatTooltip.Destroy();this.FloatTooltip=null;};this.DestroySearchIndexDialog=function(){if(!this.DialogSearchIndex)return;this.DialogSearchIndex.Destroy();this.DialogSearchIndex=null;};this.DestroyDialogDrawTool=function(){if(!this.DialogDrawTool)return;this.DialogDrawTool.Destroy();this.DialogDrawTool=null;};this.DestroyDialogModifyIndexParam=function(){if(this.DialogModifyIndexParam)return;this.DialogModifyIndexParam.Destroy();this.DialogModifyIndexParam=null;};this.DestroyDialogSelectRect=function(){if(!this.DialogSelectRect)return;this.DialogSelectRect.Destroy();this.DialogSelectRect=null;};this.DestroyDialogModifyDraw=function(){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.Destroy();this.DialogModifyDraw=null;};//隐藏内置的弹框div
|
|
1710
|
+
this.HideAllPopDiv=function(){this.HideFloatTooltip();this.CloseTooltipDialog();if(this.DialogDrawTool)this.DialogDrawTool.Close();this.CloseModifyDrawDialog();if(this.DialogSelectRect)this.DialogSelectRect.Close();if(this.DialogSearchIndex)this.DialogSearchIndex.Close();if(this.DialogModifyIndexParam)this.DialogModifyIndexParam.Close();};//obj={ Element:, Canvas: }
|
|
1710
1711
|
this.SetCorssCursorElement=function(obj){if(!obj||!obj.Element||!obj.Canvas)return;this.CorssCursorElement=obj.Element;this.CorssCursorCanvas=obj.Canvas;};this.StopDisplayLatest=function(){this.GlobalOption.IsDisplayLatest=false;if(this.DisplayLatestOption.Timer){clearTimeout(this.DisplayLatestOption.Timer);this.DisplayLatestOption.Timer=null;}};this.StartStopDisplayLatest=function(){var _this5=this;this.StopDisplayLatest();if(!this.DisplayLatestOption.Enable)return;this.DisplayLatestOption.Timer=setTimeout(function(){if(_this5.DisplayLatest){JSConsole.Chart.Log('[JSChartContainer:StartStopDisplayLatest] call this.DisplayLatest()');_this5.DisplayLatest();}},this.DisplayLatestOption.DelayTime);};this.StopDrawDynamicInfo=function(){if(this.DrawDynamicInfoOption.Timer){clearTimeout(this.DrawDynamicInfoOption.Timer);this.DrawDynamicInfoOption.Timer=null;}};this.ChartDestroy=function()//销毁
|
|
1711
|
-
{this.IsDestroy=true;this.StopAutoUpdate();this.DestroyTooltipDialog();this.DestroyFloatTooltip();this.DestroySearchIndexDialog();};this.ChartDestory=this.ChartDestroy;//老版本写错了,需要兼容下
|
|
1712
|
+
{this.IsDestroy=true;this.StopAutoUpdate();this.DestroyTooltipDialog();this.DestroyFloatTooltip();this.DestroySearchIndexDialog();this.DestroyDialogModifyIndexParam();this.DestroyDialogDrawTool();this.DestroyDialogModifyDraw();this.DestroyDialogSelectRect();};this.ChartDestory=this.ChartDestroy;//老版本写错了,需要兼容下
|
|
1712
1713
|
//设置焦点
|
|
1713
1714
|
this.SetFocus=function(){if(this.UIElement)this.UIElement.focus();};//设置事件回调
|
|
1714
1715
|
//{event:事件id, callback:回调函数}
|
|
@@ -4167,18 +4168,22 @@ this.Color="rgb(255,193,37)";//线段颜色
|
|
|
4167
4168
|
this.BarType=0;//柱子类型 0=实心 1=空心 -1=画虚线空心柱
|
|
4168
4169
|
this.LineDotted=[3,3];//虚线设置
|
|
4169
4170
|
this.Width=0;//柱子宽度 0=1 3,50=k线宽度 101=K线宽度+间距宽度
|
|
4171
|
+
this.IsHScreen=false;this.EmptyBGColor=null;//空心柱子背景色(缓存)
|
|
4172
|
+
this.BarCache={};//Type:1=线段 2=柱子
|
|
4170
4173
|
this.SetEmptyBar=function()//设置空心柱子
|
|
4171
|
-
{if(this.BarType!=1&&this.BarType!=-1)return false;this.
|
|
4172
|
-
{this.
|
|
4173
|
-
|
|
4174
|
-
{this.
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
if(this.
|
|
4179
|
-
{if(
|
|
4180
|
-
{if(
|
|
4181
|
-
this.Canvas.
|
|
4174
|
+
{if(this.BarType!=1&&this.BarType!=-1)return false;var emptyBGColor=g_JSChartResource.EmptyBarBGColor;if(emptyBGColor)this.BarCache.EmptyBGColor=emptyBGColor;if(this.BarType==-1)this.BarCache.LineDotted=this.LineDotted;return true;};this.IsEmptyBar=function(){return this.BarType==1||this.BarType==-1;};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;}if(!this.Data||!this.Data.Data)return;var pixelRatio=GetDevicePixelRatio();this.BarCache={Color:this.Color,EmptyBGColor:null,Width:1*pixelRatio,Type:0,LineDotted:null};this.IsHScreen=this.ChartFrame.IsHScreen===true;;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+g_JSChartResource.FrameLeftMargin;if(this.IsHScreen){chartright=this.ChartBorder.GetBottom();xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}var isMinute=this.IsMinuteFrame();if(isMinute){if(this.Width>1)this.BarCache.Width=2*pixelRatio;this.BarCache.Type=1;}else if(this.Width<=0)//宽度时0,使用宽度1
|
|
4175
|
+
{this.BarCache.Type=1;this.SetEmptyBar();}else if(this.Width==3||this.Width==50)//3和50 K线宽度
|
|
4176
|
+
{this.BarCache.Type=1;if(dataWidth>=4){this.BarCache.Type=2;this.BarCache.Width=dataWidth;this.SetEmptyBar();}}else if(this.Width==101)//柱子+间距
|
|
4177
|
+
{this.BarCache.Type=1;var lineWidth=dataWidth+distanceWidth+1*pixelRatio;if(lineWidth>=4){this.BarCache.Type=2;this.BarCache.Width=lineWidth;this.SetEmptyBar();}}else if(this.Width<=3){var minWidth=2*pixelRatio;var barWidth=dataWidth*(this.Width/3);if(barWidth<minWidth)barWidth=minWidth;this.BarCache.Type=1;if(barWidth>=4){this.BarCache.Type=2;this.BarCache.Width=barWidth;this.SetEmptyBar();}}else{var barWidth=this.Width*pixelRatio+dataWidth;this.BarCache.Type=2;this.BarCache.Width=barWidth;this.SetEmptyBar();}this.Canvas.save();this.ClipClient(this.IsHScreen);this.Canvas.strokeStyle=this.BarCache.Color;if(this.BarCache.EmptyBGColor)this.Canvas.fillStyle=this.BarCache.EmptyBGColor;//空心柱子
|
|
4178
|
+
else this.Canvas.fillStyle=this.BarCache.Color;if(IFrameSplitOperator.IsNonEmptyArray(this.BarCache.LineDotted))this.Canvas.setLineDash(this.BarCache.LineDotted);//虚线
|
|
4179
|
+
if(this.BarCache.Type==1)this.Canvas.lineWidth=this.BarCache.Width;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)continue;if(!IFrameSplitOperator.IsNumber(value.Value))continue;var price=value.Value;var price2=0;if(IFrameSplitOperator.IsNumber(value.Value2))price2=value.Value2;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;var x=left+(right-left)/2;}var y=this.ChartFrame.GetYFromData(price,false);var y2=this.ChartFrame.GetYFromData(price2,false);if(x>chartright)break;var xCenter=x;var yTop=Math.min(y,y2);var barHeight=Math.abs(y-y2);//柱子高度
|
|
4180
|
+
this.DrawBar(xCenter,yTop,barHeight);}this.Canvas.restore();};this.DrawBar=function(xCenter,ytop,barHeight){if(barHeight<1)barHeight=1;if(this.BarCache.Type==1)//线段
|
|
4181
|
+
{if(this.IsHScreen){this.Canvas.beginPath();this.Canvas.moveTo(ytop,ToFixedPoint(xCenter));this.Canvas.lineTo(ytop+barHeight,ToFixedPoint(xCenter));this.Canvas.stroke();}else{this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(xCenter),ytop);this.Canvas.lineTo(ToFixedPoint(xCenter),ytop+barHeight);this.Canvas.stroke();}}else if(this.BarCache.Type==2)//柱子
|
|
4182
|
+
{if(this.IsHScreen){var xLeft=xCenter-this.BarCache.Width/2;if(this.IsEmptyBar())//空心
|
|
4183
|
+
{if(this.BarCache.EmptyBGColor)//背景色填充
|
|
4184
|
+
this.Canvas.fillRect(ToFixedRect(ytop),ToFixedRect(xLeft),ToFixedRect(barHeight),ToFixedRect(this.BarCache.Width));this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(ytop),ToFixedPoint(xLeft),ToFixedRect(barHeight),ToFixedRect(this.BarCache.Width));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(ytop),ToFixedRect(xLeft),ToFixedRect(barHeight),ToFixedRect(this.BarCache.Width));}}else{var xLeft=xCenter-this.BarCache.Width/2;if(this.IsEmptyBar())//空心
|
|
4185
|
+
{if(this.BarCache.EmptyBGColor)//背景色填充
|
|
4186
|
+
this.Canvas.fillRect(ToFixedRect(xLeft),ToFixedRect(ytop),ToFixedRect(this.BarCache.Width),ToFixedRect(barHeight));this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(xLeft),ToFixedPoint(ytop),ToFixedRect(this.BarCache.Width),ToFixedRect(barHeight));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(xLeft),ToFixedRect(ytop),ToFixedRect(this.BarCache.Width),ToFixedRect(barHeight));}}}};this.GetMaxMin=function(){var xPointCount=this.ChartFrame.XPointCount;var range={};range.Min=null;range.Max=null;if(!this.Data||!this.Data.Data)return range;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var data=this.Data.Data[i];if(data==null)continue;var value2=data.Value2;if(value2==null)value2=0;if(data==null||isNaN(data.Value)||isNaN(value2))continue;var valueMax=Math.max(data.Value,value2);var valueMin=Math.min(data.Value,value2);if(range.Max==null)range.Max=valueMax;if(range.Min==null)range.Min=valueMin;if(range.Max<valueMax)range.Max=valueMax;if(range.Min>valueMin)range.Min=valueMin;}return range;};}function ChartText(){this.newMethod=IChartPainting;//派生
|
|
4182
4187
|
this.newMethod();delete this.newMethod;this.ClassName='ChartText';//类名
|
|
4183
4188
|
this.TextFont="14px 微软雅黑";this.Draw=function(){if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(!this.Data||!this.Data.Data)return;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var chartright=this.ChartBorder.GetRight();var xPointCount=this.ChartFrame.XPointCount;for(var i in this.Data.Data){var value=this.Data.Data[i];if(value==null)continue;var price=value.Value;var position=value.Position;if(position=='Left'){var x=this.ChartFrame.GetXFromIndex(0);var y=this.ChartFrame.GetYFromData(price);if(x>chartright)continue;this.Canvas.textAlign='left';this.Canvas.textBaseline='middle';this.Canvas.fillStyle=value.Color;this.Canvas.font=this.TextFont;this.Canvas.fillText(value.Message,x,y);}}};this.GetMaxMin=function(){var xPointCount=this.ChartFrame.XPointCount;var range={};range.Min=null;range.Max=null;if(!this.Data||!this.Data.Data)return range;for(var i in this.Data.Data){var data=this.Data.Data[i];if(data==null||isNaN(data.Value))continue;var value=data.Value;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;}return range;};}/*
|
|
4184
4189
|
文字输出 支持横屏
|
|
@@ -14650,7 +14655,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14650
14655
|
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);};}/********************************************************************************
|
|
14651
14656
|
* 版本信息输出
|
|
14652
14657
|
*
|
|
14653
|
-
*/var HQCHART_VERSION="1.1.
|
|
14658
|
+
*/var HQCHART_VERSION="1.1.14551";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();//把给外界调用的方法暴露出来
|
|
14654
14659
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14655
14660
|
// BaseIndex:BaseIndex,
|
|
14656
14661
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -3425,6 +3425,51 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3425
3425
|
this.DialogSearchIndex=null;
|
|
3426
3426
|
}
|
|
3427
3427
|
|
|
3428
|
+
this.DestroyDialogDrawTool=function()
|
|
3429
|
+
{
|
|
3430
|
+
if (!this.DialogDrawTool) return;
|
|
3431
|
+
|
|
3432
|
+
this.DialogDrawTool.Destroy();
|
|
3433
|
+
this.DialogDrawTool=null;
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
this.DestroyDialogModifyIndexParam=function()
|
|
3437
|
+
{
|
|
3438
|
+
if (this.DialogModifyIndexParam) return;
|
|
3439
|
+
|
|
3440
|
+
this.DialogModifyIndexParam.Destroy();
|
|
3441
|
+
this.DialogModifyIndexParam=null;
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
this.DestroyDialogSelectRect=function()
|
|
3445
|
+
{
|
|
3446
|
+
if (!this.DialogSelectRect) return;
|
|
3447
|
+
|
|
3448
|
+
this.DialogSelectRect.Destroy();
|
|
3449
|
+
this.DialogSelectRect=null;
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3452
|
+
this.DestroyDialogModifyDraw=function()
|
|
3453
|
+
{
|
|
3454
|
+
if (!this.DialogModifyDraw) return;
|
|
3455
|
+
|
|
3456
|
+
this.DialogModifyDraw.Destroy();
|
|
3457
|
+
this.DialogModifyDraw=null;
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3460
|
+
//隐藏内置的弹框div
|
|
3461
|
+
this.HideAllPopDiv=function()
|
|
3462
|
+
{
|
|
3463
|
+
this.HideFloatTooltip();
|
|
3464
|
+
this.CloseTooltipDialog();
|
|
3465
|
+
|
|
3466
|
+
if (this.DialogDrawTool) this.DialogDrawTool.Close();
|
|
3467
|
+
this.CloseModifyDrawDialog();
|
|
3468
|
+
|
|
3469
|
+
if (this.DialogSelectRect) this.DialogSelectRect.Close();
|
|
3470
|
+
if (this.DialogSearchIndex) this.DialogSearchIndex.Close();
|
|
3471
|
+
if (this.DialogModifyIndexParam) this.DialogModifyIndexParam.Close();
|
|
3472
|
+
}
|
|
3428
3473
|
|
|
3429
3474
|
|
|
3430
3475
|
//obj={ Element:, Canvas: }
|
|
@@ -3476,9 +3521,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3476
3521
|
{
|
|
3477
3522
|
this.IsDestroy=true;
|
|
3478
3523
|
this.StopAutoUpdate();
|
|
3524
|
+
|
|
3479
3525
|
this.DestroyTooltipDialog();
|
|
3480
3526
|
this.DestroyFloatTooltip();
|
|
3527
|
+
|
|
3481
3528
|
this.DestroySearchIndexDialog();
|
|
3529
|
+
this.DestroyDialogModifyIndexParam();
|
|
3530
|
+
|
|
3531
|
+
this.DestroyDialogDrawTool();
|
|
3532
|
+
this.DestroyDialogModifyDraw();
|
|
3533
|
+
|
|
3534
|
+
this.DestroyDialogSelectRect();
|
|
3482
3535
|
}
|
|
3483
3536
|
|
|
3484
3537
|
this.ChartDestory=this.ChartDestroy; //老版本写错了,需要兼容下
|
|
@@ -36028,23 +36081,22 @@ function ChartStickLine()
|
|
|
36028
36081
|
delete this.newMethod;
|
|
36029
36082
|
|
|
36030
36083
|
this.ClassName='ChartStickLine'; //类名
|
|
36031
|
-
this.Color="rgb(255,193,37)";
|
|
36032
|
-
this.BarType=0;
|
|
36033
|
-
this.LineDotted=[3,3];
|
|
36034
|
-
this.Width=0;
|
|
36084
|
+
this.Color="rgb(255,193,37)"; //线段颜色
|
|
36085
|
+
this.BarType=0; //柱子类型 0=实心 1=空心 -1=画虚线空心柱
|
|
36086
|
+
this.LineDotted=[3,3]; //虚线设置
|
|
36087
|
+
this.Width=0; //柱子宽度 0=1 3,50=k线宽度 101=K线宽度+间距宽度
|
|
36088
|
+
this.IsHScreen=false;
|
|
36089
|
+
|
|
36090
|
+
this.EmptyBGColor=null; //空心柱子背景色(缓存)
|
|
36091
|
+
this.BarCache={ }; //Type:1=线段 2=柱子
|
|
36035
36092
|
|
|
36036
36093
|
this.SetEmptyBar=function() //设置空心柱子
|
|
36037
36094
|
{
|
|
36038
36095
|
if (this.BarType!=1 && this.BarType!=-1) return false;
|
|
36039
36096
|
|
|
36040
|
-
this.Canvas.lineWidth=GetDevicePixelRatio();
|
|
36041
|
-
this.Canvas.strokeStyle=this.Color;
|
|
36042
36097
|
var emptyBGColor=g_JSChartResource.EmptyBarBGColor;
|
|
36043
|
-
if (emptyBGColor) this.
|
|
36044
|
-
if (this.BarType==-1)
|
|
36045
|
-
{
|
|
36046
|
-
this.Canvas.setLineDash(this.LineDotted); //虚线
|
|
36047
|
-
}
|
|
36098
|
+
if (emptyBGColor) this.BarCache.EmptyBGColor=emptyBGColor;
|
|
36099
|
+
if (this.BarType==-1) this.BarCache.LineDotted=this.LineDotted;
|
|
36048
36100
|
|
|
36049
36101
|
return true;
|
|
36050
36102
|
}
|
|
@@ -36054,13 +36106,6 @@ function ChartStickLine()
|
|
|
36054
36106
|
return (this.BarType==1 || this.BarType==-1);
|
|
36055
36107
|
}
|
|
36056
36108
|
|
|
36057
|
-
this.CalculateBarHeight=function(y,y2)
|
|
36058
|
-
{
|
|
36059
|
-
var barHeight=Math.abs(y-y2);
|
|
36060
|
-
if (barHeight<=0) barHeight=1;
|
|
36061
|
-
return barHeight;
|
|
36062
|
-
}
|
|
36063
|
-
|
|
36064
36109
|
this.Draw=function()
|
|
36065
36110
|
{
|
|
36066
36111
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
@@ -36075,81 +36120,93 @@ function ChartStickLine()
|
|
|
36075
36120
|
|
|
36076
36121
|
if (!this.Data || !this.Data.Data) return;
|
|
36077
36122
|
|
|
36078
|
-
var
|
|
36123
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
36124
|
+
this.BarCache={ Color:this.Color, EmptyBGColor:null, Width:1*pixelRatio, Type:0, LineDotted:null };
|
|
36125
|
+
|
|
36126
|
+
this.IsHScreen=(this.ChartFrame.IsHScreen===true);;
|
|
36079
36127
|
var dataWidth=this.ChartFrame.DataWidth;
|
|
36080
36128
|
var distanceWidth=this.ChartFrame.DistanceWidth;
|
|
36081
36129
|
var chartright=this.ChartBorder.GetRight();
|
|
36082
|
-
var zoomIndex=this.ChartFrame.ZoomIndex;
|
|
36083
|
-
if (isHScreen) chartright=this.ChartBorder.GetBottom();
|
|
36084
36130
|
var xPointCount=this.ChartFrame.XPointCount;
|
|
36085
36131
|
var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
36086
|
-
if (
|
|
36132
|
+
if (this.IsHScreen)
|
|
36133
|
+
{
|
|
36134
|
+
chartright=this.ChartBorder.GetBottom();
|
|
36135
|
+
xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
|
|
36136
|
+
}
|
|
36087
36137
|
|
|
36088
36138
|
var isMinute=this.IsMinuteFrame();
|
|
36089
36139
|
|
|
36090
|
-
this.Canvas.save();
|
|
36091
|
-
var bFillBar=false;
|
|
36092
|
-
var bFillKLine=false;
|
|
36093
|
-
var emptyBGColor=g_JSChartResource.EmptyBarBGColor;
|
|
36094
|
-
|
|
36095
36140
|
if (isMinute)
|
|
36096
36141
|
{
|
|
36097
|
-
if (this.Width>1) this.
|
|
36098
|
-
|
|
36099
|
-
this.Canvas.strokeStyle=this.Color;
|
|
36142
|
+
if (this.Width>1) this.BarCache.Width=2*pixelRatio;
|
|
36143
|
+
this.BarCache.Type=1;
|
|
36100
36144
|
}
|
|
36101
|
-
else if(this.Width
|
|
36145
|
+
else if(this.Width<=0) //宽度时0,使用宽度1
|
|
36102
36146
|
{
|
|
36147
|
+
this.BarCache.Type=1;
|
|
36103
36148
|
this.SetEmptyBar();
|
|
36104
|
-
this.Canvas.lineWidth=GetDevicePixelRatio();
|
|
36105
|
-
this.Canvas.strokeStyle=this.Color;
|
|
36106
36149
|
}
|
|
36107
36150
|
else if (this.Width==3 || this.Width==50) //3和50 K线宽度
|
|
36108
36151
|
{
|
|
36152
|
+
this.BarCache.Type=1;
|
|
36109
36153
|
if (dataWidth>=4)
|
|
36110
36154
|
{
|
|
36111
|
-
|
|
36155
|
+
this.BarCache.Type=2;
|
|
36156
|
+
this.BarCache.Width=dataWidth;
|
|
36112
36157
|
this.SetEmptyBar();
|
|
36113
|
-
if (!this.IsEmptyBar()) this.Canvas.fillStyle=this.Color;
|
|
36114
|
-
this.Canvas.strokeStyle=this.Color;
|
|
36115
36158
|
}
|
|
36116
|
-
else //太细了 画竖线
|
|
36117
|
-
{
|
|
36118
|
-
this.Canvas.lineWidth=GetDevicePixelRatio();
|
|
36119
|
-
this.Canvas.strokeStyle=this.Color;
|
|
36120
|
-
}
|
|
36121
36159
|
}
|
|
36122
|
-
else if (this.Width==101)
|
|
36160
|
+
else if (this.Width==101) //柱子+间距
|
|
36123
36161
|
{
|
|
36124
|
-
|
|
36125
|
-
|
|
36126
|
-
|
|
36162
|
+
this.BarCache.Type=1;
|
|
36163
|
+
var lineWidth=dataWidth+distanceWidth+1*pixelRatio;
|
|
36164
|
+
if (lineWidth>=4)
|
|
36165
|
+
{
|
|
36166
|
+
this.BarCache.Type=2;
|
|
36167
|
+
this.BarCache.Width=lineWidth
|
|
36168
|
+
this.SetEmptyBar();
|
|
36169
|
+
}
|
|
36127
36170
|
}
|
|
36128
36171
|
else if (this.Width<=3)
|
|
36129
36172
|
{
|
|
36130
|
-
var minWidth=2*
|
|
36173
|
+
var minWidth=2*pixelRatio;
|
|
36131
36174
|
var barWidth=dataWidth*(this.Width/3);
|
|
36132
36175
|
if (barWidth<minWidth) barWidth=minWidth;
|
|
36133
|
-
this.
|
|
36134
|
-
if (
|
|
36135
|
-
|
|
36176
|
+
this.BarCache.Type=1;
|
|
36177
|
+
if (barWidth>=4)
|
|
36178
|
+
{
|
|
36179
|
+
this.BarCache.Type=2;
|
|
36180
|
+
this.BarCache.Width=barWidth;
|
|
36181
|
+
this.SetEmptyBar();
|
|
36182
|
+
}
|
|
36136
36183
|
}
|
|
36137
36184
|
else
|
|
36138
36185
|
{
|
|
36139
|
-
var barWidth=this.Width*
|
|
36186
|
+
var barWidth=this.Width*pixelRatio+dataWidth;
|
|
36187
|
+
this.BarCache.Type=2;
|
|
36188
|
+
this.BarCache.Width=barWidth;
|
|
36140
36189
|
this.SetEmptyBar();
|
|
36141
|
-
if (!this.IsEmptyBar()) this.Canvas.fillStyle=this.Color;
|
|
36142
|
-
bFillBar=true;
|
|
36143
36190
|
}
|
|
36144
36191
|
|
|
36192
|
+
this.Canvas.save();
|
|
36193
|
+
this.ClipClient(this.IsHScreen);
|
|
36194
|
+
|
|
36195
|
+
this.Canvas.strokeStyle=this.BarCache.Color;
|
|
36196
|
+
if (this.BarCache.EmptyBGColor) this.Canvas.fillStyle=this.BarCache.EmptyBGColor; //空心柱子
|
|
36197
|
+
else this.Canvas.fillStyle=this.BarCache.Color;
|
|
36198
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.BarCache.LineDotted)) this.Canvas.setLineDash(this.BarCache.LineDotted); //虚线
|
|
36199
|
+
if (this.BarCache.Type==1) this.Canvas.lineWidth=this.BarCache.Width;
|
|
36200
|
+
|
|
36145
36201
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
36146
36202
|
{
|
|
36147
36203
|
var value=this.Data.Data[i];
|
|
36148
|
-
if (value
|
|
36204
|
+
if (!value) continue;
|
|
36205
|
+
if (!IFrameSplitOperator.IsNumber(value.Value)) continue;
|
|
36149
36206
|
|
|
36150
36207
|
var price=value.Value;
|
|
36151
|
-
var price2=
|
|
36152
|
-
if (
|
|
36208
|
+
var price2=0;
|
|
36209
|
+
if (IFrameSplitOperator.IsNumber(value.Value2)) price2=value.Value2;
|
|
36153
36210
|
|
|
36154
36211
|
if (isMinute)
|
|
36155
36212
|
{
|
|
@@ -36162,103 +36219,79 @@ function ChartStickLine()
|
|
|
36162
36219
|
var x=left+(right-left)/2;
|
|
36163
36220
|
}
|
|
36164
36221
|
|
|
36165
|
-
var y=this.ChartFrame.GetYFromData(price);
|
|
36166
|
-
var y2=this.ChartFrame.GetYFromData(price2);
|
|
36222
|
+
var y=this.ChartFrame.GetYFromData(price,false);
|
|
36223
|
+
var y2=this.ChartFrame.GetYFromData(price2,false);
|
|
36167
36224
|
|
|
36168
36225
|
if (x>chartright) break;
|
|
36169
36226
|
|
|
36170
|
-
|
|
36171
|
-
|
|
36172
|
-
|
|
36173
|
-
{
|
|
36174
|
-
var left=x-barWidth/2;
|
|
36175
|
-
var width=barWidth;
|
|
36176
|
-
if (this.IsEmptyBar()) //空心
|
|
36177
|
-
{
|
|
36178
|
-
this.Canvas.beginPath();
|
|
36179
|
-
this.Canvas.rect(ToFixedPoint(Math.min(y,y2)),ToFixedPoint(left),ToFixedRect(Math.abs(y-y2)),ToFixedRect(width));
|
|
36180
|
-
this.Canvas.stroke();
|
|
36181
|
-
}
|
|
36182
|
-
else
|
|
36183
|
-
{
|
|
36184
|
-
this.Canvas.fillRect(ToFixedRect(Math.min(y,y2)),ToFixedRect(left),ToFixedRect(Math.abs(y-y2)),ToFixedRect(width));
|
|
36185
|
-
}
|
|
36186
|
-
}
|
|
36187
|
-
else
|
|
36188
|
-
{
|
|
36189
|
-
var left=x-barWidth/2;
|
|
36190
|
-
var width=barWidth;
|
|
36191
|
-
if (left+width>chartright) width=chartright-left; //不要超过右边框子
|
|
36192
|
-
if (this.IsEmptyBar()) //空心
|
|
36193
|
-
{
|
|
36194
|
-
if (emptyBGColor)
|
|
36195
|
-
this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,y2)),ToFixedRect(width),ToFixedRect(Math.abs(y-y2)));
|
|
36227
|
+
var xCenter=x;
|
|
36228
|
+
var yTop=Math.min(y,y2);
|
|
36229
|
+
var barHeight=Math.abs(y-y2); //柱子高度
|
|
36196
36230
|
|
|
36197
|
-
|
|
36198
|
-
|
|
36199
|
-
|
|
36200
|
-
|
|
36201
|
-
|
|
36202
|
-
|
|
36203
|
-
|
|
36204
|
-
|
|
36205
|
-
|
|
36231
|
+
this.DrawBar(xCenter, yTop, barHeight);
|
|
36232
|
+
}
|
|
36233
|
+
|
|
36234
|
+
this.Canvas.restore();
|
|
36235
|
+
}
|
|
36236
|
+
|
|
36237
|
+
this.DrawBar=function(xCenter, ytop, barHeight)
|
|
36238
|
+
{
|
|
36239
|
+
if (barHeight<1) barHeight=1;
|
|
36240
|
+
|
|
36241
|
+
if (this.BarCache.Type==1) //线段
|
|
36242
|
+
{
|
|
36243
|
+
if (this.IsHScreen)
|
|
36244
|
+
{
|
|
36245
|
+
this.Canvas.beginPath();
|
|
36246
|
+
this.Canvas.moveTo(ytop,ToFixedPoint(xCenter));
|
|
36247
|
+
this.Canvas.lineTo(ytop+barHeight,ToFixedPoint(xCenter));
|
|
36248
|
+
this.Canvas.stroke();
|
|
36206
36249
|
}
|
|
36207
|
-
else
|
|
36250
|
+
else
|
|
36208
36251
|
{
|
|
36209
|
-
|
|
36252
|
+
this.Canvas.beginPath();
|
|
36253
|
+
this.Canvas.moveTo(ToFixedPoint(xCenter),ytop);
|
|
36254
|
+
this.Canvas.lineTo(ToFixedPoint(xCenter),ytop+barHeight);
|
|
36255
|
+
this.Canvas.stroke();
|
|
36256
|
+
}
|
|
36257
|
+
}
|
|
36258
|
+
else if (this.BarCache.Type==2) //柱子
|
|
36259
|
+
{
|
|
36260
|
+
if (this.IsHScreen)
|
|
36261
|
+
{
|
|
36262
|
+
var xLeft=xCenter-this.BarCache.Width/2;
|
|
36263
|
+
if (this.IsEmptyBar()) //空心
|
|
36210
36264
|
{
|
|
36211
|
-
if (
|
|
36212
|
-
|
|
36213
|
-
this.Canvas.beginPath();
|
|
36214
|
-
this.Canvas.rect(ToFixedPoint(Math.min(y,y2)),ToFixedPoint(xOffset),ToFixedRect(Math.abs(y-y2)),ToFixedRect(dataWidth));
|
|
36215
|
-
this.Canvas.stroke();
|
|
36216
|
-
}
|
|
36217
|
-
else
|
|
36218
|
-
{
|
|
36219
|
-
if (emptyBGColor)
|
|
36220
|
-
this.Canvas.fillRect(ToFixedRect(xOffset),ToFixedRect(Math.min(y,y2)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(y-y2)));
|
|
36265
|
+
if (this.BarCache.EmptyBGColor) //背景色填充
|
|
36266
|
+
this.Canvas.fillRect(ToFixedRect(ytop),ToFixedRect(xLeft),ToFixedRect(barHeight),ToFixedRect(this.BarCache.Width));
|
|
36221
36267
|
|
|
36222
|
-
|
|
36223
|
-
|
|
36224
|
-
|
|
36225
|
-
}
|
|
36268
|
+
this.Canvas.beginPath();
|
|
36269
|
+
this.Canvas.rect(ToFixedPoint(ytop),ToFixedPoint(xLeft),ToFixedRect(barHeight),ToFixedRect(this.BarCache.Width));
|
|
36270
|
+
this.Canvas.stroke();
|
|
36226
36271
|
}
|
|
36227
36272
|
else
|
|
36228
36273
|
{
|
|
36229
|
-
|
|
36230
|
-
{
|
|
36231
|
-
this.Canvas.fillRect(ToFixedRect(Math.min(y,y2)),ToFixedRect(xOffset),ToFixedRect(Math.abs(y-y2)),ToFixedRect(dataWidth));
|
|
36232
|
-
}
|
|
36233
|
-
else
|
|
36234
|
-
{
|
|
36235
|
-
this.Canvas.fillRect(ToFixedRect(xOffset),ToFixedRect(Math.min(y,y2)),ToFixedRect(dataWidth),ToFixedRect(this.CalculateBarHeight(y,y2)));
|
|
36236
|
-
}
|
|
36237
|
-
|
|
36274
|
+
this.Canvas.fillRect(ToFixedRect(ytop),ToFixedRect(xLeft),ToFixedRect(barHeight),ToFixedRect(this.BarCache.Width));
|
|
36238
36275
|
}
|
|
36239
36276
|
}
|
|
36240
36277
|
else
|
|
36241
36278
|
{
|
|
36242
|
-
|
|
36279
|
+
var xLeft=xCenter-this.BarCache.Width/2;
|
|
36280
|
+
if (this.IsEmptyBar()) //空心
|
|
36243
36281
|
{
|
|
36282
|
+
if (this.BarCache.EmptyBGColor) //背景色填充
|
|
36283
|
+
this.Canvas.fillRect(ToFixedRect(xLeft),ToFixedRect(ytop),ToFixedRect(this.BarCache.Width),ToFixedRect(barHeight));
|
|
36284
|
+
|
|
36244
36285
|
this.Canvas.beginPath();
|
|
36245
|
-
this.Canvas.
|
|
36246
|
-
this.Canvas.lineTo(y2,ToFixedPoint(x));
|
|
36286
|
+
this.Canvas.rect(ToFixedPoint(xLeft),ToFixedPoint(ytop),ToFixedRect(this.BarCache.Width),ToFixedRect(barHeight));
|
|
36247
36287
|
this.Canvas.stroke();
|
|
36248
36288
|
}
|
|
36249
36289
|
else
|
|
36250
36290
|
{
|
|
36251
|
-
|
|
36252
|
-
this.Canvas.beginPath();
|
|
36253
|
-
this.Canvas.moveTo(xFix,y);
|
|
36254
|
-
if (Math.abs(y-y2)>0) this.Canvas.lineTo(xFix,y2);
|
|
36255
|
-
else this.Canvas.lineTo(xFix,y+1); //太窄了,就画一个像素的宽度
|
|
36256
|
-
this.Canvas.stroke();
|
|
36291
|
+
this.Canvas.fillRect(ToFixedRect(xLeft),ToFixedRect(ytop),ToFixedRect(this.BarCache.Width),ToFixedRect(barHeight));
|
|
36257
36292
|
}
|
|
36258
36293
|
}
|
|
36259
36294
|
}
|
|
36260
|
-
|
|
36261
|
-
this.Canvas.restore();
|
|
36262
36295
|
}
|
|
36263
36296
|
|
|
36264
36297
|
this.GetMaxMin=function()
|