hqchart 1.1.12708 → 1.1.12714

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.
@@ -1373,7 +1373,7 @@ option.CorssCursor={};option.CorssCursor.TitleHeight=chart.ChartCorssCursor.Text
1373
1373
  }if(item.IsShowRightText===false||item.IsShowRightText===true){chart.Frame.SubFrame[i].Frame.IsShowYText[1]=item.IsShowRightText;chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowRightText=item.IsShowRightText;//显示右边刻度
1374
1374
  }if(item.TopSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.TopSpace=item.TopSpace;if(item.BottomSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.BottomSpace=item.BottomSpace;if(item.RightTextPosition>0)chart.Frame.SubFrame[i].Frame.YTextPosition[1]=item.RightTextPosition;if(item.LeftTextPosition>0)chart.Frame.SubFrame[i].Frame.YTextPosition[0]=item.LeftTextPosition;if(item.IsShowXLine==false)chart.Frame.SubFrame[i].Frame.IsShowXLine=item.IsShowXLine;if(item.IsShowYLine==false)chart.Frame.SubFrame[i].Frame.IsShowYLine=item.IsShowYLine;if(IFrameSplitOperator.IsNumber(item.YTextBaseline))chart.Frame.SubFrame[i].Frame.YTextBaseline=item.YTextBaseline;if(item.YCoordinateType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=item.YCoordinateType;if(item.IsYReverse==true)chart.Frame.SubFrame[0].Frame.CoordinateType=1;//反转坐标
1375
1375
  if(IFrameSplitOperator.IsNumber(item.PercentageTextFormat))subFrame.YSplitOperator.PercentageTextFormat=item.PercentageTextFormat;//百分比坐标格式
1376
- if(item.DefaultYMaxMin)chart.Frame.SubFrame[i].Frame.YSplitOperator.DefaultYMaxMin=item.DefaultYMaxMin;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsPlusNumber(item.MinYDistance))chart.Frame.SubFrame[i].Frame.MinYDistance=item.MinYDistance;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(item.IsDrawTitleBottomLine))subFrame.IsDrawTitleBottomLine=item.IsDrawTitleBottomLine;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;}}if(option.KLine){if(option.KLine.ShowKLine==false)chart.ChartPaint[0].IsShow=false;if(option.KLine.InfoPosition>0)chart.ChartPaint[0].InfoPosition=option.KLine.InfoPosition;if(option.KLine.IsShowMaxMinPrice==false)chart.ChartPaint[0].IsShowMaxMinPrice=option.KLine.IsShowMaxMinPrice;}if(option.KLineTitle){var item=option.KLineTitle;if(option.KLineTitle.IsShowName==false)chart.TitlePaint[0].IsShowName=false;if(option.KLineTitle.IsShowSettingInfo==false)chart.TitlePaint[0].IsShowSettingInfo=false;if(option.KLineTitle.IsShow==false)chart.TitlePaint[0].IsShow=false;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;}//叠加股票
1376
+ if(item.DefaultYMaxMin)chart.Frame.SubFrame[i].Frame.YSplitOperator.DefaultYMaxMin=item.DefaultYMaxMin;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsPlusNumber(item.MinYDistance))chart.Frame.SubFrame[i].Frame.MinYDistance=item.MinYDistance;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(item.IsDrawTitleBottomLine))subFrame.IsDrawTitleBottomLine=item.IsDrawTitleBottomLine;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;if(item.ClientBGColor)subFrame.ClientBGColor=item.ClientBGColor;}}if(option.KLine){if(option.KLine.ShowKLine==false)chart.ChartPaint[0].IsShow=false;if(option.KLine.InfoPosition>0)chart.ChartPaint[0].InfoPosition=option.KLine.InfoPosition;if(option.KLine.IsShowMaxMinPrice==false)chart.ChartPaint[0].IsShowMaxMinPrice=option.KLine.IsShowMaxMinPrice;}if(option.KLineTitle){var item=option.KLineTitle;if(option.KLineTitle.IsShowName==false)chart.TitlePaint[0].IsShowName=false;if(option.KLineTitle.IsShowSettingInfo==false)chart.TitlePaint[0].IsShowSettingInfo=false;if(option.KLineTitle.IsShow==false)chart.TitlePaint[0].IsShow=false;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;}//叠加股票
1377
1377
  if(option.Overlay){for(var i=0;i<option.Overlay.length;++i){var item=option.Overlay[i];chart.OverlaySymbol(item.Symbol,item);}}if(option.ExtendChart){for(var i=0;i<option.ExtendChart.length;++i){var item=option.ExtendChart[i];chart.CreateExtendChart(item.Name,item);}}//创建子窗口的指标
1378
1378
  var scriptData=new JSIndexScript();if(option.ColorIndex)//五彩K线
1379
1379
  {var item=option.ColorIndex;var indexInfo=scriptData.Get(item.Index);if(indexInfo){indexInfo.ID=item.Index;chart.ColorIndex=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
@@ -1406,10 +1406,10 @@ if(IFrameSplitOperator.IsBool(option.EnableZoomIndexWindow))chart.EnableZoomInde
1406
1406
  if(option.SelectedChart){var item=option.SelectedChart;if(IFrameSplitOperator.IsBool(item.EnableSelected))chart.SelectedChart.EnableSelected=item.EnableSelected;if(IFrameSplitOperator.IsBool(item.EnableMoveOn))chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;}//分页
1407
1407
  if(option.PageInfo)chart.SetPageInfo(option.PageInfo);chart.Create(windowsCount,option);//创建子窗口
1408
1408
  if(option.CorssCursorInfo){var item=option.CorssCursorInfo;if(!isNaN(option.CorssCursorInfo.Left))chart.ChartCorssCursor.ShowTextMode.Left=option.CorssCursorInfo.Left;if(!isNaN(option.CorssCursorInfo.Right))chart.ChartCorssCursor.ShowTextMode.Right=option.CorssCursorInfo.Right;if(!isNaN(option.CorssCursorInfo.Bottom))chart.ChartCorssCursor.ShowTextMode.Bottom=option.CorssCursorInfo.Bottom;if(option.CorssCursorInfo.IsShowCorss===false)chart.ChartCorssCursor.IsShowCorss=option.CorssCursorInfo.IsShowCorss;if(option.CorssCursorInfo.RightTextFormat>0)chart.ChartCorssCursor.TextFormat.Right=option.CorssCursorInfo.RightTextFormat;if(option.CorssCursorInfo.IsOnlyDrawMinute==true)chart.ChartCorssCursor.IsOnlyDrawMinute=option.CorssCursorInfo.IsOnlyDrawMinute;//Y轴显示收盘价
1409
- if(IFrameSplitOperator.IsBool(option.CorssCursorInfo.IsFixXLastTime))chart.ChartCorssCursor.IsFixXLastTime=option.CorssCursorInfo.IsFixXLastTime;if(item.RightButton){if(IFrameSplitOperator.IsBool(item.RightButton.Enable))chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;}if(IFrameSplitOperator.IsNumber(item.PriceFormatType))chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;if(IFrameSplitOperator.IsNumber(item.DataFormatType))chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;if(IFrameSplitOperator.IsNumber(item.HPenType))chart.ChartCorssCursor.HPenType=item.HPenType;if(IFrameSplitOperator.IsNumber(item.VPenType))chart.ChartCorssCursor.VPenType=item.VPenType;}if(option.MinuteInfo)chart.CreateMinuteInfo(option.MinuteInfo);if(option.IsShowRightMenu==true)chart.RightMenu=new MinuteRightMenu(this.DivElement);if(IFrameSplitOperator.IsNumber(option.DayCount))chart.DayCount=option.DayCount;this.SetChartBorder(chart,option);if(option.SplashTitle)chart.ChartSplashPaint.SplashTitle=option.SplashTitle;if(IFrameSplitOperator.IsBool(option.EnableBorderDrag)){chart.EnableBorderDrag=option.EnableBorderDrag;}this.AdjustChartBorder(chart);if(option.Frame){for(var i=0;i<option.Frame.length;++i){var item=option.Frame[i];if(!chart.Frame.SubFrame[i])continue;if(IFrameSplitOperator.IsNumber(item.SplitCount))chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitCount=item.SplitCount;if(item.StringFormat)chart.Frame.SubFrame[i].Frame.YSplitOperator.StringFormat=item.StringFormat;if(IFrameSplitOperator.IsNumber(item.SplitType)){chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitType=item.SplitType;chart.Frame.SubFrame[i].Frame.YSplitOperator.DefaultSplitType=item.SplitType;}if(item.IsShowLeftText==false){chart.Frame.SubFrame[i].Frame.IsShowYText[0]=item.IsShowLeftText;chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowLeftText=item.IsShowLeftText;//显示左边刻度
1409
+ if(IFrameSplitOperator.IsBool(option.CorssCursorInfo.IsFixXLastTime))chart.ChartCorssCursor.IsFixXLastTime=option.CorssCursorInfo.IsFixXLastTime;if(item.RightButton){if(IFrameSplitOperator.IsBool(item.RightButton.Enable))chart.ChartCorssCursor.RightButton.Enable=item.RightButton.Enable;}if(IFrameSplitOperator.IsNumber(item.PriceFormatType))chart.ChartCorssCursor.StringFormatY.PriceFormatType=item.PriceFormatType;if(IFrameSplitOperator.IsNumber(item.DataFormatType))chart.ChartCorssCursor.StringFormatY.DataFormatType=item.DataFormatType;if(IFrameSplitOperator.IsNumber(item.HPenType))chart.ChartCorssCursor.HPenType=item.HPenType;if(IFrameSplitOperator.IsNumber(item.VPenType))chart.ChartCorssCursor.VPenType=item.VPenType;}if(option.MinuteInfo)chart.CreateMinuteInfo(option.MinuteInfo);if(option.IsShowRightMenu==true)chart.RightMenu=new MinuteRightMenu(this.DivElement);if(IFrameSplitOperator.IsNumber(option.DayCount))chart.DayCount=option.DayCount;this.SetChartBorder(chart,option);if(option.SplashTitle)chart.ChartSplashPaint.SplashTitle=option.SplashTitle;if(IFrameSplitOperator.IsBool(option.EnableBorderDrag)){chart.EnableBorderDrag=option.EnableBorderDrag;}this.AdjustChartBorder(chart);if(option.Frame){for(var i=0;i<option.Frame.length;++i){var item=option.Frame[i];if(!chart.Frame.SubFrame[i])continue;var subFrame=chart.Frame.SubFrame[i].Frame;if(IFrameSplitOperator.IsNumber(item.SplitCount))chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitCount=item.SplitCount;if(item.StringFormat)chart.Frame.SubFrame[i].Frame.YSplitOperator.StringFormat=item.StringFormat;if(IFrameSplitOperator.IsNumber(item.SplitType)){chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitType=item.SplitType;chart.Frame.SubFrame[i].Frame.YSplitOperator.DefaultSplitType=item.SplitType;}if(item.IsShowLeftText==false){chart.Frame.SubFrame[i].Frame.IsShowYText[0]=item.IsShowLeftText;chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowLeftText=item.IsShowLeftText;//显示左边刻度
1410
1410
  }if(item.IsShowRightText==false){chart.Frame.SubFrame[i].Frame.IsShowYText[1]=item.IsShowRightText;chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowRightText=item.IsShowRightText;//显示右边刻度
1411
1411
  }if(item.Height>=0)chart.Frame.SubFrame[i].Height=item.Height;if(item.Custom)chart.Frame.SubFrame[i].Frame.YSplitOperator.Custom=item.Custom;if(item.RightTextFormat>0)chart.Frame.SubFrame[i].Frame.YSplitOperator.RightTextFormat=item.RightTextFormat;if(IFrameSplitOperator.IsNumber(item.TitleHeight))chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsNumber(item.FloatPrecision))chart.Frame.SubFrame[i].Frame.YSplitOperator.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsBool(item.IsShowXLine))chart.Frame.SubFrame[i].Frame.IsShowXLine=item.IsShowXLine;if(IFrameSplitOperator.IsBool(item.IsShowYLine))chart.Frame.SubFrame[i].Frame.IsShowYLine=item.IsShowYLine;if(IFrameSplitOperator.IsNumber(item.YTextBaseline))chart.Frame.SubFrame[i].Frame.YTextBaseline=item.YTextBaseline;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(item.TopSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.TopSpace=item.TopSpace;if(item.BottomSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.BottomSpace=item.BottomSpace;//是否显示关闭集合竞价按钮
1412
- if(IFrameSplitOperator.IsNumber(item.CloseBeforeButton))chart.Frame.SubFrame[i].Frame.IsShowCloseButton=item.CloseBeforeButton;}chart.UpdateXShowText();}if(option.ExtendChart){for(var i=0;i<option.ExtendChart.length;++i){var item=option.ExtendChart[i];chart.CreateExtendChart(item.Name,item);}}//叠加股票
1412
+ if(IFrameSplitOperator.IsNumber(item.CloseBeforeButton))chart.Frame.SubFrame[i].Frame.IsShowCloseButton=item.CloseBeforeButton;if(item.ClientBGColor)subFrame.ClientBGColor=item.ClientBGColor;}chart.UpdateXShowText();}if(option.ExtendChart){for(var i=0;i<option.ExtendChart.length;++i){var item=option.ExtendChart[i];chart.CreateExtendChart(item.Name,item);}}//叠加股票
1413
1413
  if(option.Overlay){for(var i=0;i<option.Overlay.length;++i){var item=option.Overlay[i];chart.OverlaySymbol(item.Symbol,item);}}if(option.MinuteLine){if(option.MinuteLine.IsDrawAreaPrice==false)chart.ChartPaint[0].IsDrawArea=false;if(option.MinuteLine.IsShowLead==false)chart.IsShowLead=false;if(option.MinuteLine.IsShowAveragePrice==false){chart.ChartPaint[1].IsShow=false;chart.TitlePaint[0].IsShowAveragePrice=false;//标题栏均线也不显示
1414
1414
  for(var i=0;i<chart.ExtendChartPaint.length;++i){var item=chart.ExtendChartPaint[i];if(item.ClassName=="MinuteTooltipPaint")item.IsShowAveragePrice=false;}}if(option.MinuteLine.SplitType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.SplitType=option.MinuteLine.SplitType;}if(option.MinuteVol){var item=option.MinuteVol;if(IFrameSplitOperator.IsNumber(item.BarColorType))chart.ChartPaint[2].BarColorType=item.BarColorType;}if(option.MinuteTitle){var item=option.MinuteTitle;if(IFrameSplitOperator.IsBool(item.IsShowName))chart.TitlePaint[0].IsShowName=item.IsShowName;if(IFrameSplitOperator.IsBool(item.IsShowDate))chart.TitlePaint[0].IsShowDate=item.IsShowDate;if(IFrameSplitOperator.IsBool(item.IsShowTime))chart.TitlePaint[0].IsShowTime=item.IsShowTime;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData))chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat))chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;if(IFrameSplitOperator.IsNumber(item.TitleBaseLine))chart.TitlePaint[0].TitleBaseLine=item.TitleBaseLine;if(item.TimeFormat)chart.TitlePaint[0].TimeFormat=item.TimeFormat;}if(option.CorssCursorTouchEnd===true)chart.CorssCursorTouchEnd=option.CorssCursorTouchEnd;if(option.IsShowBeforeData===true)chart.IsShowBeforeData=option.IsShowBeforeData;//分钟数据指标从第3个指标窗口设置
1415
1415
  if(IFrameSplitOperator.IsNonEmptyArray(option.Windows)){var scriptData=new JSIndexScript();for(var i=0;i<option.Windows.length;++i){var index=2+i;var item=option.Windows[i];if(item.Script){chart.WindowIndex[index]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
@@ -2196,6 +2196,7 @@ this.XSplit=true;//X轴变化
2196
2196
  this.HorizontalMax;//Y轴最大值
2197
2197
  this.HorizontalMin;//Y轴最小值
2198
2198
  this.XPointCount=10;//X轴数据个数
2199
+ this.ClientBGColor;//客户区背景色
2199
2200
  //Y轴原始的最大值 最小值
2200
2201
  this.YMaxMin={Max:null,Min:null};this.YSplitOperator;//Y轴分割
2201
2202
  this.XSplitOperator;//X轴分割
@@ -2217,7 +2218,8 @@ this.IsMinSize=false;//窗口是否最小化
2217
2218
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSChartResource.FrameLogo.Font;this.LogoBGColor=g_JSChartResource.FrameLogo.BGColor;this.GlobalOption;//this.IsDrawLeftBorder;
2218
2219
  this.IsDrawRightBorder=false;//是否绘制右侧刻度空白的边框
2219
2220
  this.PtInButtons=function(x,y)//坐标是否在按钮上
2220
- {for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;};this.DrawFrame=function(){};this.ClearCoordinateText=function(option){if(IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo)){for(var i=0;i<this.HorizontalInfo.length;++i){var item=this.HorizontalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}if(IFrameSplitOperator.IsNonEmptyArray(this.VerticalInfo)){for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}};//画边框
2221
+ {for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;};this.DrawFrame=function(){};this.DrawClientBG=function(){if(!this.ClientBGColor)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
2222
+ var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.ClientBGColor;this.Canvas.fillRect(left,top,width,height);};this.ClearCoordinateText=function(option){if(IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo)){for(var i=0;i<this.HorizontalInfo.length;++i){var item=this.HorizontalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}if(IFrameSplitOperator.IsNonEmptyArray(this.VerticalInfo)){for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}};//画边框
2221
2223
  this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
2222
2224
  var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;//JSConsole.Chart.Log(`[IChartFramePainting.DrawBorder] left=${left} `);
2223
2225
  if(this.BorderLine==null){if(this.IsDrawRightBorder){var xRight=ToFixedPoint(border.ChartWidth);this.Canvas.strokeStyle=this.PenBorder;this.Canvas.strokeRect(left,top,xRight-left,height);this.Canvas.beginPath();this.Canvas.moveTo(right,top);this.Canvas.lineTo(right,bottom);this.Canvas.stroke();}else{this.Canvas.strokeStyle=this.PenBorder;this.Canvas.strokeRect(left,top,width,height);}}else if(IFrameSplitOperator.IsPlusNumber(this.BorderLine))//单独绘制每个边框
@@ -4014,7 +4016,7 @@ Zoom:{Type:g_JSChartResource.DRAWTEXT.Zoom.Type,Value:g_JSChartResource.DRAWTEXT
4014
4016
  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,//字体的最大最小值
4015
4017
  Zoom:{Type:g_JSChartResource.DRAWNUMBER.Zoom.Type,Value:g_JSChartResource.DRAWNUMBER.Zoom.Value},//放大倍数
4016
4018
  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')//固定位置的 没有大小值
4017
- {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()//绘制在指定位置上
4019
+ {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.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())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();this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);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,false);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.Canvas.restore();};this.DrawPosition=function()//绘制在指定位置上
4018
4020
  {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为右对齐.
4019
4021
  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=右
4020
4022
  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=右
@@ -4036,9 +4038,9 @@ this.ExportData=this.ExportBoolData;this.TextSize={Max:g_JSChartResource.DRAWICO
4036
4038
  Zoom:{Type:g_JSChartResource.DRAWICON.Text.Zoom.Type,Value:g_JSChartResource.DRAWICON.Text.Zoom.Value},//放大倍数
4037
4039
  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,//字体的最大最小值
4038
4040
  Zoom:{Type:g_JSChartResource.DRAWTEXT.Zoom.Type,Value:g_JSChartResource.DRAWTEXT.Zoom.Value},//放大倍数
4039
- 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)//固定字体大小模式
4041
+ FontName:g_JSChartResource.DRAWTEXT.FontName,YOffset:g_JSChartResource.DRAWTEXT.YOffset};};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;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();this.Canvas.save();this.ClipClient(isHScreen);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)//固定字体大小模式
4040
4042
  this.TextFont=this.FixedFontSize+'px '+this.TextSize.FontName;else//动态字体大小
4041
- 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=右
4043
+ 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,false);}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.Canvas.restore();};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=右
4042
4044
  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=右
4043
4045
  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);}};//画连线
4044
4046
  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;//派生
@@ -10660,7 +10662,7 @@ numberData.SingleValue=data2;numberData.DataType=1;if(IFrameSplitOperator.IsNumb
10660
10662
  */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;//条件是否
10661
10663
  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;};//数据左右偏移
10662
10664
  this.XMOVE=function(offset){return offset;};//数据上下偏移
10663
- this.YMOVE=function(offset){return offset;};/*
10665
+ this.YMOVE=function(offset){return offset;};this.FIRSTDRAW=function(value){return value;};/*
10664
10666
  SOUND 播放声音。用法:SOUND(NAME),播放NAME
10665
10667
  注:
10666
10668
  1、点击设置声音按钮,在弹出来的界面中设置声音,声音用字符'A'~'J'表示。
@@ -11328,7 +11330,7 @@ var isNoneName=false;var isShowTitle=true;//显示在位置之上,对于DRAWTEXT
11328
11330
  var isDrawAbove=false;var isDrawCenter=false;var isDrawBelow=false;//VALIGN0,VALIGN1,VALIGN2 设置文字垂直对齐方式(上中下)
11329
11331
  //ALIGN0,ALIGN1,ALIGN2 设置文字水平对齐方式(左中右)
11330
11332
  var drawAlign=-1,drawVAlign=-1;var fontSize=-1;var bgConfig=null;//背景设置
11331
- var vLineConfig=null;var xOffset=null,yOffset=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))//绘图函数赋值
11333
+ var vLineConfig=null;var isFirstDraw=null;var xOffset=null,yOffset=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))//绘图函数赋值
11332
11334
  {_draw3=this.VarDrawTable.get(_varName3);}else if(!Array.isArray(varValue)){varValue=this.SingleDataToArrayData(varValue);this.VarTable.set(_varName3,varValue);//把常量放到变量表里
11333
11335
  }}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=="LINEAREA")lineArea=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("RGBX")==0&&value.length==10)color=value;//RGBX+“RRGGBB”
11334
11336
  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;//扩展数据, 不显示再图形里面
@@ -11336,7 +11338,7 @@ else if(value.indexOf('LINEOVERLAY')==0)isOverlayLine=true;else if(value.indexOf
11336
11338
  else if(value.indexOf("FONTSIZE")==0){var strFontSize=value.replace("FONTSIZE","");fontSize=parseInt(strFontSize);}else{if(_j14==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);//放到变量表里
11337
11339
  }}}else if(itemExpression.Type==Syntax.Literal)//常量
11338
11340
  {if(_j14==0){var aryValue=this.SingleDataToArrayData(itemExpression.Value);_varName3=itemExpression.Value.toString();this.VarTable.set(_varName3,aryValue);//把常量放到变量表里
11339
- }}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 _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(_j14==0){_varName3="__temp_sb_"+i+"__";var _aryValue=itemExpression.Out;isNoneName=true;this.VarTable.set(_varName3,_aryValue);}}}if(pointDot&&_varName3)//圆点
11341
+ }}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 _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=="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.Type==Syntax.BinaryExpression){if(_j14==0){_varName3="__temp_sb_"+i+"__";var _aryValue=itemExpression.Out;isNoneName=true;this.VarTable.set(_varName3,_aryValue);}}}if(pointDot&&_varName3)//圆点
11340
11342
  {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)//圆点
11341
11343
  {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)//彩色点
11342
11344
  {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 同时画出柱状线和指标线
@@ -11345,14 +11347,14 @@ else if(value.indexOf("FONTSIZE")==0){var strFontSize=value.replace("FONTSIZE","
11345
11347
  {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(lineArea&&_varName3)//LINEAREA 面积
11346
11348
  {var _outVar13=this.VarTable.get(_varName3);var _value10={Name:_varName3,Data:_outVar13,Type:9};if(color)_value10.Color=color;if(upColor)_value10.UpColor=upColor;if(downColor)_value10.DownColor=downColor;if(lineWidth)_value10.LineWidth=lineWidth;this.OutVarTable.push(_value10);}else if(colorStick&&_varName3)//CYW: SUM(VAR4,10)/10000, COLORSTICK; 画上下柱子
11347
11349
  {var _outVar14=this.VarTable.get(_varName3);var _value11={Name:_varName3,Data:_outVar14,Color:color,Type:2};if(lineWidth)_value11.LineWidth=lineWidth;if(color)_value11.Color=color;if(upColor)_value11.UpColor=upColor;if(downColor)_value11.DownColor=downColor;this.OutVarTable.push(_value11);}else if(_varName3&&color&&!_draw3){var _outVar15=this.VarTable.get(_varName3);if(!Array.isArray(_outVar15))_outVar15=this.SingleDataToArrayData(_outVar15);var _value12={Name:_varName3,Data:_outVar15,Color:color,Type:0};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(isNoneName==true)_value12.NoneName=true;if(isShowTitle==false)_value12.IsShowTitle=false;if(stepLine==true)_value12.Type=7;this.OutVarTable.push(_value12);}else if(_draw3)//画图函数
11348
- {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 _outVar16=this.VarTable.get(_varName3);var _value13={Name:_varName3,Data:_outVar16,Type:0};if(color)_value13.Color=color;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(isShowTitle==false)_value13.IsShowTitle=false;if(stepLine==true)_value13.Type=7;this.OutVarTable.push(_value13);}}}};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();//执行脚本
11350
+ {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;this.OutVarTable.push(outVar);}else if(_varName3){var _outVar16=this.VarTable.get(_varName3);var _value13={Name:_varName3,Data:_outVar16,Type:0};if(color)_value13.Color=color;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(isShowTitle==false)_value13.IsShowTitle=false;if(stepLine==true)_value13.Type=7;this.OutVarTable.push(_value13);}}}};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();//执行脚本
11349
11351
  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 _this46=this;if(debugCtrl.ExeLine<debugCtrl.LineCount){var item=this.AST.Body[debugCtrl.ExeLine];this.RunASTNode(item);++debugCtrl.ExeLine;this.DebugFilter(debugCtrl,function(){_this46.DebugRun_Next(debugCtrl);});}else{this.DebugRun_End();debugCtrl.Status=2;this.DebugFilter(debugCtrl,null);}};//debug模式
11350
11352
  this.DebugRun=function(){var _this47=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(){_this47.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 _i145 in node.Expression){var _item25=node.Expression[_i145];this.VisitNode(_item25);}};//函数调用
11351
11353
  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个条件参数
11352
11354
  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表达式.
11353
11355
  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() ,')');
11354
11356
  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'://行情最新数据
11355
- 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"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"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"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":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;//交易函数
11357
+ 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"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"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":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;//交易函数
11356
11358
  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;};//赋值
11357
11359
  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)//右值是变量
11358
11360
  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);};//逻辑运算
@@ -11407,7 +11409,7 @@ else if(value.indexOf('LINEOVERLAY')==0)isOverlayLine=true;else if(value.indexOf
11407
11409
  this.VisitCallExpression=function(node){var funcName=node.Callee.Name;var args=[];for(var _i149 in node.Arguments){var _item29=node.Arguments[_i149];var value=void 0;if(_item29.Type==Syntax.BinaryExpression||_item29.Type==Syntax.LogicalExpression)value=this.VisitBinaryExpression(_item29);else if(_item29.Type==Syntax.CallExpression)value=this.VisitCallExpression(_item29);else value=this.GetNodeValue(_item29);args.push(value);}JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]',funcName,'(',args.toString(),')');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;}node.Out=this.CallFunctionExplain(funcName,args,node);return node.Out;};this.FUNCTION_INFO_LIST=new _map2.default([["REF",{Name:"REF",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u524D\u7684'+args[0];}}],["REFX",{Name:"REFX",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u540E\u7684'+args[0];}}],["REFV",{Name:"REFV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u524D\u7684(\u672A\u4F5C\u5E73\u6ED1\u5904\u7406)'+args[0];}}],["REFXV",{Name:"REFXV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u540E\u7684(\u672A\u4F5C\u5E73\u6ED1\u5904\u7406)'+args[0];}}],["REFDATE",{Name:"REFDATE",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5'+args[0];}}],["COUNT",{Name:"COUNT",Param:{Count:2},ToString:function ToString(args){return'\u7EDF\u8BA1'+args[1]+'\u65E5\u4E2D\u6EE1\u8DB3'+args[0]+'\u7684\u5929\u6570';}}],["BARSLASTCOUNT",{Name:"BARSLASTCOUNT",Param:{Count:1},ToString:function ToString(args){return'\u6761\u4EF6'+args[0]+'\u8FDE\u7EED\u6210\u7ACB\u6B21\u6570';}}],["BARSCOUNT",{Name:"BARSCOUNT",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u6709\u6548\u6570\u636E\u5468\u671F\u6570';}}],["BARSLAST",{Name:"BARSLAST",Param:{Count:1},ToString:function ToString(args){return'\u4E0A\u6B21'+args[0]+'\u4E0D\u4E3A0\u8DDD\u4ECA\u5929\u6570';}}],["BARSNEXT",{Name:"BARSNEXT",Param:{Count:1},ToString:function ToString(args){return'\u4E0B\u6B21'+args[0]+'\u4E0D\u4E3A0\u8DDD\u4ECA\u5929\u6570';}}],["BARSSINCEN",{Name:"BARSSINCEN",Param:{Count:2},ToString:function ToString(args){return'\u5728'+args[1]+'\u5468\u671F\u5185\u9996\u6B21'+args[0]+'\u8DDD\u4ECA\u5929\u6570';}}],["BARSSINCE",{Name:"BARSSINCE",Param:{Count:1},ToString:function ToString(args){return'\u9996\u6B21'+args[0]+'\u8DDD\u4ECA\u5929\u6570';}}],["HHV",{Name:"HHV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u6700\u9AD8\u503C';}}],["LLV",{Name:"LLV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u6700\u4F4E\u503C';}}],["ZTPRICE",{Name:"ZTPRICE",Param:{Count:2},ToString:function ToString(args){return'计算涨停价';}}],["DTPRICE",{Name:"DTPRICE",Param:{Count:2},ToString:function ToString(args){return'计算跌停价';}}],["BACKSET",{Name:"BACKSET",Param:{Count:2},ToString:function ToString(args){return'\u82E5'+args[0]+'\u5219\u5C06\u6700\u8FD1'+args[1]+'\u5468\u671F\u7F6E\u4E3A1';}}],["HOD",{Name:"HOD",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u9AD8\u503C\u540D\u6B21';}}],["LOD",{Name:"LOD",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u4F4E\u503C\u540D\u6B21';}}],["REVERSE",{Name:"REVERSE",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u76F8\u53CD\u6570';}}],["FILTER",{Name:"FILTER",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u8FC7\u6EE4';}}],["FILTERX",{Name:"FILTERX",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u53CD\u5411\u8FC7\u6EE4';}}],["TFILTER",{Name:"TFILTER",Param:{Count:3},ToString:function ToString(args){return'\u4FE1\u53F7\u8FC7\u6EE4(\u591A\u5934)';}}],["SUMBARS",{Name:"SUMBARS",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7D2F\u52A0\u81F3'+args[1]+'\u7684\u5929\u6570';}}],["MA",{Name:"MA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u7B80\u5355\u79FB\u52A8\u5E73\u5747';}}],["SMA",{Name:"SMA",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5['+args[2]+'\u65E5\u6743\u91CD]\u79FB\u52A8\u5E73\u5747';}}],["MEMA",{Name:"MEMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u5E73\u6ED1\u79FB\u52A8\u5E73\u5747';}}],["EMA",{Name:"EMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6307\u6570\u79FB\u52A8\u5E73\u5747';}}],["EXPMA",{Name:"EXPMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6307\u6570\u79FB\u52A8\u5E73\u5747';}}],["EXPMEMA",{Name:"EXPMEMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6307\u6570\u5E73\u6ED1\u79FB\u52A8\u5E73\u5747';}}],["WMA",{Name:"WMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u52A0\u6743\u79FB\u52A8\u5E73\u5747';}}],["DMA",{Name:"DMA",Param:{Count:2},ToString:function ToString(args){return'\u4EE5'+args[1]+'\u4E3A\u6743\u91CD'+args[0]+'\u7684\u52A8\u6001\u79FB\u52A8\u5E73\u5747';}}],["XMA",{Name:"XMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u504F\u79FB\u79FB\u52A8\u5E73\u5747';}}],["RANGE",{Name:"RANGE",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u4F4D\u4E8E'+args[1]+'\u548C'+args[2]+'\u4E4B\u95F4';}}],["CONST",{Name:"CONST",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6700\u540E\u4E00\u65E5\u503C';}}],["TOPRANGE",{Name:"TOPRANGE",Param:{Count:1},ToString:function ToString(args){return'\u5F53\u524D\u503C\u662F\u8FD1'+args[0]+'\u5468\u671F\u7684\u6700\u5927\u503C';}}],["LOWRANGE",{Name:"LOWRANGE",Param:{Count:1},ToString:function ToString(args){return'\u5F53\u524D\u503C\u662F\u8FD1'+args[0]+'\u5468\u671F\u7684\u6700\u5C0F\u503C';}}],["FINDHIGH",{Name:"FINDHIGH",Param:{Count:4},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u9AD8\u4EF7';}}],["FINDHIGHBARS",{Name:"FINDHIGHBARS",Param:{Count:4},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u9AD8\u4EF7\u5230\u5F53\u524D\u5468\u671F\u7684\u5468\u671F\u6570';}}],["FINDLOW",{Name:"FINDLOW",Param:{Count:4},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u4F4E\u4EF7';}}],["FINDLOWBARS",{Name:"FINDLOWBARS",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u4F4E\u4EF7\u5230\u5F53\u524D\u5468\u671F\u7684\u5468\u671F\u6570';}}],["SUM",{Name:"SUM",Param:{Count:2},ToString:function ToString(args){return''+args[0]+args[1]+'\u65E5\u7D2F\u52A0';}}],["MULAR",{Name:"MULAR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u65E5\u7D2F\u4E58';}}],["AMA",{Name:"AMA",Param:{Count:2},ToString:function ToString(args){return'\u4EE5'+args[1]+'\u4E3A\u6743\u91CD'+args[0]+'\u7684\u81EA\u9002\u5E94\u5747\u7EBF';}}],["TMA",{Name:"TMA",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5['+args[2]+'\u65E5\u6743\u91CD]\u79FB\u52A8\u5E73\u5747';}}],["CROSS",{Name:"CROSS",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u4E0A\u7A7F'+args[1];}}],["LONGCROSS",{Name:"LONGCROSS",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u5C0F\u4E8E'+args[1]+'\u4FDD\u6301'+args[2]+'\u4E2A\u4EA4\u6613\u65E5\u540E\u4EA4\u53C9\u4E0A\u7A7F';}}],["UPNDAY",{Name:"UPNDAY",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5'+args[0]+'\u8FDE\u6DA8';}}],["DOWNNDAY",{Name:"DOWNNDAY",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5'+args[0]+'\u8FDE\u8DCC';}}],["NDAY",{Name:"NDAY",Param:{Count:3},ToString:function ToString(args){return'\u6700\u8FD1'+args[2]+'\u65E5'+args[0]+'\u4E00\u76F4\u5927\u4E8E'+args[1];}}],["EXIST",{Name:"EXIST",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5\u5B58\u5728'+args[0];}}],["EXISTR",{Name:"EXISTR",Param:{Count:3},ToString:function ToString(args){return'\u4ECE\u524D'+args[1]+'\u65E5\u5230\u524D'+args[2]+'\u65E5\u5B58\u5728'+args[0];}}],["EVERY",{Name:"EVERY",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5\u4E00\u76F4\u5B58\u5728'+args[0];}}],["LAST",{Name:"LAST",Param:{Count:3},ToString:function ToString(args){return'\u4ECE\u524D'+args[1]+'\u65E5\u5230\u524D'+args[2]+'\u65E5\u6301\u7EED'+args[0];}}],["NOT",{Name:"NOT",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u53D6\u53CD';}}],["IF",{Name:"IF",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["IFF",{Name:"IFF",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["IFN",{Name:"IFN",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["IFC",{Name:"IFC",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["TESTSKIP",{Name:"TESTSKIP",Param:{Count:1},ToString:function ToString(args){return'\u5982\u679C\u6EE1\u8DB3\u6761\u4EF6'+args[0]+',\u516C\u5F0F\u8FD4\u56DE';}}],["VALUEWHEN",{Name:"VALUEWHEN",Param:{Count:2},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE\u4E0A\u4E2A\u8F93\u51FA\u503C ';}}],["MAX",{Name:"MAX",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684\u8F83\u5927\u503C';}}],["MIN",{Name:"MIN",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684\u8F83\u5C0F\u503C';}}],["ACOS",{Name:"ACOS",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u53CD\u4F59\u5F26';}}],["ASIN",{Name:"ASIN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u53CD\u6B63\u5F26';}}],["ATAN",{Name:"ATAN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u53CD\u6B63\u5207';}}],["COS",{Name:"COS",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u4F59\u5F26';}}],["SIN",{Name:"SIN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6B63\u5F26';}}],["TAN",{Name:"TAN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6B63\u5207';}}],["EXP",{Name:"EXP",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6307\u6570';}}],["LN",{Name:"LN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u81EA\u7136\u5BF9\u6570';}}],["LOG",{Name:"LOG",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5BF9\u6570';}}],["SQRT",{Name:"SQRT",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5F00\u65B9';}}],["ABS",{Name:"ABS",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u7EDD\u5BF9\u503C';}}],["POW",{Name:"POW",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u4E58\u5E42';}}],["CEILING",{Name:"CEILING",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5411\u4E0A\u820D\u5165';}}],["FLOOR",{Name:"FLOOR",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5411\u4E0A\u820D\u5165';}}],["INTPART",{Name:"INTPART",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6574\u6570\u90E8\u5206';}}],["BETWEEN",{Name:"BETWEEN",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u4F4D\u4E8E'+args[1]+'\u548C'+args[2]+'\u4E4B\u95F4';}}],["FRACPART",{Name:"FRACPART",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5C0F\u6570\u90E8\u5206';}}],["ROUND",{Name:"ROUND",Param:{Count:1},ToString:function ToString(args){return'\u5BF9'+args[0]+'(\u8FDB\u884C)\u56DB\u820D\u4E94\u5165';}}],["ROUND2",{Name:"ROUND2",Param:{Count:2},ToString:function ToString(args){return'\u5BF9'+args[0]+'(\u8FDB\u884C)\u56DB\u820D\u4E94\u5165';}}],["SIGN",{Name:"SIGN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u7B26\u53F7';}}],["MOD",{Name:"MOD",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u5173\u4E8E'+args[1]+'\u7684\u6A21';}}],["RAND",{Name:"RAND",Param:{Count:1},ToString:function ToString(args){return'\u968F\u673A\u6B63\u6574\u6570';}}],["AVEDEV",{Name:"AVEDEV",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u5E73\u5747\u7EDD\u5BF9\u504F\u5DEE';}}],["DEVSQ",{Name:"DEVSQ",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6570\u636E\u504F\u5DEE\u5E73\u65B9\u548C';}}],["FORCAST",{Name:"FORCAST",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u7EBF\u6027\u56DE\u5F52\u9884\u6D4B\u503C';}}],["TSMA",{Name:"TSMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u4E2A\u5468\u671F\u5185\u7684\u65F6\u95F4\u5E8F\u5217\u4E09\u89D2\u79FB\u52A8\u5E73\u5747';}}],["SLOPE",{Name:"SLOPE",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u7EBF\u6027\u56DE\u5F52\u659C\u7387';}}],["STD",{Name:"STD",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u4F30\u7B97\u6807\u51C6\u5DEE';}}],["STDP",{Name:"STDP",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u603B\u4F53\u6807\u51C6\u5DEE';}}],["STDDEV",{Name:"STDDEV",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6807\u51C6\u504F\u5DEE';}}],["VAR",{Name:"VAR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u4F30\u7B97\u6837\u672C\u65B9\u5DEE';}}],["VARP",{Name:"VARP",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u603B\u4F53\u6837\u672C\u65B9\u5DEE';}}],["COVAR",{Name:"COVAR",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684'+args[2]+'\u5468\u671F\u7684\u534F\u65B9\u5DEE';}}],["RELATE",{Name:"RELATE",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684'+args[0]+'\u5468\u671F\u7684\u76F8\u5173\u7CFB\u6570';}}],["BETA",{Name:"BETA",Param:{Count:1},ToString:function ToString(args){return'\u03B2(Beta)\u7CFB\u6570';}}],["BETAEX",{Name:"BETAEX",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684'+args[2]+'\u5468\u671F\u7684\u76F8\u5173\u653E\u5927\u7CFB\u6570';}}],["COST",{Name:"COST",Param:{Count:1},ToString:function ToString(args){return'\u83B7\u5229\u76D8\u4E3A'+args[0]+'%\u7684\u6210\u672C\u5206\u5E03';}}],["WINNER",{Name:"WINNER",Param:{Count:1},ToString:function ToString(args){return'\u4EE5'+args[0]+'\u8BA1\u7B97\u7684\u83B7\u5229\u76D8\u6BD4\u4F8B';}}],["LWINNER",{Name:"LWINNER",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[0]+'\u65E5\u90A3\u90E8\u5206\u6210\u672C\u4EE5'+args[1]+'\u4EF7\u683C\u5356\u51FA\u7684\u83B7\u5229\u76D8\u6BD4\u4F8B';}}],["PWINNER",{Name:"PWINNER",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u65E5\u524D\u90A3\u90E8\u5206\u6210\u672C\u4EE5'+args[1]+'\u4EF7\u683C\u5356\u51FA\u7684\u83B7\u5229\u76D8\u6BD4\u4F8B';}}],["COSTEX",{Name:"COSTEX",Param:{Count:2},ToString:function ToString(args){return'\u4F4D\u4E8E\u4EF7\u683C'+args[0]+'\u548C'+args[1]+'\u95F4\u7684\u6210\u672C';}}],["PPART",{Name:"PPART",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u65E5\u524D\u90A3\u90E8\u5206\u6210\u672C\u5360\u603B\u6210\u672C\u7684\u6BD4\u4F8B';}}],["SAR",{Name:"SAR",Param:{Count:3},ToString:function ToString(args){return'\u6B65\u957F\u4E3A'+args[1]+'\u6781\u9650\u503C\u4E3A'+args[0]+'\u7684'+args[2]+'\u65E5\u629B\u7269\u8F6C\u5411';}}],["SARTURN",{Name:"SARTURN",Param:{Count:3},ToString:function ToString(args){return'\u6B65\u957F\u4E3A'+args[1]+'\u6781\u9650\u503C\u4E3A'+args[0]+'\u7684'+args[2]+'\u65E5\u629B\u7269\u8F6C\u5411\u70B9';}}],//字符串函数
11408
11410
  ["CON2STR",{Name:"CON2STR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u5B57\u7B26\u4E32';}}],["VAR2STR",{Name:"VAR2STR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u5B57\u7B26\u4E32';}}],["STR2CON",{Name:"STR2CON",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u6570\u5B57';}}],["STRLEN",{Name:"STRLEN",Param:{Count:1},ToString:function ToString(args){return'\u5F97\u5230'+args[0]+'\u5B57\u7B26\u4E32\u957F\u5EA6';}}],["STRCAT",{Name:"STRCAT",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32\u76F8\u52A0';}}],["VARCAT",{Name:"VARCAT",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32\u76F8\u52A0';}}],["STRSPACE",{Name:"STRSPACE",Param:{Count:1},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u52A0\u4E00\u7A7A\u683C';}}],["SUBSTR",{Name:"SUBSTR",Param:{Count:3},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u4E2D\u53D6\u4E00\u90E8\u5206';}}],["STRCMP",{Name:"STRCMP",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u548C\u5B57\u7B26\u4E32'+args[1]+'\u6BD4\u8F83';}}],["FINDSTR",{Name:"FINDSTR",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u4E2D\u67E5\u627E\u5B57\u7B26\u4E32'+args[1];}}],["NAMEINCLUD",{Name:"NAMEINCLUD",Param:{Count:1},ToString:function ToString(args){return'\u67E5\u627E\u54C1\u79CD\u540D\u79F0\u4E2D\u5305\u542B'+args[0];}}],["CODELIKE",{Name:"CODELIKE",Param:{Count:1},ToString:function ToString(args){return'\u67E5\u627E\u54C1\u79CD\u540D\u79F0\u4E2D\u5305\u542B'+args[0];}}],["INBLOCK",{Name:"AVEDEV",Param:{Count:1},ToString:function ToString(args){return'\u5C5E\u4E8E'+args[0]+'\u677F\u5757';}}],["STKINDI",{Name:"STKINDI",Param:{Dynamic:true},ToString:function ToString(args){return"指标引用";}}],["STRFORMAT",{Name:"STRFORMAT",Param:{Dynamic:true},ToString:function ToString(args){return'\u683C\u5F0F\u5316'+args[0]+'\u5B57\u7B26\u4E32';}}],["HHVBARS",{Name:"HHVBARS",Param:{Count:2},ToString:function ToString(args){if(args[1]==0)return'\u5386\u53F2'+args[0]+'\u65B0\u9AD8\u8DDD\u4ECA\u5929\u6570';return args[1]+'\u65E5\u5185'+args[0]+'\u65B0\u9AD8\u8DDD\u4ECA\u5929\u6570';}}],["LLVBARS",{Name:"LLVBARS",Param:{Count:2},ToString:function ToString(args){if(args[1]==0)return'\u5386\u53F2'+args[0]+'\u65B0\u4F4E\u8DDD\u4ECA\u5929\u6570';return args[1]+'\u65E5\u5185'+args[0]+'\u65B0\u4F4E\u8DDD\u4ECA\u5929\u6570';}}]]);this.CallFunctionExplain=function(funcName,args,node){if(this.FUNCTION_INFO_LIST.has(funcName)){var item=this.FUNCTION_INFO_LIST.get(funcName);if(item.Param.Dynamic===true)//动态参数
11409
11411
  {}else{if(item.Param.Count!=args.length)this.ThrowUnexpectedNode(node,'\u51FD\u6570'+funcName+'\u53C2\u6570\u4E2A\u6570\u4E0D\u6B63\u786E. \u9700\u8981'+item.Param.Count+'\u4E2A\u53C2\u6570');}return item.ToString(args);}switch(funcName){case"CALCSTOCKINDEX":return'\u5F15\u7528'+args[0]+'\u7684'+args[1]+'\u6307\u6807\u7B2C'+args[2]+'\u4E2A\u8F93\u51FA\u503C';case"PEAK":case"PEAKBARS":case"ZIG":case"ZIGA":case"TROUGH":case"TROUGHBARS":return this.GetZIGExplain(funcName,args);case"FINANCE":return this.GetFinanceExplain(args);case"DYNAINFO":return this.GetDynainfoExplain(args);case'CLOSE':case'C':case'VOL':case'V':case'OPEN':case'O':case'HIGH':case'H':case'LOW':case'L':case'AMOUNT':case'AMO':return this.GetOtherSymbolExplain({FunctionName:funcName,Args:args},node);//绘图函数
11410
- case"PLOYLINE":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6\u4EE5'+args[1]+'\u4F4D\u7F6E\u4E3A\u9876\u70B9\u753B\u6298\u7EBF\u8FDE\u63A5';case"DRAWLINE":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B\u76F4\u7EBF\u8D77\u70B9\uFF0C\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[2]+'\u65F6,\u5728'+args[3]+'\u4F4D\u7F6E\u753B\u76F4\u7EBF\u7EC8\u70B9,'+args[4]+'\u8868\u793A\u662F\u5426\u5EF6\u957F';case"DRAWSL":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B\u659C\u7EBF\u7EBF\u6027\u56DE\u5F52,'+args[2]+'\u659C\u7387,'+args[3]+'\u957F\u5EA6,'+args[4]+'\u65B9\u5411';case"DRAWKLINE":case"DRAWKLINE1":return'K线';case"DRAWICON":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B'+args[2]+'\u53F7\u56FE\u6807';case"DRAWTEXT":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u4E66\u5199\u6587\u5B57';case"DRAWTEXT_FIX":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728\u6A2A\u8F74'+args[1]+'\u7EB5\u8F74'+args[2]+'\u4F4D\u7F6E\u4E66\u5199\u6587\u5B57';case"DRAWNUMBER":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u4E66\u5199\u6570\u5B57';case"DRAWNUMBER_FIX":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728\u6A2A\u8F74'+args[1]+'\u7EB5\u8F74'+args[2]+'\u4F4D\u7F6E\u4E66\u5199\u6570\u5B57';case"RGB":return'\u81EA\u5B9A\u8272['+args[0]+','+args[1]+','+args[2]+']';case"RGBA":return'\u81EA\u5B9A\u8272['+args[0]+','+args[1]+','+args[2]+','+args[3]+']';case"DRAWBAND":return'画带状线';case"DRAWRECTREL":return"相对位置上画矩形.";case"DRAWGBK":return"填充背景";case"TIPICON":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B'+args[2]+'\u53F7\u56FE\u6807';case"STICKLINE":var barType="";if(args[4]==-1)barType="虚线空心柱";else if(args[4]==0)barType="实心柱";else barType="实线空心柱";return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6, \u5728'+args[1]+'\u548C'+args[2]+'\u4F4D\u7F6E\u4E4B\u95F4\u753B\u67F1\u72B6\u7EBF,\u5BBD\u5EA6\u4E3A'+args[3]+','+barType;case"SELL":return"卖出平仓";case"BUY":return"买入开仓";case"SELLSHORT":return"卖出开仓";case"BUYSHORT":return"买入平仓";case"YMOVE":return;case"BACKGROUND":return"绘制背景";case"UPCOLOR":return'\u4E0A\u6DA8\u989C\u8272'+args[0];case"DOWNCOLOR":return'\u4E0B\u8DCC\u989C\u8272'+args[0];default:this.ThrowUnexpectedNode(node,'\u51FD\u6570'+funcName+'\u4E0D\u5B58\u5728');}};this.GetDynainfoExplain=function(args){var DATA_NAME_MAP=new _map2.default([[3,"前收盘价"],[4,"开盘价"],[5,"最高价"],[6,"最低价"],[7,"现价"],[8,'总量'],[9,"现量"],[10,"总金额"],[11,"均价"],[12,"日涨跌"],[13,"振幅"],[14,"涨幅"],[15,"开盘时的成交金额"],[16,"前5日每分钟均量"],[17,"量比"],[18,"上涨家数"],[19,"下跌家数"]]);var id=args[0];if(DATA_NAME_MAP.has(id))return DATA_NAME_MAP.get(id);return'\u5373\u65F6\u884C\u60C5['+id+']';};this.GetFinanceExplain=function(args){var DATA_NAME_MAP=new _map2.default([[1,"总股本"],[2,"市场类型"],[3,"沪深品种类型"],[4,"沪深行业代码"],[5,"B股"],[6,"H股"],[7,"流通股本[股]"],[8,"股东人数[户]"],[9,"资产负债率%"],[10,"总资产"],[11,"流动资产"],[12,"固定资产"],[13,"无形资产"],[15,"流动负债"],[16,"少数股东权益"]]);var id=args[0];if(DATA_NAME_MAP.has(id))return DATA_NAME_MAP.get(id);return'\u8D22\u52A1\u6570\u636E['+id+']';};this.GetZIGExplain=function(funcName,args){var value=args[0];if(value==0)value="开盘价";else if(value==1)value="最高价";else if(value==2)value="最低价";else if(value==3)value="收盘价";switch(funcName){case"PEAK":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u5CF0\u503C';case"PEAKBARS":return value+'\u7684'+args[1]+'5%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u5CF0\u4F4D\u7F6E';case"ZIG":return value+'\u7684'+args[1]+'\u7684\u4E4B\u5B57\u8F6C\u5411';case"ZIGA":return value+'\u53D8\u5316'+args[1]+'\u7684\u4E4B\u5B57\u8F6C\u5411';case"TROUGH":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u8C37\u503C';case"TROUGHBARS":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u8C37\u4F4D\u7F6E';}};this.GetColorExplain=function(colorName){var COLOR_MAP=new _map2.default([['COLORBLACK','黑色'],['COLORBLUE','蓝色'],['COLORGREEN','绿色'],['COLORCYAN','青色'],['COLORRED','红色'],['COLORMAGENTA','洋红色'],['COLORBROWN','棕色'],['COLORLIGRAY','淡灰色'],['COLORGRAY','深灰色'],['COLORLIBLUE','淡蓝色'],['COLORLIGREEN','淡绿色'],['COLORLICYAN','淡青色'],['COLORLIRED','淡红色'],['COLORLIMAGENTA','淡洋红色'],['COLORWHITE','白色'],['COLORYELLOW','黄色']]);if(COLOR_MAP.has(colorName))return COLOR_MAP.get(colorName);//COLOR 自定义色
11412
+ case"PLOYLINE":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6\u4EE5'+args[1]+'\u4F4D\u7F6E\u4E3A\u9876\u70B9\u753B\u6298\u7EBF\u8FDE\u63A5';case"DRAWLINE":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B\u76F4\u7EBF\u8D77\u70B9\uFF0C\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[2]+'\u65F6,\u5728'+args[3]+'\u4F4D\u7F6E\u753B\u76F4\u7EBF\u7EC8\u70B9,'+args[4]+'\u8868\u793A\u662F\u5426\u5EF6\u957F';case"DRAWSL":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B\u659C\u7EBF\u7EBF\u6027\u56DE\u5F52,'+args[2]+'\u659C\u7387,'+args[3]+'\u957F\u5EA6,'+args[4]+'\u65B9\u5411';case"DRAWKLINE":case"DRAWKLINE1":return'K线';case"DRAWICON":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B'+args[2]+'\u53F7\u56FE\u6807';case"DRAWTEXT":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u4E66\u5199\u6587\u5B57';case"DRAWTEXT_FIX":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728\u6A2A\u8F74'+args[1]+'\u7EB5\u8F74'+args[2]+'\u4F4D\u7F6E\u4E66\u5199\u6587\u5B57';case"DRAWNUMBER":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u4E66\u5199\u6570\u5B57';case"DRAWNUMBER_FIX":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728\u6A2A\u8F74'+args[1]+'\u7EB5\u8F74'+args[2]+'\u4F4D\u7F6E\u4E66\u5199\u6570\u5B57';case"RGB":return'\u81EA\u5B9A\u8272['+args[0]+','+args[1]+','+args[2]+']';case"RGBA":return'\u81EA\u5B9A\u8272['+args[0]+','+args[1]+','+args[2]+','+args[3]+']';case"DRAWBAND":return'画带状线';case"DRAWRECTREL":return"相对位置上画矩形.";case"DRAWGBK":return"填充背景";case"TIPICON":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B'+args[2]+'\u53F7\u56FE\u6807';case"STICKLINE":var barType="";if(args[4]==-1)barType="虚线空心柱";else if(args[4]==0)barType="实心柱";else barType="实线空心柱";return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6, \u5728'+args[1]+'\u548C'+args[2]+'\u4F4D\u7F6E\u4E4B\u95F4\u753B\u67F1\u72B6\u7EBF,\u5BBD\u5EA6\u4E3A'+args[3]+','+barType;case"SELL":return"卖出平仓";case"BUY":return"买入开仓";case"SELLSHORT":return"卖出开仓";case"BUYSHORT":return"买入平仓";case"YMOVE":return;case"BACKGROUND":return"绘制背景";case"UPCOLOR":return'\u4E0A\u6DA8\u989C\u8272'+args[0];case"DOWNCOLOR":return'\u4E0B\u8DCC\u989C\u8272'+args[0];case"FIRSTDRAW":return"";default:this.ThrowUnexpectedNode(node,'\u51FD\u6570'+funcName+'\u4E0D\u5B58\u5728');}};this.GetDynainfoExplain=function(args){var DATA_NAME_MAP=new _map2.default([[3,"前收盘价"],[4,"开盘价"],[5,"最高价"],[6,"最低价"],[7,"现价"],[8,'总量'],[9,"现量"],[10,"总金额"],[11,"均价"],[12,"日涨跌"],[13,"振幅"],[14,"涨幅"],[15,"开盘时的成交金额"],[16,"前5日每分钟均量"],[17,"量比"],[18,"上涨家数"],[19,"下跌家数"]]);var id=args[0];if(DATA_NAME_MAP.has(id))return DATA_NAME_MAP.get(id);return'\u5373\u65F6\u884C\u60C5['+id+']';};this.GetFinanceExplain=function(args){var DATA_NAME_MAP=new _map2.default([[1,"总股本"],[2,"市场类型"],[3,"沪深品种类型"],[4,"沪深行业代码"],[5,"B股"],[6,"H股"],[7,"流通股本[股]"],[8,"股东人数[户]"],[9,"资产负债率%"],[10,"总资产"],[11,"流动资产"],[12,"固定资产"],[13,"无形资产"],[15,"流动负债"],[16,"少数股东权益"]]);var id=args[0];if(DATA_NAME_MAP.has(id))return DATA_NAME_MAP.get(id);return'\u8D22\u52A1\u6570\u636E['+id+']';};this.GetZIGExplain=function(funcName,args){var value=args[0];if(value==0)value="开盘价";else if(value==1)value="最高价";else if(value==2)value="最低价";else if(value==3)value="收盘价";switch(funcName){case"PEAK":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u5CF0\u503C';case"PEAKBARS":return value+'\u7684'+args[1]+'5%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u5CF0\u4F4D\u7F6E';case"ZIG":return value+'\u7684'+args[1]+'\u7684\u4E4B\u5B57\u8F6C\u5411';case"ZIGA":return value+'\u53D8\u5316'+args[1]+'\u7684\u4E4B\u5B57\u8F6C\u5411';case"TROUGH":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u8C37\u503C';case"TROUGHBARS":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u8C37\u4F4D\u7F6E';}};this.GetColorExplain=function(colorName){var COLOR_MAP=new _map2.default([['COLORBLACK','黑色'],['COLORBLUE','蓝色'],['COLORGREEN','绿色'],['COLORCYAN','青色'],['COLORRED','红色'],['COLORMAGENTA','洋红色'],['COLORBROWN','棕色'],['COLORLIGRAY','淡灰色'],['COLORGRAY','深灰色'],['COLORLIBLUE','淡蓝色'],['COLORLIGREEN','淡绿色'],['COLORLICYAN','淡青色'],['COLORLIRED','淡红色'],['COLORLIMAGENTA','淡洋红色'],['COLORWHITE','白色'],['COLORYELLOW','黄色']]);if(COLOR_MAP.has(colorName))return COLOR_MAP.get(colorName);//COLOR 自定义色
11411
11413
  //格式为COLOR+“RRGGBB”:RR、GG、BB表示红色、绿色和蓝色的分量,每种颜色的取值范围是00-FF,采用了16进制。
11412
11414
  //例如:MA5:MA(CLOSE,5),COLOR00FFFF 表示纯红色与纯绿色的混合色:COLOR808000表示淡蓝色和淡绿色的混合色。
11413
11415
  if(colorName.indexOf('COLOR')==0)return'#'+colorName.substr(5);return'rgb(30,144,255)';};this.GetLineWidthExplain=function(lineWidth){var width=parseInt(lineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))return width;return 1;};this.SymbolPeriodExplain=function(valueName,period){var mapStockDataName=new _map2.default([['CLOSE',"收盘价"],["C","收盘价"],['VOL',"成交量"],['V',"成交量"],['OPEN',"开盘价"],['O',"开盘价"],['HIGH',"最高价"],['H',"最高价"],['LOW',"最低价"],['L',"最低价"],['AMOUNT',"成交金额"],['AMO',"成交金额"],['VOLINSTK',"持仓量"]]);//MIN1,MIN5,MIN15,MIN30,MIN60,DAY,WEEK,MONTH,SEASON,YEAR
@@ -11543,7 +11545,7 @@ if(varItem.Draw.FixedPosition==="TOP")chartText.FixedPosition=1;else if(varItem.
11543
11545
  hqChart.ChartPaint.push(chartText);};//COLORSTICK
11544
11546
  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);if(varItem.UpColor)chartMACD.UpColor=varItem.UpColor;if(varItem.DownColor)chartMACD.DownColor=varItem.DownColor;this.ReloadChartResource(hqChart,windowIndex,chartMACD);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;this.ReloadChartResource(hqChart,windowIndex,chart);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);
11545
11547
  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线显示类型
11546
- chart.Identify=this.Guid;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;chart.HistoryData=hisData;this.ReloadChartResource(hqChart,windowIndex,chart);var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.TitlePaint[titleIndex].Data[id]=titleData;this.SetTitleData(titleData,chart);this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFillRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineArea();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.Data=varItem.Draw.DrawData;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);hqChart.ChartPaint.push(chart);};this.CreateFillRGN2=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillRGN();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.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFillBGRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillBGRGN();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.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFLOATRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFLOATRGN();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.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};//创建K线图
11548
+ chart.Identify=this.Guid;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;chart.HistoryData=hisData;this.ReloadChartResource(hqChart,windowIndex,chart);var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.TitlePaint[titleIndex].Data[id]=titleData;this.SetTitleData(titleData,chart);this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;if(IFrameSplitOperator.IsBool(varItem.IsFirstDraw))chart.IsDrawFirst=varItem.IsFirstDraw;hqChart.ChartPaint.push(chart);};this.CreateFillRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineArea();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.Data=varItem.Draw.DrawData;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);hqChart.ChartPaint.push(chart);};this.CreateFillRGN2=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillRGN();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.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFillBGRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillBGRGN();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.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFLOATRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFLOATRGN();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.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};//创建K线图
11547
11549
  this.CreateKLine=function(hqChart,windowIndex,varItem,id){var chart=new ChartKLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.Identify=this.Guid;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;chart.IsShowMaxMinPrice=false;chart.IsShowKTooltip=false;if(varItem.Color)//如果设置了颜色,使用外面设置的颜色
11548
11550
  chart.UnchagneColor=chart.DownColor=chart.UpColor=this.GetColor(varItem.Color);hqChart.ChartPaint.push(chart);};this.CreateOverlayKLine=function(hqChart,windowIndex,varItem,id){var chart=null;if(hqChart.IsKLineContainer())chart=new ChartOverlayKLine();else if(hqChart.IsMinuteContainer())chart=new ChartOverlayMinutePriceLine();else return;chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.Identify=this.Guid;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);//如果设置了颜色,使用外面设置的颜色
11549
11551
  else chart.Color=this.GetDefaultColor(id);chart.Data.Data=varItem.Draw.DrawData;chart.MainData=hqChart.ChartPaint[0].Data;//绑定K线
@@ -11639,7 +11641,7 @@ this.ShowConditionError=function(param,msg){var hqChart=param.HQChart;var window
11639
11641
  if(IFrameSplitOperator.IsNumber(this.YSplitType))this.OverlayIndex.Frame.Frame.YSplitOperator.SplitType=this.YSplitType;//指标名字
11640
11642
  var titleInfo={Data:[],Title:this.Name,Frame:this.OverlayIndex.Frame.Frame,Script:this};var indexParam='';for(var i in this.Arguments){var _item34=this.Arguments[i];if(indexParam.length>0)indexParam+=',';indexParam+=_item34.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);if(this.OutName&&this.OutName.length>0&&this.Arguments&&this.Arguments.length>0){titlePaint.SetDynamicTitle(this.OutName,this.Arguments,this.OverlayIndex.Identify);}this.OverlayIndex.Frame.Frame.Title=this.Name;//给子框架设置标题
11641
11643
  for(var i=0;i<this.OutVar.length;++i){var _item35=this.OutVar[i];if(_item35.IsExData===true)continue;//扩展数据不显示图形
11642
- if(_item35.Type==0){this.CreateLine(hqChart,windowIndex,_item35,i,_item35.Type);}else if(_item35.Type==1){switch(_item35.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item35,i);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item35,i);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item35,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item35,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item35,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item35,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item35,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item35,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item35,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item35,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item35,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item35,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item35,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item35,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item35,i);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item35,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item35,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item35,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item35,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item35,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item35,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item35,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item35,i);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item35,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item35,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item35.Draw.DrawType);//外部挂接
11644
+ if(_item35.Type==0){this.CreateLine(hqChart,windowIndex,_item35,i,_item35.Type);}else if(_item35.Type==1){switch(_item35.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item35,i);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item35,i);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item35,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item35,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item35,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item35,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item35,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item35,i);break;case'DRAWGBK':case"DRAWGBK2":this.CreateBackgroud(hqChart,windowIndex,_item35,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item35,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item35,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item35,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item35,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item35,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item35,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item35,i);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item35,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item35,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item35,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item35,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item35,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item35,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item35,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item35,i);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item35,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item35,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item35.Draw.DrawType);//外部挂接
11643
11645
  if(find&&find.CreateChartCallback)find.CreateChartCallback(hqChart,windowIndex,_item35,i,this);}break;}}else if(_item35.Type==2){this.CreateMACD(hqChart,windowIndex,_item35,i);}else if(_item35.Type==3){this.CreatePointDot(hqChart,windowIndex,_item35,i,hisData);}else if(_item35.Type==4){this.CreateLineStick(hqChart,windowIndex,_item35,i);}else if(_item35.Type==5){this.CreateStick(hqChart,windowIndex,_item35,i);}else if(_item35.Type==6){this.CreateVolStick(hqChart,windowIndex,_item35,i,hisData);}else if(_item35.Type==7){this.CreateLine(hqChart,windowIndex,_item35,i,_item35.Type);}else if(_item35.Type==8){this.CreateLine(hqChart,windowIndex,_item35,i,_item35.Type);}var titleData=titleInfo.Data[i];if(titleData){if(this.FloatPrecision>=0)titleData.FloatPrecision=this.FloatPrecision;if(IFrameSplitOperator.IsNumber(this.StringFormat))titleData.StringFormat=this.StringFormat;}}/*
11644
11646
  hqChart.TitlePaint[titleIndex].Title=this.Name;
11645
11647
 
@@ -11673,7 +11675,7 @@ if(varItem.Draw.DrawData)chart.Data.Data=varItem.Draw.DrawData;chart.Text=varIte
11673
11675
  frame.ChartPaint.push(chart);};//COLORSTICK
11674
11676
  this.CreateMACD=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMACD();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];var clrTitle=this.GetDefaultColor(id);if(varItem.Color)clrTitle=this.GetColor(varItem.Color);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;this.ReloadChartResource(hqChart,windowIndex,chart);titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,clrTitle);frame.ChartPaint.push(chart);};this.CreatePointDot=function(hqChart,windowIndex,varItem,id,hisData){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartPointDot();chart.Canvas=hqChart.Canvas;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.Radius)chart.Radius=varItem.Radius;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)chart.Radius=width;}if(IFrameSplitOperator.IsBool(varItem.UpDownDot)){chart.EnableUpDownColor=varItem.UpDownDot;chart.HistoryData=hisData;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateStick=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartStick();chart.Canvas=hqChart.Canvas;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;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,chart);var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateLineStick=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLineStick();chart.Canvas=hqChart.Canvas;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;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);frame.ChartPaint.push(chart);};this.CreateStraightLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLine();chart.DrawType=1;chart.Canvas=hqChart.Canvas;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;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData;//hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);
11675
11677
  frame.ChartPaint.push(chart);};this.CreateVolStick=function(hqChart,windowIndex,varItem,id,hisData){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartVolStick();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.KLineDrawType=hqChart.KLineDrawType;//设置K线显示类型
11676
- if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;chart.HistoryData=hisData;this.ReloadChartResource(hqChart,windowIndex,chart);var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetTitleData(titleData,chart);this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;frame.ChartPaint.push(chart);};//创建K线图
11678
+ if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);if(varItem.UpColor)chart.UpColor=varItem.UpColor;if(varItem.DownColor)chart.DownColor=varItem.DownColor;var titleIndex=windowIndex+1;chart.Data.Data=varItem.Data;chart.HistoryData=hisData;this.ReloadChartResource(hqChart,windowIndex,chart);var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);this.SetTitleData(titleData,chart);this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;if(IFrameSplitOperator.IsBool(varItem.IsFirstDraw))chart.IsDrawFirst=varItem.IsFirstDraw;frame.ChartPaint.push(chart);};//创建K线图
11677
11679
  this.CreateKLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartKLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data.Data=varItem.Draw.DrawData;chart.IsShowMaxMinPrice=false;chart.IsShowKTooltip=false;if(varItem.Color)//如果设置了颜色,使用外面设置的颜色
11678
11680
  chart.UnchagneColor=chart.DownColor=chart.UpColor=this.GetColor(varItem.Color);frame.ChartPaint.push(chart);};this.CreatePolyLine=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartLine();chart.Canvas=hqChart.Canvas;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;}var titleIndex=windowIndex+1;chart.Data.Data=varItem.Draw.DrawData;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=new DynamicTitleData(line.Data,' ',line.Color);//给一个空的标题
11679
11681
  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;//赋值坐标
@@ -12890,7 +12892,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
12890
12892
  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);};}/********************************************************************************
12891
12893
  * 版本信息输出
12892
12894
  *
12893
- */var HQCHART_VERSION="1.1.12692";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
12895
+ */var HQCHART_VERSION="1.1.12712";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
12894
12896
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
12895
12897
  // BaseIndex:BaseIndex,
12896
12898
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.12708",
3
+ "version": "1.1.12714",
4
4
  "description": "stock chart",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -12,7 +12,13 @@
12
12
  },
13
13
  "keywords": [
14
14
  "kline",
15
- "chart"
15
+ "chart",
16
+ "candle",
17
+ "candlestick",
18
+ "canvas",
19
+ "stock",
20
+ "candlestick-chart",
21
+ "通达信指标"
16
22
  ],
17
23
  "author": "jones2000",
18
24
  "license": "Apache License 2.0",