hqchart 1.1.13245 → 1.1.13251

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.
@@ -1986,8 +1986,7 @@ case JSCHART_MENU_ID.CMD_DELETE_TRADE_INDEX_ID://删除专家系统(交易指标
1986
1986
  if(this.CancelInstructionIndex)this.CancelInstructionIndex();break;case JSCHART_MENU_ID.CMD_CHANGE_KLINE_TYPE_ID://切换K线类型
1987
1987
  if(this.ChangeKLineDrawType&&param!=null)this.ChangeKLineDrawType(param,aryArgs[1],aryArgs[2]);break;case JSCHART_MENU_ID.CMD_CHANGE_PRICE_GAP_ID://缺口提示
1988
1988
  if(this.ChangePriceGap&&IFrameSplitOperator.IsBool(aryArgs[0])){if(aryArgs[0]==false){this.ChangePriceGap({Enable:aryArgs[0]});}else{if(IFrameSplitOperator.IsNumber(aryArgs[1]))this.ChangePriceGap({Enable:aryArgs[0],Count:aryArgs[1]});}}break;case JSCHART_MENU_ID.CMD_OVERLAY_SYMBOL_ID:if(aryArgs[1]===true){if(this.OverlaySymbol&&aryArgs[0])this.OverlaySymbol(aryArgs[0]);}else if(aryArgs[1]===false){if(this.DeleteOverlaySymbol&&aryArgs[0])this.DeleteOverlaySymbol(aryArgs[0]);}break;case JSCHART_MENU_ID.CMD_DELETE_ALL_OVERLAY_SYMBOL_ID:if(this.ClearOverlaySymbol)this.ClearOverlaySymbol();break;case JSCHART_MENU_ID.CMD_CHANGE_COORDINATETYPE_ID:if(this.ChangeCoordinateType&&aryArgs[0])this.ChangeCoordinateType(aryArgs[0]);break;case JSCHART_MENU_ID.CMD_CHANGE_KLINE_INFO_ID:if(aryArgs[0]&&IFrameSplitOperator.IsBool(aryArgs[1])){if(aryArgs[1]==true&&this.AddKLineInfo)this.AddKLineInfo(aryArgs[0],true);else if(aryArgs[1]==false&&this.DeleteKLineInfo)this.DeleteKLineInfo(aryArgs[0]);}break;case JSCHART_MENU_ID.CMD_DELETE_ALL_KLINE_INFO_ID:if(this.ClearKLineInfo)this.ClearKLineInfo();break;case JSCHART_MENU_ID.CMD_CHANGE_DRAG_MODE_ID:if(param!=null)this.DragMode=param;break;case JSCHART_MENU_ID.CMD_CHANGE_BG_SPLIT_ID:if(IFrameSplitOperator.IsBool(srcParam)){if(srcParam){this.CreateExtendChart("SessionBreaksPaint",{});this.Draw();}else{var finder=this.GetExtendChartByClassName("SessionBreaksPaint");if(finder){this.DeleteExtendChartByID(finder.Chart.ID);this.Draw();}}}break;case JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID:if(!this.IsShowDrawToolDialog())this.ShowDrawToolDialog();break;case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:var option={Name:'筹码分布',ShowType:1,Width:230};var extendChart=this.CreateExtendChart(option.Name,option);//创建扩展图形
1989
- this.SetSizeChange(true);this.Draw();break;case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:var StockChip=chart.GetExtendChartByClassName('StockChip');if(StockChip){var chipWidth=StockChip.Chart.Width;var chipIndex=parseInt(StockChip.Index);for(var i=chipIndex+1;i<this.ExtendChartPaint.length;++i)//在筹码后面创建的需要筹码的宽度
1990
- {var item=this.ExtendChartPaint[i];if(item.ClassName=='DrawToolsButton'){item.Left-=chipWidth;}}this.DeleteExtendChart(StockChip);this.Frame.ChartBorder.Right-=chipWidth;this.SetSizeChange(true);this.Draw();}break;case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:if(IFrameSplitOperator.IsBool(srcParam))this.EnableSelectRect=srcParam;break;case JSCHART_MENU_ID.CMD_CHANGE_DAY_COUNT_ID:if(this.ChangeDayCount&&param!=null)this.ChangeDayCount(param);break;case JSCHART_MENU_ID.CMD_SHOW_BEFORE_DATA_ID:if(this.ShowCallAuctionData&&IFrameSplitOperator.IsBool(srcParam))this.ShowCallAuctionData({Left:srcParam,MultiDay:{Left:srcParam}});break;case JSCHART_MENU_ID.CMD_SELECTED_ZOOM_ID:if(this.ShowSelectData&&srcParam)this.ShowSelectData(srcParam);break;case JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID:var dlg=new KLineSelectRectDialog(this.DivElement);dlg.DoModal(srcParam);break;case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID://显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
1989
+ this.SetSizeChange(true);this.Draw();break;case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:var StockChip=this.GetExtendChartByClassName('StockChip');if(StockChip){var chipWidth=StockChip.Chart.Width;this.DeleteExtendChart(StockChip);this.Frame.ChartBorder.Right-=chipWidth;this.SetSizeChange(true);this.Draw();}break;case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:if(IFrameSplitOperator.IsBool(srcParam))this.EnableSelectRect=srcParam;break;case JSCHART_MENU_ID.CMD_CHANGE_DAY_COUNT_ID:if(this.ChangeDayCount&&param!=null)this.ChangeDayCount(param);break;case JSCHART_MENU_ID.CMD_SHOW_BEFORE_DATA_ID:if(this.ShowCallAuctionData&&IFrameSplitOperator.IsBool(srcParam))this.ShowCallAuctionData({Left:srcParam,MultiDay:{Left:srcParam}});break;case JSCHART_MENU_ID.CMD_SELECTED_ZOOM_ID:if(this.ShowSelectData&&srcParam)this.ShowSelectData(srcParam);break;case JSCHART_MENU_ID.CMD_SELECTED_SUMMARY_ID:var dlg=new KLineSelectRectDialog(this.DivElement);dlg.DoModal(srcParam);break;case JSCHART_MENU_ID.CMD_SHOW_INDEX_ID://显示隐藏指标 [0]=windowIndex [1]=0=自动 1=隐藏 2=显示
1991
1990
  if(param==null||!IFrameSplitOperator.IsNumber(aryArgs[1]))return false;var windowIndex=param,showType=aryArgs[1];var script=this.WindowIndex[windowIndex];if(!script)return false;if(showType==1)script.IsShow=false;else if(showType==2)script.IsShow=true;else script.IsShow=!script.IsShow;this.UpdateWindowIndex(windowIndex);break;case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_INDEX_ID://显示隐藏叠加指标 [0]=indexGuid [1]=0=自动 1=隐藏 2=显示
1992
1991
  if(!srcParam||!IFrameSplitOperator.IsNumber(aryArgs[1]))return false;var indexGuid=srcParam,showType=aryArgs[1];var overlay=this.GetOverlayIndexByIdentify(indexGuid);if(!overlay||!overlay.OverlayItem||!overlay.OverlayItem.Script)return false;var script=overlay.OverlayItem.Script;if(showType==1)script.IsShow=false;else if(showType==2)script.IsShow==true;else script.IsShow=!script.IsShow;this.UpdateOverlayIndex(indexGuid);break;case JSCHART_MENU_ID.CMD_DELETE_OVERLAY_INDEX_ID:if(srcParam&&this.DeleteOverlayWindowsIndex)this.DeleteOverlayWindowsIndex(srcParam);break;case JSCHART_MENU_ID.CMD_SHOW_OVERLAY_Y_AXIS_ID:if(!srcParam||!IFrameSplitOperator.IsNumber(aryArgs[1]))return false;if(!this.GetOverlayIndexByIdentify)return false;var indexGuid=srcParam,showType=aryArgs[1];var finder=this.GetOverlayIndexByIdentify(indexGuid);if(!finder||!finder.OverlayItem)return false;var frame=finder.OverlayItem.Frame;if(showType==1)frame.IsShow=false;else if(showType==2)frame.IsShow==true;else frame.IsShow=!frame.IsShow;this.UpdataDataoffset();//更新数据偏移
1993
1992
  this.UpdateFrameMaxMin();//调整坐标最大 最小值
@@ -2031,6 +2030,7 @@ this.ExtendLine;//延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [
2031
2030
  this.ExtendData;//扩展属性
2032
2031
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
2033
2032
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
2033
+ this.AreaData;//区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
2034
2034
  }//边框信息
2035
2035
  function ChartBorder(){this.UIElement;//四周间距
2036
2036
  this.Left=50;this.Right=80;this.Top=50;this.Bottom=50;this.TitleHeight=24;//标题高度
@@ -2230,7 +2230,14 @@ var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i
2230
2230
  if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0)this.DrawLine(left,textLeft,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}if(item.Type==3||item.Type==4){if(item.Title){var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-itemText.Width-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-textWidth-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var preTextRect=null;if(mapTextRect&&mapTextRect.has(3))preTextRect=mapTextRect.get(3);var yText=y;var rtText={};for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom;//bgTop+=(textWidth-itemText.Width);
2231
2231
  var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Left:right,Right:this.ChartBorder.GetChartWidth(),Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:false};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0&&textInfo.Text.length==0){var textLeft=right;rtText.Left=textLeft;if(preTextRect&&bgTop<preTextRect.Rect.Bottom){yText=preTextRect.Rect.Bottom;bgTop=yText-textHeight/2-1*pixelTatio;}}else{var textLeft=right+textWidth-itemText.Width;}if(item.ExtendLine&&item.ExtendLine[1])//右侧延长线
2232
2232
  {var exLine=item.ExtendLine[1];if(IFrameSplitOperator.IsNumber(exLine.Width)){if(i==0)this.DrawLine(right,textLeft+exLine.Width,y,item.LineColor,item.LineType,item);textLeft+=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(textLeft),ToFixedPoint(bgTop),ToFixedRect(itemText.Width+1),ToFixedRect(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft+2*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,y,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;rtText.Bottom=yText;}}}if(mapTextRect&&IFrameSplitOperator.IsNumber(rtText.Left)&&IFrameSplitOperator.IsNumber(rtText.Bottom)){mapTextRect.set(3,{Rect:rtText,Item:item});}if(item.Type==3||item.Type==4){if(item.Title){var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2233
- var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.SendDrawCountDownEvent=function(sendData){if(!this.GetEventCallback)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_COUNTDOWN);if(!event||!event.Callback)return false;event.Callback(event,sendData,this);return true;};this.DrawDotLine=function(left,right,y,color,option){var pixelTatio=GetDevicePixelRatio();this.Canvas.save();this.Canvas.strokeStyle=color;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth))this.Canvas.lineWidth=option.LineWidth*pixelTatio;if(option.LineDash)this.Canvas.setLineDash(option.LineDash);else this.Canvas.setLineDash([5*pixelTatio,5*pixelTatio]);//虚线
2233
+ var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.DrawCustomAreaItem=function(item)//自定义Y轴区域
2234
+ {if(!item.AreaData)return;if(this.IsHScreen)return;//暂时不支持横屏
2235
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
2236
+ if(!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value)||item.AreaData.Value.length!=2)return;var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);var min=Math.min(item.AreaData.Value[0],item.AreaData.Value[1]);if(min>=this.HorizontalMax)return;if(max<=this.HorizontalMin)return;if(max>this.HorizontalMax)max=this.HorizontalMax;if(min<this.HorizontalMin)min=this.HorizontalMin;var border=this.GetBorder();var left=border.Left;var right=border.Right;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var yTop=this.GetYFromData(max);var yBottom=this.GetYFromData(min);if(item.AreaData.Position.includes(0)&&borderLeft>10)//左
2237
+ {var rtBG={Left:0,Right:left-1,Top:yTop,Bottom:yBottom};rtBG.Height=rtBG.Bottom-rtBG.Top;rtBG.Width=rtBG.Right-rtBG.Left;this.Canvas.fillStyle=item.AreaData.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawCustomAreaText(rtBG,item,0);}if(item.AreaData.Position.includes(1)&&borderRight>10)//右
2238
+ {var rtBG={Left:right+1,Top:yTop,Bottom:yBottom};rtBG.Height=rtBG.Bottom-rtBG.Top;if(this.YRightTextInfo&&IFrameSplitOperator.IsNumber(this.YRightTextInfo.MainTextWidth))//右侧自动调整 可以获取宽度
2239
+ {rtBG.Width=this.YRightTextInfo.MainTextWidth-1;rtBG.Right=rtBG.Left+rtBG.Width;}else{rtBG.Right=border.ChartWidth;rtBG.Width=rtBG.Right-rtBG.Left;}this.Canvas.fillStyle=item.AreaData.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawCustomAreaText(rtBG,item,1);}};this.DrawCustomAreaText=function(rtBG,item,position)//position 0=左 1=右
2240
+ {if(item.Font!=null)this.Canvas.font=item.Font;var fontHeight=this.GetFontHeight();if(rtBG.Height<fontHeight)return;var pixelTatio=GetDevicePixelRatio();var text,xText;if(position==0){if(!item.Message[0])return;this.Canvas.textAlign="right";text=item.Message[0];xText=rtBG.Right-2*pixelTatio;}else if(position==1){if(!item.Message[1])return;this.Canvas.textAlign="left";text=item.Message[1];xText=rtBG.Left+2*pixelTatio;}var yText=rtBG.Top+rtBG.Height/2;this.Canvas.textBaseline="middle";this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(text,xText,yText);};this.SendDrawCountDownEvent=function(sendData){if(!this.GetEventCallback)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_COUNTDOWN);if(!event||!event.Callback)return false;event.Callback(event,sendData,this);return true;};this.DrawDotLine=function(left,right,y,color,option){var pixelTatio=GetDevicePixelRatio();this.Canvas.save();this.Canvas.strokeStyle=color;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth))this.Canvas.lineWidth=option.LineWidth*pixelTatio;if(option.LineDash)this.Canvas.setLineDash(option.LineDash);else this.Canvas.setLineDash([5*pixelTatio,5*pixelTatio]);//虚线
2234
2241
  this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.restore();};this.DrawLine=function(left,right,y,color,lineType,option){if(lineType==-1)return;if(lineType==0){var pixelRatio=GetDevicePixelRatio();this.Canvas.strokeStyle=color;var bChangeLineWidth=false;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth)){this.Canvas.lineWidth=option.LineWidth*pixelRatio;bChangeLineWidth=true;}this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();if(bChangeLineWidth){this.Canvas.lineWidth=pixelRatio;}}else{this.DrawDotLine(left,right,y,color,option);}};this.DrawHScreenText=function(center,data){this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=data.Color;this.Canvas.save();this.Canvas.translate(center.X,center.Y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(data.Text,data.XOffset,data.YOffset);this.Canvas.restore();};this.RGBToStruct=function(rgb){if(/^(rgb|RGB)/.test(rgb)){var aColor=rgb.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");var result={};if(aColor.length!=3)return null;result.R=Number(aColor[0]);result.G=Number(aColor[1]);result.B=Number(aColor[2]);return result;}return null;};this.GetMulitTextMaxWidth=function(aryData){var width=null;for(var i=0;i<aryData.length;++i){var item=aryData[i];var text=item.Text;if(!text)continue;var value=this.Canvas.measureText(text).width;if(width==null)width=value;else if(width<value)width=value;}return width;};this.GetScaleTextWidth=function(){var border=this.ChartBorder.GetBorder();var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
2235
2242
  if(this.IsHScreen){var borderTop=this.ChartBorder.Top;var borderBottom=this.ChartBorder.Bottom;var isDrawLeft=borderTop>10*pixelTatio&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderBottom>10*pixelTatio&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}else{var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var isDrawLeft=borderLeft>10&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderRight>10&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}if(!isDrawRight&&!isDrawLeft)return null;var width={Left:null,Right:null};var rightExtendWidth=0;var isYPercentage=false;//是否是百分比坐标
2236
2243
  if(this.YSplitOperator&&this.YSplitOperator.CoordinateType==1)isYPercentage=true;var leftExtendLineWidth=0;var rightExtendLineWidth=0;if(IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend)){if(this.YLineExtend[0]&&this.YLineExtend[0].Width>1)leftExtendLineWidth=this.YLineExtend[0].Width;if(this.YLineExtend[1]&&this.YLineExtend[1].Width>1)rightExtendLineWidth=this.YLineExtend[1].Width;}for(var i=0;i<this.HorizontalInfo.length;++i){var textWidth=null;var item=this.HorizontalInfo[i];if(!item)continue;if(item.Font!=null)this.Canvas.font=item.Font;if(item.Message[0]!=null&&isDrawLeft){if(Array.isArray(item.Message[0])){textWidth=this.GetMulitTextMaxWidth(item.Message[0]);}else{textWidth=this.Canvas.measureText(item.Message[0]).width;}if(width.Left==null||width.Left<textWidth)width.Left=textWidth;//JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[0]} ${textWidth}`);
@@ -2443,7 +2450,7 @@ case 1://固定价格刻度
2443
2450
  this.DrawCustomItem(item,mapTextRect);break;case 2://当前屏最后一个K线价格刻度
2444
2451
  case 3://主图K线涨幅刻度
2445
2452
  case 4://叠加K线涨幅刻度
2446
- this.DrawCustomItem(item,mapTextRect);break;}}};this.DrawCustomVerticalItem=function(item){this.Canvas.save();if(item.Data.Line.Type==1)this.Canvas.setLineDash([5,5]);//虚线
2453
+ this.DrawCustomItem(item,mapTextRect);break;case 5:this.DrawCustomAreaItem(item);break;}}};this.DrawCustomVerticalItem=function(item){this.Canvas.save();if(item.Data.Line.Type==1)this.Canvas.setLineDash([5,5]);//虚线
2447
2454
  this.Canvas.strokeStyle=item.Data.Line.Color;this.Canvas.beginPath();if(item.IsHScreen){this.Canvas.moveTo(item.Top,ToFixedPoint(item.X));this.Canvas.lineTo(item.Bottom,ToFixedPoint(item.X));}else{this.Canvas.moveTo(ToFixedPoint(item.X),item.Top);this.Canvas.lineTo(ToFixedPoint(item.X),item.Bottom);}this.Canvas.stroke();this.Canvas.restore();};this.DrawCustomVertical=function()//X轴定制刻度显示
2448
2455
  {if(!this.CustomVerticalInfo)return;if(this.CustomVerticalInfo.length<=0)return;if(!this.Data)return;var isHScreen=this.IsHScreen;var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();var dataWidth=this.DataWidth;var distanceWidth=this.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+2.0;if(isHScreen){xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+2.0;top=this.ChartBorder.GetLeftEx();bottom=this.ChartBorder.GetRightEx();}var j=0;for(var i=this.Data.DataOffset;i<this.Data.Data.length&&j<this.XPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var kItem=this.Data.Data[i];for(var k in this.CustomVerticalInfo){var item=this.CustomVerticalInfo[k];if(item.Type!=0)continue;if(IFrameSplitOperator.IsNumber(item.Time)){if(kItem.Date!=item.Date||kItem.Time!=item.Time)continue;}else{if(kItem.Date!=item.Date)continue;}var left=xOffset;var right=xOffset+dataWidth;var x=left+(right-left)/2;var DrawData={X:x,Top:top,Bottom:bottom,Data:item,IsHScreen:isHScreen};this.DrawCustomVerticalItem(DrawData);if(this.DrawCustomVerticalEvent)this.DrawCustomVerticalEvent.Callback(this.DrawCustomVerticalEvent,DrawData,this);break;}}for(var i=1;j<this.XPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){for(var k in this.CustomVerticalInfo){var item=this.CustomVerticalInfo[k];if(item.Type!=1)continue;if(item.Space!=i)continue;var left=xOffset;var right=xOffset+dataWidth;var x=left+(right-left)/2;var DrawData={X:x,Top:top,Bottom:bottom,Data:item,IsHScreen:isHScreen};this.DrawCustomVerticalItem(DrawData);if(this.DrawCustomVerticalEvent)this.DrawCustomVerticalEvent.Callback(this.DrawCustomVerticalEvent,DrawData,this);break;}}};this.DrawSelectedBorder=function(option){if(this.Identify===0)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var height=bottom-top;this.Canvas.strokeStyle=this.SelBorderColor;if(option.Mode==1){var xRight=ToFixedPoint(border.ChartWidth);this.Canvas.strokeRect(right,top,xRight-right-1,height);//少一个像素让边框显示出来
2449
2456
  }else{this.Canvas.strokeRect(left,top,right-left-1,height);//少一个像素让边框显示出来
@@ -13130,13 +13137,13 @@ this.SelectedClassName="UMyChart_MenuItem_Tr_Selected";this.AryTDClassName=["UMy
13130
13137
  "UMyChart_MenuItem_Td_Arrow"//箭头
13131
13138
  ];this.Inital=function(){var _this67=this;window.addEventListener('mousedown',function(e){_this67.OnWindowMouseDown(e);});};//创建菜单
13132
13139
  this.CreatePopMenu=function(data){this.Clear();if(!IFrameSplitOperator.IsNonEmptyArray(data.Menu))return;var root=document.createElement("div");root.className="UMyChart_PopMenu";var table=document.createElement("table");table.className="UMyChart_PopMenu_Table";root.appendChild(table);var tbody=document.createElement("tbody");tbody.className="UMyChart_PopMenu_Tbody";table.appendChild(tbody);var rootData={Root:root,TBody:tbody,Table:table};for(var i=0;i<data.Menu.length;++i){var item=data.Menu[i];if(item.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)tbody.appendChild(trSeparator);continue;}var trDom=this.CreateMenu(rootData,item);tbody.appendChild(trDom);}document.body.appendChild(root);this.RootDOM=root;this.TBodyDOM=tbody;if(IFrameSplitOperator.IsNumber(data.Position))this.Data.Position=data.Position;if(data.ClickCallback)this.ClickCallback=data.ClickCallback;};//清除菜单
13133
- this.Clear=function(){this.Data.Menu=[];this.Data.Position=JSPopMenu.POSITION_ID.RIGHT_MENU_ID;this.ClickCallback=null;if(!this.RootDOM)return;document.body.removeChild(this.RootDOM);this.RootDOM=null;this.TBodyDOM=null;for(var i=0;i<this.ArySubRootDOM.length;++i){document.body.removeChild(this.ArySubRootDOM[i]);}this.ArySubRootDOM=[];};this.CreateMenu=function(parentItem,item){var _this68=this;var trDom=document.createElement("tr");trDom.className='UMyChart_MenuItem_Tr';var prtTdDom=null;for(var i=0;i<this.AryTDClassName.length;++i){var tdDom=document.createElement("td");tdDom.className=this.AryTDClassName[i];if(i==0)//图标
13140
+ this.Clear=function(){this.Data.Menu=[];this.Data.Position=JSPopMenu.POSITION_ID.RIGHT_MENU_ID;this.ClickCallback=null;if(!this.RootDOM)return;document.body.removeChild(this.RootDOM);this.RootDOM=null;this.TBodyDOM=null;for(var i=0;i<this.ArySubRootDOM.length;++i){document.body.removeChild(this.ArySubRootDOM[i]);}this.ArySubRootDOM=[];};this.CreateMenu=function(parentItem,item){var _this68=this;var trDom=document.createElement("tr");trDom.className='UMyChart_MenuItem_Tr';if(item.Disable===true)trDom.classList.add('UMyChart_DrawTool_Disable_Tr');var prtTdDom=null;for(var i=0;i<this.AryTDClassName.length;++i){var tdDom=document.createElement("td");tdDom.className=this.AryTDClassName[i];if(i==0)//图标
13134
13141
  {if(item.Checked){var spanDom=document.createElement("span");spanDom.className=this.CheckedClassName;spanDom.style["font-size"]="10px";tdDom.appendChild(spanDom);}}else if(i==1)//内容
13135
13142
  {tdDom.innerText=item.Name;}else if(i==2)//快捷方式
13136
13143
  {}else if(i==3)//箭头
13137
13144
  {if(IFrameSplitOperator.IsNonEmptyArray(item.SubMenu)){var spanDom=document.createElement("span");spanDom.className=this.RightArrowClassName;spanDom.style["font-size"]="10px";tdDom.appendChild(spanDom);}}trDom.appendChild(tdDom);}if(IFrameSplitOperator.IsNonEmptyArray(item.SubMenu))//子菜单
13138
- {var subRoot=document.createElement("div");subRoot.className="UMyChart_PopSubMenu";var subTable=document.createElement("table");subTable.className="UMyChart_PopMenu_Table";subRoot.appendChild(subTable);var subTbody=document.createElement("tbody");subTbody.className="UMyChart_PopMenu_TBody";subTable.appendChild(subTbody);var subRootData={Root:subRoot,TBody:subTbody,Table:subTable};var preTrDom=null;for(var i=0;i<item.SubMenu.length;++i){var subItem=item.SubMenu[i];if(subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)subTbody.appendChild(trSeparator);continue;}var subTrDom=this.CreateMenu(subRootData,subItem);preTrDom=subTrDom;subTbody.appendChild(subTrDom);}trDom.onmouseover=function(e){_this68.OnMouseOver(e,parentItem,trDom,subRoot);};document.body.appendChild(subRoot);this.ArySubRootDOM.push(subRoot);}else{trDom.onmousedown=function(e){_this68.OnClickMenu(e,item,false);};//菜单点击
13139
- trDom.onmouseover=function(e){_this68.OnMouseOver(e,parentItem);};}return trDom;};this.CreateSeparatorTr=function(){var trSeparator=document.createElement("tr");trSeparator.className='UMyChart_MenuItem_Tr_Separator';var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Status_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);return trSeparator;};//弹tab菜单
13145
+ {var subRoot=document.createElement("div");subRoot.className="UMyChart_PopSubMenu";var subTable=document.createElement("table");subTable.className="UMyChart_PopMenu_Table";subRoot.appendChild(subTable);var subTbody=document.createElement("tbody");subTbody.className="UMyChart_PopMenu_TBody";subTable.appendChild(subTbody);var subRootData={Root:subRoot,TBody:subTbody,Table:subTable};var preTrDom=null;for(var i=0;i<item.SubMenu.length;++i){var subItem=item.SubMenu[i];if(subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)subTbody.appendChild(trSeparator);continue;}var subTrDom=this.CreateMenu(subRootData,subItem);preTrDom=subTrDom;subTbody.appendChild(subTrDom);}trDom.onmouseover=function(e){_this68.OnMouseOver(e,parentItem,trDom,subRoot);};document.body.appendChild(subRoot);this.ArySubRootDOM.push(subRoot);}else{if(item.Disable===true){}else{trDom.onmousedown=function(e){_this68.OnClickMenu(e,item,false);};//菜单点击
13146
+ trDom.onmouseover=function(e){_this68.OnMouseOver(e,parentItem);};}}return trDom;};this.CreateSeparatorTr=function(){var trSeparator=document.createElement("tr");trSeparator.className='UMyChart_MenuItem_Tr_Separator';var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Status_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);return trSeparator;};//弹tab菜单
13140
13147
  this.PopupMenuByTab=function(rtTab){if(!this.RootDOM)return;if(!rtTab)return;var xLeft=rtTab.Left;var yTop=rtTab.Top-this.RootDOM.offsetHeight;this.RootDOM.style.visibility='visible';this.RootDOM.style.top=yTop+"px";this.RootDOM.style.left=xLeft+"px";};//弹右键菜单
13141
13148
  this.PopupMenuByRight=function(x,y){if(!this.RootDOM)return;if(!IFrameSplitOperator.IsNumber(x)||!IFrameSplitOperator.IsNumber(y))return;//菜单在当前屏幕无法显示需要调整
13142
13149
  var menuHeight=this.RootDOM.offsetHeight;var yMenuBottom=y+menuHeight;var yBottom=window.innerHeight-15;if(yMenuBottom>yBottom)y=yBottom-menuHeight;var menuWidth=this.RootDOM.offsetWidth;var yMenuRight=x+menuWidth;var yRight=window.innerWidth-15;if(yMenuRight>yRight)x=yRight-menuWidth;this.RootDOM.style.visibility='visible';this.RootDOM.style.top=y+"px";this.RootDOM.style.left=x+"px";};//下拉菜单
@@ -13187,7 +13194,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13187
13194
  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);};}/********************************************************************************
13188
13195
  * 版本信息输出
13189
13196
  *
13190
- */var HQCHART_VERSION="1.1.13244";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13197
+ */var HQCHART_VERSION="1.1.13250";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13191
13198
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13192
13199
  // BaseIndex:BaseIndex,
13193
13200
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13245",
3
+ "version": "1.1.13251",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -9257,19 +9257,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9257
9257
  this.Draw();
9258
9258
  break;
9259
9259
  case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
9260
- var StockChip=chart.GetExtendChartByClassName('StockChip');
9260
+ var StockChip=this.GetExtendChartByClassName('StockChip');
9261
9261
  if (StockChip)
9262
9262
  {
9263
9263
  var chipWidth=StockChip.Chart.Width;
9264
- var chipIndex=parseInt(StockChip.Index);
9265
- for(var i=chipIndex+1; i<this.ExtendChartPaint.length; ++i) //在筹码后面创建的需要筹码的宽度
9266
- {
9267
- var item=this.ExtendChartPaint[i];
9268
- if (item.ClassName=='DrawToolsButton')
9269
- {
9270
- item.Left-=chipWidth;
9271
- }
9272
- }
9273
9264
  this.DeleteExtendChart(StockChip);
9274
9265
  this.Frame.ChartBorder.Right-=chipWidth;
9275
9266
  this.SetSizeChange(true);
@@ -9641,6 +9632,7 @@ function CoordinateInfo()
9641
9632
  this.ExtendData; //扩展属性
9642
9633
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
9643
9634
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
9635
+ this.AreaData; //区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
9644
9636
  }
9645
9637
 
9646
9638
 
@@ -12155,6 +12147,91 @@ function AverageWidthFrame()
12155
12147
  }
12156
12148
  }
12157
12149
 
12150
+ this.DrawCustomAreaItem=function(item) //自定义Y轴区域
12151
+ {
12152
+ if (!item.AreaData) return;
12153
+ if (this.IsHScreen) return; //暂时不支持横屏
12154
+
12155
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
12156
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value) || item.AreaData.Value.length!=2) return;
12157
+
12158
+ var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);
12159
+ var min=Math.min(item.AreaData.Value[0],item.AreaData.Value[1]);
12160
+ if (min>=this.HorizontalMax) return;
12161
+ if (max<=this.HorizontalMin) return;
12162
+
12163
+ if (max>this.HorizontalMax) max=this.HorizontalMax;
12164
+ if (min<this.HorizontalMin) min=this.HorizontalMin;
12165
+
12166
+ var border=this.GetBorder();
12167
+ var left=border.Left;
12168
+ var right=border.Right;
12169
+ var borderRight = this.ChartBorder.Right;
12170
+ var borderLeft = this.ChartBorder.Left;
12171
+
12172
+ var yTop=this.GetYFromData(max);
12173
+ var yBottom=this.GetYFromData(min);
12174
+
12175
+ if (item.AreaData.Position.includes(0) && borderLeft>10) //左
12176
+ {
12177
+ var rtBG={ Left:0, Right:left-1, Top:yTop, Bottom:yBottom };
12178
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
12179
+ rtBG.Width=rtBG.Right-rtBG.Left;
12180
+ this.Canvas.fillStyle=item.AreaData.BGColor;
12181
+ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
12182
+ this.DrawCustomAreaText(rtBG, item, 0);
12183
+ }
12184
+
12185
+ if (item.AreaData.Position.includes(1) && borderRight>10) //右
12186
+ {
12187
+ var rtBG={ Left:right+1, Top:yTop, Bottom:yBottom };
12188
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
12189
+ if (this.YRightTextInfo && IFrameSplitOperator.IsNumber(this.YRightTextInfo.MainTextWidth)) //右侧自动调整 可以获取宽度
12190
+ {
12191
+ rtBG.Width=this.YRightTextInfo.MainTextWidth-1;
12192
+ rtBG.Right=rtBG.Left+rtBG.Width;
12193
+ }
12194
+ else
12195
+ {
12196
+ rtBG.Right=border.ChartWidth;
12197
+ rtBG.Width=rtBG.Right-rtBG.Left;
12198
+ }
12199
+
12200
+ this.Canvas.fillStyle=item.AreaData.BGColor;
12201
+ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
12202
+ this.DrawCustomAreaText(rtBG, item, 1);
12203
+ }
12204
+ }
12205
+
12206
+ this.DrawCustomAreaText=function(rtBG, item, position) //position 0=左 1=右
12207
+ {
12208
+ if (item.Font != null) this.Canvas.font = item.Font;
12209
+ var fontHeight=this.GetFontHeight();
12210
+ if (rtBG.Height<fontHeight) return;
12211
+
12212
+ var pixelTatio = GetDevicePixelRatio();
12213
+ var text, xText;
12214
+ if (position==0)
12215
+ {
12216
+ if (!item.Message[0]) return;
12217
+ this.Canvas.textAlign = "right";
12218
+ text=item.Message[0];
12219
+ xText=rtBG.Right-2*pixelTatio;
12220
+ }
12221
+ else if (position==1)
12222
+ {
12223
+ if (!item.Message[1]) return;
12224
+ this.Canvas.textAlign = "left";
12225
+ text=item.Message[1];
12226
+ xText=rtBG.Left+2*pixelTatio
12227
+ }
12228
+
12229
+ var yText=rtBG.Top+rtBG.Height/2;
12230
+ this.Canvas.textBaseline = "middle";
12231
+ this.Canvas.fillStyle = item.TextColor;
12232
+ this.Canvas.fillText(text, xText, yText);
12233
+ }
12234
+
12158
12235
  this.SendDrawCountDownEvent=function(sendData)
12159
12236
  {
12160
12237
  if (!this.GetEventCallback) return false;
@@ -15706,6 +15783,9 @@ function KLineFrame()
15706
15783
  case 4: //叠加K线涨幅刻度
15707
15784
  this.DrawCustomItem(item, mapTextRect);
15708
15785
  break;
15786
+ case 5:
15787
+ this.DrawCustomAreaItem(item);
15788
+ break;
15709
15789
  }
15710
15790
  }
15711
15791
  }
@@ -72814,7 +72894,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72814
72894
 
72815
72895
  { Name:"背景分割", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_BG_SPLIT_ID, Args:[!bBGSpit]}, Checked:bBGSpit},
72816
72896
 
72817
- { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
72897
+ { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
72818
72898
 
72819
72899
  { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
72820
72900
  ]
@@ -103,6 +103,8 @@ function JSPopMenu()
103
103
  {
104
104
  var trDom=document.createElement("tr");
105
105
  trDom.className='UMyChart_MenuItem_Tr';
106
+
107
+ if (item.Disable===true) trDom.classList.add('UMyChart_DrawTool_Disable_Tr');
106
108
 
107
109
  var prtTdDom=null;
108
110
  for(var i=0;i<this.AryTDClassName.length;++i)
@@ -178,8 +180,15 @@ function JSPopMenu()
178
180
  }
179
181
  else
180
182
  {
181
- trDom.onmousedown=(e)=> { this.OnClickMenu(e, item, false); }; //菜单点击
182
- trDom.onmouseover=(e)=>{ this.OnMouseOver(e, parentItem); }
183
+ if (item.Disable===true)
184
+ {
185
+
186
+ }
187
+ else
188
+ {
189
+ trDom.onmousedown=(e)=> { this.OnClickMenu(e, item, false); }; //菜单点击
190
+ trDom.onmouseover=(e)=>{ this.OnMouseOver(e, parentItem); }
191
+ }
183
192
  }
184
193
 
185
194
  return trDom;
@@ -313,6 +322,8 @@ function JSPopMenu()
313
322
  subMenu.style.left=`${x}px`;
314
323
  subMenu.style.top=`${y}px`;
315
324
 
325
+
326
+
316
327
  trDom.classList.add(this.SelectedClassName);
317
328
 
318
329
  /*
@@ -1241,6 +1241,12 @@ input[type="color"] {
1241
1241
  height:20px;
1242
1242
  }
1243
1243
 
1244
+ .UMyChart_DrawTool_Disable_Tr
1245
+ {
1246
+ pointer-events: none;
1247
+ color:rgb(169,169,169)
1248
+ }
1249
+
1244
1250
  .UMyChart_MenuItem_Tr_Separator
1245
1251
  {
1246
1252
  height:5px;
@@ -60,6 +60,12 @@
60
60
  height:20px;
61
61
  }
62
62
 
63
+ .UMyChart_DrawTool_Disable_Tr
64
+ {
65
+ pointer-events: none;
66
+ color:rgb(169,169,169)
67
+ }
68
+
63
69
  .UMyChart_DrawTool_Span_Selected
64
70
  {
65
71
  background: rgb(128,128,128);