hqchart 1.1.13746 → 1.1.13754
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 +16 -14
- package/package.json +1 -1
- package/src/jscommon/umychart.complier.js +27 -1
- package/src/jscommon/umychart.js +7 -4
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +35 -6
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +35 -6
package/lib/umychart.vue.js
CHANGED
|
@@ -3770,18 +3770,18 @@ this.Color="rgb(255,193,37)";//线段颜色
|
|
|
3770
3770
|
this.LineWidth;//线段宽度
|
|
3771
3771
|
this.DrawType=0;//画图方式 0=无效数平滑 1=无效数不画断开
|
|
3772
3772
|
this.IsDotLine=false;//虚线
|
|
3773
|
-
this.BreakPoint;//断开的点索引 Set();
|
|
3773
|
+
this.LineDash=g_JSChartResource.DOTLINE.LineDash;this.BreakPoint;//断开的点索引 Set();
|
|
3774
3774
|
this.DrawSelectedStatus=this.DrawLinePoint;this.PtInChart=this.PtInLine;this.ExportData=this.ExportArrayData;this.GetItemData=this.GetArrayItemData;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(!this.Data||!this.Data.Data)return;switch(this.DrawType){case 0:return this.DrawLine();case 1:return this.DrawStraightLine();case 2:return this.DrawSectionLine();//分段线
|
|
3775
|
-
}};this.DrawLine=function(){var bHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var chartright=this.ChartBorder.GetRight();if(bHScreen)chartright=this.ChartBorder.GetBottom();var xPointCount=this.ChartFrame.XPointCount;this.Canvas.save();if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();if(this.IsDotLine)this.Canvas.setLineDash(
|
|
3775
|
+
}};this.DrawLine=function(){var bHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var chartright=this.ChartBorder.GetRight();if(bHScreen)chartright=this.ChartBorder.GetBottom();var xPointCount=this.ChartFrame.XPointCount;this.Canvas.save();if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();if(this.IsDotLine)this.Canvas.setLineDash(this.LineDash);//画虚线
|
|
3776
3776
|
var bFirstPoint=true;var drawCount=0;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var value=this.Data.Data[i];if(value==null)continue;var x=this.ChartFrame.GetXFromIndex(j);var y=this.GetYFromData(value);if(x>chartright)break;if(bFirstPoint){this.Canvas.strokeStyle=this.Color;this.Canvas.beginPath();if(bHScreen)this.Canvas.moveTo(y,x);//横屏坐标轴对调
|
|
3777
3777
|
else this.Canvas.moveTo(x,y);bFirstPoint=false;}else{if(bHScreen)this.Canvas.lineTo(y,x);else this.Canvas.lineTo(x,y);}++drawCount;}if(drawCount>0)this.Canvas.stroke();this.Canvas.restore();};//无效数不画
|
|
3778
|
-
this.DrawStraightLine=function(){var bHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var chartright=border.BottomEx;var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var lockRect=this.GetLockRect();if(lockRect){if(bHScreen)chartright=lockRect.Top;else chartright=lockRect.Left;}this.Canvas.save();this.ClipClient(bHScreen);if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();this.Canvas.strokeStyle=this.Color;if(this.IsDotLine)this.Canvas.setLineDash(
|
|
3778
|
+
this.DrawStraightLine=function(){var bHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var chartright=border.BottomEx;var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var lockRect=this.GetLockRect();if(lockRect){if(bHScreen)chartright=lockRect.Top;else chartright=lockRect.Left;}this.Canvas.save();this.ClipClient(bHScreen);if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();this.Canvas.strokeStyle=this.Color;if(this.IsDotLine)this.Canvas.setLineDash(this.LineDash);//画虚线
|
|
3779
3779
|
var bFirstPoint=true;var ptFirst=null;;//第1个点
|
|
3780
3780
|
var drawCount=0;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth)//for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
3781
3781
|
{var value=this.Data.Data[i];if(value==null){if(drawCount>0)this.Canvas.stroke();bFirstPoint=true;drawCount=0;ptFirst=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.GetYFromData(value,false);if(x>chartright)break;if(bFirstPoint){this.Canvas.beginPath();if(bHScreen)this.Canvas.moveTo(y,x);//横屏坐标轴对调
|
|
3782
3782
|
else this.Canvas.moveTo(x,y);bFirstPoint=false;ptFirst={X:x,Y:y};}else{if(bHScreen)this.Canvas.lineTo(y,x);else this.Canvas.lineTo(x,y);}++drawCount;}if(drawCount>0){if(drawCount==1&&ptFirst)//如果只有1个点, 画一个像素的横线
|
|
3783
3783
|
{if(bHScreen)this.Canvas.lineTo(ptFirst.Y,ptFirst.X+1*GetDevicePixelRatio());else this.Canvas.lineTo(ptFirst.X+1*GetDevicePixelRatio(),ptFirst.Y);}this.Canvas.stroke();}this.Canvas.restore();};//分段线
|
|
3784
|
-
this.DrawSectionLine=function(){var bHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var chartright=border.BottomEx;var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var lockRect=this.GetLockRect();if(lockRect){if(bHScreen)chartright=lockRect.Top;else chartright=lockRect.Left;}this.Canvas.save();this.ClipClient(bHScreen);if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();this.Canvas.strokeStyle=this.Color;if(this.IsDotLine)this.Canvas.setLineDash(
|
|
3784
|
+
this.DrawSectionLine=function(){var bHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var chartright=border.BottomEx;var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var lockRect=this.GetLockRect();if(lockRect){if(bHScreen)chartright=lockRect.Top;else chartright=lockRect.Left;}this.Canvas.save();this.ClipClient(bHScreen);if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();this.Canvas.strokeStyle=this.Color;if(this.IsDotLine)this.Canvas.setLineDash(this.LineDash);//画虚线
|
|
3785
3785
|
var bFirstPoint=true;var ptFirst=null;;//第1个点
|
|
3786
3786
|
var drawCount=0;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth)//for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
3787
3787
|
{var value=this.Data.Data[i];if(value==null){if(drawCount>0)this.Canvas.stroke();bFirstPoint=true;drawCount=0;ptFirst=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.GetYFromData(value,false);if(x>chartright)break;//断开
|
|
@@ -4088,7 +4088,8 @@ LabelWidth:0,TextHeight:0,MaxTextWidth:0};this.BaseLineColor;//基准线
|
|
|
4088
4088
|
this.BaseValue=0;this.Super_GetMaxMin=this.GetMaxMin;//父类的方法
|
|
4089
4089
|
this.ValueRange;//{ Max:, Min: } //固定最大最小值
|
|
4090
4090
|
this.IsShowText=false;this.SetOption=function(option){if(!option)return;if(option.UpColor)this.UpColor=option.UpColor;if(option.DownColor)this.DownColor=option.DownColor;if(option.DownDiffColor)this.DownDiffColor=option.DownDiffColor;if(option.UpDiffColor)this.UpDiffColor=option.UpDiffColor;if(option.BaseLineColor)this.BaseLineColor=option.BaseLineColor;if(IFrameSplitOperator.IsNumber(option.BaseValue))this.BaseValue=option.BaseValue;if(IFrameSplitOperator.IsNumber(option.Style))this.Style=option.Style;if(option.ValueRange)this.ValueRange=option.ValueRange;};this.Draw=function(){this.IsShowText=false;this.TextLabelConfig.LabelWidth=0;this.TextLabelConfig.TextHeight=0;this.TextLabelConfig.MaxTextWidth=0;if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var bHScreen=this.ChartFrame.IsHScreen===true;var lineWidth=this.LineWidth*GetDevicePixelRatio();if(this.LineWidth==50)lineWidth=dataWidth;else if(lineWidth>dataWidth)lineWidth=dataWidth;if(!bHScreen){var itemWidth=dataWidth+distanceWidth;var bMinute=this.IsMinuteFrame();if(bMinute){var border=this.ChartBorder.GetBorder();itemWidth=(border.Right-border.Left)/(xPointCount-1);}this.Canvas.font=this.TextLabelConfig.Font;this.TextLabelConfig.MaxTextWidth=this.Canvas.measureText("-888").width;this.TextLabelConfig.LabelWidth=this.TextLabelConfig.MaxTextWidth+this.TextLabelConfig.TextMargin.Left+this.TextLabelConfig.TextMargin.Right;this.IsShowText=itemWidth>this.TextLabelConfig.LabelWidth;this.TextLabelConfig.TextHeight=this.Canvas.measureText("擎").width;}this.Canvas.save();if(IFrameSplitOperator.IsNumber(this.BaseValue)&&this.BaseValue!=0){this.DrawBaseLine();if(this.BaseValue>0)this.DrawBars(lineWidth,true,true);else this.DrawBars(lineWidth,false,true);}else{//上下分开画
|
|
4091
|
-
this.DrawBars(lineWidth,true,true);this.DrawBars(lineWidth,false);}this.Canvas.restore();};this.DrawBars=function(lineWidth,bUpBar,bDrawLabel){var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var bHScreen=this.ChartFrame.IsHScreen===true;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Top;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Left;}var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);var aryBar=[],aryDiffBar=[],aryText=[];var preValue=null;
|
|
4091
|
+
this.DrawBars(lineWidth,true,true);this.DrawBars(lineWidth,false);}this.Canvas.restore();};this.DrawBars=function(lineWidth,bUpBar,bDrawLabel){var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var bHScreen=this.ChartFrame.IsHScreen===true;if(bHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Top;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var lockRect=this.GetLockRect();if(lockRect)chartright=lockRect.Left;}var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);var aryBar=[],aryDiffBar=[],aryText=[];var preValue=null;var start=this.Data.DataOffset;if(start-1>0)preValue=this.Data.Data[start-1];//上一个数值
|
|
4092
|
+
for(var i=start,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;}if(x>chartright)break;var textItem={X:x,Value:value};if(IFrameSplitOperator.IsNumber(preValue))textItem.DiffValue=value-preValue;aryText.push(textItem);preValue=value;if(bUpBar){if(value<0)continue;}else{if(value>=0)continue;}var bDiffBar=false;var diffValue=null;if(this.BaseValue>0){if(value<this.BaseValue){bDiffBar=true;if(this.Style==1)diffValue=this.BaseValue+(this.BaseValue-value);else diffValue=this.BaseValue-(this.BaseValue-value);}}else if(this.BaseValue<0){if(value>this.BaseValue){bDiffBar=true;if(this.Style==1)diffValue=this.BaseValue-(value-this.BaseValue);else diffValue=this.BaseValue+(value-this.BaseValue);}}if(!bDiffBar){var y=this.ChartFrame.GetYFromData(value);aryBar.push({X:x,Y:y});}else{var y=this.ChartFrame.GetYFromData(diffValue);aryDiffBar.push({X:x,Y:y});}}this.Canvas.lineWidth=lineWidth;if(bUpBar)this.Canvas.strokeStyle=this.UpColor;else this.Canvas.strokeStyle=this.DownColor;this.DrawStick(aryBar,lineWidth,yBottom);if(this.BaseValue>0){this.Canvas.strokeStyle=this.UpDiffColor;this.DrawStick(aryDiffBar,lineWidth,yBottom);}else if(this.BaseValue<0){this.Canvas.strokeStyle=this.DownDiffColor;this.DrawStick(aryDiffBar,lineWidth,yBottom);}if(this.IsShowText&&bDrawLabel)this.DrawStickText(aryText);};this.DrawStick=function(aryData,lineWidth,yBottom){if(!IFrameSplitOperator.IsNonEmptyArray(aryData))return;var bHScreen=this.ChartFrame.IsHScreen===true;var drawCount=0;this.Canvas.beginPath();for(var i=0;i<aryData.length;++i){var item=aryData[i];var y=item.Y;var xFix=ToFixedPoint2(lineWidth,item.X);//毛边修正
|
|
4092
4093
|
if(bHScreen){this.Canvas.moveTo(yBottom,ToFixedPoint(x));this.Canvas.lineTo(y,ToFixedPoint(x));}else{this.Canvas.moveTo(xFix,yBottom);this.Canvas.lineTo(xFix,y);}++drawCount;}if(drawCount>0)this.Canvas.stroke();};this.DrawBaseLine=function(){if(!IFrameSplitOperator.IsNumber(this.BaseValue)||this.BaseValue==0)return;if(!this.BaseLineColor)return;var bHScreen=this.ChartFrame.IsHScreen===true;var border=this.ChartFrame.GetBorder();var y=this.ChartFrame.GetYFromData(this.BaseValue);this.Canvas.strokeStyle=this.BaseLineColor;this.Canvas.lineWidth=1*GetDevicePixelRatio();if(bHScreen){}else{var yFix=ToFixedPoint(y);this.Canvas.beginPath();this.Canvas.moveTo(border.Left,yFix);this.Canvas.lineTo(border.Right,yFix);this.Canvas.stroke();}};this.DrawStickText=function(aryData){var config=this.TextLabelConfig;this.Canvas.font=config.Font;var border=this.ChartBorder.GetBorder();var itemHeight=config.TextHeight*2+config.TextMargin.Bottom+config.TextMargin.Top;for(var i=0;i<aryData.length;++i){var item=aryData[i];var value=item.Value;var xCenter=item.X;var xLeft=xCenter-config.LabelWidth/2;var rtDraw={Left:xLeft,Width:config.LabelWidth,Top:border.BottomEx+1,Height:itemHeight};rtDraw.Right=rtDraw.Left+rtDraw.Width;rtDraw.Bottom=rtDraw.Top+rtDraw.Height;if(IFrameSplitOperator.IsNumber(value)){var bgColor=config.UnchangeColor;if(value>0)bgColor=config.UpColor;else if(value<0)bgColor=config.DownColor;this.DrawTextLabel(value,bgColor,config.BorderColor,config.TextColor,rtDraw,config.TextHeight,config.MaxTextWidth,config.TextMargin);}var value=item.DiffValue;var rtDraw={Left:xLeft,Width:config.LabelWidth,Bottom:border.TopEx-1,Height:itemHeight};rtDraw.Right=rtDraw.Left+rtDraw.Width;rtDraw.Top=rtDraw.Bottom-rtDraw.Height;if(IFrameSplitOperator.IsNumber(value)){var bgColor=config.UnchangeColor;if(value>0)bgColor=config.UpColor;else if(value<0)bgColor=config.DownColor;this.DrawTextLabel(value,bgColor,config.BorderColor,config.TextColor,rtDraw,config.TextHeight,config.MaxTextWidth,config.TextMargin);}}};//数值标签
|
|
4093
4094
|
this.DrawTextLabel=function(value,clrGB,clrBorder,clrText,rtDraw,textHeight,textWidth,textMargin){if(clrGB){this.Canvas.fillStyle=clrGB;this.Canvas.fillRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}if(clrBorder){this.Canvas.lineWidth=2;this.Canvas.strokeStyle=clrBorder;this.Canvas.strokeRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}else{this.Canvas.lineWidth=1;this.Canvas.strokeStyle="rgb(0,0,0)";this.Canvas.strokeRect(rtDraw.Left,rtDraw.Top,rtDraw.Width,rtDraw.Height);}var aryText=[null,null];//大于3位数的 2行输出
|
|
4094
4095
|
var sign="";//负数
|
|
@@ -10863,7 +10864,7 @@ numberData.SingleValue=data2;numberData.DataType=1;if(IFrameSplitOperator.IsNumb
|
|
|
10863
10864
|
*/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){if(dotted=='0'){result.Border.Dotted=[];}else{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(!IFrameSplitOperator.IsNumber(value))continue;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;//条件是否
|
|
10864
10865
|
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;};this.STICKTYPE=function(value){return value;};//数据左右偏移
|
|
10865
10866
|
this.XMOVE=function(offset){return offset;};//数据上下偏移
|
|
10866
|
-
this.YMOVE=function(offset){return offset;};this.KLINETYPE=function(type){return type;};this.FIRSTDRAW=function(value){return value;};/*
|
|
10867
|
+
this.YMOVE=function(offset){return offset;};this.LINEDASH=function(aryData){if(IFrameSplitOperator.IsNonEmptyArray(aryData))return aryData.slice();return[];};this.KLINETYPE=function(type){return type;};this.FIRSTDRAW=function(value){return value;};/*
|
|
10867
10868
|
SOUND 播放声音。用法:SOUND(NAME),播放NAME
|
|
10868
10869
|
注:
|
|
10869
10870
|
1、点击设置声音按钮,在弹出来的界面中设置声音,声音用字符'A'~'J'表示。
|
|
@@ -11566,7 +11567,7 @@ var isNoneName=false;var isShowTitle=true;//显示在位置之上,对于DRAWTEXT
|
|
|
11566
11567
|
var isDrawAbove=false;var isDrawCenter=false;var isDrawBelow=false;//VALIGN0,VALIGN1,VALIGN2 设置文字垂直对齐方式(上中下)
|
|
11567
11568
|
//ALIGN0,ALIGN1,ALIGN2 设置文字水平对齐方式(左中右)
|
|
11568
11569
|
var drawAlign=-1,drawVAlign=-1;var fontSize=-1;var bgConfig=null;//背景设置
|
|
11569
|
-
var vLineConfig=null;var isFirstDraw=null;var xOffset=null,yOffset=null;var klineType=null;for(var _j14=0;_j14<item.Expression.Expression.length;++_j14){var itemExpression=item.Expression.Expression[_j14];if(itemExpression.Type==Syntax.AssignmentExpression&&itemExpression.Operator==':'&&itemExpression.Left){if(_j14==0){_varName3=itemExpression.Left.Name;var _varValue=this.VarTable.get(_varName3);if(this.VarDrawTable.has(_varName3))//绘图函数赋值
|
|
11570
|
+
var vLineConfig=null;var isFirstDraw=null;var xOffset=null,yOffset=null;var klineType=null;var lineDash=null;for(var _j14=0;_j14<item.Expression.Expression.length;++_j14){var itemExpression=item.Expression.Expression[_j14];if(itemExpression.Type==Syntax.AssignmentExpression&&itemExpression.Operator==':'&&itemExpression.Left){if(_j14==0){_varName3=itemExpression.Left.Name;var _varValue=this.VarTable.get(_varName3);if(this.VarDrawTable.has(_varName3))//绘图函数赋值
|
|
11570
11571
|
{_draw3=this.VarDrawTable.get(_varName3);}else if(!Array.isArray(_varValue)){_varValue=this.SingleDataToArrayData(_varValue);this.VarTable.set(_varName3,_varValue);//把常量放到变量表里
|
|
11571
11572
|
}}else{}}else if(itemExpression.Type==Syntax.Identifier){var _value4=itemExpression.Name;if(_value4==='COLORSTICK')colorStick=true;else if(_value4==='POINTDOT')pointDot=true;else if(_value4==='CIRCLEDOT')circleDot=true;else if(_value4==='DOTLINE')isDotLine=true;else if(_value4=="UPDOWNDOT")upDownDot=true;else if(_value4==='LINESTICK')lineStick=true;else if(_value4==='STICK')stick=true;else if(_value4==='VOLSTICK')volStick=true;else if(_value4=="LINEAREA")lineArea=true;else if(_value4==="DRAWABOVE")isDrawAbove=true;else if(_value4==="DRAWCENTER")isDrawCenter=true;else if(_value4=="DRAWBELOW")isDrawBelow=true;else if(_value4=="STEPLINE")stepLine=true;else if(_value4=="SINGLELINE")isSingleLine=true;else if(_value4.indexOf('COLOR')==0)color=_value4;else if(_value4.indexOf("RGBX")==0&&_value4.length==10)color=_value4;//RGBX+“RRGGBB”
|
|
11572
11573
|
else if(_value4.indexOf('LINETHICK')==0)lineWidth=_value4;else if(_value4=="ALIGN0")drawAlign=0;else if(_value4=="ALIGN1")drawAlign=1;else if(_value4=="ALIGN2")drawAlign=2;else if(_value4=="VALIGN0")drawVAlign=0;else if(_value4=="VALIGN1")drawVAlign=1;else if(_value4=="VALIGN2")drawVAlign=2;else if(_value4.indexOf('NODRAW')==0)isShow=false;else if(_value4.indexOf('EXDATA')==0)isExData=true;//扩展数据, 不显示再图形里面
|
|
@@ -11574,7 +11575,7 @@ else if(_value4.indexOf('LINEOVERLAY')==0)isOverlayLine=true;else if(_value4.ind
|
|
|
11574
11575
|
else if(_value4.indexOf("FONTSIZE")==0){var strFontSize=_value4.replace("FONTSIZE","");fontSize=parseInt(strFontSize);}else{if(_j14==0){_varName3=itemExpression.Name;var _varValue2=this.ReadVariable(_varName3,itemExpression);if(!Array.isArray(_varValue2))_varValue2=this.SingleDataToArrayData(_varValue2);_varName3="__temp_si_"+i+"__";isNoneName=true;this.VarTable.set(_varName3,_varValue2);//放到变量表里
|
|
11575
11576
|
}}}else if(itemExpression.Type==Syntax.Literal)//常量
|
|
11576
11577
|
{if(_j14==0){var aryValue=this.SingleDataToArrayData(itemExpression.Value);_varName3=itemExpression.Value.toString();this.VarTable.set(_varName3,aryValue);//把常量放到变量表里
|
|
11577
|
-
}}else if(itemExpression.Type==Syntax.CallExpression){if(_j14==0){if(this.Draw.IsDrawFunction(itemExpression.Callee.Name)){_draw3=itemExpression.Draw;_draw3.Name=itemExpression.Callee.Name;}else{var _varValue3=itemExpression.Out;_varName3='__temp_sc_'+itemExpression.Callee.Name+'_'+i+'__';isNoneName=true;this.VarTable.set(_varName3,_varValue3);}}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=="STICKTYPE"){stickType=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=="FIRSTDRAW"){if(itemExpression.Out===0)isFirstDraw=false;else if(itemExpression.Out===1)isFirstDraw=true;}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.Callee.Name=="KLINETYPE"){klineType=itemExpression.Out;}}}else if(itemExpression.Type==Syntax.BinaryExpression){if(_j14==0){_varName3="__temp_sb_"+i+"__";var _aryValue=itemExpression.Out;isNoneName=true;this.VarTable.set(_varName3,_aryValue);}}else if(itemExpression.Type==Syntax.UnaryExpression){if(_j14==0){_varName3="__temp_su_"+i+"__";var varInfo={};if(this.ReadUnaryExpression(itemExpression,varInfo)){isNoneName=true;this.VarTable.set(_varName3,varInfo.OutVar);}}}else if(itemExpression.Type==Syntax.MemberExpression)//"MA.MA2"(5,12,29), COLORRED;
|
|
11578
|
+
}}else if(itemExpression.Type==Syntax.CallExpression){if(_j14==0){if(this.Draw.IsDrawFunction(itemExpression.Callee.Name)){_draw3=itemExpression.Draw;_draw3.Name=itemExpression.Callee.Name;}else{var _varValue3=itemExpression.Out;_varName3='__temp_sc_'+itemExpression.Callee.Name+'_'+i+'__';isNoneName=true;this.VarTable.set(_varName3,_varValue3);}}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=="STICKTYPE"){stickType=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=="LINEDASH"){if(IFrameSplitOperator.IsNonEmptyArray(itemExpression.Out))lineDash=itemExpression.Out.slice();}else if(itemExpression.Callee.Name=="FIRSTDRAW"){if(itemExpression.Out===0)isFirstDraw=false;else if(itemExpression.Out===1)isFirstDraw=true;}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.Callee.Name=="KLINETYPE"){klineType=itemExpression.Out;}}}else if(itemExpression.Type==Syntax.BinaryExpression){if(_j14==0){_varName3="__temp_sb_"+i+"__";var _aryValue=itemExpression.Out;isNoneName=true;this.VarTable.set(_varName3,_aryValue);}}else if(itemExpression.Type==Syntax.UnaryExpression){if(_j14==0){_varName3="__temp_su_"+i+"__";var varInfo={};if(this.ReadUnaryExpression(itemExpression,varInfo)){isNoneName=true;this.VarTable.set(_varName3,varInfo.OutVar);}}}else if(itemExpression.Type==Syntax.MemberExpression)//"MA.MA2"(5,12,29), COLORRED;
|
|
11578
11579
|
{if(_j14==0){var outVar=this.ReadMemberVariable(itemExpression);if(outVar){if(!Array.isArray(outVar))varValue=this.SingleDataToArrayData(outVar);isNoneName=true;_varName3="__temp_di_"+i+"__";this.VarTable.set(_varName3,outVar);//把常量放到变量表里
|
|
11579
11580
|
}}}}if(pointDot&&_varName3)//圆点
|
|
11580
11581
|
{var _outVar7=this.VarTable.get(_varName3);if(!Array.isArray(_outVar7))_outVar7=this.SingleDataToArrayData(_outVar7);var _value5={Name:_varName3,Data:_outVar7,Radius:g_JSChartResource.POINTDOT.Radius,Type:3};if(color)_value5.Color=color;if(lineWidth)_value5.LineWidth=lineWidth;this.OutVarTable.push(_value5);}else if(circleDot&&_varName3)//圆点
|
|
@@ -11584,8 +11585,8 @@ else if(_value4.indexOf("FONTSIZE")==0){var strFontSize=_value4.replace("FONTSIZ
|
|
|
11584
11585
|
{var _outVar11=this.VarTable.get(_varName3);var _value9={Name:_varName3,Data:_outVar11,Type:5};if(color)_value9.Color=color;if(lineWidth)_value9.LineWidth=lineWidth;this.OutVarTable.push(_value9);}else if(volStick&&_varName3)//VOLSTICK 画彩色柱状线
|
|
11585
11586
|
{var _outVar12=this.VarTable.get(_varName3);var _value10={Name:_varName3,Data:_outVar12,Type:6};if(color)_value10.Color=color;if(upColor)_value10.UpColor=upColor;if(downColor)_value10.DownColor=downColor;if(lineWidth)_value10.LineWidth=lineWidth;if(IFrameSplitOperator.IsNumber(stickType))_value10.StickType=stickType;this.OutVarTable.push(_value10);}else if(lineArea&&_varName3)//LINEAREA 面积
|
|
11586
11587
|
{var _outVar13=this.VarTable.get(_varName3);var _value11={Name:_varName3,Data:_outVar13,Type:9};if(color)_value11.Color=color;if(upColor)_value11.UpColor=upColor;if(downColor)_value11.DownColor=downColor;if(lineWidth)_value11.LineWidth=lineWidth;this.OutVarTable.push(_value11);}else if(colorStick&&_varName3)//CYW: SUM(VAR4,10)/10000, COLORSTICK; 画上下柱子
|
|
11587
|
-
{var _outVar14=this.VarTable.get(_varName3);var _value12={Name:_varName3,Data:_outVar14,Color:color,Type:2};if(lineWidth)_value12.LineWidth=lineWidth;if(color)_value12.Color=color;if(upColor)_value12.UpColor=upColor;if(downColor)_value12.DownColor=downColor;this.OutVarTable.push(_value12);}else if(_varName3&&color&&!_draw3){var _outVar15=this.VarTable.get(_varName3);if(!Array.isArray(_outVar15))_outVar15=this.SingleDataToArrayData(_outVar15);var _value13={Name:_varName3,Data:_outVar15,Color:color,Type:0};if(lineWidth)_value13.LineWidth=lineWidth;if(isShow==false)_value13.IsShow=false;if(isExData==true)_value13.IsExData=true;if(isDotLine==true)_value13.IsDotLine=true;if(isOverlayLine==true)_value13.IsOverlayLine=true;if(isSingleLine==true)_value13.IsSingleLine=true;if(isNoneName==true)_value13.NoneName=true;if(isShowTitle==false)_value13.IsShowTitle=false;if(stepLine==true)_value13.Type=7;this.OutVarTable.push(_value13);}else if(_draw3)//画图函数
|
|
11588
|
-
{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;if(IFrameSplitOperator.IsBool(isFirstDraw))outVar.IsFirstDraw=isFirstDraw;if(IFrameSplitOperator.IsNumber(klineType))outVar.KLineType=klineType;this.OutVarTable.push(outVar);}else if(_varName3){var _outVar16=this.VarTable.get(_varName3);var _value14={Name:_varName3,Data:_outVar16,Type:0};if(color)_value14.Color=color;if(lineWidth)_value14.LineWidth=lineWidth;if(isShow==false)_value14.IsShow=false;if(isExData==true)_value14.IsExData=true;if(isDotLine==true)_value14.IsDotLine=true;if(isOverlayLine==true)_value14.IsOverlayLine=true;if(isSingleLine==true)_value14.IsSingleLine=true;if(isShowTitle==false)_value14.IsShowTitle=false;if(stepLine==true)_value14.Type=7;this.OutVarTable.push(_value14);}}}};this.ReadUnaryExpression=function(item,varInfo){var argument=item.Argument;var outVar=null;if(argument.Type==Syntax.Literal){outVar=argument.Value;if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}else if(argument.Type==Syntax.Identifier){var varName=argument.Name;outVar=this.ReadVariable(varName,item.Expression);if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}else if(argument.Type==Syntax.BinaryExpression){outVar=argument.Out;if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}else if(argument.Type==Syntax.CallExpression){var callItem=argument;if(this.Draw.IsDrawFunction(callItem.Callee.Name)){return false;}else if(callItem.Callee.Name==="IFC"&&callItem.Draw){return false;}else{outVar=callItem.Out;if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}}else{return false;}if(item.Operator=='-'){if(outVar)outVar=this.Algorithm.Subtract(0,outVar);}varInfo.OutVar=outVar;return true;};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();//执行脚本
|
|
11588
|
+
{var _outVar14=this.VarTable.get(_varName3);var _value12={Name:_varName3,Data:_outVar14,Color:color,Type:2};if(lineWidth)_value12.LineWidth=lineWidth;if(color)_value12.Color=color;if(upColor)_value12.UpColor=upColor;if(downColor)_value12.DownColor=downColor;this.OutVarTable.push(_value12);}else if(_varName3&&color&&!_draw3){var _outVar15=this.VarTable.get(_varName3);if(!Array.isArray(_outVar15))_outVar15=this.SingleDataToArrayData(_outVar15);var _value13={Name:_varName3,Data:_outVar15,Color:color,Type:0};if(lineWidth)_value13.LineWidth=lineWidth;if(isShow==false)_value13.IsShow=false;if(isExData==true)_value13.IsExData=true;if(isDotLine==true)_value13.IsDotLine=true;if(IFrameSplitOperator.IsNonEmptyArray(lineDash))_value13.LineDash=lineDash;if(isOverlayLine==true)_value13.IsOverlayLine=true;if(isSingleLine==true)_value13.IsSingleLine=true;if(isNoneName==true)_value13.NoneName=true;if(isShowTitle==false)_value13.IsShowTitle=false;if(stepLine==true)_value13.Type=7;this.OutVarTable.push(_value13);}else if(_draw3)//画图函数
|
|
11589
|
+
{var outVar={Name:_draw3.Name,Draw:_draw3,Type:1};if(color)outVar.Color=color;if(isDotLine==true)outVar.IsDotLine=true;if(IFrameSplitOperator.IsNonEmptyArray(lineDash))outVar.LineDash=lineDash;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;if(IFrameSplitOperator.IsBool(isFirstDraw))outVar.IsFirstDraw=isFirstDraw;if(IFrameSplitOperator.IsNumber(klineType))outVar.KLineType=klineType;this.OutVarTable.push(outVar);}else if(_varName3){var _outVar16=this.VarTable.get(_varName3);var _value14={Name:_varName3,Data:_outVar16,Type:0};if(color)_value14.Color=color;if(lineWidth)_value14.LineWidth=lineWidth;if(isShow==false)_value14.IsShow=false;if(isExData==true)_value14.IsExData=true;if(isDotLine==true)_value14.IsDotLine=true;if(IFrameSplitOperator.IsNonEmptyArray(lineDash))_value14.LineDash=lineDash;if(isOverlayLine==true)_value14.IsOverlayLine=true;if(isSingleLine==true)_value14.IsSingleLine=true;if(isShowTitle==false)_value14.IsShowTitle=false;if(stepLine==true)_value14.Type=7;this.OutVarTable.push(_value14);}}}};this.ReadUnaryExpression=function(item,varInfo){var argument=item.Argument;var outVar=null;if(argument.Type==Syntax.Literal){outVar=argument.Value;if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}else if(argument.Type==Syntax.Identifier){var varName=argument.Name;outVar=this.ReadVariable(varName,item.Expression);if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}else if(argument.Type==Syntax.BinaryExpression){outVar=argument.Out;if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}else if(argument.Type==Syntax.CallExpression){var callItem=argument;if(this.Draw.IsDrawFunction(callItem.Callee.Name)){return false;}else if(callItem.Callee.Name==="IFC"&&callItem.Draw){return false;}else{outVar=callItem.Out;if(!Array.isArray(outVar))outVar=this.SingleDataToArrayData(outVar);}}else{return false;}if(item.Operator=='-'){if(outVar)outVar=this.Algorithm.Subtract(0,outVar);}varInfo.OutVar=outVar;return true;};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();//执行脚本
|
|
11589
11590
|
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 _this48=this;if(debugCtrl.ExeLine<debugCtrl.LineCount){var item=this.AST.Body[debugCtrl.ExeLine];this.RunASTNode(item);++debugCtrl.ExeLine;this.DebugFilter(debugCtrl,function(){_this48.DebugRun_Next(debugCtrl);});}else{this.DebugRun_End();debugCtrl.Status=2;this.DebugFilter(debugCtrl,null);}};//debug模式
|
|
11590
11591
|
this.DebugRun=function(){var _this49=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(){_this49.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;case Syntax.UnaryExpression:this.VisitUnaryExpression(node);break;}};this.VisitUnaryExpression=function(node){if(node.Operator=='-'){var tempValue=this.GetNodeValueEx(node.Argument);var value=this.Algorithm.Subtract(0,tempValue);}else{var value=node.Argument.Value;}return value;};this.VisitSequenceExpression=function(node){for(var _i130 in node.Expression){var _item18=node.Expression[_i130];this.VisitNode(_item18);}};this.GetDynamicScriptIndex=function(node,args){var dynamicName=node.Callee.Value;var aryValue=dynamicName.split(".");if(aryValue.length!=2){this.ThrowUnexpectedNode(node,'\u8C03\u7528\u6307\u6807\u683C\u5F0F\''+dynamicName+'\'\u9519\u8BEF');}var name=aryValue[0];var outName=aryValue[1];var period=null;var pos=outName.indexOf('#');if(pos!=-1){period=outName.slice(pos+1);//周期
|
|
11591
11592
|
outName=outName.slice(0,pos);}var strValue="";for(var i=0;i<args.length;++i){var value=args[i];if(strValue.length>0)strValue+=",";strValue+=''+value;}var strArgs='('+strValue+')';var key=outName+'#'+strArgs;if(period)key+='#'+period;if(!this.VarTable.has(name))return null;var indexData=this.VarTable.get(name);var value=indexData[key];return value;};//函数调用
|
|
@@ -11595,7 +11596,7 @@ var bResult=this.Algorithm.IFC(args[0]);var item=bResult?node.Arguments[1]:node.
|
|
|
11595
11596
|
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;}if(g_JSComplierResource.IsCustomDataFunction(funcName)){var functionInfo=g_JSComplierResource.CustomDataFunction.Data.get(funcName);node.Out=this.SymbolData.GetStockCacheData({FunctionName:funcName,Args:args,ArgCount:functionInfo.ArgCount,Node:node});node.Draw=null;return node.Out;}switch(funcName){case'DYNAINFO'://行情最新数据
|
|
11596
11597
|
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"TIPICON":node.Draw=this.Draw.TIPICON(args[0],args[1],args[2],args[3]);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"KLINETYPE"://K线类型 和DRAWKLINE连用
|
|
11597
11598
|
node.Out=this.Draw.KLINETYPE(args[0]);break;case"DRAWOVERLAYKLINE":node.Draw=this.Draw.DRAWOVERLAYKLINE(args[0],args[1],args[2],args[3]);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"STICKTYPE"://柱子类型
|
|
11598
|
-
node.Out=this.Draw.STICKTYPE(args[0]);break;case"XMOVE":node.Out=this.Draw.XMOVE(args[0]);break;case"YMOVE":node.Out=this.Draw.YMOVE(args[0]);break;case"FIRSTDRAW":node.Out=this.Draw.FIRSTDRAW(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"DRAWGBK_DIV":node.Draw=this.Draw.DRAWGBK_DIV(args[0],args[1],args[2],args[3],args[4]);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":case"CALCSTOCKINDEX":node.Out=this.SymbolData.GetScriptIndexOutData(args,node,funcName);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":node.Out=this.SymbolData.SysParam(args[0],this);break;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;//交易函数
|
|
11599
|
+
node.Out=this.Draw.STICKTYPE(args[0]);break;case"XMOVE":node.Out=this.Draw.XMOVE(args[0]);break;case"YMOVE":node.Out=this.Draw.YMOVE(args[0]);break;case"LINEDASH":node.Out=this.Draw.LINEDASH(args);break;case"FIRSTDRAW":node.Out=this.Draw.FIRSTDRAW(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"DRAWGBK_DIV":node.Draw=this.Draw.DRAWGBK_DIV(args[0],args[1],args[2],args[3],args[4]);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":case"CALCSTOCKINDEX":node.Out=this.SymbolData.GetScriptIndexOutData(args,node,funcName);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":node.Out=this.SymbolData.SysParam(args[0],this);break;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;//交易函数
|
|
11599
11600
|
case"BUY":node.Draw=this.Draw.BUY(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"SELL":node.Draw=this.Draw.SELL(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"SELLSHORT":node.Draw=this.Draw.SELLSHORT(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;case"BUYSHORT":node.Draw=this.Draw.BUYSHORT(args[0],args[1],args[2],args[3]);node.Out=node.Draw.DrawData.Data;break;default:node.Out=this.Algorithm.CallFunction(funcName,args,node,this.SymbolData);break;}return node.Out;};//赋值
|
|
11600
11601
|
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)//右值是变量
|
|
11601
11602
|
value=this.ReadVariable(right.Name,right);else if(right.Type==Syntax.MemberExpression)value=this.ReadMemberVariable(right);else if(right.Type==Syntax.UnaryExpression)value=this.VisitUnaryExpression(right);if(JS_EXECUTE_DEBUG_LOG)JSConsole.Complier.Log('[JSExecute::VisitAssignmentExpression]',varName,' = ',value);if(drawValue)this.VarDrawTable.set(varName,drawValue);this.VarTable.set(varName,value);};//逻辑运算
|
|
@@ -11773,8 +11774,9 @@ this.SetChartIndexName=function(chart){if(this.Name)chart.IndexName=this.Name;el
|
|
|
11773
11774
|
};//设置标题数据
|
|
11774
11775
|
this.SetTitleData=function(titleData,chart){titleData.ChartClassName=chart.ClassName;titleData.IsVisible=chart.IsVisible;};//自定义图形配色
|
|
11775
11776
|
this.ReloadChartResource=function(hqChart,windowIndex,chart){var event=hqChart.GetEventCallback(JSCHART_EVENT_ID.ON_RELOAD_INDEX_CHART_RESOURCE);//指标计算完成回调
|
|
11776
|
-
if(!event||!event.Callback)return;var sendData={Chart:chart,IndexName:this.Name,IndexID:this.ID,HQChart:hqChart,WindowIndex:windowIndex};event.Callback(event,sendData,this);};this.CreateLine=function(hqChart,windowIndex,varItem,id,lineType){if(lineType==7)var line=new ChartStepLine();else var line=new ChartLine();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;line.Identify=this.Guid;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(lineType==8){line.DrawType=2;line.BreakPoint=varItem.BreakPoint;}if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}if(varItem.IsDotLine)line.IsDotLine=true;//虚线
|
|
11777
|
-
|
|
11777
|
+
if(!event||!event.Callback)return;var sendData={Chart:chart,IndexName:this.Name,IndexID:this.ID,HQChart:hqChart,WindowIndex:windowIndex};event.Callback(event,sendData,this);};this.CreateLine=function(hqChart,windowIndex,varItem,id,lineType){if(lineType==7)var line=new ChartStepLine();else var line=new ChartLine();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;line.Identify=this.Guid;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(lineType==8){line.DrawType=2;line.BreakPoint=varItem.BreakPoint;}if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}if(varItem.IsDotLine){line.IsDotLine=true;//虚线
|
|
11778
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();}//虚线设置
|
|
11779
|
+
if(IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash))line.LineDash=varItem.LineDash;if(varItem.IsShow==false)line.IsShow=false;var titleIndex=windowIndex+1;line.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,line);if(varItem.IsShowTitle===false)//NOTEXT 不绘制标题
|
|
11778
11780
|
{}else if(IFrameSplitOperator.IsString(varItem.Name)&&varItem.Name.indexOf("NOTEXT")==0)//标题中包含NOTEXT不绘制标题
|
|
11779
11781
|
{}else{if(varItem.NoneName)hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);else hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);this.SetTitleData(hqChart.TitlePaint[titleIndex].Data[id],line);}this.SetChartIndexName(line);hqChart.ChartPaint.push(line);};this.CreateArea=function(hqChart,windowIndex,varItem,id){var line=new ChartArea();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;line.Identify=this.Guid;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.DownColor){line.AreaColor=varItem.DownColor;}else if(varItem.UpColor){line.AreaColor=varItem.UpColor;line.AreaDirection=1;}if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))line.LineWidth=width;}if(IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash))line.LineDash=varItem.LineDash;//虚线
|
|
11780
11782
|
if(varItem.IsShow==false)line.IsShow=false;var titleIndex=windowIndex+1;line.Data.Data=varItem.Data;if(varItem.IsShowTitle===false)//NOTEXT 不绘制标题
|
|
@@ -13786,7 +13788,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13786
13788
|
this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
|
|
13787
13789
|
* 版本信息输出
|
|
13788
13790
|
*
|
|
13789
|
-
*/var HQCHART_VERSION="1.1.
|
|
13791
|
+
*/var HQCHART_VERSION="1.1.13753";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
13790
13792
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13791
13793
|
// BaseIndex:BaseIndex,
|
|
13792
13794
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -10528,6 +10528,12 @@ function JSDraw(errorHandler,symbolData)
|
|
|
10528
10528
|
return offset;
|
|
10529
10529
|
}
|
|
10530
10530
|
|
|
10531
|
+
this.LINEDASH=function(aryData)
|
|
10532
|
+
{
|
|
10533
|
+
if (IFrameSplitOperator.IsNonEmptyArray(aryData)) return aryData.slice();
|
|
10534
|
+
return [];
|
|
10535
|
+
}
|
|
10536
|
+
|
|
10531
10537
|
this.KLINETYPE=function(type)
|
|
10532
10538
|
{
|
|
10533
10539
|
return type;
|
|
@@ -17399,6 +17405,7 @@ function JSExecute(ast,option)
|
|
|
17399
17405
|
var isFirstDraw=null;
|
|
17400
17406
|
let xOffset=null, yOffset=null;
|
|
17401
17407
|
var klineType=null;
|
|
17408
|
+
var lineDash=null;
|
|
17402
17409
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
17403
17410
|
{
|
|
17404
17411
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -17527,6 +17534,11 @@ function JSExecute(ast,option)
|
|
|
17527
17534
|
{
|
|
17528
17535
|
yOffset=itemExpression.Out;
|
|
17529
17536
|
}
|
|
17537
|
+
else if (itemExpression.Callee.Name=="LINEDASH")
|
|
17538
|
+
{
|
|
17539
|
+
if (IFrameSplitOperator.IsNonEmptyArray(itemExpression.Out))
|
|
17540
|
+
lineDash=itemExpression.Out.slice();
|
|
17541
|
+
}
|
|
17530
17542
|
else if (itemExpression.Callee.Name=="FIRSTDRAW")
|
|
17531
17543
|
{
|
|
17532
17544
|
if (itemExpression.Out===0) isFirstDraw=false;
|
|
@@ -17691,6 +17703,7 @@ function JSExecute(ast,option)
|
|
|
17691
17703
|
if (isShow == false) value.IsShow = false;
|
|
17692
17704
|
if (isExData==true) value.IsExData = true;
|
|
17693
17705
|
if (isDotLine==true) value.IsDotLine=true;
|
|
17706
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) value.LineDash=lineDash;
|
|
17694
17707
|
if (isOverlayLine==true) value.IsOverlayLine=true;
|
|
17695
17708
|
if (isSingleLine==true) value.IsSingleLine=true;
|
|
17696
17709
|
if (isNoneName==true) value.NoneName=true;
|
|
@@ -17703,6 +17716,7 @@ function JSExecute(ast,option)
|
|
|
17703
17716
|
var outVar={Name:draw.Name, Draw:draw, Type:1};
|
|
17704
17717
|
if (color) outVar.Color=color;
|
|
17705
17718
|
if (isDotLine==true) outVar.IsDotLine=true;
|
|
17719
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) outVar.LineDash=lineDash;
|
|
17706
17720
|
if (lineWidth) outVar.LineWidth=lineWidth;
|
|
17707
17721
|
if (isDrawAbove) outVar.IsDrawAbove=true;
|
|
17708
17722
|
if (isDrawCenter) outVar.IsDrawCenter=true;
|
|
@@ -17727,6 +17741,7 @@ function JSExecute(ast,option)
|
|
|
17727
17741
|
if (isShow==false) value.IsShow=false;
|
|
17728
17742
|
if (isExData==true) value.IsExData = true;
|
|
17729
17743
|
if (isDotLine==true) value.IsDotLine=true;
|
|
17744
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) value.LineDash=lineDash;
|
|
17730
17745
|
if (isOverlayLine==true) value.IsOverlayLine=true;
|
|
17731
17746
|
if (isSingleLine==true) value.IsSingleLine=true;
|
|
17732
17747
|
if (isShowTitle==false) value.IsShowTitle=false;
|
|
@@ -18214,6 +18229,9 @@ function JSExecute(ast,option)
|
|
|
18214
18229
|
case "YMOVE":
|
|
18215
18230
|
node.Out=this.Draw.YMOVE(args[0]);
|
|
18216
18231
|
break;
|
|
18232
|
+
case "LINEDASH":
|
|
18233
|
+
node.Out=this.Draw.LINEDASH(args);
|
|
18234
|
+
break;
|
|
18217
18235
|
case "FIRSTDRAW":
|
|
18218
18236
|
node.Out=this.Draw.FIRSTDRAW(args[0]);
|
|
18219
18237
|
break;
|
|
@@ -20473,7 +20491,15 @@ function ScriptIndex(name,script,args,option)
|
|
|
20473
20491
|
if (!isNaN(width) && width>0) line.LineWidth=width;
|
|
20474
20492
|
}
|
|
20475
20493
|
|
|
20476
|
-
if (varItem.IsDotLine)
|
|
20494
|
+
if (varItem.IsDotLine)
|
|
20495
|
+
{
|
|
20496
|
+
line.IsDotLine=true; //虚线
|
|
20497
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
20498
|
+
}
|
|
20499
|
+
|
|
20500
|
+
//虚线设置
|
|
20501
|
+
if (IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash)) line.LineDash=varItem.LineDash;
|
|
20502
|
+
|
|
20477
20503
|
if (varItem.IsShow==false) line.IsShow=false;
|
|
20478
20504
|
|
|
20479
20505
|
let titleIndex=windowIndex+1;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -30665,6 +30665,7 @@ function ChartLine()
|
|
|
30665
30665
|
this.LineWidth; //线段宽度
|
|
30666
30666
|
this.DrawType=0; //画图方式 0=无效数平滑 1=无效数不画断开
|
|
30667
30667
|
this.IsDotLine=false; //虚线
|
|
30668
|
+
this.LineDash=g_JSChartResource.DOTLINE.LineDash;
|
|
30668
30669
|
this.BreakPoint; //断开的点索引 Set();
|
|
30669
30670
|
|
|
30670
30671
|
|
|
@@ -30710,7 +30711,7 @@ function ChartLine()
|
|
|
30710
30711
|
|
|
30711
30712
|
this.Canvas.save();
|
|
30712
30713
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
30713
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
30714
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
30714
30715
|
var bFirstPoint=true;
|
|
30715
30716
|
var drawCount=0;
|
|
30716
30717
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -30777,7 +30778,7 @@ function ChartLine()
|
|
|
30777
30778
|
this.ClipClient(bHScreen);
|
|
30778
30779
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
30779
30780
|
this.Canvas.strokeStyle=this.Color;
|
|
30780
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
30781
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
30781
30782
|
|
|
30782
30783
|
var bFirstPoint=true;
|
|
30783
30784
|
var ptFirst=null;; //第1个点
|
|
@@ -30874,7 +30875,7 @@ function ChartLine()
|
|
|
30874
30875
|
this.ClipClient(bHScreen);
|
|
30875
30876
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
30876
30877
|
this.Canvas.strokeStyle=this.Color;
|
|
30877
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
30878
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
30878
30879
|
|
|
30879
30880
|
var bFirstPoint=true;
|
|
30880
30881
|
var ptFirst=null;; //第1个点
|
|
@@ -36184,7 +36185,9 @@ function ChartClipColorStick()
|
|
|
36184
36185
|
var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
36185
36186
|
var aryBar=[], aryDiffBar=[], aryText=[];
|
|
36186
36187
|
var preValue=null;
|
|
36187
|
-
|
|
36188
|
+
var start=this.Data.DataOffset;
|
|
36189
|
+
if (start-1>0) preValue=this.Data.Data[start-1]; //上一个数值
|
|
36190
|
+
for(var i=start,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
36188
36191
|
{
|
|
36189
36192
|
var value=this.Data.Data[i];
|
|
36190
36193
|
if (value==null) continue;
|
|
@@ -34590,6 +34590,7 @@ function ChartLine()
|
|
|
34590
34590
|
this.LineWidth; //线段宽度
|
|
34591
34591
|
this.DrawType=0; //画图方式 0=无效数平滑 1=无效数不画断开
|
|
34592
34592
|
this.IsDotLine=false; //虚线
|
|
34593
|
+
this.LineDash=g_JSChartResource.DOTLINE.LineDash;
|
|
34593
34594
|
this.BreakPoint; //断开的点索引 Set();
|
|
34594
34595
|
|
|
34595
34596
|
|
|
@@ -34635,7 +34636,7 @@ function ChartLine()
|
|
|
34635
34636
|
|
|
34636
34637
|
this.Canvas.save();
|
|
34637
34638
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
34638
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
34639
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
34639
34640
|
var bFirstPoint=true;
|
|
34640
34641
|
var drawCount=0;
|
|
34641
34642
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -34702,7 +34703,7 @@ function ChartLine()
|
|
|
34702
34703
|
this.ClipClient(bHScreen);
|
|
34703
34704
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
34704
34705
|
this.Canvas.strokeStyle=this.Color;
|
|
34705
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
34706
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
34706
34707
|
|
|
34707
34708
|
var bFirstPoint=true;
|
|
34708
34709
|
var ptFirst=null;; //第1个点
|
|
@@ -34799,7 +34800,7 @@ function ChartLine()
|
|
|
34799
34800
|
this.ClipClient(bHScreen);
|
|
34800
34801
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
34801
34802
|
this.Canvas.strokeStyle=this.Color;
|
|
34802
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
34803
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
34803
34804
|
|
|
34804
34805
|
var bFirstPoint=true;
|
|
34805
34806
|
var ptFirst=null;; //第1个点
|
|
@@ -40109,7 +40110,9 @@ function ChartClipColorStick()
|
|
|
40109
40110
|
var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
40110
40111
|
var aryBar=[], aryDiffBar=[], aryText=[];
|
|
40111
40112
|
var preValue=null;
|
|
40112
|
-
|
|
40113
|
+
var start=this.Data.DataOffset;
|
|
40114
|
+
if (start-1>0) preValue=this.Data.Data[start-1]; //上一个数值
|
|
40115
|
+
for(var i=start,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
40113
40116
|
{
|
|
40114
40117
|
var value=this.Data.Data[i];
|
|
40115
40118
|
if (value==null) continue;
|
|
@@ -109090,6 +109093,12 @@ function JSDraw(errorHandler,symbolData)
|
|
|
109090
109093
|
return offset;
|
|
109091
109094
|
}
|
|
109092
109095
|
|
|
109096
|
+
this.LINEDASH=function(aryData)
|
|
109097
|
+
{
|
|
109098
|
+
if (IFrameSplitOperator.IsNonEmptyArray(aryData)) return aryData.slice();
|
|
109099
|
+
return [];
|
|
109100
|
+
}
|
|
109101
|
+
|
|
109093
109102
|
this.KLINETYPE=function(type)
|
|
109094
109103
|
{
|
|
109095
109104
|
return type;
|
|
@@ -115961,6 +115970,7 @@ function JSExecute(ast,option)
|
|
|
115961
115970
|
var isFirstDraw=null;
|
|
115962
115971
|
let xOffset=null, yOffset=null;
|
|
115963
115972
|
var klineType=null;
|
|
115973
|
+
var lineDash=null;
|
|
115964
115974
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
115965
115975
|
{
|
|
115966
115976
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -116089,6 +116099,11 @@ function JSExecute(ast,option)
|
|
|
116089
116099
|
{
|
|
116090
116100
|
yOffset=itemExpression.Out;
|
|
116091
116101
|
}
|
|
116102
|
+
else if (itemExpression.Callee.Name=="LINEDASH")
|
|
116103
|
+
{
|
|
116104
|
+
if (IFrameSplitOperator.IsNonEmptyArray(itemExpression.Out))
|
|
116105
|
+
lineDash=itemExpression.Out.slice();
|
|
116106
|
+
}
|
|
116092
116107
|
else if (itemExpression.Callee.Name=="FIRSTDRAW")
|
|
116093
116108
|
{
|
|
116094
116109
|
if (itemExpression.Out===0) isFirstDraw=false;
|
|
@@ -116253,6 +116268,7 @@ function JSExecute(ast,option)
|
|
|
116253
116268
|
if (isShow == false) value.IsShow = false;
|
|
116254
116269
|
if (isExData==true) value.IsExData = true;
|
|
116255
116270
|
if (isDotLine==true) value.IsDotLine=true;
|
|
116271
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) value.LineDash=lineDash;
|
|
116256
116272
|
if (isOverlayLine==true) value.IsOverlayLine=true;
|
|
116257
116273
|
if (isSingleLine==true) value.IsSingleLine=true;
|
|
116258
116274
|
if (isNoneName==true) value.NoneName=true;
|
|
@@ -116265,6 +116281,7 @@ function JSExecute(ast,option)
|
|
|
116265
116281
|
var outVar={Name:draw.Name, Draw:draw, Type:1};
|
|
116266
116282
|
if (color) outVar.Color=color;
|
|
116267
116283
|
if (isDotLine==true) outVar.IsDotLine=true;
|
|
116284
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) outVar.LineDash=lineDash;
|
|
116268
116285
|
if (lineWidth) outVar.LineWidth=lineWidth;
|
|
116269
116286
|
if (isDrawAbove) outVar.IsDrawAbove=true;
|
|
116270
116287
|
if (isDrawCenter) outVar.IsDrawCenter=true;
|
|
@@ -116289,6 +116306,7 @@ function JSExecute(ast,option)
|
|
|
116289
116306
|
if (isShow==false) value.IsShow=false;
|
|
116290
116307
|
if (isExData==true) value.IsExData = true;
|
|
116291
116308
|
if (isDotLine==true) value.IsDotLine=true;
|
|
116309
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) value.LineDash=lineDash;
|
|
116292
116310
|
if (isOverlayLine==true) value.IsOverlayLine=true;
|
|
116293
116311
|
if (isSingleLine==true) value.IsSingleLine=true;
|
|
116294
116312
|
if (isShowTitle==false) value.IsShowTitle=false;
|
|
@@ -116776,6 +116794,9 @@ function JSExecute(ast,option)
|
|
|
116776
116794
|
case "YMOVE":
|
|
116777
116795
|
node.Out=this.Draw.YMOVE(args[0]);
|
|
116778
116796
|
break;
|
|
116797
|
+
case "LINEDASH":
|
|
116798
|
+
node.Out=this.Draw.LINEDASH(args);
|
|
116799
|
+
break;
|
|
116779
116800
|
case "FIRSTDRAW":
|
|
116780
116801
|
node.Out=this.Draw.FIRSTDRAW(args[0]);
|
|
116781
116802
|
break;
|
|
@@ -119035,7 +119056,15 @@ function ScriptIndex(name,script,args,option)
|
|
|
119035
119056
|
if (!isNaN(width) && width>0) line.LineWidth=width;
|
|
119036
119057
|
}
|
|
119037
119058
|
|
|
119038
|
-
if (varItem.IsDotLine)
|
|
119059
|
+
if (varItem.IsDotLine)
|
|
119060
|
+
{
|
|
119061
|
+
line.IsDotLine=true; //虚线
|
|
119062
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
119063
|
+
}
|
|
119064
|
+
|
|
119065
|
+
//虚线设置
|
|
119066
|
+
if (IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash)) line.LineDash=varItem.LineDash;
|
|
119067
|
+
|
|
119039
119068
|
if (varItem.IsShow==false) line.IsShow=false;
|
|
119040
119069
|
|
|
119041
119070
|
let titleIndex=windowIndex+1;
|
|
@@ -138585,7 +138614,7 @@ function ScrollBarBGChart()
|
|
|
138585
138614
|
|
|
138586
138615
|
|
|
138587
138616
|
|
|
138588
|
-
var HQCHART_VERSION="1.1.
|
|
138617
|
+
var HQCHART_VERSION="1.1.13753";
|
|
138589
138618
|
|
|
138590
138619
|
function PrintHQChartVersion()
|
|
138591
138620
|
{
|
|
@@ -34634,6 +34634,7 @@ function ChartLine()
|
|
|
34634
34634
|
this.LineWidth; //线段宽度
|
|
34635
34635
|
this.DrawType=0; //画图方式 0=无效数平滑 1=无效数不画断开
|
|
34636
34636
|
this.IsDotLine=false; //虚线
|
|
34637
|
+
this.LineDash=g_JSChartResource.DOTLINE.LineDash;
|
|
34637
34638
|
this.BreakPoint; //断开的点索引 Set();
|
|
34638
34639
|
|
|
34639
34640
|
|
|
@@ -34679,7 +34680,7 @@ function ChartLine()
|
|
|
34679
34680
|
|
|
34680
34681
|
this.Canvas.save();
|
|
34681
34682
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
34682
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
34683
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
34683
34684
|
var bFirstPoint=true;
|
|
34684
34685
|
var drawCount=0;
|
|
34685
34686
|
for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
|
|
@@ -34746,7 +34747,7 @@ function ChartLine()
|
|
|
34746
34747
|
this.ClipClient(bHScreen);
|
|
34747
34748
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
34748
34749
|
this.Canvas.strokeStyle=this.Color;
|
|
34749
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
34750
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
34750
34751
|
|
|
34751
34752
|
var bFirstPoint=true;
|
|
34752
34753
|
var ptFirst=null;; //第1个点
|
|
@@ -34843,7 +34844,7 @@ function ChartLine()
|
|
|
34843
34844
|
this.ClipClient(bHScreen);
|
|
34844
34845
|
if (this.LineWidth>0) this.Canvas.lineWidth=this.LineWidth * GetDevicePixelRatio();
|
|
34845
34846
|
this.Canvas.strokeStyle=this.Color;
|
|
34846
|
-
if (this.IsDotLine) this.Canvas.setLineDash(
|
|
34847
|
+
if (this.IsDotLine) this.Canvas.setLineDash(this.LineDash); //画虚线
|
|
34847
34848
|
|
|
34848
34849
|
var bFirstPoint=true;
|
|
34849
34850
|
var ptFirst=null;; //第1个点
|
|
@@ -40153,7 +40154,9 @@ function ChartClipColorStick()
|
|
|
40153
40154
|
var yBottom=this.ChartFrame.GetYFromData(this.BaseValue);
|
|
40154
40155
|
var aryBar=[], aryDiffBar=[], aryText=[];
|
|
40155
40156
|
var preValue=null;
|
|
40156
|
-
|
|
40157
|
+
var start=this.Data.DataOffset;
|
|
40158
|
+
if (start-1>0) preValue=this.Data.Data[start-1]; //上一个数值
|
|
40159
|
+
for(var i=start,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
|
|
40157
40160
|
{
|
|
40158
40161
|
var value=this.Data.Data[i];
|
|
40159
40162
|
if (value==null) continue;
|
|
@@ -109134,6 +109137,12 @@ function JSDraw(errorHandler,symbolData)
|
|
|
109134
109137
|
return offset;
|
|
109135
109138
|
}
|
|
109136
109139
|
|
|
109140
|
+
this.LINEDASH=function(aryData)
|
|
109141
|
+
{
|
|
109142
|
+
if (IFrameSplitOperator.IsNonEmptyArray(aryData)) return aryData.slice();
|
|
109143
|
+
return [];
|
|
109144
|
+
}
|
|
109145
|
+
|
|
109137
109146
|
this.KLINETYPE=function(type)
|
|
109138
109147
|
{
|
|
109139
109148
|
return type;
|
|
@@ -116005,6 +116014,7 @@ function JSExecute(ast,option)
|
|
|
116005
116014
|
var isFirstDraw=null;
|
|
116006
116015
|
let xOffset=null, yOffset=null;
|
|
116007
116016
|
var klineType=null;
|
|
116017
|
+
var lineDash=null;
|
|
116008
116018
|
for(let j=0; j<item.Expression.Expression.length; ++j)
|
|
116009
116019
|
{
|
|
116010
116020
|
let itemExpression=item.Expression.Expression[j];
|
|
@@ -116133,6 +116143,11 @@ function JSExecute(ast,option)
|
|
|
116133
116143
|
{
|
|
116134
116144
|
yOffset=itemExpression.Out;
|
|
116135
116145
|
}
|
|
116146
|
+
else if (itemExpression.Callee.Name=="LINEDASH")
|
|
116147
|
+
{
|
|
116148
|
+
if (IFrameSplitOperator.IsNonEmptyArray(itemExpression.Out))
|
|
116149
|
+
lineDash=itemExpression.Out.slice();
|
|
116150
|
+
}
|
|
116136
116151
|
else if (itemExpression.Callee.Name=="FIRSTDRAW")
|
|
116137
116152
|
{
|
|
116138
116153
|
if (itemExpression.Out===0) isFirstDraw=false;
|
|
@@ -116297,6 +116312,7 @@ function JSExecute(ast,option)
|
|
|
116297
116312
|
if (isShow == false) value.IsShow = false;
|
|
116298
116313
|
if (isExData==true) value.IsExData = true;
|
|
116299
116314
|
if (isDotLine==true) value.IsDotLine=true;
|
|
116315
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) value.LineDash=lineDash;
|
|
116300
116316
|
if (isOverlayLine==true) value.IsOverlayLine=true;
|
|
116301
116317
|
if (isSingleLine==true) value.IsSingleLine=true;
|
|
116302
116318
|
if (isNoneName==true) value.NoneName=true;
|
|
@@ -116309,6 +116325,7 @@ function JSExecute(ast,option)
|
|
|
116309
116325
|
var outVar={Name:draw.Name, Draw:draw, Type:1};
|
|
116310
116326
|
if (color) outVar.Color=color;
|
|
116311
116327
|
if (isDotLine==true) outVar.IsDotLine=true;
|
|
116328
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) outVar.LineDash=lineDash;
|
|
116312
116329
|
if (lineWidth) outVar.LineWidth=lineWidth;
|
|
116313
116330
|
if (isDrawAbove) outVar.IsDrawAbove=true;
|
|
116314
116331
|
if (isDrawCenter) outVar.IsDrawCenter=true;
|
|
@@ -116333,6 +116350,7 @@ function JSExecute(ast,option)
|
|
|
116333
116350
|
if (isShow==false) value.IsShow=false;
|
|
116334
116351
|
if (isExData==true) value.IsExData = true;
|
|
116335
116352
|
if (isDotLine==true) value.IsDotLine=true;
|
|
116353
|
+
if (IFrameSplitOperator.IsNonEmptyArray(lineDash)) value.LineDash=lineDash;
|
|
116336
116354
|
if (isOverlayLine==true) value.IsOverlayLine=true;
|
|
116337
116355
|
if (isSingleLine==true) value.IsSingleLine=true;
|
|
116338
116356
|
if (isShowTitle==false) value.IsShowTitle=false;
|
|
@@ -116820,6 +116838,9 @@ function JSExecute(ast,option)
|
|
|
116820
116838
|
case "YMOVE":
|
|
116821
116839
|
node.Out=this.Draw.YMOVE(args[0]);
|
|
116822
116840
|
break;
|
|
116841
|
+
case "LINEDASH":
|
|
116842
|
+
node.Out=this.Draw.LINEDASH(args);
|
|
116843
|
+
break;
|
|
116823
116844
|
case "FIRSTDRAW":
|
|
116824
116845
|
node.Out=this.Draw.FIRSTDRAW(args[0]);
|
|
116825
116846
|
break;
|
|
@@ -119079,7 +119100,15 @@ function ScriptIndex(name,script,args,option)
|
|
|
119079
119100
|
if (!isNaN(width) && width>0) line.LineWidth=width;
|
|
119080
119101
|
}
|
|
119081
119102
|
|
|
119082
|
-
if (varItem.IsDotLine)
|
|
119103
|
+
if (varItem.IsDotLine)
|
|
119104
|
+
{
|
|
119105
|
+
line.IsDotLine=true; //虚线
|
|
119106
|
+
line.LineDash=g_JSChartResource.DOTLINE.LineDash.slice();
|
|
119107
|
+
}
|
|
119108
|
+
|
|
119109
|
+
//虚线设置
|
|
119110
|
+
if (IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash)) line.LineDash=varItem.LineDash;
|
|
119111
|
+
|
|
119083
119112
|
if (varItem.IsShow==false) line.IsShow=false;
|
|
119084
119113
|
|
|
119085
119114
|
let titleIndex=windowIndex+1;
|
|
@@ -143141,7 +143170,7 @@ function HQChartScriptWorker()
|
|
|
143141
143170
|
|
|
143142
143171
|
|
|
143143
143172
|
|
|
143144
|
-
var HQCHART_VERSION="1.1.
|
|
143173
|
+
var HQCHART_VERSION="1.1.13753";
|
|
143145
143174
|
|
|
143146
143175
|
function PrintHQChartVersion()
|
|
143147
143176
|
{
|