hqchart 1.1.13206 → 1.1.13210

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.
@@ -1482,7 +1482,11 @@ CMD_HIDE_STOCKCHIP_ID:21,CMD_ENABLE_SELECT_RECT_ID:22,//启动区间选择
1482
1482
  CMD_CHANGE_DAY_COUNT_ID:23,//切换天数
1483
1483
  CMD_SHOW_BEFORE_DATA_ID:24,//显示|隐藏集合竞价
1484
1484
  CMD_SELECTED_ZOOM_ID:25,//选中放大
1485
- CMD_SELECTED_SUMMARY_ID:26//区间统计
1485
+ CMD_SELECTED_SUMMARY_ID:26,//区间统计
1486
+ CMD_SHOW_INDEX_ID:27,//显示隐藏指标
1487
+ CMD_SHOW_OVERLAY_INDEX_ID:28,//显示隐藏叠加指标
1488
+ CMD_DELETE_OVERLAY_INDEX_ID:29,//删除叠加指标
1489
+ CMD_SHOW_OVERLAY_Y_AXIS_ID:30//显示隐藏Y轴叠加指标
1486
1490
  };function PhoneDBClick(){this.Start=[];this.Clear=function(){this.Start=[];};this.AddTouchStart=function(x,y,time){if(this.Start.length>0){var item=this.Start[this.Start.length-1];var spanTime=time-item.Time;if(spanTime>0&&spanTime<300){this.Start.push({X:x,Y:y,Time:time});}else{this.Start=[];}}else{this.Start.push({X:x,Y:y,Time:time});}};this.IsVaildDBClick=function(){if(this.Start.length==2)return true;return false;};this.AddTouchEnd=function(time){if(this.Start.length<=0)return;var item=this.Start[this.Start.length-1];var spanTime=time-item.Time;if(spanTime>=0&&spanTime<150){}else{this.Start=[];}};}/*
1487
1491
  图形控件
1488
1492
  */function JSChartContainer(uielement,OffscreenElement,cacheElement){var _this5=this;this.ClassName='JSChartContainer';var _self=this;this.Frame;//框架画法
@@ -1979,7 +1983,11 @@ if(this.ChangePriceGap&&IFrameSplitOperator.IsBool(aryArgs[0])){if(aryArgs[0]==f
1979
1983
  this.SetSizeChange(true);this.Draw();break;case JSCHART_MENU_ID.CMD_HIDE_DRAWTOOL_ID:var drawTools=this.GetExtendChartByClassName('DrawToolsButton');if(drawTools){var toolsWidth=drawTools.Chart.Width;var toolsIndex=parseInt(drawTools.Index);for(var i=toolsIndex+1;i<this.ExtendChartPaint.length;++i)//在画图工具后面创建的需要减去工具的宽度
1980
1984
  {var item=this.ExtendChartPaint[i];if(item.ClassName=='StockChip'){item.Left-=toolsWidth;}}this.DeleteExtendChart(drawTools);this.Frame.ChartBorder.Right-=toolsWidth;this.SetSizeChange(true);this.Draw();}break;case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:var option={Name:'筹码分布',ShowType:1,Width:230};var extendChart=this.CreateExtendChart(option.Name,option);//创建扩展图形
1981
1985
  this.SetSizeChange(true);this.Draw();break;case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:var StockChip=chart.GetExtendChartByClassName('StockChip');if(StockChip){var chipWidth=StockChip.Chart.Width;var chipIndex=parseInt(StockChip.Index);for(var i=chipIndex+1;i<this.ExtendChartPaint.length;++i)//在筹码后面创建的需要筹码的宽度
1982
- {var item=this.ExtendChartPaint[i];if(item.ClassName=='DrawToolsButton'){item.Left-=chipWidth;}}this.DeleteExtendChart(StockChip);this.Frame.ChartBorder.Right-=chipWidth;this.SetSizeChange(true);this.Draw();}break;case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:if(IFrameSplitOperator.IsBool(srcParam))this.EnableSelectRect=srcParam;break;case JSCHART_MENU_ID.CMD_CHANGE_DAY_COUNT_ID:if(this.ChangeDayCount&&param!=null)this.ChangeDayCount(param);break;case JSCHART_MENU_ID.CMD_SHOW_BEFORE_DATA_ID:if(this.ShowCallAuctionData&&IFrameSplitOperator.IsBool(srcParam))this.ShowCallAuctionData({Left:srcParam,MultiDay:{Left:srcParam}});break;case JSCHART_MENU_ID.CMD_SELECTED_ZOOM_ID:if(this.ShowSelectData&&srcParam)this.ShowSelectData(srcParam);break;case JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID:var dlg=new KLineSelectRectDialog(this.DivElement);dlg.DoModal(srcParam);break;}};//点击右键菜单
1986
+ {var item=this.ExtendChartPaint[i];if(item.ClassName=='DrawToolsButton'){item.Left-=chipWidth;}}this.DeleteExtendChart(StockChip);this.Frame.ChartBorder.Right-=chipWidth;this.SetSizeChange(true);this.Draw();}break;case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:if(IFrameSplitOperator.IsBool(srcParam))this.EnableSelectRect=srcParam;break;case JSCHART_MENU_ID.CMD_CHANGE_DAY_COUNT_ID:if(this.ChangeDayCount&&param!=null)this.ChangeDayCount(param);break;case JSCHART_MENU_ID.CMD_SHOW_BEFORE_DATA_ID:if(this.ShowCallAuctionData&&IFrameSplitOperator.IsBool(srcParam))this.ShowCallAuctionData({Left:srcParam,MultiDay:{Left:srcParam}});break;case JSCHART_MENU_ID.CMD_SELECTED_ZOOM_ID:if(this.ShowSelectData&&srcParam)this.ShowSelectData(srcParam);break;case JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID:var dlg=new KLineSelectRectDialog(this.DivElement);dlg.DoModal(srcParam);break;case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID://显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
1987
+ if(param==null||!IFrameSplitOperator.IsNumber(aryArgs[1]))return false;var windowIndex=param,showType=aryArgs[1];var script=this.WindowIndex[windowIndex];if(!script)return false;if(showType==1)script.IsShow=false;else if(showType==2)script.IsShow=true;else script.IsShow=!script.IsShow;this.UpdateWindowIndex(windowIndex);break;case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID://显示隐藏叠加指标 [0]=indexGuid [1]=0=自动 1=隐藏 2=显示
1988
+ if(!srcParam||!IFrameSplitOperator.IsNumber(aryArgs[1]))return false;var indexGuid=srcParam,showType=aryArgs[1];var overlay=this.GetOverlayIndexByIdentify(indexGuid);if(!overlay||!overlay.OverlayItem||!overlay.OverlayItem.Script)return false;var script=overlay.OverlayItem.Script;if(showType==1)script.IsShow=false;else if(showType==2)script.IsShow==true;else script.IsShow=!script.IsShow;this.UpdateOverlayIndex(indexGuid);break;case JSCHART_MENU_ID.CMD_DELETE_OVERLAY_INDEX_ID:if(srcParam&&this.DeleteOverlayWindowsIndex)this.DeleteOverlayWindowsIndex(srcParam);break;case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID:if(!srcParam||!IFrameSplitOperator.IsNumber(aryArgs[1]))return false;if(!this.GetOverlayIndexByIdentify)return false;var indexGuid=srcParam,showType=aryArgs[1];var finder=this.GetOverlayIndexByIdentify(indexGuid);if(!finder||!finder.OverlayItem)return false;var frame=finder.OverlayItem.Frame;if(showType==1)frame.IsShow=false;else if(showType==2)frame.IsShow==true;else frame.IsShow=!frame.IsShow;this.UpdataDataoffset();//更新数据偏移
1989
+ this.UpdateFrameMaxMin();//调整坐标最大 最小值
1990
+ this.Draw();break;}};this.GetShowIndexMenuData=function(windowIndex,showType){var script=this.WindowIndex[windowIndex];if(!script)return null;var data={Name:script.IsShow?"隐藏指标":"显示指标",Data:{ID:JSCHART_MENU_ID.CMD_SHOW_INDEX_ID,Args:[windowIndex,0]}};return data;};this.GetShowOverlayIndexMenuData=function(indexGuid,showType){var overlay=this.GetOverlayIndexByIdentify(indexGuid);if(!overlay||!overlay.OverlayItem||!overlay.OverlayItem.Script)return null;var script=overlay.OverlayItem.Script;var data={Name:script.IsShow?"隐藏指标":"显示指标",Data:{ID:JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID,Args:[indexGuid,0]}};return data;};this.GetShowOverlayIndexYAxisMenuData=function(indexGuid,showType){var overlay=this.GetOverlayIndexByIdentify(indexGuid);if(!overlay||!overlay.OverlayItem||!overlay.OverlayItem.Script)return null;var frame=overlay.OverlayItem.Frame;var data={Name:frame.IsShow?"隐藏Y轴":"显示Y轴",Data:{ID:JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID,Args:[indexGuid,0]}};return data;};//点击右键菜单
1983
1991
  this.OnClickRightMenu=function(data){JSConsole.Chart.Log('[JSChartContainer::OnClickRightMenu] ',data);if(!data||!data.Data)return;var cmdID=data.Data.ID;//命令ID
1984
1992
  var aryArgs=data.Data.Args;//参数
1985
1993
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MENU_COMMAND);//回调通知外部
@@ -5805,7 +5813,7 @@ if(left+textWidth>right)break;this.Canvas.fillText(text,left,bottom,textWidth);l
5805
5813
  }};this.OnDrawEventCallback=function(drawData){if(!this.OnDrawEvent||!this.OnDrawEvent.Callback)return;var data={Draw:drawData,Name:'DynamicChartTitlePainting'};this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);};this.GetFontHeight=function(font){return GetFontHeight(this.Canvas,font,"擎");};//指标名字按钮
5806
5814
  this.DrawNameButton=function(rtButton,moveonPoint,mouseStatus){var pixelRatio=GetDevicePixelRatio();var title=this.Title;if(this.IsShowNameArrow)title+='▼';var textWidth=this.Canvas.measureText(title).width;var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;var roundRadius=this.BorderRoundRadius*pixelRatio;var bgWidth=textWidth+4*pixelRatio+roundRadius*2;rtButton.Top=rtButton.YCenter-bgHeight/2-1,rtButton.Width=bgWidth;rtButton.Height=bgHeight;rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var borderColor=this.BGBorderColor;if(moveonPoint&&moveonPoint.X>=rtButton.Left&&moveonPoint.X<rtButton.Right&&moveonPoint.Y>=rtButton.Top&&moveonPoint.Y<=rtButton.Bottom){if(this.BGBorderMoveOnColor)borderColor=this.BGBorderMoveOnColor;if(mouseStatus){var btnItem={ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON};mouseStatus.MouseOnToolbar={ID:"IndexNameButton",Rect:rtButton,Item:btnItem,Frame:this.Frame,Point:{X:moveonPoint.X,Y:moveonPoint.Y}};}}if(this.NameButtonStyle==1){this.Canvas.beginPath();this.Canvas.roundRect(ToFixedPoint(rtButton.Left),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height),[roundRadius]);this.Canvas.closePath();this.Canvas.fillStyle=this.BGColor;this.Canvas.fill();if(borderColor){this.Canvas.strokeStyle=borderColor;this.Canvas.stroke();}}else{this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtButton.Left,rtButton.Top,rtButton.Width,rtButton.Height);if(borderColor){this.Canvas.strokeStyle=borderColor;this.Canvas.strokeRect(ToFixedPoint(rtButton.Left),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height),[roundRadius]);}}this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(title,rtButton.Left+roundRadius+2*pixelRatio,rtButton.YCenter,textWidth);};//绘制按钮
5807
5815
  this.DrawButton=function(item,rtButton,moveonPoint,mouseStatus){var size=item.Style.Size;if(IFrameSplitOperator.IsNumber(item.Style.YMoveOffset))rtButton.YCenter+=item.Style.YMoveOffset;var font=size+'px '+item.Style.Family;rtButton.Top=rtButton.YCenter-size/2;rtButton.Width=size+item.Style.MerginLeft;rtButton.Height=size;rtButton.Bottom=rtButton.Top+rtButton.Height;rtButton.Right=rtButton.Left+rtButton.Width;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={ID:"TitleButton",Rect:rtButton,Item:item,Frame:this.Frame,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,rtButton.Left,rtButton.YCenter);return true;};this.DrawToolbar=function(toolbarInfo,moveonPoint,mouseStatus){toolbarInfo.Width=0;if(!this.Frame||!this.Frame.GetLeftToolbar)return;var aryButton=this.Frame.GetLeftToolbar();if(!IFrameSplitOperator.IsNonEmptyArray(aryButton))return;if(this.Frame.IsHScreen===true){}else{var border=this.Frame.GetBorder();var right=border.Right-3;var left=border.Left+3;var yCenter=toolbarInfo.YCenter;for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var rtButton={Left:left,YCenter:yCenter};this.DrawButton(item,rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:item.ID,Rect:rtButton,FrameID:this.Frame.Identify,Type:0,Data:item.Data});//Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
5808
- left=rtButton.Right;toolbarInfo.Width+=rtButton.Width;}if(toolbarInfo.Width>0)toolbarInfo.Width+=3;}};this.DrawOverlayToolbar=function(overlayItem,toolbarInfo,moveonPoint,mouseStatus){toolbarInfo.Width=0;if(!overlayItem||!overlayItem.Frame||!overlayItem.Frame.GetLeftToolbar)return;var frame=overlayItem.Frame;var aryButton=frame.GetLeftToolbar({Overlay:overlayItem,OverlayID:toolbarInfo.ID});if(!IFrameSplitOperator.IsNonEmptyArray(aryButton))return;if(this.Frame.IsHScreen===true){}else{var border=frame.GetBorder();var right=border.Right-3;var left=border.Left+3;var yCenter=toolbarInfo.YCenter;for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var rtButton={Left:left,YCenter:yCenter};this.DrawButton(item,rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:item.ID,Rect:rtButton,FrameID:this.Frame.Identify,Type:1,OverlayID:toolbarInfo.ID,Title:overlayItem.Title});left=rtButton.Right;toolbarInfo.Width+=rtButton.Width;}if(toolbarInfo.Width>0)toolbarInfo.Width+=3;}};this.PtInButtons=function(x,y){for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;if(x>rect.Left&&x<rect.Right&&y>rect.Top&&y<rect.Bottom){var result={ID:item.ID,Rect:rect,FrameID:item.FrameID,Type:item.Type,Data:item.Data};if(item.Type==1){result.Title=item.Title;result.OverlayID=item.OverlayID;}return result;}}return null;};}//画图工具
5816
+ left=rtButton.Right;toolbarInfo.Width+=rtButton.Width;}if(toolbarInfo.Width>0)toolbarInfo.Width+=3;}};this.DrawOverlayToolbar=function(overlayItem,toolbarInfo,moveonPoint,mouseStatus){toolbarInfo.Width=0;if(!overlayItem||!overlayItem.Frame||!overlayItem.Frame.GetLeftToolbar)return;var frame=overlayItem.Frame;var aryButton=frame.GetLeftToolbar({Overlay:overlayItem,OverlayID:toolbarInfo.ID});if(!IFrameSplitOperator.IsNonEmptyArray(aryButton))return;if(this.Frame.IsHScreen===true){}else{var border=frame.GetBorder();var right=border.Right-3;var left=border.Left+3;var yCenter=toolbarInfo.YCenter;for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var rtButton={Left:left,YCenter:yCenter};this.DrawButton(item,rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:item.ID,Rect:rtButton,FrameID:this.Frame.Identify,Type:1,OverlayID:toolbarInfo.ID,Title:overlayItem.Title,Data:item.Data});left=rtButton.Right;toolbarInfo.Width+=rtButton.Width;}if(toolbarInfo.Width>0)toolbarInfo.Width+=3;}};this.PtInButtons=function(x,y){for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;if(x>rect.Left&&x<rect.Right&&y>rect.Top&&y<rect.Bottom){var result={ID:item.ID,Rect:rect,FrameID:item.FrameID,Type:item.Type,Data:item.Data};if(item.Type==1){result.Title=item.Title;result.OverlayID=item.OverlayID;}return result;}}return null;};}//画图工具
5809
5817
  function IChartDrawPicture(){this.Frame;this.Canvas;this.Point=new Array();//画图的点
5810
5818
  this.Value=new Array();//XValue,YValue
5811
5819
  this.LinePoint=[];this.PointCount=2;//画点的个数
@@ -6010,8 +6018,10 @@ this.LineWidth=1;this.Precision=2;//小数位数
6010
6018
  this.ValueTextColor='rgb(250,250,250)';this.IsShowCorssCursor=true;//画的时候是否显示十字光标
6011
6019
  this.GetLabelCallback;//绘制标题回调函数
6012
6020
  this.PointCount=1;this.ClassName='ChartDrawHLine';this.Font=14*GetDevicePixelRatio()+"px 微软雅黑";this.TextFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.RightSpaceWidth=50;this.ButtonPosition=0;//按钮位置, 0=价格后面, 1=价格上面
6013
- this.ButtonBGColor='rgb(190,190,190)';this.ButtonSpace=3;this.TextMargin={Left:0,Right:0};this.Button={CloseIcon:{Text:'\uE62B',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE,TooltipText:null},SettingIcon:{Text:'\uE623',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING,TooltipText:null//修改ID, Text , TooltipText 可以外部定制按钮
6014
- }};this.AryButton=[];this.ExtendData;//扩展数据
6021
+ this.ButtonBGColor='rgb(190,190,190)';this.ButtonSpace=3;this.TextMargin={Left:0,Right:0};this.Button={CloseIcon:{Text:'\uE62B',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE,TooltipText:null,Margin:{Left:2,Right:2}},SettingIcon:{Text:'\uE623',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING,TooltipText:null,Margin:{Left:2,Right:2}//修改ID, Text , TooltipText 可以外部定制按钮
6022
+ }};this.CustomButton=[];//自定义的按钮 { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1, TooltipText:null }
6023
+ this.AryShowButton=[];//需要显示的按钮 { Data:, Width }
6024
+ this.AryButton=[];this.ExtendData;//扩展数据
6015
6025
  this.ShowPriceTextConfig={IsShow:[false,false,true],//[0]=left内 [1]=right内 [2]=right外
6016
6026
  Font:[12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1']};//内部变量
6017
6027
  this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.GetLabelCallback){this.GetLabelCallback=option.GetLabelCallback;}if(IFrameSplitOperator.IsNumber(option.Precision))this.Precision=option.Precision;if(IFrameSplitOperator.IsNumber(option.Precision))this.Precision=option.Precision;if(option.Font)this.Font=option.Font;if(option.ValueTextColor)this.ValueTextColor=option.ValueTextColor;if(IFrameSplitOperator.IsNumber(option.ButtonPosition))this.ButtonPosition=option.ButtonPosition;if(IFrameSplitOperator.IsNumber(option.RightSpaceWidth))this.RightSpaceWidth=option.RightSpaceWidth;if(option.Button){var item=option.Button;if(item.CloseIcon)this.Button.CloseIcon=CloneData(item.CloseIcon);else if(item.CloseIcon===null)this.Button.CloseIcon=null;if(item.SettingIcon)this.Button.SettingIcon=CloneData(item.SettingIcon);else if(item.SettingIcon===null)this.Button.SettingIcon=null;}if(option.ExtendData)this.ExtendData=option.ExtendData;if(IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText)){for(var i=0;i<option.IsShowPriceText.length&&i<3;++i){var value=option.IsShowPriceText[i];if(IFrameSplitOperator.IsBool(value))this.ShowPriceTextConfig.IsShow[i]=value;}}if(option.TextMargin){var item=option.TextMargin;if(IFrameSplitOperator.IsNumber(item.Left))this.TextMargin.Left=item.Left;if(IFrameSplitOperator.IsNumber(item.Right))this.TextMargin.Right=item.Right;}}};this.ExportStorageData=function(){var storageData;if(this.Super_ExportStorageData){storageData=this.Super_ExportStorageData();if(this.Label)storageData.Label=this.Label;}return storageData;};this.IsPointIn=this.IsPointIn_XYValue_Line;/*
@@ -6023,9 +6033,11 @@ this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.SetOpt
6023
6033
  return this.PointRange(drawPoint);
6024
6034
  }
6025
6035
  */this.IsDrawMain=function()//选中绘制在动态绘图上, 没有选中绘制在背景上
6026
- {if(!this.GetActiveDrawPicture)return true;var active=this.GetActiveDrawPicture();if(active.Select.Guid==this.Guid)return false;return true;};this.MainDraw=function(){this.Draw();};this.Draw=function(moveonPoint,mouseStatus){this.LinePoint=[];this.AryButton=[];this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return null;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}this.ClipFrame();//画线段
6036
+ {if(!this.GetActiveDrawPicture)return true;var active=this.GetActiveDrawPicture();if(active.Select.Guid==this.Guid)return false;return true;};this.MainDraw=function(){this.Draw();};//获取需要显示的按钮 系统按钮+自定义按钮
6037
+ this.GetShowButton=function(){var aryButton=[];var item=this.Button.SettingIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});item=this.Button.CloseIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomButton)){for(var i=0;i<this.CustomButton.length;++i){item=this.CustomButton[i];if(item&&item.Text)aryButton.push({Data:item,Width:null});}}return aryButton;};this.Draw=function(moveonPoint,mouseStatus){this.AryShowButton=[];this.LinePoint=[];this.AryButton=[];this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return null;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}this.ClipFrame();//画线段
6027
6038
  this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(drawPoint[0].X,left);this.Canvas.lineTo(drawPoint[0].X,right);}else{this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));}this.Canvas.stroke();this.RestoreLineWidth();//画水平线段
6028
- var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoint[0].X;line.Start.Y=left;line.End.X=drawPoint[0].X;line.End.Y=right;}else{line.Start.X=left;line.Start.Y=drawPoint[0].Y;line.End.X=right;line.End.Y=drawPoint[0].Y;}this.LinePoint.push(line);var yValue=this.Frame.GetYData(drawPoint[0].Y);var strPrice=yValue.toFixed(this.Precision);if(this.ShowPriceTextConfig.IsShow[0]){this.DrawPriceText(strPrice,line.Start,line.End,0);}if(this.ShowPriceTextConfig.IsShow[1]){this.DrawPriceText(strPrice,line.Start,line.End,1);}var labInfo;if(this.GetLabelCallback)labInfo=this.GetLabelCallback(this);//描述信息
6039
+ var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoint[0].X;line.Start.Y=left;line.End.X=drawPoint[0].X;line.End.Y=right;}else{line.Start.X=left;line.Start.Y=drawPoint[0].Y;line.End.X=right;line.End.Y=drawPoint[0].Y;}this.LinePoint.push(line);var yValue=this.Frame.GetYData(drawPoint[0].Y);var strPrice=yValue.toFixed(this.Precision);if(this.ShowPriceTextConfig.IsShow[0]){this.DrawPriceText(strPrice,line.Start,line.End,0);}if(this.ShowPriceTextConfig.IsShow[1]){this.DrawPriceText(strPrice,line.Start,line.End,1);}var labInfo;if(this.GetLabelCallback)labInfo=this.GetLabelCallback(this);this.AryShowButton=this.GetShowButton();//获取按钮
6040
+ //描述信息
6029
6041
  if(labInfo)this.DrawLab(labInfo,drawPoint[0].Y);//画中心点
6030
6042
  var xCenter=left+(right-left)/2;var point={X:xCenter,Y:drawPoint[0].Y};this.DrawPoint([point]);this.Canvas.restore();//外部右侧显示价格
6031
6043
  if(this.ShowPriceTextConfig.IsShow[2]){var rtDraw={};this.CalculateButtonSize();this.DrawValueText(drawPoint[0].Y,rtDraw,labInfo);if(labInfo)this.DrawRightLab(labInfo,rtDraw);if(labInfo)this.DrawCustomHLine(labInfo,drawPoint[0].Y);}//鼠标是否在按钮上
@@ -6034,18 +6046,7 @@ if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;var rtTop=y-labSize.He
6034
6046
  if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;var rtTop=drawTop;this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(labSize.Width),ToFixedRect(labSize.Height));}var yText=drawTop+1+lineSpace;this.Canvas.textBaseline="top";for(var i=0;i<labInfo.AryText.length;++i){var item=labInfo.AryText[i];if(item.Name){this.Canvas.textAlign="left";this.Canvas.fillStyle=item.NameColor;this.Canvas.fillText(item.Name,drawLeft+1,yText+1);}if(item.Text){this.Canvas.textAlign="right";this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Text,drawRight-1,yText+1);}yText+=labSize.LineHeight+lineSpace;}};this.DrawCustomHLine=function(labInfo,yLine){if(!labInfo)return;if(!IFrameSplitOperator.IsNonEmptyArray(labInfo.AryLine))return;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var pixelRatio=GetDevicePixelRatio();var yMax=yLine,yMin=yLine;for(var i=0;i<labInfo.AryLine.length;++i){var item=labInfo.AryLine[i];if(!IFrameSplitOperator.IsNumber(item.Value))continue;if(item.Width<0)continue;var y=this.Frame.GetYFromData(item.Value);var yFixed=ToFixedPoint(y);var xRight=right;if(IFrameSplitOperator.IsPlusNumber(item.Width)){if(item.Width<1)xRight=left+item.Width*(right-left);//0.3 百分比
6035
6047
  else xRight=left+item.Width*pixelRatio;//>1 实际数值就是长度
6036
6048
  }if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(xRight,yFixed);this.Canvas.stroke();if(yMax<yFixed)yMax=yFixed;if(yMin>yFixed)yMin=yFixed;}if(yMax!=yMin&&labInfo.VLine){var item=labInfo.VLine;var x=left+20*pixelRatio;if(IFrameSplitOperator.IsNumber(item.XOffset))x=left+item.XOffset*pixelRatio;x=ToFixedPoint(x);if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(x,yMax);this.Canvas.lineTo(x,yMin);this.Canvas.stroke();}};this.DrawValueText=function(y,rtDraw,labInfo){var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(this.RightSpaceWidth>0){this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(right,ToFixedPoint(y));this.Canvas.lineTo(right+this.RightSpaceWidth,ToFixedPoint(y));this.Canvas.stroke();}var yValue=this.Frame.GetYData(y);var strValue=yValue.toFixed(this.Precision);if(labInfo&&labInfo.PriceSuffixText)strValue+=labInfo.PriceSuffixText;this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var rtBG={Left:right+this.RightSpaceWidth,Top:y-lineHeight/2,Width:textWidth+4,Height:lineHeight};//rtBG.Right=rtBG.Left+rtBG.Width;
6037
- rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;var xText=rtBG.Left+this.TextMargin.Left+2;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(strValue,xText,y);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);};this.DrawPriceText=function(text,ptStart,ptEnd,position){if(position!=1&&position!=0)return;var font=this.ShowPriceTextConfig.Font[position];this.Canvas.fillStyle=this.LineColor;this.Canvas.font=font;var textWidth=this.Canvas.measureText(text).width;var lineHeight=this.GetFontHeight();var rtBG=null;if(position==1){var rtBG={Left:ptStart.X,Top:ptStart.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}else if(position==0){var rtBG={Right:ptEnd.X,Top:ptEnd.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);};this.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(this.Button.SettingIcon){var icon=this.Button.SettingIcon;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;var width=this.Canvas.measureText(icon.Text).width;this.SettingButtonSize=width;}if(this.Button.CloseIcon){var icon=this.Button.CloseIcon;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;var width=this.Canvas.measureText(icon.Text).width;this.ColseButtonSize=width;}if(this.ColseButtonSize<=0&&this.SettingButtonSize<=0)return;var buttonWidth=0;if(this.SettingButtonSize>0)buttonWidth+=this.SettingButtonSize;if(this.ColseButtonSize>0){if(buttonWidth>0)buttonWidth+=this.ButtonSpace;buttonWidth+=this.ColseButtonSize;}buttonWidth+=4;this.ButtonBGWidth=buttonWidth;};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(this.ColseButtonSize<=0&&this.SettingButtonSize<=0)return;if(this.ButtonPosition==1)drawTop-=drawHeight;this.Canvas.fillStyle=this.LineColor;var left=drawLeft;var rtBG={Left:drawLeft,Top:drawTop,Width:this.ButtonBGWidth,Height:drawHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));left+=1;var pixelRatio=GetDevicePixelRatio();if(this.Button.SettingIcon&&this.Button.SettingIcon.Text){var rtButton={Left:left,Top:drawTop,Width:this.SettingButtonSize,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var icon=this.Button.SettingIcon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText});/*
6038
- if (this.ColseButtonSize>0)
6039
- {
6040
- var xLine=rtButton.Right+this.ButtonSpace/2;
6041
- xLine=ToFixedPoint(xLine);
6042
- this.Canvas.strokeStyle=this.ButtonSplitLineColor;
6043
- this.Canvas.beginPath();
6044
- this.Canvas.moveTo(xLine,rtButton.Top);
6045
- this.Canvas.lineTo(xLine,rtButton.Bottom);
6046
- this.Canvas.stroke();
6047
- }
6048
- */left=rtButton.Right+this.ButtonSpace;}if(this.Button.CloseIcon&&this.Button.CloseIcon.Text){var rtButton={Left:left,Top:drawTop,Width:this.ColseButtonSize,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var icon=this.Button.CloseIcon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText});left=rtButton.Right;}rtDraw.Right=rtBG.Right;};this.PtInButtons=function(x,y){for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};}//趋势线
6049
+ rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;var xText=rtBG.Left+this.TextMargin.Left+2;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(strValue,xText,y);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);};this.DrawPriceText=function(text,ptStart,ptEnd,position){if(position!=1&&position!=0)return;var font=this.ShowPriceTextConfig.Font[position];this.Canvas.fillStyle=this.LineColor;this.Canvas.font=font;var textWidth=this.Canvas.measureText(text).width;var lineHeight=this.GetFontHeight();var rtBG=null;if(position==1){var rtBG={Left:ptStart.X,Top:ptStart.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}else if(position==0){var rtBG={Right:ptEnd.X,Top:ptEnd.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);};this.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;var totalWidth=0;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;item.Width=this.Canvas.measureText(icon.Text).width+2;if(icon.Margin){var margin=icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;}totalWidth+=item.Width;}this.ButtonBGWidth=totalWidth;};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.ButtonPosition==1)drawTop-=drawHeight;this.Canvas.fillStyle=this.LineColor;var left=drawLeft;var rtBG={Left:drawLeft,Top:drawTop,Width:this.ButtonBGWidth,Height:drawHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));var pixelRatio=GetDevicePixelRatio();for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var rtButton={Left:left,Top:drawTop,Width:item.Width,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(icon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText});left=rtButton.Right;}};this.PtInButtons=function(x,y){for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};}//趋势线
6049
6050
  function ChartDrawPictureTrendLine(){this.newMethod=IChartDrawPicture;//派生
6050
6051
  this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPictureTrendLine';this.IsPointIn=this.IsPointIn_XYValue_Line;this.GetXYCoordinate=this.GetXYCoordinate_default;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:false,IsCheckY:false});if(!drawPoint||drawPoint.length!=2)return;var ptStart=drawPoint[0];var ptEnd=drawPoint[1];var extendLine=this.CalculateExtendLinePoint(ptStart,ptEnd);this.ClipFrame();this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(extendLine.Start.X,extendLine.Start.Y);this.Canvas.lineTo(extendLine.End.X,extendLine.End.Y);this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);this.DrawPoint(drawPoint);//画点
6051
6052
  this.Canvas.restore();};}//画图工具-矩形
@@ -11602,7 +11603,7 @@ frame.ChartPaint.push(chartText);};//创建文本
11602
11603
  this.CreateText=function(hqChart,windowIndex,varItem,id,drawName){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.ReloadResource();if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);var titleIndex=windowIndex+1;if(varItem.Draw.Position)chart.Position=varItem.Draw.Position;//赋值坐标
11603
11604
  if(varItem.Draw.DrawData)chart.Data.Data=varItem.Draw.DrawData;chart.Text=varItem.Draw.Text;if(varItem.Draw.Direction>0)chart.Direction=varItem.Draw.Direction;if(varItem.Draw.YOffset>0)chart.YOffset=varItem.Draw.YOffset;if(varItem.Draw.TextAlign)chart.TextAlign=varItem.Draw.TextAlign;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
11604
11605
  frame.ChartPaint.push(chart);};//COLORSTICK
11605
- this.CreateMACD=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMACD();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];var clrTitle=this.GetDefaultColor(id);if(varItem.Color)clrTitle=this.GetColor(varItem.Color);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;this.ReloadChartResource(hqChart,windowIndex,chart);titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,clrTitle);frame.ChartPaint.push(chart);};this.CreatePointDot=function(hqChart,windowIndex,varItem,id,hisData){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartPointDot();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.Radius)chart.Radius=varItem.Radius;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.Radius=width;}if(IFrameSplitOperator.IsBool(varItem.UpDownDot)){chart.EnableUpDownColor=varItem.UpDownDot;chart.HistoryData=hisData;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateStick=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,chart);var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateLineStick=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLineStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateStraightLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLine();chart.DrawType=1;chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
11606
+ this.CreateMACD=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMACD();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];var clrTitle=this.GetDefaultColor(id);if(varItem.Color)clrTitle=this.GetColor(varItem.Color);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;this.ReloadChartResource(hqChart,windowIndex,chart);titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,clrTitle);this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreatePointDot=function(hqChart,windowIndex,varItem,id,hisData){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartPointDot();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.Radius)chart.Radius=varItem.Radius;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.Radius=width;}if(IFrameSplitOperator.IsBool(varItem.UpDownDot)){chart.EnableUpDownColor=varItem.UpDownDot;chart.HistoryData=hisData;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateStick=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,chart);var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateLineStick=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLineStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateStraightLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLine();chart.DrawType=1;chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
11606
11607
  frame.ChartPaint.push(chart);};this.CreateVolStick=function(hqChart,windowIndex,varItem,id,hisData){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartVolStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.KLineDrawType=hqChart.KLineDrawType;//设置K线显示类型
11607
11608
  if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))chart.BarWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;chart.HistoryData=hisData;this.ReloadChartResource(hqChart,windowIndex,chart);var titlePaint=hqChart.TitlePaint[titleIndex];var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;this.SetTitleData(titleData,chart);this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;if(IFrameSplitOperator.IsBool(varItem.IsFirstDraw))chart.IsDrawFirst=varItem.IsFirstDraw;frame.ChartPaint.push(chart);};//创建K线图
11608
11609
  this.CreateKLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartKLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data.Data=varItem.Draw.DrawData;chart.IsShowMaxMinPrice=false;chart.IsShowKTooltip=false;if(varItem.Color)//如果设置了颜色,使用外面设置的颜色
@@ -11612,7 +11613,7 @@ var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData.Value;chart.T
11612
11613
  this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateTextLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartTextLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;if(varItem.Draw&&varItem.Draw.DrawData){var drawData=varItem.Draw.DrawData;chart.Text=drawData.Text;chart.Line=drawData.Line;chart.Price=drawData.Price;}frame.ChartPaint.push(chart);};this.CreateStackedBar=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartStackedBar();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.BarColor))chart.BarColor=varItem.Draw.BarColor;if(IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.BarName))chart.BarName=varItem.Draw.BarName;if(IFrameSplitOperator.IsNumber(varItem.Draw.LineWidth))chart.LineWidth=varItem.Draw.LineWidth;if(IFrameSplitOperator.IsNumber(varItem.Draw.BarType))chart.BarType=varItem.Draw.BarType;chart.Data.Data=varItem.Draw.DrawData;var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);titleData.DataType="ChartStackedBar";titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;frame.ChartPaint.push(chart);};//创建图标
11613
11614
  this.CreateIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.TextAlign='center';chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chart.Direction=1;else if(varItem.DrawVAlign==1)chart.Direction=0;else if(varItem.DrawVAlign==2)chart.Direction=2;}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chart.TextAlign="left";else if(varItem.DrawAlign==1)chart.TextAlign="center";else if(varItem.DrawAlign==2)chart.TextAlign='right';}if(IFrameSplitOperator.IsNumber(varItem.XOffset))chart.ShowOffset.X=varItem.XOffset;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chart.ShowOffset.Y=varItem.YOffset;chart.Data.Data=varItem.Draw.DrawData;var icon=varItem.Draw.Icon;if(icon.IconFont==true){chart.IconFont={Family:icon.Family,Text:icon.Symbol,Color:icon.Color};}else{chart.Text=icon.Symbol;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else if(icon.Color)chart.Color=icon.Color;else chart.Color='rgb(0,0,0)';}//var titleIndex=windowIndex+1;
11614
11615
  //hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
11615
- frame.ChartPaint.push(chart);};this.CreateTipIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartDrawSVG();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(hqChart.ChartPaint[0].IsMinuteFrame())chart.Data=hqChart.SourceData;else chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11616
+ this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateTipIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartDrawSVG();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(hqChart.ChartPaint[0].IsMinuteFrame())chart.Data=hqChart.SourceData;else chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11616
11617
  chart.Family=varItem.Draw.Icon.Family;chart.TextFont=g_JSChartResource.TIPICON.TextFont;var svgSize=g_JSChartResource.TIPICON.Size;var svgColor=g_JSChartResource.TIPICON.Color;var svgYOffset=0;var svgVAlign=2;//上下对齐方式
11617
11618
  if(IFrameSplitOperator.IsNumber(varItem.YOffset))svgYOffset=varItem.YOffset;if(varItem.Color)svgColor=this.GetColor(varItem.Color);if(varItem.DrawFontSize>0)svgSize=varItem.DrawFontSize;if(varItem.DrawVAlign>=0)svgVAlign=varItem.DrawVAlign;if(varItem.Draw&&IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.DrawData)&&varItem.Draw.Icon){var drawData=varItem.Draw.DrawData;var aryData=[];var isArrayTip=Array.isArray(varItem.Draw.Text);var singleTip=null;if(!isArrayTip&&varItem.Draw.Text)singleTip={Text:varItem.Draw.Text};for(var j=0;j<drawData.length;++j){var item=drawData[j];if(!IFrameSplitOperator.IsNumber(item))continue;var svgItem={Index:j,Value:item,SVG:{Symbol:varItem.Draw.Icon.Symbol,Size:svgSize,Color:svgColor,YOffset:svgYOffset,VAlign:svgVAlign}};if(isArrayTip){var text=varItem.Draw.Text[j];if(text)svgItem.Tooltip={Text:text};}else{svgItem.Tooltip=singleTip;}aryData.push(svgItem);}chart.Texts=aryData;}frame.ChartPaint.push(chart);};//创建通道
11618
11619
  this.CreateChannel=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartChannel();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Draw.AreaColor)chart.AreaColor=varItem.Draw.AreaColor;else if(varItem.Color)chart.AreaColor=this.GetColor(varItem.Color);else chart.AreaColor=this.GetDefaultColor(id);if(varItem.Draw.Border.Color)chart.LineColor=varItem.Draw.Border.Color;else chart.LineColor=null;if(varItem.Draw.Border.Dotted)chart.LineDotted=varItem.Draw.Border.Dotted;if(varItem.Draw.Border.Width>0)chart.LineWidth=varItem.Draw.Border.Width;//let titleIndex=windowIndex+1;
@@ -13181,7 +13182,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13181
13182
  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);};}/********************************************************************************
13182
13183
  * 版本信息输出
13183
13184
  *
13184
- */var HQCHART_VERSION="1.1.13205";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13185
+ */var HQCHART_VERSION="1.1.13209";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13185
13186
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13186
13187
  // BaseIndex:BaseIndex,
13187
13188
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13206",
3
+ "version": "1.1.13210",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -22360,6 +22360,7 @@ function OverlayScriptIndex(name,script,args,option)
22360
22360
 
22361
22361
  titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,clrTitle);
22362
22362
 
22363
+ this.SetChartIndexName(chart);
22363
22364
  frame.ChartPaint.push(chart);
22364
22365
  }
22365
22366
 
@@ -22714,6 +22715,7 @@ function OverlayScriptIndex(name,script,args,option)
22714
22715
 
22715
22716
  //var titleIndex=windowIndex+1;
22716
22717
  //hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
22718
+ this.SetChartIndexName(chart);
22717
22719
  frame.ChartPaint.push(chart);
22718
22720
  }
22719
22721
 
@@ -2661,7 +2661,12 @@ var JSCHART_MENU_ID=
2661
2661
  CMD_SHOW_BEFORE_DATA_ID:24, //显示|隐藏集合竞价
2662
2662
 
2663
2663
  CMD_SELECTED_ZOOM_ID:25, //选中放大
2664
- CMD_SELECTED_SUMMARY_ID:26, //区间统计
2664
+ CMD_SELECTED_SUMMARY_ID:26, //区间统计
2665
+
2666
+ CMD_SHOW_INDEX_ID:27, //显示隐藏指标
2667
+ CMD_SHOW_OVERLAY_INDEX_ID:28, //显示隐藏叠加指标
2668
+ CMD_DELETE_OVERLAY_INDEX_ID:29, //删除叠加指标
2669
+ CMD_SHOW_OVERLAY_Y_AXIS_ID:30, //显示隐藏Y轴叠加指标
2665
2670
  }
2666
2671
 
2667
2672
 
@@ -9256,9 +9261,92 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9256
9261
  var dlg=new KLineSelectRectDialog(this.DivElement);
9257
9262
  dlg.DoModal(srcParam);
9258
9263
  break;
9264
+
9265
+ case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID: //显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
9266
+ if (param==null || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
9267
+ var windowIndex=param, showType=aryArgs[1];
9268
+ var script=this.WindowIndex[windowIndex];
9269
+ if (!script) return false;
9270
+
9271
+ if (showType==1) script.IsShow=false;
9272
+ else if (showType==2) script.IsShow=true;
9273
+ else script.IsShow=!script.IsShow;
9274
+
9275
+ this.UpdateWindowIndex(windowIndex);
9276
+ break;
9277
+
9278
+ case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID: //显示隐藏叠加指标 [0]=indexGuid [1]=0=自动 1=隐藏 2=显示
9279
+ if (!srcParam || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
9280
+ var indexGuid=srcParam,showType=aryArgs[1];
9281
+
9282
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
9283
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return false;
9284
+
9285
+ var script=overlay.OverlayItem.Script;
9286
+
9287
+ if (showType==1) script.IsShow=false;
9288
+ else if (showType==2) script.IsShow==true;
9289
+ else script.IsShow=!script.IsShow;
9290
+
9291
+ this.UpdateOverlayIndex(indexGuid);
9292
+ break;
9293
+ case JSCHART_MENU_ID.CMD_DELETE_OVERLAY_INDEX_ID:
9294
+ if (srcParam && this.DeleteOverlayWindowsIndex)
9295
+ this.DeleteOverlayWindowsIndex(srcParam);
9296
+ break;
9297
+ case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID:
9298
+ if (!srcParam || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
9299
+ if (!this.GetOverlayIndexByIdentify) return false;
9300
+
9301
+ var indexGuid=srcParam,showType=aryArgs[1];
9302
+ var finder=this.GetOverlayIndexByIdentify(indexGuid);
9303
+ if (!finder || !finder.OverlayItem) return false;
9304
+
9305
+ var frame=finder.OverlayItem.Frame;
9306
+ if (showType==1) frame.IsShow=false;
9307
+ else if (showType==2) frame.IsShow==true;
9308
+ else frame.IsShow=!frame.IsShow;
9309
+
9310
+ this.UpdataDataoffset(); //更新数据偏移
9311
+ this.UpdateFrameMaxMin(); //调整坐标最大 最小值
9312
+ this.Draw();
9313
+
9314
+ break;
9259
9315
  }
9260
9316
  }
9261
9317
 
9318
+ this.GetShowIndexMenuData=function(windowIndex, showType)
9319
+ {
9320
+ var script=this.WindowIndex[windowIndex];
9321
+ if (!script) return null;
9322
+
9323
+ var data= { Name:script.IsShow?"隐藏指标":"显示指标", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_INDEX_ID, Args:[windowIndex, 0] } };
9324
+
9325
+ return data;
9326
+ }
9327
+
9328
+ this.GetShowOverlayIndexMenuData=function(indexGuid, showType)
9329
+ {
9330
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
9331
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return null;
9332
+
9333
+ var script=overlay.OverlayItem.Script;
9334
+ var data= { Name:script.IsShow?"隐藏指标":"显示指标", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID, Args:[indexGuid, 0] } };
9335
+
9336
+ return data;
9337
+ }
9338
+
9339
+ this.GetShowOverlayIndexYAxisMenuData=function(indexGuid, showType)
9340
+ {
9341
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
9342
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return null;
9343
+
9344
+ var frame=overlay.OverlayItem.Frame;
9345
+ var data= { Name:frame.IsShow?"隐藏Y轴":"显示Y轴", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID, Args:[indexGuid, 0] } };
9346
+
9347
+ return data;
9348
+ }
9349
+
9262
9350
  //点击右键菜单
9263
9351
  this.OnClickRightMenu=function(data)
9264
9352
  {
@@ -53763,7 +53851,7 @@ function DynamicChartTitlePainting()
53763
53851
  var rtButton={ Left:left, YCenter:yCenter };
53764
53852
  this.DrawButton(item, rtButton, moveonPoint, mouseStatus);
53765
53853
 
53766
- this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:1, OverlayID:toolbarInfo.ID, Title:overlayItem.Title });
53854
+ this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:1, OverlayID:toolbarInfo.ID, Title:overlayItem.Title, Data:item.Data });
53767
53855
 
53768
53856
  left=rtButton.Right;
53769
53857
 
@@ -55993,11 +56081,14 @@ function ChartDrawHLine()
55993
56081
 
55994
56082
  this.Button=
55995
56083
  {
55996
- CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null },
55997
- SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null }
56084
+ CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null, Margin:{ Left:2, Right:2 } },
56085
+ SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null, Margin:{ Left:2, Right:2 } }
55998
56086
  //修改ID, Text , TooltipText 可以外部定制按钮
55999
56087
  }
56000
56088
 
56089
+ this.CustomButton=[]; //自定义的按钮 { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1, TooltipText:null }
56090
+
56091
+ this.AryShowButton=[]; //需要显示的按钮 { Data:, Width }
56001
56092
  this.AryButton=[];
56002
56093
  this.ExtendData; //扩展数据
56003
56094
  this.ShowPriceTextConfig=
@@ -56103,8 +56194,32 @@ function ChartDrawHLine()
56103
56194
  this.Draw();
56104
56195
  }
56105
56196
 
56197
+ //获取需要显示的按钮 系统按钮+自定义按钮
56198
+ this.GetShowButton=function()
56199
+ {
56200
+ var aryButton=[];
56201
+
56202
+ var item=this.Button.SettingIcon;
56203
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
56204
+
56205
+ item=this.Button.CloseIcon;
56206
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
56207
+
56208
+ if (IFrameSplitOperator.IsNonEmptyArray(this.CustomButton))
56209
+ {
56210
+ for(var i=0;i<this.CustomButton.length;++i)
56211
+ {
56212
+ item=this.CustomButton[i];
56213
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
56214
+ }
56215
+ }
56216
+
56217
+ return aryButton;
56218
+ }
56219
+
56106
56220
  this.Draw=function(moveonPoint, mouseStatus)
56107
56221
  {
56222
+ this.AryShowButton=[];
56108
56223
  this.LinePoint=[];
56109
56224
  this.AryButton=[];
56110
56225
  this.ColseButtonSize=0;
@@ -56180,6 +56295,8 @@ function ChartDrawHLine()
56180
56295
  var labInfo;
56181
56296
  if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
56182
56297
 
56298
+ this.AryShowButton=this.GetShowButton(); //获取按钮
56299
+
56183
56300
  //描述信息
56184
56301
  if (labInfo)
56185
56302
  this.DrawLab(labInfo, drawPoint[0].Y);
@@ -56483,42 +56600,33 @@ function ChartDrawHLine()
56483
56600
  {
56484
56601
  var pixelRatio=GetDevicePixelRatio();
56485
56602
 
56486
- if (this.Button.SettingIcon)
56487
- {
56488
- var icon=this.Button.SettingIcon;
56489
- var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
56490
- this.Canvas.font=font;
56491
- var width=this.Canvas.measureText(icon.Text).width;
56492
- this.SettingButtonSize=width;
56493
- }
56603
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
56494
56604
 
56495
- if (this.Button.CloseIcon)
56605
+ var totalWidth=0;
56606
+ for(var i=0;i<this.AryShowButton.length;++i)
56496
56607
  {
56497
- var icon=this.Button.CloseIcon;
56608
+ var item=this.AryShowButton[i];
56609
+ var icon=item.Data;
56498
56610
  var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
56499
56611
  this.Canvas.font=font;
56500
- var width=this.Canvas.measureText(icon.Text).width;
56501
- this.ColseButtonSize=width;
56502
- }
56612
+ item.Width=this.Canvas.measureText(icon.Text).width+2;
56503
56613
 
56504
- if (this.ColseButtonSize<=0 && this.SettingButtonSize<=0) return;
56614
+ if (icon.Margin)
56615
+ {
56616
+ var margin=icon.Margin;
56617
+ if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
56618
+ if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
56619
+ }
56505
56620
 
56506
- var buttonWidth=0
56507
- if (this.SettingButtonSize>0) buttonWidth+=this.SettingButtonSize;
56508
- if (this.ColseButtonSize>0)
56509
- {
56510
- if (buttonWidth>0) buttonWidth+=this.ButtonSpace;
56511
- buttonWidth+=this.ColseButtonSize;
56621
+ totalWidth+=item.Width;
56512
56622
  }
56513
56623
 
56514
- buttonWidth+=4;
56515
-
56516
- this.ButtonBGWidth=buttonWidth;
56624
+ this.ButtonBGWidth=totalWidth;
56517
56625
  }
56518
56626
 
56519
56627
  this.DrawButton=function(drawTop, drawLeft, drawHeight, rtDraw)
56520
56628
  {
56521
- if (this.ColseButtonSize<=0 && this.SettingButtonSize<=0) return;
56629
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
56522
56630
 
56523
56631
  if (this.ButtonPosition==1) drawTop-=drawHeight;
56524
56632
 
@@ -56530,61 +56638,29 @@ function ChartDrawHLine()
56530
56638
  this.Canvas.fillStyle=this.ButtonBGColor;
56531
56639
  this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
56532
56640
 
56533
- left+=1;
56534
56641
  var pixelRatio=GetDevicePixelRatio();
56535
- if (this.Button.SettingIcon && this.Button.SettingIcon.Text)
56642
+ for(var i=0;i<this.AryShowButton.length;++i)
56536
56643
  {
56537
- var rtButton={Left:left, Top:drawTop, Width:this.SettingButtonSize, Height:drawHeight };
56538
- rtButton.Right=rtButton.Left+rtButton.Width;
56539
- rtButton.Bottom=rtButton.Top+rtButton.Height;
56540
- var yCenter=rtButton.Top+rtButton.Height/2;
56541
- var xCenter=rtButton.Left+rtButton.Width/2;
56542
-
56543
- var icon=this.Button.SettingIcon;
56544
- this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
56545
- this.Canvas.textAlign="center";
56546
- this.Canvas.textBaseline="middle";
56547
- this.Canvas.fillStyle=icon.Color;
56548
- this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);
56549
-
56550
- this.AryButton.push({Rect:rtButton, ID:icon.ID, TooltipText:icon.TooltipText});
56644
+ var item=this.AryShowButton[i];
56645
+ var icon=item.Data;
56551
56646
 
56552
- /*
56553
- if (this.ColseButtonSize>0)
56554
- {
56555
- var xLine=rtButton.Right+this.ButtonSpace/2;
56556
- xLine=ToFixedPoint(xLine);
56557
- this.Canvas.strokeStyle=this.ButtonSplitLineColor;
56558
- this.Canvas.beginPath();
56559
- this.Canvas.moveTo(xLine,rtButton.Top);
56560
- this.Canvas.lineTo(xLine,rtButton.Bottom);
56561
- this.Canvas.stroke();
56562
- }
56563
- */
56564
-
56565
- left=rtButton.Right+this.ButtonSpace;
56566
- }
56567
-
56568
- if (this.Button.CloseIcon && this.Button.CloseIcon.Text)
56569
- {
56570
- var rtButton={Left:left, Top:drawTop, Width:this.ColseButtonSize, Height:drawHeight };
56647
+ var rtButton={Left:left, Top:drawTop, Width:item.Width, Height:drawHeight };
56571
56648
  rtButton.Right=rtButton.Left+rtButton.Width;
56572
56649
  rtButton.Bottom=rtButton.Top+rtButton.Height;
56573
56650
  var yCenter=rtButton.Top+rtButton.Height/2;
56574
56651
  var xCenter=rtButton.Left+rtButton.Width/2;
56575
- var icon=this.Button.CloseIcon;
56576
- this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
56652
+
56653
+ var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
56654
+ this.Canvas.font=font;
56577
56655
  this.Canvas.textAlign="center";
56578
56656
  this.Canvas.textBaseline="middle";
56579
56657
  this.Canvas.fillStyle=icon.Color;
56580
- this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);
56658
+ this.Canvas.fillText(icon.Text,xCenter,yCenter);
56581
56659
 
56582
56660
  this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText });
56583
56661
 
56584
56662
  left=rtButton.Right;
56585
56663
  }
56586
-
56587
- rtDraw.Right=rtBG.Right;
56588
56664
  }
56589
56665
 
56590
56666
  this.PtInButtons=function(x,y)
@@ -6553,7 +6553,12 @@ var JSCHART_MENU_ID=
6553
6553
  CMD_SHOW_BEFORE_DATA_ID:24, //显示|隐藏集合竞价
6554
6554
 
6555
6555
  CMD_SELECTED_ZOOM_ID:25, //选中放大
6556
- CMD_SELECTED_SUMMARY_ID:26, //区间统计
6556
+ CMD_SELECTED_SUMMARY_ID:26, //区间统计
6557
+
6558
+ CMD_SHOW_INDEX_ID:27, //显示隐藏指标
6559
+ CMD_SHOW_OVERLAY_INDEX_ID:28, //显示隐藏叠加指标
6560
+ CMD_DELETE_OVERLAY_INDEX_ID:29, //删除叠加指标
6561
+ CMD_SHOW_OVERLAY_Y_AXIS_ID:30, //显示隐藏Y轴叠加指标
6557
6562
  }
6558
6563
 
6559
6564
 
@@ -13148,9 +13153,92 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13148
13153
  var dlg=new KLineSelectRectDialog(this.DivElement);
13149
13154
  dlg.DoModal(srcParam);
13150
13155
  break;
13156
+
13157
+ case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID: //显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
13158
+ if (param==null || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
13159
+ var windowIndex=param, showType=aryArgs[1];
13160
+ var script=this.WindowIndex[windowIndex];
13161
+ if (!script) return false;
13162
+
13163
+ if (showType==1) script.IsShow=false;
13164
+ else if (showType==2) script.IsShow=true;
13165
+ else script.IsShow=!script.IsShow;
13166
+
13167
+ this.UpdateWindowIndex(windowIndex);
13168
+ break;
13169
+
13170
+ case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID: //显示隐藏叠加指标 [0]=indexGuid [1]=0=自动 1=隐藏 2=显示
13171
+ if (!srcParam || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
13172
+ var indexGuid=srcParam,showType=aryArgs[1];
13173
+
13174
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
13175
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return false;
13176
+
13177
+ var script=overlay.OverlayItem.Script;
13178
+
13179
+ if (showType==1) script.IsShow=false;
13180
+ else if (showType==2) script.IsShow==true;
13181
+ else script.IsShow=!script.IsShow;
13182
+
13183
+ this.UpdateOverlayIndex(indexGuid);
13184
+ break;
13185
+ case JSCHART_MENU_ID.CMD_DELETE_OVERLAY_INDEX_ID:
13186
+ if (srcParam && this.DeleteOverlayWindowsIndex)
13187
+ this.DeleteOverlayWindowsIndex(srcParam);
13188
+ break;
13189
+ case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID:
13190
+ if (!srcParam || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
13191
+ if (!this.GetOverlayIndexByIdentify) return false;
13192
+
13193
+ var indexGuid=srcParam,showType=aryArgs[1];
13194
+ var finder=this.GetOverlayIndexByIdentify(indexGuid);
13195
+ if (!finder || !finder.OverlayItem) return false;
13196
+
13197
+ var frame=finder.OverlayItem.Frame;
13198
+ if (showType==1) frame.IsShow=false;
13199
+ else if (showType==2) frame.IsShow==true;
13200
+ else frame.IsShow=!frame.IsShow;
13201
+
13202
+ this.UpdataDataoffset(); //更新数据偏移
13203
+ this.UpdateFrameMaxMin(); //调整坐标最大 最小值
13204
+ this.Draw();
13205
+
13206
+ break;
13151
13207
  }
13152
13208
  }
13153
13209
 
13210
+ this.GetShowIndexMenuData=function(windowIndex, showType)
13211
+ {
13212
+ var script=this.WindowIndex[windowIndex];
13213
+ if (!script) return null;
13214
+
13215
+ var data= { Name:script.IsShow?"隐藏指标":"显示指标", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_INDEX_ID, Args:[windowIndex, 0] } };
13216
+
13217
+ return data;
13218
+ }
13219
+
13220
+ this.GetShowOverlayIndexMenuData=function(indexGuid, showType)
13221
+ {
13222
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
13223
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return null;
13224
+
13225
+ var script=overlay.OverlayItem.Script;
13226
+ var data= { Name:script.IsShow?"隐藏指标":"显示指标", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID, Args:[indexGuid, 0] } };
13227
+
13228
+ return data;
13229
+ }
13230
+
13231
+ this.GetShowOverlayIndexYAxisMenuData=function(indexGuid, showType)
13232
+ {
13233
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
13234
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return null;
13235
+
13236
+ var frame=overlay.OverlayItem.Frame;
13237
+ var data= { Name:frame.IsShow?"隐藏Y轴":"显示Y轴", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID, Args:[indexGuid, 0] } };
13238
+
13239
+ return data;
13240
+ }
13241
+
13154
13242
  //点击右键菜单
13155
13243
  this.OnClickRightMenu=function(data)
13156
13244
  {
@@ -57655,7 +57743,7 @@ function DynamicChartTitlePainting()
57655
57743
  var rtButton={ Left:left, YCenter:yCenter };
57656
57744
  this.DrawButton(item, rtButton, moveonPoint, mouseStatus);
57657
57745
 
57658
- this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:1, OverlayID:toolbarInfo.ID, Title:overlayItem.Title });
57746
+ this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:1, OverlayID:toolbarInfo.ID, Title:overlayItem.Title, Data:item.Data });
57659
57747
 
57660
57748
  left=rtButton.Right;
57661
57749
 
@@ -59885,11 +59973,14 @@ function ChartDrawHLine()
59885
59973
 
59886
59974
  this.Button=
59887
59975
  {
59888
- CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null },
59889
- SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null }
59976
+ CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null, Margin:{ Left:2, Right:2 } },
59977
+ SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null, Margin:{ Left:2, Right:2 } }
59890
59978
  //修改ID, Text , TooltipText 可以外部定制按钮
59891
59979
  }
59892
59980
 
59981
+ this.CustomButton=[]; //自定义的按钮 { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1, TooltipText:null }
59982
+
59983
+ this.AryShowButton=[]; //需要显示的按钮 { Data:, Width }
59893
59984
  this.AryButton=[];
59894
59985
  this.ExtendData; //扩展数据
59895
59986
  this.ShowPriceTextConfig=
@@ -59995,8 +60086,32 @@ function ChartDrawHLine()
59995
60086
  this.Draw();
59996
60087
  }
59997
60088
 
60089
+ //获取需要显示的按钮 系统按钮+自定义按钮
60090
+ this.GetShowButton=function()
60091
+ {
60092
+ var aryButton=[];
60093
+
60094
+ var item=this.Button.SettingIcon;
60095
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
60096
+
60097
+ item=this.Button.CloseIcon;
60098
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
60099
+
60100
+ if (IFrameSplitOperator.IsNonEmptyArray(this.CustomButton))
60101
+ {
60102
+ for(var i=0;i<this.CustomButton.length;++i)
60103
+ {
60104
+ item=this.CustomButton[i];
60105
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
60106
+ }
60107
+ }
60108
+
60109
+ return aryButton;
60110
+ }
60111
+
59998
60112
  this.Draw=function(moveonPoint, mouseStatus)
59999
60113
  {
60114
+ this.AryShowButton=[];
60000
60115
  this.LinePoint=[];
60001
60116
  this.AryButton=[];
60002
60117
  this.ColseButtonSize=0;
@@ -60072,6 +60187,8 @@ function ChartDrawHLine()
60072
60187
  var labInfo;
60073
60188
  if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
60074
60189
 
60190
+ this.AryShowButton=this.GetShowButton(); //获取按钮
60191
+
60075
60192
  //描述信息
60076
60193
  if (labInfo)
60077
60194
  this.DrawLab(labInfo, drawPoint[0].Y);
@@ -60375,42 +60492,33 @@ function ChartDrawHLine()
60375
60492
  {
60376
60493
  var pixelRatio=GetDevicePixelRatio();
60377
60494
 
60378
- if (this.Button.SettingIcon)
60379
- {
60380
- var icon=this.Button.SettingIcon;
60381
- var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60382
- this.Canvas.font=font;
60383
- var width=this.Canvas.measureText(icon.Text).width;
60384
- this.SettingButtonSize=width;
60385
- }
60495
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
60386
60496
 
60387
- if (this.Button.CloseIcon)
60497
+ var totalWidth=0;
60498
+ for(var i=0;i<this.AryShowButton.length;++i)
60388
60499
  {
60389
- var icon=this.Button.CloseIcon;
60500
+ var item=this.AryShowButton[i];
60501
+ var icon=item.Data;
60390
60502
  var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60391
60503
  this.Canvas.font=font;
60392
- var width=this.Canvas.measureText(icon.Text).width;
60393
- this.ColseButtonSize=width;
60394
- }
60504
+ item.Width=this.Canvas.measureText(icon.Text).width+2;
60395
60505
 
60396
- if (this.ColseButtonSize<=0 && this.SettingButtonSize<=0) return;
60506
+ if (icon.Margin)
60507
+ {
60508
+ var margin=icon.Margin;
60509
+ if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
60510
+ if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
60511
+ }
60397
60512
 
60398
- var buttonWidth=0
60399
- if (this.SettingButtonSize>0) buttonWidth+=this.SettingButtonSize;
60400
- if (this.ColseButtonSize>0)
60401
- {
60402
- if (buttonWidth>0) buttonWidth+=this.ButtonSpace;
60403
- buttonWidth+=this.ColseButtonSize;
60513
+ totalWidth+=item.Width;
60404
60514
  }
60405
60515
 
60406
- buttonWidth+=4;
60407
-
60408
- this.ButtonBGWidth=buttonWidth;
60516
+ this.ButtonBGWidth=totalWidth;
60409
60517
  }
60410
60518
 
60411
60519
  this.DrawButton=function(drawTop, drawLeft, drawHeight, rtDraw)
60412
60520
  {
60413
- if (this.ColseButtonSize<=0 && this.SettingButtonSize<=0) return;
60521
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
60414
60522
 
60415
60523
  if (this.ButtonPosition==1) drawTop-=drawHeight;
60416
60524
 
@@ -60422,61 +60530,29 @@ function ChartDrawHLine()
60422
60530
  this.Canvas.fillStyle=this.ButtonBGColor;
60423
60531
  this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
60424
60532
 
60425
- left+=1;
60426
60533
  var pixelRatio=GetDevicePixelRatio();
60427
- if (this.Button.SettingIcon && this.Button.SettingIcon.Text)
60534
+ for(var i=0;i<this.AryShowButton.length;++i)
60428
60535
  {
60429
- var rtButton={Left:left, Top:drawTop, Width:this.SettingButtonSize, Height:drawHeight };
60430
- rtButton.Right=rtButton.Left+rtButton.Width;
60431
- rtButton.Bottom=rtButton.Top+rtButton.Height;
60432
- var yCenter=rtButton.Top+rtButton.Height/2;
60433
- var xCenter=rtButton.Left+rtButton.Width/2;
60536
+ var item=this.AryShowButton[i];
60537
+ var icon=item.Data;
60434
60538
 
60435
- var icon=this.Button.SettingIcon;
60436
- this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60437
- this.Canvas.textAlign="center";
60438
- this.Canvas.textBaseline="middle";
60439
- this.Canvas.fillStyle=icon.Color;
60440
- this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);
60441
-
60442
- this.AryButton.push({Rect:rtButton, ID:icon.ID, TooltipText:icon.TooltipText});
60443
-
60444
- /*
60445
- if (this.ColseButtonSize>0)
60446
- {
60447
- var xLine=rtButton.Right+this.ButtonSpace/2;
60448
- xLine=ToFixedPoint(xLine);
60449
- this.Canvas.strokeStyle=this.ButtonSplitLineColor;
60450
- this.Canvas.beginPath();
60451
- this.Canvas.moveTo(xLine,rtButton.Top);
60452
- this.Canvas.lineTo(xLine,rtButton.Bottom);
60453
- this.Canvas.stroke();
60454
- }
60455
- */
60456
-
60457
- left=rtButton.Right+this.ButtonSpace;
60458
- }
60459
-
60460
- if (this.Button.CloseIcon && this.Button.CloseIcon.Text)
60461
- {
60462
- var rtButton={Left:left, Top:drawTop, Width:this.ColseButtonSize, Height:drawHeight };
60539
+ var rtButton={Left:left, Top:drawTop, Width:item.Width, Height:drawHeight };
60463
60540
  rtButton.Right=rtButton.Left+rtButton.Width;
60464
60541
  rtButton.Bottom=rtButton.Top+rtButton.Height;
60465
60542
  var yCenter=rtButton.Top+rtButton.Height/2;
60466
60543
  var xCenter=rtButton.Left+rtButton.Width/2;
60467
- var icon=this.Button.CloseIcon;
60468
- this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60544
+
60545
+ var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60546
+ this.Canvas.font=font;
60469
60547
  this.Canvas.textAlign="center";
60470
60548
  this.Canvas.textBaseline="middle";
60471
60549
  this.Canvas.fillStyle=icon.Color;
60472
- this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);
60550
+ this.Canvas.fillText(icon.Text,xCenter,yCenter);
60473
60551
 
60474
60552
  this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText });
60475
60553
 
60476
60554
  left=rtButton.Right;
60477
60555
  }
60478
-
60479
- rtDraw.Right=rtBG.Right;
60480
60556
  }
60481
60557
 
60482
60558
  this.PtInButtons=function(x,y)
@@ -116973,6 +117049,7 @@ function OverlayScriptIndex(name,script,args,option)
116973
117049
 
116974
117050
  titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,clrTitle);
116975
117051
 
117052
+ this.SetChartIndexName(chart);
116976
117053
  frame.ChartPaint.push(chart);
116977
117054
  }
116978
117055
 
@@ -117327,6 +117404,7 @@ function OverlayScriptIndex(name,script,args,option)
117327
117404
 
117328
117405
  //var titleIndex=windowIndex+1;
117329
117406
  //hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
117407
+ this.SetChartIndexName(chart);
117330
117408
  frame.ChartPaint.push(chart);
117331
117409
  }
117332
117410
 
@@ -131875,7 +131953,7 @@ function ScrollBarBGChart()
131875
131953
 
131876
131954
 
131877
131955
 
131878
- var HQCHART_VERSION="1.1.13205";
131956
+ var HQCHART_VERSION="1.1.13209";
131879
131957
 
131880
131958
  function PrintHQChartVersion()
131881
131959
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13205";
8
+ var HQCHART_VERSION="1.1.13209";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -6597,7 +6597,12 @@ var JSCHART_MENU_ID=
6597
6597
  CMD_SHOW_BEFORE_DATA_ID:24, //显示|隐藏集合竞价
6598
6598
 
6599
6599
  CMD_SELECTED_ZOOM_ID:25, //选中放大
6600
- CMD_SELECTED_SUMMARY_ID:26, //区间统计
6600
+ CMD_SELECTED_SUMMARY_ID:26, //区间统计
6601
+
6602
+ CMD_SHOW_INDEX_ID:27, //显示隐藏指标
6603
+ CMD_SHOW_OVERLAY_INDEX_ID:28, //显示隐藏叠加指标
6604
+ CMD_DELETE_OVERLAY_INDEX_ID:29, //删除叠加指标
6605
+ CMD_SHOW_OVERLAY_Y_AXIS_ID:30, //显示隐藏Y轴叠加指标
6601
6606
  }
6602
6607
 
6603
6608
 
@@ -13192,9 +13197,92 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13192
13197
  var dlg=new KLineSelectRectDialog(this.DivElement);
13193
13198
  dlg.DoModal(srcParam);
13194
13199
  break;
13200
+
13201
+ case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID: //显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
13202
+ if (param==null || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
13203
+ var windowIndex=param, showType=aryArgs[1];
13204
+ var script=this.WindowIndex[windowIndex];
13205
+ if (!script) return false;
13206
+
13207
+ if (showType==1) script.IsShow=false;
13208
+ else if (showType==2) script.IsShow=true;
13209
+ else script.IsShow=!script.IsShow;
13210
+
13211
+ this.UpdateWindowIndex(windowIndex);
13212
+ break;
13213
+
13214
+ case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID: //显示隐藏叠加指标 [0]=indexGuid [1]=0=自动 1=隐藏 2=显示
13215
+ if (!srcParam || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
13216
+ var indexGuid=srcParam,showType=aryArgs[1];
13217
+
13218
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
13219
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return false;
13220
+
13221
+ var script=overlay.OverlayItem.Script;
13222
+
13223
+ if (showType==1) script.IsShow=false;
13224
+ else if (showType==2) script.IsShow==true;
13225
+ else script.IsShow=!script.IsShow;
13226
+
13227
+ this.UpdateOverlayIndex(indexGuid);
13228
+ break;
13229
+ case JSCHART_MENU_ID.CMD_DELETE_OVERLAY_INDEX_ID:
13230
+ if (srcParam && this.DeleteOverlayWindowsIndex)
13231
+ this.DeleteOverlayWindowsIndex(srcParam);
13232
+ break;
13233
+ case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID:
13234
+ if (!srcParam || !IFrameSplitOperator.IsNumber(aryArgs[1])) return false;
13235
+ if (!this.GetOverlayIndexByIdentify) return false;
13236
+
13237
+ var indexGuid=srcParam,showType=aryArgs[1];
13238
+ var finder=this.GetOverlayIndexByIdentify(indexGuid);
13239
+ if (!finder || !finder.OverlayItem) return false;
13240
+
13241
+ var frame=finder.OverlayItem.Frame;
13242
+ if (showType==1) frame.IsShow=false;
13243
+ else if (showType==2) frame.IsShow==true;
13244
+ else frame.IsShow=!frame.IsShow;
13245
+
13246
+ this.UpdataDataoffset(); //更新数据偏移
13247
+ this.UpdateFrameMaxMin(); //调整坐标最大 最小值
13248
+ this.Draw();
13249
+
13250
+ break;
13195
13251
  }
13196
13252
  }
13197
13253
 
13254
+ this.GetShowIndexMenuData=function(windowIndex, showType)
13255
+ {
13256
+ var script=this.WindowIndex[windowIndex];
13257
+ if (!script) return null;
13258
+
13259
+ var data= { Name:script.IsShow?"隐藏指标":"显示指标", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_INDEX_ID, Args:[windowIndex, 0] } };
13260
+
13261
+ return data;
13262
+ }
13263
+
13264
+ this.GetShowOverlayIndexMenuData=function(indexGuid, showType)
13265
+ {
13266
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
13267
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return null;
13268
+
13269
+ var script=overlay.OverlayItem.Script;
13270
+ var data= { Name:script.IsShow?"隐藏指标":"显示指标", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID, Args:[indexGuid, 0] } };
13271
+
13272
+ return data;
13273
+ }
13274
+
13275
+ this.GetShowOverlayIndexYAxisMenuData=function(indexGuid, showType)
13276
+ {
13277
+ var overlay=this.GetOverlayIndexByIdentify(indexGuid);
13278
+ if (!overlay || !overlay.OverlayItem || !overlay.OverlayItem.Script) return null;
13279
+
13280
+ var frame=overlay.OverlayItem.Frame;
13281
+ var data= { Name:frame.IsShow?"隐藏Y轴":"显示Y轴", Data:{ ID: JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID, Args:[indexGuid, 0] } };
13282
+
13283
+ return data;
13284
+ }
13285
+
13198
13286
  //点击右键菜单
13199
13287
  this.OnClickRightMenu=function(data)
13200
13288
  {
@@ -57699,7 +57787,7 @@ function DynamicChartTitlePainting()
57699
57787
  var rtButton={ Left:left, YCenter:yCenter };
57700
57788
  this.DrawButton(item, rtButton, moveonPoint, mouseStatus);
57701
57789
 
57702
- this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:1, OverlayID:toolbarInfo.ID, Title:overlayItem.Title });
57790
+ this.Buttons.push({ ID:item.ID, Rect:rtButton, FrameID:this.Frame.Identify, Type:1, OverlayID:toolbarInfo.ID, Title:overlayItem.Title, Data:item.Data });
57703
57791
 
57704
57792
  left=rtButton.Right;
57705
57793
 
@@ -59929,11 +60017,14 @@ function ChartDrawHLine()
59929
60017
 
59930
60018
  this.Button=
59931
60019
  {
59932
- CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null },
59933
- SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null }
60020
+ CloseIcon: { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE, TooltipText:null, Margin:{ Left:2, Right:2 } },
60021
+ SettingIcon: { Text:'\ue623',Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING, TooltipText:null, Margin:{ Left:2, Right:2 } }
59934
60022
  //修改ID, Text , TooltipText 可以外部定制按钮
59935
60023
  }
59936
60024
 
60025
+ this.CustomButton=[]; //自定义的按钮 { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1, TooltipText:null }
60026
+
60027
+ this.AryShowButton=[]; //需要显示的按钮 { Data:, Width }
59937
60028
  this.AryButton=[];
59938
60029
  this.ExtendData; //扩展数据
59939
60030
  this.ShowPriceTextConfig=
@@ -60039,8 +60130,32 @@ function ChartDrawHLine()
60039
60130
  this.Draw();
60040
60131
  }
60041
60132
 
60133
+ //获取需要显示的按钮 系统按钮+自定义按钮
60134
+ this.GetShowButton=function()
60135
+ {
60136
+ var aryButton=[];
60137
+
60138
+ var item=this.Button.SettingIcon;
60139
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
60140
+
60141
+ item=this.Button.CloseIcon;
60142
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
60143
+
60144
+ if (IFrameSplitOperator.IsNonEmptyArray(this.CustomButton))
60145
+ {
60146
+ for(var i=0;i<this.CustomButton.length;++i)
60147
+ {
60148
+ item=this.CustomButton[i];
60149
+ if (item && item.Text) aryButton.push({ Data:item, Width:null });
60150
+ }
60151
+ }
60152
+
60153
+ return aryButton;
60154
+ }
60155
+
60042
60156
  this.Draw=function(moveonPoint, mouseStatus)
60043
60157
  {
60158
+ this.AryShowButton=[];
60044
60159
  this.LinePoint=[];
60045
60160
  this.AryButton=[];
60046
60161
  this.ColseButtonSize=0;
@@ -60116,6 +60231,8 @@ function ChartDrawHLine()
60116
60231
  var labInfo;
60117
60232
  if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
60118
60233
 
60234
+ this.AryShowButton=this.GetShowButton(); //获取按钮
60235
+
60119
60236
  //描述信息
60120
60237
  if (labInfo)
60121
60238
  this.DrawLab(labInfo, drawPoint[0].Y);
@@ -60419,42 +60536,33 @@ function ChartDrawHLine()
60419
60536
  {
60420
60537
  var pixelRatio=GetDevicePixelRatio();
60421
60538
 
60422
- if (this.Button.SettingIcon)
60423
- {
60424
- var icon=this.Button.SettingIcon;
60425
- var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60426
- this.Canvas.font=font;
60427
- var width=this.Canvas.measureText(icon.Text).width;
60428
- this.SettingButtonSize=width;
60429
- }
60539
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
60430
60540
 
60431
- if (this.Button.CloseIcon)
60541
+ var totalWidth=0;
60542
+ for(var i=0;i<this.AryShowButton.length;++i)
60432
60543
  {
60433
- var icon=this.Button.CloseIcon;
60544
+ var item=this.AryShowButton[i];
60545
+ var icon=item.Data;
60434
60546
  var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60435
60547
  this.Canvas.font=font;
60436
- var width=this.Canvas.measureText(icon.Text).width;
60437
- this.ColseButtonSize=width;
60438
- }
60548
+ item.Width=this.Canvas.measureText(icon.Text).width+2;
60439
60549
 
60440
- if (this.ColseButtonSize<=0 && this.SettingButtonSize<=0) return;
60550
+ if (icon.Margin)
60551
+ {
60552
+ var margin=icon.Margin;
60553
+ if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
60554
+ if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
60555
+ }
60441
60556
 
60442
- var buttonWidth=0
60443
- if (this.SettingButtonSize>0) buttonWidth+=this.SettingButtonSize;
60444
- if (this.ColseButtonSize>0)
60445
- {
60446
- if (buttonWidth>0) buttonWidth+=this.ButtonSpace;
60447
- buttonWidth+=this.ColseButtonSize;
60557
+ totalWidth+=item.Width;
60448
60558
  }
60449
60559
 
60450
- buttonWidth+=4;
60451
-
60452
- this.ButtonBGWidth=buttonWidth;
60560
+ this.ButtonBGWidth=totalWidth;
60453
60561
  }
60454
60562
 
60455
60563
  this.DrawButton=function(drawTop, drawLeft, drawHeight, rtDraw)
60456
60564
  {
60457
- if (this.ColseButtonSize<=0 && this.SettingButtonSize<=0) return;
60565
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
60458
60566
 
60459
60567
  if (this.ButtonPosition==1) drawTop-=drawHeight;
60460
60568
 
@@ -60466,61 +60574,29 @@ function ChartDrawHLine()
60466
60574
  this.Canvas.fillStyle=this.ButtonBGColor;
60467
60575
  this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
60468
60576
 
60469
- left+=1;
60470
60577
  var pixelRatio=GetDevicePixelRatio();
60471
- if (this.Button.SettingIcon && this.Button.SettingIcon.Text)
60578
+ for(var i=0;i<this.AryShowButton.length;++i)
60472
60579
  {
60473
- var rtButton={Left:left, Top:drawTop, Width:this.SettingButtonSize, Height:drawHeight };
60474
- rtButton.Right=rtButton.Left+rtButton.Width;
60475
- rtButton.Bottom=rtButton.Top+rtButton.Height;
60476
- var yCenter=rtButton.Top+rtButton.Height/2;
60477
- var xCenter=rtButton.Left+rtButton.Width/2;
60580
+ var item=this.AryShowButton[i];
60581
+ var icon=item.Data;
60478
60582
 
60479
- var icon=this.Button.SettingIcon;
60480
- this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60481
- this.Canvas.textAlign="center";
60482
- this.Canvas.textBaseline="middle";
60483
- this.Canvas.fillStyle=icon.Color;
60484
- this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);
60485
-
60486
- this.AryButton.push({Rect:rtButton, ID:icon.ID, TooltipText:icon.TooltipText});
60487
-
60488
- /*
60489
- if (this.ColseButtonSize>0)
60490
- {
60491
- var xLine=rtButton.Right+this.ButtonSpace/2;
60492
- xLine=ToFixedPoint(xLine);
60493
- this.Canvas.strokeStyle=this.ButtonSplitLineColor;
60494
- this.Canvas.beginPath();
60495
- this.Canvas.moveTo(xLine,rtButton.Top);
60496
- this.Canvas.lineTo(xLine,rtButton.Bottom);
60497
- this.Canvas.stroke();
60498
- }
60499
- */
60500
-
60501
- left=rtButton.Right+this.ButtonSpace;
60502
- }
60503
-
60504
- if (this.Button.CloseIcon && this.Button.CloseIcon.Text)
60505
- {
60506
- var rtButton={Left:left, Top:drawTop, Width:this.ColseButtonSize, Height:drawHeight };
60583
+ var rtButton={Left:left, Top:drawTop, Width:item.Width, Height:drawHeight };
60507
60584
  rtButton.Right=rtButton.Left+rtButton.Width;
60508
60585
  rtButton.Bottom=rtButton.Top+rtButton.Height;
60509
60586
  var yCenter=rtButton.Top+rtButton.Height/2;
60510
60587
  var xCenter=rtButton.Left+rtButton.Width/2;
60511
- var icon=this.Button.CloseIcon;
60512
- this.Canvas.font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60588
+
60589
+ var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
60590
+ this.Canvas.font=font;
60513
60591
  this.Canvas.textAlign="center";
60514
60592
  this.Canvas.textBaseline="middle";
60515
60593
  this.Canvas.fillStyle=icon.Color;
60516
- this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);
60594
+ this.Canvas.fillText(icon.Text,xCenter,yCenter);
60517
60595
 
60518
60596
  this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText });
60519
60597
 
60520
60598
  left=rtButton.Right;
60521
60599
  }
60522
-
60523
- rtDraw.Right=rtBG.Right;
60524
60600
  }
60525
60601
 
60526
60602
  this.PtInButtons=function(x,y)
@@ -117017,6 +117093,7 @@ function OverlayScriptIndex(name,script,args,option)
117017
117093
 
117018
117094
  titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,clrTitle);
117019
117095
 
117096
+ this.SetChartIndexName(chart);
117020
117097
  frame.ChartPaint.push(chart);
117021
117098
  }
117022
117099
 
@@ -117371,6 +117448,7 @@ function OverlayScriptIndex(name,script,args,option)
117371
117448
 
117372
117449
  //var titleIndex=windowIndex+1;
117373
117450
  //hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
117451
+ this.SetChartIndexName(chart);
117374
117452
  frame.ChartPaint.push(chart);
117375
117453
  }
117376
117454
 
@@ -134788,7 +134866,7 @@ function HQChartScriptWorker()
134788
134866
 
134789
134867
 
134790
134868
 
134791
- var HQCHART_VERSION="1.1.13205";
134869
+ var HQCHART_VERSION="1.1.13209";
134792
134870
 
134793
134871
  function PrintHQChartVersion()
134794
134872
  {