hqchart 1.1.11721 → 1.1.11724
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
|
@@ -3405,6 +3405,7 @@ this.Direction=0;//0=middle 1=bottom 2=top
|
|
|
3405
3405
|
this.FixedFontSize=-1;//固定字体大小
|
|
3406
3406
|
this.YOffset=0;//连线
|
|
3407
3407
|
this.Position;//指定输出位置
|
|
3408
|
+
this.ShowOffset={X:0,Y:0};//显示偏移
|
|
3408
3409
|
this.IconFont;//Iconfont
|
|
3409
3410
|
this.IconSize={Max:g_JSChartResource.DRAWICON.Icon.MaxSize,Min:g_JSChartResource.DRAWICON.Icon.MinSize,//图标的最大最小值
|
|
3410
3411
|
Zoom:{Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type,Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value},//放大倍数
|
|
@@ -3416,7 +3417,7 @@ Zoom:{Type:g_JSChartResource.DRAWTEXT.Zoom.Type,Value:g_JSChartResource.DRAWTEXT
|
|
|
3416
3417
|
FontName:g_JSChartResource.DRAWTEXT.FontName,YOffset:g_JSChartResource.DRAWTEXT.YOffset};}else if(this.Name=="DRAWNUMBER"){this.TextSize={Max:g_JSChartResource.DRAWNUMBER.MaxSize,Min:g_JSChartResource.DRAWNUMBER.MinSize,//字体的最大最小值
|
|
3417
3418
|
Zoom:{Type:g_JSChartResource.DRAWNUMBER.Zoom.Type,Value:g_JSChartResource.DRAWNUMBER.Zoom.Value},//放大倍数
|
|
3418
3419
|
FontName:g_JSChartResource.DRAWNUMBER.FontName,YOffset:g_JSChartResource.DRAWNUMBER.YOffset};}else if(this.Name=="DRAWTEXT_FIX"){this.Font.DRAWTEXT_FIX=g_JSChartResource.DRAWTEXT_FIX.Font;}else if(this.Name=="DRAWNUMBER_FIX"){this.Font.DRAWNUMBER_FIX=g_JSChartResource.DRAWNUMBER_FIX.Font;}};this.SuperGetMaxMin=this.GetMaxMin;this.GetMaxMin=function(){if(this.Name=="DRAWTEXT_FIX"||this.Name=='DRAWNUMBER_FIX')//固定位置的 没有大小值
|
|
3419
|
-
{return{Min:null,Max:null};}else if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){return{Min:null,Max:null};}else{return this.SuperGetMaxMin();}};this.DrawRectText=function(){if(!this.DrawData)return;var isHScreen=this.ChartFrame.IsHScreen===true;var border=this.ChartFrame.GetBorder();if(this.Name=="DRAWTEXTREL"){if(isHScreen){var height=border.RightTitle-border.LeftEx;var width=border.BottomEx-border.TopEx;var x=this.DrawData.Point.X/1000*width+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y/1000*width;}else{var width=border.RightEx-border.LeftEx;var height=border.BottomEx-border.TopTitle;var x=this.DrawData.Point.X/1000*width+border.LeftEx;var y=this.DrawData.Point.Y/1000*height+border.TopTitle;}}else if(this.Name=="DRAWTEXTABS"){if(isHScreen){var x=this.DrawData.Point.X+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y;}else{var x=this.DrawData.Point.X+border.LeftEx;var y=this.DrawData.Point.Y+border.TopTitle;}}else{return;}if(this.Direction==1)this.Canvas.textBaseline='bottom';else if(this.Direction==2)this.Canvas.textBaseline='top';else this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.Color;this.DrawText(this.DrawData.Text,x,y,isHScreen);};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){this.DrawRectText();return;}if(this.Position){this.DrawPosition();return;}if(!this.Data||!this.Data.Data)return;var isHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=this.ChartBorder.GetRight();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();if(isHScreen){chartright=this.ChartBorder.GetBottom();top=this.ChartBorder.GetRightEx();bottom=this.ChartBorder.GetLeftEx();xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}var xPointCount=this.ChartFrame.XPointCount;var isArrayText=Array.isArray(this.Text);var pixelTatio=GetDevicePixelRatio();var drawTextInfo={Text:{},Font:{}};if(this.Direction==1){this.Canvas.textBaseline='bottom';drawTextInfo.Text={Baseline:'bottom'};}else if(this.Direction==2){this.Canvas.textBaseline='top';drawTextInfo.Text={Baseline:'top'};}else{this.Canvas.textBaseline='middle';drawTextInfo.Text={Baseline:'middle'};}if(this.IconFont){this.Color=this.IconFont.Color;this.Text=this.IconFont.Text;if(this.FixedFontSize>0)var iconSize=this.FixedFontSize;else var iconSize=this.GetDynamicIconSize(dataWidth,distanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=iconSize+'px '+this.IconFont.Family;}else{if(this.FixedFontSize>0)this.TextFont=this.FixedFontSize+'px '+this.TextSize.FontName;else this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);this.Canvas.font=this.TextFont;}drawTextInfo.Font={Height:this.GetFontHeight()};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y=this.ChartFrame.GetYFromData(value);if(x>chartright)break;this.Canvas.textAlign=this.TextAlign;this.Canvas.fillStyle=this.Color;drawTextInfo.Text.Color=this.Color;drawTextInfo.Text.Align=this.TextAlign;drawTextInfo.X=x;drawTextInfo.Y=y;if(this.YOffset>0&&this.Direction>0){var yPrice=y;this.Canvas.setLineDash([5,10]);this.Canvas.strokeStyle=this.Color;this.Canvas.beginPath();if(isHScreen){if(this.Direction==1){y=top-this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom+this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(yPrice),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(y),ToFixedPoint(x));}else{if(this.Direction==1){y=top+this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom-this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yPrice));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.setLineDash([]);}if(isArrayText){var text=this.Text[i];if(!text)continue;if(this.Name=='DRAWNUMBER'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT")this.DrawTextV2(text,drawTextInfo,isHScreen);else this.DrawText(text,x,y,isHScreen);}else{if(this.Name=='DRAWICON'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2){if(this.IconFont)y+=this.IconSize.YOffset*pixelTatio;else y+=this.TextSize.YOffset*pixelTatio;}}else if(this.Name=="DRAWTEXT"){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT"){this.DrawTextV2(this.Text,drawTextInfo,isHScreen);}else{this.DrawText(this.Text,x,y,isHScreen);}}}};this.DrawPosition=function()//绘制在指定位置上
|
|
3420
|
+
{return{Min:null,Max:null};}else if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){return{Min:null,Max:null};}else{return this.SuperGetMaxMin();}};this.DrawRectText=function(){if(!this.DrawData)return;var isHScreen=this.ChartFrame.IsHScreen===true;var border=this.ChartFrame.GetBorder();if(this.Name=="DRAWTEXTREL"){if(isHScreen){var height=border.RightTitle-border.LeftEx;var width=border.BottomEx-border.TopEx;var x=this.DrawData.Point.X/1000*width+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y/1000*width;}else{var width=border.RightEx-border.LeftEx;var height=border.BottomEx-border.TopTitle;var x=this.DrawData.Point.X/1000*width+border.LeftEx;var y=this.DrawData.Point.Y/1000*height+border.TopTitle;}}else if(this.Name=="DRAWTEXTABS"){if(isHScreen){var x=this.DrawData.Point.X+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y;}else{var x=this.DrawData.Point.X+border.LeftEx;var y=this.DrawData.Point.Y+border.TopTitle;}}else{return;}if(this.Direction==1)this.Canvas.textBaseline='bottom';else if(this.Direction==2)this.Canvas.textBaseline='top';else this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.Color;this.DrawText(this.DrawData.Text,x,y,isHScreen);};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){this.DrawRectText();return;}if(this.Position){this.DrawPosition();return;}if(!this.Data||!this.Data.Data)return;var isHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=this.ChartBorder.GetRight();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();if(isHScreen){chartright=this.ChartBorder.GetBottom();top=this.ChartBorder.GetRightEx();bottom=this.ChartBorder.GetLeftEx();xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}var xPointCount=this.ChartFrame.XPointCount;var isArrayText=Array.isArray(this.Text);var pixelTatio=GetDevicePixelRatio();var drawTextInfo={Text:{},Font:{}};if(this.Direction==1){this.Canvas.textBaseline='bottom';drawTextInfo.Text={Baseline:'bottom'};}else if(this.Direction==2){this.Canvas.textBaseline='top';drawTextInfo.Text={Baseline:'top'};}else{this.Canvas.textBaseline='middle';drawTextInfo.Text={Baseline:'middle'};}if(this.IconFont){this.Color=this.IconFont.Color;this.Text=this.IconFont.Text;if(this.FixedFontSize>0)var iconSize=this.FixedFontSize;else var iconSize=this.GetDynamicIconSize(dataWidth,distanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=iconSize+'px '+this.IconFont.Family;}else{if(this.FixedFontSize>0)this.TextFont=this.FixedFontSize+'px '+this.TextSize.FontName;else this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);this.Canvas.font=this.TextFont;}drawTextInfo.Font={Height:this.GetFontHeight()};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y=this.ChartFrame.GetYFromData(value);if(x>chartright)break;y+=this.ShowOffset.Y;x+=this.ShowOffset.X;this.Canvas.textAlign=this.TextAlign;this.Canvas.fillStyle=this.Color;drawTextInfo.Text.Color=this.Color;drawTextInfo.Text.Align=this.TextAlign;drawTextInfo.X=x;drawTextInfo.Y=y;if(this.YOffset>0&&this.Direction>0){var yPrice=y;this.Canvas.setLineDash([5,10]);this.Canvas.strokeStyle=this.Color;this.Canvas.beginPath();if(isHScreen){if(this.Direction==1){y=top-this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom+this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(yPrice),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(y),ToFixedPoint(x));}else{if(this.Direction==1){y=top+this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom-this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yPrice));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.setLineDash([]);}if(isArrayText){var text=this.Text[i];if(!text)continue;if(this.Name=='DRAWNUMBER'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT")this.DrawTextV2(text,drawTextInfo,isHScreen);else this.DrawText(text,x,y,isHScreen);}else{if(this.Name=='DRAWICON'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2){if(this.IconFont)y+=this.IconSize.YOffset*pixelTatio;else y+=this.TextSize.YOffset*pixelTatio;}}else if(this.Name=="DRAWTEXT"){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT"){this.DrawTextV2(this.Text,drawTextInfo,isHScreen);}else{this.DrawText(this.Text,x,y,isHScreen);}}}};this.DrawPosition=function()//绘制在指定位置上
|
|
3420
3421
|
{if(!this.Text)return;var isHScreen=this.ChartFrame.IsHScreen===true;if(isHScreen){var y=this.ChartBorder.GetRightEx()-this.ChartBorder.GetWidthEx()*this.Position.Y;var x=this.ChartBorder.GetTop()+this.ChartBorder.GetHeight()*this.Position.X;}else{var x=this.ChartBorder.GetLeft()+this.ChartBorder.GetWidth()*this.Position.X;var y=this.ChartBorder.GetTopEx()+this.ChartBorder.GetHeightEx()*this.Position.Y;}this.Canvas.fillStyle=this.Color;if(this.Name=="DRAWTEXT_FIX")this.Canvas.font=this.Font.DRAWTEXT_FIX;else if(this.Name=="DRAWNUMBER_FIX")this.Canvas.font=this.Font.DRAWNUMBER_FIX;//TYPE:0为左对齐,1为右对齐.
|
|
3421
3422
|
if(this.Position.Type==0)this.Canvas.textAlign='left';else if(this.Position.Type==1)this.Canvas.textAlign='right';else this.Canvas.textAlign='center';if(this.Direction==1)this.Canvas.textBaseline='bottom';else if(this.Direction==2)this.Canvas.textBaseline='top';else this.Canvas.textBaseline='middle';if(Array.isArray(this.Text)){if(!this.Data||!this.Data.Data)return;var xPointCount=this.ChartFrame.XPointCount;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var text=this.Text[i];if(text){this.DrawText(text,x,y,isHScreen);break;}}}else{this.DrawText(this.Text,x,y,isHScreen);}};this.DrawText=function(text,x,y,isHScreen){if(isHScreen){this.Canvas.save();this.Canvas.translate(y,x);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(text,0,0);this.Canvas.restore();}else{this.Canvas.fillText(text,x,y);}};this.DrawTextV2=function(text,drawInfo,isHScreen){var textWidth=this.Canvas.measureText(text).width;if(isHScreen){var x=drawInfo.Y;var y=drawInfo.X;if(drawInfo.Text.Align=="right")y=y-textWidth;else if(drawInfo.Text.Align=="center")y=y-textWidth/2;if(drawInfo.Text.Baseline=="top")x-=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")x-=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
|
|
3422
3423
|
var xRect=x-margin[0];var yRect=y-margin[2];var bgWidth=textWidth+margin[2]+margin[3];var bgHeight=drawInfo.Font.Height+margin[0]+margin[1];if(this.TextBG.Color){this.Canvas.fillStyle=this.TextBG.Color;this.Canvas.fillRect(xRect,yRect,bgHeight,bgWidth);}if(this.TextBG.Border){this.Canvas.strokeStyle=this.TextBG.Border;this.Canvas.strokeRect(ToFixedPoint(xRect),ToFixedPoint(yRect),ToFixedRect(bgHeight),ToFixedRect(bgWidth));}}this.Canvas.textBaseline="bottom";this.Canvas.textAlign="left";this.Canvas.fillStyle=drawInfo.Text.Color;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(text,0,0);this.Canvas.restore();}else{var x=drawInfo.X;var y=drawInfo.Y;if(drawInfo.Text.Align=="right")x=x-textWidth;else if(drawInfo.Text.Align=="center")x=x-textWidth/2;if(drawInfo.Text.Baseline=="top")y+=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")y+=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
|
|
@@ -3429,13 +3430,14 @@ this.FixedFontSize=-1;//固定字体大小
|
|
|
3429
3430
|
this.YOffset=0;//连线
|
|
3430
3431
|
this.FixedPosition=-1;//固定位置输出 1顶部, 2底部
|
|
3431
3432
|
this.VerticalLine;//垂直线
|
|
3433
|
+
this.ShowOffset={X:0,Y:0};//显示偏移
|
|
3432
3434
|
this.ExportData=this.ExportBoolData;this.TextSize={Max:g_JSChartResource.DRAWICON.Text.MaxSize,Min:g_JSChartResource.DRAWICON.Text.MinSize,//字体的最大最小值
|
|
3433
3435
|
Zoom:{Type:g_JSChartResource.DRAWICON.Text.Zoom.Type,Value:g_JSChartResource.DRAWICON.Text.Zoom.Value},//放大倍数
|
|
3434
3436
|
FontName:g_JSChartResource.DRAWICON.Text.FontName,YOffset:g_JSChartResource.DRAWICON.Text.YOffset};this.ReloadResource=function(resource){this.TextSize={Max:g_JSChartResource.DRAWTEXT.MaxSize,Min:g_JSChartResource.DRAWTEXT.MinSize,//字体的最大最小值
|
|
3435
3437
|
Zoom:{Type:g_JSChartResource.DRAWTEXT.Zoom.Type,Value:g_JSChartResource.DRAWTEXT.Zoom.Value},//放大倍数
|
|
3436
3438
|
FontName:g_JSChartResource.DRAWTEXT.FontName,YOffset:g_JSChartResource.DRAWTEXT.YOffset};};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(!this.Data||!this.Data.Data)return;var isHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=this.ChartBorder.GetRight();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();if(isHScreen){chartright=this.ChartBorder.GetBottom();top=this.ChartBorder.GetRightEx();bottom=this.ChartBorder.GetLeftEx();xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}var xPointCount=this.ChartFrame.XPointCount;var isArrayText=Array.isArray(this.Text);var drawTextInfo={Text:{Color:this.Color,Align:this.TextAlign,Baseline:this.TextBaseline},Font:{}};if(this.FixedFontSize>0)//固定字体大小模式
|
|
3437
3439
|
this.TextFont=this.FixedFontSize+'px '+this.TextSize.FontName;else//动态字体大小
|
|
3438
|
-
this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);this.Canvas.font=this.TextFont;drawTextInfo.Font={Height:this.GetFontHeight()};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y;if(this.FixedPosition===1){y=top;}else if(this.FixedPosition===2){y=bottom;}else{y=this.ChartFrame.GetYFromData(value);}if(x>chartright)break;drawTextInfo.X=x;drawTextInfo.Y=y;if(isArrayText){var text=this.Text[i];if(!text)continue;this.DrawText(text,drawTextInfo,isHScreen);}else{this.DrawText(this.Text,drawTextInfo,isHScreen);}this.DrawVerticalLine(i,drawTextInfo,isHScreen);}};this.DrawText=function(text,drawInfo,isHScreen){var textWidth=this.Canvas.measureText(text).width;if(isHScreen){var x=drawInfo.Y;var y=drawInfo.X;if(drawInfo.Text.Align=="right")y=y-textWidth;else if(drawInfo.Text.Align=="center")y=y-textWidth/2;if(drawInfo.Text.Baseline=="top")x-=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")x-=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
|
|
3440
|
+
this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);this.Canvas.font=this.TextFont;drawTextInfo.Font={Height:this.GetFontHeight()};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y;if(this.FixedPosition===1){y=top;}else if(this.FixedPosition===2){y=bottom;}else{y=this.ChartFrame.GetYFromData(value);}if(x>chartright)break;y+=this.ShowOffset.Y;x+=this.ShowOffset.X;drawTextInfo.X=x;drawTextInfo.Y=y;if(isArrayText){var text=this.Text[i];if(!text)continue;this.DrawText(text,drawTextInfo,isHScreen);}else{this.DrawText(this.Text,drawTextInfo,isHScreen);}this.DrawVerticalLine(i,drawTextInfo,isHScreen);}};this.DrawText=function(text,drawInfo,isHScreen){var textWidth=this.Canvas.measureText(text).width;if(isHScreen){var x=drawInfo.Y;var y=drawInfo.X;if(drawInfo.Text.Align=="right")y=y-textWidth;else if(drawInfo.Text.Align=="center")y=y-textWidth/2;if(drawInfo.Text.Baseline=="top")x-=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")x-=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
|
|
3439
3441
|
var xRect=x-margin[0];var yRect=y-margin[2];var bgWidth=textWidth+margin[2]+margin[3];var bgHeight=drawInfo.Font.Height+margin[0]+margin[1];if(this.TextBG.Color){this.Canvas.fillStyle=this.TextBG.Color;this.Canvas.fillRect(xRect,yRect,bgHeight,bgWidth);}if(this.TextBG.Border){this.Canvas.strokeStyle=this.TextBG.Border;this.Canvas.strokeRect(ToFixedPoint(xRect),ToFixedPoint(yRect),ToFixedRect(bgHeight),ToFixedRect(bgWidth));}drawInfo.Rect={Bottom:xRect,Top:xRect+bgHeight};}else{var xRect=x;var bgHeight=drawInfo.Font.Height;drawInfo.Rect={Bottom:xRect,Top:xRect+bgHeight};}this.Canvas.textBaseline="bottom";this.Canvas.textAlign="left";this.Canvas.fillStyle=drawInfo.Text.Color;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(text,0,0);this.Canvas.restore();}else{var x=drawInfo.X;var y=drawInfo.Y;if(drawInfo.Text.Align=="right")x=x-textWidth;else if(drawInfo.Text.Align=="center")x=x-textWidth/2;if(drawInfo.Text.Baseline=="top")y+=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")y+=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
|
|
3440
3442
|
var xRect=x-margin[2];var yRect=y-drawInfo.Font.Height-margin[1];var bgWidth=textWidth+margin[2]+margin[3];var bgHeight=drawInfo.Font.Height+margin[0]+margin[1];if(this.TextBG.Color){this.Canvas.fillStyle=this.TextBG.Color;this.Canvas.fillRect(xRect,yRect,bgWidth,bgHeight);}if(this.TextBG.Border){this.Canvas.strokeStyle=this.TextBG.Border;this.Canvas.strokeRect(ToFixedPoint(xRect),ToFixedPoint(yRect),ToFixedRect(bgWidth),ToFixedRect(bgHeight));}drawInfo.Rect={Top:yRect,Bottom:yRect+bgHeight};}else{var yRect=y-drawInfo.Font.Height;var bgHeight=drawInfo.Font.Height;drawInfo.Rect={Top:yRect,Bottom:yRect+bgHeight};}this.Canvas.textBaseline="bottom";this.Canvas.textAlign="left";this.Canvas.fillStyle=drawInfo.Text.Color;this.Canvas.fillText(text,x,y);}};//画连线
|
|
3441
3443
|
this.DrawVerticalLine=function(index,drawTextInfo,isHScreen){if(!this.VerticalLine)return;var item=this.VerticalLine.Data[index];if(!item)return;if(!IFrameSplitOperator.IsNumber(item.High))return;if(!IFrameSplitOperator.IsNumber(item.Low))return;var yHigh=this.ChartFrame.GetYFromData(item.High);var yLow=this.ChartFrame.GetYFromData(item.Low);var yLine,yLine2;if(isHScreen){if(drawTextInfo.Rect.Bottom>yHigh){yLine=drawTextInfo.Rect.Bottom-1;yLine2=yHigh+1;}else if(drawTextInfo.Rect.Top<yLow){yLine=drawTextInfo.Rect.Top-1;yLine2=yLow-1;}else{return;}}else{if(drawTextInfo.Rect.Bottom<yHigh){yLine=drawTextInfo.Rect.Bottom+1;yLine2=yHigh-1;}else if(drawTextInfo.Rect.Top>yLow){yLine=drawTextInfo.Rect.Top-1;yLine2=yLow+1;}else{return;}}this.Canvas.save();var pixelTatio=GetDevicePixelRatio();var xLine=drawTextInfo.X;if(this.VerticalLine.LineType==1){if(this.VerticalLine.LineDotted)this.Canvas.setLineDash(this.VerticalLine.LineDotted);else this.Canvas.setLineDash([5,10]);}if(IFrameSplitOperator.IsPlusNumber(this.VerticalLine.LineWidth)){this.Canvas.lineWidth=this.VerticalLine.LineWidth*pixelTatio;}this.Canvas.strokeStyle=this.VerticalLine.Color;this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(yLine),ToFixedPoint(xLine));this.Canvas.lineTo(ToFixedPoint(yLine2),ToFixedPoint(xLine));}else{this.Canvas.moveTo(ToFixedPoint(xLine),ToFixedPoint(yLine));this.Canvas.lineTo(ToFixedPoint(xLine),ToFixedPoint(yLine2));}this.Canvas.stroke();this.Canvas.restore();};}function ChartDrawNumber(){this.newMethod=ChartDrawText;//派生
|
|
@@ -9072,7 +9074,9 @@ numberData.SingleValue=data2;numberData.DataType=1;if(IFrameSplitOperator.IsNumb
|
|
|
9072
9074
|
areaColor: 通道面积颜色 RGB(200,30,44) 不填使用默认颜色
|
|
9073
9075
|
dotted: 通道顶部和底部虚线设置 '3,4' , 不填默认 3,3
|
|
9074
9076
|
*/this.DRAWCHANNEL=function(condition,data,data2,borderColor,borderWidth,dotted,areaColor){var drawData=[];var result={DrawData:drawData,DrawType:'DRAWCHANNEL',Border:{}};if(condition.length<=0)return result;if(borderColor)result.Border.Color=borderColor;if(areaColor)result.AreaColor=areaColor;if(borderWidth>0)result.Border.Width=borderWidth;if(dotted){var ary=dotted.split(',');result.Border.Dotted=[];for(var i in ary){var item=ary[i];if(!item)continue;var value=parseInt(ary[i]);if(value<=0)continue;result.Border.Dotted.push(value);}if(result.Border.Dotted.length<=0)result.Border.Dotted=null;}var IsNumber=typeof data=="number";var IsNumber2=typeof data2=="number";if(typeof condition=='number'){if(!condition)return result;//条件是否
|
|
9075
|
-
for(var i=0;i<this.SymbolData.Data.Data.length;++i){drawData[i]=null;if(IsNumber&&IsNumber2){drawData[i]={Value:data,Value2:data2};}else if(IsNumber&&!IsNumber2){if(isNaN(data2[i]))continue;drawData[i]={Value:data,Value2:data2[i]};}else if(!IsNumber&&IsNumber2){if(isNaN(data[i]))continue;drawData[i]={Value:data[i],Value2:data2};}else{if(isNaN(data[i])||isNaN(data2[i]))continue;drawData[i]={Value:data[i],Value2:data2[i]};}}}else{for(var i=0;i<condition.length;++i){drawData[i]=null;if(isNaN(condition[i])||!condition[i])continue;if(IsNumber&&IsNumber2){drawData[i]={Value:data,Value2:data2};}else if(IsNumber&&!IsNumber2){if(isNaN(data2[i]))continue;drawData[i]={Value:data,Value2:data2[i]};}else if(!IsNumber&&IsNumber2){if(isNaN(data[i]))continue;drawData[i]={Value:data[i],Value2:data2};}else{if(isNaN(data[i])||isNaN(data2[i]))continue;drawData[i]={Value:data[i],Value2:data2[i]};}}}return result;};this.RGB=function(r,g,b){var rgb='RGB('+r+','+g+','+b+')';return rgb;};this.RGBA=function(r,g,b,a){var rgba='RGB('+r+','+g+','+b+','+a+')';return rgba;};this.UPCOLOR=function(color){return color;};this.DOWNCOLOR=function(color){return color;}
|
|
9077
|
+
for(var i=0;i<this.SymbolData.Data.Data.length;++i){drawData[i]=null;if(IsNumber&&IsNumber2){drawData[i]={Value:data,Value2:data2};}else if(IsNumber&&!IsNumber2){if(isNaN(data2[i]))continue;drawData[i]={Value:data,Value2:data2[i]};}else if(!IsNumber&&IsNumber2){if(isNaN(data[i]))continue;drawData[i]={Value:data[i],Value2:data2};}else{if(isNaN(data[i])||isNaN(data2[i]))continue;drawData[i]={Value:data[i],Value2:data2[i]};}}}else{for(var i=0;i<condition.length;++i){drawData[i]=null;if(isNaN(condition[i])||!condition[i])continue;if(IsNumber&&IsNumber2){drawData[i]={Value:data,Value2:data2};}else if(IsNumber&&!IsNumber2){if(isNaN(data2[i]))continue;drawData[i]={Value:data,Value2:data2[i]};}else if(!IsNumber&&IsNumber2){if(isNaN(data[i]))continue;drawData[i]={Value:data[i],Value2:data2};}else{if(isNaN(data[i])||isNaN(data2[i]))continue;drawData[i]={Value:data[i],Value2:data2[i]};}}}return result;};this.RGB=function(r,g,b){var rgb='RGB('+r+','+g+','+b+')';return rgb;};this.RGBA=function(r,g,b,a){var rgba='RGB('+r+','+g+','+b+','+a+')';return rgba;};this.UPCOLOR=function(color){return color;};this.DOWNCOLOR=function(color){return color;};//数据左右偏移
|
|
9078
|
+
this.XMOVE=function(offset){return offset;};//数据上下偏移
|
|
9079
|
+
this.YMOVE=function(offset){return offset;};/*
|
|
9076
9080
|
SOUND 播放声音。用法:SOUND(NAME),播放NAME
|
|
9077
9081
|
注:
|
|
9078
9082
|
1、点击设置声音按钮,在弹出来的界面中设置声音,声音用字符'A'~'J'表示。
|
|
@@ -9704,14 +9708,14 @@ var isNoneName=false;var isShowTitle=true;//显示在位置之上,对于DRAWTEXT
|
|
|
9704
9708
|
var isDrawAbove=false;var isDrawCenter=false;var isDrawBelow=false;//VALIGN0,VALIGN1,VALIGN2 设置文字垂直对齐方式(上中下)
|
|
9705
9709
|
//ALIGN0,ALIGN1,ALIGN2 设置文字水平对齐方式(左中右)
|
|
9706
9710
|
var drawAlign=-1,drawVAlign=-1;var fontSize=-1;var bgConfig=null;//背景设置
|
|
9707
|
-
var vLineConfig=null;for(var _j13=0;_j13<item.Expression.Expression.length;++_j13){var itemExpression=item.Expression.Expression[_j13];if(itemExpression.Type==Syntax.AssignmentExpression&&itemExpression.Operator==':'&&itemExpression.Left){if(_j13==0){_varName3=itemExpression.Left.Name;var varValue=this.VarTable.get(_varName3);if(this.VarDrawTable.has(_varName3))//绘图函数赋值
|
|
9711
|
+
var vLineConfig=null;var xOffset=null,yOffset=null;for(var _j13=0;_j13<item.Expression.Expression.length;++_j13){var itemExpression=item.Expression.Expression[_j13];if(itemExpression.Type==Syntax.AssignmentExpression&&itemExpression.Operator==':'&&itemExpression.Left){if(_j13==0){_varName3=itemExpression.Left.Name;var varValue=this.VarTable.get(_varName3);if(this.VarDrawTable.has(_varName3))//绘图函数赋值
|
|
9708
9712
|
{_draw3=this.VarDrawTable.get(_varName3);}else if(!Array.isArray(varValue)){varValue=this.SingleDataToArrayData(varValue);this.VarTable.set(_varName3,varValue);//把常量放到变量表里
|
|
9709
9713
|
}}else{}}else if(itemExpression.Type==Syntax.Identifier){var value=itemExpression.Name;if(value==='COLORSTICK')colorStick=true;else if(value==='POINTDOT')pointDot=true;else if(value==='CIRCLEDOT')circleDot=true;else if(value==='DOTLINE')isDotLine=true;else if(value=="UPDOWNDOT")upDownDot=true;else if(value==='LINESTICK')lineStick=true;else if(value==='STICK')stick=true;else if(value==='VOLSTICK')volStick=true;else if(value==="DRAWABOVE")isDrawAbove=true;else if(value==="DRAWCENTER")isDrawCenter=true;else if(value=="DRAWBELOW")isDrawBelow=true;else if(value=="STEPLINE")stepLine=true;else if(value.indexOf('COLOR')==0)color=value;else if(value.indexOf('LINETHICK')==0)lineWidth=value;else if(value=="ALIGN0")drawAlign=0;else if(value=="ALIGN1")drawAlign=1;else if(value=="ALIGN2")drawAlign=2;else if(value=="VALIGN0")drawVAlign=0;else if(value=="VALIGN1")drawVAlign=1;else if(value=="VALIGN2")drawVAlign=2;else if(value.indexOf('NODRAW')==0)isShow=false;else if(value.indexOf('EXDATA')==0)isExData=true;//扩展数据, 不显示再图形里面
|
|
9710
9714
|
else if(value.indexOf('LINEOVERLAY')==0)isOverlayLine=true;else if(value.indexOf("NOTEXT")==0||value.indexOf("NOTITLE")==0)isShowTitle=false;//标题不显示
|
|
9711
9715
|
else if(value.indexOf("FONTSIZE")==0){var strFontSize=value.replace("FONTSIZE","");fontSize=parseInt(strFontSize);}else{if(_j13==0){_varName3=itemExpression.Name;var _varValue=this.ReadVariable(_varName3,itemExpression);if(!Array.isArray(_varValue))_varValue=this.SingleDataToArrayData(_varValue);_varName3="__temp_si_"+i+"__";isNoneName=true;this.VarTable.set(_varName3,_varValue);//放到变量表里
|
|
9712
9716
|
}}}else if(itemExpression.Type==Syntax.Literal)//常量
|
|
9713
9717
|
{if(_j13==0){var aryValue=this.SingleDataToArrayData(itemExpression.Value);_varName3=itemExpression.Value.toString();this.VarTable.set(_varName3,aryValue);//把常量放到变量表里
|
|
9714
|
-
}}else if(itemExpression.Type==Syntax.CallExpression){if(_j13==0){if(this.Draw.IsDrawFunction(itemExpression.Callee.Name)){_draw3=itemExpression.Draw;_draw3.Name=itemExpression.Callee.Name;}else{var _varValue2=itemExpression.Out;_varName3='__temp_sc_'+itemExpression.Callee.Name+'_'+i+'__';isNoneName=true;this.VarTable.set(_varName3,_varValue2);}}else{if(itemExpression.Callee.Name=="RGB"||itemExpression.Callee.Name=="RGBA"){color=itemExpression.Out;}else if(itemExpression.Callee.Name=="UPCOLOR"){upColor=itemExpression.Out;}else if(itemExpression.Callee.Name=="DOWNCOLOR"){downColor=itemExpression.Out;}else if(itemExpression.Callee.Name=="SOUND"){var event=this.GetSoundEvent();if(event){}_varName3=null;}else if(itemExpression.Callee.Name=="ICON"){var drawCond=this.VarTable.get(_varName3);if(drawCond){_draw3=this.GetOutIconData(drawCond,itemExpression.Draw);if(_draw3)_draw3.Name=itemExpression.Callee.Name;}_varName3=null;}else if(itemExpression.Callee.Name=="BACKGROUND"){bgConfig=itemExpression.Draw;_varName3=null;}else if(itemExpression.Callee.Name=="CKLINE"){vLineConfig=itemExpression.Draw;_varName3=null;}}}else if(itemExpression.Type==Syntax.BinaryExpression){if(_j13==0){_varName3="__temp_sb_"+i+"__";var _aryValue=itemExpression.Out;isNoneName=true;this.VarTable.set(_varName3,_aryValue);}}}if(pointDot&&_varName3)//圆点
|
|
9718
|
+
}}else if(itemExpression.Type==Syntax.CallExpression){if(_j13==0){if(this.Draw.IsDrawFunction(itemExpression.Callee.Name)){_draw3=itemExpression.Draw;_draw3.Name=itemExpression.Callee.Name;}else{var _varValue2=itemExpression.Out;_varName3='__temp_sc_'+itemExpression.Callee.Name+'_'+i+'__';isNoneName=true;this.VarTable.set(_varName3,_varValue2);}}else{if(itemExpression.Callee.Name=="RGB"||itemExpression.Callee.Name=="RGBA"){color=itemExpression.Out;}else if(itemExpression.Callee.Name=="UPCOLOR"){upColor=itemExpression.Out;}else if(itemExpression.Callee.Name=="DOWNCOLOR"){downColor=itemExpression.Out;}else if(itemExpression.Callee.Name=="XMOVE"){xOffset=itemExpression.Out;}else if(itemExpression.Callee.Name=="YMOVE"){yOffset=itemExpression.Out;}else if(itemExpression.Callee.Name=="SOUND"){var event=this.GetSoundEvent();if(event){}_varName3=null;}else if(itemExpression.Callee.Name=="ICON"){var drawCond=this.VarTable.get(_varName3);if(drawCond){_draw3=this.GetOutIconData(drawCond,itemExpression.Draw);if(_draw3)_draw3.Name=itemExpression.Callee.Name;}_varName3=null;}else if(itemExpression.Callee.Name=="BACKGROUND"){bgConfig=itemExpression.Draw;_varName3=null;}else if(itemExpression.Callee.Name=="CKLINE"){vLineConfig=itemExpression.Draw;_varName3=null;}}}else if(itemExpression.Type==Syntax.BinaryExpression){if(_j13==0){_varName3="__temp_sb_"+i+"__";var _aryValue=itemExpression.Out;isNoneName=true;this.VarTable.set(_varName3,_aryValue);}}}if(pointDot&&_varName3)//圆点
|
|
9715
9719
|
{var _outVar7=this.VarTable.get(_varName3);if(!Array.isArray(_outVar7))_outVar7=this.SingleDataToArrayData(_outVar7);var _value4={Name:_varName3,Data:_outVar7,Radius:g_JSChartResource.POINTDOT.Radius,Type:3};if(color)_value4.Color=color;if(lineWidth)_value4.LineWidth=lineWidth;this.OutVarTable.push(_value4);}else if(circleDot&&_varName3)//圆点
|
|
9716
9720
|
{var _outVar8=this.VarTable.get(_varName3);if(!Array.isArray(_outVar8))_outVar8=this.SingleDataToArrayData(_outVar8);var _value5={Name:_varName3,Data:_outVar8,Radius:g_JSChartResource.CIRCLEDOT.Radius,Type:3};if(color)_value5.Color=color;if(lineWidth)_value5.LineWidth=lineWidth;this.OutVarTable.push(_value5);}else if(upDownDot&&_varName3)//彩色点
|
|
9717
9721
|
{var _outVar9=this.VarTable.get(_varName3);if(!Array.isArray(_outVar9))_outVar9=this.SingleDataToArrayData(_outVar9);var _value6={Name:_varName3,Data:_outVar9,Radius:g_JSChartResource.CIRCLEDOT.Radius,Type:3,UpDownDot:true};if(color)_value6.Color=color;if(lineWidth)_value6.LineWidth=lineWidth;this.OutVarTable.push(_value6);}else if(lineStick&&_varName3)//LINESTICK 同时画出柱状线和指标线
|
|
@@ -9719,14 +9723,14 @@ else if(value.indexOf("FONTSIZE")==0){var strFontSize=value.replace("FONTSIZE","
|
|
|
9719
9723
|
{var _outVar11=this.VarTable.get(_varName3);var _value8={Name:_varName3,Data:_outVar11,Type:5};if(color)_value8.Color=color;if(lineWidth)_value8.LineWidth=lineWidth;this.OutVarTable.push(_value8);}else if(volStick&&_varName3)//VOLSTICK 画彩色柱状线
|
|
9720
9724
|
{var _outVar12=this.VarTable.get(_varName3);var _value9={Name:_varName3,Data:_outVar12,Type:6};if(color)_value9.Color=color;if(upColor)_value9.UpColor=upColor;if(downColor)_value9.DownColor=downColor;this.OutVarTable.push(_value9);}else if(colorStick&&_varName3)//CYW: SUM(VAR4,10)/10000, COLORSTICK; 画上下柱子
|
|
9721
9725
|
{var _outVar13=this.VarTable.get(_varName3);var _value10={Name:_varName3,Data:_outVar13,Color:color,Type:2};if(lineWidth)_value10.LineWidth=lineWidth;if(color)_value10.Color=color;this.OutVarTable.push(_value10);}else if(_varName3&&color&&!_draw3){var _outVar14=this.VarTable.get(_varName3);if(!Array.isArray(_outVar14))_outVar14=this.SingleDataToArrayData(_outVar14);var _value11={Name:_varName3,Data:_outVar14,Color:color,Type:0};if(lineWidth)_value11.LineWidth=lineWidth;if(isShow==false)_value11.IsShow=false;if(isExData==true)_value11.IsExData=true;if(isDotLine==true)_value11.IsDotLine=true;if(isOverlayLine==true)_value11.IsOverlayLine=true;if(isNoneName==true)_value11.NoneName=true;if(isShowTitle==false)_value11.IsShowTitle=false;if(stepLine==true)_value11.Type=7;this.OutVarTable.push(_value11);}else if(_draw3)//画图函数
|
|
9722
|
-
{var outVar={Name:_draw3.Name,Draw:_draw3,Type:1};if(color)outVar.Color=color;if(isDotLine==true)outVar.IsDotLine=true;if(lineWidth)outVar.LineWidth=lineWidth;if(isDrawAbove)outVar.IsDrawAbove=true;if(isDrawCenter)outVar.IsDrawCenter=true;if(isDrawBelow)outVar.IsDrawBelow=true;if(drawAlign>=0)outVar.DrawAlign=drawAlign;if(drawVAlign>=0)outVar.DrawVAlign=drawVAlign;if(fontSize>0)outVar.DrawFontSize=fontSize;if(bgConfig)outVar.Background=bgConfig;if(vLineConfig)outVar.VerticalLine=vLineConfig;this.OutVarTable.push(outVar);}else if(_varName3){var _outVar15=this.VarTable.get(_varName3);var _value12={Name:_varName3,Data:_outVar15,Type:0};if(color)_value12.Color=color;if(lineWidth)_value12.LineWidth=lineWidth;if(isShow==false)_value12.IsShow=false;if(isExData==true)_value12.IsExData=true;if(isDotLine==true)_value12.IsDotLine=true;if(isOverlayLine==true)_value12.IsOverlayLine=true;if(isShowTitle==false)_value12.IsShowTitle=false;if(stepLine==true)_value12.Type=7;this.OutVarTable.push(_value12);}}}};this.GetOutIconData=function(cond,iconDraw){if(Array.isArray(cond)){for(var i=0;i<cond.length&&i<iconDraw.DrawData.length;++i){var item=cond[i];if(item<=0)iconDraw.DrawData[i]=null;}return iconDraw;}if(cond)return iconDraw;return null;};this.GetSoundEvent=function(){if(!this.GetEventCallback)return null;return this.GetEventCallback(JSCHART_EVENT_ID.ON_PLAY_SOUND);};this.Run=function(){try{var data=this.RunAST();//执行脚本
|
|
9726
|
+
{var outVar={Name:_draw3.Name,Draw:_draw3,Type:1};if(color)outVar.Color=color;if(isDotLine==true)outVar.IsDotLine=true;if(lineWidth)outVar.LineWidth=lineWidth;if(isDrawAbove)outVar.IsDrawAbove=true;if(isDrawCenter)outVar.IsDrawCenter=true;if(isDrawBelow)outVar.IsDrawBelow=true;if(drawAlign>=0)outVar.DrawAlign=drawAlign;if(drawVAlign>=0)outVar.DrawVAlign=drawVAlign;if(fontSize>0)outVar.DrawFontSize=fontSize;if(bgConfig)outVar.Background=bgConfig;if(vLineConfig)outVar.VerticalLine=vLineConfig;if(IFrameSplitOperator.IsNumber(xOffset))outVar.XOffset=xOffset;if(IFrameSplitOperator.IsNumber(yOffset))outVar.YOffset=yOffset;this.OutVarTable.push(outVar);}else if(_varName3){var _outVar15=this.VarTable.get(_varName3);var _value12={Name:_varName3,Data:_outVar15,Type:0};if(color)_value12.Color=color;if(lineWidth)_value12.LineWidth=lineWidth;if(isShow==false)_value12.IsShow=false;if(isExData==true)_value12.IsExData=true;if(isDotLine==true)_value12.IsDotLine=true;if(isOverlayLine==true)_value12.IsOverlayLine=true;if(isShowTitle==false)_value12.IsShowTitle=false;if(stepLine==true)_value12.Type=7;this.OutVarTable.push(_value12);}}}};this.GetOutIconData=function(cond,iconDraw){if(Array.isArray(cond)){for(var i=0;i<cond.length&&i<iconDraw.DrawData.length;++i){var item=cond[i];if(item<=0)iconDraw.DrawData[i]=null;}return iconDraw;}if(cond)return iconDraw;return null;};this.GetSoundEvent=function(){if(!this.GetEventCallback)return null;return this.GetEventCallback(JSCHART_EVENT_ID.ON_PLAY_SOUND);};this.Run=function(){try{var data=this.RunAST();//执行脚本
|
|
9723
9727
|
JSConsole.Complier.Log('[JSComplier.Run] execute finish',data);if(this.IndexCtrl)this.IndexCtrl.Status=0;if(this.UpdateUICallback){JSConsole.Complier.Log('[JSComplier.Run] invoke UpdateUICallback.');if(this.CallbackParam&&this.CallbackParam.Job&&this.CallbackParam.Job.ID==JS_EXECUTE_JOB_ID.JOB_EXECUTE_INDEX){this.UpdateUICallback(data,this.CallbackParam,this.SymbolData);}else{if(this.CallbackParam&&this.CallbackParam.Self&&this.CallbackParam.Self.ClassName==='ScriptIndexConsole')this.CallbackParam.JSExecute=this;if(this.IsUsePageData==true)this.CallbackParam.Self.IsUsePageData=true;this.UpdateUICallback(data,this.CallbackParam);}}}catch(error){JSConsole.Complier.Log(error);if(error.Job){JSConsole.Complier.Log('[JSComplier.Run] download job and reexectue',error.Job);this.JobList.push(error.Job);this.JobList.push({ID:JS_EXECUTE_JOB_ID.JOB_RUN_SCRIPT});this.Execute();}else if(this.ErrorCallback){if(this.IndexCtrl)this.IndexCtrl.Status=0;this.ErrorCallback(error,this.CallbackParam);}}};this.DebugRun_End=function(){var data=this.OutVarTable;JSConsole.Complier.Log('[JSComplier.DebugRun_End] execute finish',data);if(this.IndexCtrl)this.IndexCtrl.Status=0;if(this.UpdateUICallback){JSConsole.Complier.Log('[JSComplier.DebugRun_End] invoke UpdateUICallback.');if(this.CallbackParam&&this.CallbackParam.Job&&this.CallbackParam.Job.ID==JS_EXECUTE_JOB_ID.JOB_EXECUTE_INDEX){this.UpdateUICallback(data,this.CallbackParam,this.SymbolData);}else{if(this.CallbackParam&&this.CallbackParam.Self&&this.CallbackParam.Self.ClassName==='ScriptIndexConsole')this.CallbackParam.JSExecute=this;if(this.IsUsePageData==true)this.CallbackParam.Self.IsUsePageData=true;this.UpdateUICallback(data,this.CallbackParam);}}};this.DebugRun_Next=function(debugCtrl){var _this38=this;if(debugCtrl.ExeLine<debugCtrl.LineCount){var item=this.AST.Body[debugCtrl.ExeLine];this.RunASTNode(item);++debugCtrl.ExeLine;this.DebugFilter(debugCtrl,function(){_this38.DebugRun_Next(debugCtrl);});}else{this.DebugRun_End();debugCtrl.Status=2;this.DebugFilter(debugCtrl,null);}};//debug模式
|
|
9724
9728
|
this.DebugRun=function(){var _this39=this;try{if(!this.AST)this.ThrowError();if(!this.AST.Body)this.ThrowError();var debugCtrl={LineCount:this.AST.Body.length,ExeLine:0,Self:this,Status:1};this.DebugFilter(debugCtrl,function(){_this39.DebugRun_Next(debugCtrl);});}catch(error){if(this.ErrorCallback){if(this.IndexCtrl)this.IndexCtrl.Status=0;this.ErrorCallback(error,this.CallbackParam);}}};this.VisitNode=function(node){switch(node.Type){case Syntax.SequenceExpression:this.VisitSequenceExpression(node);break;case Syntax.ExpressionStatement:this.VisitNode(node.Expression);break;case Syntax.AssignmentExpression:this.VisitAssignmentExpression(node);break;case Syntax.BinaryExpression:case Syntax.LogicalExpression:this.VisitBinaryExpression(node);break;case Syntax.CallExpression:this.VisitCallExpression(node);break;}};this.VisitSequenceExpression=function(node){for(var _i146 in node.Expression){var _item24=node.Expression[_i146];this.VisitNode(_item24);}};//函数调用
|
|
9725
9729
|
this.VisitCallExpression=function(node){var funcName=node.Callee.Name;var args=[];for(var i=0;i<node.Arguments.length;++i){var item=node.Arguments[i];var value;if(funcName==="IFC"&&i>=1)break;//IFC先处理第1个条件参数
|
|
9726
9730
|
if(item.Type==Syntax.BinaryExpression||item.Type==Syntax.LogicalExpression)value=this.VisitBinaryExpression(item);else if(item.Type==Syntax.CallExpression)value=this.VisitCallExpression(item);else value=this.GetNodeValue(item);args.push(value);}if(funcName==="IFC"){//IFC(X,A,B)若X不为0则执行A,否则执行B.IFC与IF函数的区别:根据X的值来选择性执行A、B表达式.
|
|
9727
9731
|
var bResult=this.Algorithm.IFC(args[0]);var item=bResult?node.Arguments[1]:node.Arguments[2];var value;if(item.Type==Syntax.BinaryExpression||item.Type==Syntax.LogicalExpression)value=this.VisitBinaryExpression(item);else if(item.Type==Syntax.CallExpression)value=this.VisitCallExpression(item);else value=this.GetNodeValue(item);node.Out=value;if(item.Draw)node.Draw=item.Draw;return node.Out;}//JSConsole.Complier.Log('[JSExecute::VisitCallExpression]' , funcName, '(', args.toString() ,')');
|
|
9728
9732
|
if(g_JSComplierResource.IsCustomFunction(funcName)){var data=this.Algorithm.CallCustomFunction(funcName,args,this.SymbolData,node);node.Out=[];node.Draw=null;if(data){if(data.Out)node.Out=data.Out;if(data.Draw)node.Draw=data.Draw;}return node.Out;}switch(funcName){case'DYNAINFO'://行情最新数据
|
|
9729
|
-
node.Out=this.SymbolData.GetLatestCacheData(args[0]);break;case'STICKLINE':node.Draw=this.Draw.STICKLINE(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWTEXT':node.Draw=this.Draw.DRAWTEXT(args[0],args[1],args[2]);node.Out=[];break;case'DRAWTEXT_FIX':node.Draw=this.Draw.DRAWTEXT_FIX(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'SUPERDRAWTEXT':node.Draw=this.Draw.SUPERDRAWTEXT(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWICON':node.Draw=this.Draw.DRAWICON(args[0],args[1],args[2]);node.Out=[];break;case"ICON":node.Draw=this.Draw.ICON(args[0],args[1]);node.Out=[];break;case"BACKGROUND":node.Draw=this.Draw.BACKGROUND(args[0],args[1],args[2],args[3],args[4],args[5]);node.Out=[];break;case"CKLINE":node.Draw=this.Draw.CKLINE(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWLINE':node.Draw=this.Draw.DRAWLINE(args[0],args[1],args[2],args[3],args[4]);node.Out=node.Draw.DrawData;break;case'DRAWBAND':node.Draw=this.Draw.DRAWBAND(args[0],args[1],args[2],args[3]);node.Out=[];break;case"FILLRGN":if(args.length>=4)node.Draw=this.Draw.FILLRGN2(args);else node.Draw=this.Draw.FILLRGN(args[0],args[1],args[2]);node.Out=[];break;case"FLOATRGN":node.Draw=this.Draw.FLOATRGN(args);node.Out=[];break;case"FILLTOPRGN":node.Draw=this.Draw.FILLBGRGN(1,args);node.Out=[];break;case"FILLBOTTOMRGN":node.Draw=this.Draw.FILLBGRGN(0,args);node.Out=[];break;case"FILLVERTICALRGN":node.Draw=this.Draw.FILLVERTICALRGN(args);node.Out=[];break;case'DRAWKLINE':case"DRAWKLINE1":node.Draw=this.Draw.DRAWKLINE(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWKLINE_IF':node.Draw=this.Draw.DRAWKLINE_IF(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"DRAWCOLORKLINE":node.Draw=this.Draw.DRAWCOLORKLINE(args[0],args[1],args[2]);node.Out=[];break;case'PLOYLINE':case'POLYLINE':node.Draw=this.Draw.POLYLINE(args[0],args[1]);node.Out=node.Draw.DrawData;break;case'DRAWNUMBER':node.Draw=this.Draw.DRAWNUMBER(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Value;break;case"DRAWNUMBER_FIX":node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);node.Out=node.Draw.DrawData.Value;break;case"DRAWCHANNEL":node.Draw=this.Draw.DRAWCHANNEL(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);node.Out=[];break;case'RGB':node.Out=this.Draw.RGB(args[0],args[1],args[2]);break;case"RGBA":node.Out=this.Draw.RGBA(args[0],args[1],args[2],args[3]);break;case"UPCOLOR":node.Out=this.Draw.UPCOLOR(args[0]);break;case"DOWNCOLOR":node.Out=this.Draw.DOWNCOLOR(args[0]);break;case'PARTLINE':node.Draw=this.Draw.PARTLINE(args);node.Out=[];break;case'DRAWGBK':node.Draw=this.Draw.DRAWGBK(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWGBK2':node.Draw=this.Draw.DRAWGBK2(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWTEXT_LINE':node.Draw=this.Draw.DRAWTEXT_LINE(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);node.Out=[];break;case'DRAWRECTREL':node.Draw=this.Draw.DRAWRECTREL(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"DRAWTEXTREL":node.Draw=this.Draw.DRAWTEXTREL(args[0],args[1],args[2]);node.Out=[];break;case"DRAWTEXTABS":node.Draw=this.Draw.DRAWTEXTABS(args[0],args[1],args[2]);node.Out=[];break;case"DRAWOVERLAYLINE":node.Draw=this.Draw.DRAWOVERLAYLINE(args[0],args[1],args[2]);node.Out=node.Draw.DrawData.Data;break;case"DRAWSL":node.Draw=this.Draw.DRAWSL(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"VERTLINE":node.Draw=this.Draw.VERTLINE(args[0],args[1]);node.Out=node.Draw.DrawData.Data;break;case"HORLINE":node.Draw=this.Draw.HORLINE(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case'CODELIKE':node.Out=this.SymbolData.CODELIKE(args[0]);break;case'NAMELIKE':case"NAMEINCLUDE":node.Out=this.SymbolData.NAMELIKE(args[1]);break;case'REFDATE':node.Out=this.SymbolData.REFDATE(args[0],args[1]);break;case'FINANCE':node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:1,Node:node});break;case"FINVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:1,Node:node});break;case"FINONE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"GPJYVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"SCJYVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"MARGIN":node.Out=this.SymbolData.GetMarginCacheData(args[0],node);break;case"HK2SHSZ":node.Out=this.SymbolData.GetHKToSHSZCacheData(args[0],node);break;case"NEWS":node.Out=this.SymbolData.GetNewsAnalysisCacheData(args[0],node);break;case'UPCOUNT':case'DOWNCOUNT':node.Out=this.SymbolData.GetIndexIncreaseCacheData(funcName,args[0],node);break;case'SF':node.Out=this.SymbolData.GetSectionFinanceCacheData(args[0],args[1],args[2],node);break;case'LOADAPIDATA':node.Out=this.SymbolData.GetCustomApiData(args);break;case"STKINDI":node.Out=this.SymbolData.GetScriptIndexOutData(args,node);break;case"SOUND":node.Draw=this.Draw.SOUND(args[0]);node.Out=[];break;case"PLAYSOUND":node.Draw=this.Draw.PLAYSOUND(args[0],args[1]);node.Out=[];break;case'CLOSE':case'C':case'VOL':case'V':case'OPEN':case'O':case'HIGH':case'H':case'LOW':case'L':case'AMOUNT':case'AMO':node.Out=this.SymbolData.GetOtherSymolCacheData({FunctionName:funcName,Args:args});break;case"INBLOCK":node.Out=this.SymbolData.IsInBlock(args[0],node);break;case'COVER_C':case'COVER_O':case'COVER_H':case'COVER_L':case'COVER_A':case'COVER_V':if(args.length==2)return this.SymbolData.GetSymbolPeriodCacheData2(JSComplierHelper.GetConvertValueName(funcName),args[0],args[1]);return this.SymbolData.GetSymbolPeriodCacheData(JSComplierHelper.GetConvertValueName(funcName),args[0]);case"SYSPARAM":return this.SymbolData.SysParam(args[0],this);case"TESTSKIP":var bExit=this.Algorithm.TESTSKIP(args[0],node);node.Out=null;if(bExit){this.Interrupt.Exit=true;if(node&&node.Marker){var marker=node.Marker;this.Interrupt.Line=marker.Line;this.Interrupt.Index=marker.Index;this.Interrupt.Column=marker.Column;}}break;default:node.Out=this.Algorithm.CallFunction(funcName,args,node,this.SymbolData);break;}return node.Out;};//赋值
|
|
9733
|
+
node.Out=this.SymbolData.GetLatestCacheData(args[0]);break;case'STICKLINE':node.Draw=this.Draw.STICKLINE(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWTEXT':node.Draw=this.Draw.DRAWTEXT(args[0],args[1],args[2]);node.Out=[];break;case'DRAWTEXT_FIX':node.Draw=this.Draw.DRAWTEXT_FIX(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'SUPERDRAWTEXT':node.Draw=this.Draw.SUPERDRAWTEXT(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWICON':node.Draw=this.Draw.DRAWICON(args[0],args[1],args[2]);node.Out=[];break;case"ICON":node.Draw=this.Draw.ICON(args[0],args[1]);node.Out=[];break;case"BACKGROUND":node.Draw=this.Draw.BACKGROUND(args[0],args[1],args[2],args[3],args[4],args[5]);node.Out=[];break;case"CKLINE":node.Draw=this.Draw.CKLINE(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case'DRAWLINE':node.Draw=this.Draw.DRAWLINE(args[0],args[1],args[2],args[3],args[4]);node.Out=node.Draw.DrawData;break;case'DRAWBAND':node.Draw=this.Draw.DRAWBAND(args[0],args[1],args[2],args[3]);node.Out=[];break;case"FILLRGN":if(args.length>=4)node.Draw=this.Draw.FILLRGN2(args);else node.Draw=this.Draw.FILLRGN(args[0],args[1],args[2]);node.Out=[];break;case"FLOATRGN":node.Draw=this.Draw.FLOATRGN(args);node.Out=[];break;case"FILLTOPRGN":node.Draw=this.Draw.FILLBGRGN(1,args);node.Out=[];break;case"FILLBOTTOMRGN":node.Draw=this.Draw.FILLBGRGN(0,args);node.Out=[];break;case"FILLVERTICALRGN":node.Draw=this.Draw.FILLVERTICALRGN(args);node.Out=[];break;case'DRAWKLINE':case"DRAWKLINE1":node.Draw=this.Draw.DRAWKLINE(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWKLINE_IF':node.Draw=this.Draw.DRAWKLINE_IF(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"DRAWCOLORKLINE":node.Draw=this.Draw.DRAWCOLORKLINE(args[0],args[1],args[2]);node.Out=[];break;case'PLOYLINE':case'POLYLINE':node.Draw=this.Draw.POLYLINE(args[0],args[1]);node.Out=node.Draw.DrawData;break;case'DRAWNUMBER':node.Draw=this.Draw.DRAWNUMBER(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Value;break;case"DRAWNUMBER_FIX":node.Draw=this.Draw.DRAWNUMBER_FIX(args[0],args[1],args[2],args[3],args[4]);node.Out=node.Draw.DrawData.Value;break;case"DRAWCHANNEL":node.Draw=this.Draw.DRAWCHANNEL(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);node.Out=[];break;case'RGB':node.Out=this.Draw.RGB(args[0],args[1],args[2]);break;case"RGBA":node.Out=this.Draw.RGBA(args[0],args[1],args[2],args[3]);break;case"UPCOLOR":node.Out=this.Draw.UPCOLOR(args[0]);break;case"DOWNCOLOR":node.Out=this.Draw.DOWNCOLOR(args[0]);break;case"XMOVE":node.Out=this.Draw.XMOVE(args[0]);break;case"YMOVE":node.Out=this.Draw.YMOVE(args[0]);break;case'PARTLINE':node.Draw=this.Draw.PARTLINE(args);node.Out=[];break;case'DRAWGBK':node.Draw=this.Draw.DRAWGBK(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWGBK2':node.Draw=this.Draw.DRAWGBK2(args[0],args[1],args[2],args[3]);node.Out=[];break;case'DRAWTEXT_LINE':node.Draw=this.Draw.DRAWTEXT_LINE(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);node.Out=[];break;case'DRAWRECTREL':node.Draw=this.Draw.DRAWRECTREL(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"DRAWTEXTREL":node.Draw=this.Draw.DRAWTEXTREL(args[0],args[1],args[2]);node.Out=[];break;case"DRAWTEXTABS":node.Draw=this.Draw.DRAWTEXTABS(args[0],args[1],args[2]);node.Out=[];break;case"DRAWOVERLAYLINE":node.Draw=this.Draw.DRAWOVERLAYLINE(args[0],args[1],args[2]);node.Out=node.Draw.DrawData.Data;break;case"DRAWSL":node.Draw=this.Draw.DRAWSL(args[0],args[1],args[2],args[3],args[4]);node.Out=[];break;case"VERTLINE":node.Draw=this.Draw.VERTLINE(args[0],args[1]);node.Out=node.Draw.DrawData.Data;break;case"HORLINE":node.Draw=this.Draw.HORLINE(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case'CODELIKE':node.Out=this.SymbolData.CODELIKE(args[0]);break;case'NAMELIKE':case"NAMEINCLUDE":node.Out=this.SymbolData.NAMELIKE(args[1]);break;case'REFDATE':node.Out=this.SymbolData.REFDATE(args[0],args[1]);break;case'FINANCE':node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:1,Node:node});break;case"FINVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:1,Node:node});break;case"FINONE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"GPJYVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"SCJYVALUE":node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:3,Node:node});break;case"MARGIN":node.Out=this.SymbolData.GetMarginCacheData(args[0],node);break;case"HK2SHSZ":node.Out=this.SymbolData.GetHKToSHSZCacheData(args[0],node);break;case"NEWS":node.Out=this.SymbolData.GetNewsAnalysisCacheData(args[0],node);break;case'UPCOUNT':case'DOWNCOUNT':node.Out=this.SymbolData.GetIndexIncreaseCacheData(funcName,args[0],node);break;case'SF':node.Out=this.SymbolData.GetSectionFinanceCacheData(args[0],args[1],args[2],node);break;case'LOADAPIDATA':node.Out=this.SymbolData.GetCustomApiData(args);break;case"STKINDI":node.Out=this.SymbolData.GetScriptIndexOutData(args,node);break;case"SOUND":node.Draw=this.Draw.SOUND(args[0]);node.Out=[];break;case"PLAYSOUND":node.Draw=this.Draw.PLAYSOUND(args[0],args[1]);node.Out=[];break;case'CLOSE':case'C':case'VOL':case'V':case'OPEN':case'O':case'HIGH':case'H':case'LOW':case'L':case'AMOUNT':case'AMO':node.Out=this.SymbolData.GetOtherSymolCacheData({FunctionName:funcName,Args:args});break;case"INBLOCK":node.Out=this.SymbolData.IsInBlock(args[0],node);break;case'COVER_C':case'COVER_O':case'COVER_H':case'COVER_L':case'COVER_A':case'COVER_V':if(args.length==2)return this.SymbolData.GetSymbolPeriodCacheData2(JSComplierHelper.GetConvertValueName(funcName),args[0],args[1]);return this.SymbolData.GetSymbolPeriodCacheData(JSComplierHelper.GetConvertValueName(funcName),args[0]);case"SYSPARAM":return this.SymbolData.SysParam(args[0],this);case"TESTSKIP":var bExit=this.Algorithm.TESTSKIP(args[0],node);node.Out=null;if(bExit){this.Interrupt.Exit=true;if(node&&node.Marker){var marker=node.Marker;this.Interrupt.Line=marker.Line;this.Interrupt.Index=marker.Index;this.Interrupt.Column=marker.Column;}}break;default:node.Out=this.Algorithm.CallFunction(funcName,args,node,this.SymbolData);break;}return node.Out;};//赋值
|
|
9730
9734
|
this.VisitAssignmentExpression=function(node){var left=node.Left;if(left.Type!=Syntax.Identifier)this.ThrowUnexpectedNode(node);var varName=left.Name;var right=node.Right;var value=null,drawValue=null;if(right.Type==Syntax.BinaryExpression||right.Type==Syntax.LogicalExpression)value=this.VisitBinaryExpression(right);else if(right.Type==Syntax.CallExpression){value=this.VisitCallExpression(right);if(right.Draw)drawValue=right.Draw;}else if(right.Type==Syntax.Literal){value=right.Value;if(IFrameSplitOperator.IsString(value)&&right.Value.indexOf("$")>0)value=this.SymbolData.GetOtherSymolCacheData({Literal:value});}else if(right.Type==Syntax.Identifier)//右值是变量
|
|
9731
9735
|
value=this.ReadVariable(right.Name,right);else if(right.Type==Syntax.MemberExpression)value=this.ReadMemberVariable(right);else if(right.Type==Syntax.UnaryExpression){if(right.Operator=='-'){var tempValue=this.GetNodeValue(right.Argument);value=this.Algorithm.Subtract(0,tempValue);}else{value=right.Argument.Value;}}if(JS_EXECUTE_DEBUG_LOG)JSConsole.Complier.Log('[JSExecute::VisitAssignmentExpression]',varName,' = ',value);if(drawValue)this.VarDrawTable.set(varName,drawValue);this.VarTable.set(varName,value);};//逻辑运算
|
|
9732
9736
|
this.VisitBinaryExpression=function(node){var stack=[];stack.push(node);var temp=null;while(stack.length!=0){temp=stack[stack.length-1];if(temp.Left&&node!=temp.Left&&node!=temp.Right){stack.push(temp.Left);}else if(temp.Right&&node!=temp.Right){stack.push(temp.Right);}else{var value=stack.pop();if(value.Type==Syntax.BinaryExpression)//只遍历操作符就可以
|
|
@@ -9893,7 +9897,7 @@ this.CreateDrawNumber=function(hqChart,windowIndex,varItem,id){var chartText=new
|
|
|
9893
9897
|
if(varItem.Draw.FixedPosition==="TOP")chartText.FixedPosition=1;else if(varItem.Draw.FixedPosition==="BOTTOM")chartText.FixedPosition=2;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.TextBaseline='top';else if(varItem.DrawVAlign==1)chartText.TextBaseline='middle';else if(varItem.DrawVAlign==2)chartText.TextBaseline='bottom';}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;if(varItem.Background)chartText.TextBG=varItem.Background;if(varItem.VerticalLine)chartText.VerticalLine=varItem.VerticalLine;var titleIndex=windowIndex+1;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
9894
9898
|
hqChart.ChartPaint.push(chartText);};//DRAWTEXT
|
|
9895
9899
|
this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id){var chartText=new ChartDrawText();chartText.Canvas=hqChart.Canvas;chartText.Name=varItem.Name;chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chartText.ReloadResource();if(varItem.Color)chartText.Color=this.GetColor(varItem.Color);else chartText.Color=this.GetDefaultColor(id);if(varItem.IsDrawCenter===true)chartText.TextAlign='center';if(varItem.IsDrawAbove===true)chartText.TextBaseline='bottom';if(varItem.IsDrawBelow===true)chartText.TextBaseline='top';if(varItem.Draw.DrawData)chartText.Data.Data=varItem.Draw.DrawData;chartText.Text=varItem.Draw.Text;if(varItem.Draw.Direction>0)chartText.Direction=varItem.Draw.Direction;if(varItem.Draw.YOffset>0)chartText.YOffset=varItem.Draw.YOffset;if(varItem.Draw.TextAlign)chartText.TextAlign=varItem.Draw.TextAlign;//指定输出位置
|
|
9896
|
-
if(varItem.Draw.FixedPosition==="TOP")chartText.FixedPosition=1;else if(varItem.Draw.FixedPosition==="BOTTOM")chartText.FixedPosition=2;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.TextBaseline='top';else if(varItem.DrawVAlign==1)chartText.TextBaseline='middle';else if(varItem.DrawVAlign==2)chartText.TextBaseline='bottom';}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;if(varItem.Background)chartText.TextBG=varItem.Background;if(varItem.VerticalLine)chartText.VerticalLine=varItem.VerticalLine;var titleIndex=windowIndex+1;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
9900
|
+
if(varItem.Draw.FixedPosition==="TOP")chartText.FixedPosition=1;else if(varItem.Draw.FixedPosition==="BOTTOM")chartText.FixedPosition=2;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.TextBaseline='top';else if(varItem.DrawVAlign==1)chartText.TextBaseline='middle';else if(varItem.DrawVAlign==2)chartText.TextBaseline='bottom';}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;if(varItem.Background)chartText.TextBG=varItem.Background;if(varItem.VerticalLine)chartText.VerticalLine=varItem.VerticalLine;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chartText.ShowOffset.Y=varItem.YOffset;if(IFrameSplitOperator.IsNumber(varItem.XOffset))chartText.ShowOffset.X=varItem.XOffset;var titleIndex=windowIndex+1;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
9897
9901
|
hqChart.ChartPaint.push(chartText);};//COLORSTICK
|
|
9898
9902
|
this.CreateMACD=function(hqChart,windowIndex,varItem,id){var chartMACD=new ChartMACD();chartMACD.Canvas=hqChart.Canvas;chartMACD.Identify=this.Guid;chartMACD.Name=varItem.Name;chartMACD.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartMACD.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chartMACD.LineWidth=width;}var titleIndex=windowIndex+1;chartMACD.Data.Data=varItem.Data;var clrTitle=this.GetDefaultColor(id);if(varItem.Color)clrTitle=this.GetColor(varItem.Color);hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chartMACD.Data,varItem.Name,clrTitle);this.SetChartIndexName(chartMACD);hqChart.ChartPaint.push(chartMACD);};this.CreatePointDot=function(hqChart,windowIndex,varItem,id,hisData){var pointDot=new ChartPointDot();pointDot.Canvas=hqChart.Canvas;pointDot.Name=varItem.Name;pointDot.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;pointDot.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)pointDot.Color=this.GetColor(varItem.Color);else pointDot.Color=this.GetDefaultColor(id);if(varItem.Radius)pointDot.Radius=varItem.Radius;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)pointDot.Radius=width;}if(IFrameSplitOperator.IsBool(varItem.UpDownDot)){pointDot.EnableUpDownColor=varItem.UpDownDot;pointDot.HistoryData=hisData;}var titleIndex=windowIndex+1;pointDot.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(pointDot.Data,varItem.Name,pointDot.Color);hqChart.ChartPaint.push(pointDot);};this.CreateStick=function(hqChart,windowIndex,varItem,id){var chart=new ChartStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateLineStick=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.ChartPaint.push(chart);};this.CreateStraightLine=function(hqChart,windowIndex,varItem,id){var line=new ChartLine();line.DrawType=1;line.Canvas=hqChart.Canvas;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}var titleIndex=windowIndex+1;line.Data.Data=varItem.Draw.DrawData;if(varItem.Name=="DRAWLINE")hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
|
|
9899
9903
|
hqChart.ChartPaint.push(line);};this.CreateVolStick=function(hqChart,windowIndex,varItem,id,hisData){var chart=new ChartVolStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.KLineDrawType=hqChart.KLineDrawType;//设置K线显示类型
|
|
@@ -9909,7 +9913,7 @@ var titleIndex=windowIndex+1;chartText.Data.Data=varItem.Draw.DrawData.Value;cha
|
|
|
9909
9913
|
hqChart.ChartPaint.push(chartText);};this.CreateDrawText=function(hqChart,windowIndex,varItem,id){var chartText=new ChartSingleText();chartText.Canvas=hqChart.Canvas;chartText.Name=varItem.Name;chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chartText.ReloadResource();if(varItem.Color)chartText.Color=this.GetColor(varItem.Color);else chartText.Color=this.GetDefaultColor(id);if(varItem.IsDrawAbove)chartText.Direction=1;else chartText.Direction=0;if(varItem.DrawFontSize>0)chartText.TextFont=varItem.DrawFontSize*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1';//临时用下吧
|
|
9910
9914
|
var titleIndex=windowIndex+1;chartText.DrawData=varItem.Draw.DrawData;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
9911
9915
|
hqChart.ChartPaint.push(chartText);};//创建图标
|
|
9912
|
-
this.CreateIcon=function(hqChart,windowIndex,varItem,id){var chartText=new ChartSingleText();chartText.Canvas=hqChart.Canvas;chartText.TextAlign='center';chartText.Name=varItem.Name;chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chartText.Direction=2;if(varItem.IsDrawAbove)chartText.Direction=1;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.Direction=1;else if(varItem.DrawVAlign==1)chartText.Direction=0;else if(varItem.DrawVAlign==2)chartText.Direction=2;}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}var titleIndex=windowIndex+1;chartText.Data.Data=varItem.Draw.DrawData;var icon=varItem.Draw.Icon;if(icon.IconFont==true){chartText.IconFont={Family:icon.Family,Text:icon.Symbol,Color:icon.Color};if(varItem.Color)chartText.IconFont.Color=this.GetColor(varItem.Color);}else{chartText.Text=icon.Symbol;if(varItem.Color)chartText.Color=this.GetColor(varItem.Color);else if(icon.Color)chartText.Color=icon.Color;else chartText.Color='rgb(0,0,0)';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
9916
|
+
this.CreateIcon=function(hqChart,windowIndex,varItem,id){var chartText=new ChartSingleText();chartText.Canvas=hqChart.Canvas;chartText.TextAlign='center';chartText.Name=varItem.Name;chartText.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chartText.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chartText.Direction=2;if(varItem.IsDrawAbove)chartText.Direction=1;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.Direction=1;else if(varItem.DrawVAlign==1)chartText.Direction=0;else if(varItem.DrawVAlign==2)chartText.Direction=2;}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}var titleIndex=windowIndex+1;chartText.Data.Data=varItem.Draw.DrawData;var icon=varItem.Draw.Icon;if(icon.IconFont==true){chartText.IconFont={Family:icon.Family,Text:icon.Symbol,Color:icon.Color};if(varItem.Color)chartText.IconFont.Color=this.GetColor(varItem.Color);}else{chartText.Text=icon.Symbol;if(varItem.Color)chartText.Color=this.GetColor(varItem.Color);else if(icon.Color)chartText.Color=icon.Color;else chartText.Color='rgb(0,0,0)';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;if(IFrameSplitOperator.IsNumber(varItem.XOffset))chartText.ShowOffset.X=varItem.XOffset;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chartText.ShowOffset.Y=varItem.YOffset;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
9913
9917
|
hqChart.ChartPaint.push(chartText);};//创建通道
|
|
9914
9918
|
this.CreateChannel=function(hqChart,windowIndex,varItem,id){var chart=new ChartChannel();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Draw.AreaColor)chart.AreaColor=varItem.Draw.AreaColor;else if(varItem.Color)chart.AreaColor=this.GetColor(varItem.Color);else chart.AreaColor=this.GetDefaultColor(id);if(varItem.Draw.Border.Color)chart.LineColor=varItem.Draw.Border.Color;else chart.LineColor=null;if(varItem.Draw.Border.Dotted)chart.LineDotted=varItem.Draw.Border.Dotted;if(varItem.Draw.Border.Width>0)chart.LineWidth=varItem.Draw.Border.Width;//let titleIndex=windowIndex+1;
|
|
9915
9919
|
chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreatePartLine=function(hqChart,windowIndex,varItem,i){var chart=new ChartPartLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))chart.LineWidth=width;}chart.Data.Data=varItem.Draw.DrawData;this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateMultiLine=function(hqChart,windowIndex,varItem,i){var chart=new ChartMultiLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
|
|
@@ -9985,7 +9989,7 @@ this.ShowConditionError=function(param,msg){var hqChart=param.HQChart;var window
|
|
|
9985
9989
|
if(IFrameSplitOperator.IsNumber(this.YSplitType))this.OverlayIndex.Frame.Frame.YSplitOperator.SplitType=this.YSplitType;//指标名字
|
|
9986
9990
|
var titleInfo={Data:[],Title:this.Name};var indexParam='';for(var i in this.Arguments){var _item33=this.Arguments[i];if(indexParam.length>0)indexParam+=',';indexParam+=_item33.Value.toString();}if(indexParam.length>0)titleInfo.Title=this.Name+'('+indexParam+')';var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.set(this.OverlayIndex.Identify,titleInfo);this.OverlayIndex.Frame.Frame.Title=titleInfo.Title;//给子框架设置标题
|
|
9987
9991
|
if(this.OutName&&this.OutName.length>0&&this.Arguments&&this.Arguments.length>0){titlePaint.SetDynamicTitle(this.OutName,this.Arguments,this.OverlayIndex.Identify);}for(var i in this.OutVar){var _item34=this.OutVar[i];if(_item34.IsExData===true)continue;//扩展数据不显示图形
|
|
9988
|
-
if(_item34.Type==0){this.CreateLine(hqChart,windowIndex,_item34,i,_item34.Type);}else if(_item34.Type==1){switch(_item34.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item34,i);break;case'DRAWTEXT':case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item34,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item34,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item34,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item34,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item34,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item34,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item34,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item34,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item34,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item34,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item34,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item34,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item34,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item34,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item34,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item34,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item34,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item34,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item34,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item34,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item34,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item34.Draw.DrawType);//外部挂接
|
|
9992
|
+
if(_item34.Type==0){this.CreateLine(hqChart,windowIndex,_item34,i,_item34.Type);}else if(_item34.Type==1){switch(_item34.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item34,i);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item34,i);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item34,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item34,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item34,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item34,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item34,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item34,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item34,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item34,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item34,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item34,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item34,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item34,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item34,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item34,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item34,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item34,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item34,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item34,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item34,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item34,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item34,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item34.Draw.DrawType);//外部挂接
|
|
9989
9993
|
if(find&&find.CreateChartCallback)find.CreateChartCallback(hqChart,windowIndex,_item34,i,this);}break;}}else if(_item34.Type==2){this.CreateMACD(hqChart,windowIndex,_item34,i);}else if(_item34.Type==3){this.CreatePointDot(hqChart,windowIndex,_item34,i,hisData);}else if(_item34.Type==4){this.CreateLineStick(hqChart,windowIndex,_item34,i);}else if(_item34.Type==5){this.CreateStick(hqChart,windowIndex,_item34,i);}else if(_item34.Type==6){this.CreateVolStick(hqChart,windowIndex,_item34,i,hisData);}else if(_item34.Type==7){this.CreateLine(hqChart,windowIndex,_item34,i,_item34.Type);}}/*
|
|
9990
9994
|
hqChart.TitlePaint[titleIndex].Title=this.Name;
|
|
9991
9995
|
|
|
@@ -10007,7 +10011,10 @@ if(event){var self=param.Self;var data={OutVar:self.OutVar,WindowIndex:windowInd
|
|
|
10007
10011
|
/////////////////////////////////////////////////////////////////////////////////////
|
|
10008
10012
|
this.CreateLine=function(hqChart,windowIndex,varItem,id,lineType){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;if(lineType==7)var chart=new ChartStepLine();else var chart=new ChartLine();chart.Canvas=hqChart.Canvas;chart.DrawType=1;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.LineWidth=width;}if(varItem.IsShow==false)chart.IsShow=false;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);titleData.ChartClassName=chart.ClassName;titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};//创建柱子
|
|
10009
10013
|
this.CreateBar=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartStickLine();chart.Canvas=hqChart.Canvas;if(varItem.Draw.Width>0)chart.Width=varItem.Draw.Width;else chart.Width=1;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
10010
|
-
this.SetChartIndexName(chart);frame.ChartPaint.push(chart);}
|
|
10014
|
+
this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};//DRAWTEXT
|
|
10015
|
+
this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chartText=new ChartDrawText();chartText.Canvas=hqChart.Canvas;chartText.Name=varItem.Name;chartText.ChartBorder=frame.Frame.ChartBorder;chartText.ChartFrame=frame.Frame;chartText.Identify=overlayIndex.Identify;chartText.ReloadResource();if(varItem.Color)chartText.Color=this.GetColor(varItem.Color);else chartText.Color=this.GetDefaultColor(id);if(varItem.IsDrawCenter===true)chartText.TextAlign='center';if(varItem.IsDrawAbove===true)chartText.TextBaseline='bottom';if(varItem.IsDrawBelow===true)chartText.TextBaseline='top';if(varItem.Draw.DrawData)chartText.Data.Data=varItem.Draw.DrawData;chartText.Text=varItem.Draw.Text;if(varItem.Draw.Direction>0)chartText.Direction=varItem.Draw.Direction;if(varItem.Draw.YOffset>0)chartText.YOffset=varItem.Draw.YOffset;if(varItem.Draw.TextAlign)chartText.TextAlign=varItem.Draw.TextAlign;//指定输出位置
|
|
10016
|
+
if(varItem.Draw.FixedPosition==="TOP")chartText.FixedPosition=1;else if(varItem.Draw.FixedPosition==="BOTTOM")chartText.FixedPosition=2;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chartText.TextBaseline='top';else if(varItem.DrawVAlign==1)chartText.TextBaseline='middle';else if(varItem.DrawVAlign==2)chartText.TextBaseline='bottom';}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chartText.TextAlign="left";else if(varItem.DrawAlign==1)chartText.TextAlign="center";else if(varItem.DrawAlign==2)chartText.TextAlign='right';}if(varItem.DrawFontSize>0)chartText.FixedFontSize=varItem.DrawFontSize;if(varItem.Background)chartText.TextBG=varItem.Background;if(varItem.VerticalLine)chartText.VerticalLine=varItem.VerticalLine;if(IFrameSplitOperator.IsNumber(varItem.XOffset))chartText.ShowOffset.X=varItem.XOffset;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chartText.ShowOffset.Y=varItem.YOffset;//let titleIndex=windowIndex+1;
|
|
10017
|
+
frame.ChartPaint.push(chartText);};//创建文本
|
|
10011
10018
|
this.CreateText=function(hqChart,windowIndex,varItem,id,drawName){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.ReloadResource();if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);var titleIndex=windowIndex+1;if(varItem.Draw.Position)chart.Position=varItem.Draw.Position;//赋值坐标
|
|
10012
10019
|
if(varItem.Draw.DrawData)chart.Data.Data=varItem.Draw.DrawData;chart.Text=varItem.Draw.Text;if(varItem.Draw.Direction>0)chart.Direction=varItem.Draw.Direction;if(varItem.Draw.YOffset>0)chart.YOffset=varItem.Draw.YOffset;if(varItem.Draw.TextAlign)chart.TextAlign=varItem.Draw.TextAlign;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
10013
10020
|
frame.ChartPaint.push(chart);};//COLORSTICK
|
|
@@ -10019,7 +10026,8 @@ chart.UnchagneColor=chart.DownColor=chart.UpColor=this.GetColor(varItem.Color);f
|
|
|
10019
10026
|
frame.ChartPaint.push(chart);};this.CreateNumberText=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.ReloadResource();chart.TextAlign="center";if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.IsDrawAbove)chart.Direction=1;else chart.Direction=2;if(varItem.Draw.Position)chart.Position=varItem.Draw.Position;//赋值坐标
|
|
10020
10027
|
var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData.Value;chart.Text=varItem.Draw.DrawData.Text;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
10021
10028
|
frame.ChartPaint.push(chart);};this.CreateTextLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartTextLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;if(varItem.Draw&&varItem.Draw.DrawData){var drawData=varItem.Draw.DrawData;chart.Text=drawData.Text;chart.Line=drawData.Line;chart.Price=drawData.Price;}frame.ChartPaint.push(chart);};this.CreateStackedBar=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartStackedBar();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.BarColor))chart.BarColor=varItem.Draw.BarColor;if(IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.BarName))chart.BarName=varItem.Draw.BarName;if(IFrameSplitOperator.IsNumber(varItem.Draw.LineWidth))chart.LineWidth=varItem.Draw.LineWidth;if(IFrameSplitOperator.IsNumber(varItem.Draw.BarType))chart.BarType=varItem.Draw.BarType;chart.Data.Data=varItem.Draw.DrawData;var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);titleData.DataType="ChartStackedBar";titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;frame.ChartPaint.push(chart);};//创建图标
|
|
10022
|
-
this.CreateIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.TextAlign='center';chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;
|
|
10029
|
+
this.CreateIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.TextAlign='center';chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chart.Direction=1;else if(varItem.DrawVAlign==1)chart.Direction=0;else if(varItem.DrawVAlign==2)chart.Direction=2;}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chart.TextAlign="left";else if(varItem.DrawAlign==1)chart.TextAlign="center";else if(varItem.DrawAlign==2)chart.TextAlign='right';}if(IFrameSplitOperator.IsNumber(varItem.XOffset))chart.ShowOffset.X=varItem.XOffset;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chart.ShowOffset.Y=varItem.YOffset;chart.Data.Data=varItem.Draw.DrawData;var icon=varItem.Draw.Icon;if(icon.IconFont==true){chart.IconFont={Family:icon.Family,Text:icon.Symbol,Color:icon.Color};}else{chart.Text=icon.Symbol;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else if(icon.Color)chart.Color=icon.Color;else chart.Color='rgb(0,0,0)';}//var titleIndex=windowIndex+1;
|
|
10030
|
+
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
10023
10031
|
frame.ChartPaint.push(chart);};//创建通道
|
|
10024
10032
|
this.CreateChannel=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartChannel();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Draw.AreaColor)chart.AreaColor=varItem.Draw.AreaColor;else if(varItem.Color)chart.AreaColor=this.GetColor(varItem.Color);else chart.AreaColor=this.GetDefaultColor(id);if(varItem.Draw.Border.Color)chart.LineColor=varItem.Draw.Border.Color;else chart.LineColor=null;if(varItem.Draw.Border.Dotted)chart.LineDotted=varItem.Draw.Border.Dotted;if(varItem.Draw.Border.Width>0)chart.LineWidth=varItem.Draw.Border.Width;//let titleIndex=windowIndex+1;
|
|
10025
10033
|
chart.Data.Data=varItem.Draw.DrawData;frame.ChartPaint.push(chart);};//
|
package/package.json
CHANGED
|
@@ -30477,6 +30477,7 @@ function ChartSingleText()
|
|
|
30477
30477
|
this.FixedFontSize=-1; //固定字体大小
|
|
30478
30478
|
this.YOffset=0; //连线
|
|
30479
30479
|
this.Position; //指定输出位置
|
|
30480
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
30480
30481
|
this.IconFont; //Iconfont
|
|
30481
30482
|
this.IconSize=
|
|
30482
30483
|
{
|
|
@@ -30704,6 +30705,9 @@ function ChartSingleText()
|
|
|
30704
30705
|
|
|
30705
30706
|
if (x>chartright) break;
|
|
30706
30707
|
|
|
30708
|
+
y+=this.ShowOffset.Y;
|
|
30709
|
+
x+=this.ShowOffset.X;
|
|
30710
|
+
|
|
30707
30711
|
this.Canvas.textAlign=this.TextAlign;
|
|
30708
30712
|
this.Canvas.fillStyle=this.Color;
|
|
30709
30713
|
|
|
@@ -30965,7 +30969,7 @@ function ChartDrawText()
|
|
|
30965
30969
|
this.YOffset=0; //连线
|
|
30966
30970
|
this.FixedPosition=-1; //固定位置输出 1顶部, 2底部
|
|
30967
30971
|
this.VerticalLine; //垂直线
|
|
30968
|
-
|
|
30972
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
30969
30973
|
this.ExportData=this.ExportBoolData;
|
|
30970
30974
|
|
|
30971
30975
|
this.TextSize=
|
|
@@ -31060,6 +31064,9 @@ function ChartDrawText()
|
|
|
31060
31064
|
|
|
31061
31065
|
if (x>chartright) break;
|
|
31062
31066
|
|
|
31067
|
+
y+=this.ShowOffset.Y;
|
|
31068
|
+
x+=this.ShowOffset.X;
|
|
31069
|
+
|
|
31063
31070
|
drawTextInfo.X=x;
|
|
31064
31071
|
drawTextInfo.Y=y;
|
|
31065
31072
|
|
|
@@ -92614,6 +92621,19 @@ function JSDraw(errorHandler,symbolData)
|
|
|
92614
92621
|
return color;
|
|
92615
92622
|
}
|
|
92616
92623
|
|
|
92624
|
+
//数据左右偏移
|
|
92625
|
+
this.XMOVE=function(offset)
|
|
92626
|
+
{
|
|
92627
|
+
return offset;
|
|
92628
|
+
}
|
|
92629
|
+
|
|
92630
|
+
//数据上下偏移
|
|
92631
|
+
this.YMOVE=function(offset)
|
|
92632
|
+
{
|
|
92633
|
+
return offset;
|
|
92634
|
+
}
|
|
92635
|
+
|
|
92636
|
+
|
|
92617
92637
|
/*
|
|
92618
92638
|
SOUND 播放声音。用法:SOUND(NAME),播放NAME
|
|
92619
92639
|
注:
|
|
@@ -98958,6 +98978,7 @@ function JSExecute(ast,option)
|
|
|
98958
98978
|
var fontSize=-1;
|
|
98959
98979
|
var bgConfig=null; //背景设置
|
|
98960
98980
|
var vLineConfig=null;
|
|
98981
|
+
let xOffset=null, yOffset=null;
|
|
98961
98982
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
98962
98983
|
{
|
|
98963
98984
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -99070,6 +99091,14 @@ function JSExecute(ast,option)
|
|
|
99070
99091
|
{
|
|
99071
99092
|
downColor=itemExpression.Out;
|
|
99072
99093
|
}
|
|
99094
|
+
else if (itemExpression.Callee.Name=="XMOVE")
|
|
99095
|
+
{
|
|
99096
|
+
xOffset=itemExpression.Out;
|
|
99097
|
+
}
|
|
99098
|
+
else if (itemExpression.Callee.Name=="YMOVE")
|
|
99099
|
+
{
|
|
99100
|
+
yOffset=itemExpression.Out;
|
|
99101
|
+
}
|
|
99073
99102
|
else if (itemExpression.Callee.Name=="SOUND")
|
|
99074
99103
|
{
|
|
99075
99104
|
var event=this.GetSoundEvent();
|
|
@@ -99204,6 +99233,8 @@ function JSExecute(ast,option)
|
|
|
99204
99233
|
if (fontSize>0) outVar.DrawFontSize=fontSize;
|
|
99205
99234
|
if (bgConfig) outVar.Background=bgConfig;
|
|
99206
99235
|
if (vLineConfig) outVar.VerticalLine=vLineConfig;
|
|
99236
|
+
if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
|
|
99237
|
+
if (IFrameSplitOperator.IsNumber(yOffset)) outVar.YOffset=yOffset;
|
|
99207
99238
|
this.OutVarTable.push(outVar);
|
|
99208
99239
|
}
|
|
99209
99240
|
else if (varName)
|
|
@@ -99558,6 +99589,12 @@ function JSExecute(ast,option)
|
|
|
99558
99589
|
case "DOWNCOLOR":
|
|
99559
99590
|
node.Out=this.Draw.DOWNCOLOR(args[0]);
|
|
99560
99591
|
break;
|
|
99592
|
+
case "XMOVE":
|
|
99593
|
+
node.Out=this.Draw.XMOVE(args[0]);
|
|
99594
|
+
break;
|
|
99595
|
+
case "YMOVE":
|
|
99596
|
+
node.Out=this.Draw.YMOVE(args[0]);
|
|
99597
|
+
break;
|
|
99561
99598
|
case 'PARTLINE':
|
|
99562
99599
|
node.Draw=this.Draw.PARTLINE(args);
|
|
99563
99600
|
node.Out=[];
|
|
@@ -101697,6 +101734,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
101697
101734
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
101698
101735
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
101699
101736
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
101737
|
+
|
|
101738
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
101739
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
101700
101740
|
|
|
101701
101741
|
let titleIndex=windowIndex+1;
|
|
101702
101742
|
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
@@ -102244,6 +102284,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
102244
102284
|
}
|
|
102245
102285
|
|
|
102246
102286
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
102287
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
102288
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
102289
|
+
|
|
102247
102290
|
|
|
102248
102291
|
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
102249
102292
|
|
|
@@ -102989,6 +103032,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
102989
103032
|
this.CreateBar(hqChart,windowIndex,item,i);
|
|
102990
103033
|
break;
|
|
102991
103034
|
case 'DRAWTEXT':
|
|
103035
|
+
this.CreateDrawTextV2(hqChart,windowIndex,item,i);
|
|
103036
|
+
break;
|
|
102992
103037
|
case 'SUPERDRAWTEXT':
|
|
102993
103038
|
this.CreateText(hqChart,windowIndex,item,i);
|
|
102994
103039
|
break;
|
|
@@ -103199,6 +103244,58 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103199
103244
|
frame.ChartPaint.push(chart);
|
|
103200
103245
|
}
|
|
103201
103246
|
|
|
103247
|
+
//DRAWTEXT
|
|
103248
|
+
this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id)
|
|
103249
|
+
{
|
|
103250
|
+
var overlayIndex=this.OverlayIndex;
|
|
103251
|
+
var frame=overlayIndex.Frame;
|
|
103252
|
+
var chartText=new ChartDrawText();
|
|
103253
|
+
chartText.Canvas=hqChart.Canvas;
|
|
103254
|
+
chartText.Name=varItem.Name;
|
|
103255
|
+
chartText.ChartBorder=frame.Frame.ChartBorder;
|
|
103256
|
+
chartText.ChartFrame=frame.Frame;
|
|
103257
|
+
chartText.Identify=overlayIndex.Identify;
|
|
103258
|
+
chartText.ReloadResource();
|
|
103259
|
+
|
|
103260
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
103261
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
103262
|
+
if (varItem.IsDrawCenter===true) chartText.TextAlign='center';
|
|
103263
|
+
if (varItem.IsDrawAbove===true) chartText.TextBaseline='bottom'
|
|
103264
|
+
if (varItem.IsDrawBelow===true) chartText.TextBaseline='top';
|
|
103265
|
+
|
|
103266
|
+
if (varItem.Draw.DrawData) chartText.Data.Data=varItem.Draw.DrawData;
|
|
103267
|
+
chartText.Text=varItem.Draw.Text;
|
|
103268
|
+
if (varItem.Draw.Direction>0) chartText.Direction=varItem.Draw.Direction;
|
|
103269
|
+
if (varItem.Draw.YOffset>0) chartText.YOffset=varItem.Draw.YOffset;
|
|
103270
|
+
if (varItem.Draw.TextAlign) chartText.TextAlign=varItem.Draw.TextAlign;
|
|
103271
|
+
//指定输出位置
|
|
103272
|
+
if (varItem.Draw.FixedPosition==="TOP") chartText.FixedPosition=1;
|
|
103273
|
+
else if (varItem.Draw.FixedPosition==="BOTTOM") chartText.FixedPosition=2;
|
|
103274
|
+
|
|
103275
|
+
if (varItem.DrawVAlign>=0)
|
|
103276
|
+
{
|
|
103277
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
103278
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
103279
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
103280
|
+
}
|
|
103281
|
+
|
|
103282
|
+
if (varItem.DrawAlign>=0)
|
|
103283
|
+
{
|
|
103284
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
103285
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
103286
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
103287
|
+
}
|
|
103288
|
+
|
|
103289
|
+
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
103290
|
+
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
103291
|
+
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
103292
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
103293
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
103294
|
+
|
|
103295
|
+
//let titleIndex=windowIndex+1;
|
|
103296
|
+
frame.ChartPaint.push(chartText);
|
|
103297
|
+
}
|
|
103298
|
+
|
|
103202
103299
|
//创建文本
|
|
103203
103300
|
this.CreateText=function(hqChart,windowIndex,varItem,id, drawName)
|
|
103204
103301
|
{
|
|
@@ -103554,7 +103651,23 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103554
103651
|
chart.ChartFrame=frame.Frame;
|
|
103555
103652
|
chart.Identify=overlayIndex.Identify;
|
|
103556
103653
|
|
|
103557
|
-
|
|
103654
|
+
if (varItem.DrawVAlign>=0)
|
|
103655
|
+
{
|
|
103656
|
+
if (varItem.DrawVAlign==0) chart.Direction=1;
|
|
103657
|
+
else if (varItem.DrawVAlign==1) chart.Direction=0;
|
|
103658
|
+
else if (varItem.DrawVAlign==2) chart.Direction=2;
|
|
103659
|
+
}
|
|
103660
|
+
|
|
103661
|
+
if (varItem.DrawAlign>=0)
|
|
103662
|
+
{
|
|
103663
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
103664
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
103665
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
103666
|
+
}
|
|
103667
|
+
|
|
103668
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chart.ShowOffset.X=varItem.XOffset;
|
|
103669
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chart.ShowOffset.Y=varItem.YOffset;
|
|
103670
|
+
|
|
103558
103671
|
chart.Data.Data=varItem.Draw.DrawData;
|
|
103559
103672
|
var icon=varItem.Draw.Icon;
|
|
103560
103673
|
if (icon.IconFont==true)
|
|
@@ -103569,8 +103682,9 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103569
103682
|
else chart.Color='rgb(0,0,0)';
|
|
103570
103683
|
}
|
|
103571
103684
|
|
|
103572
|
-
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
103573
103685
|
|
|
103686
|
+
//var titleIndex=windowIndex+1;
|
|
103687
|
+
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
103574
103688
|
frame.ChartPaint.push(chart);
|
|
103575
103689
|
}
|
|
103576
103690
|
|
|
@@ -30521,6 +30521,7 @@ function ChartSingleText()
|
|
|
30521
30521
|
this.FixedFontSize=-1; //固定字体大小
|
|
30522
30522
|
this.YOffset=0; //连线
|
|
30523
30523
|
this.Position; //指定输出位置
|
|
30524
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
30524
30525
|
this.IconFont; //Iconfont
|
|
30525
30526
|
this.IconSize=
|
|
30526
30527
|
{
|
|
@@ -30748,6 +30749,9 @@ function ChartSingleText()
|
|
|
30748
30749
|
|
|
30749
30750
|
if (x>chartright) break;
|
|
30750
30751
|
|
|
30752
|
+
y+=this.ShowOffset.Y;
|
|
30753
|
+
x+=this.ShowOffset.X;
|
|
30754
|
+
|
|
30751
30755
|
this.Canvas.textAlign=this.TextAlign;
|
|
30752
30756
|
this.Canvas.fillStyle=this.Color;
|
|
30753
30757
|
|
|
@@ -31009,7 +31013,7 @@ function ChartDrawText()
|
|
|
31009
31013
|
this.YOffset=0; //连线
|
|
31010
31014
|
this.FixedPosition=-1; //固定位置输出 1顶部, 2底部
|
|
31011
31015
|
this.VerticalLine; //垂直线
|
|
31012
|
-
|
|
31016
|
+
this.ShowOffset={ X:0, Y:0 }; //显示偏移
|
|
31013
31017
|
this.ExportData=this.ExportBoolData;
|
|
31014
31018
|
|
|
31015
31019
|
this.TextSize=
|
|
@@ -31104,6 +31108,9 @@ function ChartDrawText()
|
|
|
31104
31108
|
|
|
31105
31109
|
if (x>chartright) break;
|
|
31106
31110
|
|
|
31111
|
+
y+=this.ShowOffset.Y;
|
|
31112
|
+
x+=this.ShowOffset.X;
|
|
31113
|
+
|
|
31107
31114
|
drawTextInfo.X=x;
|
|
31108
31115
|
drawTextInfo.Y=y;
|
|
31109
31116
|
|
|
@@ -92658,6 +92665,19 @@ function JSDraw(errorHandler,symbolData)
|
|
|
92658
92665
|
return color;
|
|
92659
92666
|
}
|
|
92660
92667
|
|
|
92668
|
+
//数据左右偏移
|
|
92669
|
+
this.XMOVE=function(offset)
|
|
92670
|
+
{
|
|
92671
|
+
return offset;
|
|
92672
|
+
}
|
|
92673
|
+
|
|
92674
|
+
//数据上下偏移
|
|
92675
|
+
this.YMOVE=function(offset)
|
|
92676
|
+
{
|
|
92677
|
+
return offset;
|
|
92678
|
+
}
|
|
92679
|
+
|
|
92680
|
+
|
|
92661
92681
|
/*
|
|
92662
92682
|
SOUND 播放声音。用法:SOUND(NAME),播放NAME
|
|
92663
92683
|
注:
|
|
@@ -99002,6 +99022,7 @@ function JSExecute(ast,option)
|
|
|
99002
99022
|
var fontSize=-1;
|
|
99003
99023
|
var bgConfig=null; //背景设置
|
|
99004
99024
|
var vLineConfig=null;
|
|
99025
|
+
let xOffset=null, yOffset=null;
|
|
99005
99026
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
99006
99027
|
{
|
|
99007
99028
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -99114,6 +99135,14 @@ function JSExecute(ast,option)
|
|
|
99114
99135
|
{
|
|
99115
99136
|
downColor=itemExpression.Out;
|
|
99116
99137
|
}
|
|
99138
|
+
else if (itemExpression.Callee.Name=="XMOVE")
|
|
99139
|
+
{
|
|
99140
|
+
xOffset=itemExpression.Out;
|
|
99141
|
+
}
|
|
99142
|
+
else if (itemExpression.Callee.Name=="YMOVE")
|
|
99143
|
+
{
|
|
99144
|
+
yOffset=itemExpression.Out;
|
|
99145
|
+
}
|
|
99117
99146
|
else if (itemExpression.Callee.Name=="SOUND")
|
|
99118
99147
|
{
|
|
99119
99148
|
var event=this.GetSoundEvent();
|
|
@@ -99248,6 +99277,8 @@ function JSExecute(ast,option)
|
|
|
99248
99277
|
if (fontSize>0) outVar.DrawFontSize=fontSize;
|
|
99249
99278
|
if (bgConfig) outVar.Background=bgConfig;
|
|
99250
99279
|
if (vLineConfig) outVar.VerticalLine=vLineConfig;
|
|
99280
|
+
if (IFrameSplitOperator.IsNumber(xOffset)) outVar.XOffset=xOffset;
|
|
99281
|
+
if (IFrameSplitOperator.IsNumber(yOffset)) outVar.YOffset=yOffset;
|
|
99251
99282
|
this.OutVarTable.push(outVar);
|
|
99252
99283
|
}
|
|
99253
99284
|
else if (varName)
|
|
@@ -99602,6 +99633,12 @@ function JSExecute(ast,option)
|
|
|
99602
99633
|
case "DOWNCOLOR":
|
|
99603
99634
|
node.Out=this.Draw.DOWNCOLOR(args[0]);
|
|
99604
99635
|
break;
|
|
99636
|
+
case "XMOVE":
|
|
99637
|
+
node.Out=this.Draw.XMOVE(args[0]);
|
|
99638
|
+
break;
|
|
99639
|
+
case "YMOVE":
|
|
99640
|
+
node.Out=this.Draw.YMOVE(args[0]);
|
|
99641
|
+
break;
|
|
99605
99642
|
case 'PARTLINE':
|
|
99606
99643
|
node.Draw=this.Draw.PARTLINE(args);
|
|
99607
99644
|
node.Out=[];
|
|
@@ -101741,6 +101778,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
101741
101778
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
101742
101779
|
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
101743
101780
|
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
101781
|
+
|
|
101782
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
101783
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
101744
101784
|
|
|
101745
101785
|
let titleIndex=windowIndex+1;
|
|
101746
101786
|
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
@@ -102288,6 +102328,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
102288
102328
|
}
|
|
102289
102329
|
|
|
102290
102330
|
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
102331
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
102332
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
102333
|
+
|
|
102291
102334
|
|
|
102292
102335
|
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
102293
102336
|
|
|
@@ -103033,6 +103076,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103033
103076
|
this.CreateBar(hqChart,windowIndex,item,i);
|
|
103034
103077
|
break;
|
|
103035
103078
|
case 'DRAWTEXT':
|
|
103079
|
+
this.CreateDrawTextV2(hqChart,windowIndex,item,i);
|
|
103080
|
+
break;
|
|
103036
103081
|
case 'SUPERDRAWTEXT':
|
|
103037
103082
|
this.CreateText(hqChart,windowIndex,item,i);
|
|
103038
103083
|
break;
|
|
@@ -103243,6 +103288,58 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103243
103288
|
frame.ChartPaint.push(chart);
|
|
103244
103289
|
}
|
|
103245
103290
|
|
|
103291
|
+
//DRAWTEXT
|
|
103292
|
+
this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id)
|
|
103293
|
+
{
|
|
103294
|
+
var overlayIndex=this.OverlayIndex;
|
|
103295
|
+
var frame=overlayIndex.Frame;
|
|
103296
|
+
var chartText=new ChartDrawText();
|
|
103297
|
+
chartText.Canvas=hqChart.Canvas;
|
|
103298
|
+
chartText.Name=varItem.Name;
|
|
103299
|
+
chartText.ChartBorder=frame.Frame.ChartBorder;
|
|
103300
|
+
chartText.ChartFrame=frame.Frame;
|
|
103301
|
+
chartText.Identify=overlayIndex.Identify;
|
|
103302
|
+
chartText.ReloadResource();
|
|
103303
|
+
|
|
103304
|
+
if (varItem.Color) chartText.Color=this.GetColor(varItem.Color);
|
|
103305
|
+
else chartText.Color=this.GetDefaultColor(id);
|
|
103306
|
+
if (varItem.IsDrawCenter===true) chartText.TextAlign='center';
|
|
103307
|
+
if (varItem.IsDrawAbove===true) chartText.TextBaseline='bottom'
|
|
103308
|
+
if (varItem.IsDrawBelow===true) chartText.TextBaseline='top';
|
|
103309
|
+
|
|
103310
|
+
if (varItem.Draw.DrawData) chartText.Data.Data=varItem.Draw.DrawData;
|
|
103311
|
+
chartText.Text=varItem.Draw.Text;
|
|
103312
|
+
if (varItem.Draw.Direction>0) chartText.Direction=varItem.Draw.Direction;
|
|
103313
|
+
if (varItem.Draw.YOffset>0) chartText.YOffset=varItem.Draw.YOffset;
|
|
103314
|
+
if (varItem.Draw.TextAlign) chartText.TextAlign=varItem.Draw.TextAlign;
|
|
103315
|
+
//指定输出位置
|
|
103316
|
+
if (varItem.Draw.FixedPosition==="TOP") chartText.FixedPosition=1;
|
|
103317
|
+
else if (varItem.Draw.FixedPosition==="BOTTOM") chartText.FixedPosition=2;
|
|
103318
|
+
|
|
103319
|
+
if (varItem.DrawVAlign>=0)
|
|
103320
|
+
{
|
|
103321
|
+
if (varItem.DrawVAlign==0) chartText.TextBaseline='top';
|
|
103322
|
+
else if (varItem.DrawVAlign==1) chartText.TextBaseline='middle';
|
|
103323
|
+
else if (varItem.DrawVAlign==2) chartText.TextBaseline='bottom';
|
|
103324
|
+
}
|
|
103325
|
+
|
|
103326
|
+
if (varItem.DrawAlign>=0)
|
|
103327
|
+
{
|
|
103328
|
+
if (varItem.DrawAlign==0) chartText.TextAlign="left";
|
|
103329
|
+
else if (varItem.DrawAlign==1) chartText.TextAlign="center";
|
|
103330
|
+
else if (varItem.DrawAlign==2) chartText.TextAlign='right';
|
|
103331
|
+
}
|
|
103332
|
+
|
|
103333
|
+
if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
|
|
103334
|
+
if (varItem.Background) chartText.TextBG=varItem.Background;
|
|
103335
|
+
if (varItem.VerticalLine) chartText.VerticalLine=varItem.VerticalLine;
|
|
103336
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
|
|
103337
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
|
|
103338
|
+
|
|
103339
|
+
//let titleIndex=windowIndex+1;
|
|
103340
|
+
frame.ChartPaint.push(chartText);
|
|
103341
|
+
}
|
|
103342
|
+
|
|
103246
103343
|
//创建文本
|
|
103247
103344
|
this.CreateText=function(hqChart,windowIndex,varItem,id, drawName)
|
|
103248
103345
|
{
|
|
@@ -103598,7 +103695,23 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103598
103695
|
chart.ChartFrame=frame.Frame;
|
|
103599
103696
|
chart.Identify=overlayIndex.Identify;
|
|
103600
103697
|
|
|
103601
|
-
|
|
103698
|
+
if (varItem.DrawVAlign>=0)
|
|
103699
|
+
{
|
|
103700
|
+
if (varItem.DrawVAlign==0) chart.Direction=1;
|
|
103701
|
+
else if (varItem.DrawVAlign==1) chart.Direction=0;
|
|
103702
|
+
else if (varItem.DrawVAlign==2) chart.Direction=2;
|
|
103703
|
+
}
|
|
103704
|
+
|
|
103705
|
+
if (varItem.DrawAlign>=0)
|
|
103706
|
+
{
|
|
103707
|
+
if (varItem.DrawAlign==0) chart.TextAlign="left";
|
|
103708
|
+
else if (varItem.DrawAlign==1) chart.TextAlign="center";
|
|
103709
|
+
else if (varItem.DrawAlign==2) chart.TextAlign='right';
|
|
103710
|
+
}
|
|
103711
|
+
|
|
103712
|
+
if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chart.ShowOffset.X=varItem.XOffset;
|
|
103713
|
+
if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chart.ShowOffset.Y=varItem.YOffset;
|
|
103714
|
+
|
|
103602
103715
|
chart.Data.Data=varItem.Draw.DrawData;
|
|
103603
103716
|
var icon=varItem.Draw.Icon;
|
|
103604
103717
|
if (icon.IconFont==true)
|
|
@@ -103613,8 +103726,9 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
103613
103726
|
else chart.Color='rgb(0,0,0)';
|
|
103614
103727
|
}
|
|
103615
103728
|
|
|
103616
|
-
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
103617
103729
|
|
|
103730
|
+
//var titleIndex=windowIndex+1;
|
|
103731
|
+
//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
|
|
103618
103732
|
frame.ChartPaint.push(chart);
|
|
103619
103733
|
}
|
|
103620
103734
|
|