hqchart 1.1.15154 → 1.1.15160
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.
package/lib/umychart.vue.js
CHANGED
|
@@ -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
|
-
|
|
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=
|
|
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
|
|
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)//鼠标哪个指标窗口
|
|
@@ -6581,7 +6582,7 @@ this.CacheData;//数据缓存
|
|
|
6581
6582
|
//接口函数
|
|
6582
6583
|
this.SetLastPoint=null;//this.SetLastPoint=function(obj) obj={X:,Y:}
|
|
6583
6584
|
this.Update=null;//更新数据回调
|
|
6584
|
-
this.GetActiveDrawPicture=null;this.GetYCoordinatePoint=null;this.Draw=function(){};this.SetOption=function(option){if(!option)return;if(option.LineColor)this.LineColor=option.LineColor;if(option.LineWidth>0)this.LineWidth=option.LineWidth;if(option.AreaColor)this.AreaColor=option.AreaColor;if(option.PointColor)this.PointColor=option.PointColor;if(option.MoveOnPointColor)this.MoveOnPointColor=option.MoveOnPointColor;if(option.PointRadius)this.PointRadius=option.PointRadius;if(IFrameSplitOperator.IsNumber(option.SquareSize))this.SquareSize=option.SquareSize;if(IFrameSplitOperator.IsBool(option.IsShowPoint))this.IsShowPoint=option.IsShowPoint;if(IFrameSplitOperator.IsNumber(option.LimitFrameID))this.LimitFrameID=option.LimitFrameID;if(IFrameSplitOperator.IsBool(option.EnableCtrlMove))this.EnableCtrlMove=option.EnableCtrlMove;if(IFrameSplitOperator.IsBool(option.IsShowYCoordinate))this.IsShowYCoordinate=option.IsShowYCoordinate;if(IFrameSplitOperator.IsBool(option.EnableSave))this.EnableSave=option.EnableSave;if(IFrameSplitOperator.IsBool(option.EnableMove))this.EnableMove=option.EnableMove;};this.ReloadResource=function(resource){if(!resource){this.PointColor=g_JSChartResource.DrawPicture.PointColor[0];this.MoveOnPointColor=g_JSChartResource.DrawPicture.PointColor[1];this.PointBGColor=g_JSChartResource.DrawPicture.PointColor[2];}};this.SetLineWidth=function(){this.BackupLineWidth=null;if(this.LineWidth>0){this.BackupLineWidth=this.Canvas.lineWidth;this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();}};this.GetFontHeight=function(font){return GetFontHeight(this.Canvas,font,"擎");};this.RestoreLineWidth=function(){if(this.BackupLineWidth!=null){this.Canvas.lineWidth=this.BackupLineWidth;}};//磁吸K线
|
|
6585
|
+
this.GetActiveDrawPicture=null;this.GetYCoordinatePoint=null;this.Draw=function(){};this.SetOption=function(option){if(!option)return;if(option.LineColor)this.LineColor=option.LineColor;if(option.LineWidth>0)this.LineWidth=option.LineWidth;if(option.AreaColor)this.AreaColor=option.AreaColor;if(option.PointColor)this.PointColor=option.PointColor;if(option.MoveOnPointColor)this.MoveOnPointColor=option.MoveOnPointColor;if(option.PointRadius)this.PointRadius=option.PointRadius;if(IFrameSplitOperator.IsNumber(option.SquareSize))this.SquareSize=option.SquareSize;if(IFrameSplitOperator.IsBool(option.IsShowPoint))this.IsShowPoint=option.IsShowPoint;if(IFrameSplitOperator.IsNumber(option.LimitFrameID))this.LimitFrameID=option.LimitFrameID;if(IFrameSplitOperator.IsBool(option.EnableCtrlMove))this.EnableCtrlMove=option.EnableCtrlMove;if(IFrameSplitOperator.IsBool(option.IsShowYCoordinate))this.IsShowYCoordinate=option.IsShowYCoordinate;if(IFrameSplitOperator.IsBool(option.EnableSave))this.EnableSave=option.EnableSave;if(IFrameSplitOperator.IsBool(option.EnableMove))this.EnableMove=option.EnableMove;if(option.CacheData)this.CacheData=option.CacheData;};this.ReloadResource=function(resource){if(!resource){this.PointColor=g_JSChartResource.DrawPicture.PointColor[0];this.MoveOnPointColor=g_JSChartResource.DrawPicture.PointColor[1];this.PointBGColor=g_JSChartResource.DrawPicture.PointColor[2];}};this.SetLineWidth=function(){this.BackupLineWidth=null;if(this.LineWidth>0){this.BackupLineWidth=this.Canvas.lineWidth;this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();}};this.GetFontHeight=function(font){return GetFontHeight(this.Canvas,font,"擎");};this.RestoreLineWidth=function(){if(this.BackupLineWidth!=null){this.Canvas.lineWidth=this.BackupLineWidth;}};//磁吸K线
|
|
6585
6586
|
this.PointMagnetKLine=function(){if(!this.IsSupportMagnet)return false;if(!this.Frame)return false;if(this.Frame.ClassName=="MinuteFrame"||this.Frame.Class=="MinuteHScreenFrame")return false;if(this.Frame.Identify!=0)return false;var pointIndex=-1;if(this.Status==2)pointIndex=1;else if(this.Status==1)pointIndex=0;else if(IFrameSplitOperator.IsNumber(this.MovePointIndex))pointIndex=this.MovePointIndex;if(pointIndex<0)return false;if(this.Option&&this.Option.Magnet&&this.Option.Magnet.Enable){var option={IsFixedX:false,Magnet:{Enable:true,PointIndex:pointIndex,Distance:this.Option.Magnet.Distance,Type:this.Option.Magnet.Type}};return this.AdjustPoint(this.Point,option);}return false;};//Point => Value
|
|
6586
6587
|
this.PointToValue=function(){if(!this.Frame)return false;if(this.Frame.ClassName=="MinuteFrame"||this.Frame.Class=="MinuteHScreenFrame"){return this.PointToValue_Minute();}else{return this.PointToValue_KLine();}};this.PointToKLine=function(aryPoint){if(!this.Frame)return null;var data=this.Frame.Data;if(!data)return null;var kLine=[];var isHScreen=this.Frame.IsHScreen;if(isHScreen){for(var i in aryPoint){var item=aryPoint[i];var xValue=parseInt(this.Frame.GetXData(item.Y))+data.DataOffset;var yValue=this.Frame.GetYData(item.X);var valueItem={XValue:xValue,YValue:yValue};var kline=data.Data[xValue];valueItem.DateTime={Date:kline.Date};if(IFrameSplitOperator.IsNumber(kline.Time))valueItem.DateTime.Time=kline.Time;kLine[i]=valueItem;}}else{for(var i in aryPoint){var item=aryPoint[i];var index=parseInt(this.Frame.GetXData(item.X,false));var xValue=index+data.DataOffset;if(xValue<0)xValue=0;else if(xValue>=data.Data.length){xValue=data.Data.length-1;index=xValue-data.DataOffset;}var yValue=this.Frame.GetYData(item.Y,false);var valueItem={XValue:xValue,YValue:yValue,XIndex:index};var kline=data.Data[xValue];valueItem.DateTime={Date:kline.Date};if(IFrameSplitOperator.IsNumber(kline.Time))valueItem.DateTime.Time=kline.Time;kLine[i]=valueItem;}}return kLine;};this.PointToValue_KLine=function(){if(!this.Frame)return false;var data=this.Frame.Data;if(!data)return false;var isHScreen=this.Frame.IsHScreen;if(isHScreen){for(var i=0;i<this.Point.length;++i){var item=this.Point[i];var xValue=parseInt(this.Frame.GetXData(item.Y,false))+data.DataOffset;var yValue=this.Frame.GetYData(item.X,false);var valueItem={XValue:xValue,YValue:yValue};var kline=data.Data[xValue];valueItem.DateTime={Date:kline.Date};if(IFrameSplitOperator.IsNumber(kline.Time))valueItem.DateTime.Time=kline.Time;this.Value[i]=valueItem;}}else{for(var i=0;i<this.Point.length;++i){var item=this.Point[i];var xValue=parseInt(this.Frame.GetXData(item.X,false))+data.DataOffset;if(xValue<0)xValue=0;else if(xValue>=data.Data.length)xValue=data.Data.length-1;var yValue=this.Frame.GetYData(item.Y,false);var valueItem={XValue:xValue,YValue:yValue};var kline=data.Data[xValue];valueItem.DateTime={Date:kline.Date};if(IFrameSplitOperator.IsNumber(kline.Time))valueItem.DateTime.Time=kline.Time;this.Value[i]=valueItem;}}return true;};this.PointToValue_Minute=function(){if(!this.Frame)return false;var data=this.Frame.Data;if(!data)return false;var isHScreen=this.Frame.IsHScreen;if(isHScreen){for(var i=0;i<this.Point.length;++i){var item=this.Point[i];var xValue=parseInt(this.Frame.GetXData(item.Y,false));var yValue=this.Frame.GetYData(item.X,false);var valueItem={XValue:xValue,YValue:yValue};var minuteItem=data.Data[xValue];valueItem.DateTime={Date:minuteItem.Date,Time:minuteItem.Time};this.Value[i]=valueItem;}}else{var xDatetime=g_MinuteTimeStringData.GetTimeData(this.Symbol);for(var i=0;i<this.Point.length;++i){var item=this.Point[i];var xValue=parseInt(this.Frame.GetXData(item.X,false));var yValue=this.Frame.GetYData(item.Y,false);if(xValue>=data.Data.length)//超过当前数据,直接读固定时间
|
|
6587
6588
|
{var index=xValue%xDatetime.length;var dataIndex=data.Data.length-1;var valueItem={XValue:xValue,YValue:yValue};var minuteItem=data.Data[dataIndex];var timeItem=xDatetime[index];valueItem.DateTime={Date:minuteItem.Date,Time:timeItem};this.Value[i]=valueItem;}else{var valueItem={XValue:xValue,YValue:yValue};var minuteItem=data.Data[xValue];valueItem.DateTime={Date:minuteItem.Date,Time:minuteItem.Time};this.Value[i]=valueItem;}}}return true;};this.IsPointIn=function(x,y,option){return false;};//Value => Point
|
|
@@ -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
|
|
6774
|
-
this.DrawPoint(drawPoint)
|
|
6775
|
-
this.DrawInsideLabel(drawPoint[0]);this.Canvas.restore();this.DrawValueLabel(drawPoint[0]);};this.
|
|
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度
|
|
@@ -9476,8 +9477,7 @@ this.Draw();};this.CreateChartDrawPicture=function(name,option,callback){var dra
|
|
|
9476
9477
|
if(option)drawPicture.SetOption(option);var self=this;drawPicture.Update=function()//更新回调函数
|
|
9477
9478
|
{self.DrawDynamicInfo();};drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.CurrentChartDrawPicture=drawPicture;JSConsole.Chart.Log("[MinuteChartContainer::CreateChartDrawPicture] ",name,this.CurrentChartDrawPicture);return true;};//手动添加画线
|
|
9478
9479
|
this.AddChartDrawPicture=function(obj){if(!obj)return null;if(obj.FrameID<0||obj.FrameID>=this.Frame.SubFrame.length)return null;var self=this;var item=IChartDrawPicture.GetDrawPictureByClassName(obj.ClassName);if(!item)return null;var drawPicture=item.Create();drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.Frame=this.Frame.SubFrame[obj.FrameID].Frame;//绑定框架坐标
|
|
9479
|
-
drawPicture.Symbol=this.Symbol;drawPicture.Period=888888888;drawPicture.HQChart=this;if(obj.Value)drawPicture.Value=obj.Value;if(obj.Guid)drawPicture.Guid=obj.Guid;if(obj.
|
|
9480
|
-
if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(obj);drawPicture.SetOption(obj);if(obj.EnableUpdateXValue)drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.ChartDrawPicture.push(drawPicture);if(obj.Draw==true)this.DrawDynamicInfo();return drawPicture;};this.ReloadChartDrawPicture=function(){this.ChartDrawPicture=[];if(this.SelectChartDrawPicture)this.SelectChartDrawPicture.IsSelected=false;this.SelectChartDrawPicture=null;this.CurrentChartDrawPicture=null;this.MoveOnChartDrawPicture=null;if(this.ChartDrawStorage){this.ChartDrawStorageCache=this.ChartDrawStorage.GetDrawData({Symbol:this.Symbol,Period:888888888});}};this.CreateChartDrawPictureByStorage=function()//把缓存(this.ChartDrawStorageCache) 画图工具创建出来
|
|
9480
|
+
drawPicture.Symbol=this.Symbol;drawPicture.Period=888888888;drawPicture.HQChart=this;if(obj.Value)drawPicture.Value=obj.Value;if(obj.Guid)drawPicture.Guid=obj.Guid;if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(obj);drawPicture.SetOption(obj);if(obj.EnableUpdateXValue)drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return self.GetActiveDrawPicture();};this.ChartDrawPicture.push(drawPicture);if(obj.Draw==true)this.DrawDynamicInfo();return drawPicture;};this.ReloadChartDrawPicture=function(){this.ChartDrawPicture=[];if(this.SelectChartDrawPicture)this.SelectChartDrawPicture.IsSelected=false;this.SelectChartDrawPicture=null;this.CurrentChartDrawPicture=null;this.MoveOnChartDrawPicture=null;if(this.ChartDrawStorage){this.ChartDrawStorageCache=this.ChartDrawStorage.GetDrawData({Symbol:this.Symbol,Period:888888888});}};this.CreateChartDrawPictureByStorage=function()//把缓存(this.ChartDrawStorageCache) 画图工具创建出来
|
|
9481
9481
|
{var _this43=this;if(!this.ChartDrawStorageCache||this.ChartDrawStorageCache.length<=0)return;var kData=this.GetKData();for(var i=0;i<this.ChartDrawStorageCache.length;++i){var item=this.ChartDrawStorageCache[i];if(item.FrameID<0||!this.Frame.SubFrame||this.Frame.SubFrame.length<item.FrameID)continue;var drawPicture=IChartDrawPicture.CreateChartDrawPicture(item);if(!drawPicture)continue;drawPicture.Canvas=this.Canvas;drawPicture.Status=10;drawPicture.HQChart=this;drawPicture.Frame=this.Frame.SubFrame[item.FrameID].Frame;//绑定框架坐标
|
|
9482
9482
|
if(drawPicture.ImportStorageData)drawPicture.ImportStorageData(item);drawPicture.ResetXValue();drawPicture.UpdateXValue();drawPicture.ValueToPoint();drawPicture.GetActiveDrawPicture=function(){return _this43.GetActiveDrawPicture();};this.ChartDrawPicture.push(drawPicture);}this.ChartDrawStorageCache=null;//清空缓存
|
|
9483
9483
|
};this.SetSizeChange=function(bChanged){this.Frame.SetSizeChage(bChanged);for(var i in this.ExtendChartPaint){var item=this.ExtendChartPaint[i];item.SizeChange=bChanged;}};this.SetSizeChage=this.SetSizeChange;//根据X坐标获取数据索引
|
|
@@ -15561,7 +15561,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15561
15561
|
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
15562
|
* 版本信息输出
|
|
15563
15563
|
*
|
|
15564
|
-
*/var HQCHART_VERSION="1.1.
|
|
15564
|
+
*/var HQCHART_VERSION="1.1.15159";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
15565
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15566
15566
|
// BaseIndex:BaseIndex,
|
|
15567
15567
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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)+'%';
|
|
@@ -64608,6 +64611,7 @@ function IChartDrawPicture()
|
|
|
64608
64611
|
if (IFrameSplitOperator.IsBool(option.IsShowYCoordinate)) this.IsShowYCoordinate=option.IsShowYCoordinate;
|
|
64609
64612
|
if (IFrameSplitOperator.IsBool(option.EnableSave)) this.EnableSave=option.EnableSave;
|
|
64610
64613
|
if (IFrameSplitOperator.IsBool(option.EnableMove)) this.EnableMove=option.EnableMove;
|
|
64614
|
+
if (option.CacheData) this.CacheData=option.CacheData;
|
|
64611
64615
|
|
|
64612
64616
|
}
|
|
64613
64617
|
|
|
@@ -67024,7 +67028,7 @@ function ChartDrawPictureHorizontalLine()
|
|
|
67024
67028
|
if (!drawPoint || drawPoint.length!=1) return;
|
|
67025
67029
|
if (!this.Frame) return;
|
|
67026
67030
|
if (this.Value.length!=1) return;
|
|
67027
|
-
if (!this.IsYValueInFrame(this.Value[0].YValue)) return
|
|
67031
|
+
if (!this.IsYValueInFrame(this.Value[0].YValue)) return;
|
|
67028
67032
|
|
|
67029
67033
|
var isHScreen=this.Frame.IsHScreen;
|
|
67030
67034
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
@@ -67035,7 +67039,8 @@ function ChartDrawPictureHorizontalLine()
|
|
|
67035
67039
|
right=this.Frame.ChartBorder.GetBottom();
|
|
67036
67040
|
}
|
|
67037
67041
|
|
|
67038
|
-
|
|
67042
|
+
var eventData=this.BeforeDrawEvent(drawPoint[0]);
|
|
67043
|
+
if (eventData && !eventData.IsShow) return;
|
|
67039
67044
|
|
|
67040
67045
|
this.ClipFrame();
|
|
67041
67046
|
|
|
@@ -67076,8 +67081,6 @@ function ChartDrawPictureHorizontalLine()
|
|
|
67076
67081
|
//画点
|
|
67077
67082
|
this.DrawPoint(drawPoint);
|
|
67078
67083
|
|
|
67079
|
-
this.FormatLabelTextEvent(drawPoint);
|
|
67080
|
-
|
|
67081
67084
|
//显示价格
|
|
67082
67085
|
this.DrawInsideLabel(drawPoint[0])
|
|
67083
67086
|
|
|
@@ -67086,16 +67089,18 @@ function ChartDrawPictureHorizontalLine()
|
|
|
67086
67089
|
this.DrawValueLabel(drawPoint[0]);
|
|
67087
67090
|
}
|
|
67088
67091
|
|
|
67089
|
-
this.
|
|
67092
|
+
this.BeforeDrawEvent=function(point)
|
|
67090
67093
|
{
|
|
67091
|
-
if (!this.HQChart) return;
|
|
67092
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
67093
|
-
if (!event || !event.Callback) return;
|
|
67094
|
+
if (!this.HQChart) return null;
|
|
67095
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);
|
|
67096
|
+
if (!event || !event.Callback) return null;
|
|
67094
67097
|
|
|
67095
|
-
var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
|
|
67098
|
+
var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig, IsShow:true };
|
|
67096
67099
|
event.Callback(event, sendData, this);
|
|
67100
|
+
|
|
67101
|
+
return sendData;
|
|
67097
67102
|
}
|
|
67098
|
-
|
|
67103
|
+
|
|
67099
67104
|
this.DrawValueLabel=function(point)
|
|
67100
67105
|
{
|
|
67101
67106
|
if (!point) return;
|
|
@@ -95976,7 +95981,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
95976
95981
|
drawPicture.HQChart=this;
|
|
95977
95982
|
if (obj.Value) drawPicture.Value=obj.Value;
|
|
95978
95983
|
if (obj.Guid) drawPicture.Guid=obj.Guid;
|
|
95979
|
-
if (obj.CacheData) drawPicture.CacheData=obj.CacheData; //缓存数据
|
|
95980
95984
|
|
|
95981
95985
|
if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(obj);
|
|
95982
95986
|
drawPicture.SetOption(obj);
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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)+'%';
|
|
@@ -68704,6 +68707,7 @@ function IChartDrawPicture()
|
|
|
68704
68707
|
if (IFrameSplitOperator.IsBool(option.IsShowYCoordinate)) this.IsShowYCoordinate=option.IsShowYCoordinate;
|
|
68705
68708
|
if (IFrameSplitOperator.IsBool(option.EnableSave)) this.EnableSave=option.EnableSave;
|
|
68706
68709
|
if (IFrameSplitOperator.IsBool(option.EnableMove)) this.EnableMove=option.EnableMove;
|
|
68710
|
+
if (option.CacheData) this.CacheData=option.CacheData;
|
|
68707
68711
|
|
|
68708
68712
|
}
|
|
68709
68713
|
|
|
@@ -71120,7 +71124,7 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71120
71124
|
if (!drawPoint || drawPoint.length!=1) return;
|
|
71121
71125
|
if (!this.Frame) return;
|
|
71122
71126
|
if (this.Value.length!=1) return;
|
|
71123
|
-
if (!this.IsYValueInFrame(this.Value[0].YValue)) return
|
|
71127
|
+
if (!this.IsYValueInFrame(this.Value[0].YValue)) return;
|
|
71124
71128
|
|
|
71125
71129
|
var isHScreen=this.Frame.IsHScreen;
|
|
71126
71130
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
@@ -71131,7 +71135,8 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71131
71135
|
right=this.Frame.ChartBorder.GetBottom();
|
|
71132
71136
|
}
|
|
71133
71137
|
|
|
71134
|
-
|
|
71138
|
+
var eventData=this.BeforeDrawEvent(drawPoint[0]);
|
|
71139
|
+
if (eventData && !eventData.IsShow) return;
|
|
71135
71140
|
|
|
71136
71141
|
this.ClipFrame();
|
|
71137
71142
|
|
|
@@ -71172,8 +71177,6 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71172
71177
|
//画点
|
|
71173
71178
|
this.DrawPoint(drawPoint);
|
|
71174
71179
|
|
|
71175
|
-
this.FormatLabelTextEvent(drawPoint);
|
|
71176
|
-
|
|
71177
71180
|
//显示价格
|
|
71178
71181
|
this.DrawInsideLabel(drawPoint[0])
|
|
71179
71182
|
|
|
@@ -71182,16 +71185,18 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71182
71185
|
this.DrawValueLabel(drawPoint[0]);
|
|
71183
71186
|
}
|
|
71184
71187
|
|
|
71185
|
-
this.
|
|
71188
|
+
this.BeforeDrawEvent=function(point)
|
|
71186
71189
|
{
|
|
71187
|
-
if (!this.HQChart) return;
|
|
71188
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
71189
|
-
if (!event || !event.Callback) return;
|
|
71190
|
+
if (!this.HQChart) return null;
|
|
71191
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);
|
|
71192
|
+
if (!event || !event.Callback) return null;
|
|
71190
71193
|
|
|
71191
|
-
var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
|
|
71194
|
+
var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig, IsShow:true };
|
|
71192
71195
|
event.Callback(event, sendData, this);
|
|
71196
|
+
|
|
71197
|
+
return sendData;
|
|
71193
71198
|
}
|
|
71194
|
-
|
|
71199
|
+
|
|
71195
71200
|
this.DrawValueLabel=function(point)
|
|
71196
71201
|
{
|
|
71197
71202
|
if (!point) return;
|
|
@@ -100072,7 +100077,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100072
100077
|
drawPicture.HQChart=this;
|
|
100073
100078
|
if (obj.Value) drawPicture.Value=obj.Value;
|
|
100074
100079
|
if (obj.Guid) drawPicture.Guid=obj.Guid;
|
|
100075
|
-
if (obj.CacheData) drawPicture.CacheData=obj.CacheData; //缓存数据
|
|
100076
100080
|
|
|
100077
100081
|
if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(obj);
|
|
100078
100082
|
drawPicture.SetOption(obj);
|
|
@@ -153799,7 +153803,7 @@ function ScrollBarBGChart()
|
|
|
153799
153803
|
|
|
153800
153804
|
|
|
153801
153805
|
|
|
153802
|
-
var HQCHART_VERSION="1.1.
|
|
153806
|
+
var HQCHART_VERSION="1.1.15159";
|
|
153803
153807
|
|
|
153804
153808
|
function PrintHQChartVersion()
|
|
153805
153809
|
{
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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)+'%';
|
|
@@ -68748,6 +68751,7 @@ function IChartDrawPicture()
|
|
|
68748
68751
|
if (IFrameSplitOperator.IsBool(option.IsShowYCoordinate)) this.IsShowYCoordinate=option.IsShowYCoordinate;
|
|
68749
68752
|
if (IFrameSplitOperator.IsBool(option.EnableSave)) this.EnableSave=option.EnableSave;
|
|
68750
68753
|
if (IFrameSplitOperator.IsBool(option.EnableMove)) this.EnableMove=option.EnableMove;
|
|
68754
|
+
if (option.CacheData) this.CacheData=option.CacheData;
|
|
68751
68755
|
|
|
68752
68756
|
}
|
|
68753
68757
|
|
|
@@ -71164,7 +71168,7 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71164
71168
|
if (!drawPoint || drawPoint.length!=1) return;
|
|
71165
71169
|
if (!this.Frame) return;
|
|
71166
71170
|
if (this.Value.length!=1) return;
|
|
71167
|
-
if (!this.IsYValueInFrame(this.Value[0].YValue)) return
|
|
71171
|
+
if (!this.IsYValueInFrame(this.Value[0].YValue)) return;
|
|
71168
71172
|
|
|
71169
71173
|
var isHScreen=this.Frame.IsHScreen;
|
|
71170
71174
|
var left=this.Frame.ChartBorder.GetLeft();
|
|
@@ -71175,7 +71179,8 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71175
71179
|
right=this.Frame.ChartBorder.GetBottom();
|
|
71176
71180
|
}
|
|
71177
71181
|
|
|
71178
|
-
|
|
71182
|
+
var eventData=this.BeforeDrawEvent(drawPoint[0]);
|
|
71183
|
+
if (eventData && !eventData.IsShow) return;
|
|
71179
71184
|
|
|
71180
71185
|
this.ClipFrame();
|
|
71181
71186
|
|
|
@@ -71216,8 +71221,6 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71216
71221
|
//画点
|
|
71217
71222
|
this.DrawPoint(drawPoint);
|
|
71218
71223
|
|
|
71219
|
-
this.FormatLabelTextEvent(drawPoint);
|
|
71220
|
-
|
|
71221
71224
|
//显示价格
|
|
71222
71225
|
this.DrawInsideLabel(drawPoint[0])
|
|
71223
71226
|
|
|
@@ -71226,16 +71229,18 @@ function ChartDrawPictureHorizontalLine()
|
|
|
71226
71229
|
this.DrawValueLabel(drawPoint[0]);
|
|
71227
71230
|
}
|
|
71228
71231
|
|
|
71229
|
-
this.
|
|
71232
|
+
this.BeforeDrawEvent=function(point)
|
|
71230
71233
|
{
|
|
71231
|
-
if (!this.HQChart) return;
|
|
71232
|
-
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.
|
|
71233
|
-
if (!event || !event.Callback) return;
|
|
71234
|
+
if (!this.HQChart) return null;
|
|
71235
|
+
var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);
|
|
71236
|
+
if (!event || !event.Callback) return null;
|
|
71234
71237
|
|
|
71235
|
-
var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig };
|
|
71238
|
+
var sendData={ ID:this.Guid, LabelConfig:this.LabelConfig, InsideLabelConfig:this.InsideLabelConfig, IsShow:true };
|
|
71236
71239
|
event.Callback(event, sendData, this);
|
|
71240
|
+
|
|
71241
|
+
return sendData;
|
|
71237
71242
|
}
|
|
71238
|
-
|
|
71243
|
+
|
|
71239
71244
|
this.DrawValueLabel=function(point)
|
|
71240
71245
|
{
|
|
71241
71246
|
if (!point) return;
|
|
@@ -100116,7 +100121,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
100116
100121
|
drawPicture.HQChart=this;
|
|
100117
100122
|
if (obj.Value) drawPicture.Value=obj.Value;
|
|
100118
100123
|
if (obj.Guid) drawPicture.Guid=obj.Guid;
|
|
100119
|
-
if (obj.CacheData) drawPicture.CacheData=obj.CacheData; //缓存数据
|
|
100120
100124
|
|
|
100121
100125
|
if (drawPicture.ImportStorageData) drawPicture.ImportStorageData(obj);
|
|
100122
100126
|
drawPicture.SetOption(obj);
|
|
@@ -165812,7 +165816,7 @@ function HQChartScriptWorker()
|
|
|
165812
165816
|
|
|
165813
165817
|
|
|
165814
165818
|
|
|
165815
|
-
var HQCHART_VERSION="1.1.
|
|
165819
|
+
var HQCHART_VERSION="1.1.15159";
|
|
165816
165820
|
|
|
165817
165821
|
function PrintHQChartVersion()
|
|
165818
165822
|
{
|