hqchart 1.1.14663 → 1.1.14670
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
|
@@ -2478,7 +2478,7 @@ this.IndexTitleSpace=0;//指标标题和参数值之间的间距
|
|
|
2478
2478
|
this.IsShowIndexTitle=true;//显示整个指标标题信息
|
|
2479
2479
|
this.IsDrawTitleBottomLine=false;this.BorderLine=null;//1=上 2=下 4=左 8=右
|
|
2480
2480
|
this.Buttons=[];//按钮事件
|
|
2481
|
-
this.
|
|
2481
|
+
this.ToolbarCacheSize=null;//缓存工具条宽度{ RToolbar:{ Left:, Right }}
|
|
2482
2482
|
this.IsMinSize=false;//窗口是否最小化
|
|
2483
2483
|
this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSChartResource.FrameLogo.Font;this.LogoBGColor=g_JSChartResource.FrameLogo.BGColor;this.GlobalOption;//this.IsDrawLeftBorder;
|
|
2484
2484
|
this.IsDrawRightBorder=false;//是否绘制右侧刻度空白的边框
|
|
@@ -2486,7 +2486,7 @@ this.IsDrawLeftBorder=false;//是否绘制右侧刻度空白的边框
|
|
|
2486
2486
|
this.HorizontalLabel;//Y轴刻度标签页 (支持点击的才会有)[ { ID:, Args:[], }]
|
|
2487
2487
|
this.PtInButtons=function(x,y)//坐标是否在按钮上
|
|
2488
2488
|
{for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};//Y轴标签文字
|
|
2489
|
-
this.PtInHorizontalLabel=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalLabel))return null;for(var i=0;i<this.HorizontalLabel.length;++i){var item=this.HorizontalLabel[i];var rect=item.Rect;if(PtInRect(x,y,rect)){return{ID:item.ID,Rect:rect,Item:item.Item,LineID:item.LineID};}}return;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.HorizontalLabel=[];this.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
|
|
2489
|
+
this.PtInHorizontalLabel=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalLabel))return null;for(var i=0;i<this.HorizontalLabel.length;++i){var item=this.HorizontalLabel[i];var rect=item.Rect;if(PtInRect(x,y,rect)){return{ID:item.ID,Rect:rect,Item:item.Item,LineID:item.LineID};}}return;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.HorizontalLabel=[];this.ToolbarCacheSize=null;this.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
|
|
2490
2490
|
};this.DrawFrame=function(){};this.DrawClientBG=function(){if(!this.ClientBGColor)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
|
|
2491
2491
|
var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.ClientBGColor;this.Canvas.fillRect(left,top,width,height);};this.ClearCoordinateText=function(option){if(IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo)){for(var i=0;i<this.HorizontalInfo.length;++i){var item=this.HorizontalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}if(IFrameSplitOperator.IsNonEmptyArray(this.VerticalInfo)){for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}};//画边框
|
|
2492
2492
|
this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
|
|
@@ -2559,8 +2559,8 @@ this.FrameData={SubFrameItem:null};//窗口框架信息
|
|
|
2559
2559
|
//画图工具刻度
|
|
2560
2560
|
this.DrawPicture={BGColor:g_JSChartResource.DrawPicture.XYCoordinate.BGColor,TextBGColor:g_JSChartResource.DrawPicture.XYCoordinate.TextBGColor,TextColor:g_JSChartResource.DrawPicture.XYCoordinate.TextColor,Font:g_JSChartResource.DrawPicture.XYCoordinate.Font};this.IChartFramePainting_ReloadResource=this.ReloadResource;this.ReloadResource=function(resource){this.IChartFramePainting_ReloadResource(resource);if(!resource){this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);this.OverlayIndexButton=CloneData(g_JSChartResource.Buttons.OverlayIndex);this.ChangeIndexButton=CloneData(g_JSChartResource.Buttons.ChangeIndex);this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);this.MaxMinWindowButton=CloneData(g_JSChartResource.Buttons.MaxMinWindow);this.TitleWindowButton=CloneData(g_JSChartResource.Buttons.TitleWindow);this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);}};this.DrawFrame=function(){if(this.XPointCount>0){var dInterval=this.ChartBorder.GetWidth()/(6*this.XPointCount);//分6份, 数据4 间距2
|
|
2561
2561
|
this.DistanceWidth=2*dInterval;this.DataWidth=4*dInterval;}this.DrawHorizontal();this.DrawVertical();};this.DrawTitleButton=function(aryButton,moveonPoint,mouseStatus){var border=this.GetBorder();if(this.IsHScreen){var y=border.Bottom-3;var x=border.RightTitle+this.ChartBorder.TitleHeight/2;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);//底部开始画
|
|
2562
|
-
var yButton=0,xButton=0,bottom=0;for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Size;var xButton=bottom-size-item.Style.MerginLeft;var font=size+'px '+item.Style.Family;var color=item.Style.Color;this.Canvas.fillStyle=color;this.Canvas.font=font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Style.Text,xButton,0);var rtButton={Left:x-size/2,Right:x+size/2,Bottom:y,Width:size,Height:size+item.Style.MerginLeft};rtButton.Top=rtButton.Bottom-size-item.Style.MerginLeft;this.Buttons.push({ID:item.ID,Rect:rtButton});bottom=xButton;y=rtButton.Top;}this.Canvas.restore();}else{var right=border.Right-3;var left=border.Left;var yButton=border.Top+this.ChartBorder.TitleHeight/2
|
|
2563
|
-
for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Size;var xBotton=right-size-item.Style.MerginLeft;var font=size+'px '+item.Style.Family;var rtButton={Left:xBotton,Top:yButton-size/2,Right:xBotton+size+item.Style.MerginLeft,Bottom:yButton+size/2,Width:size+item.Style.MerginLeft,Height:size};var color=item.Style.Color;if(moveonPoint&&moveonPoint.X>=rtButton.Left&&moveonPoint.X<rtButton.Right&&moveonPoint.Y>=rtButton.Top&&moveonPoint.Y<=rtButton.Bottom){color=item.Style.MoveOnColor;if(mouseStatus)mouseStatus.MouseOnToolbar={Rect:rtButton,Item:item,Frame:this,Point:{X:moveonPoint.X,Y:moveonPoint.Y}};}this.Canvas.fillStyle=color;this.Canvas.font=font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Style.Text,xBotton,yButton);this.Buttons.push({ID:item.ID,Rect:rtButton});right=xBotton;}}};this.DrawToolbarTooltip=function(mouseOnToolbar){if(!mouseOnToolbar)return;var border=this.GetBorder();var text=null;if(mouseOnToolbar.Item.TooltipText){text=mouseOnToolbar.Item.TooltipText;}else{var key='Toolbar-'+mouseOnToolbar.Item.ID;text=g_JSChartLocalization.GetText(key,0);}if(!text)return;var pixelRatio=GetDevicePixelRatio();var canvas=this.Canvas;if(this.GetExtraCanvas){var finder=this.GetExtraCanvas(JSChart.TooltipCursorCanvasKey);if(finder)canvas=finder.Canvas;}var xCenter=mouseOnToolbar.Rect.Left+mouseOnToolbar.Rect.Width/2;canvas.font=this.ButtonTooltip.Font;canvas.textAlign="left";canvas.textBaseline="bottom";var mergin=this.ButtonTooltip.Mergin;var textWidth=canvas.measureText(text).width+mergin.Left+mergin.Right;var textHeight=this.GetFontHeight();var bgHeight=textHeight+mergin.Top+mergin.Bottom;if(mouseOnToolbar.ID=="TitleButton"){var x=mouseOnToolbar.Point.X;var y=mouseOnToolbar.Point.Y+20;}else if(JSCHART_BUTTON_ID.CLOSE_BEFOREOPEN_ID==mouseOnToolbar.Item.ID){var x=mouseOnToolbar.Rect.Right+5;var y=mouseOnToolbar.Rect.Top;}else if(JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE==mouseOnToolbar.Item.ID||JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING==mouseOnToolbar.Item.ID||mouseOnToolbar.Item.ID>=JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1&&mouseOnToolbar.Item.ID<=JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_18){var x=mouseOnToolbar.Point.X;var y=mouseOnToolbar.Point.Y+20;if(x+textWidth>=border.ChartWidth)x=border.ChartWidth-textWidth-2;}else{var x=xCenter-textWidth/2;var y=border.Top-bgHeight;if(y<0)y=border.TopEx+1;if(x+textWidth>border.ChartWidth)x=border.ChartWidth-textWidth-2;}if(IFrameSplitOperator.IsNumber(this.ButtonTooltip.BorderRadius))//圆角
|
|
2562
|
+
var yButton=0,xButton=0,bottom=0;for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Size;var xButton=bottom-size-item.Style.MerginLeft;var font=size+'px '+item.Style.Family;var color=item.Style.Color;this.Canvas.fillStyle=color;this.Canvas.font=font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Style.Text,xButton,0);var rtButton={Left:x-size/2,Right:x+size/2,Bottom:y,Width:size,Height:size+item.Style.MerginLeft};rtButton.Top=rtButton.Bottom-size-item.Style.MerginLeft;this.Buttons.push({ID:item.ID,Rect:rtButton});bottom=xButton;y=rtButton.Top;}this.Canvas.restore();}else{var right=border.Right-3;var left=border.Left;var yButton=border.Top+this.ChartBorder.TitleHeight/2;this.ToolbarCacheSize={RToolbar:{Right:right,Left:right}//右往左绘制
|
|
2563
|
+
};for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Size;var xBotton=right-size-item.Style.MerginLeft;var font=size+'px '+item.Style.Family;var rtButton={Left:xBotton,Top:yButton-size/2,Right:xBotton+size+item.Style.MerginLeft,Bottom:yButton+size/2,Width:size+item.Style.MerginLeft,Height:size};var color=item.Style.Color;if(moveonPoint&&moveonPoint.X>=rtButton.Left&&moveonPoint.X<rtButton.Right&&moveonPoint.Y>=rtButton.Top&&moveonPoint.Y<=rtButton.Bottom){color=item.Style.MoveOnColor;if(mouseStatus)mouseStatus.MouseOnToolbar={Rect:rtButton,Item:item,Frame:this,Point:{X:moveonPoint.X,Y:moveonPoint.Y}};}this.Canvas.fillStyle=color;this.Canvas.font=font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Style.Text,xBotton,yButton);this.Buttons.push({ID:item.ID,Rect:rtButton});this.ToolbarCacheSize.RToolbar.Left=rtButton.Left;right=xBotton;}}};this.DrawToolbarTooltip=function(mouseOnToolbar){if(!mouseOnToolbar)return;var border=this.GetBorder();var text=null;if(mouseOnToolbar.Item.TooltipText){text=mouseOnToolbar.Item.TooltipText;}else{var key='Toolbar-'+mouseOnToolbar.Item.ID;text=g_JSChartLocalization.GetText(key,0);}if(!text)return;var pixelRatio=GetDevicePixelRatio();var canvas=this.Canvas;if(this.GetExtraCanvas){var finder=this.GetExtraCanvas(JSChart.TooltipCursorCanvasKey);if(finder)canvas=finder.Canvas;}var xCenter=mouseOnToolbar.Rect.Left+mouseOnToolbar.Rect.Width/2;canvas.font=this.ButtonTooltip.Font;canvas.textAlign="left";canvas.textBaseline="bottom";var mergin=this.ButtonTooltip.Mergin;var textWidth=canvas.measureText(text).width+mergin.Left+mergin.Right;var textHeight=this.GetFontHeight();var bgHeight=textHeight+mergin.Top+mergin.Bottom;if(mouseOnToolbar.ID=="TitleButton"){var x=mouseOnToolbar.Point.X;var y=mouseOnToolbar.Point.Y+20;}else if(JSCHART_BUTTON_ID.CLOSE_BEFOREOPEN_ID==mouseOnToolbar.Item.ID){var x=mouseOnToolbar.Rect.Right+5;var y=mouseOnToolbar.Rect.Top;}else if(JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE==mouseOnToolbar.Item.ID||JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING==mouseOnToolbar.Item.ID||mouseOnToolbar.Item.ID>=JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1&&mouseOnToolbar.Item.ID<=JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_18){var x=mouseOnToolbar.Point.X;var y=mouseOnToolbar.Point.Y+20;if(x+textWidth>=border.ChartWidth)x=border.ChartWidth-textWidth-2;}else{var x=xCenter-textWidth/2;var y=border.Top-bgHeight;if(y<0)y=border.TopEx+1;if(x+textWidth>border.ChartWidth)x=border.ChartWidth-textWidth-2;}if(IFrameSplitOperator.IsNumber(this.ButtonTooltip.BorderRadius))//圆角
|
|
2564
2564
|
{var roundRadius=this.ButtonTooltip.BorderRadius;canvas.beginPath();canvas.roundRect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(textWidth),ToFixedRect(bgHeight),[roundRadius]);canvas.closePath();canvas.fillStyle=this.ButtonTooltip.ColorBG;canvas.fill();canvas.strokeStyle=this.ButtonTooltip.ColorBorder;canvas.stroke();canvas.fillStyle=this.ButtonTooltip.Color;canvas.fillText(text,x+mergin.Left,y+bgHeight-mergin.Bottom);}else{canvas.fillStyle=this.ButtonTooltip.ColorBG;canvas.fillRect(x,y,textWidth,bgHeight);//画一个背景色, 不然是一个黑的背景
|
|
2565
2565
|
canvas.fillStyle=this.ButtonTooltip.Color;canvas.fillText(text,x+mergin.Left,y+bgHeight-mergin.Bottom);}};//isLimit 是否限制在当前坐标下
|
|
2566
2566
|
this.GetYFromData=function(value,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromData){return this.GetYLogarithmicFromData(value,isLimit);}if(isLimit===false){if(this.CoordinateType==1){var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetTopEx()+height;}else{var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetBottomEx()-height;}}else{if(this.CoordinateType==1){if(value<=this.HorizontalMin)return this.ChartBorder.GetTopEx();if(value>=this.HorizontalMax)return this.ChartBorder.GetBottomEx();var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetTopEx()+height;}else{if(value<=this.HorizontalMin)return this.ChartBorder.GetBottomEx();if(value>=this.HorizontalMax)return this.ChartBorder.GetTopEx();var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetBottomEx()-height;}}};this.IsShowRightHorizontal=function(){var borderRight=this.ChartBorder.Right;if(borderRight<=10)return false;if(this.YTextPosition[1]==2)return false;if(this.IsShowYText[1]===false)return false;if(this.GlobalOption&&this.GlobalOption.RightHorizontal){var item=this.GlobalOption.RightHorizontal;if(item.Show===false)return false;}return true;};//画Y轴
|
|
@@ -2828,7 +2828,7 @@ divToolbar.innerHTML=spanIcon;var chart=this.ChartBorder.UIElement.JSChartContai
|
|
|
2828
2828
|
(0,_jquery2.default)("#"+divToolbar.id+" .index_param").hide();else if(typeof this.ModifyIndexEvent=='function')//绑定点击事件
|
|
2829
2829
|
(0,_jquery2.default)("#"+divToolbar.id+" .index_param").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify},this.ModifyIndexEvent);if(!this.ChangeIndex)//隐藏'换指标'
|
|
2830
2830
|
{(0,_jquery2.default)("#"+divToolbar.id+" .index_change").hide();}else if(typeof this.ChangeIndexEvent=='function'){(0,_jquery2.default)("#"+divToolbar.id+" .index_change").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify,IsOverlay:false},this.ChangeIndexEvent);}if(!this.OverlayIndex){(0,_jquery2.default)("#"+divToolbar.id+" .index_overlay").hide();}else{(0,_jquery2.default)("#"+divToolbar.id+" .index_overlay").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify,IsOverlay:true},this.ChangeIndexEvent);}(0,_jquery2.default)("#"+divToolbar.id+" .index_close").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify},function(event){var hqChart=event.data.Chart;var id=event.data.Identify;hqChart.RemoveIndexWindow(id);});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar)){for(var i=0;i<this.CustomToolbar.length;++i){var item=this.CustomToolbar[i];(0,_jquery2.default)("#"+item.ID).click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify,ID:item.ID},item.Click);}}divToolbar.style.display="block";};//手绘,不用DOM,使用DOM太麻烦了
|
|
2831
|
-
this.DrawToolbarV2=function(moveonPoint,mouseStatus){if(g_JSChartResource.IsDOMFrameToolbar===true)return;this.Buttons=[];
|
|
2831
|
+
this.DrawToolbarV2=function(moveonPoint,mouseStatus){if(g_JSChartResource.IsDOMFrameToolbar===true)return;this.Buttons=[];if(this.IsMinSize==true)return;if(this.ChartBorder.TitleHeight<5)return;var aryButton=[];//第1个窗口不能关闭
|
|
2832
2832
|
if(this.CloseIndex&&this.Identify!==0)aryButton.push({ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW,Style:this.CloseWindowButton});if(this.MaxMinWindow&&this.Identify!=0)aryButton.push({ID:JSCHART_BUTTON_ID.MAX_MIN_WINDOW,Style:this.MaxMinWindowButton});if(this.TitleWindow&&this.Identify!=0)aryButton.push({ID:JSCHART_BUTTON_ID.TITLE_WINDOW,Style:this.TitleWindowButton});if(this.ExportData)aryButton.push({ID:JSCHART_BUTTON_ID.EXPORT_DATA,Style:this.ExportDataButton});if(this.OverlayIndex)aryButton.push({ID:JSCHART_BUTTON_ID.OVERLAY_INDEX,Style:this.OverlayIndexButton});if(this.ChangeIndex)aryButton.push({ID:JSCHART_BUTTON_ID.CHANGE_INDEX,Style:this.ChangeIndexButton});if(this.ModifyIndex)aryButton.push({ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM,Style:this.ModifyIndexParamButton});if(this.AddIndexWindow)aryButton.push({ID:JSCHART_BUTTON_ID.ADD_INDEX_WINDOW,Style:this.AddIndexWindowButton});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar)){for(var i=0;i<this.CustomToolbar.length;++i){var item=this.CustomToolbar[i];if(item.ID&&item.Style){var btnItem={ID:item.ID,Style:item.Style,TooltipText:item.TooltipText,Data:item.Data};if(item.IsLeft===true)//左侧按钮
|
|
2833
2833
|
{}else{aryButton.push(btnItem);//右侧按钮
|
|
2834
2834
|
}}}}if(this.GetEventCallback){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_RIGHT_TOOLBAR);if(event&&event.Callback){var sendData={PreventDefault:false,DefaultButton:aryButton,AryButton:null,FrameID:this.Identify};/*
|
|
@@ -6124,10 +6124,11 @@ if(this.GlobalOption&&this.GlobalOption.LockCorssCursor&&this.GlobalOption.LockC
|
|
|
6124
6124
|
*/return;}var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var bottom=this.Frame.ChartBorder.GetTop()+this.Frame.ChartBorder.TitleHeight/2;//上下居中显示
|
|
6125
6125
|
var right=this.Frame.ChartBorder.GetRight();var toolbarInfo={Width:0,YCenter:bottom};this.DrawToolbar(toolbarInfo,moveonPoint,mouseStatus);left+=toolbarInfo.Width;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.font=this.Font;var pixelRatio=GetDevicePixelRatio();if(this.Title&&this.IsShowIndexName&&this.IsShowMainIndexTitle){if(this.IsDrawTitleBG){var rtButton={Left:left,YCenter:bottom,Width:0};this.DrawNameButton(rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON,Rect:rtButton,FrameID:this.Frame.Identify,Type:2});//Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
6126
6126
|
if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);this.TitleRect=rtButton;left+=rtButton.Width+3*pixelRatio;left+=this.TitleSpace;}else{var textWidth=this.Canvas.measureText(this.Title).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.Title,left,bottom,textWidth);if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}}if(this.ArgumentsText&&this.IsShowIndexName&&this.IsShowMainIndexTitle){var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.ArgumentsText,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}var isShowLastData=this.IsShowLastData();var lockRect=this.Frame.GetLockRect();if(lockRect)//指标上锁区域不显示动态标题
|
|
6127
|
-
{var index=Math.abs(this.CursorIndex);if(this.IsKLineFrame)index=this.CursorIndex;var x=this.Frame.GetXFromIndex(index.toFixed(0));if(x>=lockRect.Left)return;if(isShowLastData)return;}var rtText={Left:left,Right:left};if(this.IsMinuteFrame&&this.PointInfo&&(this.PointInfo.ClientPos==2||this.PointInfo.ClientPos==3||this.PointInfo.ClientPos>=200&&this.PointInfo.ClientPos<=299||this.PointInfo.ClientPos>=300&&this.PointInfo.ClientPos<=399)){var result={PreventDefault:false};this.DrawMainCallAuction({Left:left,Right:right,Bottom:bottom},rtText,result);if(result.PreventDefault===false)this.DrawMainIndexTitle({Left:left,Right:right,Bottom:bottom},isShowLastData,rtText);}else{
|
|
6127
|
+
{var index=Math.abs(this.CursorIndex);if(this.IsKLineFrame)index=this.CursorIndex;var x=this.Frame.GetXFromIndex(index.toFixed(0));if(x>=lockRect.Left)return;if(isShowLastData)return;}var rtText={Left:left,Right:left};if(this.IsMinuteFrame&&this.PointInfo&&(this.PointInfo.ClientPos==2||this.PointInfo.ClientPos==3||this.PointInfo.ClientPos>=200&&this.PointInfo.ClientPos<=299||this.PointInfo.ClientPos>=300&&this.PointInfo.ClientPos<=399)){var result={PreventDefault:false};this.DrawMainCallAuction({Left:left,Right:right,Bottom:bottom},rtText,result);if(result.PreventDefault===false)this.DrawMainIndexTitle({Left:left,Right:right,Bottom:bottom},isShowLastData,rtText);}else{var yRight=right;if(this.Frame.ToolbarCacheSize&&this.Frame.ToolbarCacheSize.RToolbar)yRight=this.Frame.ToolbarCacheSize.RToolbar.Left-2;//右侧按钮宽度要去掉
|
|
6128
|
+
this.DrawMainIndexTitle({Left:left,Right:yRight,Bottom:bottom},isShowLastData,rtText);if(IFrameSplitOperator.IsNumber(rtText.Bottom))bottom=rtText.Bottom;}left=rtText.Left;if(this.Explain)//说明信息
|
|
6128
6129
|
{this.Canvas.fillStyle=this.TitleColor;var text="说明:"+this.Explain;var textWidth=this.Canvas.measureText(text).width+2;if(left+textWidth<right){this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}if(this.ColorIndex&&this.IsShowColorIndexTitle){this.Canvas.fillStyle=g_JSChartResource.Title.ColorIndexColor;var tradeName=this.ColorIndex.Name+this.ColorIndex.Param;var textWidth=this.Canvas.measureText(tradeName).width+2;//后空2个像素
|
|
6129
6130
|
this.Canvas.fillText(tradeName,left,bottom,textWidth);left+=textWidth;}if(this.TradeIndex&&this.IsShowTradeIndexTitle){this.Canvas.fillStyle=g_JSChartResource.Title.TradeIndexColor;var tradeName=this.TradeIndex.Name+this.TradeIndex.Param;var textWidth=this.Canvas.measureText(tradeName).width+2;//后空2个像素
|
|
6130
|
-
this.Canvas.fillText(tradeName,left,bottom,textWidth);left+=textWidth;}if(this.OverlayIndexType.Position==1){if(!this.Frame.ChartBorder.IsShowTitleOnly)this.DrawOverlayIndexSingleLine(moveonPoint,mouseStatus);}else{var xOffset=10*GetDevicePixelRatio();//主指标区分开 间距多空点
|
|
6131
|
+
this.Canvas.fillText(tradeName,left,bottom,textWidth);left+=textWidth;}if(this.OverlayIndexType.Position==1){if(!this.Frame.ChartBorder.IsShowTitleOnly)this.DrawOverlayIndexSingleLine(moveonPoint,mouseStatus,bottom+1);}else{var xOffset=10*GetDevicePixelRatio();//主指标区分开 间距多空点
|
|
6131
6132
|
if(!this.IsShowMainIndexTitle)xOffset=0;this.DrawOverlayIndex(left+xOffset);}};this.GetTitleItem=function(item,isShowLastData,titleIndex){if(!item||!item.Data||!item.Data.Data)return null;;if(Array.isArray(item.Data.Data)&&item.Data.Data.length<=0)return null;if(item.IsShow===false)return null;if(item.IsVisible===false)return null;var valueText=null;//单值
|
|
6132
6133
|
var aryText=null;//多值
|
|
6133
6134
|
var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线只有1个数据
|
|
@@ -6140,10 +6141,13 @@ var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线
|
|
|
6140
6141
|
if(this.IsShowUpDownArrow){var preValue=null;if(dataIndex-1>=0)preValue=item.Data.Data[dataIndex-1];if(IFrameSplitOperator.IsNumber(preValue)){if(preValue>value)arrowSuper={Text:'↓',TextColor:this.UpDownArrowConfig.DownColor};else if(preValue<value)arrowSuper={Text:'↑',TextColor:this.UpDownArrowConfig.UpColor};else arrowSuper={Text:'→',TextColor:this.UpDownArrowConfig.UnchangeColor};if(this.TitleArrowType==1)arrowSuper.TextColor=item.Color;}}valueText=this.FormatValue(value,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,valueText);if(dyValue)valueText=dyValue;}if(arrowSuper){var outItem={Name:null,Text:valueText,Color:item.Color,TextEx:[arrowSuper]};if(item.Name){var text=item.Name;var dyTitle=this.GetDynamicOutName(item.Name);//动态标题
|
|
6141
6142
|
if(dyTitle)text=dyTitle;outItem.Name=text;}//outItem.BG='rgb(100,100,100)';
|
|
6142
6143
|
aryText=[outItem];valueText=null;}}}return{Text:valueText,ArrayText:aryText};};//绘制主图指标 rtText 返回画完以后的区域
|
|
6143
|
-
this.DrawMainIndexTitle=function(positionInfo,isShowLastData,rtText){if(!this.IsShowMainIndexTitle)return;var left=positionInfo.Left;var right=positionInfo.Right;var bottom=positionInfo.Bottom;var pixelRatio=GetDevicePixelRatio();for(var i=0;i<this.Data.length;++i){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText)//多变量输出
|
|
6144
|
+
this.DrawMainIndexTitle=function(positionInfo,isShowLastData,rtText){if(!this.IsShowMainIndexTitle)return;var left=positionInfo.Left;var newLineLeft=this.Frame.ChartBorder.GetLeft()+this.MerginLeft+5;var right=positionInfo.Right;var bottom=positionInfo.Bottom;var pixelRatio=GetDevicePixelRatio();var lineHeight=this.Canvas.measureText("擎").width+2;for(var i=0;i<this.Data.length;++i){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText)//多变量输出
|
|
6144
6145
|
{var text;for(var k=0;k<aryText.length;++k){var titleItem=aryText[k];if(titleItem.Name)text=titleItem.Name+":"+titleItem.Text;else text=titleItem.Text;if(IFrameSplitOperator.IsNumber(titleItem.LeftSpace))left+=titleItem.LeftSpace*pixelRatio;var space=this.ParamSpace*pixelRatio;var indexTextWidth=this.Canvas.measureText(text).width;//标题+数值长度
|
|
6145
|
-
var textWidth=indexTextWidth;if(IFrameSplitOperator.IsNonEmptyArray(titleItem.TextEx)){var xLeft=left;for(var n=0;n<titleItem.TextEx.length;++n){var outItem=titleItem.TextEx[n];var outTextWidth=this.Canvas.measureText(outItem.Text).width+2;outItem.Width=outTextWidth;outItem.Left=xLeft;textWidth+=outTextWidth;xLeft+=outTextWidth;}}if(left+textWidth+space>right)
|
|
6146
|
-
|
|
6146
|
+
var textWidth=indexTextWidth;if(IFrameSplitOperator.IsNonEmptyArray(titleItem.TextEx)){var xLeft=left;for(var n=0;n<titleItem.TextEx.length;++n){var outItem=titleItem.TextEx[n];var outTextWidth=this.Canvas.measureText(outItem.Text).width+2;outItem.Width=outTextWidth;outItem.Left=xLeft;textWidth+=outTextWidth;xLeft+=outTextWidth;}}if(left+textWidth+space>right){left=newLineLeft;bottom+=lineHeight;right=this.Frame.ChartBorder.GetRight();//第2行以后 右侧边框
|
|
6147
|
+
}if(titleItem.BG)//背景
|
|
6148
|
+
{var textHeight=this.Canvas.measureText("擎").width+2;var rtBG={Left:left,Top:bottom-textHeight/2,Width:textWidth,Height:textHeight};this.Canvas.fillStyle=titleItem.BG;this.Canvas.fillRect(rtBG.Left,rtBG.Top-1,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=titleItem.Color;this.Canvas.fillText(text,rtBG.Left+1,bottom,indexTextWidth);left+=indexTextWidth;if(IFrameSplitOperator.IsNonEmptyArray(titleItem.TextEx)){for(var n=0;n<titleItem.TextEx.length;++n){var outItem=titleItem.TextEx[n];this.Canvas.fillStyle=outItem.TextColor;this.Canvas.fillText(outItem.Text,left,bottom,outItem.Width);left+=outItem.Width;}}left+=space;}else{this.Canvas.fillStyle=titleItem.Color;this.Canvas.fillText(text,left,bottom,indexTextWidth);left+=indexTextWidth;if(IFrameSplitOperator.IsNonEmptyArray(titleItem.TextEx)){for(var n=0;n<titleItem.TextEx.length;++n){var outItem=titleItem.TextEx[n];this.Canvas.fillStyle=outItem.TextColor;this.Canvas.fillText(outItem.Text,left,bottom,outItem.Width);left+=outItem.Width;}}left+=space;}}}else{this.Canvas.fillStyle=item.Color;var text=valueText;if(item.Name){var dyTitle=this.GetDynamicOutName(item.Name);if(dyTitle)text=dyTitle+":"+valueText;else text=item.Name+":"+valueText;}var space=this.ParamSpace*pixelRatio;var textWidth=this.Canvas.measureText(text).width+space;if(left+textWidth>right)//换行
|
|
6149
|
+
{left=newLineLeft;bottom+=lineHeight;right=this.Frame.ChartBorder.GetRight();//第2行以后 右侧边框
|
|
6150
|
+
}this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}rtText.Left=left;rtText.Bottom=bottom;};//集合竞价
|
|
6147
6151
|
this.DrawMainCallAuction=function(positionInfo,rtText,result){if(!this.IsShowMainIndexTitle)return;if(!this.MainTitlePaint)return;var auctionData=this.MainTitlePaint.GetCurrentAuctionData();//集合竞价分时数据
|
|
6148
6152
|
if(!auctionData||!auctionData.Data)return;if(!this.GetEventCallback)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_CALL_AUCTION_INDEX_TITLE);if(!event)return;var data={AuctionData:auctionData,Data:this.Data,FrameID:this.Frame.Identify,Out:null,PreventDefault:false};event.Callback(event,data,this);result.PreventDefault=data.PreventDefault;if(!IFrameSplitOperator.IsNonEmptyArray(data.Out))return;var left=positionInfo.Left;var right=positionInfo.Right;var bottom=positionInfo.Bottom;var pixelRatio=GetDevicePixelRatio();var aryText=data.Out;//[{Text:, Color, Space:间距 }]
|
|
6149
6153
|
for(var i=0;i<aryText.length;++i){var item=aryText[i];if(!item.Text)continue;var textWidth=this.Canvas.measureText(item.Text).width+2;if(left+textWidth>right)break;if(item.BGColor)//背景
|
|
@@ -6152,8 +6156,8 @@ for(var i=0;i<aryText.length;++i){var item=aryText[i];if(!item.Text)continue;var
|
|
|
6152
6156
|
this.GetPreVaildItem=function(data,start){for(var i=start;i>=0;--i){var item=data[i];if(item)return{Item:item,Index:i};}return null;};this.DrawSelectedLine=function(left,bottom,textWidth){this.Canvas.save();var fontHeight=this.GetFontHeight();this.Canvas.strokeStyle=this.SelectedColor;var lineWidth=4;var lineBottom=ToFixedPoint2(lineWidth,bottom+fontHeight/2);this.Canvas.lineWidth=lineWidth;this.Canvas.beginPath();this.Canvas.moveTo(left,lineBottom);this.Canvas.lineTo(left+textWidth,lineBottom);this.Canvas.stroke();this.Canvas.restore();};this.FormatOverlayTitle=function(item,overlayItem,titleIndex){if(!item||!item.Data||!item.Data.Data||!item.Name)return null;if(item.IsVisible===false)return null;if(item.Data.Data.length<=0)return null;var value=null;var valueText=null;var aryText=null;if(item.DataType=="StraightLine")//直线只有1个数据
|
|
6153
6157
|
{value=item.Data.Data[0];valueText=this.FormatValue(value,item);}else{var index=Math.abs(this.CursorIndex-0.5);index=parseInt(index.toFixed(0));if(this.IsKLineFrame)index=this.CursorIndex;var dataIndex=item.Data.DataOffset+index;if(dataIndex>=item.Data.Data.length)dataIndex=item.Data.Data.length-1;if(dataIndex<0)return null;value=item.Data.Data[dataIndex];if(value==null)return null;if(this.GetEventCallback)//外部处理
|
|
6154
6158
|
{var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_OVERLAY_INDEX_OUT_TEXT);if(event){var sendData={Item:item,Index:titleIndex,Data:overlayItem,FrameID:this.Frame.Identify,DataIndex:dataIndex,Value:value,PreventDefault:false,Out:null};event.Callback(event,sendData,this);if(sendData.Out)return sendData.Out;if(sendData.PreventDefault)return sendData.Out;}}if(item.DataType=="MultiReport"){valueText=this.FormatMultiReport(value,item);if(!valueText)return null;}else if(item.DataType=="ChartStackedBar"){aryText=this.FormatStackedBarTitle(value,item);if(!aryText)return null;}else if(item.DataType=="ChartMultiLine")//多线段数据
|
|
6155
|
-
{aryText=this.ForamtMultiLineTitle(dataIndex,item);if(!aryText)return null;}else if(item.DataType=="ChartMultiPoint"){aryText=this.ForamtMultiPointTitle(dataIndex,item);if(!aryText)return null;}else if(item.DataType=="ChartMultiBar"){aryText=this.ForamtMultiBarTitle(dataIndex,item);if(!aryText)return null;}else if(item.DataType=="DRAWKLINE"){aryText=this.FormatKLineTitle(value,item);if(!aryText)return null;}else if(item.DataType=="ChartIndexTitle"){var outTitle=this.FormatIndexTitle(value,item);if(!outTitle)return null;valueText=outTitle.Text;aryText=outTitle.ArrayText;}else if(item.DataType=="MULTI_POINT_LINE"){valueText=this.FormatMultiDataLine(value,item);if(!valueText)return null;}else{valueText=this.FormatValue(value,item);}}return{Text:valueText,ArrayText:aryText};};this.DrawOverlayIndexSingleLine=function(moveonPoint,mouseStatus)//叠加指标1个指标一行
|
|
6156
|
-
{var pixelRatio=GetDevicePixelRatio();var border=this.Frame.GetBorder();if(this.Frame.IsHScreen===true){var left=1;var top=2*pixelRatio;var right=this.Frame.ChartBorder.GetHeight();var bottom=this.Frame.ChartBorder.GetWidthEx();}else{var top=border.TopTitle+2*pixelRatio;if(!this.IsShowMainIndexTitle)top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var right=border.Right;var bottom=border.Bottom;}var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;var x=left,y=top;
|
|
6159
|
+
{aryText=this.ForamtMultiLineTitle(dataIndex,item);if(!aryText)return null;}else if(item.DataType=="ChartMultiPoint"){aryText=this.ForamtMultiPointTitle(dataIndex,item);if(!aryText)return null;}else if(item.DataType=="ChartMultiBar"){aryText=this.ForamtMultiBarTitle(dataIndex,item);if(!aryText)return null;}else if(item.DataType=="DRAWKLINE"){aryText=this.FormatKLineTitle(value,item);if(!aryText)return null;}else if(item.DataType=="ChartIndexTitle"){var outTitle=this.FormatIndexTitle(value,item);if(!outTitle)return null;valueText=outTitle.Text;aryText=outTitle.ArrayText;}else if(item.DataType=="MULTI_POINT_LINE"){valueText=this.FormatMultiDataLine(value,item);if(!valueText)return null;}else{valueText=this.FormatValue(value,item);}}return{Text:valueText,ArrayText:aryText};};this.DrawOverlayIndexSingleLine=function(moveonPoint,mouseStatus,yTop)//叠加指标1个指标一行
|
|
6160
|
+
{var pixelRatio=GetDevicePixelRatio();var border=this.Frame.GetBorder();var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");if(this.Frame.IsHScreen===true){var left=1;var top=2*pixelRatio;var right=this.Frame.ChartBorder.GetHeight();var bottom=this.Frame.ChartBorder.GetWidthEx();}else{var top=border.TopTitle+2*pixelRatio;if(IFrameSplitOperator.IsNumber(yTop)&&yTop>top)top=yTop+fontHeight/2+2*pixelRatio;if(!this.IsShowMainIndexTitle)top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var right=border.Right;var bottom=border.Bottom;}var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;var x=left,y=top;y=top+fontHeight/2;var _iteratorNormalCompletion11=true;var _didIteratorError11=false;var _iteratorError11=undefined;try{for(var _iterator11=(0,_getIterator3.default)(this.OverlayIndex),_step11;!(_iteratorNormalCompletion11=(_step11=_iterator11.next()).done);_iteratorNormalCompletion11=true){item=_step11.value;var overlayItem=item[1];var overlayID=item[0];var toolbarInfo={Width:0,YCenter:y,ID:overlayID};this.DrawOverlayToolbar(overlayItem,toolbarInfo,moveonPoint,mouseStatus);if(!overlayItem.IsShowIndexTitle)continue;if(!overlayItem.Frame.IsShowIndexTitle)continue;x=left+toolbarInfo.Width;this.Canvas.font=this.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";if(overlayItem.Title&&this.IsShowOverlayIndexName){var textWidth=this.Canvas.measureText(overlayItem.Title).width+2;if(x+textWidth<right){if(this.OverlayIndexType.BGColor){this.Canvas.fillStyle=this.OverlayIndexType.BGColor;var rtBG={Left:x,Top:y-fontHeight/2,Width:textWidth,Height:fontHeight+lineSpace};//保存下标题的坐标
|
|
6157
6161
|
this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(this.IsSelectedChart(overlayID))this.DrawSelectedLine(x,y,textWidth,overlayItem.Title);this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(overlayItem.Title,x,y,textWidth);}x+=textWidth;}for(var i=0;i<overlayItem.Data.length;++i){var item=overlayItem.Data[i];var outText=this.FormatOverlayTitle(item,overlayItem,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText){var text;for(var k=0;k<aryText.length;++k){var titleItem=aryText[k];if(titleItem.Name)text=titleItem.Name+":"+titleItem.Text;else text=titleItem.Text;var textWidth=this.Canvas.measureText(text).width+2;//后空2个像素
|
|
6158
6162
|
if(x+textWidth>right)break;if(IFrameSplitOperator.IsNumber(titleItem.LeftSpace))x+=titleItem.LeftSpace*pixelRatio;if(this.OverlayIndexType.BGColor){this.Canvas.fillStyle=this.OverlayIndexType.BGColor;var rtBG={Left:x,Top:y-fontHeight/2,Width:textWidth,Height:fontHeight+lineSpace};//保存下标题的坐标
|
|
6159
6163
|
this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fillStyle=titleItem.Color;this.Canvas.fillText(text,x,y,textWidth);x+=textWidth;}}else{var text=valueText;if(item.Name){var dyTitle=this.GetDynamicOutName(item.Name,overlayID);if(dyTitle)text=dyTitle+":"+valueText;else text=item.Name+":"+valueText;}var textWidth=this.Canvas.measureText(text).width+2;//后空2个像素
|
|
@@ -14751,7 +14755,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14751
14755
|
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);};}/********************************************************************************
|
|
14752
14756
|
* 版本信息输出
|
|
14753
14757
|
*
|
|
14754
|
-
*/var HQCHART_VERSION="1.1.
|
|
14758
|
+
*/var HQCHART_VERSION="1.1.14669";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();//把给外界调用的方法暴露出来
|
|
14755
14759
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14756
14760
|
// BaseIndex:BaseIndex,
|
|
14757
14761
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -12156,7 +12156,7 @@ function IChartFramePainting()
|
|
|
12156
12156
|
|
|
12157
12157
|
this.BorderLine=null; //1=上 2=下 4=左 8=右
|
|
12158
12158
|
this.Buttons=[]; //按钮事件
|
|
12159
|
-
this.
|
|
12159
|
+
this.ToolbarCacheSize=null; //缓存工具条宽度{ RToolbar:{ Left:, Right }}
|
|
12160
12160
|
|
|
12161
12161
|
this.IsMinSize=false; //窗口是否最小化
|
|
12162
12162
|
|
|
@@ -12219,6 +12219,7 @@ function IChartFramePainting()
|
|
|
12219
12219
|
{
|
|
12220
12220
|
this.Buttons=[];
|
|
12221
12221
|
this.HorizontalLabel=[];
|
|
12222
|
+
this.ToolbarCacheSize=null;
|
|
12222
12223
|
this.DrawClientBG();
|
|
12223
12224
|
this.DrawFrame();
|
|
12224
12225
|
this.DrawBorder();
|
|
@@ -12738,7 +12739,9 @@ function AverageWidthFrame()
|
|
|
12738
12739
|
var right=border.Right-3;
|
|
12739
12740
|
var left=border.Left;
|
|
12740
12741
|
var yButton=border.Top+this.ChartBorder.TitleHeight/2;
|
|
12741
|
-
|
|
12742
|
+
|
|
12743
|
+
this.ToolbarCacheSize={ RToolbar:{ Right:right, Left:right }}
|
|
12744
|
+
|
|
12742
12745
|
//右往左绘制
|
|
12743
12746
|
for(var i=0;i<aryButton.length;++i)
|
|
12744
12747
|
{
|
|
@@ -12764,8 +12767,12 @@ function AverageWidthFrame()
|
|
|
12764
12767
|
|
|
12765
12768
|
this.Buttons.push({ ID:item.ID, Rect:rtButton });
|
|
12766
12769
|
|
|
12770
|
+
this.ToolbarCacheSize.RToolbar.Left=rtButton.Left;
|
|
12771
|
+
|
|
12767
12772
|
right=xBotton;
|
|
12768
12773
|
}
|
|
12774
|
+
|
|
12775
|
+
|
|
12769
12776
|
}
|
|
12770
12777
|
}
|
|
12771
12778
|
|
|
@@ -17770,7 +17777,6 @@ function KLineFrame()
|
|
|
17770
17777
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
17771
17778
|
|
|
17772
17779
|
this.Buttons=[];
|
|
17773
|
-
this.LeftButtonWidth=0;
|
|
17774
17780
|
if (this.IsMinSize==true) return;
|
|
17775
17781
|
if (this.ChartBorder.TitleHeight<5) return;
|
|
17776
17782
|
|
|
@@ -60401,7 +60407,10 @@ function DynamicChartTitlePainting()
|
|
|
60401
60407
|
}
|
|
60402
60408
|
else
|
|
60403
60409
|
{
|
|
60404
|
-
|
|
60410
|
+
var yRight=right;
|
|
60411
|
+
if (this.Frame.ToolbarCacheSize && this.Frame.ToolbarCacheSize.RToolbar) yRight=this.Frame.ToolbarCacheSize.RToolbar.Left-2; //右侧按钮宽度要去掉
|
|
60412
|
+
this.DrawMainIndexTitle({ Left:left, Right:yRight, Bottom:bottom }, isShowLastData, rtText);
|
|
60413
|
+
if (IFrameSplitOperator.IsNumber(rtText.Bottom)) bottom=rtText.Bottom;
|
|
60405
60414
|
}
|
|
60406
60415
|
|
|
60407
60416
|
left=rtText.Left;
|
|
@@ -60439,7 +60448,7 @@ function DynamicChartTitlePainting()
|
|
|
60439
60448
|
if (this.OverlayIndexType.Position==1)
|
|
60440
60449
|
{
|
|
60441
60450
|
if (!this.Frame.ChartBorder.IsShowTitleOnly)
|
|
60442
|
-
this.DrawOverlayIndexSingleLine(moveonPoint, mouseStatus);
|
|
60451
|
+
this.DrawOverlayIndexSingleLine(moveonPoint, mouseStatus, bottom+1);
|
|
60443
60452
|
}
|
|
60444
60453
|
else
|
|
60445
60454
|
{
|
|
@@ -60631,9 +60640,11 @@ function DynamicChartTitlePainting()
|
|
|
60631
60640
|
if (!this.IsShowMainIndexTitle) return;
|
|
60632
60641
|
|
|
60633
60642
|
var left=positionInfo.Left;
|
|
60643
|
+
var newLineLeft=this.Frame.ChartBorder.GetLeft()+this.MerginLeft+5;
|
|
60634
60644
|
var right=positionInfo.Right;
|
|
60635
60645
|
var bottom=positionInfo.Bottom;
|
|
60636
60646
|
var pixelRatio=GetDevicePixelRatio();
|
|
60647
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
60637
60648
|
for(var i=0; i<this.Data.length; ++i)
|
|
60638
60649
|
{
|
|
60639
60650
|
var item=this.Data[i];
|
|
@@ -60673,7 +60684,12 @@ function DynamicChartTitlePainting()
|
|
|
60673
60684
|
}
|
|
60674
60685
|
}
|
|
60675
60686
|
|
|
60676
|
-
if ((left+textWidth+space)>right)
|
|
60687
|
+
if ((left+textWidth+space)>right)
|
|
60688
|
+
{
|
|
60689
|
+
left=newLineLeft;
|
|
60690
|
+
bottom+=lineHeight;
|
|
60691
|
+
right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
|
|
60692
|
+
}
|
|
60677
60693
|
|
|
60678
60694
|
if (titleItem.BG) //背景
|
|
60679
60695
|
{
|
|
@@ -60732,7 +60748,12 @@ function DynamicChartTitlePainting()
|
|
|
60732
60748
|
}
|
|
60733
60749
|
var space=this.ParamSpace*pixelRatio;
|
|
60734
60750
|
var textWidth=this.Canvas.measureText(text).width+space;
|
|
60735
|
-
if ((left+textWidth)>right)
|
|
60751
|
+
if ((left+textWidth)>right) //换行
|
|
60752
|
+
{
|
|
60753
|
+
left=newLineLeft;
|
|
60754
|
+
bottom+=lineHeight;
|
|
60755
|
+
right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
|
|
60756
|
+
}
|
|
60736
60757
|
|
|
60737
60758
|
this.Canvas.fillText(text,left,bottom,textWidth);
|
|
60738
60759
|
left+=textWidth;
|
|
@@ -60740,6 +60761,7 @@ function DynamicChartTitlePainting()
|
|
|
60740
60761
|
}
|
|
60741
60762
|
|
|
60742
60763
|
rtText.Left=left;
|
|
60764
|
+
rtText.Bottom=bottom;
|
|
60743
60765
|
}
|
|
60744
60766
|
|
|
60745
60767
|
//集合竞价
|
|
@@ -60928,10 +60950,12 @@ function DynamicChartTitlePainting()
|
|
|
60928
60950
|
return { Text:valueText, ArrayText:aryText };
|
|
60929
60951
|
}
|
|
60930
60952
|
|
|
60931
|
-
this.DrawOverlayIndexSingleLine=function(moveonPoint, mouseStatus) //叠加指标1个指标一行
|
|
60953
|
+
this.DrawOverlayIndexSingleLine=function(moveonPoint, mouseStatus, yTop) //叠加指标1个指标一行
|
|
60932
60954
|
{
|
|
60933
60955
|
var pixelRatio=GetDevicePixelRatio();
|
|
60934
60956
|
var border=this.Frame.GetBorder();
|
|
60957
|
+
var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");
|
|
60958
|
+
|
|
60935
60959
|
if (this.Frame.IsHScreen===true)
|
|
60936
60960
|
{
|
|
60937
60961
|
var left=1;
|
|
@@ -60942,6 +60966,7 @@ function DynamicChartTitlePainting()
|
|
|
60942
60966
|
else
|
|
60943
60967
|
{
|
|
60944
60968
|
var top=border.TopTitle+2*pixelRatio;
|
|
60969
|
+
if (IFrameSplitOperator.IsNumber(yTop) && yTop>top) top=yTop+fontHeight/2+2*pixelRatio;
|
|
60945
60970
|
if (!this.IsShowMainIndexTitle) top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;
|
|
60946
60971
|
var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;
|
|
60947
60972
|
var right=border.Right;
|
|
@@ -60951,7 +60976,6 @@ function DynamicChartTitlePainting()
|
|
|
60951
60976
|
|
|
60952
60977
|
var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;
|
|
60953
60978
|
var x=left, y=top;
|
|
60954
|
-
var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");
|
|
60955
60979
|
y=top+fontHeight/2;
|
|
60956
60980
|
for(item of this.OverlayIndex)
|
|
60957
60981
|
{
|
|
@@ -16252,7 +16252,7 @@ function IChartFramePainting()
|
|
|
16252
16252
|
|
|
16253
16253
|
this.BorderLine=null; //1=上 2=下 4=左 8=右
|
|
16254
16254
|
this.Buttons=[]; //按钮事件
|
|
16255
|
-
this.
|
|
16255
|
+
this.ToolbarCacheSize=null; //缓存工具条宽度{ RToolbar:{ Left:, Right }}
|
|
16256
16256
|
|
|
16257
16257
|
this.IsMinSize=false; //窗口是否最小化
|
|
16258
16258
|
|
|
@@ -16315,6 +16315,7 @@ function IChartFramePainting()
|
|
|
16315
16315
|
{
|
|
16316
16316
|
this.Buttons=[];
|
|
16317
16317
|
this.HorizontalLabel=[];
|
|
16318
|
+
this.ToolbarCacheSize=null;
|
|
16318
16319
|
this.DrawClientBG();
|
|
16319
16320
|
this.DrawFrame();
|
|
16320
16321
|
this.DrawBorder();
|
|
@@ -16834,7 +16835,9 @@ function AverageWidthFrame()
|
|
|
16834
16835
|
var right=border.Right-3;
|
|
16835
16836
|
var left=border.Left;
|
|
16836
16837
|
var yButton=border.Top+this.ChartBorder.TitleHeight/2;
|
|
16837
|
-
|
|
16838
|
+
|
|
16839
|
+
this.ToolbarCacheSize={ RToolbar:{ Right:right, Left:right }}
|
|
16840
|
+
|
|
16838
16841
|
//右往左绘制
|
|
16839
16842
|
for(var i=0;i<aryButton.length;++i)
|
|
16840
16843
|
{
|
|
@@ -16860,8 +16863,12 @@ function AverageWidthFrame()
|
|
|
16860
16863
|
|
|
16861
16864
|
this.Buttons.push({ ID:item.ID, Rect:rtButton });
|
|
16862
16865
|
|
|
16866
|
+
this.ToolbarCacheSize.RToolbar.Left=rtButton.Left;
|
|
16867
|
+
|
|
16863
16868
|
right=xBotton;
|
|
16864
16869
|
}
|
|
16870
|
+
|
|
16871
|
+
|
|
16865
16872
|
}
|
|
16866
16873
|
}
|
|
16867
16874
|
|
|
@@ -21866,7 +21873,6 @@ function KLineFrame()
|
|
|
21866
21873
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
21867
21874
|
|
|
21868
21875
|
this.Buttons=[];
|
|
21869
|
-
this.LeftButtonWidth=0;
|
|
21870
21876
|
if (this.IsMinSize==true) return;
|
|
21871
21877
|
if (this.ChartBorder.TitleHeight<5) return;
|
|
21872
21878
|
|
|
@@ -64497,7 +64503,10 @@ function DynamicChartTitlePainting()
|
|
|
64497
64503
|
}
|
|
64498
64504
|
else
|
|
64499
64505
|
{
|
|
64500
|
-
|
|
64506
|
+
var yRight=right;
|
|
64507
|
+
if (this.Frame.ToolbarCacheSize && this.Frame.ToolbarCacheSize.RToolbar) yRight=this.Frame.ToolbarCacheSize.RToolbar.Left-2; //右侧按钮宽度要去掉
|
|
64508
|
+
this.DrawMainIndexTitle({ Left:left, Right:yRight, Bottom:bottom }, isShowLastData, rtText);
|
|
64509
|
+
if (IFrameSplitOperator.IsNumber(rtText.Bottom)) bottom=rtText.Bottom;
|
|
64501
64510
|
}
|
|
64502
64511
|
|
|
64503
64512
|
left=rtText.Left;
|
|
@@ -64535,7 +64544,7 @@ function DynamicChartTitlePainting()
|
|
|
64535
64544
|
if (this.OverlayIndexType.Position==1)
|
|
64536
64545
|
{
|
|
64537
64546
|
if (!this.Frame.ChartBorder.IsShowTitleOnly)
|
|
64538
|
-
this.DrawOverlayIndexSingleLine(moveonPoint, mouseStatus);
|
|
64547
|
+
this.DrawOverlayIndexSingleLine(moveonPoint, mouseStatus, bottom+1);
|
|
64539
64548
|
}
|
|
64540
64549
|
else
|
|
64541
64550
|
{
|
|
@@ -64727,9 +64736,11 @@ function DynamicChartTitlePainting()
|
|
|
64727
64736
|
if (!this.IsShowMainIndexTitle) return;
|
|
64728
64737
|
|
|
64729
64738
|
var left=positionInfo.Left;
|
|
64739
|
+
var newLineLeft=this.Frame.ChartBorder.GetLeft()+this.MerginLeft+5;
|
|
64730
64740
|
var right=positionInfo.Right;
|
|
64731
64741
|
var bottom=positionInfo.Bottom;
|
|
64732
64742
|
var pixelRatio=GetDevicePixelRatio();
|
|
64743
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
64733
64744
|
for(var i=0; i<this.Data.length; ++i)
|
|
64734
64745
|
{
|
|
64735
64746
|
var item=this.Data[i];
|
|
@@ -64769,7 +64780,12 @@ function DynamicChartTitlePainting()
|
|
|
64769
64780
|
}
|
|
64770
64781
|
}
|
|
64771
64782
|
|
|
64772
|
-
if ((left+textWidth+space)>right)
|
|
64783
|
+
if ((left+textWidth+space)>right)
|
|
64784
|
+
{
|
|
64785
|
+
left=newLineLeft;
|
|
64786
|
+
bottom+=lineHeight;
|
|
64787
|
+
right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
|
|
64788
|
+
}
|
|
64773
64789
|
|
|
64774
64790
|
if (titleItem.BG) //背景
|
|
64775
64791
|
{
|
|
@@ -64828,7 +64844,12 @@ function DynamicChartTitlePainting()
|
|
|
64828
64844
|
}
|
|
64829
64845
|
var space=this.ParamSpace*pixelRatio;
|
|
64830
64846
|
var textWidth=this.Canvas.measureText(text).width+space;
|
|
64831
|
-
if ((left+textWidth)>right)
|
|
64847
|
+
if ((left+textWidth)>right) //换行
|
|
64848
|
+
{
|
|
64849
|
+
left=newLineLeft;
|
|
64850
|
+
bottom+=lineHeight;
|
|
64851
|
+
right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
|
|
64852
|
+
}
|
|
64832
64853
|
|
|
64833
64854
|
this.Canvas.fillText(text,left,bottom,textWidth);
|
|
64834
64855
|
left+=textWidth;
|
|
@@ -64836,6 +64857,7 @@ function DynamicChartTitlePainting()
|
|
|
64836
64857
|
}
|
|
64837
64858
|
|
|
64838
64859
|
rtText.Left=left;
|
|
64860
|
+
rtText.Bottom=bottom;
|
|
64839
64861
|
}
|
|
64840
64862
|
|
|
64841
64863
|
//集合竞价
|
|
@@ -65024,10 +65046,12 @@ function DynamicChartTitlePainting()
|
|
|
65024
65046
|
return { Text:valueText, ArrayText:aryText };
|
|
65025
65047
|
}
|
|
65026
65048
|
|
|
65027
|
-
this.DrawOverlayIndexSingleLine=function(moveonPoint, mouseStatus) //叠加指标1个指标一行
|
|
65049
|
+
this.DrawOverlayIndexSingleLine=function(moveonPoint, mouseStatus, yTop) //叠加指标1个指标一行
|
|
65028
65050
|
{
|
|
65029
65051
|
var pixelRatio=GetDevicePixelRatio();
|
|
65030
65052
|
var border=this.Frame.GetBorder();
|
|
65053
|
+
var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");
|
|
65054
|
+
|
|
65031
65055
|
if (this.Frame.IsHScreen===true)
|
|
65032
65056
|
{
|
|
65033
65057
|
var left=1;
|
|
@@ -65038,6 +65062,7 @@ function DynamicChartTitlePainting()
|
|
|
65038
65062
|
else
|
|
65039
65063
|
{
|
|
65040
65064
|
var top=border.TopTitle+2*pixelRatio;
|
|
65065
|
+
if (IFrameSplitOperator.IsNumber(yTop) && yTop>top) top=yTop+fontHeight/2+2*pixelRatio;
|
|
65041
65066
|
if (!this.IsShowMainIndexTitle) top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;
|
|
65042
65067
|
var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;
|
|
65043
65068
|
var right=border.Right;
|
|
@@ -65047,7 +65072,6 @@ function DynamicChartTitlePainting()
|
|
|
65047
65072
|
|
|
65048
65073
|
var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;
|
|
65049
65074
|
var x=left, y=top;
|
|
65050
|
-
var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");
|
|
65051
65075
|
y=top+fontHeight/2;
|
|
65052
65076
|
for(item of this.OverlayIndex)
|
|
65053
65077
|
{
|
|
@@ -147060,7 +147084,7 @@ function ScrollBarBGChart()
|
|
|
147060
147084
|
|
|
147061
147085
|
|
|
147062
147086
|
|
|
147063
|
-
var HQCHART_VERSION="1.1.
|
|
147087
|
+
var HQCHART_VERSION="1.1.14669";
|
|
147064
147088
|
|
|
147065
147089
|
function PrintHQChartVersion()
|
|
147066
147090
|
{
|
|
@@ -16296,7 +16296,7 @@ function IChartFramePainting()
|
|
|
16296
16296
|
|
|
16297
16297
|
this.BorderLine=null; //1=上 2=下 4=左 8=右
|
|
16298
16298
|
this.Buttons=[]; //按钮事件
|
|
16299
|
-
this.
|
|
16299
|
+
this.ToolbarCacheSize=null; //缓存工具条宽度{ RToolbar:{ Left:, Right }}
|
|
16300
16300
|
|
|
16301
16301
|
this.IsMinSize=false; //窗口是否最小化
|
|
16302
16302
|
|
|
@@ -16359,6 +16359,7 @@ function IChartFramePainting()
|
|
|
16359
16359
|
{
|
|
16360
16360
|
this.Buttons=[];
|
|
16361
16361
|
this.HorizontalLabel=[];
|
|
16362
|
+
this.ToolbarCacheSize=null;
|
|
16362
16363
|
this.DrawClientBG();
|
|
16363
16364
|
this.DrawFrame();
|
|
16364
16365
|
this.DrawBorder();
|
|
@@ -16878,7 +16879,9 @@ function AverageWidthFrame()
|
|
|
16878
16879
|
var right=border.Right-3;
|
|
16879
16880
|
var left=border.Left;
|
|
16880
16881
|
var yButton=border.Top+this.ChartBorder.TitleHeight/2;
|
|
16881
|
-
|
|
16882
|
+
|
|
16883
|
+
this.ToolbarCacheSize={ RToolbar:{ Right:right, Left:right }}
|
|
16884
|
+
|
|
16882
16885
|
//右往左绘制
|
|
16883
16886
|
for(var i=0;i<aryButton.length;++i)
|
|
16884
16887
|
{
|
|
@@ -16904,8 +16907,12 @@ function AverageWidthFrame()
|
|
|
16904
16907
|
|
|
16905
16908
|
this.Buttons.push({ ID:item.ID, Rect:rtButton });
|
|
16906
16909
|
|
|
16910
|
+
this.ToolbarCacheSize.RToolbar.Left=rtButton.Left;
|
|
16911
|
+
|
|
16907
16912
|
right=xBotton;
|
|
16908
16913
|
}
|
|
16914
|
+
|
|
16915
|
+
|
|
16909
16916
|
}
|
|
16910
16917
|
}
|
|
16911
16918
|
|
|
@@ -21910,7 +21917,6 @@ function KLineFrame()
|
|
|
21910
21917
|
if (g_JSChartResource.IsDOMFrameToolbar===true) return;
|
|
21911
21918
|
|
|
21912
21919
|
this.Buttons=[];
|
|
21913
|
-
this.LeftButtonWidth=0;
|
|
21914
21920
|
if (this.IsMinSize==true) return;
|
|
21915
21921
|
if (this.ChartBorder.TitleHeight<5) return;
|
|
21916
21922
|
|
|
@@ -64541,7 +64547,10 @@ function DynamicChartTitlePainting()
|
|
|
64541
64547
|
}
|
|
64542
64548
|
else
|
|
64543
64549
|
{
|
|
64544
|
-
|
|
64550
|
+
var yRight=right;
|
|
64551
|
+
if (this.Frame.ToolbarCacheSize && this.Frame.ToolbarCacheSize.RToolbar) yRight=this.Frame.ToolbarCacheSize.RToolbar.Left-2; //右侧按钮宽度要去掉
|
|
64552
|
+
this.DrawMainIndexTitle({ Left:left, Right:yRight, Bottom:bottom }, isShowLastData, rtText);
|
|
64553
|
+
if (IFrameSplitOperator.IsNumber(rtText.Bottom)) bottom=rtText.Bottom;
|
|
64545
64554
|
}
|
|
64546
64555
|
|
|
64547
64556
|
left=rtText.Left;
|
|
@@ -64579,7 +64588,7 @@ function DynamicChartTitlePainting()
|
|
|
64579
64588
|
if (this.OverlayIndexType.Position==1)
|
|
64580
64589
|
{
|
|
64581
64590
|
if (!this.Frame.ChartBorder.IsShowTitleOnly)
|
|
64582
|
-
this.DrawOverlayIndexSingleLine(moveonPoint, mouseStatus);
|
|
64591
|
+
this.DrawOverlayIndexSingleLine(moveonPoint, mouseStatus, bottom+1);
|
|
64583
64592
|
}
|
|
64584
64593
|
else
|
|
64585
64594
|
{
|
|
@@ -64771,9 +64780,11 @@ function DynamicChartTitlePainting()
|
|
|
64771
64780
|
if (!this.IsShowMainIndexTitle) return;
|
|
64772
64781
|
|
|
64773
64782
|
var left=positionInfo.Left;
|
|
64783
|
+
var newLineLeft=this.Frame.ChartBorder.GetLeft()+this.MerginLeft+5;
|
|
64774
64784
|
var right=positionInfo.Right;
|
|
64775
64785
|
var bottom=positionInfo.Bottom;
|
|
64776
64786
|
var pixelRatio=GetDevicePixelRatio();
|
|
64787
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
64777
64788
|
for(var i=0; i<this.Data.length; ++i)
|
|
64778
64789
|
{
|
|
64779
64790
|
var item=this.Data[i];
|
|
@@ -64813,7 +64824,12 @@ function DynamicChartTitlePainting()
|
|
|
64813
64824
|
}
|
|
64814
64825
|
}
|
|
64815
64826
|
|
|
64816
|
-
if ((left+textWidth+space)>right)
|
|
64827
|
+
if ((left+textWidth+space)>right)
|
|
64828
|
+
{
|
|
64829
|
+
left=newLineLeft;
|
|
64830
|
+
bottom+=lineHeight;
|
|
64831
|
+
right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
|
|
64832
|
+
}
|
|
64817
64833
|
|
|
64818
64834
|
if (titleItem.BG) //背景
|
|
64819
64835
|
{
|
|
@@ -64872,7 +64888,12 @@ function DynamicChartTitlePainting()
|
|
|
64872
64888
|
}
|
|
64873
64889
|
var space=this.ParamSpace*pixelRatio;
|
|
64874
64890
|
var textWidth=this.Canvas.measureText(text).width+space;
|
|
64875
|
-
if ((left+textWidth)>right)
|
|
64891
|
+
if ((left+textWidth)>right) //换行
|
|
64892
|
+
{
|
|
64893
|
+
left=newLineLeft;
|
|
64894
|
+
bottom+=lineHeight;
|
|
64895
|
+
right=this.Frame.ChartBorder.GetRight(); //第2行以后 右侧边框
|
|
64896
|
+
}
|
|
64876
64897
|
|
|
64877
64898
|
this.Canvas.fillText(text,left,bottom,textWidth);
|
|
64878
64899
|
left+=textWidth;
|
|
@@ -64880,6 +64901,7 @@ function DynamicChartTitlePainting()
|
|
|
64880
64901
|
}
|
|
64881
64902
|
|
|
64882
64903
|
rtText.Left=left;
|
|
64904
|
+
rtText.Bottom=bottom;
|
|
64883
64905
|
}
|
|
64884
64906
|
|
|
64885
64907
|
//集合竞价
|
|
@@ -65068,10 +65090,12 @@ function DynamicChartTitlePainting()
|
|
|
65068
65090
|
return { Text:valueText, ArrayText:aryText };
|
|
65069
65091
|
}
|
|
65070
65092
|
|
|
65071
|
-
this.DrawOverlayIndexSingleLine=function(moveonPoint, mouseStatus) //叠加指标1个指标一行
|
|
65093
|
+
this.DrawOverlayIndexSingleLine=function(moveonPoint, mouseStatus, yTop) //叠加指标1个指标一行
|
|
65072
65094
|
{
|
|
65073
65095
|
var pixelRatio=GetDevicePixelRatio();
|
|
65074
65096
|
var border=this.Frame.GetBorder();
|
|
65097
|
+
var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");
|
|
65098
|
+
|
|
65075
65099
|
if (this.Frame.IsHScreen===true)
|
|
65076
65100
|
{
|
|
65077
65101
|
var left=1;
|
|
@@ -65082,6 +65106,7 @@ function DynamicChartTitlePainting()
|
|
|
65082
65106
|
else
|
|
65083
65107
|
{
|
|
65084
65108
|
var top=border.TopTitle+2*pixelRatio;
|
|
65109
|
+
if (IFrameSplitOperator.IsNumber(yTop) && yTop>top) top=yTop+fontHeight/2+2*pixelRatio;
|
|
65085
65110
|
if (!this.IsShowMainIndexTitle) top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;
|
|
65086
65111
|
var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;
|
|
65087
65112
|
var right=border.Right;
|
|
@@ -65091,7 +65116,6 @@ function DynamicChartTitlePainting()
|
|
|
65091
65116
|
|
|
65092
65117
|
var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;
|
|
65093
65118
|
var x=left, y=top;
|
|
65094
|
-
var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");
|
|
65095
65119
|
y=top+fontHeight/2;
|
|
65096
65120
|
for(item of this.OverlayIndex)
|
|
65097
65121
|
{
|
|
@@ -157875,7 +157899,7 @@ function HQChartScriptWorker()
|
|
|
157875
157899
|
|
|
157876
157900
|
|
|
157877
157901
|
|
|
157878
|
-
var HQCHART_VERSION="1.1.
|
|
157902
|
+
var HQCHART_VERSION="1.1.14669";
|
|
157879
157903
|
|
|
157880
157904
|
function PrintHQChartVersion()
|
|
157881
157905
|
{
|