hqchart 1.1.15154 → 1.1.15158

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.
@@ -1707,7 +1707,7 @@ ON_REPORT_SHOW_TOOLTIP:175,//报价列表 提示信息\
1707
1707
  ON_FORMAT_TVLONGPOSITION_LABEL:176,ON_FORMAT_COUNTDOWN_TEXT:177,//倒计时
1708
1708
  ON_CLICK_INDEX_LOCK:178,//点击指标锁
1709
1709
  ON_CORSSCURSOR_STATUS_CHANGE:179,//十字光标状态改变
1710
- ON_FORMAT_DRAW_HLINE_LABEL:180//画图工具-水平线(ChartDrawPictureHorizontalLine)格式化标签文字
1710
+ ON_BEFORE_DRAW_HLINE:180//画图工具-水平线(ChartDrawPictureHorizontalLine) 绘图前
1711
1711
  };var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
1712
1712
  OP_SCROLL_RIGHT:2,//往右移动
1713
1713
  OP_ZOOM_OUT:3,//缩小
@@ -2869,7 +2869,7 @@ var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i
2869
2869
  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);
2870
2870
  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])//右侧延长线
2871
2871
  {var exLine=item.ExtendLine[1];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2872
- if(i==0)this.DrawLine(right,textLeft+exLine.Width,y,item.LineColor,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);if(item.ClickData)//点击事件
2872
+ if(i==0)this.DrawLine(right,textLeft+exLine.Width,y,item.LineColor,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{var textBGColor=item.LineColor;if(itemText.BGColor)textBGColor=itemText.BGColor;this.Canvas.fillStyle=textBGColor;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);if(item.ClickData)//点击事件
2873
2873
  this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);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+')';//内部刻度 背景增加透明度
2874
2874
  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.AddHorizontalLabel=function(left,top,width,height,item,lineID){var rtLabel={Left:left,Top:top,Width:width,Height:height};rtLabel.Right=rtLabel.Left+rtLabel.Width;rtLabel.Bottom=rtLabel.Top+rtLabel.Height;var lableItem={Rect:rtLabel,Item:item,ID:item.ClickData.ID,Args:item.ClickData.Args,LineID:lineID};this.HorizontalLabel.push(lableItem);};this.DrawCustomAreaItem=function(item)//自定义Y轴区域
2875
2875
  {if(!item.AreaData)return;if(this.IsHScreen)return;//暂时不支持横屏
@@ -3125,7 +3125,8 @@ this.DrawVertical=function(){var border=this.ChartBorder.GetBorder();var top=bor
3125
3125
  {if(!this.IsShow&&!this.IsYDrawMainFrame)return;if(!item.Message[1]&&!item.Message[0])return;if(item.Value>this.HorizontalMax||item.Value<this.HorizontalMin){//this.DrawOutRangeCustomItem(item, mapTextRect);
3126
3126
  this.SendDrawCountDownEvent({IsShow:false});return;}var border=this.GetBorder();var left=border.Left;var right=border.Right+this.RightOffset;if(this.IsYDrawMainFrame)right=border.Right;var bottom=border.Bottom;var top=border.Top;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var titleHeight=this.ChartBorder.TitleHeight;if(this.IsHScreen){borderLeft=this.ChartBorder.Top;borderRight=this.ChartBorder.Bottom;top=border.Top;bottom=border.Bottom;}var pixelTatio=GetDevicePixelRatio();var defaultTextHeight=18*pixelTatio;var textHeight=defaultTextHeight;var y=this.GetYFromData(item.Value);var position=0;var emptyBGColor;if(item.ExtendData&&item.ExtendData.Custom){var customItem=item.ExtendData.Custom;if(IFrameSplitOperator.IsNumber(customItem.Position))position=customItem.Position;if(customItem.EmptyBGColor)emptyBGColor=customItem.EmptyBGColor;}if(item.Message[0])// 左
3127
3127
  {if(borderLeft<10||position==1){if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
3128
- var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=top;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;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(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=left+1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0)this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){if(i==0)var bgTop=top-itemText.Width;else var bgTop=top-textWidth;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(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var rectLeft=left-itemText.Width;var textLeft=left;}else{var rectLeft=left-textWidth;var textLeft=left-(textWidth-itemText.Width);}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
3128
+ var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=top;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;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(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=left+1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0)this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){if(i==0)var bgTop=top-itemText.Width;else var bgTop=top-textWidth;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(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var rectLeft=left-itemText.Width;var textLeft=left;}else{var rectLeft=left-textWidth;var textLeft=left-(textWidth-itemText.Width);}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;//if (itemText.BGColor) this.Canvas.fillStyle=itemText.BGColor;
3129
+ this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
3129
3130
  {if(borderRight<10||position==1){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 bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
3130
3131
  var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom-itemText.Width;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,textWidth);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,Right:right,Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:true};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=right-itemText.Width;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textWidth,textHeight);//文本背景区域
3131
3132
  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);
@@ -3417,7 +3418,7 @@ for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j]
3417
3418
  if(this.ChartBorder.UIElement){this.Position={X:this.ChartBorder.UIElement.offsetLeft,Y:this.ChartBorder.UIElement.offsetTop,W:this.ChartBorder.UIElement.clientWidth,H:this.ChartBorder.UIElement.clientHeight};}};this.SetBeforeDrawXYCallback=function(callback){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];item.Frame.BeforeDrawXYCallback=callback;}};//图形快照
3418
3419
  this.Snapshot=function(){this.ScreenImageData=this.Canvas.getImageData(0,0,this.ChartBorder.GetChartWidth(),this.ChartBorder.GetChartHeight());};this.GetXData=function(x){return this.SubFrame[0].Frame.GetXData(x);};this.GetYData=function(y,outObject)//outObject 可以保存返回的额外数据
3419
3420
  {var frame;for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];var left=item.Frame.ChartBorder.GetLeft();var top=item.Frame.ChartBorder.GetTopEx();var width=item.Frame.ChartBorder.GetWidth();var height=item.Frame.ChartBorder.GetHeightEx();item.Frame.Canvas.beginPath();item.Frame.Canvas.rect(left,top,width,height);if(item.Frame.Canvas.isPointInPath(left,y)){frame=item.Frame;if(outObject)outObject.FrameID=i;break;}}if(frame!=null){if(frame.RightFrame)outObject.RightYValue=frame.RightFrame.GetYData(y);//右侧子坐标
3420
- var yValue=frame.GetYData(y);if(frame.YSplitOperator.CoordinateType==1)//百分比坐标 右边显示百分比信息
3421
+ var yValue=frame.GetYData(y);if(frame.YSplitOperator.CoordinateType==1&&frame.YSplitOperator.GetFirstOpenPrice)//百分比坐标 右边显示百分比信息(K线才有)
3421
3422
  {var firstOpenPrice=frame.YSplitOperator.GetFirstOpenPrice();outObject.RightYValue=((yValue-firstOpenPrice)/firstOpenPrice*100).toFixed(2)+'%';}if(frame.GetMainOverlayFrame){var aryOverlayFrame=frame.GetMainOverlayFrame();if(aryOverlayFrame){if(aryOverlayFrame[0])//左侧
3422
3423
  {var leftFrame=aryOverlayFrame[0];var value=leftFrame.GetYData(y);outObject.RightYValue=yValue;yValue=value;}if(aryOverlayFrame[1])//右侧
3423
3424
  {var rightFrame=aryOverlayFrame[1];var value=rightFrame.GetYData(y);outObject.RightYValue=value;}}}return yValue;}};this.PtInFrame=function(x,y)//鼠标哪个指标窗口
@@ -6770,9 +6771,9 @@ IsShow:true};this.LabelTitle;this.SetOption=function(option){if(this.Super_SetOp
6770
6771
 
6771
6772
  return this.PointRange(drawPoint);
6772
6773
  }
6773
- */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);//画点
6774
- this.DrawPoint(drawPoint);this.FormatLabelTextEvent(drawPoint);//显示价格
6775
- this.DrawInsideLabel(drawPoint[0]);this.Canvas.restore();this.DrawValueLabel(drawPoint[0]);};this.FormatLabelTextEvent=function(point){if(!this.HQChart)return;var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DRAW_HLINE_LABEL);if(!event||!event.Callback)return;var sendData={ID:this.Guid,LabelConfig:this.LabelConfig,InsideLabelConfig:this.InsideLabelConfig};event.Callback(event,sendData,this);};this.DrawValueLabel=function(point){if(!point)return;if(this.Frame.IsHScreen)return;//不支持横屏
6774
+ */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;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();}var eventData=this.BeforeDrawEvent(drawPoint[0]);if(eventData&&!eventData.IsShow)return;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);//画点
6775
+ this.DrawPoint(drawPoint);//显示价格
6776
+ this.DrawInsideLabel(drawPoint[0]);this.Canvas.restore();this.DrawValueLabel(drawPoint[0]);};this.BeforeDrawEvent=function(point){if(!this.HQChart)return null;var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);if(!event||!event.Callback)return null;var sendData={ID:this.Guid,LabelConfig:this.LabelConfig,InsideLabelConfig:this.InsideLabelConfig,IsShow:true};event.Callback(event,sendData,this);return sendData;};this.DrawValueLabel=function(point){if(!point)return;if(this.Frame.IsHScreen)return;//不支持横屏
6776
6777
  var y=point.Y;var yFixed=ToFixedPoint2(this.LineWidth,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;if(config.Left.IsShow&&this.Frame.ChartBorder.Left>5){var leftText=text;if(config.Left.Text)leftText=config.Left.Text;var textWidth=this.Canvas.measureText(leftText).width;var left=border.Left;if(IFrameSplitOperator.IsNumber(config.Left.LineOffset)&&config.Left.LineOffset!==0){left-=config.Left.LineOffset;this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(border.Left,yFixed);this.Canvas.lineTo(left,yFixed);this.Canvas.stroke();this.RestoreLineWidth();}var margin=config.Left.Margin;var rtBG={Right: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(leftText,xText,yText);}if(config.Right.IsShow&&this.Frame.ChartBorder.Right>5){var rightText=text;if(config.Right.Text)rightText=config.Right.Text;var textWidth=this.Canvas.measureText(rightText).width;var left=border.Right;if(IFrameSplitOperator.IsNumber(config.Right.LineOffset)&&config.Right.LineOffset!==0){left+=config.Right.LineOffset;this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(border.Right,yFixed);this.Canvas.lineTo(left,yFixed);this.Canvas.stroke();this.RestoreLineWidth();}var margin=config.Right.Margin;var rtBG={Left: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.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(rightText,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)//左
6777
6778
  {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)//右
6778
6779
  {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度
@@ -15561,7 +15562,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15561
15562
  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);};}/********************************************************************************
15562
15563
  * 版本信息输出
15563
15564
  *
15564
- */var HQCHART_VERSION="1.1.15153";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();//把给外界调用的方法暴露出来
15565
+ */var HQCHART_VERSION="1.1.15157";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();//把给外界调用的方法暴露出来
15565
15566
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15566
15567
  // BaseIndex:BaseIndex,
15567
15568
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15154",
3
+ "version": "1.1.15158",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -2908,7 +2908,7 @@ var JSCHART_EVENT_ID=
2908
2908
  ON_CLICK_INDEX_LOCK:178, //点击指标锁
2909
2909
  ON_CORSSCURSOR_STATUS_CHANGE:179, //十字光标状态改变
2910
2910
 
2911
- ON_FORMAT_DRAW_HLINE_LABEL:180, //画图工具-水平线(ChartDrawPictureHorizontalLine)格式化标签文字
2911
+ ON_BEFORE_DRAW_HLINE:180, //画图工具-水平线(ChartDrawPictureHorizontalLine) 绘图前
2912
2912
  }
2913
2913
 
2914
2914
  var JSCHART_OPERATOR_ID=
@@ -15955,7 +15955,9 @@ function AverageWidthFrame()
15955
15955
  }
15956
15956
  else
15957
15957
  {
15958
- this.Canvas.fillStyle=item.LineColor;
15958
+ var textBGColor=item.LineColor;
15959
+ if (itemText.BGColor) textBGColor=itemText.BGColor;
15960
+ this.Canvas.fillStyle=textBGColor;
15959
15961
  this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
15960
15962
  if (itemText.TextColor) this.Canvas.fillStyle=itemText.TextColor;
15961
15963
  else this.Canvas.fillStyle = item.TextColor;
@@ -20469,6 +20471,7 @@ function OverlayKLineFrame()
20469
20471
  else
20470
20472
  {
20471
20473
  this.Canvas.fillStyle=item.LineColor;
20474
+ //if (itemText.BGColor) this.Canvas.fillStyle=itemText.BGColor;
20472
20475
  this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
20473
20476
  this.Canvas.fillStyle = item.TextColor;
20474
20477
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
@@ -22691,7 +22694,7 @@ function HQTradeFrame()
22691
22694
  if (frame.RightFrame) outObject.RightYValue=frame.RightFrame.GetYData(y); //右侧子坐标
22692
22695
 
22693
22696
  var yValue=frame.GetYData(y);
22694
- if (frame.YSplitOperator.CoordinateType==1) //百分比坐标 右边显示百分比信息
22697
+ if (frame.YSplitOperator.CoordinateType==1 && frame.YSplitOperator.GetFirstOpenPrice) //百分比坐标 右边显示百分比信息(K线才有)
22695
22698
  {
22696
22699
  var firstOpenPrice=frame.YSplitOperator.GetFirstOpenPrice();
22697
22700
  outObject.RightYValue=((yValue-firstOpenPrice)/firstOpenPrice*100).toFixed(2)+'%';
@@ -67024,7 +67027,7 @@ function ChartDrawPictureHorizontalLine()
67024
67027
  if (!drawPoint || drawPoint.length!=1) return;
67025
67028
  if (!this.Frame) return;
67026
67029
  if (this.Value.length!=1) return;
67027
- if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
67030
+ if (!this.IsYValueInFrame(this.Value[0].YValue)) return;
67028
67031
 
67029
67032
  var isHScreen=this.Frame.IsHScreen;
67030
67033
  var left=this.Frame.ChartBorder.GetLeft();
@@ -67035,7 +67038,8 @@ function ChartDrawPictureHorizontalLine()
67035
67038
  right=this.Frame.ChartBorder.GetBottom();
67036
67039
  }
67037
67040
 
67038
-
67041
+ var eventData=this.BeforeDrawEvent(drawPoint[0]);
67042
+ if (eventData && !eventData.IsShow) return;
67039
67043
 
67040
67044
  this.ClipFrame();
67041
67045
 
@@ -67076,8 +67080,6 @@ function ChartDrawPictureHorizontalLine()
67076
67080
  //画点
67077
67081
  this.DrawPoint(drawPoint);
67078
67082
 
67079
- this.FormatLabelTextEvent(drawPoint);
67080
-
67081
67083
  //显示价格
67082
67084
  this.DrawInsideLabel(drawPoint[0])
67083
67085
 
@@ -67086,16 +67088,18 @@ function ChartDrawPictureHorizontalLine()
67086
67088
  this.DrawValueLabel(drawPoint[0]);
67087
67089
  }
67088
67090
 
67089
- this.FormatLabelTextEvent=function(point)
67091
+ this.BeforeDrawEvent=function(point)
67090
67092
  {
67091
- if (!this.HQChart) return;
67092
- var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DRAW_HLINE_LABEL);
67093
- if (!event || !event.Callback) return;
67093
+ if (!this.HQChart) return null;
67094
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);
67095
+ if (!event || !event.Callback) return null;
67094
67096
 
67095
- var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
67097
+ var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig, IsShow:true };
67096
67098
  event.Callback(event, sendData, this);
67099
+
67100
+ return sendData;
67097
67101
  }
67098
-
67102
+
67099
67103
  this.DrawValueLabel=function(point)
67100
67104
  {
67101
67105
  if (!point) return;
@@ -7004,7 +7004,7 @@ var JSCHART_EVENT_ID=
7004
7004
  ON_CLICK_INDEX_LOCK:178, //点击指标锁
7005
7005
  ON_CORSSCURSOR_STATUS_CHANGE:179, //十字光标状态改变
7006
7006
 
7007
- ON_FORMAT_DRAW_HLINE_LABEL:180, //画图工具-水平线(ChartDrawPictureHorizontalLine)格式化标签文字
7007
+ ON_BEFORE_DRAW_HLINE:180, //画图工具-水平线(ChartDrawPictureHorizontalLine) 绘图前
7008
7008
  }
7009
7009
 
7010
7010
  var JSCHART_OPERATOR_ID=
@@ -20051,7 +20051,9 @@ function AverageWidthFrame()
20051
20051
  }
20052
20052
  else
20053
20053
  {
20054
- this.Canvas.fillStyle=item.LineColor;
20054
+ var textBGColor=item.LineColor;
20055
+ if (itemText.BGColor) textBGColor=itemText.BGColor;
20056
+ this.Canvas.fillStyle=textBGColor;
20055
20057
  this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
20056
20058
  if (itemText.TextColor) this.Canvas.fillStyle=itemText.TextColor;
20057
20059
  else this.Canvas.fillStyle = item.TextColor;
@@ -24565,6 +24567,7 @@ function OverlayKLineFrame()
24565
24567
  else
24566
24568
  {
24567
24569
  this.Canvas.fillStyle=item.LineColor;
24570
+ //if (itemText.BGColor) this.Canvas.fillStyle=itemText.BGColor;
24568
24571
  this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
24569
24572
  this.Canvas.fillStyle = item.TextColor;
24570
24573
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
@@ -26787,7 +26790,7 @@ function HQTradeFrame()
26787
26790
  if (frame.RightFrame) outObject.RightYValue=frame.RightFrame.GetYData(y); //右侧子坐标
26788
26791
 
26789
26792
  var yValue=frame.GetYData(y);
26790
- if (frame.YSplitOperator.CoordinateType==1) //百分比坐标 右边显示百分比信息
26793
+ if (frame.YSplitOperator.CoordinateType==1 && frame.YSplitOperator.GetFirstOpenPrice) //百分比坐标 右边显示百分比信息(K线才有)
26791
26794
  {
26792
26795
  var firstOpenPrice=frame.YSplitOperator.GetFirstOpenPrice();
26793
26796
  outObject.RightYValue=((yValue-firstOpenPrice)/firstOpenPrice*100).toFixed(2)+'%';
@@ -71120,7 +71123,7 @@ function ChartDrawPictureHorizontalLine()
71120
71123
  if (!drawPoint || drawPoint.length!=1) return;
71121
71124
  if (!this.Frame) return;
71122
71125
  if (this.Value.length!=1) return;
71123
- if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
71126
+ if (!this.IsYValueInFrame(this.Value[0].YValue)) return;
71124
71127
 
71125
71128
  var isHScreen=this.Frame.IsHScreen;
71126
71129
  var left=this.Frame.ChartBorder.GetLeft();
@@ -71131,7 +71134,8 @@ function ChartDrawPictureHorizontalLine()
71131
71134
  right=this.Frame.ChartBorder.GetBottom();
71132
71135
  }
71133
71136
 
71134
-
71137
+ var eventData=this.BeforeDrawEvent(drawPoint[0]);
71138
+ if (eventData && !eventData.IsShow) return;
71135
71139
 
71136
71140
  this.ClipFrame();
71137
71141
 
@@ -71172,8 +71176,6 @@ function ChartDrawPictureHorizontalLine()
71172
71176
  //画点
71173
71177
  this.DrawPoint(drawPoint);
71174
71178
 
71175
- this.FormatLabelTextEvent(drawPoint);
71176
-
71177
71179
  //显示价格
71178
71180
  this.DrawInsideLabel(drawPoint[0])
71179
71181
 
@@ -71182,16 +71184,18 @@ function ChartDrawPictureHorizontalLine()
71182
71184
  this.DrawValueLabel(drawPoint[0]);
71183
71185
  }
71184
71186
 
71185
- this.FormatLabelTextEvent=function(point)
71187
+ this.BeforeDrawEvent=function(point)
71186
71188
  {
71187
- if (!this.HQChart) return;
71188
- var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DRAW_HLINE_LABEL);
71189
- if (!event || !event.Callback) return;
71189
+ if (!this.HQChart) return null;
71190
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);
71191
+ if (!event || !event.Callback) return null;
71190
71192
 
71191
- var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
71193
+ var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig, IsShow:true };
71192
71194
  event.Callback(event, sendData, this);
71195
+
71196
+ return sendData;
71193
71197
  }
71194
-
71198
+
71195
71199
  this.DrawValueLabel=function(point)
71196
71200
  {
71197
71201
  if (!point) return;
@@ -153799,7 +153803,7 @@ function ScrollBarBGChart()
153799
153803
 
153800
153804
 
153801
153805
 
153802
- var HQCHART_VERSION="1.1.15153";
153806
+ var HQCHART_VERSION="1.1.15157";
153803
153807
 
153804
153808
  function PrintHQChartVersion()
153805
153809
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15153";
8
+ var HQCHART_VERSION="1.1.15157";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -7048,7 +7048,7 @@ var JSCHART_EVENT_ID=
7048
7048
  ON_CLICK_INDEX_LOCK:178, //点击指标锁
7049
7049
  ON_CORSSCURSOR_STATUS_CHANGE:179, //十字光标状态改变
7050
7050
 
7051
- ON_FORMAT_DRAW_HLINE_LABEL:180, //画图工具-水平线(ChartDrawPictureHorizontalLine)格式化标签文字
7051
+ ON_BEFORE_DRAW_HLINE:180, //画图工具-水平线(ChartDrawPictureHorizontalLine) 绘图前
7052
7052
  }
7053
7053
 
7054
7054
  var JSCHART_OPERATOR_ID=
@@ -20095,7 +20095,9 @@ function AverageWidthFrame()
20095
20095
  }
20096
20096
  else
20097
20097
  {
20098
- this.Canvas.fillStyle=item.LineColor;
20098
+ var textBGColor=item.LineColor;
20099
+ if (itemText.BGColor) textBGColor=itemText.BGColor;
20100
+ this.Canvas.fillStyle=textBGColor;
20099
20101
  this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);
20100
20102
  if (itemText.TextColor) this.Canvas.fillStyle=itemText.TextColor;
20101
20103
  else this.Canvas.fillStyle = item.TextColor;
@@ -24609,6 +24611,7 @@ function OverlayKLineFrame()
24609
24611
  else
24610
24612
  {
24611
24613
  this.Canvas.fillStyle=item.LineColor;
24614
+ //if (itemText.BGColor) this.Canvas.fillStyle=itemText.BGColor;
24612
24615
  this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);
24613
24616
  this.Canvas.fillStyle = item.TextColor;
24614
24617
  this.Canvas.fillText(itemText.Text, textLeft - 1*pixelTatio, yText);
@@ -26831,7 +26834,7 @@ function HQTradeFrame()
26831
26834
  if (frame.RightFrame) outObject.RightYValue=frame.RightFrame.GetYData(y); //右侧子坐标
26832
26835
 
26833
26836
  var yValue=frame.GetYData(y);
26834
- if (frame.YSplitOperator.CoordinateType==1) //百分比坐标 右边显示百分比信息
26837
+ if (frame.YSplitOperator.CoordinateType==1 && frame.YSplitOperator.GetFirstOpenPrice) //百分比坐标 右边显示百分比信息(K线才有)
26835
26838
  {
26836
26839
  var firstOpenPrice=frame.YSplitOperator.GetFirstOpenPrice();
26837
26840
  outObject.RightYValue=((yValue-firstOpenPrice)/firstOpenPrice*100).toFixed(2)+'%';
@@ -71164,7 +71167,7 @@ function ChartDrawPictureHorizontalLine()
71164
71167
  if (!drawPoint || drawPoint.length!=1) return;
71165
71168
  if (!this.Frame) return;
71166
71169
  if (this.Value.length!=1) return;
71167
- if (!this.IsYValueInFrame(this.Value[0].YValue)) return null;
71170
+ if (!this.IsYValueInFrame(this.Value[0].YValue)) return;
71168
71171
 
71169
71172
  var isHScreen=this.Frame.IsHScreen;
71170
71173
  var left=this.Frame.ChartBorder.GetLeft();
@@ -71175,7 +71178,8 @@ function ChartDrawPictureHorizontalLine()
71175
71178
  right=this.Frame.ChartBorder.GetBottom();
71176
71179
  }
71177
71180
 
71178
-
71181
+ var eventData=this.BeforeDrawEvent(drawPoint[0]);
71182
+ if (eventData && !eventData.IsShow) return;
71179
71183
 
71180
71184
  this.ClipFrame();
71181
71185
 
@@ -71216,8 +71220,6 @@ function ChartDrawPictureHorizontalLine()
71216
71220
  //画点
71217
71221
  this.DrawPoint(drawPoint);
71218
71222
 
71219
- this.FormatLabelTextEvent(drawPoint);
71220
-
71221
71223
  //显示价格
71222
71224
  this.DrawInsideLabel(drawPoint[0])
71223
71225
 
@@ -71226,16 +71228,18 @@ function ChartDrawPictureHorizontalLine()
71226
71228
  this.DrawValueLabel(drawPoint[0]);
71227
71229
  }
71228
71230
 
71229
- this.FormatLabelTextEvent=function(point)
71231
+ this.BeforeDrawEvent=function(point)
71230
71232
  {
71231
- if (!this.HQChart) return;
71232
- var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_DRAW_HLINE_LABEL);
71233
- if (!event || !event.Callback) return;
71233
+ if (!this.HQChart) return null;
71234
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);
71235
+ if (!event || !event.Callback) return null;
71234
71236
 
71235
- var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
71237
+ var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig, IsShow:true };
71236
71238
  event.Callback(event, sendData, this);
71239
+
71240
+ return sendData;
71237
71241
  }
71238
-
71242
+
71239
71243
  this.DrawValueLabel=function(point)
71240
71244
  {
71241
71245
  if (!point) return;
@@ -165812,7 +165816,7 @@ function HQChartScriptWorker()
165812
165816
 
165813
165817
 
165814
165818
 
165815
- var HQCHART_VERSION="1.1.15153";
165819
+ var HQCHART_VERSION="1.1.15157";
165816
165820
 
165817
165821
  function PrintHQChartVersion()
165818
165822
  {