hqchart 1.1.15066 → 1.1.15073

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.
@@ -2758,7 +2758,7 @@ if(this.YSplitOperator&&this.YSplitOperator.CoordinateType==1)isYPercentage=true
2758
2758
  }if(item.Message[1]!=null&&isDrawRight){if(item.Font!=null)this.Canvas.font=item.Font;if(Array.isArray(item.Message[1])){if(this.MultiTextFormat==1)//显示1行 格式:价格/百分比
2759
2759
  {textWidth=this.GetMulitCoordinateItemTextWidth(item.Message[1]);}else if(this.MultiTextFormat==2)//显示2行
2760
2760
  {textWidth=this.Canvas.measureText(item.Message[1][0]).width;var textWidth2=this.Canvas.measureText(item.Message[1][1]).width;if(textWidth<textWidth2)textWidth=textWidth2;}else if(this.MultiTextFormat==3){textWidth=this.GetMulitTextMaxWidth(item.Message[1]);}else//显示第1行
2761
- {textWidth=this.Canvas.measureText(item.Message[1][0]).width;if(isYPercentage){var perTextWidth=this.Canvas.measureText("-00.00%").width;if(perTextWidth>textWidth)textWidth=perTextWidth;}}}else{textWidth=this.Canvas.measureText(item.Message[1]).width;}if(width.Right==null||width.Right<textWidth)width.Right=textWidth;}}if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=rightExtendWidth;if(IFrameSplitOperator.IsNumber(width.Left))width.Left+=this.YTextPadding[0]+leftExtendLineWidth;if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=this.YTextPadding[1]+rightExtendLineWidth;return{TextWidth:width};};this.CreateDivFrameToolbar=function(hqchart,frameID,divHQChart){if(this.ToolbarButtonStyle==1)return;if(this.DivFrameToolbar)return;if(this.ClassName=="MinuteFrame"||this.ClassName=="KLineFrame"){this.DivFrameToolbar=new JSDivFrameToolbar();this.DivFrameToolbar.HQChart=hqchart;this.DivFrameToolbar.DivHQChart=divHQChart;this.DivFrameToolbar.FrameID=frameID;this.DivFrameToolbar.Create();}};this.ClearToolbar=function(){if(!this.DivFrameToolbar)return;this.DivFrameToolbar.Destroy();this.DivFrameToolbar=null;};this.HideToolbar=function(){if(!this.DivFrameToolbar)return;this.DivFrameToolbar.Hide();};this.GetMainOverlayFrame=function(){if(!this.FrameData||!this.FrameData.SubFrameItem)return null;var subFrame=this.FrameData.SubFrameItem;var leftFrame=null,rightFrame=null;for(var i=0;i<subFrame.OverlayIndex.length;++i){var item=subFrame.OverlayIndex[i];var overlayFrame=item.Frame;if(overlayFrame.IsShowMainFrame==2)rightFrame=overlayFrame;else if(overlayFrame.IsShowMainFrame==1)leftFrame=overlayFrame;}if(!leftFrame&&!rightFrame)return null;return[leftFrame,rightFrame];};}function MinuteFrame(){this.newMethod=AverageWidthFrame;//派生
2761
+ {textWidth=this.Canvas.measureText(item.Message[1][0]).width;if(isYPercentage){var perTextWidth=this.Canvas.measureText("-00.00%").width;if(perTextWidth>textWidth)textWidth=perTextWidth;}}}else{textWidth=this.Canvas.measureText(item.Message[1]).width;}if(width.Right==null||width.Right<textWidth)width.Right=textWidth;}}if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=rightExtendWidth;if(IFrameSplitOperator.IsNumber(width.Left))width.Left+=this.YTextPadding[0]+leftExtendLineWidth;if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=this.YTextPadding[1]+rightExtendLineWidth;return{TextWidth:width};};this.CreateDivFrameToolbar=function(hqchart,frameID,divHQChart){if(this.ToolbarButtonStyle==1)return;if(this.DivFrameToolbar)return;if(this.ClassName=="MinuteFrame"||this.ClassName=="KLineFrame"){this.DivFrameToolbar=new JSDivFrameToolbar();this.DivFrameToolbar.HQChart=hqchart;this.DivFrameToolbar.DivHQChart=divHQChart;this.DivFrameToolbar.FrameID=frameID;this.DivFrameToolbar.Create(this);}};this.ClearToolbar=function(){if(!this.DivFrameToolbar)return;this.DivFrameToolbar.Destroy();this.DivFrameToolbar=null;};this.HideToolbar=function(){if(!this.DivFrameToolbar)return;this.DivFrameToolbar.Hide();};this.GetMainOverlayFrame=function(){if(!this.FrameData||!this.FrameData.SubFrameItem)return null;var subFrame=this.FrameData.SubFrameItem;var leftFrame=null,rightFrame=null;for(var i=0;i<subFrame.OverlayIndex.length;++i){var item=subFrame.OverlayIndex[i];var overlayFrame=item.Frame;if(overlayFrame.IsShowMainFrame==2)rightFrame=overlayFrame;else if(overlayFrame.IsShowMainFrame==1)leftFrame=overlayFrame;}if(!leftFrame&&!rightFrame)return null;return[leftFrame,rightFrame];};}function MinuteFrame(){this.newMethod=AverageWidthFrame;//派生
2762
2762
  this.newMethod();delete this.newMethod;this.ClassName="MinuteFrame";this.DataWidth=1*GetDevicePixelRatio();this.DistanceWidth=1*GetDevicePixelRatio();this.MinuteCount=243;//每天的分钟个数
2763
2763
  this.BeforeBGColor=g_JSChartResource.Minute.Before.BGColor;//集合竞价背景
2764
2764
  this.AfterBGColor=g_JSChartResource.Minute.After.BGColor;this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;this.CustomHorizontalInfo=[];this.RightFrame=null;//右侧多重坐标
@@ -4865,7 +4865,8 @@ this.LockID;//锁ID
4865
4865
  this.Callback;//回调
4866
4866
  this.IndexName;//指标名字
4867
4867
  this.MinWidth=null;//最小宽度
4868
- this.Draw=function(isDraw){this.LockRect=null;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(this.ChartFrame.IsHScreen===true){this.HScreenDraw(isDraw);return;}var xOffset=this.ChartBorder.GetRight();var lOffsetWidth=0;if(this.ChartFrame.Data!=null){var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+2.0;var chartright=this.ChartBorder.GetRight();var xPointCount=this.ChartFrame.XPointCount;for(var i=this.ChartFrame.Data.DataOffset,j=0;i<this.ChartFrame.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var data=this.ChartFrame.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;}lOffsetWidth=(dataWidth+distanceWidth)*this.LockCount;}if(lOffsetWidth==0){lOffsetWidth=(xOffset-this.ChartBorder.GetLeft())*this.WidthDiv;}var lLeft=xOffset-lOffsetWidth;if(lLeft<this.ChartBorder.GetLeft())lLeft=this.ChartBorder.GetLeft();var lHeight=this.ChartBorder.GetBottom()-this.ChartBorder.GetTop();var lWidth=this.ChartBorder.GetRight()-lLeft;if(this.MinWidth>10&&lWidth<this.MinWidth){lWidth=this.MinWidth;lLeft=this.ChartBorder.GetRight()-lWidth;if(lLeft<this.ChartBorder.GetLeft())lLeft=this.ChartBorder.GetLeft();}if(isDraw){this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(lLeft,this.ChartBorder.GetTop(),lWidth,lHeight);var xCenter=lLeft+lWidth/2;var yCenter=this.ChartBorder.GetTop()+lHeight/2;this.Canvas.textAlign='center';this.Canvas.textBaseline='middle';this.Canvas.fillStyle=this.TextColor;this.Canvas.font=this.Font;this.Canvas.fillText(this.Title,xCenter,yCenter);}this.LockRect={Left:lLeft,Top:this.ChartBorder.GetTop(),Width:lWidth,Heigh:lHeight};//保存上锁区域
4868
+ this.Draw=function(isDraw){this.LockRect=null;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(this.ChartFrame.IsHScreen===true){this.HScreenDraw(isDraw);return;}var xOffset=this.ChartBorder.GetRight();var lOffsetWidth=0;if(this.ChartFrame.Data!=null){var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+2.0;var chartright=this.ChartBorder.GetRight();var xPointCount=this.ChartFrame.XPointCount;for(var i=this.ChartFrame.Data.DataOffset,j=0;i<this.ChartFrame.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var data=this.ChartFrame.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;}lOffsetWidth=(dataWidth+distanceWidth)*this.LockCount;}if(lOffsetWidth==0){lOffsetWidth=(xOffset-this.ChartBorder.GetLeft())*this.WidthDiv;}var lLeft=xOffset-lOffsetWidth;if(lLeft<this.ChartBorder.GetLeft())lLeft=this.ChartBorder.GetLeft();var lHeight=this.ChartBorder.GetBottom()-this.ChartBorder.GetTop();var lWidth=this.ChartBorder.GetRight()-lLeft;if(this.MinWidth>10&&lWidth<this.MinWidth){lWidth=this.MinWidth;lLeft=this.ChartBorder.GetRight()-lWidth;if(lLeft<this.ChartBorder.GetLeft())lLeft=this.ChartBorder.GetLeft();}if(isDraw){var rtBG={Left:lLeft,Top:this.ChartBorder.GetTop(),Width:lWidth,Height:lHeight};rtBG.Right=rtBG.Width+rtBG.Left;rtBG.Bottom=rtBG.Height+rtBG.Top;//上下渐变
4869
+ var bgColor=this.SetFillStyle(this.BGColor,rtBG.Left,rtBG.Top,rtBG.Left,rtBG.Bottom);this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);var xCenter=rtBG.Left+rtBG.Width/2;var yCenter=rtBG.Top+lHeight/2;this.Canvas.textAlign='center';this.Canvas.textBaseline='middle';this.Canvas.fillStyle=this.TextColor;this.Canvas.font=this.Font;this.Canvas.fillText(this.Title,xCenter,yCenter);}this.LockRect={Left:lLeft,Top:this.ChartBorder.GetTop(),Width:lWidth,Heigh:lHeight};//保存上锁区域
4869
4870
  };this.HScreenDraw=function(isDraw){var xOffset=this.ChartBorder.GetBottom();var lOffsetWidth=0;if(this.ChartFrame.Data!=null){var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+2.0;var chartright=this.ChartBorder.GetBottom();var xPointCount=this.ChartFrame.XPointCount;//求最后1个数据的位置
4870
4871
  for(var i=this.ChartFrame.Data.DataOffset,j=0;i<this.ChartFrame.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var data=this.ChartFrame.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;}lOffsetWidth=(dataWidth+distanceWidth)*this.LockCount;}if(lOffsetWidth==0){lOffsetWidth=(xOffset-this.ChartBorder.GetTop())*this.WidthDiv;}var lLeft=xOffset-lOffsetWidth;if(lLeft<this.ChartBorder.GetTop())lLeft=this.ChartBorder.GetTop();var lHeight=this.ChartBorder.GetRight()-this.ChartBorder.GetLeft();var lWidth=this.ChartBorder.GetBottom()-lLeft;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(this.ChartBorder.GetLeft(),lLeft,lHeight,lWidth);var xCenter=this.ChartBorder.GetLeft()+lHeight/2;var yCenter=lLeft+lWidth/2;this.Canvas.save();this.Canvas.translate(xCenter,yCenter);this.Canvas.rotate(90*Math.PI/180);this.Canvas.textAlign='center';this.Canvas.textBaseline='middle';this.Canvas.fillStyle=this.TextColor;this.Canvas.font=this.Font;this.Canvas.fillText(this.Title,0,0);this.Canvas.restore();this.LockRect={Left:this.ChartBorder.GetLeft(),Top:lLeft,Width:lHeight,Heigh:lWidth};//保存上锁区域
4871
4872
  };//x,y是否在上锁区域
@@ -5159,7 +5160,7 @@ this.NotSupportMessage="不支持筹码图";this.Buttons=[];this.DefaultButton=C
5159
5160
  this.LongButton=CloneData(g_JSChartResource.StockChip.LongButton);//远期筹码分布图
5160
5161
  this.RecentButton=CloneData(g_JSChartResource.StockChip.RecentButton);//近期筹码分布图
5161
5162
  this.CloseButton=CloneData(g_JSChartResource.StockChip.CloseButton);//关闭按钮
5162
- this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);this.DAY_COLOR=[['rgb(255,0,0)','rgb(255,128,128)','rgb(255,0,128)','rgb(255,100,0)','rgb(192,128,0)','rgb(255,192,0)'],['rgb(120,80,225)','rgb(160,160,225)','rgb(80,80,255)','rgb(120,120,255)','rgb(32,64,192)','rgb(0,64,128)']];this.SetOption=function(option){if(!option)return;if(option.ShowType>0)this.ShowType=option.ShowType;if(option.IsShowX)this.IsShowX=option.IsShowX;if(option.ShowXCount>0)this.ShowXCount=option.ShowXCount;if(option.Width>100)this.Width=option.Width*GetDevicePixelRatio();if(option.CalculateType>0)this.CalculateType=option.CalculateType;if(IFrameSplitOperator.IsNumber(option.PriceZoom))this.PriceZoom=option.PriceZoom;};this.ReloadResource=function(resource){this.PenBorder=g_JSChartResource.FrameBorderPen;this.Font=g_JSChartResource.StockChip.Font;this.InfoColor=g_JSChartResource.StockChip.InfoColor;this.DayInfoColor=g_JSChartResource.StockChip.DayInfoColor;this.DefaultButton=CloneData(g_JSChartResource.StockChip.DefaultButton);//默认筹码分布图
5163
+ this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);this.DAY_COLOR=[['rgb(255,0,0)','rgb(255,128,128)','rgb(255,0,128)','rgb(255,100,0)','rgb(192,128,0)','rgb(255,192,0)'],['rgb(120,80,225)','rgb(160,160,225)','rgb(80,80,255)','rgb(120,120,255)','rgb(32,64,192)','rgb(0,64,128)']];this.SetOption=function(option){if(!option)return;if(option.ShowType>0)this.ShowType=option.ShowType;if(option.IsShowX)this.IsShowX=option.IsShowX;if(option.ShowXCount>0)this.ShowXCount=option.ShowXCount;if(option.Width>50)this.Width=option.Width*GetDevicePixelRatio();if(option.CalculateType>0)this.CalculateType=option.CalculateType;if(IFrameSplitOperator.IsNumber(option.PriceZoom))this.PriceZoom=option.PriceZoom;};this.ReloadResource=function(resource){this.PenBorder=g_JSChartResource.FrameBorderPen;this.Font=g_JSChartResource.StockChip.Font;this.InfoColor=g_JSChartResource.StockChip.InfoColor;this.DayInfoColor=g_JSChartResource.StockChip.DayInfoColor;this.DefaultButton=CloneData(g_JSChartResource.StockChip.DefaultButton);//默认筹码分布图
5163
5164
  this.LongButton=CloneData(g_JSChartResource.StockChip.LongButton);//远期筹码分布图
5164
5165
  this.RecentButton=CloneData(g_JSChartResource.StockChip.RecentButton);//近期筹码分布图
5165
5166
  this.CloseButton=CloneData(g_JSChartResource.StockChip.CloseButton);this.ButtonTooltip=CloneData(g_JSChartResource.Buttons.Tooltip);};this.Draw=function(){this.PixelRatio=GetDevicePixelRatio();var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);var top=ToFixedPoint(this.ChartBorder.GetTop());var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);var bottom=ToFixedPoint(this.ChartBorder.GetBottom());var width=right-left;var height=bottom-top;this.ClientRect={Left:left,Top:top,Width:width,Height:height};if(ChartData.IsTickPeriod(this.HQChart.Period))//分笔图没有筹码
@@ -6513,10 +6514,10 @@ this.IsPointInLine=function(x,y,option){if(!this.LinePoint)return-1;var lineWidt
6513
6514
  return -1;
6514
6515
  */};//0-10 鼠标对应的点索引 100=鼠标在正个图形上 -1 鼠标不在图形上
6515
6516
  this.IsPointIn_XYValue_Line=function(x,y,option){if(this.Status!=10)return-1;var value=this.IsPointInXYValue(x,y,option);if(value>=0)return value;value=this.IsPointInLine(x,y,option);if(value>=0)return 100;return-1;};this.DrawLine=function(ptStart,ptEnd,isDottedline){if(isDottedline)this.Canvas.setLineDash([5,10]);this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.stroke();if(isDottedline)this.Canvas.setLineDash([]);};this.CreateLineData=function(ptStart,ptEnd){var line={Start:new Point(),End:new Point()};line.Start.Y=ptStart.Y;line.Start.X=ptStart.X;line.End.Y=ptEnd.Y;line.End.X=ptEnd.X;return line;};//导出成存储格式
6516
- this.ExportStorageData=function(){var storageData={ClassName:this.ClassName,Symbol:this.Symbol,Guid:this.Guid,Period:this.Period,Value:[],FrameID:this.Frame.Identify,LineColor:this.LineColor,AreaColor:this.AreaColor,LineWidth:this.LineWidth,Right:this.Right,EnableSave:this.EnableSave,IsShowYCoordinate:this.IsShowYCoordinate};for(var i=0;i<this.Value.length;++i){var item=this.Value[i];storageData.Value.push({XValue:item.XValue,YValue:item.YValue,DateTime:item.DateTime});}if(this.Text)storageData.Text=this.Text;//如果有文本, 也导出
6517
+ this.ExportStorageData=function(){var storageData={ClassName:this.ClassName,Symbol:this.Symbol,Guid:this.Guid,Period:this.Period,Value:[],FrameID:this.Frame.Identify,LineColor:this.LineColor,AreaColor:this.AreaColor,LineWidth:this.LineWidth,Right:this.Right,EnableSave:this.EnableSave,IsShowYCoordinate:this.IsShowYCoordinate,EnableCtrlMove:this.EnableCtrlMove};for(var i=0;i<this.Value.length;++i){var item=this.Value[i];storageData.Value.push({XValue:item.XValue,YValue:item.YValue,DateTime:item.DateTime});}if(this.Text)storageData.Text=this.Text;//如果有文本, 也导出
6517
6518
  if(this.FontOption)storageData.FontOption=this.FontOption;//字体也导出
6518
6519
  return storageData;};//导出基础的配置 不包含点
6519
- this.ExportBaseData=function(){var data={ClassName:this.ClassName,Guid:this.Guid,FrameID:this.Frame.Identify,Symbol:this.Symbol,Period:this.Period,Right:this.Right,LineColor:this.LineColor,LineWidth:this.LineWidth,EnableSave:this.EnableSave,IsShowYCoordinate:this.IsShowYCoordinate};if(this.AreaColor)data.AreaColor=this.AreaColor;if(this.Text)data.Text=this.Text;//如果有文本, 也导出
6520
+ this.ExportBaseData=function(){var data={ClassName:this.ClassName,Guid:this.Guid,FrameID:this.Frame.Identify,Symbol:this.Symbol,Period:this.Period,Right:this.Right,LineColor:this.LineColor,LineWidth:this.LineWidth,EnableSave:this.EnableSave,IsShowYCoordinate:this.IsShowYCoordinate,EnableCtrlMove:this.EnableCtrlMove};if(this.AreaColor)data.AreaColor=this.AreaColor;if(this.Text)data.Text=this.Text;//如果有文本, 也导出
6520
6521
  if(this.FontOption){data.FontOption={};this.SetFont(data.FontOption,this.FontOption);//字体也导出
6521
6522
  }return data;};this.IsFrameMinSize=function()//框架是否是最小化模式
6522
6523
  {return this.Frame&&this.Frame.IsMinSize;};this.PointRange=function(aryPoint){if(!IFrameSplitOperator.IsNonEmptyArray(aryPoint))return null;if(aryPoint.length==1){var data={Points:[{X:aryPoint[0].X,Y:aryPoint[0].Y}]};return data;}else{var xMax=aryPoint[0].X;var xMin=xMax;var yMax=aryPoint[0].Y;var yMin=yMax;var aryData=[{X:aryPoint[0].X,Y:aryPoint[0].Y}];for(var i=1;i<aryPoint.length;++i){if(xMax<aryPoint[i].X)xMax=aryPoint[i].X;if(xMin>aryPoint[i].X)xMin=aryPoint[i].X;if(yMax<aryPoint[i].Y)yMax=aryPoint[i].Y;if(yMin>aryPoint[i].Y)yMin=aryPoint[i].Y;aryData.push({X:aryPoint[i].X,Y:aryPoint[i].Y});}var data={X:{Max:{X:xMax},Min:{X:xMin}},Y:{Max:{Y:yMax},Min:{Y:yMin}},Points:aryData//所有的点
@@ -6618,9 +6619,9 @@ this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPictureHaflLine'
6618
6619
  this.Canvas.restore();this.FullLine={Start:drawPoint[0],End:endPoint};};}// 画图工具-水平线 支持横屏
6619
6620
  function ChartDrawPictureHorizontalLine(){this.newMethod=IChartDrawPicture;//派生
6620
6621
  this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPictureHorizontalLine';this.PointCount=1;this.IsPointIn=this.IsPointIn_XYValue_Line;this.IsDrawFirst=true;this.LineWidth=1;this.Super_SetOption=this.SetOption;//父类函数
6621
- this.Super_ExportStorageData=this.ExportStorageData;this.LabelConfig={Left:{IsShow:true,Margin:{Left:5,Top:4,Bottom:2,Right:5}},Right:{IsShow:true,Margin:{Left:5,Top:4,Bottom:2,Right:5}},Font:12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',TextColor:"rgb(255,255,255)"};this.InsideLabelConfig={Position:0,//0=左, 1=右
6622
- Font:14*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',Margin:{Left:5,Top:4,Bottom:2,Right:5},TextColor:"rgb(255,255,255)",BGAlpha:0.8//背景色透明度
6623
- };this.LabelTitle;this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.LabelTitle)this.LabelTitle=option.LabelTitle;if(option.Label){var item=option.Label;if(item.Left){var subItem=item.Left;if(IFrameSplitOperator.IsBool(subItem.IsShow))this.LabelConfig.Left.IsShow=subItem.IsShow;}if(item.Right){var subItem=item.Right;if(IFrameSplitOperator.IsBool(subItem.IsShow))this.LabelConfig.Right.IsShow=subItem.IsShow;}if(item.Font)this.LabelConfig.Font=item.Font;if(item.TextColor)this.LabelConfig.FoTextColornt=item.TextColor;}if(option.InsideLabel){var item=option.InsideLabel;if(item.Font)this.InsideLabelConfig.Font=item.Font;if(item.TextColor)this.InsideLabelConfig.TextColor=item.TextColor;if(IFrameSplitOperator.IsNumber(item.Position))this.InsideLabelConfig.Position=item.Position;if(IFrameSplitOperator.IsNumber(item.BGAlpha))this.InsideLabelConfig.BGAlpha=item.BGAlpha;}}};this.ExportStorageData=function(){var storageData;if(this.Super_ExportStorageData){storageData=this.Super_ExportStorageData();if(this.LabelTitle)storageData.LabelTitle=this.LabelTitle;}return storageData;};/*
6622
+ this.Super_ExportStorageData=this.ExportStorageData;this.LabelConfig={Left:{IsShow:true,Margin:{Left:5,Top:4,Bottom:2,Right:5}},Right:{IsShow:true,Margin:{Left:5,Top:4,Bottom:2,Right:5}},Font:12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',TextColor:"rgb(255,255,255)",BGColor:null};this.InsideLabelConfig={Position:0,//0=左, 1=右
6623
+ Font:14*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',Margin:{Left:5,Top:4,Bottom:2,Right:5},TextColor:"rgb(255,255,255)",BGAlpha:0.8,//背景色透明度,
6624
+ IsShow:true};this.LabelTitle;this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.LabelTitle)this.LabelTitle=option.LabelTitle;if(option.Label){var item=option.Label;if(item.Left){var subItem=item.Left;if(IFrameSplitOperator.IsBool(subItem.IsShow))this.LabelConfig.Left.IsShow=subItem.IsShow;}if(item.Right){var subItem=item.Right;if(IFrameSplitOperator.IsBool(subItem.IsShow))this.LabelConfig.Right.IsShow=subItem.IsShow;}if(item.Font)this.LabelConfig.Font=item.Font;if(item.TextColor)this.LabelConfig.TextColor=item.TextColor;if(item.BGColor)this.LabelConfig.BGColor=item.BGColor;}if(option.InsideLabel){var item=option.InsideLabel;if(item.Font)this.InsideLabelConfig.Font=item.Font;if(item.TextColor)this.InsideLabelConfig.TextColor=item.TextColor;if(IFrameSplitOperator.IsNumber(item.Position))this.InsideLabelConfig.Position=item.Position;if(IFrameSplitOperator.IsNumber(item.BGAlpha))this.InsideLabelConfig.BGAlpha=item.BGAlpha;if(IFrameSplitOperator.IsBool(item.IsShow))this.InsideLabelConfig.IsShow=item.IsShow;}}};this.ExportStorageData=function(){var storageData;if(this.Super_ExportStorageData){storageData=this.Super_ExportStorageData();if(this.LabelTitle)storageData.LabelTitle=this.LabelTitle;if(this.LabelConfig)storageData.Label=this.LabelConfig;if(this.InsideLabelConfig)storageData.InsideLabel=this.InsideLabelConfig;}return storageData;};/*
6624
6625
  this.GetXYCoordinate=function()
6625
6626
  {
6626
6627
  if (this.IsFrameMinSize()) return null;
@@ -6631,7 +6632,7 @@ Font:14*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',Margin:{Left:5,Top:4
6631
6632
  */this.Draw=function(){this.LinePoint=[];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();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{var yFixed=ToFixedPoint2(this.LineWidth,drawPoint[0].Y);this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);}this.Canvas.stroke();this.RestoreLineWidth();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);//画点
6632
6633
  this.DrawPoint(drawPoint);//显示价格
6633
6634
  this.DrawInsideLabel(drawPoint[0]);this.Canvas.restore();this.DrawValueLabel(drawPoint[0]);};this.DrawValueLabel=function(point){if(!point)return;if(this.Frame.IsHScreen)return;//不支持横屏
6634
- var y=point.Y;var yValue=this.Frame.GetYData(y);var text=yValue.toFixed(2);var border=this.Frame.GetBorder();var config=this.LabelConfig;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;var textWidth=this.Canvas.measureText(text).width;if(config.Left.IsShow&&this.Frame.ChartBorder.Left>5){var margin=config.Left.Margin;var rtBG={Right:border.Left-1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Left=rtBG.Right-rtBG.Width;this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(text,xText,yText);}if(config.Right.IsShow&&this.Frame.ChartBorder.Right>5){var margin=config.Right.Margin;var rtBG={Left:border.Right+1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(text,xText,yText);}};this.DrawInsideLabel=function(point){if(!point)return;var isHScreen=this.Frame.IsHScreen;var config=this.InsideLabelConfig;if(config.Position!=0&&config.Position!=1)return;var margin=config.Margin;this.Canvas.fillStyle=this.LineColor;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;var border=this.Frame.GetBorder();if(isHScreen){var yValue=this.Frame.GetYData(point.X);var text=yValue.toFixed(2);if(this.LabelTitle)text=this.LabelTitle+text;var textWidth=this.Canvas.measureText(text).width;var rtBG=null;if(config.Position==0)//左
6635
+ var y=point.Y;var yValue=this.Frame.GetYData(y);var text=yValue.toFixed(2);var border=this.Frame.GetBorder();var config=this.LabelConfig;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;var textWidth=this.Canvas.measureText(text).width;if(config.Left.IsShow&&this.Frame.ChartBorder.Left>5){var margin=config.Left.Margin;var rtBG={Right:border.Left-1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Left=rtBG.Right-rtBG.Width;if(config.BGColor)this.Canvas.fillStyle=config.BGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(text,xText,yText);}if(config.Right.IsShow&&this.Frame.ChartBorder.Right>5){var margin=config.Right.Margin;var rtBG={Left:border.Right+1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(config.BGColor)this.Canvas.fillStyle=config.BGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(text,xText,yText);}};this.DrawInsideLabel=function(point){if(!point)return;var isHScreen=this.Frame.IsHScreen;var config=this.InsideLabelConfig;if(!config.IsShow)return;if(config.Position!=0&&config.Position!=1)return;var margin=config.Margin;this.Canvas.fillStyle=this.LineColor;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;var border=this.Frame.GetBorder();if(isHScreen){var yValue=this.Frame.GetYData(point.X);var text=yValue.toFixed(2);if(this.LabelTitle)text=this.LabelTitle+text;var textWidth=this.Canvas.measureText(text).width;var rtBG=null;if(config.Position==0)//左
6635
6636
  {var rtBG={Top:border.Top+1,Width:textHeight+margin.Top+margin.Bottom,Height:textWidth+margin.Left+margin.Right,Left:point.X};rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;}else if(config.Position==1)//右
6636
6637
  {var rtBG={Bottom:border.Bottom-1,Width:textHeight+margin.Top+margin.Bottom,Height:textWidth+margin.Left+margin.Right,Left:point.X};rtBG.Top=rtBG.Bottom-rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;}var bgColor=this.LineColor;if(config.BGAlpha<1)bgColor=IChartDrawPicture.ColorToRGBA(this.LineColor,config.BGAlpha);this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);var xText=rtBG.Right-margin.Top;var yText=rtBG.Top+margin.Left;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);//数据和框子旋转180度
6637
6638
  this.Canvas.textAlign="left";this.Canvas.textBaseline="top";this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(text,0,0);}else{var yValue=this.Frame.GetYData(point.Y);var text=yValue.toFixed(2);if(this.LabelTitle)text=this.LabelTitle+text;var textWidth=this.Canvas.measureText(text).width;var rtBG=null;if(config.Position==0)//左
@@ -10416,11 +10417,16 @@ Path2DHelper.FormatRadian=function(angle){angle%=PI2;if(angle<0)angle+=PI2;retur
10416
10417
  //
10417
10418
  ///////////////////////////////////////////////////////////////////////////////////
10418
10419
  function JSDivFrameToolbar(){this.DivToolbar=null;this.DivHQChart=null;this.HQChart=null;this.FrameID=-1;//指标窗口ID
10419
- this.ID=Guid();this.Left=-1;this.Top=-1;this.IconConfig={Color:g_JSChartResource.DivFrameToolbar.Icon.Color,HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor};this.AryButton=[{ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param",Tooltip:{Text:"修改参数"},Span:null,Div:null,TooltipSpan:null},{ID:JSCHART_BUTTON_ID.CHANGE_INDEX,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index",Tooltip:{Text:"切换指标"},Span:null,Div:null,TooltipSpan:null},{ID:JSCHART_BUTTON_ID.OVERLAY_INDEX,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index",Tooltip:{Text:"叠加指标"},Span:null,Div:null,TooltipSpan:null},{ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close",Tooltip:{Text:"关闭窗口"},Span:null,Div:null,TooltipSpan:null}];this.SetToolbar=function(aryButton){//清空原来的按钮
10420
- for(var i=0;i<this.AryButton.length;i++){var item=this.AryButton[i];if(item.Div&&this.DivToolbar)this.DivToolbar.removeChild(item.Div);item.Div=null;item.Span=null;item.TooltipSpan=null;}this.AryButton=[];//重新创建
10421
- for(var i=0;i<aryButton.length;i++){var item=aryButton[i];if(!item.ID||!item.ClassName)continue;var newItem={ID:item.ID,ClassName:item.ClassName,Span:null,Div:null,TooltipSpan:null};if(item.Tooltip&&item.Tooltip.Text)newItem.Tooltip={Text:item.Tooltip.Text};this.AryButton.push(newItem);if(this.DivToolbar)this.CreateButton(newItem,this.DivToolbar);}this.UpdateStyle();};this.Destroy=function(){if(this.DivToolbar){if(this.DivHQChart.removeChild)this.DivHQChart.removeChild(this.DivToolbar);this.DivToolbar=null;}this.HQChart=null;this.DivHQChart=null;this.FrameID=-1;};this.Create=function(){var divToolbar=document.createElement("div");divToolbar.className='UMyChart_FrameToolbar_Div';divToolbar.id=this.ID;divToolbar.oncontextmenu=function(){return false;};//屏蔽右键系统菜单
10422
- for(var i=0;i<this.AryButton.length;i++){var item=this.AryButton[i];if(this.FrameID==0&&item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW)continue;//第一个指标窗口不显示关闭按钮
10423
- this.CreateButton(item,divToolbar);}this.DivHQChart.appendChild(divToolbar);this.DivToolbar=divToolbar;this.UpdateStyle();if(!this.HQChart.JSToolbarTooltip){this.HQChart.JSToolbarTooltip=new JSToolbarTooltip();this.HQChart.JSToolbarTooltip.DivHQChart=this.DivHQChart;this.HQChart.JSToolbarTooltip.Create();}};this.UpdateStyle=function(){if(!this.DivToolbar)return;for(var i=0;i<this.AryButton.length;i++){var item=this.AryButton[i];if(!item.Span)continue;item.Span.style["color"]=this.IconConfig.Color;}};this.ReloadResource=function(option){this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;this.UpdateStyle();};this.CreateButton=function(item,divDom){var _this50=this;var btnDiv=document.createElement("div");btnDiv.className="UMyChart_FrameToolbar_Div_Button";btnDiv.onmouseover=function(e){_this50.OnHoverButton(e,item);};btnDiv.onmouseout=function(e){_this50.OnLeaveButton(e,item);};item.Div=btnDiv;var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.onmousedown=function(e){_this50.OnClickButton(e,item);};item.Span=spanDom;btnDiv.appendChild(spanDom);divDom.appendChild(btnDiv);};this.OnClickButton=function(e,item){if(!this.FrameID<0)return;if(!this.HQChart)return;var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;var button={ID:item.ID,Frame:frame};this.HQChart.ClickFrameButton(button,e);};this.OnHoverButton=function(e,item){if(!item.Span)return;item.Span.style["color"]=this.IconConfig.HoverColor;this.ShowTooltip(e,item);};this.OnLeaveButton=function(e,item){if(!item.Span)return;item.Span.style["color"]=this.IconConfig.Color;this.HideTooltip();};this.Show=function(frameID){this.FrameID=frameID;if(!this.FrameID<0)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.Frame.SubFrame))return;if(!this.HQChart.Frame.SubFrame[this.FrameID])return;var pixelTatio=GetDevicePixelRatio();var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;var border=frame.GetBorder();var top=border.Top/pixelTatio;var right=border.RightEx/pixelTatio;var left=right-this.DivToolbar.offsetWidth-2;if(this.Top!=top||this.Left!=left){this.DivToolbar.style.top=top+"px";this.DivToolbar.style.left=left+"px";this.DivToolbar.style.height=frame.ChartBorder.TitleHeight/pixelTatio+"px";this.Top=top;this.Left=left;}if(this.DivToolbar.style.visibility!='visible')this.DivToolbar.style.visibility='visible';};this.Hide=function(){if(this.DivToolbar)this.DivToolbar.style.visibility="hidden";};this.HideTooltip=function(){if(this.HQChart.JSToolbarTooltip)this.HQChart.JSToolbarTooltip.Hide();};this.ShowTooltip=function(e,item){if(!this.HQChart.JSToolbarTooltip)return;if(!item.Div)return;var rtButton=item.Div.getBoundingClientRect();var rtHQChart=this.DivHQChart.getBoundingClientRect();var left=rtButton.left-rtHQChart.left;var top=rtButton.bottom-rtHQChart.top+2;this.HQChart.JSToolbarTooltip.Show(top,left,{Text:item.Tooltip.Text});};}function JSToolbarTooltip(){this.DivTooltip=null;this.DivHQChart=null;this.Text=null;this.Left=-1;this.Top=-1;this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;this.Create=function(){var divDom=document.createElement("div");divDom.className='UMyChart_Toolbar_Tooltip_Div';this.DivHQChart.appendChild(divDom);this.DivTooltip=divDom;this.UpdateStyle();};this.ReloadResource=function(option){this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;this.UpdateStyle();};this.UpdateStyle=function(){if(!this.DivTooltip)return;this.DivTooltip.style["background-color"]=this.BGColor;this.DivTooltip.style["color"]=this.TextColor;this.DivTooltip.style["border"]="1px solid "+this.BorderColor;};this.Show=function(top,left,tooltipData){if(!this.DivTooltip)return;if(this.Text!=tooltipData.Text)this.DivTooltip.innerHTML=tooltipData.Text;var right=left+this.DivTooltip.offsetWidth;if(right+5>=window.innerWidth)left=left-this.DivTooltip.offsetWidth;if(this.Top!=top||this.Left!=left){this.DivTooltip.style.top=top+"px";this.DivTooltip.style.left=left+"px";this.Top=top;this.Left=left;}if(this.DivTooltip.style.visibility!='visible')this.DivTooltip.style.visibility='visible';};this.Hide=function(){if(!this.DivTooltip)return;if(this.DivTooltip.style["visibility"]!='hidden')this.DivTooltip.style["visibility"]="hidden";};}/*
10420
+ this.ID=Guid();this.Left=-1;this.Top=-1;this.IconConfig={Color:g_JSChartResource.DivFrameToolbar.Icon.Color,HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor};this.AryButton=[];//按钮数组
10421
+ //创建按钮
10422
+ this.CreateArrayButton=function(aryButton){for(var i=0;i<aryButton.length;i++){var item=aryButton[i];if(!item.ID||!item.ClassName)continue;var newItem={ID:item.ID,ClassName:item.ClassName,Span:null,Div:null,TooltipSpan:null};if(item.Tooltip&&item.Tooltip.Text)newItem.Tooltip={Text:item.Tooltip.Text};this.AryButton.push(newItem);if(this.DivToolbar)this.CreateButton(newItem,this.DivToolbar);}};//清空原来的按钮
10423
+ this.ClearAllButtons=function(){//清空原来的按钮
10424
+ for(var i=0;i<this.AryButton.length;i++){var item=this.AryButton[i];if(item.Div&&this.DivToolbar)this.DivToolbar.removeChild(item.Div);item.Div=null;item.Span=null;item.TooltipSpan=null;}this.AryButton=[];};this.GetShowButtons=function(subFrame){var frame=subFrame;if(!frame&&this.FrameID>=0&&this.FrameID<this.HQChart.Frame.SubFrame.length)frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;var aryDefaultButton=JSDivFrameToolbar.GetDfaultButtons();var aryButton=[];for(var i=0;i<aryDefaultButton.length;i++){var item=aryDefaultButton[i];if(this.FrameID==0&&item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW)continue;//第一个指标窗口不显示关闭按钮
10425
+ if(item.ID==JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM&&frame&&frame.ModifyIndex===false)continue;if(item.ID==JSCHART_BUTTON_ID.CHANGE_INDEX&&frame&&frame.ChangeIndex===false)continue;if(item.ID==JSCHART_BUTTON_ID.OVERLAY_INDEX&&frame&&frame.OverlayIndex===false)continue;if(item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW&&frame&&frame.CloseIndex===false)continue;aryButton.push(item);}return aryButton;};this.SetToolbar=function(aryButton){this.ClearAllButtons();//清空原来的按钮
10426
+ this.CreateArrayButton(aryButton);//重新创建
10427
+ this.UpdateStyle();};this.UpdateButton=function(){if(!this.DivToolbar)return;var aryButton=this.GetShowButtons();var bChange=false;if(aryButton.length!=this.AryButton.length){bChange=true;}else{for(var i=0;i<this.AryButton.length;++i){var leftItem=this.AryButton[i];var rightItem=aryButton[i];if(leftItem.ID!=rightItem.ID||leftItem.ClassName!=rightItem.ClassName){bChange=true;break;}}}if(!bChange)return;this.SetToolbar(aryButton);//重新设置按钮
10428
+ };this.Destroy=function(){if(this.DivToolbar){if(this.DivHQChart.removeChild)this.DivHQChart.removeChild(this.DivToolbar);this.DivToolbar=null;}this.HQChart=null;this.DivHQChart=null;this.FrameID=-1;};this.Create=function(frame){var divToolbar=document.createElement("div");divToolbar.className='UMyChart_FrameToolbar_Div';divToolbar.id=this.ID;divToolbar.oncontextmenu=function(){return false;};//屏蔽右键系统菜单
10429
+ this.DivToolbar=divToolbar;var aryButtons=this.GetShowButtons(frame);this.CreateArrayButton(aryButtons);this.DivHQChart.appendChild(divToolbar);this.UpdateStyle();if(!this.HQChart.JSToolbarTooltip){this.HQChart.JSToolbarTooltip=new JSToolbarTooltip();this.HQChart.JSToolbarTooltip.DivHQChart=this.DivHQChart;this.HQChart.JSToolbarTooltip.Create();}};this.UpdateStyle=function(){if(!this.DivToolbar)return;for(var i=0;i<this.AryButton.length;i++){var item=this.AryButton[i];if(!item.Span)continue;item.Span.style["color"]=this.IconConfig.Color;}};this.ReloadResource=function(option){this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;this.UpdateStyle();};this.CreateButton=function(item,divDom){var _this50=this;var btnDiv=document.createElement("div");btnDiv.className="UMyChart_FrameToolbar_Div_Button";btnDiv.onmouseover=function(e){_this50.OnHoverButton(e,item);};btnDiv.onmouseout=function(e){_this50.OnLeaveButton(e,item);};item.Div=btnDiv;var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.onmousedown=function(e){_this50.OnClickButton(e,item);};item.Span=spanDom;btnDiv.appendChild(spanDom);divDom.appendChild(btnDiv);};this.OnClickButton=function(e,item){if(!this.FrameID<0)return;if(!this.HQChart)return;var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;var button={ID:item.ID,Frame:frame};this.HQChart.ClickFrameButton(button,e);};this.OnHoverButton=function(e,item){if(!item.Span)return;item.Span.style["color"]=this.IconConfig.HoverColor;this.ShowTooltip(e,item);};this.OnLeaveButton=function(e,item){if(!item.Span)return;item.Span.style["color"]=this.IconConfig.Color;this.HideTooltip();};this.Show=function(frameID){this.FrameID=frameID;if(!this.FrameID<0)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.Frame.SubFrame))return;if(!this.HQChart.Frame.SubFrame[this.FrameID])return;var pixelTatio=GetDevicePixelRatio();var frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;var border=frame.GetBorder();var top=border.Top/pixelTatio;var right=border.RightEx/pixelTatio;var left=right-this.DivToolbar.offsetWidth-2;if(this.Top!=top||this.Left!=left){this.DivToolbar.style.top=top+"px";this.DivToolbar.style.left=left+"px";this.DivToolbar.style.height=frame.ChartBorder.TitleHeight/pixelTatio+"px";this.Top=top;this.Left=left;}if(this.DivToolbar.style.visibility!='visible')this.DivToolbar.style.visibility='visible';};this.Hide=function(){if(this.DivToolbar)this.DivToolbar.style.visibility="hidden";};this.HideTooltip=function(){if(this.HQChart.JSToolbarTooltip)this.HQChart.JSToolbarTooltip.Hide();};this.ShowTooltip=function(e,item){if(!this.HQChart.JSToolbarTooltip)return;if(!item.Div)return;var rtButton=item.Div.getBoundingClientRect();var rtHQChart=this.DivHQChart.getBoundingClientRect();var left=rtButton.left-rtHQChart.left;var top=rtButton.bottom-rtHQChart.top+2;this.HQChart.JSToolbarTooltip.Show(top,left,{Text:item.Tooltip.Text});};}JSDivFrameToolbar.GetDfaultButtons=function(){var aryButton=[{ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param",Tooltip:{Text:"修改参数"},Span:null,Div:null,TooltipSpan:null},{ID:JSCHART_BUTTON_ID.CHANGE_INDEX,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index",Tooltip:{Text:"切换指标"},Span:null,Div:null,TooltipSpan:null},{ID:JSCHART_BUTTON_ID.OVERLAY_INDEX,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index",Tooltip:{Text:"叠加指标"},Span:null,Div:null,TooltipSpan:null},{ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW,ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close",Tooltip:{Text:"关闭窗口"},Span:null,Div:null,TooltipSpan:null}];return aryButton;};function JSToolbarTooltip(){this.DivTooltip=null;this.DivHQChart=null;this.Text=null;this.Left=-1;this.Top=-1;this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;this.Create=function(){var divDom=document.createElement("div");divDom.className='UMyChart_Toolbar_Tooltip_Div';this.DivHQChart.appendChild(divDom);this.DivTooltip=divDom;this.UpdateStyle();};this.ReloadResource=function(option){this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;this.UpdateStyle();};this.UpdateStyle=function(){if(!this.DivTooltip)return;this.DivTooltip.style["background-color"]=this.BGColor;this.DivTooltip.style["color"]=this.TextColor;this.DivTooltip.style["border"]="1px solid "+this.BorderColor;};this.Show=function(top,left,tooltipData){if(!this.DivTooltip)return;if(this.Text!=tooltipData.Text)this.DivTooltip.innerHTML=tooltipData.Text;var right=left+this.DivTooltip.offsetWidth;if(right+5>=window.innerWidth)left=left-this.DivTooltip.offsetWidth;if(this.Top!=top||this.Left!=left){this.DivTooltip.style.top=top+"px";this.DivTooltip.style.left=left+"px";this.Top=top;this.Left=left;}if(this.DivTooltip.style.visibility!='visible')this.DivTooltip.style.visibility='visible';};this.Hide=function(){if(!this.DivTooltip)return;if(this.DivTooltip.style["visibility"]!='hidden')this.DivTooltip.style["visibility"]="hidden";};}/*
10424
10430
  Copyright (c) 2018 jones
10425
10431
 
10426
10432
  http://www.apache.org/licenses/LICENSE-2.0
@@ -15332,7 +15338,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15332
15338
  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);};}/********************************************************************************
15333
15339
  * 版本信息输出
15334
15340
  *
15335
- */var HQCHART_VERSION="1.1.15065";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();//把给外界调用的方法暴露出来
15341
+ */var HQCHART_VERSION="1.1.15072";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();//把给外界调用的方法暴露出来
15336
15342
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15337
15343
  // BaseIndex:BaseIndex,
15338
15344
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15066",
3
+ "version": "1.1.15073",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -16218,7 +16218,7 @@ function AverageWidthFrame()
16218
16218
  this.DivFrameToolbar.HQChart=hqchart;
16219
16219
  this.DivFrameToolbar.DivHQChart=divHQChart;
16220
16220
  this.DivFrameToolbar.FrameID=frameID;
16221
- this.DivFrameToolbar.Create();
16221
+ this.DivFrameToolbar.Create(this);
16222
16222
  }
16223
16223
  }
16224
16224
 
@@ -47774,10 +47774,17 @@ function ChartLock()
47774
47774
 
47775
47775
  if (isDraw)
47776
47776
  {
47777
- this.Canvas.fillStyle = this.BGColor;
47778
- this.Canvas.fillRect(lLeft, this.ChartBorder.GetTop(), lWidth, lHeight);
47779
- var xCenter = lLeft + lWidth / 2;
47780
- var yCenter = this.ChartBorder.GetTop() + lHeight / 2;
47777
+ var rtBG={ Left:lLeft, Top:this.ChartBorder.GetTop(), Width:lWidth, Height:lHeight };
47778
+ rtBG.Right=rtBG.Width+rtBG.Left;
47779
+ rtBG.Bottom=rtBG.Height+rtBG.Top;
47780
+
47781
+ //上下渐变
47782
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
47783
+ this.Canvas.fillStyle =bgColor;
47784
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
47785
+
47786
+ var xCenter = rtBG.Left + rtBG.Width / 2;
47787
+ var yCenter = rtBG.Top + lHeight / 2;
47781
47788
  this.Canvas.textAlign = 'center';
47782
47789
  this.Canvas.textBaseline = 'middle';
47783
47790
  this.Canvas.fillStyle = this.TextColor;
@@ -47821,6 +47828,7 @@ function ChartLock()
47821
47828
  if (lLeft < this.ChartBorder.GetTop()) lLeft = this.ChartBorder.GetTop();
47822
47829
  var lHeight = this.ChartBorder.GetRight()-this.ChartBorder.GetLeft();
47823
47830
  var lWidth = this.ChartBorder.GetBottom() - lLeft;
47831
+
47824
47832
  this.Canvas.fillStyle = this.BGColor;
47825
47833
  this.Canvas.fillRect(this.ChartBorder.GetLeft(), lLeft,lHeight,lWidth);
47826
47834
 
@@ -49471,7 +49479,7 @@ function StockChip()
49471
49479
  if (option.ShowType>0) this.ShowType=option.ShowType;
49472
49480
  if (option.IsShowX) this.IsShowX=option.IsShowX;
49473
49481
  if (option.ShowXCount>0) this.ShowXCount=option.ShowXCount;
49474
- if (option.Width>100) this.Width=option.Width*GetDevicePixelRatio();
49482
+ if (option.Width>50) this.Width=option.Width*GetDevicePixelRatio();
49475
49483
  if (option.CalculateType>0) this.CalculateType=option.CalculateType;
49476
49484
  if (IFrameSplitOperator.IsNumber(option.PriceZoom)) this.PriceZoom=option.PriceZoom;
49477
49485
  }
@@ -65380,7 +65388,7 @@ function IChartDrawPicture()
65380
65388
  Symbol:this.Symbol, Guid:this.Guid, Period:this.Period,Value:[] ,
65381
65389
  FrameID:this.Frame.Identify, LineColor:this.LineColor, AreaColor:this.AreaColor,
65382
65390
  LineWidth:this.LineWidth, Right:this.Right, EnableSave:this.EnableSave,
65383
- IsShowYCoordinate:this.IsShowYCoordinate
65391
+ IsShowYCoordinate:this.IsShowYCoordinate, EnableCtrlMove:this.EnableCtrlMove
65384
65392
  };
65385
65393
 
65386
65394
  for(var i=0; i<this.Value.length; ++i)
@@ -65404,7 +65412,7 @@ function IChartDrawPicture()
65404
65412
  Symbol:this.Symbol, Period:this.Period,Right:this.Right,
65405
65413
  LineColor:this.LineColor,
65406
65414
  LineWidth:this.LineWidth,
65407
- EnableSave:this.EnableSave, IsShowYCoordinate:this.IsShowYCoordinate
65415
+ EnableSave:this.EnableSave, IsShowYCoordinate:this.IsShowYCoordinate, EnableCtrlMove:this.EnableCtrlMove,
65408
65416
  };
65409
65417
 
65410
65418
  if (this.AreaColor) data.AreaColor=this.AreaColor;
@@ -66656,7 +66664,7 @@ function ChartDrawPictureHorizontalLine()
66656
66664
  {
66657
66665
  Left:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
66658
66666
  Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
66659
- Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)"
66667
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)", BGColor:null
66660
66668
  };
66661
66669
 
66662
66670
  this.InsideLabelConfig=
@@ -66665,7 +66673,8 @@ function ChartDrawPictureHorizontalLine()
66665
66673
  Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
66666
66674
  Margin:{ Left:5, Top:4, Bottom:2, Right:5 },
66667
66675
  TextColor:"rgb(255,255,255)",
66668
- BGAlpha:0.8, //背景色透明度
66676
+ BGAlpha:0.8, //背景色透明度,
66677
+ IsShow:true
66669
66678
  }
66670
66679
 
66671
66680
  this.LabelTitle;
@@ -66694,7 +66703,8 @@ function ChartDrawPictureHorizontalLine()
66694
66703
  }
66695
66704
 
66696
66705
  if (item.Font) this.LabelConfig.Font=item.Font;
66697
- if (item.TextColor) this.LabelConfig.FoTextColornt=item.TextColor;
66706
+ if (item.TextColor) this.LabelConfig.TextColor=item.TextColor;
66707
+ if (item.BGColor) this.LabelConfig.BGColor=item.BGColor;
66698
66708
  }
66699
66709
 
66700
66710
  if (option.InsideLabel)
@@ -66704,6 +66714,7 @@ function ChartDrawPictureHorizontalLine()
66704
66714
  if (item.TextColor) this.InsideLabelConfig.TextColor=item.TextColor;
66705
66715
  if (IFrameSplitOperator.IsNumber(item.Position)) this.InsideLabelConfig.Position=item.Position;
66706
66716
  if (IFrameSplitOperator.IsNumber(item.BGAlpha)) this.InsideLabelConfig.BGAlpha=item.BGAlpha;
66717
+ if (IFrameSplitOperator.IsBool(item.IsShow)) this.InsideLabelConfig.IsShow=item.IsShow;
66707
66718
  }
66708
66719
  }
66709
66720
  }
@@ -66715,6 +66726,8 @@ function ChartDrawPictureHorizontalLine()
66715
66726
  {
66716
66727
  storageData=this.Super_ExportStorageData();
66717
66728
  if (this.LabelTitle) storageData.LabelTitle=this.LabelTitle;
66729
+ if (this.LabelConfig) storageData.Label=this.LabelConfig;
66730
+ if (this.InsideLabelConfig) storageData.InsideLabel=this.InsideLabelConfig;
66718
66731
  }
66719
66732
 
66720
66733
  return storageData;
@@ -66821,7 +66834,8 @@ function ChartDrawPictureHorizontalLine()
66821
66834
  rtBG.Bottom=rtBG.Top+rtBG.Height;
66822
66835
  rtBG.Left=rtBG.Right-rtBG.Width;
66823
66836
 
66824
- this.Canvas.fillStyle=this.LineColor;
66837
+ if (config.BGColor) this.Canvas.fillStyle=config.BGColor;
66838
+ else this.Canvas.fillStyle=this.LineColor;
66825
66839
  this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
66826
66840
 
66827
66841
  this.Canvas.textAlign="left";
@@ -66839,7 +66853,9 @@ function ChartDrawPictureHorizontalLine()
66839
66853
  rtBG.Top=y-textHeight/2-margin.Top;
66840
66854
  rtBG.Bottom=rtBG.Top+rtBG.Height;
66841
66855
  rtBG.Right=rtBG.Left+rtBG.Width;
66842
- this.Canvas.fillStyle=this.LineColor;
66856
+
66857
+ if (config.BGColor) this.Canvas.fillStyle=config.BGColor;
66858
+ else this.Canvas.fillStyle=this.LineColor;
66843
66859
  this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
66844
66860
 
66845
66861
  this.Canvas.textAlign="left";
@@ -66857,6 +66873,7 @@ function ChartDrawPictureHorizontalLine()
66857
66873
 
66858
66874
  var isHScreen=this.Frame.IsHScreen;
66859
66875
  var config=this.InsideLabelConfig;
66876
+ if (!config.IsShow) return;
66860
66877
  if (config.Position!=0 && config.Position!=1) return;
66861
66878
  var margin=config.Margin;
66862
66879
 
@@ -105278,27 +105295,26 @@ function JSDivFrameToolbar()
105278
105295
  HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
105279
105296
  }
105280
105297
 
105281
- this.AryButton=
105282
- [
105283
- {
105284
- ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
105285
- Span:null, Div:null, TooltipSpan:null
105286
- },
105287
- {
105288
- ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
105289
- Span:null,Div:null, TooltipSpan:null
105290
- },
105291
- {
105292
- ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
105293
- Span:null,Div:null, TooltipSpan:null
105294
- },
105295
- {
105296
- ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
105297
- Span:null,Div:null, TooltipSpan:null
105298
- },
105299
- ];
105298
+ this.AryButton=[]; //按钮数组
105300
105299
 
105301
- this.SetToolbar=function(aryButton)
105300
+ //创建按钮
105301
+ this.CreateArrayButton=function(aryButton)
105302
+ {
105303
+ for(var i=0;i<aryButton.length; i++)
105304
+ {
105305
+ var item=aryButton[i];
105306
+ if (!item.ID || !item.ClassName) continue;
105307
+ var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
105308
+ if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
105309
+
105310
+ this.AryButton.push(newItem);
105311
+
105312
+ if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
105313
+ }
105314
+ }
105315
+
105316
+ //清空原来的按钮
105317
+ this.ClearAllButtons=function()
105302
105318
  {
105303
105319
  //清空原来的按钮
105304
105320
  for(var i=0; i<this.AryButton.length; i++)
@@ -105309,24 +105325,75 @@ function JSDivFrameToolbar()
105309
105325
  item.Span=null;
105310
105326
  item.TooltipSpan=null;
105311
105327
  }
105328
+
105312
105329
  this.AryButton=[];
105330
+ }
105313
105331
 
105314
- //重新创建
105315
- for(var i=0;i<aryButton.length; i++)
105332
+ this.GetShowButtons=function(subFrame)
105333
+ {
105334
+ var frame=subFrame;
105335
+ if (!frame && this.FrameID>=0 && this.FrameID<this.HQChart.Frame.SubFrame.length)
105336
+ frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
105337
+
105338
+ var aryDefaultButton=JSDivFrameToolbar.GetDfaultButtons();
105339
+ var aryButton=[];
105340
+ for(var i=0;i<aryDefaultButton.length; i++)
105316
105341
  {
105317
- var item=aryButton[i];
105318
- if (!item.ID || !item.ClassName) continue;
105319
- var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
105320
- if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
105342
+ var item=aryDefaultButton[i];
105343
+ if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
105321
105344
 
105322
- this.AryButton.push(newItem);
105345
+ if (item.ID==JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM && frame && frame.ModifyIndex===false) continue;
105346
+ if (item.ID==JSCHART_BUTTON_ID.CHANGE_INDEX && frame && frame.ChangeIndex===false) continue;
105347
+ if (item.ID==JSCHART_BUTTON_ID.OVERLAY_INDEX && frame && frame.OverlayIndex===false) continue;
105348
+ if (item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW && frame && frame.CloseIndex===false) continue;
105323
105349
 
105324
- if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
105350
+ aryButton.push(item);
105325
105351
  }
105326
105352
 
105353
+ return aryButton;
105354
+ }
105355
+
105356
+ this.SetToolbar=function(aryButton)
105357
+ {
105358
+ this.ClearAllButtons(); //清空原来的按钮
105359
+
105360
+ this.CreateArrayButton(aryButton); //重新创建
105361
+
105327
105362
  this.UpdateStyle();
105328
105363
  }
105329
105364
 
105365
+ this.UpdateButton=function()
105366
+ {
105367
+ if (!this.DivToolbar) return;
105368
+
105369
+ var aryButton=this.GetShowButtons();
105370
+ var bChange=false;
105371
+ if (aryButton.length!=this.AryButton.length)
105372
+ {
105373
+ bChange=true;
105374
+ }
105375
+ else
105376
+ {
105377
+ for(var i=0;i<this.AryButton.length;++i)
105378
+ {
105379
+ var leftItem=this.AryButton[i];
105380
+ var rightItem=aryButton[i];
105381
+
105382
+ if (leftItem.ID!=rightItem.ID || leftItem.ClassName!=rightItem.ClassName)
105383
+ {
105384
+ bChange=true;
105385
+ break;
105386
+ }
105387
+ }
105388
+ }
105389
+
105390
+ if (!bChange) return;
105391
+
105392
+ this.SetToolbar(aryButton); //重新设置按钮
105393
+ }
105394
+
105395
+
105396
+
105330
105397
  this.Destroy=function()
105331
105398
  {
105332
105399
  if (this.DivToolbar)
@@ -105340,24 +105407,19 @@ function JSDivFrameToolbar()
105340
105407
  this.FrameID=-1;
105341
105408
  }
105342
105409
 
105343
- this.Create=function()
105410
+ this.Create=function(frame)
105344
105411
  {
105345
105412
  var divToolbar=document.createElement("div");
105346
105413
  divToolbar.className='UMyChart_FrameToolbar_Div';
105347
105414
  divToolbar.id=this.ID;
105348
105415
  divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
105416
+ this.DivToolbar=divToolbar;
105349
105417
 
105350
- for(var i=0;i<this.AryButton.length; i++)
105351
- {
105352
- var item=this.AryButton[i];
105353
- if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
105354
- this.CreateButton(item, divToolbar);
105355
- }
105418
+ var aryButtons=this.GetShowButtons(frame);
105419
+ this.CreateArrayButton(aryButtons)
105356
105420
 
105357
105421
  this.DivHQChart.appendChild(divToolbar);
105358
105422
 
105359
- this.DivToolbar=divToolbar;
105360
-
105361
105423
  this.UpdateStyle();
105362
105424
 
105363
105425
  if (!this.HQChart.JSToolbarTooltip)
@@ -105483,6 +105545,32 @@ function JSDivFrameToolbar()
105483
105545
  }
105484
105546
  }
105485
105547
 
105548
+ JSDivFrameToolbar.GetDfaultButtons=function()
105549
+ {
105550
+ var aryButton=
105551
+ [
105552
+
105553
+ {
105554
+ ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
105555
+ Span:null, Div:null, TooltipSpan:null
105556
+ },
105557
+ {
105558
+ ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
105559
+ Span:null,Div:null, TooltipSpan:null
105560
+ },
105561
+ {
105562
+ ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
105563
+ Span:null,Div:null, TooltipSpan:null
105564
+ },
105565
+ {
105566
+ ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
105567
+ Span:null,Div:null, TooltipSpan:null
105568
+ },
105569
+ ];
105570
+
105571
+ return aryButton
105572
+ }
105573
+
105486
105574
 
105487
105575
  function JSToolbarTooltip()
105488
105576
  {
@@ -2386,6 +2386,7 @@ input[type="color"] {
2386
2386
 
2387
2387
  .UMyChart_Toolbar_Tooltip_Div
2388
2388
  {
2389
+ visibility:hidden;
2389
2390
  background-color: rgb(220,220,220);
2390
2391
  color: rgb(0,0,0);
2391
2392
  text-align: center;
@@ -20314,7 +20314,7 @@ function AverageWidthFrame()
20314
20314
  this.DivFrameToolbar.HQChart=hqchart;
20315
20315
  this.DivFrameToolbar.DivHQChart=divHQChart;
20316
20316
  this.DivFrameToolbar.FrameID=frameID;
20317
- this.DivFrameToolbar.Create();
20317
+ this.DivFrameToolbar.Create(this);
20318
20318
  }
20319
20319
  }
20320
20320
 
@@ -51870,10 +51870,17 @@ function ChartLock()
51870
51870
 
51871
51871
  if (isDraw)
51872
51872
  {
51873
- this.Canvas.fillStyle = this.BGColor;
51874
- this.Canvas.fillRect(lLeft, this.ChartBorder.GetTop(), lWidth, lHeight);
51875
- var xCenter = lLeft + lWidth / 2;
51876
- var yCenter = this.ChartBorder.GetTop() + lHeight / 2;
51873
+ var rtBG={ Left:lLeft, Top:this.ChartBorder.GetTop(), Width:lWidth, Height:lHeight };
51874
+ rtBG.Right=rtBG.Width+rtBG.Left;
51875
+ rtBG.Bottom=rtBG.Height+rtBG.Top;
51876
+
51877
+ //上下渐变
51878
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
51879
+ this.Canvas.fillStyle =bgColor;
51880
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
51881
+
51882
+ var xCenter = rtBG.Left + rtBG.Width / 2;
51883
+ var yCenter = rtBG.Top + lHeight / 2;
51877
51884
  this.Canvas.textAlign = 'center';
51878
51885
  this.Canvas.textBaseline = 'middle';
51879
51886
  this.Canvas.fillStyle = this.TextColor;
@@ -51917,6 +51924,7 @@ function ChartLock()
51917
51924
  if (lLeft < this.ChartBorder.GetTop()) lLeft = this.ChartBorder.GetTop();
51918
51925
  var lHeight = this.ChartBorder.GetRight()-this.ChartBorder.GetLeft();
51919
51926
  var lWidth = this.ChartBorder.GetBottom() - lLeft;
51927
+
51920
51928
  this.Canvas.fillStyle = this.BGColor;
51921
51929
  this.Canvas.fillRect(this.ChartBorder.GetLeft(), lLeft,lHeight,lWidth);
51922
51930
 
@@ -53567,7 +53575,7 @@ function StockChip()
53567
53575
  if (option.ShowType>0) this.ShowType=option.ShowType;
53568
53576
  if (option.IsShowX) this.IsShowX=option.IsShowX;
53569
53577
  if (option.ShowXCount>0) this.ShowXCount=option.ShowXCount;
53570
- if (option.Width>100) this.Width=option.Width*GetDevicePixelRatio();
53578
+ if (option.Width>50) this.Width=option.Width*GetDevicePixelRatio();
53571
53579
  if (option.CalculateType>0) this.CalculateType=option.CalculateType;
53572
53580
  if (IFrameSplitOperator.IsNumber(option.PriceZoom)) this.PriceZoom=option.PriceZoom;
53573
53581
  }
@@ -69476,7 +69484,7 @@ function IChartDrawPicture()
69476
69484
  Symbol:this.Symbol, Guid:this.Guid, Period:this.Period,Value:[] ,
69477
69485
  FrameID:this.Frame.Identify, LineColor:this.LineColor, AreaColor:this.AreaColor,
69478
69486
  LineWidth:this.LineWidth, Right:this.Right, EnableSave:this.EnableSave,
69479
- IsShowYCoordinate:this.IsShowYCoordinate
69487
+ IsShowYCoordinate:this.IsShowYCoordinate, EnableCtrlMove:this.EnableCtrlMove
69480
69488
  };
69481
69489
 
69482
69490
  for(var i=0; i<this.Value.length; ++i)
@@ -69500,7 +69508,7 @@ function IChartDrawPicture()
69500
69508
  Symbol:this.Symbol, Period:this.Period,Right:this.Right,
69501
69509
  LineColor:this.LineColor,
69502
69510
  LineWidth:this.LineWidth,
69503
- EnableSave:this.EnableSave, IsShowYCoordinate:this.IsShowYCoordinate
69511
+ EnableSave:this.EnableSave, IsShowYCoordinate:this.IsShowYCoordinate, EnableCtrlMove:this.EnableCtrlMove,
69504
69512
  };
69505
69513
 
69506
69514
  if (this.AreaColor) data.AreaColor=this.AreaColor;
@@ -70752,7 +70760,7 @@ function ChartDrawPictureHorizontalLine()
70752
70760
  {
70753
70761
  Left:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
70754
70762
  Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
70755
- Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)"
70763
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)", BGColor:null
70756
70764
  };
70757
70765
 
70758
70766
  this.InsideLabelConfig=
@@ -70761,7 +70769,8 @@ function ChartDrawPictureHorizontalLine()
70761
70769
  Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
70762
70770
  Margin:{ Left:5, Top:4, Bottom:2, Right:5 },
70763
70771
  TextColor:"rgb(255,255,255)",
70764
- BGAlpha:0.8, //背景色透明度
70772
+ BGAlpha:0.8, //背景色透明度,
70773
+ IsShow:true
70765
70774
  }
70766
70775
 
70767
70776
  this.LabelTitle;
@@ -70790,7 +70799,8 @@ function ChartDrawPictureHorizontalLine()
70790
70799
  }
70791
70800
 
70792
70801
  if (item.Font) this.LabelConfig.Font=item.Font;
70793
- if (item.TextColor) this.LabelConfig.FoTextColornt=item.TextColor;
70802
+ if (item.TextColor) this.LabelConfig.TextColor=item.TextColor;
70803
+ if (item.BGColor) this.LabelConfig.BGColor=item.BGColor;
70794
70804
  }
70795
70805
 
70796
70806
  if (option.InsideLabel)
@@ -70800,6 +70810,7 @@ function ChartDrawPictureHorizontalLine()
70800
70810
  if (item.TextColor) this.InsideLabelConfig.TextColor=item.TextColor;
70801
70811
  if (IFrameSplitOperator.IsNumber(item.Position)) this.InsideLabelConfig.Position=item.Position;
70802
70812
  if (IFrameSplitOperator.IsNumber(item.BGAlpha)) this.InsideLabelConfig.BGAlpha=item.BGAlpha;
70813
+ if (IFrameSplitOperator.IsBool(item.IsShow)) this.InsideLabelConfig.IsShow=item.IsShow;
70803
70814
  }
70804
70815
  }
70805
70816
  }
@@ -70811,6 +70822,8 @@ function ChartDrawPictureHorizontalLine()
70811
70822
  {
70812
70823
  storageData=this.Super_ExportStorageData();
70813
70824
  if (this.LabelTitle) storageData.LabelTitle=this.LabelTitle;
70825
+ if (this.LabelConfig) storageData.Label=this.LabelConfig;
70826
+ if (this.InsideLabelConfig) storageData.InsideLabel=this.InsideLabelConfig;
70814
70827
  }
70815
70828
 
70816
70829
  return storageData;
@@ -70917,7 +70930,8 @@ function ChartDrawPictureHorizontalLine()
70917
70930
  rtBG.Bottom=rtBG.Top+rtBG.Height;
70918
70931
  rtBG.Left=rtBG.Right-rtBG.Width;
70919
70932
 
70920
- this.Canvas.fillStyle=this.LineColor;
70933
+ if (config.BGColor) this.Canvas.fillStyle=config.BGColor;
70934
+ else this.Canvas.fillStyle=this.LineColor;
70921
70935
  this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
70922
70936
 
70923
70937
  this.Canvas.textAlign="left";
@@ -70935,7 +70949,9 @@ function ChartDrawPictureHorizontalLine()
70935
70949
  rtBG.Top=y-textHeight/2-margin.Top;
70936
70950
  rtBG.Bottom=rtBG.Top+rtBG.Height;
70937
70951
  rtBG.Right=rtBG.Left+rtBG.Width;
70938
- this.Canvas.fillStyle=this.LineColor;
70952
+
70953
+ if (config.BGColor) this.Canvas.fillStyle=config.BGColor;
70954
+ else this.Canvas.fillStyle=this.LineColor;
70939
70955
  this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
70940
70956
 
70941
70957
  this.Canvas.textAlign="left";
@@ -70953,6 +70969,7 @@ function ChartDrawPictureHorizontalLine()
70953
70969
 
70954
70970
  var isHScreen=this.Frame.IsHScreen;
70955
70971
  var config=this.InsideLabelConfig;
70972
+ if (!config.IsShow) return;
70956
70973
  if (config.Position!=0 && config.Position!=1) return;
70957
70974
  var margin=config.Margin;
70958
70975
 
@@ -109374,27 +109391,26 @@ function JSDivFrameToolbar()
109374
109391
  HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
109375
109392
  }
109376
109393
 
109377
- this.AryButton=
109378
- [
109379
- {
109380
- ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
109381
- Span:null, Div:null, TooltipSpan:null
109382
- },
109383
- {
109384
- ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
109385
- Span:null,Div:null, TooltipSpan:null
109386
- },
109387
- {
109388
- ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
109389
- Span:null,Div:null, TooltipSpan:null
109390
- },
109391
- {
109392
- ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109393
- Span:null,Div:null, TooltipSpan:null
109394
- },
109395
- ];
109394
+ this.AryButton=[]; //按钮数组
109396
109395
 
109397
- this.SetToolbar=function(aryButton)
109396
+ //创建按钮
109397
+ this.CreateArrayButton=function(aryButton)
109398
+ {
109399
+ for(var i=0;i<aryButton.length; i++)
109400
+ {
109401
+ var item=aryButton[i];
109402
+ if (!item.ID || !item.ClassName) continue;
109403
+ var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109404
+ if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109405
+
109406
+ this.AryButton.push(newItem);
109407
+
109408
+ if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
109409
+ }
109410
+ }
109411
+
109412
+ //清空原来的按钮
109413
+ this.ClearAllButtons=function()
109398
109414
  {
109399
109415
  //清空原来的按钮
109400
109416
  for(var i=0; i<this.AryButton.length; i++)
@@ -109405,24 +109421,75 @@ function JSDivFrameToolbar()
109405
109421
  item.Span=null;
109406
109422
  item.TooltipSpan=null;
109407
109423
  }
109424
+
109408
109425
  this.AryButton=[];
109426
+ }
109409
109427
 
109410
- //重新创建
109411
- for(var i=0;i<aryButton.length; i++)
109428
+ this.GetShowButtons=function(subFrame)
109429
+ {
109430
+ var frame=subFrame;
109431
+ if (!frame && this.FrameID>=0 && this.FrameID<this.HQChart.Frame.SubFrame.length)
109432
+ frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109433
+
109434
+ var aryDefaultButton=JSDivFrameToolbar.GetDfaultButtons();
109435
+ var aryButton=[];
109436
+ for(var i=0;i<aryDefaultButton.length; i++)
109412
109437
  {
109413
- var item=aryButton[i];
109414
- if (!item.ID || !item.ClassName) continue;
109415
- var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109416
- if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109438
+ var item=aryDefaultButton[i];
109439
+ if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
109417
109440
 
109418
- this.AryButton.push(newItem);
109441
+ if (item.ID==JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM && frame && frame.ModifyIndex===false) continue;
109442
+ if (item.ID==JSCHART_BUTTON_ID.CHANGE_INDEX && frame && frame.ChangeIndex===false) continue;
109443
+ if (item.ID==JSCHART_BUTTON_ID.OVERLAY_INDEX && frame && frame.OverlayIndex===false) continue;
109444
+ if (item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW && frame && frame.CloseIndex===false) continue;
109419
109445
 
109420
- if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
109446
+ aryButton.push(item);
109421
109447
  }
109422
109448
 
109449
+ return aryButton;
109450
+ }
109451
+
109452
+ this.SetToolbar=function(aryButton)
109453
+ {
109454
+ this.ClearAllButtons(); //清空原来的按钮
109455
+
109456
+ this.CreateArrayButton(aryButton); //重新创建
109457
+
109423
109458
  this.UpdateStyle();
109424
109459
  }
109425
109460
 
109461
+ this.UpdateButton=function()
109462
+ {
109463
+ if (!this.DivToolbar) return;
109464
+
109465
+ var aryButton=this.GetShowButtons();
109466
+ var bChange=false;
109467
+ if (aryButton.length!=this.AryButton.length)
109468
+ {
109469
+ bChange=true;
109470
+ }
109471
+ else
109472
+ {
109473
+ for(var i=0;i<this.AryButton.length;++i)
109474
+ {
109475
+ var leftItem=this.AryButton[i];
109476
+ var rightItem=aryButton[i];
109477
+
109478
+ if (leftItem.ID!=rightItem.ID || leftItem.ClassName!=rightItem.ClassName)
109479
+ {
109480
+ bChange=true;
109481
+ break;
109482
+ }
109483
+ }
109484
+ }
109485
+
109486
+ if (!bChange) return;
109487
+
109488
+ this.SetToolbar(aryButton); //重新设置按钮
109489
+ }
109490
+
109491
+
109492
+
109426
109493
  this.Destroy=function()
109427
109494
  {
109428
109495
  if (this.DivToolbar)
@@ -109436,24 +109503,19 @@ function JSDivFrameToolbar()
109436
109503
  this.FrameID=-1;
109437
109504
  }
109438
109505
 
109439
- this.Create=function()
109506
+ this.Create=function(frame)
109440
109507
  {
109441
109508
  var divToolbar=document.createElement("div");
109442
109509
  divToolbar.className='UMyChart_FrameToolbar_Div';
109443
109510
  divToolbar.id=this.ID;
109444
109511
  divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
109512
+ this.DivToolbar=divToolbar;
109445
109513
 
109446
- for(var i=0;i<this.AryButton.length; i++)
109447
- {
109448
- var item=this.AryButton[i];
109449
- if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
109450
- this.CreateButton(item, divToolbar);
109451
- }
109514
+ var aryButtons=this.GetShowButtons(frame);
109515
+ this.CreateArrayButton(aryButtons)
109452
109516
 
109453
109517
  this.DivHQChart.appendChild(divToolbar);
109454
109518
 
109455
- this.DivToolbar=divToolbar;
109456
-
109457
109519
  this.UpdateStyle();
109458
109520
 
109459
109521
  if (!this.HQChart.JSToolbarTooltip)
@@ -109579,6 +109641,32 @@ function JSDivFrameToolbar()
109579
109641
  }
109580
109642
  }
109581
109643
 
109644
+ JSDivFrameToolbar.GetDfaultButtons=function()
109645
+ {
109646
+ var aryButton=
109647
+ [
109648
+
109649
+ {
109650
+ ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
109651
+ Span:null, Div:null, TooltipSpan:null
109652
+ },
109653
+ {
109654
+ ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
109655
+ Span:null,Div:null, TooltipSpan:null
109656
+ },
109657
+ {
109658
+ ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
109659
+ Span:null,Div:null, TooltipSpan:null
109660
+ },
109661
+ {
109662
+ ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109663
+ Span:null,Div:null, TooltipSpan:null
109664
+ },
109665
+ ];
109666
+
109667
+ return aryButton
109668
+ }
109669
+
109582
109670
 
109583
109671
  function JSToolbarTooltip()
109584
109672
  {
@@ -153619,7 +153707,7 @@ function ScrollBarBGChart()
153619
153707
 
153620
153708
 
153621
153709
 
153622
- var HQCHART_VERSION="1.1.15065";
153710
+ var HQCHART_VERSION="1.1.15072";
153623
153711
 
153624
153712
  function PrintHQChartVersion()
153625
153713
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15065";
8
+ var HQCHART_VERSION="1.1.15072";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -20358,7 +20358,7 @@ function AverageWidthFrame()
20358
20358
  this.DivFrameToolbar.HQChart=hqchart;
20359
20359
  this.DivFrameToolbar.DivHQChart=divHQChart;
20360
20360
  this.DivFrameToolbar.FrameID=frameID;
20361
- this.DivFrameToolbar.Create();
20361
+ this.DivFrameToolbar.Create(this);
20362
20362
  }
20363
20363
  }
20364
20364
 
@@ -51914,10 +51914,17 @@ function ChartLock()
51914
51914
 
51915
51915
  if (isDraw)
51916
51916
  {
51917
- this.Canvas.fillStyle = this.BGColor;
51918
- this.Canvas.fillRect(lLeft, this.ChartBorder.GetTop(), lWidth, lHeight);
51919
- var xCenter = lLeft + lWidth / 2;
51920
- var yCenter = this.ChartBorder.GetTop() + lHeight / 2;
51917
+ var rtBG={ Left:lLeft, Top:this.ChartBorder.GetTop(), Width:lWidth, Height:lHeight };
51918
+ rtBG.Right=rtBG.Width+rtBG.Left;
51919
+ rtBG.Bottom=rtBG.Height+rtBG.Top;
51920
+
51921
+ //上下渐变
51922
+ var bgColor=this.SetFillStyle(this.BGColor, rtBG.Left, rtBG.Top, rtBG.Left, rtBG.Bottom);
51923
+ this.Canvas.fillStyle =bgColor;
51924
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
51925
+
51926
+ var xCenter = rtBG.Left + rtBG.Width / 2;
51927
+ var yCenter = rtBG.Top + lHeight / 2;
51921
51928
  this.Canvas.textAlign = 'center';
51922
51929
  this.Canvas.textBaseline = 'middle';
51923
51930
  this.Canvas.fillStyle = this.TextColor;
@@ -51961,6 +51968,7 @@ function ChartLock()
51961
51968
  if (lLeft < this.ChartBorder.GetTop()) lLeft = this.ChartBorder.GetTop();
51962
51969
  var lHeight = this.ChartBorder.GetRight()-this.ChartBorder.GetLeft();
51963
51970
  var lWidth = this.ChartBorder.GetBottom() - lLeft;
51971
+
51964
51972
  this.Canvas.fillStyle = this.BGColor;
51965
51973
  this.Canvas.fillRect(this.ChartBorder.GetLeft(), lLeft,lHeight,lWidth);
51966
51974
 
@@ -53611,7 +53619,7 @@ function StockChip()
53611
53619
  if (option.ShowType>0) this.ShowType=option.ShowType;
53612
53620
  if (option.IsShowX) this.IsShowX=option.IsShowX;
53613
53621
  if (option.ShowXCount>0) this.ShowXCount=option.ShowXCount;
53614
- if (option.Width>100) this.Width=option.Width*GetDevicePixelRatio();
53622
+ if (option.Width>50) this.Width=option.Width*GetDevicePixelRatio();
53615
53623
  if (option.CalculateType>0) this.CalculateType=option.CalculateType;
53616
53624
  if (IFrameSplitOperator.IsNumber(option.PriceZoom)) this.PriceZoom=option.PriceZoom;
53617
53625
  }
@@ -69520,7 +69528,7 @@ function IChartDrawPicture()
69520
69528
  Symbol:this.Symbol, Guid:this.Guid, Period:this.Period,Value:[] ,
69521
69529
  FrameID:this.Frame.Identify, LineColor:this.LineColor, AreaColor:this.AreaColor,
69522
69530
  LineWidth:this.LineWidth, Right:this.Right, EnableSave:this.EnableSave,
69523
- IsShowYCoordinate:this.IsShowYCoordinate
69531
+ IsShowYCoordinate:this.IsShowYCoordinate, EnableCtrlMove:this.EnableCtrlMove
69524
69532
  };
69525
69533
 
69526
69534
  for(var i=0; i<this.Value.length; ++i)
@@ -69544,7 +69552,7 @@ function IChartDrawPicture()
69544
69552
  Symbol:this.Symbol, Period:this.Period,Right:this.Right,
69545
69553
  LineColor:this.LineColor,
69546
69554
  LineWidth:this.LineWidth,
69547
- EnableSave:this.EnableSave, IsShowYCoordinate:this.IsShowYCoordinate
69555
+ EnableSave:this.EnableSave, IsShowYCoordinate:this.IsShowYCoordinate, EnableCtrlMove:this.EnableCtrlMove,
69548
69556
  };
69549
69557
 
69550
69558
  if (this.AreaColor) data.AreaColor=this.AreaColor;
@@ -70796,7 +70804,7 @@ function ChartDrawPictureHorizontalLine()
70796
70804
  {
70797
70805
  Left:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
70798
70806
  Right:{ IsShow:true, Margin:{ Left:5, Top:4, Bottom:2, Right:5 } },
70799
- Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)"
70807
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, TextColor:"rgb(255,255,255)", BGColor:null
70800
70808
  };
70801
70809
 
70802
70810
  this.InsideLabelConfig=
@@ -70805,7 +70813,8 @@ function ChartDrawPictureHorizontalLine()
70805
70813
  Font:`${14*GetDevicePixelRatio()}px 微软雅黑`,
70806
70814
  Margin:{ Left:5, Top:4, Bottom:2, Right:5 },
70807
70815
  TextColor:"rgb(255,255,255)",
70808
- BGAlpha:0.8, //背景色透明度
70816
+ BGAlpha:0.8, //背景色透明度,
70817
+ IsShow:true
70809
70818
  }
70810
70819
 
70811
70820
  this.LabelTitle;
@@ -70834,7 +70843,8 @@ function ChartDrawPictureHorizontalLine()
70834
70843
  }
70835
70844
 
70836
70845
  if (item.Font) this.LabelConfig.Font=item.Font;
70837
- if (item.TextColor) this.LabelConfig.FoTextColornt=item.TextColor;
70846
+ if (item.TextColor) this.LabelConfig.TextColor=item.TextColor;
70847
+ if (item.BGColor) this.LabelConfig.BGColor=item.BGColor;
70838
70848
  }
70839
70849
 
70840
70850
  if (option.InsideLabel)
@@ -70844,6 +70854,7 @@ function ChartDrawPictureHorizontalLine()
70844
70854
  if (item.TextColor) this.InsideLabelConfig.TextColor=item.TextColor;
70845
70855
  if (IFrameSplitOperator.IsNumber(item.Position)) this.InsideLabelConfig.Position=item.Position;
70846
70856
  if (IFrameSplitOperator.IsNumber(item.BGAlpha)) this.InsideLabelConfig.BGAlpha=item.BGAlpha;
70857
+ if (IFrameSplitOperator.IsBool(item.IsShow)) this.InsideLabelConfig.IsShow=item.IsShow;
70847
70858
  }
70848
70859
  }
70849
70860
  }
@@ -70855,6 +70866,8 @@ function ChartDrawPictureHorizontalLine()
70855
70866
  {
70856
70867
  storageData=this.Super_ExportStorageData();
70857
70868
  if (this.LabelTitle) storageData.LabelTitle=this.LabelTitle;
70869
+ if (this.LabelConfig) storageData.Label=this.LabelConfig;
70870
+ if (this.InsideLabelConfig) storageData.InsideLabel=this.InsideLabelConfig;
70858
70871
  }
70859
70872
 
70860
70873
  return storageData;
@@ -70961,7 +70974,8 @@ function ChartDrawPictureHorizontalLine()
70961
70974
  rtBG.Bottom=rtBG.Top+rtBG.Height;
70962
70975
  rtBG.Left=rtBG.Right-rtBG.Width;
70963
70976
 
70964
- this.Canvas.fillStyle=this.LineColor;
70977
+ if (config.BGColor) this.Canvas.fillStyle=config.BGColor;
70978
+ else this.Canvas.fillStyle=this.LineColor;
70965
70979
  this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
70966
70980
 
70967
70981
  this.Canvas.textAlign="left";
@@ -70979,7 +70993,9 @@ function ChartDrawPictureHorizontalLine()
70979
70993
  rtBG.Top=y-textHeight/2-margin.Top;
70980
70994
  rtBG.Bottom=rtBG.Top+rtBG.Height;
70981
70995
  rtBG.Right=rtBG.Left+rtBG.Width;
70982
- this.Canvas.fillStyle=this.LineColor;
70996
+
70997
+ if (config.BGColor) this.Canvas.fillStyle=config.BGColor;
70998
+ else this.Canvas.fillStyle=this.LineColor;
70983
70999
  this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
70984
71000
 
70985
71001
  this.Canvas.textAlign="left";
@@ -70997,6 +71013,7 @@ function ChartDrawPictureHorizontalLine()
70997
71013
 
70998
71014
  var isHScreen=this.Frame.IsHScreen;
70999
71015
  var config=this.InsideLabelConfig;
71016
+ if (!config.IsShow) return;
71000
71017
  if (config.Position!=0 && config.Position!=1) return;
71001
71018
  var margin=config.Margin;
71002
71019
 
@@ -109418,27 +109435,26 @@ function JSDivFrameToolbar()
109418
109435
  HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
109419
109436
  }
109420
109437
 
109421
- this.AryButton=
109422
- [
109423
- {
109424
- ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
109425
- Span:null, Div:null, TooltipSpan:null
109426
- },
109427
- {
109428
- ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
109429
- Span:null,Div:null, TooltipSpan:null
109430
- },
109431
- {
109432
- ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
109433
- Span:null,Div:null, TooltipSpan:null
109434
- },
109435
- {
109436
- ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109437
- Span:null,Div:null, TooltipSpan:null
109438
- },
109439
- ];
109438
+ this.AryButton=[]; //按钮数组
109440
109439
 
109441
- this.SetToolbar=function(aryButton)
109440
+ //创建按钮
109441
+ this.CreateArrayButton=function(aryButton)
109442
+ {
109443
+ for(var i=0;i<aryButton.length; i++)
109444
+ {
109445
+ var item=aryButton[i];
109446
+ if (!item.ID || !item.ClassName) continue;
109447
+ var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109448
+ if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109449
+
109450
+ this.AryButton.push(newItem);
109451
+
109452
+ if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
109453
+ }
109454
+ }
109455
+
109456
+ //清空原来的按钮
109457
+ this.ClearAllButtons=function()
109442
109458
  {
109443
109459
  //清空原来的按钮
109444
109460
  for(var i=0; i<this.AryButton.length; i++)
@@ -109449,24 +109465,75 @@ function JSDivFrameToolbar()
109449
109465
  item.Span=null;
109450
109466
  item.TooltipSpan=null;
109451
109467
  }
109468
+
109452
109469
  this.AryButton=[];
109470
+ }
109453
109471
 
109454
- //重新创建
109455
- for(var i=0;i<aryButton.length; i++)
109472
+ this.GetShowButtons=function(subFrame)
109473
+ {
109474
+ var frame=subFrame;
109475
+ if (!frame && this.FrameID>=0 && this.FrameID<this.HQChart.Frame.SubFrame.length)
109476
+ frame=this.HQChart.Frame.SubFrame[this.FrameID].Frame;
109477
+
109478
+ var aryDefaultButton=JSDivFrameToolbar.GetDfaultButtons();
109479
+ var aryButton=[];
109480
+ for(var i=0;i<aryDefaultButton.length; i++)
109456
109481
  {
109457
- var item=aryButton[i];
109458
- if (!item.ID || !item.ClassName) continue;
109459
- var newItem={ ID:item.ID, ClassName:item.ClassName, Span:null,Div:null, TooltipSpan:null };
109460
- if (item.Tooltip && item.Tooltip.Text) newItem.Tooltip={ Text:item.Tooltip.Text };
109482
+ var item=aryDefaultButton[i];
109483
+ if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
109461
109484
 
109462
- this.AryButton.push(newItem);
109485
+ if (item.ID==JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM && frame && frame.ModifyIndex===false) continue;
109486
+ if (item.ID==JSCHART_BUTTON_ID.CHANGE_INDEX && frame && frame.ChangeIndex===false) continue;
109487
+ if (item.ID==JSCHART_BUTTON_ID.OVERLAY_INDEX && frame && frame.OverlayIndex===false) continue;
109488
+ if (item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW && frame && frame.CloseIndex===false) continue;
109463
109489
 
109464
- if (this.DivToolbar) this.CreateButton(newItem, this.DivToolbar);
109490
+ aryButton.push(item);
109465
109491
  }
109466
109492
 
109493
+ return aryButton;
109494
+ }
109495
+
109496
+ this.SetToolbar=function(aryButton)
109497
+ {
109498
+ this.ClearAllButtons(); //清空原来的按钮
109499
+
109500
+ this.CreateArrayButton(aryButton); //重新创建
109501
+
109467
109502
  this.UpdateStyle();
109468
109503
  }
109469
109504
 
109505
+ this.UpdateButton=function()
109506
+ {
109507
+ if (!this.DivToolbar) return;
109508
+
109509
+ var aryButton=this.GetShowButtons();
109510
+ var bChange=false;
109511
+ if (aryButton.length!=this.AryButton.length)
109512
+ {
109513
+ bChange=true;
109514
+ }
109515
+ else
109516
+ {
109517
+ for(var i=0;i<this.AryButton.length;++i)
109518
+ {
109519
+ var leftItem=this.AryButton[i];
109520
+ var rightItem=aryButton[i];
109521
+
109522
+ if (leftItem.ID!=rightItem.ID || leftItem.ClassName!=rightItem.ClassName)
109523
+ {
109524
+ bChange=true;
109525
+ break;
109526
+ }
109527
+ }
109528
+ }
109529
+
109530
+ if (!bChange) return;
109531
+
109532
+ this.SetToolbar(aryButton); //重新设置按钮
109533
+ }
109534
+
109535
+
109536
+
109470
109537
  this.Destroy=function()
109471
109538
  {
109472
109539
  if (this.DivToolbar)
@@ -109480,24 +109547,19 @@ function JSDivFrameToolbar()
109480
109547
  this.FrameID=-1;
109481
109548
  }
109482
109549
 
109483
- this.Create=function()
109550
+ this.Create=function(frame)
109484
109551
  {
109485
109552
  var divToolbar=document.createElement("div");
109486
109553
  divToolbar.className='UMyChart_FrameToolbar_Div';
109487
109554
  divToolbar.id=this.ID;
109488
109555
  divToolbar.oncontextmenu = function() { return false; }; //屏蔽右键系统菜单
109556
+ this.DivToolbar=divToolbar;
109489
109557
 
109490
- for(var i=0;i<this.AryButton.length; i++)
109491
- {
109492
- var item=this.AryButton[i];
109493
- if (this.FrameID==0 && item.ID==JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW) continue; //第一个指标窗口不显示关闭按钮
109494
- this.CreateButton(item, divToolbar);
109495
- }
109558
+ var aryButtons=this.GetShowButtons(frame);
109559
+ this.CreateArrayButton(aryButtons)
109496
109560
 
109497
109561
  this.DivHQChart.appendChild(divToolbar);
109498
109562
 
109499
- this.DivToolbar=divToolbar;
109500
-
109501
109563
  this.UpdateStyle();
109502
109564
 
109503
109565
  if (!this.HQChart.JSToolbarTooltip)
@@ -109623,6 +109685,32 @@ function JSDivFrameToolbar()
109623
109685
  }
109624
109686
  }
109625
109687
 
109688
+ JSDivFrameToolbar.GetDfaultButtons=function()
109689
+ {
109690
+ var aryButton=
109691
+ [
109692
+
109693
+ {
109694
+ ID:JSCHART_BUTTON_ID.MODIFY_INDEX_PARAM, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-index_param", Tooltip:{ Text:"修改参数"},
109695
+ Span:null, Div:null, TooltipSpan:null
109696
+ },
109697
+ {
109698
+ ID:JSCHART_BUTTON_ID.CHANGE_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-change_index", Tooltip:{ Text:"切换指标"},
109699
+ Span:null,Div:null, TooltipSpan:null
109700
+ },
109701
+ {
109702
+ ID:JSCHART_BUTTON_ID.OVERLAY_INDEX, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-overlay_index", Tooltip:{ Text:"叠加指标"},
109703
+ Span:null,Div:null, TooltipSpan:null
109704
+ },
109705
+ {
109706
+ ID:JSCHART_BUTTON_ID.CLOSE_INDEX_WINDOW, ClassName:"UMyChart_FrameToolbar_Span_Button icon iconfont icon-close", Tooltip:{ Text:"关闭窗口"},
109707
+ Span:null,Div:null, TooltipSpan:null
109708
+ },
109709
+ ];
109710
+
109711
+ return aryButton
109712
+ }
109713
+
109626
109714
 
109627
109715
  function JSToolbarTooltip()
109628
109716
  {
@@ -165499,7 +165587,7 @@ function HQChartScriptWorker()
165499
165587
 
165500
165588
 
165501
165589
 
165502
- var HQCHART_VERSION="1.1.15065";
165590
+ var HQCHART_VERSION="1.1.15072";
165503
165591
 
165504
165592
  function PrintHQChartVersion()
165505
165593
  {