hqchart 1.1.15134 → 1.1.15138

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.
@@ -2726,7 +2726,7 @@ if(this.BorderLine==null){if(this.IsDrawRightBorder||this.IsDrawLeftBorder){this
2726
2726
  this.Canvas.stroke();
2727
2727
  }
2728
2728
  */};//画标题背景色
2729
- this.DrawTitleBG=function(){if(this.ChartBorder.TitleHeight<=0)return;var border=this.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(this.ChartBorder.GetTopTitle());var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.TitleBGColor;this.Canvas.fillRect(left,top,width,height);if(this.IsDrawTitleBottomLine){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(border.TopTitle));this.Canvas.lineTo(right,ToFixedPoint(border.TopTitle));this.Canvas.stroke();}};this.DrawLock=function(){if(!this.LockPaint)return;this.LockPaint.Draw(true);};this.DrawLogo=function(){var border=this.GetBorder();var text=g_JSChartResource.FrameLogo.Text;if(!IFrameSplitOperator.IsString(text))return;this.Canvas.font=this.LogoTextFont;this.Canvas.textAlign='left';this.Canvas.textBaseline='bottom';var height=this.Canvas.measureText("擎").width;var width=this.Canvas.measureText(text).width;if(this.IsHScreen){var x=border.Left+5;var y=border.Top+5;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);var rtBG={Left:0,Bottom:0,Width:width+4,Height:height+4};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(this.LogoBGColor){this.Canvas.fillStyle=this.LogoBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.fillText(text,1,0);this.Canvas.restore();}else{var rtBG={Left:border.Left+5,Bottom:border.Bottom-5,Width:width+4,Height:height+4};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(this.LogoBGColor){this.Canvas.fillStyle=this.LogoBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}var x=rtBG.Left+1;var y=rtBG.Bottom-1;this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.fillText(text,x,y);}};this.CalculateLock=function(aryData){this.LockPaint.SetData(aryData);this.LockPaint.Draw(false);};//创建锁图形
2729
+ this.DrawTitleBG=function(){if(this.ChartBorder.TitleHeight<=0)return;var border=this.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(this.ChartBorder.GetTopTitle());var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.TitleBGColor;this.Canvas.fillRect(left,top,width,height);if(this.IsDrawTitleBottomLine){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(border.TopTitle));this.Canvas.lineTo(right,ToFixedPoint(border.TopTitle));this.Canvas.stroke();}};this.DrawLock=function(){if(!this.LockPaint)return;this.LockPaint.Draw(true);};this.DrawLogo=function(){var border=this.GetBorder();var text=g_JSChartResource.FrameLogo.Text;if(!IFrameSplitOperator.IsString(text))return;this.Canvas.font=this.LogoTextFont;this.Canvas.textAlign='left';this.Canvas.textBaseline='bottom';var height=this.Canvas.measureText("擎").width;var width=this.Canvas.measureText(text).width;if(this.IsHScreen){var x=border.Left+5;var y=border.Top+5;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);var rtBG={Left:0,Bottom:0,Width:width+4,Height:height+4};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(this.LogoBGColor){this.Canvas.fillStyle=this.LogoBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.fillText(text,1,0);this.Canvas.restore();}else{var rtBG={Left:border.Left+5,Bottom:border.Bottom-5,Width:width+4,Height:height+4};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(this.LogoBGColor){this.Canvas.fillStyle=this.LogoBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}var x=rtBG.Left+1;var y=rtBG.Bottom-1;this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.fillText(text,x,y);}};this.CalculateLock=function(aryData){if(!this.LockPaint)return;this.LockPaint.SetData(aryData);this.LockPaint.Draw(false);};//创建锁图形
2730
2730
  this.CreateLockPaint=function(){this.LockPaint=g_ChartPaintFactory.Create("ChartLock");// new ChartLock();
2731
2731
  this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;};this.SetLock=function(lockData){this.IndexLock.SetData(lockData);};this.GetLockRect=function(){if(!this.LockPaint)return null;return this.LockPaint.LockRect;};this.ReloadResource=function(resource){if(!resource){this.PenBorder=g_JSChartResource.FrameBorderPen;//边框颜色
2732
2732
  this.TitleBGColor=g_JSChartResource.FrameTitleBGColor;//标题背景色
@@ -2765,7 +2765,7 @@ this.XTextExtend;//[0]=底部 { Align:0=默认(居中), 1=左对齐 }
2765
2765
  this.XLineExtend;//[0]=底部 { Mode:1, Color: } Mode=1 分割线 Mode=2短线
2766
2766
  this.FrameData={SubFrameItem:null};//窗口框架信息
2767
2767
  //画图工具刻度
2768
- this.DrawPicture={BGColor:g_JSChartResource.DrawPicture.XYCoordinate.BGColor,TextBGColor:g_JSChartResource.DrawPicture.XYCoordinate.TextBGColor,TextColor:g_JSChartResource.DrawPicture.XYCoordinate.TextColor,Font:g_JSChartResource.DrawPicture.XYCoordinate.Font};this.IChartFramePainting_ReloadResource=this.ReloadResource;this.ReloadResource=function(resource){this.IChartFramePainting_ReloadResource(resource);if(!resource){this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);this.OverlayIndexButton=CloneData(g_JSChartResource.Buttons.OverlayIndex);this.ChangeIndexButton=CloneData(g_JSChartResource.Buttons.ChangeIndex);this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);this.MaxMinWindowButton=CloneData(g_JSChartResource.Buttons.MaxMinWindow);this.TitleWindowButton=CloneData(g_JSChartResource.Buttons.TitleWindow);this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);}if(this.DivFrameToolbar)this.DivFrameToolbar.ReloadResource(resource);};this.DrawFrame=function(){if(this.XPointCount>0){var dInterval=this.ChartBorder.GetWidth()/(6*this.XPointCount);//分6份, 数据4 间距2
2768
+ this.DrawPicture={BGColor:g_JSChartResource.DrawPicture.XYCoordinate.BGColor,TextBGColor:g_JSChartResource.DrawPicture.XYCoordinate.TextBGColor,TextColor:g_JSChartResource.DrawPicture.XYCoordinate.TextColor,Font:g_JSChartResource.DrawPicture.XYCoordinate.Font};this.IChartFramePainting_ReloadResource=this.ReloadResource;this.ReloadResource=function(resource){this.IChartFramePainting_ReloadResource(resource);if(!resource){this.ToolbarButtonStyle=g_JSChartResource.ToolbarButtonStyle;this.CloseWindowButton=CloneData(g_JSChartResource.Buttons.CloseWindow);this.OverlayIndexButton=CloneData(g_JSChartResource.Buttons.OverlayIndex);this.ChangeIndexButton=CloneData(g_JSChartResource.Buttons.ChangeIndex);this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);this.MaxMinWindowButton=CloneData(g_JSChartResource.Buttons.MaxMinWindow);this.TitleWindowButton=CloneData(g_JSChartResource.Buttons.TitleWindow);this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);this.AddIndexWindowButton=CloneData(g_JSChartResource.Buttons.AddIndexWindow);this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);}if(this.ToolbarButtonStyle==1){this.ClearToolbar();}else{if(this.DivFrameToolbar)this.DivFrameToolbar.ReloadResource(resource);}};this.DrawFrame=function(){if(this.XPointCount>0){var dInterval=this.ChartBorder.GetWidth()/(6*this.XPointCount);//分6份, 数据4 间距2
2769
2769
  this.DistanceWidth=2*dInterval;this.DataWidth=4*dInterval;}this.DrawHorizontal();this.DrawVertical();};this.DrawTitleButton=function(aryButton,moveonPoint,mouseStatus){var border=this.GetBorder();if(this.IsHScreen){var y=border.Bottom-3;var x=border.RightTitle+this.ChartBorder.TitleHeight/2;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);//底部开始画
2770
2770
  var yButton=0,xButton=0,bottom=0;for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Size;var xButton=bottom-size-item.Style.MerginLeft;var font=size+'px '+item.Style.Family;var color=item.Style.Color;this.Canvas.fillStyle=color;this.Canvas.font=font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Style.Text,xButton,0);var rtButton={Left:x-size/2,Right:x+size/2,Bottom:y,Width:size,Height:size+item.Style.MerginLeft};rtButton.Top=rtButton.Bottom-size-item.Style.MerginLeft;this.Buttons.push({ID:item.ID,Rect:rtButton});bottom=xButton;y=rtButton.Top;}this.Canvas.restore();}else{var right=border.RightEx-3;var left=border.Left;var yButton=border.Top+this.ChartBorder.TitleHeight/2;this.ToolbarCacheSize={RToolbar:{Right:right,Left:right}//右往左绘制
2771
2771
  };for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Size;var xBotton=right-size-item.Style.MerginLeft;var font=size+'px '+item.Style.Family;var rtButton={Left:xBotton,Top:yButton-size/2,Right:xBotton+size+item.Style.MerginLeft,Bottom:yButton+size/2,Width:size+item.Style.MerginLeft,Height:size};var color=item.Style.Color;if(moveonPoint&&moveonPoint.X>=rtButton.Left&&moveonPoint.X<rtButton.Right&&moveonPoint.Y>=rtButton.Top&&moveonPoint.Y<=rtButton.Bottom){color=item.Style.MoveOnColor;if(mouseStatus)mouseStatus.MouseOnToolbar={Rect:rtButton,Item:item,Frame:this,Point:{X:moveonPoint.X,Y:moveonPoint.Y}};}this.Canvas.fillStyle=color;this.Canvas.font=font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(item.Style.Text,xBotton,yButton);this.Buttons.push({ID:item.ID,Rect:rtButton});this.ToolbarCacheSize.RToolbar.Left=rtButton.Left;right=xBotton;}}};this.DrawToolbarTooltip=function(mouseOnToolbar){if(!mouseOnToolbar)return;var border=this.GetBorder();var text=null;if(mouseOnToolbar.Item.TooltipText){text=mouseOnToolbar.Item.TooltipText;}else{var key='Toolbar-'+mouseOnToolbar.Item.ID;text=g_JSChartLocalization.GetText(key,0);}if(!text)return;var pixelRatio=GetDevicePixelRatio();var canvas=this.Canvas;if(this.GetExtraCanvas){var finder=this.GetExtraCanvas(JSChart.TooltipCursorCanvasKey);if(finder)canvas=finder.Canvas;}var xCenter=mouseOnToolbar.Rect.Left+mouseOnToolbar.Rect.Width/2;canvas.font=this.ButtonTooltip.Font;canvas.textAlign="left";canvas.textBaseline="bottom";var mergin=this.ButtonTooltip.Mergin;var textWidth=canvas.measureText(text).width+mergin.Left+mergin.Right;var textHeight=this.GetFontHeight();var bgHeight=textHeight+mergin.Top+mergin.Bottom;if(mouseOnToolbar.ID=="TitleButton"){var x=mouseOnToolbar.Point.X;var y=mouseOnToolbar.Point.Y+20;if(y+textHeight>border.ChartHeight)y=mouseOnToolbar.Point.Y-5-textHeight;}else if(JSCHART_BUTTON_ID.CLOSE_BEFOREOPEN_ID==mouseOnToolbar.Item.ID){var x=mouseOnToolbar.Rect.Right+5;var y=mouseOnToolbar.Rect.Top;}else if(JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE==mouseOnToolbar.Item.ID||JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING==mouseOnToolbar.Item.ID||mouseOnToolbar.Item.ID>=JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1&&mouseOnToolbar.Item.ID<=JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_18){var x=mouseOnToolbar.Point.X;var y=mouseOnToolbar.Point.Y+20;if(x+textWidth>=border.ChartWidth)x=border.ChartWidth-textWidth-2;}else{var x=xCenter-textWidth/2;var y=border.Top-bgHeight;if(y<0)y=border.TopEx+1;if(x+textWidth>border.ChartWidth)x=border.ChartWidth-textWidth-2;}if(IFrameSplitOperator.IsNumber(this.ButtonTooltip.BorderRadius))//圆角
@@ -3014,21 +3014,7 @@ this.IsDrawTitleBG=false;this.IsShowNameArrow=false;this.CustomVerticalInfo=[];/
3014
3014
  // Type:1, Space: 第几个空白间距, Line:{ Color:线段颜色, Type:线段类型 0 直线 1 虚线 }
3015
3015
  this.DrawCustomVerticalEvent;this.RightSpaceCount=0;this.Logarithmic=null;//{Up:上部 , Donw:下部 , OpenPrice:第一个开盘价}
3016
3016
  this.CustomToolbar=[];//自定义toolbar按钮 { ID:, Html:, Click } 2.0版本 { ID, Style:{ 见 g_JSChartResource.Buttons.CloseWindow}}
3017
- this.ToolbarType=0;this.DrawToolbar=function(){if(this.ToolbarButtonStyle==1)return;if(g_JSChartResource.IsDOMFrameToolbar===true)return;if(!this.DivFrameToolbar)return;this.DivFrameToolbar.Show(this.Identify);return;if(typeof _jquery2.default=="undefined")return;if(!this.ChartBorder.UIElement||!this.ChartBorder.UIElement.parentNode)return;var divToolbar=document.getElementById(this.ToolbarID);if(divToolbar&&this.SizeChange==false&&this.ReDrawToolbar==false)return;if(!divToolbar){divToolbar=document.createElement("div");divToolbar.className='klineframe-toolbar';divToolbar.id=this.ToolbarID;divToolbar.oncontextmenu=function(){return false;};//屏蔽右键系统菜单
3018
- //为divToolbar添加属性identify
3019
- divToolbar.setAttribute("identify",this.Identify.toString());this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);}if(!this.ModifyIndex&&!this.ChangeIndex&&!this.OverlayIndex&&!this.CloseIndex&&!IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar)){if(divToolbar.style.display!='none')divToolbar.style.display='none';return;}//使用外城div尺寸 画图尺寸是被放大的
3020
- var pixelTatio=GetDevicePixelRatio();var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));//JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
3021
- var toolbarWidth=100;var toolbarHeight=this.ChartBorder.GetTitleHeight();var left=chartWidth-this.ChartBorder.Right/pixelTatio-toolbarWidth;var top=this.ChartBorder.GetTop()/pixelTatio;if(this.ToolbarRect){//尺寸变动移动才重新设置DOM
3022
- if(this.ToolbarRect.Left==left&&this.ToolbarRect.Top==top&&this.ToolbarRect.Width==toolbarWidth&&this.ToolbarRect.Height==toolbarHeight/pixelTatio){return;}}this.ToolbarRect={Left:left,Top:top,Width:toolbarWidth,Height:toolbarHeight/pixelTatio};var modifyButton='<span class=\'index_param icon iconfont icon-index_param\' id=\'modifyindex\' style=\'cursor:pointer;margin-left:2px;margin-right:2px;\' title=\'\u8C03\u6574\u6307\u6807\u53C2\u6570\'></span>';var changeButton='<span class=\'index_change icon iconfont icon-change_index\' id=\'changeindex\' style=\'cursor:pointer;margin-left:2px;margin-right:2px;\' title=\'\u5207\u6362\u6307\u6807\'></span>';var overlayButton='<span class=\'index_overlay icon iconfont icon-overlay_index\' id=\'overlayindex\' style=\'cursor:pointer;margin-left:2px;margin-right:2px;\' title=\'\u53E0\u52A0\u6307\u6807\'></span>';var closeButton='<span class=\'index_close icon iconfont icon-close\' id=\'closeindex\' style=\'cursor:pointer;margin-left:2px;margin-right:2px;\' title=\'\u5173\u95ED\u6307\u6807\u7A97\u53E3\'></span>';var spanIcon=modifyButton+changeButton+overlayButton;if(this.Identify!==0&&this.CloseIndex)//第1个窗口不能关闭
3023
- {spanIcon+=closeButton;}if(IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar)){for(var i=0;i<this.CustomToolbar.length;++i){var item=this.CustomToolbar[i];spanIcon+=item.Html;}}//var scrollPos=GetScrollPosition();
3024
- //left = left+scrollPos.Left;
3025
- //top = top+scrollPos.Top;
3026
- divToolbar.style.left=left+"px";divToolbar.style.top=top+"px";divToolbar.style.width=toolbarWidth+"px";//宽度先不调整吧
3027
- divToolbar.style.height=toolbarHeight/pixelTatio+'px';//只调整高度
3028
- divToolbar.innerHTML=spanIcon;var chart=this.ChartBorder.UIElement.JSChartContainer;var identify=this.Identify;if(!this.ModifyIndex)//隐藏'改参数'
3029
- (0,_jquery2.default)("#"+divToolbar.id+" .index_param").hide();else if(typeof this.ModifyIndexEvent=='function')//绑定点击事件
3030
- (0,_jquery2.default)("#"+divToolbar.id+" .index_param").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify},this.ModifyIndexEvent);if(!this.ChangeIndex)//隐藏'换指标'
3031
- {(0,_jquery2.default)("#"+divToolbar.id+" .index_change").hide();}else if(typeof this.ChangeIndexEvent=='function'){(0,_jquery2.default)("#"+divToolbar.id+" .index_change").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify,IsOverlay:false},this.ChangeIndexEvent);}if(!this.OverlayIndex){(0,_jquery2.default)("#"+divToolbar.id+" .index_overlay").hide();}else{(0,_jquery2.default)("#"+divToolbar.id+" .index_overlay").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify,IsOverlay:true},this.ChangeIndexEvent);}(0,_jquery2.default)("#"+divToolbar.id+" .index_close").click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify},function(event){var hqChart=event.data.Chart;var id=event.data.Identify;hqChart.RemoveIndexWindow(id);});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar)){for(var i=0;i<this.CustomToolbar.length;++i){var item=this.CustomToolbar[i];(0,_jquery2.default)("#"+item.ID).click({Chart:this.ChartBorder.UIElement.JSChartContainer,Identify:this.Identify,ID:item.ID},item.Click);}}divToolbar.style.display="block";};//手绘,不用DOM,使用DOM太麻烦了
3017
+ this.ToolbarType=0;this.DrawToolbar=function(){if(this.ToolbarButtonStyle==1)return;if(g_JSChartResource.IsDOMFrameToolbar===true)return;if(!this.DivFrameToolbar)return;this.DivFrameToolbar.Show(this.Identify);};//手绘,不用DOM,使用DOM太麻烦了
3032
3018
  this.DrawToolbarV2=function(moveonPoint,mouseStatus){if(g_JSChartResource.IsDOMFrameToolbar===true)return;this.Buttons=[];if(this.IsMinSize==true)return;if(this.ChartBorder.TitleHeight<5)return;var aryButton=[];//第1个窗口不能关闭
3033
3019
  if(this.CloseIndex&&this.Identify!==0)aryButton.push({ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW,Style:this.CloseWindowButton});if(this.MaxMinWindow&&this.Identify!=0)aryButton.push({ID:JSCHART_BUTTON_ID.MAX_MIN_WINDOW,Style:this.MaxMinWindowButton});if(this.TitleWindow&&this.Identify!=0)aryButton.push({ID:JSCHART_BUTTON_ID.TITLE_WINDOW,Style:this.TitleWindowButton});if(this.ExportData)aryButton.push({ID:JSCHART_BUTTON_ID.EXPORT_DATA,Style:this.ExportDataButton});if(this.OverlayIndex)aryButton.push({ID:JSCHART_BUTTON_ID.OVERLAY_INDEX,Style:this.OverlayIndexButton});if(this.ChangeIndex)aryButton.push({ID:JSCHART_BUTTON_ID.CHANGE_INDEX,Style:this.ChangeIndexButton});if(this.ModifyIndex)aryButton.push({ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM,Style:this.ModifyIndexParamButton});if(this.AddIndexWindow)aryButton.push({ID:JSCHART_BUTTON_ID.ADD_INDEX_WINDOW,Style:this.AddIndexWindowButton});if(this.IndexHelp)aryButton.push({ID:JSCHART_BUTTON_ID.INDEX_HELP,Style:this.IndexHelpButton});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar)){for(var i=0;i<this.CustomToolbar.length;++i){var item=this.CustomToolbar[i];if(item.ID&&item.Style){var btnItem={ID:item.ID,Style:item.Style,TooltipText:item.TooltipText,Data:item.Data};if(item.IsLeft===true)//左侧按钮
3034
3020
  {}else{aryButton.push(btnItem);//右侧按钮
@@ -15564,7 +15550,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15564
15550
  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);};}/********************************************************************************
15565
15551
  * 版本信息输出
15566
15552
  *
15567
- */var HQCHART_VERSION="1.1.15133";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
15553
+ */var HQCHART_VERSION="1.1.15137";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
15568
15554
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15569
15555
  // BaseIndex:BaseIndex,
15570
15556
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15134",
3
+ "version": "1.1.15138",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -13584,6 +13584,8 @@ function IChartFramePainting()
13584
13584
 
13585
13585
  this.CalculateLock=function(aryData)
13586
13586
  {
13587
+ if (!this.LockPaint) return;
13588
+
13587
13589
  this.LockPaint.SetData(aryData);
13588
13590
  this.LockPaint.Draw(false);
13589
13591
  }
@@ -13776,7 +13778,14 @@ function AverageWidthFrame()
13776
13778
  this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);
13777
13779
  }
13778
13780
 
13779
- if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
13781
+ if (this.ToolbarButtonStyle==1)
13782
+ {
13783
+ this.ClearToolbar();
13784
+ }
13785
+ else
13786
+ {
13787
+ if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
13788
+ }
13780
13789
  }
13781
13790
 
13782
13791
  this.DrawFrame=function()
@@ -18799,155 +18808,6 @@ function KLineFrame()
18799
18808
  if (!this.DivFrameToolbar) return;
18800
18809
 
18801
18810
  this.DivFrameToolbar.Show(this.Identify);
18802
-
18803
- return;
18804
-
18805
- if (typeof($)=="undefined") return;
18806
-
18807
- if (!this.ChartBorder.UIElement || !this.ChartBorder.UIElement.parentNode) return;
18808
-
18809
- var divToolbar=document.getElementById(this.ToolbarID);
18810
- if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
18811
-
18812
- if (!divToolbar)
18813
- {
18814
-
18815
- divToolbar=document.createElement("div");
18816
- divToolbar.className='klineframe-toolbar';
18817
- divToolbar.id=this.ToolbarID;
18818
- divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
18819
- //为divToolbar添加属性identify
18820
- divToolbar.setAttribute("identify",this.Identify.toString());
18821
- this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
18822
- }
18823
-
18824
- if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex && !IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
18825
- {
18826
- if (divToolbar.style.display!='none')
18827
- divToolbar.style.display='none';
18828
- return;
18829
- }
18830
-
18831
- //使用外城div尺寸 画图尺寸是被放大的
18832
- var pixelTatio = GetDevicePixelRatio();
18833
- var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
18834
- var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
18835
- //JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
18836
-
18837
- var toolbarWidth=100;
18838
- var toolbarHeight=this.ChartBorder.GetTitleHeight();
18839
- var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
18840
- var top=this.ChartBorder.GetTop()/pixelTatio;
18841
-
18842
- if (this.ToolbarRect)
18843
- {
18844
- //尺寸变动移动才重新设置DOM
18845
- if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
18846
- this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
18847
- {
18848
- return;
18849
- }
18850
- }
18851
-
18852
- this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
18853
-
18854
- const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
18855
- const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
18856
- const overlayButton=`<span class='index_overlay icon iconfont icon-overlay_index' id='overlayindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='叠加指标'></span>`;
18857
- const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
18858
-
18859
- var spanIcon=modifyButton+changeButton+overlayButton;
18860
-
18861
- if (this.Identify!==0 && this.CloseIndex) //第1个窗口不能关闭
18862
- {
18863
- spanIcon+=closeButton;
18864
- }
18865
-
18866
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
18867
- {
18868
- for(var i=0;i<this.CustomToolbar.length;++i)
18869
- {
18870
- var item=this.CustomToolbar[i];
18871
- spanIcon+=item.Html;
18872
- }
18873
- }
18874
-
18875
- //var scrollPos=GetScrollPosition();
18876
- //left = left+scrollPos.Left;
18877
- //top = top+scrollPos.Top;
18878
- divToolbar.style.left = left + "px";
18879
- divToolbar.style.top = top + "px";
18880
- divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
18881
- divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
18882
- divToolbar.innerHTML=spanIcon;
18883
-
18884
- var chart=this.ChartBorder.UIElement.JSChartContainer;
18885
- var identify=this.Identify;
18886
- if (!this.ModifyIndex) //隐藏'改参数'
18887
- $("#"+divToolbar.id+" .index_param").hide();
18888
- else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
18889
- $("#"+divToolbar.id+" .index_param").click(
18890
- {
18891
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18892
- Identify:this.Identify
18893
- },this.ModifyIndexEvent);
18894
-
18895
- if (!this.ChangeIndex) //隐藏'换指标'
18896
- {
18897
- $("#"+divToolbar.id+" .index_change").hide();
18898
- }
18899
- else if (typeof(this.ChangeIndexEvent)=='function')
18900
- {
18901
- $("#"+divToolbar.id+" .index_change").click(
18902
- {
18903
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18904
- Identify:this.Identify,
18905
- IsOverlay:false
18906
- },this.ChangeIndexEvent);
18907
- }
18908
-
18909
- if (!this.OverlayIndex)
18910
- {
18911
- $("#"+divToolbar.id+" .index_overlay").hide();
18912
- }
18913
- else
18914
- {
18915
- $("#"+divToolbar.id+" .index_overlay").click(
18916
- {
18917
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18918
- Identify:this.Identify,
18919
- IsOverlay:true
18920
- },this.ChangeIndexEvent);
18921
- }
18922
-
18923
- $("#"+divToolbar.id+" .index_close").click(
18924
- {
18925
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18926
- Identify:this.Identify
18927
- },
18928
- function(event)
18929
- {
18930
- var hqChart=event.data.Chart;
18931
- var id=event.data.Identify;
18932
- hqChart.RemoveIndexWindow(id);
18933
- });
18934
-
18935
-
18936
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
18937
- {
18938
- for(var i=0;i<this.CustomToolbar.length;++i)
18939
- {
18940
- var item=this.CustomToolbar[i];
18941
- $("#"+item.ID).click(
18942
- {
18943
- Chart:this.ChartBorder.UIElement.JSChartContainer,
18944
- Identify:this.Identify,
18945
- ID:item.ID
18946
- },item.Click);
18947
- }
18948
- }
18949
-
18950
- divToolbar.style.display = "block";
18951
18811
  }
18952
18812
 
18953
18813
  //手绘,不用DOM,使用DOM太麻烦了
@@ -17680,6 +17680,8 @@ function IChartFramePainting()
17680
17680
 
17681
17681
  this.CalculateLock=function(aryData)
17682
17682
  {
17683
+ if (!this.LockPaint) return;
17684
+
17683
17685
  this.LockPaint.SetData(aryData);
17684
17686
  this.LockPaint.Draw(false);
17685
17687
  }
@@ -17872,7 +17874,14 @@ function AverageWidthFrame()
17872
17874
  this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);
17873
17875
  }
17874
17876
 
17875
- if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
17877
+ if (this.ToolbarButtonStyle==1)
17878
+ {
17879
+ this.ClearToolbar();
17880
+ }
17881
+ else
17882
+ {
17883
+ if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
17884
+ }
17876
17885
  }
17877
17886
 
17878
17887
  this.DrawFrame=function()
@@ -22895,155 +22904,6 @@ function KLineFrame()
22895
22904
  if (!this.DivFrameToolbar) return;
22896
22905
 
22897
22906
  this.DivFrameToolbar.Show(this.Identify);
22898
-
22899
- return;
22900
-
22901
- if (typeof($)=="undefined") return;
22902
-
22903
- if (!this.ChartBorder.UIElement || !this.ChartBorder.UIElement.parentNode) return;
22904
-
22905
- var divToolbar=document.getElementById(this.ToolbarID);
22906
- if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
22907
-
22908
- if (!divToolbar)
22909
- {
22910
-
22911
- divToolbar=document.createElement("div");
22912
- divToolbar.className='klineframe-toolbar';
22913
- divToolbar.id=this.ToolbarID;
22914
- divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
22915
- //为divToolbar添加属性identify
22916
- divToolbar.setAttribute("identify",this.Identify.toString());
22917
- this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
22918
- }
22919
-
22920
- if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex && !IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
22921
- {
22922
- if (divToolbar.style.display!='none')
22923
- divToolbar.style.display='none';
22924
- return;
22925
- }
22926
-
22927
- //使用外城div尺寸 画图尺寸是被放大的
22928
- var pixelTatio = GetDevicePixelRatio();
22929
- var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
22930
- var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
22931
- //JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
22932
-
22933
- var toolbarWidth=100;
22934
- var toolbarHeight=this.ChartBorder.GetTitleHeight();
22935
- var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
22936
- var top=this.ChartBorder.GetTop()/pixelTatio;
22937
-
22938
- if (this.ToolbarRect)
22939
- {
22940
- //尺寸变动移动才重新设置DOM
22941
- if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
22942
- this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
22943
- {
22944
- return;
22945
- }
22946
- }
22947
-
22948
- this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
22949
-
22950
- const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
22951
- const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
22952
- const overlayButton=`<span class='index_overlay icon iconfont icon-overlay_index' id='overlayindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='叠加指标'></span>`;
22953
- const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
22954
-
22955
- var spanIcon=modifyButton+changeButton+overlayButton;
22956
-
22957
- if (this.Identify!==0 && this.CloseIndex) //第1个窗口不能关闭
22958
- {
22959
- spanIcon+=closeButton;
22960
- }
22961
-
22962
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
22963
- {
22964
- for(var i=0;i<this.CustomToolbar.length;++i)
22965
- {
22966
- var item=this.CustomToolbar[i];
22967
- spanIcon+=item.Html;
22968
- }
22969
- }
22970
-
22971
- //var scrollPos=GetScrollPosition();
22972
- //left = left+scrollPos.Left;
22973
- //top = top+scrollPos.Top;
22974
- divToolbar.style.left = left + "px";
22975
- divToolbar.style.top = top + "px";
22976
- divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
22977
- divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
22978
- divToolbar.innerHTML=spanIcon;
22979
-
22980
- var chart=this.ChartBorder.UIElement.JSChartContainer;
22981
- var identify=this.Identify;
22982
- if (!this.ModifyIndex) //隐藏'改参数'
22983
- $("#"+divToolbar.id+" .index_param").hide();
22984
- else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
22985
- $("#"+divToolbar.id+" .index_param").click(
22986
- {
22987
- Chart:this.ChartBorder.UIElement.JSChartContainer,
22988
- Identify:this.Identify
22989
- },this.ModifyIndexEvent);
22990
-
22991
- if (!this.ChangeIndex) //隐藏'换指标'
22992
- {
22993
- $("#"+divToolbar.id+" .index_change").hide();
22994
- }
22995
- else if (typeof(this.ChangeIndexEvent)=='function')
22996
- {
22997
- $("#"+divToolbar.id+" .index_change").click(
22998
- {
22999
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23000
- Identify:this.Identify,
23001
- IsOverlay:false
23002
- },this.ChangeIndexEvent);
23003
- }
23004
-
23005
- if (!this.OverlayIndex)
23006
- {
23007
- $("#"+divToolbar.id+" .index_overlay").hide();
23008
- }
23009
- else
23010
- {
23011
- $("#"+divToolbar.id+" .index_overlay").click(
23012
- {
23013
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23014
- Identify:this.Identify,
23015
- IsOverlay:true
23016
- },this.ChangeIndexEvent);
23017
- }
23018
-
23019
- $("#"+divToolbar.id+" .index_close").click(
23020
- {
23021
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23022
- Identify:this.Identify
23023
- },
23024
- function(event)
23025
- {
23026
- var hqChart=event.data.Chart;
23027
- var id=event.data.Identify;
23028
- hqChart.RemoveIndexWindow(id);
23029
- });
23030
-
23031
-
23032
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
23033
- {
23034
- for(var i=0;i<this.CustomToolbar.length;++i)
23035
- {
23036
- var item=this.CustomToolbar[i];
23037
- $("#"+item.ID).click(
23038
- {
23039
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23040
- Identify:this.Identify,
23041
- ID:item.ID
23042
- },item.Click);
23043
- }
23044
- }
23045
-
23046
- divToolbar.style.display = "block";
23047
22907
  }
23048
22908
 
23049
22909
  //手绘,不用DOM,使用DOM太麻烦了
@@ -153915,7 +153775,7 @@ function ScrollBarBGChart()
153915
153775
 
153916
153776
 
153917
153777
 
153918
- var HQCHART_VERSION="1.1.15133";
153778
+ var HQCHART_VERSION="1.1.15137";
153919
153779
 
153920
153780
  function PrintHQChartVersion()
153921
153781
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15133";
8
+ var HQCHART_VERSION="1.1.15137";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -17724,6 +17724,8 @@ function IChartFramePainting()
17724
17724
 
17725
17725
  this.CalculateLock=function(aryData)
17726
17726
  {
17727
+ if (!this.LockPaint) return;
17728
+
17727
17729
  this.LockPaint.SetData(aryData);
17728
17730
  this.LockPaint.Draw(false);
17729
17731
  }
@@ -17916,7 +17918,14 @@ function AverageWidthFrame()
17916
17918
  this.IndexHelpButton=CloneData(g_JSChartResource.Buttons.IndexHelp);
17917
17919
  }
17918
17920
 
17919
- if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
17921
+ if (this.ToolbarButtonStyle==1)
17922
+ {
17923
+ this.ClearToolbar();
17924
+ }
17925
+ else
17926
+ {
17927
+ if (this.DivFrameToolbar) this.DivFrameToolbar.ReloadResource(resource);
17928
+ }
17920
17929
  }
17921
17930
 
17922
17931
  this.DrawFrame=function()
@@ -22939,155 +22948,6 @@ function KLineFrame()
22939
22948
  if (!this.DivFrameToolbar) return;
22940
22949
 
22941
22950
  this.DivFrameToolbar.Show(this.Identify);
22942
-
22943
- return;
22944
-
22945
- if (typeof($)=="undefined") return;
22946
-
22947
- if (!this.ChartBorder.UIElement || !this.ChartBorder.UIElement.parentNode) return;
22948
-
22949
- var divToolbar=document.getElementById(this.ToolbarID);
22950
- if (divToolbar && this.SizeChange==false && this.ReDrawToolbar==false) return;
22951
-
22952
- if (!divToolbar)
22953
- {
22954
-
22955
- divToolbar=document.createElement("div");
22956
- divToolbar.className='klineframe-toolbar';
22957
- divToolbar.id=this.ToolbarID;
22958
- divToolbar.oncontextmenu = function() { return false;}; //屏蔽右键系统菜单
22959
- //为divToolbar添加属性identify
22960
- divToolbar.setAttribute("identify",this.Identify.toString());
22961
- this.ChartBorder.UIElement.parentNode.appendChild(divToolbar);
22962
- }
22963
-
22964
- if (!this.ModifyIndex && !this.ChangeIndex && !this.OverlayIndex && !this.CloseIndex && !IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
22965
- {
22966
- if (divToolbar.style.display!='none')
22967
- divToolbar.style.display='none';
22968
- return;
22969
- }
22970
-
22971
- //使用外城div尺寸 画图尺寸是被放大的
22972
- var pixelTatio = GetDevicePixelRatio();
22973
- var chartWidth=parseInt(this.ChartBorder.UIElement.parentElement.style.width.replace("px",""));
22974
- var chartHeight=parseInt(this.ChartBorder.UIElement.parentElement.style.height.replace("px",""));
22975
- //JSConsole.Chart.Log('[KLineFrame::DrawToolbar] ',chartWidth,chartHeight,pixelTatio);
22976
-
22977
- var toolbarWidth=100;
22978
- var toolbarHeight=this.ChartBorder.GetTitleHeight();
22979
- var left=chartWidth-(this.ChartBorder.Right/pixelTatio)-toolbarWidth;
22980
- var top=this.ChartBorder.GetTop()/pixelTatio;
22981
-
22982
- if (this.ToolbarRect)
22983
- {
22984
- //尺寸变动移动才重新设置DOM
22985
- if (this.ToolbarRect.Left==left && this.ToolbarRect.Top==top &&
22986
- this.ToolbarRect.Width==toolbarWidth && this.ToolbarRect.Height==toolbarHeight/pixelTatio)
22987
- {
22988
- return;
22989
- }
22990
- }
22991
-
22992
- this.ToolbarRect={ Left:left, Top:top, Width:toolbarWidth, Height:toolbarHeight/pixelTatio };
22993
-
22994
- const modifyButton=`<span class='index_param icon iconfont icon-index_param' id='modifyindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='调整指标参数'></span>`;
22995
- const changeButton=`<span class='index_change icon iconfont icon-change_index' id='changeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='切换指标'></span>`;
22996
- const overlayButton=`<span class='index_overlay icon iconfont icon-overlay_index' id='overlayindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='叠加指标'></span>`;
22997
- const closeButton=`<span class='index_close icon iconfont icon-close' id='closeindex' style='cursor:pointer;margin-left:2px;margin-right:2px;' title='关闭指标窗口'></span>`;
22998
-
22999
- var spanIcon=modifyButton+changeButton+overlayButton;
23000
-
23001
- if (this.Identify!==0 && this.CloseIndex) //第1个窗口不能关闭
23002
- {
23003
- spanIcon+=closeButton;
23004
- }
23005
-
23006
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
23007
- {
23008
- for(var i=0;i<this.CustomToolbar.length;++i)
23009
- {
23010
- var item=this.CustomToolbar[i];
23011
- spanIcon+=item.Html;
23012
- }
23013
- }
23014
-
23015
- //var scrollPos=GetScrollPosition();
23016
- //left = left+scrollPos.Left;
23017
- //top = top+scrollPos.Top;
23018
- divToolbar.style.left = left + "px";
23019
- divToolbar.style.top = top + "px";
23020
- divToolbar.style.width=toolbarWidth+"px"; //宽度先不调整吧
23021
- divToolbar.style.height=(toolbarHeight/pixelTatio)+'px'; //只调整高度
23022
- divToolbar.innerHTML=spanIcon;
23023
-
23024
- var chart=this.ChartBorder.UIElement.JSChartContainer;
23025
- var identify=this.Identify;
23026
- if (!this.ModifyIndex) //隐藏'改参数'
23027
- $("#"+divToolbar.id+" .index_param").hide();
23028
- else if (typeof(this.ModifyIndexEvent)=='function') //绑定点击事件
23029
- $("#"+divToolbar.id+" .index_param").click(
23030
- {
23031
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23032
- Identify:this.Identify
23033
- },this.ModifyIndexEvent);
23034
-
23035
- if (!this.ChangeIndex) //隐藏'换指标'
23036
- {
23037
- $("#"+divToolbar.id+" .index_change").hide();
23038
- }
23039
- else if (typeof(this.ChangeIndexEvent)=='function')
23040
- {
23041
- $("#"+divToolbar.id+" .index_change").click(
23042
- {
23043
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23044
- Identify:this.Identify,
23045
- IsOverlay:false
23046
- },this.ChangeIndexEvent);
23047
- }
23048
-
23049
- if (!this.OverlayIndex)
23050
- {
23051
- $("#"+divToolbar.id+" .index_overlay").hide();
23052
- }
23053
- else
23054
- {
23055
- $("#"+divToolbar.id+" .index_overlay").click(
23056
- {
23057
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23058
- Identify:this.Identify,
23059
- IsOverlay:true
23060
- },this.ChangeIndexEvent);
23061
- }
23062
-
23063
- $("#"+divToolbar.id+" .index_close").click(
23064
- {
23065
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23066
- Identify:this.Identify
23067
- },
23068
- function(event)
23069
- {
23070
- var hqChart=event.data.Chart;
23071
- var id=event.data.Identify;
23072
- hqChart.RemoveIndexWindow(id);
23073
- });
23074
-
23075
-
23076
- if (IFrameSplitOperator.IsNonEmptyArray(this.CustomToolbar))
23077
- {
23078
- for(var i=0;i<this.CustomToolbar.length;++i)
23079
- {
23080
- var item=this.CustomToolbar[i];
23081
- $("#"+item.ID).click(
23082
- {
23083
- Chart:this.ChartBorder.UIElement.JSChartContainer,
23084
- Identify:this.Identify,
23085
- ID:item.ID
23086
- },item.Click);
23087
- }
23088
- }
23089
-
23090
- divToolbar.style.display = "block";
23091
22951
  }
23092
22952
 
23093
22953
  //手绘,不用DOM,使用DOM太麻烦了
@@ -165944,7 +165804,7 @@ function HQChartScriptWorker()
165944
165804
 
165945
165805
 
165946
165806
 
165947
- var HQCHART_VERSION="1.1.15133";
165807
+ var HQCHART_VERSION="1.1.15137";
165948
165808
 
165949
165809
  function PrintHQChartVersion()
165950
165810
  {