hqchart 1.1.12943 → 1.1.12955

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.
@@ -68,7 +68,7 @@ this.Get=function(id){if(!this.DataMap.has(id))return null;return this.DataMap.g
68
68
  ]);}JSIndexScript.AddIndex=function(aryIndex)//添加自定义指标
69
69
  {for(var i in aryIndex){g_CustomIndex.Add(aryIndex[i]);}};//修改指标属性
70
70
  JSIndexScript.ModifyAttribute=function(indexInfo,attribute){if(!attribute)return;if(attribute.Args)indexInfo.Args=attribute.Args;//外部可以设置参数
71
- if(IFrameSplitOperator.IsNumber(attribute.FloatPrecision))indexInfo.FloatPrecision=attribute.FloatPrecision;if(IFrameSplitOperator.IsNumber(attribute.StringFormat))indexInfo.StringFormat=attribute.StringFormat;if(IFrameSplitOperator.IsBool(attribute.IsSync))indexInfo.IsSync=attribute.IsSync;if(IFrameSplitOperator.IsBool(attribute.IsShortTitle))indexInfo.IsShortTitle=attribute.IsShortTitle;if(attribute.TitleFont)indexInfo.TitleFont=attribute.TitleFont;if(attribute.Lock)indexInfo.Lock=attribute.Lock;if(IFrameSplitOperator.IsNumber(attribute.YSplitType))indexInfo.YSplitType=attribute.YSplitType;if(attribute.YAxis){var item=attribute.YAxis;if(!indexInfo.YAxis)indexInfo.YAxis={};if(IFrameSplitOperator.IsNumber(item.FloatPrecision))indexInfo.YAxis.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsNumber(item.StringFormat))indexInfo.YAxis.StringFormat=item.StringFormat;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;}};JSIndexScript.prototype.Get=function(id){var data=g_CustomIndex.Get(id);if(data)return data;var func=this.DataMap.get(id);if(func){var data=func();data.ID=id;return data;}return null;};JSIndexScript.prototype.Search=function(name){var result=[];var reg=new RegExp(name,'i');this.DataMap.forEach(function(value,key){if(key.indexOf('交易系统-')!=0&&key.indexOf('五彩K线-')!=0&&key.search(reg)>=0)result.push(key);});return result;};JSIndexScript.prototype.MA=function(){var data={Name:'MA',Description:'均线',IsMainIndex:true,StringFormat:2,Args:[{Name:'M1',Value:5},{Name:'M2',Value:10},{Name:'M3',Value:20}],OutName:[{Name:'MA1',DynamicName:"MA{M1}"},{Name:'MA2',DynamicName:"MA{M2}"},{Name:'MA3',DynamicName:"MA{M3}"}],Script://脚本
71
+ if(IFrameSplitOperator.IsNumber(attribute.FloatPrecision))indexInfo.FloatPrecision=attribute.FloatPrecision;if(IFrameSplitOperator.IsNumber(attribute.StringFormat))indexInfo.StringFormat=attribute.StringFormat;if(IFrameSplitOperator.IsBool(attribute.IsSync))indexInfo.IsSync=attribute.IsSync;if(IFrameSplitOperator.IsBool(attribute.IsShortTitle))indexInfo.IsShortTitle=attribute.IsShortTitle;if(attribute.TitleFont)indexInfo.TitleFont=attribute.TitleFont;if(attribute.Lock)indexInfo.Lock=attribute.Lock;if(IFrameSplitOperator.IsNumber(attribute.YSplitType))indexInfo.YSplitType=attribute.YSplitType;if(IFrameSplitOperator.IsBool(attribute.IsShowIndexTitle))indexInfo.IsShowIndexTitle=attribute.IsShowIndexTitle;if(attribute.YAxis){var item=attribute.YAxis;if(!indexInfo.YAxis)indexInfo.YAxis={};if(IFrameSplitOperator.IsNumber(item.FloatPrecision))indexInfo.YAxis.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsNumber(item.StringFormat))indexInfo.YAxis.StringFormat=item.StringFormat;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))indexInfo.YAxis.EnableRemoveZero=item.EnableRemoveZero;}};JSIndexScript.prototype.Get=function(id){var data=g_CustomIndex.Get(id);if(data)return data;var func=this.DataMap.get(id);if(func){var data=func();data.ID=id;return data;}return null;};JSIndexScript.prototype.Search=function(name){var result=[];var reg=new RegExp(name,'i');this.DataMap.forEach(function(value,key){if(key.indexOf('交易系统-')!=0&&key.indexOf('五彩K线-')!=0&&key.search(reg)>=0)result.push(key);});return result;};JSIndexScript.prototype.MA=function(){var data={Name:'MA',Description:'均线',IsMainIndex:true,StringFormat:2,Args:[{Name:'M1',Value:5},{Name:'M2',Value:10},{Name:'M3',Value:20}],OutName:[{Name:'MA1',DynamicName:"MA{M1}"},{Name:'MA2',DynamicName:"MA{M2}"},{Name:'MA3',DynamicName:"MA{M3}"}],Script://脚本
72
72
  'MA1:MA(CLOSE,M1);\n\
73
73
  MA2:MA(CLOSE,M2);\n\
74
74
  MA3:MA(CLOSE,M3);'};return data;};JSIndexScript.prototype.MA4=function(){var data={Name:'MA',Description:'均线',IsMainIndex:true,StringFormat:2,Args:[{Name:'M1',Value:5},{Name:'M2',Value:10},{Name:'M3',Value:20},{Name:'M4',Value:60}],OutName:[{Name:'MA1',DynamicName:"MA{M1}"},{Name:'MA2',DynamicName:"MA{M2}"},{Name:'MA3',DynamicName:"MA{M3}"},{Name:'MA4',DynamicName:"MA{M4}"}],Script://脚本
@@ -5775,6 +5775,7 @@ this.Buttons=[];//按钮
5775
5775
  //动态标题
5776
5776
  //动态标题
5777
5777
  this.DynamicTitle={OutName:null,OutValue:null};this.OverlayDynamicTitle=new _map2.default();//key , value={ OutName, OutValue }
5778
+ this.IsShowMainIndexTitle=true;//是否显示主图指标标题
5778
5779
  this.ReloadResource=function(){this.Font=g_JSChartResource.TitleFont;this.TitleColor=g_JSChartResource.DefaultTextColor;this.OverlayIndexType.BGColor=g_JSChartResource.OverlayIndexTitleBGColor;};this.SetDynamicTitleData=function(outName,args,data){if(!data.OutName)data.OutName=new _map2.default();else data.OutName.clear();if(!data.OutValue)data.OutValue=new _map2.default();else data.OutValue.clear();var mapArgs=new _map2.default();for(var i in args){var item=args[i];mapArgs.set('{'+item.Name+'}',item);}for(var i in outName){var item=outName[i];if(item.DynamicName){var aryFond=item.DynamicName.match(/{\w*}/i);if(!aryFond||aryFond.length<=0){data.OutName.set(item.Name,item.DynamicName);}else{var dyName=item.DynamicName;var bFind=true;for(var j=0;j<aryFond.length;++j){var findItem=aryFond[j];if(mapArgs.has(findItem)){var value=mapArgs.get(findItem).Value;dyName=dyName.replace(findItem,value.toString());}else{bFind=false;break;}}if(bFind)data.OutName.set(item.Name,dyName);}}if(item.DynamicValue){data.OutValue.set(item.Name,item.DynamicValue);}}};this.SetDynamicTitle=function(outName,args,overlayID){if(IFrameSplitOperator.IsString(overlayID)){var dynamicTitle=null;if(this.OverlayDynamicTitle.has(overlayID)){dynamicTitle=this.OverlayDynamicTitle.get(overlayID);}else{dynamicTitle={OutName:null,OutValue:null};this.OverlayDynamicTitle.set(overlayID,dynamicTitle);}this.SetDynamicTitleData(outName,args,dynamicTitle);}else{this.SetDynamicTitleData(outName,args,this.DynamicTitle);}};this.GetDynamicOutName=function(key,overlayID){if(IFrameSplitOperator.IsString(overlayID)){if(!this.OverlayDynamicTitle.has(overlayID))return null;var dynamicTitle=this.OverlayDynamicTitle.get(overlayID);var outName=dynamicTitle.OutName;}else{var outName=this.DynamicTitle.OutName;}if(!outName||outName.size<=0)return null;if(!outName.has(key))return null;return outName.get(key);};this.GetDynamicOutValue=function(key,value){var outValue=this.DynamicTitle.OutValue;if(!outValue||outValue.size<=0)return null;if(!outValue.has(key))return null;var strFormat=outValue.get(key);strFormat=strFormat.replace('{Value}',value);return strFormat;};this.IsClickTitle=function(x,y)//是否点击了指标标题
5779
5780
  {if(!this.TitleRect)return false;if(x>this.TitleRect.Left&&x<this.TitleRect.Left+this.TitleRect.Width&&y>this.TitleRect.Top&&y<this.TitleRect.Top+this.TitleRect.Height){return true;}return false;};this.FormatValue=function(value,item){if(item.StringFormat==STRING_FORMAT_TYPE.DEFAULT)return IFrameSplitOperator.FormatValueString(value,item.FloatPrecision,this.LanguageID);else if(item.StringFormat==STRING_FORMAT_TYPE.THOUSANDS)return IFrameSplitOperator.FormatValueThousandsString(value,item.FloatPrecision);else if(item.StringFormat==STRING_FORMAT_TYPE.ORIGINAL)return value.toFixed(item.FloatPrecision).toString();else if(item.StringFormat==STRING_FORMAT_TYPE.INTEGER)return IFrameSplitOperator.FromatIntegerString(value,item.FloatPrecision,this.LanguageID);};this.FormatMultiReport=function(data,format){var text="";for(var i in data){var item=data[i];var quarter=item.Quarter;var year=item.Year;var value=item.Value;if(text.length>0)text+=',';text+=year.toString();switch(quarter){case 1:text+='一季报 ';break;case 2:text+='半年报 ';break;case 3:text+='三季报 ';break;case 4:text+='年报 ';break;}text+=this.FormatValue(value,format);}return text;};this.FromatMultiDataLine=function(value,dataInfo){var text="";if(Array.isArray(value)){for(var i=0;i<value.length;++i){var item=value[i];if(item.Type==0)continue;if(!IFrameSplitOperator.IsNumber(item.Value))continue;var strValue=this.FormatValue(item.Value,dataInfo);if(text.length>0)text+=',';text+=strValue;}}else{if(value.Type!=0&&IFrameSplitOperator.IsNumber(value.Value)){text=this.FormatValue(value.Value,dataInfo);}}if(text.length<=0)return null;return text;};//多变量输出
5780
5781
  this.FromatStackedBarTitle=function(aryBar,dataInfo){if(!IFrameSplitOperator.IsNonEmptyArray(aryBar))return null;if(!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Color))return null;var aryText=[];for(var i=0;i<aryBar.length;++i){var value=aryBar[i];if(!IFrameSplitOperator.IsNumber(value))continue;var item={Text:value.toFixed(2)};if(dataInfo.Name&&dataInfo.Name[i])item.Name=dataInfo.Name[i];item.Color=dataInfo.Color[i];aryText.push(item);}if(aryText.length<=0)return null;return aryText;};this.ForamtMultiLineTitle=function(dataIndex,dataInfo){if(!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Lines))return null;var aryText=[];for(var i=0;i<dataInfo.Lines.length;++i){var line=dataInfo.Lines[i];for(var j=0;j<line.Point.length;++j){var item=line.Point[j];if(item.Index==dataIndex){var item={Text:item.Value.toFixed(2)};if(aryText.length==0)item.Name=dataInfo.Name;item.Color=line.Color;aryText.push(item);break;}}}if(!IFrameSplitOperator.IsNonEmptyArray(aryText))return null;return aryText;};this.ForamtMultiPointTitle=function(dataIndex,dataInfo){if(!IFrameSplitOperator.IsNonEmptyArray(dataInfo.PointGroup))return null;var aryText=[];for(var i=0;i<dataInfo.PointGroup.length;++i){var groupItem=dataInfo.PointGroup[i];for(var j=0;j<groupItem.Point.length;++j){var item=groupItem.Point[j];if(item.Index==dataIndex){var item={Text:item.Value.toFixed(2)};if(aryText.length==0)item.Name=dataInfo.Name;item.Color=groupItem.BGColor;aryText.push(item);break;}}}if(!IFrameSplitOperator.IsNonEmptyArray(aryText))return null;return aryText;};this.FormatVPVRTitle=function(pt,dataInfo){var chart=dataInfo.Chart;var aryText=[];if(chart.VolType==0){var item={Text:" Up/Down ",Color:this.TitleColor};aryText.push(item);}else{var item={Text:" Total ",Color:this.TitleColor};aryText.push(item);}if(!IFrameSplitOperator.IsNumber(pt.Y))return aryText;var top=this.Frame.ChartBorder.GetTopEx();var bottom=this.Frame.ChartBorder.GetBottomEx();if(pt.Y<top||pt.Y>bottom)return aryText;var yPrice=this.Frame.GetYData(pt.Y);var find=null;for(var i=0;i<dataInfo.Data.Data.length;++i){var item=dataInfo.Data.Data[i];if(yPrice>=item.Price-dataInfo.Data.PriceOffset/2&&yPrice<item.Price+dataInfo.Data.PriceOffset/2){find=item;break;}}if(!find)return null;if(chart.VolType==0){var total=0;for(var i=0;i<find.Vol.length;++i){var volItem=find.Vol[i];if(!IFrameSplitOperator.IsNumber(volItem.Value))continue;var item={Text:IFrameSplitOperator.FormatVolString(volItem.Value,this.LanguageID)};total+=volItem.Value;if(IFrameSplitOperator.IsNumber(volItem.ColorID))item.Color=chart.BarColor[volItem.ColorID];else if(volItem.Color)item.Color=volItem.Color;aryText.push(item);}var item={Text:IFrameSplitOperator.FormatVolString(total,this.LanguageID),Color:this.TitleColor};aryText.push(item);}else{if(find.TotalVol&&IFrameSplitOperator.IsNumber(find.TotalVol.Value)){var item={Text:IFrameSplitOperator.FormatVolString(find.TotalVol.Value,this.LanguageID)};if(IFrameSplitOperator.IsNumber(find.TotalVol.ColorID))item.Color=chart.BarColor[find.TotalVol.ColorID];else if(find.TotalVol.Color)item.Color=find.TotalVol.Color;aryText.push(item);}}return aryText;};this.IsShowLastData=function(){var isShowLastData=false;if(this.DrawStatus&&this.DrawStatus.IsTitleShowLatestData){var status=this.DrawStatus;if(!IFrameSplitOperator.IsNumber(status.FrameID)||status.FrameID<0)isShowLastData=true;else if(status.CorssCursorTouchEnd&&status.IsOnTouch==false)isShowLastData=true;}else if(this.GlobalOption&&this.GlobalOption.IsDisplayLatest){isShowLastData=true;}return isShowLastData;};this.OnDrawTitleEvent=function(){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_INDEXTITLE_DRAW);if(!event)return;var data={Index:null,Data:this.Data,Title:this.Title,Script:this.Script,FrameID:this.Frame.Identify,OverlayIndex:this.OverlayIndex,IsShowTitleOnly:false};if(this.ArgumentsText)data.ArgumentsText=this.ArgumentsText;if(this.Frame&&this.Frame.ChartBorder)data.IsShowTitleOnly=this.Frame.ChartBorder.IsShowTitleOnly;if(IFrameSplitOperator.IsNumber(this.CursorIndex)){var index=Math.abs(this.CursorIndex);index=parseInt(index.toFixed(0));data.Index=index;//当前屏数据索引
@@ -5785,15 +5786,15 @@ this.FromatStackedBarTitle=function(aryBar,dataInfo){if(!IFrameSplitOperator.IsN
5785
5786
  this.Canvas.strokeRect(ToFixedPoint(this.TitleRect.Left),ToFixedPoint(this.TitleRect.Top),ToFixedRect(this.TitleRect.Width),ToFixedRect(this.TitleRect.Height));
5786
5787
  }
5787
5788
  */return;}var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var bottom=this.Frame.ChartBorder.GetTop()+this.Frame.ChartBorder.TitleHeight/2;//上下居中显示
5788
- var right=this.Frame.ChartBorder.GetRight();var toolbarInfo={Width:0,YCenter:bottom};this.DrawToolbar(toolbarInfo,moveonPoint,mouseStatus);left+=toolbarInfo.Width;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.font=this.Font;var pixelRatio=GetDevicePixelRatio();if(this.Title&&this.IsShowIndexName){if(this.IsDrawTitleBG){var rtButton={Left:left,YCenter:bottom,Width:0};this.DrawNameButton(rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON,Rect:rtButton,FrameID:this.Frame.Identify,Type:2});//Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
5789
- if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);this.TitleRect=rtButton;left+=rtButton.Width+3*pixelRatio;left+=this.TitleSpace;}else{var textWidth=this.Canvas.measureText(this.Title).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.Title,left,bottom,textWidth);if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}}if(this.ArgumentsText&&this.IsShowIndexName){var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.ArgumentsText,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}var isShowLastData=this.IsShowLastData();var lockRect=this.Frame.GetLockRect();if(lockRect)//指标上锁区域不显示动态标题
5790
- {var index=Math.abs(this.CursorIndex);if(this.IsKLineFrame)index=this.CursorIndex;var x=this.Frame.GetXFromIndex(index.toFixed(0));if(x>=lockRect.Left)return;if(isShowLastData)return;}for(var i=0;i<this.Data.length;++i){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText)//多变量输出
5789
+ var right=this.Frame.ChartBorder.GetRight();var toolbarInfo={Width:0,YCenter:bottom};this.DrawToolbar(toolbarInfo,moveonPoint,mouseStatus);left+=toolbarInfo.Width;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.font=this.Font;var pixelRatio=GetDevicePixelRatio();if(this.Title&&this.IsShowIndexName&&this.IsShowMainIndexTitle){if(this.IsDrawTitleBG){var rtButton={Left:left,YCenter:bottom,Width:0};this.DrawNameButton(rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON,Rect:rtButton,FrameID:this.Frame.Identify,Type:2});//Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
5790
+ if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);this.TitleRect=rtButton;left+=rtButton.Width+3*pixelRatio;left+=this.TitleSpace;}else{var textWidth=this.Canvas.measureText(this.Title).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.Title,left,bottom,textWidth);if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}}if(this.ArgumentsText&&this.IsShowIndexName&&this.IsShowMainIndexTitle){var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.ArgumentsText,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}var isShowLastData=this.IsShowLastData();var lockRect=this.Frame.GetLockRect();if(lockRect)//指标上锁区域不显示动态标题
5791
+ {var index=Math.abs(this.CursorIndex);if(this.IsKLineFrame)index=this.CursorIndex;var x=this.Frame.GetXFromIndex(index.toFixed(0));if(x>=lockRect.Left)return;if(isShowLastData)return;}for(var i=0;i<this.Data.length&&this.IsShowMainIndexTitle;++i){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText)//多变量输出
5791
5792
  {var text;for(var k=0;k<aryText.length;++k){var titleItem=aryText[k];if(titleItem.Name)text=titleItem.Name+":"+titleItem.Text;else text=titleItem.Text;var space=this.ParamSpace*GetDevicePixelRatio();var textWidth=this.Canvas.measureText(text).width+space;if(left+textWidth>right)break;if(titleItem.BG)//背景
5792
5793
  {var textHeight=this.Canvas.measureText("擎").width+2;var textWidth=this.Canvas.measureText(text).width+2;var rtBG={Left:left,Top:bottom-textHeight/2,Width:textWidth,Height:textHeight};this.Canvas.fillStyle=titleItem.BG;this.Canvas.fillRect(rtBG.Left,rtBG.Top-1,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=titleItem.Color;this.Canvas.fillText(text,rtBG.Left+1,bottom,textWidth);left+=textWidth+space;}else{this.Canvas.fillStyle=titleItem.Color;this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}}else{this.Canvas.fillStyle=item.Color;var text=valueText;if(item.Name){var dyTitle=this.GetDynamicOutName(item.Name);if(dyTitle)text=dyTitle+":"+valueText;else text=item.Name+":"+valueText;}var space=this.ParamSpace*GetDevicePixelRatio();var textWidth=this.Canvas.measureText(text).width+space;if(left+textWidth>right)break;this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}if(this.Explain)//说明信息
5793
5794
  {this.Canvas.fillStyle=this.TitleColor;var text="说明:"+this.Explain;var textWidth=this.Canvas.measureText(text).width+2;if(left+textWidth<right){this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}if(this.ColorIndex&&this.IsShowColorIndexTitle){this.Canvas.fillStyle=g_JSChartResource.Title.ColorIndexColor;var tradeName=this.ColorIndex.Name+this.ColorIndex.Param;var textWidth=this.Canvas.measureText(tradeName).width+2;//后空2个像素
5794
5795
  this.Canvas.fillText(tradeName,left,bottom,textWidth);left+=textWidth;}if(this.TradeIndex&&this.IsShowTradeIndexTitle){this.Canvas.fillStyle=g_JSChartResource.Title.TradeIndexColor;var tradeName=this.TradeIndex.Name+this.TradeIndex.Param;var textWidth=this.Canvas.measureText(tradeName).width+2;//后空2个像素
5795
- this.Canvas.fillText(tradeName,left,bottom,textWidth);left+=textWidth;}if(this.OverlayIndexType.Position==1){if(!this.Frame.ChartBorder.IsShowTitleOnly)this.DrawOverlayIndexSingleLine(moveonPoint,mouseStatus);}else{this.DrawOverlayIndex(left+10*GetDevicePixelRatio());//间距多空点 和主指标区分开
5796
- }};this.GetTitleItem=function(item,isShowLastData,titleIndex){if(!item||!item.Data||!item.Data.Data)return null;;if(Array.isArray(item.Data.Data)&&item.Data.Data.length<=0)return null;if(item.IsShow===false)return null;if(item.IsVisible===false)return null;var valueText=null;//单值
5796
+ this.Canvas.fillText(tradeName,left,bottom,textWidth);left+=textWidth;}if(this.OverlayIndexType.Position==1){if(!this.Frame.ChartBorder.IsShowTitleOnly)this.DrawOverlayIndexSingleLine(moveonPoint,mouseStatus);}else{var xOffset=10*GetDevicePixelRatio();//主指标区分开 间距多空点
5797
+ if(!this.IsShowMainIndexTitle)xOffset=0;this.DrawOverlayIndex(left+xOffset);}};this.GetTitleItem=function(item,isShowLastData,titleIndex){if(!item||!item.Data||!item.Data.Data)return null;;if(Array.isArray(item.Data.Data)&&item.Data.Data.length<=0)return null;if(item.IsShow===false)return null;if(item.IsVisible===false)return null;var valueText=null;//单值
5797
5798
  var aryText=null;//多值
5798
5799
  var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线只有1个数据
5799
5800
  {value=item.Data.Data[0];valueText=this.FormatValue(value,item);}else if(item.ChartClassName=="ChartVolProfileVisibleRange"){aryText=this.FormatVPVRTitle(this.LastPoint,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else{if(isShowLastData){var dataIndex=item.Data.Data.length-1;//显示最后一个数据
@@ -5802,7 +5803,7 @@ var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线
5802
5803
  {preVaildItem=this.GetPreVaildItem(item.Data.Data,dataIndex);if(!preVaildItem)return null;preText=this.FormatValue(preVaildItem.Item,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,preText);if(dyValue)preText=dyValue;}valueText='--('+preText+')';return{Text:valueText,ArrayText:aryText};}if(value==null)return null;if(item.DataType=="HistoryData-Vol"){value=value.Vol;valueText=this.FormatValue(value,item);}else if(item.DataType=="MultiReport"){valueText=this.FormatMultiReport(value,item);}else if(item.DataType=="MULTI_POINT_LINE"){valueText=this.FromatMultiDataLine(value,item);if(!valueText)return null;}else if(item.DataType=="ChartStackedBar"){aryText=this.FromatStackedBarTitle(value,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(g_ScriptIndexChartFactory.Has(item.DataType))//外部挂接
5803
5804
  {var find=g_ScriptIndexChartFactory.Get(item.DataType);if(find&&find.FormatTitleCallback)return find.FormatTitleCallback(value,item,dataIndex);}else{if(this.GetEventCallback){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_INDEX_OUT_TEXT);if(event){var data={Item:item,Index:titleIndex,Data:this.Data,FrameID:this.Frame.Identify,DataIndex:dataIndex,Value:value,Out:null};event.Callback(event,data,this);if(data.Out)return data.Out;}}var arrow=null;if(this.IsShowUpDownArrow){var preValue=null;if(dataIndex-1>=0)preValue=item.Data.Data[dataIndex-1];if(IFrameSplitOperator.IsNumber(preValue)){if(preValue>value)arrow='↓';else if(preValue<value)arrow='↑';else arrow='→';}}valueText=this.FormatValue(value,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,valueText);if(dyValue)valueText=dyValue;}if(arrow)valueText+=arrow;}}return{Text:valueText,ArrayText:aryText};};//获取上一个有效数据
5804
5805
  this.GetPreVaildItem=function(data,start){for(var i=start;i>=0;--i){var item=data[i];if(item)return{Item:item,Index:i};}return null;};this.DrawSelectedLine=function(left,bottom,textWidth){this.Canvas.save();var fontHeight=this.GetFontHeight();this.Canvas.strokeStyle=this.SelectedColor;var lineWidth=4;var lineBottom=ToFixedPoint2(lineWidth,bottom+fontHeight/2);this.Canvas.lineWidth=lineWidth;this.Canvas.beginPath();this.Canvas.moveTo(left,lineBottom);this.Canvas.lineTo(left+textWidth,lineBottom);this.Canvas.stroke();this.Canvas.restore();};this.DrawOverlayIndexSingleLine=function(moveonPoint,mouseStatus)//叠加指标1个指标一行
5805
- {var pixelRatio=GetDevicePixelRatio();var border=this.Frame.GetBorder();if(this.Frame.IsHScreen===true){var left=1;var top=2*pixelRatio;var right=this.Frame.ChartBorder.GetHeight();var bottom=this.Frame.ChartBorder.GetWidthEx();}else{var top=border.TopTitle+2*pixelRatio;var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var right=border.Right;var bottom=border.Bottom;}var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;var x=left,y=top;var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");y=top+fontHeight/2;var _iteratorNormalCompletion10=true;var _didIteratorError10=false;var _iteratorError10=undefined;try{for(var _iterator10=(0,_getIterator3.default)(this.OverlayIndex),_step10;!(_iteratorNormalCompletion10=(_step10=_iterator10.next()).done);_iteratorNormalCompletion10=true){item=_step10.value;var overlayItem=item[1];var overlayID=item[0];var toolbarInfo={Width:0,YCenter:y,ID:overlayID};this.DrawOverlayToolbar(overlayItem,toolbarInfo,moveonPoint,mouseStatus);if(!overlayItem.Frame.IsShowIndexTitle)continue;x=left+toolbarInfo.Width;this.Canvas.font=this.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";if(overlayItem.Title&&this.IsShowOverlayIndexName){var textWidth=this.Canvas.measureText(overlayItem.Title).width+2;if(x+textWidth<right){if(this.OverlayIndexType.BGColor){this.Canvas.fillStyle=this.OverlayIndexType.BGColor;var rtBG={Left:x,Top:y-fontHeight/2,Width:textWidth,Height:fontHeight+lineSpace};//保存下标题的坐标
5806
+ {var pixelRatio=GetDevicePixelRatio();var border=this.Frame.GetBorder();if(this.Frame.IsHScreen===true){var left=1;var top=2*pixelRatio;var right=this.Frame.ChartBorder.GetHeight();var bottom=this.Frame.ChartBorder.GetWidthEx();}else{var top=border.TopTitle+2*pixelRatio;if(!this.IsShowMainIndexTitle)top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var right=border.Right;var bottom=border.Bottom;}var lineSpace=this.OverlayIndexType.LineSpace*pixelRatio;var x=left,y=top;var fontHeight=GetFontHeight(this.Canvas,this.Font,"擎");y=top+fontHeight/2;var _iteratorNormalCompletion10=true;var _didIteratorError10=false;var _iteratorError10=undefined;try{for(var _iterator10=(0,_getIterator3.default)(this.OverlayIndex),_step10;!(_iteratorNormalCompletion10=(_step10=_iterator10.next()).done);_iteratorNormalCompletion10=true){item=_step10.value;var overlayItem=item[1];var overlayID=item[0];var toolbarInfo={Width:0,YCenter:y,ID:overlayID};this.DrawOverlayToolbar(overlayItem,toolbarInfo,moveonPoint,mouseStatus);if(!overlayItem.IsShowIndexTitle)continue;if(!overlayItem.Frame.IsShowIndexTitle)continue;x=left+toolbarInfo.Width;this.Canvas.font=this.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";if(overlayItem.Title&&this.IsShowOverlayIndexName){var textWidth=this.Canvas.measureText(overlayItem.Title).width+2;if(x+textWidth<right){if(this.OverlayIndexType.BGColor){this.Canvas.fillStyle=this.OverlayIndexType.BGColor;var rtBG={Left:x,Top:y-fontHeight/2,Width:textWidth,Height:fontHeight+lineSpace};//保存下标题的坐标
5806
5807
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(this.IsSelectedChart(overlayID))this.DrawSelectedLine(x,y,textWidth,overlayItem.Title);this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(overlayItem.Title,x,y,textWidth);}x+=textWidth;}for(var i=0;i<overlayItem.Data.length;++i){var item=overlayItem.Data[i];if(!item||!item.Data||!item.Data.Data||!item.Name)continue;if(item.IsVisible===false)continue;if(item.Data.Data.length<=0)continue;var value=null;var valueText=null;var aryText=null;if(item.DataType=="StraightLine")//直线只有1个数据
5807
5808
  {value=item.Data.Data[0];valueText=this.FormatValue(value,item);}else{var index=Math.abs(this.CursorIndex-0.5);index=parseInt(index.toFixed(0));if(this.IsKLineFrame)index=this.CursorIndex;var dataIndex=item.Data.DataOffset+index;if(dataIndex>=item.Data.Data.length)dataIndex=item.Data.Data.length-1;if(dataIndex<0)continue;value=item.Data.Data[dataIndex];if(value==null)continue;if(item.DataType=="HistoryData-Vol"){value=value.Vol;valueText=this.FormatValue(value,item);}else if(item.DataType=="MultiReport"){valueText=this.FormatMultiReport(value,item);}else if(item.DataType=="ChartStackedBar"){aryText=this.FromatStackedBarTitle(value,item);if(!aryText)continue;}else{valueText=this.FormatValue(value,item);}}if(aryText){var text;for(var k=0;k<aryText.length;++k){var titleItem=aryText[k];if(titleItem.Name)text=titleItem.Name+":"+titleItem.Text;else text=titleItem.Text;var textWidth=this.Canvas.measureText(text).width+2;//后空2个像素
5808
5809
  if(x+textWidth>right)break;if(this.OverlayIndexType.BGColor){this.Canvas.fillStyle=this.OverlayIndexType.BGColor;var rtBG={Left:x,Top:y-fontHeight/2,Width:textWidth,Height:fontHeight+lineSpace};//保存下标题的坐标
@@ -5810,9 +5811,9 @@ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fil
5810
5811
  if(x+textWidth>right)break;if(this.OverlayIndexType.BGColor){this.Canvas.fillStyle=this.OverlayIndexType.BGColor;var rtBG={Left:x,Top:y-fontHeight/2,Width:textWidth,Height:fontHeight+lineSpace};//保存下标题的坐标
5811
5812
  this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.fillStyle=item.Color;this.Canvas.fillText(text,x,y,textWidth);x+=textWidth;}}y+=fontHeight+lineSpace;if(y+fontHeight+lineSpace>=bottom)break;}}catch(err){_didIteratorError10=true;_iteratorError10=err;}finally{try{if(!_iteratorNormalCompletion10&&_iterator10.return){_iterator10.return();}}finally{if(_didIteratorError10){throw _iteratorError10;}}}};this.DrawOverlayIndex=function(left)//叠加指标标题
5812
5813
  {var bottom=this.Frame.ChartBorder.GetTop()+this.Frame.ChartBorder.TitleHeight/2;//上下居中显示
5813
- var right=this.Frame.ChartBorder.GetRight();if(this.Frame.IsHScreen===true){bottom=-this.Frame.ChartBorder.TitleHeight/2;right=this.Frame.ChartBorder.GetHeight();}if(left>right)return;var spaceWidth=5*GetDevicePixelRatio();var drawLeft=left;var _iteratorNormalCompletion11=true;var _didIteratorError11=false;var _iteratorError11=undefined;try{for(var _iterator11=(0,_getIterator3.default)(this.OverlayIndex),_step11;!(_iteratorNormalCompletion11=(_step11=_iterator11.next()).done);_iteratorNormalCompletion11=true){item=_step11.value;left+=spaceWidth;var overlayItem=item[1];var overlayID=item[0];if(overlayItem.Title&&this.IsShowOverlayIndexName){this.Canvas.fillStyle=this.TitleColor;var textWidth=this.Canvas.measureText(overlayItem.Title).width+2;drawLeft=left;left+=textWidth;if(left>right)break;this.Canvas.fillText(overlayItem.Title,drawLeft,bottom,textWidth);if(this.IsSelectedChart(overlayID))this.DrawSelectedLine(drawLeft,bottom,textWidth);}for(var i in overlayItem.Data){var item=overlayItem.Data[i];if(!item||!item.Data||!item.Data.Data||!item.Name)continue;if(item.Data.Data.length<=0)continue;var value=null;var valueText=null;if(item.DataType=="StraightLine")//直线只有1个数据
5814
+ var right=this.Frame.ChartBorder.GetRight();if(this.Frame.IsHScreen===true){bottom=-this.Frame.ChartBorder.TitleHeight/2;right=this.Frame.ChartBorder.GetHeight();}if(left>right)return;var spaceWidth=5*GetDevicePixelRatio();var drawLeft=left;var indexCount=0;var _iteratorNormalCompletion11=true;var _didIteratorError11=false;var _iteratorError11=undefined;try{for(var _iterator11=(0,_getIterator3.default)(this.OverlayIndex),_step11;!(_iteratorNormalCompletion11=(_step11=_iterator11.next()).done);_iteratorNormalCompletion11=true){item=_step11.value;if(indexCount>0)left+=spaceWidth;var overlayItem=item[1];var overlayID=item[0];if(overlayItem.Title&&this.IsShowOverlayIndexName){this.Canvas.fillStyle=this.TitleColor;var textWidth=this.Canvas.measureText(overlayItem.Title).width+2;drawLeft=left;left+=textWidth;if(left>right)break;this.Canvas.fillText(overlayItem.Title,drawLeft,bottom,textWidth);if(this.IsSelectedChart(overlayID))this.DrawSelectedLine(drawLeft,bottom,textWidth);}for(var i in overlayItem.Data){var item=overlayItem.Data[i];if(!item||!item.Data||!item.Data.Data||!item.Name)continue;if(item.Data.Data.length<=0)continue;var value=null;var valueText=null;if(item.DataType=="StraightLine")//直线只有1个数据
5814
5815
  {value=item.Data.Data[0];valueText=this.FormatValue(value,item);}else{var index=Math.abs(this.CursorIndex-0.5);index=parseInt(index.toFixed(0));if(this.IsKLineFrame)index=this.CursorIndex;var dataIndex=item.Data.DataOffset+index;if(dataIndex>=item.Data.Data.length)dataIndex=item.Data.Data.length-1;if(dataIndex<0)continue;value=item.Data.Data[dataIndex];if(value==null)continue;if(item.DataType=="HistoryData-Vol"){value=value.Vol;valueText=this.FormatValue(value,item);}else if(item.DataType=="MultiReport"){valueText=this.FormatMultiReport(value,item);}else{valueText=this.FormatValue(value,item);}}this.Canvas.fillStyle=item.Color;var text=item.Name+":"+valueText;var textWidth=this.Canvas.measureText(text).width+2;//后空2个像素
5815
- drawLeft=left;left+=textWidth;if(left>right)break;this.Canvas.fillText(text,drawLeft,bottom,textWidth);}if(left>right)break;}}catch(err){_didIteratorError11=true;_iteratorError11=err;}finally{try{if(!_iteratorNormalCompletion11&&_iterator11.return){_iterator11.return();}}finally{if(_didIteratorError11){throw _iteratorError11;}}}};this.HScreenDraw=function(){var border=this.Frame.ChartBorder.GetHScreenBorder();var xText=this.Frame.ChartBorder.GetRightTitle();var yText=border.TopEx;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);var left=1;var bottom=-this.Frame.ChartBorder.TitleHeight/2;//上下居中显示
5816
+ drawLeft=left;left+=textWidth;if(left>right)break;this.Canvas.fillText(text,drawLeft,bottom,textWidth);}if(left>right)break;++indexCount;}}catch(err){_didIteratorError11=true;_iteratorError11=err;}finally{try{if(!_iteratorNormalCompletion11&&_iterator11.return){_iterator11.return();}}finally{if(_didIteratorError11){throw _iteratorError11;}}}};this.HScreenDraw=function(){var border=this.Frame.ChartBorder.GetHScreenBorder();var xText=this.Frame.ChartBorder.GetRightTitle();var yText=border.TopEx;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);var left=1;var bottom=-this.Frame.ChartBorder.TitleHeight/2;//上下居中显示
5816
5817
  var right=this.Frame.ChartBorder.GetHeight();this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.font=this.Font;var pixelRatio=GetDevicePixelRatio();if(this.Title&&this.IsShowIndexName){var textWidth=this.Canvas.measureText(this.Title).width+2;if(this.IsDrawTitleBG){var title=this.Title;if(this.IsShowNameArrow)title+='▼';var textWidth=this.Canvas.measureText(title).width;var bgHeight=this.Canvas.measureText("擎").width+4*pixelRatio;var bgWidth=textWidth+4*pixelRatio;this.TitleRect={Top:border.Top,Left:this.Frame.ChartBorder.GetRightTitle()+this.Frame.ChartBorder.TitleHeight/2-bgHeight/2,Width:bgHeight,Height:bgWidth};//保存下标题的坐标
5817
5818
  this.Canvas.fillStyle=this.BGColor;var drawRect={Left:left,Top:bottom-bgHeight/2,Width:bgWidth,Height:bgHeight};this.Canvas.fillRect(drawRect.Left,drawRect.Top,drawRect.Width,drawRect.Height);if(this.BGBorderColor){this.Canvas.strokeStyle=this.BGBorderColor;this.Canvas.strokeRect(ToFixedPoint(drawRect.Left),ToFixedPoint(drawRect.Top),ToFixedRect(drawRect.Width),ToFixedRect(drawRect.Height));}this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(title,left+2*pixelRatio,bottom,textWidth);left+=bgWidth+2*pixelRatio;left+=this.TitleSpace;}else{this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.Title,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}}if(this.ArgumentsText&&this.IsShowIndexName){var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.ArgumentsText,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}var isShowLastData=this.IsShowLastData();var lockRect=this.Frame.GetLockRect();if(lockRect)//指标上锁区域不显示动态标题
5818
5819
  {var index=Math.abs(this.CursorIndex-0.5);if(this.IsKLineFrame)index=this.CursorIndex;var x=this.Frame.GetXFromIndex(index.toFixed(0));if(x>=lockRect.Top)return;if(isShowLastData)return;}for(var i in this.Data){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText){var text;for(var k=0;k<aryText.length;++k){var titleItem=aryText[k];if(titleItem.Name)text=titleItem.Name+":"+titleItem.Text;else text=titleItem.Text;var space=this.ParamSpace*GetDevicePixelRatio();var textWidth=this.Canvas.measureText(text).width+space;if(left+textWidth>right)break;this.Canvas.fillStyle=titleItem.Color;this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}else{this.Canvas.fillStyle=item.Color;var text=valueText;if(item.Name){var dyTitle=this.GetDynamicOutName(item.Name);if(dyTitle)text=dyTitle+":"+valueText;else text=item.Name+":"+valueText;}var space=this.ParamSpace*GetDevicePixelRatio();var textWidth=this.Canvas.measureText(text).width+space;//后空2个像素
@@ -7297,7 +7298,8 @@ if(!indexInfo){indexCustom=JSIndexMap.Get(indexName);//定制指标
7297
7298
  if(!indexCustom){console.warn('[KLineChartContainer::CreateOverlayIndex] can not find index['+indexName+']');return null;}}}var subFrame=this.Frame.SubFrame[windowIndex];var overlayFrame=new OverlayIndexItem();if(obj.Identify)overlayFrame.Identify=obj.Identify;//由外部指定id
7298
7299
  //var frame= this.ClassName==='KLineChartHScreenContainer' ? new OverlayKLineHScreenFrame() : new OverlayKLineFrame();
7299
7300
  var frame=this.CreateOverlayFrame();frame.Canvas=this.Canvas;frame.MainFrame=subFrame.Frame;frame.ChartBorder=subFrame.Frame.ChartBorder;frame.GetEventCallback=function(id){return _this21.GetEventCallback(id);};if(obj.ShowRightText===true)frame.IsShow=true;else if(obj.ShowRightText===false)frame.IsShow=false;if(IFrameSplitOperator.IsBool(obj.ShowToolbar))frame.IsShowToolbar=obj.ShowToolbar;//废弃
7300
- if(IFrameSplitOperator.IsBool(obj.IsShareY))frame.IsShareY=obj.IsShareY;if(IFrameSplitOperator.IsBool(obj.IsShowIndexTitle))frame.IsShowIndexTitle=obj.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin))frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin;//是否计算Y最大最小值
7301
+ if(IFrameSplitOperator.IsBool(obj.IsShareY))frame.IsShareY=obj.IsShareY;//if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
7302
+ if(IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin))frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin;//是否计算Y最大最小值
7301
7303
  frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=frame.ChartBorder;frame.YSplitOperator.SplitCount=subFrame.Frame.YSplitOperator.SplitCount;frame.YSplitOperator.GetEventCallback=function(id){return _this21.GetEventCallback(id);};frame.YSplitOperator.GetKLineChartCallback=function(){return _this21.GetKLineChart();};frame.YSplitOperator.OverlayIndex=overlayFrame;frame.YSplitOperator.HQChart=this;frame.YSplitOperator.OverlayIdentify=overlayFrame.Identify;if(obj.Frame){var item=obj.Frame;if(item.Custom)frame.YSplitOperator.Custom=item.Custom;if(IFrameSplitOperator.IsBool(item.IsYDrawMainFrame))frame.IsYDrawMainFrame=item.IsYDrawMainFrame;//自定义刻度绘制在主图上
7302
7304
  if(IFrameSplitOperator.IsBool(item.IsShowToolbar))frame.IsShowToolbar=item.IsShowToolbar;//是否显示工具栏
7303
7305
  }overlayFrame.Frame=frame;if(apiItem){var apiIndex=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,obj,true);apiIndex.OverlayIndex={IsOverlay:true,Identify:overlayFrame.Identify,WindowIndex:windowIndex,Frame:overlayFrame};//叠加指标信息
@@ -7344,9 +7346,9 @@ if(item.Script)//自定义指标脚本
7344
7346
  {var apiItem=item.API;this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);}else{var indexID=item.Index;var indexItem=JSIndexMap.Get(indexID);if(indexItem){this.WindowIndex[i]=indexItem.Create();this.CreateWindowIndex(windowIndex);}else{var systemScript=new JSIndexScript();var indexInfo=systemScript.Get(indexID);if(indexInfo){JSIndexScript.ModifyAttribute(indexInfo,item);this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
7345
7347
  }}}this.SetSubFrameAttribute(frame,item,frameItem);}//最后一个显示X轴坐标
7346
7348
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}//叠加指标
7347
- var aryOverlayIndex=[];if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Index)item.IndexName=item.Index;if(item.Windows>=0)item.WindowIndex=item.Windows;var overlay=this.CreateOverlayWindowsIndex(item);if(!overlay)continue;aryOverlayIndex.push({WindowsIndex:item.WindowIndex,Overlay:overlay});}}if(!bRefreshData){var bindData=this.ChartPaint[0].Data;for(var i=0;i<count;++i)//请求指标
7349
+ var aryOverlayIndex=[];if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Index)item.IndexName=item.Index;if(item.Windows>=0)item.WindowIndex=item.Windows;var overlay=this.CreateOverlayWindowsIndex(item);if(!overlay)continue;aryOverlayIndex.push({WindowsIndex:item.WindowIndex,Overlay:overlay});}}this.Frame.SetSizeChage(true);if(!bRefreshData){var bindData=this.ChartPaint[0].Data;for(var i=0;i<count;++i)//请求指标
7348
7350
  {this.BindIndexData(i,bindData);}for(var i=0;i<aryOverlayIndex.length;++i){var item=aryOverlayIndex[i];this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);}this.UpdataDataoffset();//更新数据偏移
7349
- this.Frame.SetSizeChage(true);this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
7351
+ this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
7350
7352
  this.Draw();}else{if(!symbol)symbol=this.Symbol;var optionData={KLine:{}};if(IFrameSplitOperator.IsNumber(period))optionData.KLine.Period=period;if(IFrameSplitOperator.IsNumber(right))optionData.KLine.Right=right;this.ChangeSymbol(symbol,optionData);}};this.RemoveIndexWindow=function(id,option){JSConsole.Chart.Log('[KLineChartContainer::RemoveIndexWindow] remove id',id);if(id==0){if(option&&option.DeleteMainIndex)//删除指标
7351
7353
  {this.DeleteIndexPaint(id);this.WindowIndex[id]=null;this.Frame.SetSizeChage(true);this.UpdateFrameMaxMin();this.ResetFrameXYSplit();this.Draw();}return;}if(!this.Frame.SubFrame)return;if(id>=this.Frame.SubFrame.length)return;this.Frame.RestoreIndexWindows();var delFrame=this.Frame.SubFrame[id].Frame;this.DeleteIndexPaint(id);this.Frame.SubFrame[id].Frame.ClearToolbar();var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[id],WindowIndex:id};event.Callback(event,sendData,this);}this.Frame.SubFrame.splice(id,1);this.WindowIndex.splice(id,1);this.TitlePaint.splice(id+1,1);//删除对应的动态标题
7352
7354
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;item.Identify=i;}if(this.ChartDrawPicture.length>0){var aryDrawPicture=[];for(var i in this.ChartDrawPicture){var item=this.ChartDrawPicture[i];if(item.Frame==delFrame)continue;aryDrawPicture.push(item);}this.ChartDrawPicture=aryDrawPicture;}this.Frame.SetSizeChage(true);this.UpdateFrameMaxMin();this.ResetFrameXYSplit();this.Draw();};//获取当前的显示的指标
@@ -7811,7 +7813,7 @@ this.ChartSplashPaint=new ChartSplashPaint();this.ChartSplashPaint.Canvas=this.C
7811
7813
  this.Frame=new HQTradeFrame();this.Frame.ChartBorder=new ChartBorder();this.Frame.ChartBorder.UIElement=this.UIElement;this.Frame.ChartBorder.Top=25;this.Frame.ChartBorder.TitleHeight=0;this.Frame.ChartBorder.Left=50;this.Frame.ChartBorder.Bottom=20;this.Frame.Canvas=this.Canvas;this.Frame.GetExtendChartRightWidth=function(){return _this26.GetExtendChartRightWidth();};this.Frame.GetEventCallback=function(id){return _this26.GetEventCallback(id);};this.Frame.ZoomStartWindowIndex=2;this.ChartCorssCursor.Frame=this.Frame;//十字光标绑定框架
7812
7814
  this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.CreateMainKLine();this.CreateExtendChart("RectSelectPaint",option?option.SelectRect:null);//区间统计
7813
7815
  if(this.EnableIndexChartDrag)this.CreateExtendChart("DragMovePaint");//子窗口动态标题
7814
- for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this26.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;if(this.ChartCorssCursor.CallAcutionXOperator)this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;var bRegisterKeydown=true;var bRegisterWheel=true;if(option&&option.Listener){var item=option.Listener;if(item.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register keydown event.');}if(item.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this26.OnKeyDown(e);},true);//键盘消息
7816
+ for(var i=0;i<this.Frame.SubFrame.length;++i){var titlePaint=new DynamicChartTitlePainting();if(i==0||i==1)titlePaint.IsShowMainIndexTitle=false;titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this26.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;if(this.ChartCorssCursor.CallAcutionXOperator)this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;var bRegisterKeydown=true;var bRegisterWheel=true;if(option&&option.Listener){var item=option.Listener;if(item.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register keydown event.');}if(item.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this26.OnKeyDown(e);},true);//键盘消息
7815
7817
  if(bRegisterWheel)this.UIElement.addEventListener("wheel",function(e){_this26.OnWheel(e);},true);//上下滚动消息
7816
7818
  };//创建子窗口
7817
7819
  this.CreateChildWindow=function(windowCount){var _this27=this;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_FRAME);for(var i=0;i<windowCount;++i){var border=new ChartBorder();border.UIElement=this.UIElement;var frame=new MinuteFrame();frame.Canvas=this.Canvas;frame.ChartBorder=border;frame.Identify=i;frame.GlobalOption=this.GlobalOption;if(i<2)frame.ChartBorder.TitleHeight=0;frame.XPointCount=243;if(i>=2){if(this.ModifyIndexDialog)frame.ModifyIndexEvent=this.ModifyIndexDialog.DoModal;//绑定菜单事件
@@ -7854,8 +7856,8 @@ var bindData=this.SourceData;this.BindIndexData(i,bindData);//执行脚本
7854
7856
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.UpdataDataoffset();//更新数据偏移
7855
7857
  }this.UpdateXShowText();this.Frame.SetSizeChage(true);this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
7856
7858
  this.Draw();};this.ChangeIndexTemplate=function(option)//切换指标模板 可以设置指标窗口个数 每个窗口的指标, 只能从第3个指标窗口开始设置,前面2个指标窗口固定无法设置
7857
- {var _this32=this;if(!Array.isArray(option.Windows))return;var count=option.Windows.length;var currentLength=this.Frame.SubFrame.length;var startWindowIndex=2;count+=startWindowIndex;var dayCount=null;if(IFrameSplitOperator.IsNumber(option.DayCount)&&option.DayCount!=this.DayCount)dayCount=option.DayCount;//天数
7858
- var bRefreshData=dayCount!=null;//清空所有的指标图型
7859
+ {var _this32=this;if(!Array.isArray(option.Windows))return;var count=option.Windows.length;var currentLength=this.Frame.SubFrame.length;var startWindowIndex=2;count+=startWindowIndex;var dayCount=null,symbol=null;if(IFrameSplitOperator.IsNumber(option.DayCount)&&option.DayCount!=this.DayCount)dayCount=option.DayCount;//天数
7860
+ if(option.Symbol)symbol=option.Symbol;var bRefreshData=dayCount!=null||symbol!=null;//清空所有的指标图型
7859
7861
  for(var i=startWindowIndex;i<currentLength;++i){this.DeleteIndexPaint(i);var frame=this.Frame.SubFrame[i];frame.YSpecificMaxMin=null;frame.IsLocked=false;frame.YSplitScale=null;}if(currentLength>count){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);for(var i=currentLength-1;i>=count;--i){this.Frame.SubFrame[i].Frame.ClearToolbar();if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}this.Frame.SubFrame.splice(count,currentLength-count);this.WindowIndex.splice(count,currentLength-count);this.TitlePaint.splice(count+1,currentLength-count);}else{for(var i=currentLength;i<count;++i)//创建新的指标窗口
7860
7862
  {var subFrame=this.CreateSubFrameItem(i);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this32.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint[i+1]=titlePaint;}}for(var i=0;i<count;++i){var windowIndex=i;var item=null,frameItem=null;if(option.Frame&&option.Frame.length>i)frameItem=option.Frame[windowIndex];if(windowIndex>=startWindowIndex)item=option.Windows[windowIndex-startWindowIndex];var titleIndex=windowIndex+1;this.TitlePaint[titleIndex].Data=[];this.TitlePaint[titleIndex].Title=null;if(item){if(item.Script)//自定义指标脚本
7861
7863
  {this.WindowIndex[windowIndex]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
@@ -7864,10 +7866,10 @@ for(var i=startWindowIndex;i<currentLength;++i){this.DeleteIndexPaint(i);var fra
7864
7866
  }}}}this.SetSubFrameAttribute(this.Frame.SubFrame[windowIndex],item,frameItem);}//清空叠加指标
7865
7867
  for(var i=0;i<this.Frame.SubFrame.length;++i){this.DeleteWindowsOverlayIndex(i);}//最后一个显示X轴坐标
7866
7868
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}//叠加指标
7867
- var aryOverlayIndex=[];if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Index)item.IndexName=item.Index;if(item.Windows>=0)item.WindowIndex=item.Windows;var overlay=this.CreateOverlayWindowsIndex(item);if(!overlay)continue;aryOverlayIndex.push({WindowsIndex:item.WindowIndex,Overlay:overlay});}}if(!bRefreshData){var bindData=this.SourceData;for(var i=0;i<count;++i){this.BindIndexData(i,bindData);//执行脚本
7869
+ var aryOverlayIndex=[];if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Index)item.IndexName=item.Index;if(item.Windows>=0)item.WindowIndex=item.Windows;var overlay=this.CreateOverlayWindowsIndex(item);if(!overlay)continue;aryOverlayIndex.push({WindowsIndex:item.WindowIndex,Overlay:overlay});}}this.Frame.SetSizeChage(true);if(!bRefreshData){var bindData=this.SourceData;for(var i=0;i<count;++i){this.BindIndexData(i,bindData);//执行脚本
7868
7870
  }for(var i=0;i<aryOverlayIndex.length;++i){var item=aryOverlayIndex[i];this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);}this.UpdataDataoffset();//更新数据偏移
7869
- this.Frame.SetSizeChage(true);if(this.UpdateXShowText)this.UpdateXShowText();this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
7870
- this.Draw();}else{this.Frame.SetSizeChage(true);if(dayCount!=null)this.ChangeDayCount(dayCount);}};this.RemoveIndexWindow=function(id){JSConsole.Chart.Log('[MinuteChartContainer::RemoveIndexWindow] remove id',id);if(id<2)return;if(!this.Frame.SubFrame)return;if(id>=this.Frame.SubFrame.length)return;this.Frame.RestoreIndexWindows();var delFrame=this.Frame.SubFrame[id].Frame;this.DeleteIndexPaint(id);this.Frame.SubFrame[id].Frame.ClearToolbar();var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[id],WindowIndex:id};event.Callback(event,sendData,this);}this.Frame.SubFrame.splice(id,1);this.WindowIndex.splice(id,1);this.TitlePaint.splice(id+1,1);//删除对应的动态标题
7871
+ if(this.UpdateXShowText)this.UpdateXShowText();this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
7872
+ this.Draw();}else{if(!symbol)symbol=this.Symbol;var option={};if(IFrameSplitOperator.IsNumber(dayCount))option.DayCount=dayCount;this.ChangeSymbol(symbol,option);}};this.RemoveIndexWindow=function(id){JSConsole.Chart.Log('[MinuteChartContainer::RemoveIndexWindow] remove id',id);if(id<2)return;if(!this.Frame.SubFrame)return;if(id>=this.Frame.SubFrame.length)return;this.Frame.RestoreIndexWindows();var delFrame=this.Frame.SubFrame[id].Frame;this.DeleteIndexPaint(id);this.Frame.SubFrame[id].Frame.ClearToolbar();var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[id],WindowIndex:id};event.Callback(event,sendData,this);}this.Frame.SubFrame.splice(id,1);this.WindowIndex.splice(id,1);this.TitlePaint.splice(id+1,1);//删除对应的动态标题
7871
7873
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;item.Identify=i;}/*
7872
7874
  if (this.ChartDrawPicture.length>0)
7873
7875
  {
@@ -8111,8 +8113,7 @@ if(!indexInfo){indexCustom=JSIndexMap.Get(indexName);//定制指标
8111
8113
  if(!indexCustom){console.warn('[MinuteChartContainer::CreateOverlayIndex] can not find index['+indexName+']');return null;}}}var subFrame=this.Frame.SubFrame[windowIndex];var overlayFrame=new OverlayIndexItem();if(obj.Identify)overlayFrame.Identify=obj.Identify;//由外部指定id
8112
8114
  var frame=null;if(this.ClassName=="MinuteChartContainer")frame=new OverlayMinuteFrame();else frame=new OverlayMinuteHScreenFrame();frame.Canvas=this.Canvas;frame.MainFrame=subFrame.Frame;frame.ChartBorder=subFrame.Frame.ChartBorder;frame.GlobalOption=this.GlobalOption;if(obj.ShowRightText===true)frame.IsShow=true;else if(obj.ShowRightText===false)frame.IsShow=false;if(obj.IsShareY===true)frame.IsShareY=true;if(IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin))frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin;//是否计算Y最大最小值
8113
8115
  frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=frame.ChartBorder;frame.YSplitOperator.SplitCount=subFrame.Frame.YSplitOperator.SplitCount;frame.YSplitOperator.GetEventCallback=function(id){return _this34.GetEventCallback(id);};frame.YSplitOperator.HQChart=this;frame.YSplitOperator.OverlayIdentify=overlayFrame.Identify;if(obj.Frame){var item=obj.Frame;if(item.Custom)frame.YSplitOperator.Custom=item.Custom;}overlayFrame.Frame=frame;if(apiItem){var apiIndex=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,obj,true);apiIndex.OverlayIndex={IsOverlay:true,Identify:overlayFrame.Identify,WindowIndex:windowIndex,Frame:overlayFrame};//叠加指标信息
8114
- overlayFrame.Script=apiIndex;}else if(indexInfo){var indexData=indexInfo;if(obj.Args)indexData.Args=obj.Args;//外部可以设置参数
8115
- var scriptIndex=new OverlayScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData);//脚本执行
8116
+ overlayFrame.Script=apiIndex;}else if(indexInfo){JSIndexScript.ModifyAttribute(indexInfo,obj);var scriptIndex=new OverlayScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
8116
8117
  scriptIndex.OverlayIndex={IsOverlay:true,Identify:overlayFrame.Identify,WindowIndex:windowIndex,Frame:overlayFrame};//叠加指标信息
8117
8118
  overlayFrame.Script=scriptIndex;}else{var scriptIndex=indexCustom.Create();scriptIndex.OverlayIndex={IsOverlay:true,Identify:overlayFrame.Identify,WindowIndex:windowIndex,Frame:overlayFrame};//叠加指标信息
8118
8119
  scriptIndex.Create(this,windowIndex);overlayFrame.Script=scriptIndex;}subFrame.OverlayIndex.push(overlayFrame);return overlayFrame;};this.DeleteOverlayWindowsIndex=function(identify)//删除叠加指标
@@ -11380,7 +11381,8 @@ this.Add=function(name,option){this.DataMap.set(name,{MinuteFittingCallback:opti
11380
11381
  function ScriptIndex(name,script,args,option){this.newMethod=BaseIndex;//派生
11381
11382
  this.newMethod(name);delete this.newMethod;this.ClassName="ScriptIndex";this.Script=script;this.Arguments=[];this.OutVar=[];this.ID;//指标ID
11382
11383
  this.FloatPrecision=2;//小数位数
11383
- this.StringFormat;this.KLineType=null;//K线显示类型
11384
+ this.StringFormat;this.IsShowIndexTitle=true;//是否显示指标标题
11385
+ this.KLineType=null;//K线显示类型
11384
11386
  this.InstructionType;//五彩K线, 交易指标
11385
11387
  this.YSpecificMaxMin=null;//最大最小值
11386
11388
  this.YSplitScale=null;//固定刻度
@@ -11399,7 +11401,7 @@ this.IsSync=false;//是否是同步计算 (无数据请求)
11399
11401
  this.IsShow=true;//是否显示图形
11400
11402
  this.RunCount=0;//已执行次数
11401
11403
  this.MaxRunCount=-1;//最大执行次数 -1=无限
11402
- if(option){if(option.FloatPrecision>=0)this.FloatPrecision=option.FloatPrecision;if(option.StringFormat>0)this.StringFormat=option.StringFormat;if(option.ID)this.ID=option.ID;if(option.KLineType>=0||option.KLineType===-1)this.KLineType=option.KLineType;if(option.InstructionType)this.InstructionType=option.InstructionType;if(option.YSpecificMaxMin)this.YSpecificMaxMin=option.YSpecificMaxMin;if(option.YSplitScale)this.YSplitScale=option.YSplitScale;if(option.Condition)this.Condition=option.Condition;if(option.TitleFont)this.TitleFont=option.TitleFont;if(option.IsShortTitle)this.IsShortTitle=option.IsShortTitle;if(option.OutName)this.OutName=option.OutName;if(IFrameSplitOperator.IsNumber(option.YSplitType))this.YSplitType=option.YSplitType;if(IFrameSplitOperator.IsBool(option.IsSync))this.IsSync=option.IsSync;if(IFrameSplitOperator.IsNumber(option.MaxRunCount))this.MaxRunCount=option.MaxRunCount;if(option.Debug){if(IFrameSplitOperator.IsPlusNumber(option.Debug.Count)&&option.Debug.Callback){this.Debug={Count:option.Debug.Count,Callback:option.Debug.Callback};}}}if(option&&option.Lock){if(option.Lock.IsLocked==true)this.IsLocked=true;//指标上锁
11404
+ if(option){if(option.FloatPrecision>=0)this.FloatPrecision=option.FloatPrecision;if(option.StringFormat>0)this.StringFormat=option.StringFormat;if(IFrameSplitOperator.IsBool(option.IsShowIndexTitle))this.IsShowIndexTitle=option.IsShowIndexTitle;if(option.ID)this.ID=option.ID;if(option.KLineType>=0||option.KLineType===-1)this.KLineType=option.KLineType;if(option.InstructionType)this.InstructionType=option.InstructionType;if(option.YSpecificMaxMin)this.YSpecificMaxMin=option.YSpecificMaxMin;if(option.YSplitScale)this.YSplitScale=option.YSplitScale;if(option.Condition)this.Condition=option.Condition;if(option.TitleFont)this.TitleFont=option.TitleFont;if(option.IsShortTitle)this.IsShortTitle=option.IsShortTitle;if(option.OutName)this.OutName=option.OutName;if(IFrameSplitOperator.IsNumber(option.YSplitType))this.YSplitType=option.YSplitType;if(IFrameSplitOperator.IsBool(option.IsSync))this.IsSync=option.IsSync;if(IFrameSplitOperator.IsNumber(option.MaxRunCount))this.MaxRunCount=option.MaxRunCount;if(option.Debug){if(IFrameSplitOperator.IsPlusNumber(option.Debug.Count)&&option.Debug.Callback){this.Debug={Count:option.Debug.Count,Callback:option.Debug.Callback};}}}if(option&&option.Lock){if(option.Lock.IsLocked==true)this.IsLocked=true;//指标上锁
11403
11405
  if(option.Lock.Callback)this.LockCallback=option.Lock.Callback;//锁回调
11404
11406
  if(option.Lock.ID)this.LockID=option.Lock.ID;//锁ID
11405
11407
  if(option.Lock.BG)this.LockBG=option.Lock.BG;if(option.Lock.TextColor)this.LockTextColor=option.Lock.TextColor;if(option.Lock.Text)this.LockText=option.Lock.Text;if(option.Lock.Font)this.LockFont=option.Lock.Font;if(option.Lock.Count)this.LockCount=option.Lock.Count;if(option.Lock.MinWidth)this.LockMinWidth=option.Lock.MinWidth*GetDevicePixelRatio();}if(option&&option.YAxis){this.YAxis={};if(IFrameSplitOperator.IsNumber(option.YAxis.FloatPrecision))this.YAxis.FloatPrecision=option.YAxis.FloatPrecision;if(IFrameSplitOperator.IsNumber(option.YAxis.StringFormat))this.YAxis.StringFormat=option.YAxis.StringFormat;if(IFrameSplitOperator.IsBool(option.YAxis.EnableRemoveZero))this.YAxis.EnableRemoveZero=option.YAxis.EnableRemoveZero;}if(args)this.Arguments=args;this.CopyTo=function(dest)//赋值到新实例出来
@@ -11508,12 +11510,12 @@ if(this.YSplitScale)hqChart.Frame.SubFrame[windowIndex].Frame.YSplitScale=this.Y
11508
11510
  var testData={ Name:'MULTI_LINE', Type:1,Draw:{ DrawType:'MULTI_LINE', DrawData:[point1,point2] } };
11509
11511
  this.OutVar.push(testData);
11510
11512
  }
11511
- */for(var _i136 in this.OutVar){var _item27=this.OutVar[_i136];if(_item27.IsExData===true)continue;//扩展数据不显示图形
11513
+ */for(var _i136=0;_i136<this.OutVar.length;++_i136){var _item27=this.OutVar[_i136];if(_item27.IsExData===true)continue;//扩展数据不显示图形
11512
11514
  if(_item27.Type==1000||_item27.Type==1001)continue;//数据集合, 字符串
11513
11515
  if(_item27.Type==0){if(_item27.IsOverlayLine)this.CreateOverlayLine(hqChart,windowIndex,_item27,_i136,_item27.Type);else this.CreateLine(hqChart,windowIndex,_item27,_i136,_item27.Type);}else if(_item27.Type==1){switch(_item27.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item27,_i136);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item27,_i136);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item27,_i136);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item27,_i136);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item27,_i136);break;case"FILLRGN":this.CreateFillRGN(hqChart,windowIndex,_item27,_i136);break;case"FILLRGN2":this.CreateFillRGN2(hqChart,windowIndex,_item27,_i136);break;case"FILLTOPRGN":case"FILLBOTTOMRGN":case"FILLVERTICALRGN":this.CreateFillBGRGN(hqChart,windowIndex,_item27,_i136);break;case"FLOATRGN":this.CreateFLOATRGN(hqChart,windowIndex,_item27,_i136);break;case'DRAWKLINE':case"DRAWKLINE1":this.CreateKLine(hqChart,windowIndex,_item27,_i136);break;case"DRAWOVERLAYKLINE":this.CreateOverlayKLine(hqChart,windowIndex,_item27,_i136);break;case"DRAWCOLORKLINE":this.CreateDrawColorKLine(hqChart,windowIndex,_item27,_i136);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item27,_i136);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item27,_i136);break;case'DRAWGBK':case"DRAWGBK2":this.CreateBackgroud(hqChart,windowIndex,_item27,_i136);break;case"DRAWGBK_DIV":this.CreateBackgroundDiv(hqChart,windowIndex,_item27,_i136);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item27,_i136);break;case'DRAWNUMBER':this.CreateDrawNumber(hqChart,windowIndex,_item27,_i136);break;case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item27,_i136);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item27,_i136);break;case"ICON":this.CreateIcon(hqChart,windowIndex,_item27,_i136);break;case"TIPICON":this.CreateTipIcon(hqChart,windowIndex,_item27,_i136);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item27,_i136);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item27,_i136);break;case'DRAWRECTREL':this.CreateRectangle(hqChart,windowIndex,_item27,_i136);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item27,_i136);break;case"DRAWOVERLAYLINE":this.CreateScriptOverlayLine(hqChart,windowIndex,_item27,_i136);break;case"DRAWSL":this.CreateChartSlopeLine(hqChart,windowIndex,_item27,_i136);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item27,_i136);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item27,_i136);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item27,_i136);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item27,_i136);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item27,_i136);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item27,_i136);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item27,_i136);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item27,_i136);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item27,_i136);break;case"COLOR_KLINE":this.CreateColorKLine(hqChart,windowIndex,_item27,_i136);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item27,_i136);break;case"MULTI_POINT_LINE":this.CreateLineMultiData(hqChart,windowIndex,_item27,_i136);break;case"BUY":case"SELL":case"SELLSHORT":case"BUYSHORT":this.CreateTradeIcon(hqChart,windowIndex,_item27,_i136);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item27,_i136);break;case SCRIPT_CHART_NAME.KLINE_TABLE:this.CreateKLineTable(hqChart,windowIndex,_item27,_i136);break;case SCRIPT_CHART_NAME.SCATTER_PLOT:this.CreateScatterPlot(hqChart,windowIndex,_item27,_i136);break;default:{var find=g_ScriptIndexChartFactory.Get(_item27.Draw.DrawType);//外部挂接
11514
11516
  if(find&&find.CreateChartCallback)find.CreateChartCallback(hqChart,windowIndex,_item27,_i136,this);}break;}}else if(_item27.Type==2){this.CreateMACD(hqChart,windowIndex,_item27,_i136);}else if(_item27.Type==3){this.CreatePointDot(hqChart,windowIndex,_item27,_i136,hisData);}else if(_item27.Type==4){this.CreateLineStick(hqChart,windowIndex,_item27,_i136);}else if(_item27.Type==5){this.CreateStick(hqChart,windowIndex,_item27,_i136);}else if(_item27.Type==6){this.CreateVolStick(hqChart,windowIndex,_item27,_i136,hisData);}else if(_item27.Type==7){this.CreateLine(hqChart,windowIndex,_item27,_i136,_item27.Type);}else if(_item27.Type==8){this.CreateLine(hqChart,windowIndex,_item27,_i136,_item27.Type);}else if(_item27.Type==9){this.CreateArea(hqChart,windowIndex,_item27,_i136);}var titlePaint=hqChart.TitlePaint[windowIndex+1];if(titlePaint&&titlePaint.Data&&_i136<titlePaint.Data.length)//设置标题数值 小数位数和格式
11515
- {if(this.StringFormat>0)titlePaint.Data[_i136].StringFormat=this.StringFormat;if(this.FloatPrecision>=0)titlePaint.Data[_i136].FloatPrecision=this.FloatPrecision;if(this.OutName&&this.OutName.length>0&&this.Arguments&&this.Arguments.length>0){titlePaint.SetDynamicTitle(this.OutName,this.Arguments);}}}var titleIndex=windowIndex+1;hqChart.TitlePaint[titleIndex].Title=this.Name;hqChart.TitlePaint[titleIndex].Identify=this.Guid;//指标ID
11516
- hqChart.TitlePaint[titleIndex].ArgumentsText=null;hqChart.TitlePaint[titleIndex].Script=this;if(!this.IsShortTitle){var indexParam='';for(var _i137=0;_i137<this.Arguments.length;++_i137){var _item28=this.Arguments[_i137];if(indexParam.length>0)indexParam+=',';indexParam+=_item28.Value.toString();}if(indexParam.length>0)hqChart.TitlePaint[titleIndex].ArgumentsText='('+indexParam+')';}if(this.TitleFont)hqChart.TitlePaint[titleIndex].Font=this.TitleFont;return true;};//给一个默认的颜色
11517
+ {if(this.StringFormat>0)titlePaint.Data[_i136].StringFormat=this.StringFormat;if(this.FloatPrecision>=0)titlePaint.Data[_i136].FloatPrecision=this.FloatPrecision;if(this.OutName&&this.OutName.length>0&&this.Arguments&&this.Arguments.length>0){titlePaint.SetDynamicTitle(this.OutName,this.Arguments);}}}var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.Title=this.Name;titlePaint.Identify=this.Guid;//指标ID
11518
+ titlePaint.ArgumentsText=null;titlePaint.Script=this;titlePaint.IsShowMainIndexTitle=this.IsShowIndexTitle;if(!this.IsShortTitle){var indexParam='';for(var _i137=0;_i137<this.Arguments.length;++_i137){var _item28=this.Arguments[_i137];if(indexParam.length>0)indexParam+=',';indexParam+=_item28.Value.toString();}if(indexParam.length>0)titlePaint.ArgumentsText='('+indexParam+')';}if(this.TitleFont)titlePaint.Font=this.TitleFont;return true;};//给一个默认的颜色
11517
11519
  this.GetDefaultColor=function(id){var COLOR_ARRAY=null;//使用全局线段配置
11518
11520
  if(g_JSChartResource&&g_JSChartResource.Index&&g_JSChartResource.Index.LineColor){COLOR_ARRAY=g_JSChartResource.Index.LineColor;}if(!COLOR_ARRAY||!Array.isArray(COLOR_ARRAY)){COLOR_ARRAY=["rgb(255,174,0)","rgb(25,199,255)","rgb(175,95,162)","rgb(236,105,65)","rgb(68,114,196)","rgb(229,0,79)","rgb(0,128,255)","rgb(252,96,154)","rgb(42,230,215)","rgb(24,71,178)"];}var number=parseInt(id);return COLOR_ARRAY[number%(COLOR_ARRAY.length-1)];};//获取颜色
11519
11521
  this.GetColor=function(colorName){if(colorName.indexOf("RGB(")==0)return colorName.toLowerCase();if(colorName.indexOf("rgb(")==0)return colorName;if(colorName.indexOf("RGBA(")==0)return colorName.toLowerCase();if(colorName.indexOf("rgba(")==0)return colorName;var color=JSComplier.ColorVarToRGB(colorName);if(color)return color;return'rgb(30,144,255)';/*
@@ -11550,7 +11552,7 @@ this.OverlayIndex=null;// { IsOverlay:true, Identify:overlayFrame.Identify, Wind
11550
11552
  //显示指标不符合条件
11551
11553
  this.ShowConditionError=function(param,msg){var hqChart=param.HQChart;var windowIndex=param.WindowIndex;var message='指标不支持当前品种或周期';if(msg)message=msg;var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;frame.ChartPaint=[];var chart=new ChartLine();chart.Canvas=hqChart.Canvas;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.NotSupportMessage=message;frame.ChartPaint.push(chart);hqChart.Draw();};this.BindData=function(hqChart,windowIndex,hisData){if(!this.OverlayIndex||this.OverlayIndex.IsOverlay!=true)return;this.OverlayIndex.Frame.ChartPaint=[];if(!IFrameSplitOperator.IsNonEmptyArray(this.OutVar))return;//修改Y轴分割方式
11552
11554
  var ySpliter=this.OverlayIndex.Frame.Frame.YSplitOperator;if(ySpliter){ySpliter.Reset();ySpliter.FloatPrecision=this.FloatPrecision;if(IFrameSplitOperator.IsNumber(this.YSplitType))ySpliter.SplitType=this.YSplitType;if(this.YAxis)ySpliter.SetOption(this.YAxis);}//指标名字
11553
- var titleInfo={Data:[],Title:this.Name,Frame:this.OverlayIndex.Frame.Frame,Script:this};var indexParam='';for(var i in this.Arguments){var _item29=this.Arguments[i];if(indexParam.length>0)indexParam+=',';indexParam+=_item29.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;//给子框架设置标题
11555
+ var titleInfo={Data:[],Title:this.Name,Frame:this.OverlayIndex.Frame.Frame,Script:this,IsShowIndexTitle:this.IsShowIndexTitle};var indexParam='';for(var i in this.Arguments){var _item29=this.Arguments[i];if(indexParam.length>0)indexParam+=',';indexParam+=_item29.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;//给子框架设置标题
11554
11556
  if(hqChart.Frame.SubFrame[windowIndex]){var mainFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(mainFrame)this.OverlayIndex.Frame.Frame.XPointCount=mainFrame.XPointCount;//跟主窗口同步下页面显示数据个数
11555
11557
  }for(var i=0;i<this.OutVar.length;++i){var _item30=this.OutVar[i];if(_item30.IsExData===true)continue;//扩展数据不显示图形
11556
11558
  if(_item30.Type==0){this.CreateLine(hqChart,windowIndex,_item30,i,_item30.Type);}else if(_item30.Type==1){switch(_item30.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item30,i);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item30,i);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item30,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item30,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item30,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item30,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item30,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item30,i);break;case'DRAWGBK':case"DRAWGBK2":this.CreateBackgroud(hqChart,windowIndex,_item30,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item30,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item30,i);break;case"TIPICON":this.CreateTipIcon(hqChart,windowIndex,_item30,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item30,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item30,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item30,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item30,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item30,i);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item30,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item30,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item30,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item30,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item30,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item30,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item30,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item30,i);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item30,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item30,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item30.Draw.DrawType);//外部挂接
@@ -12810,7 +12812,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
12810
12812
  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);};}/********************************************************************************
12811
12813
  * 版本信息输出
12812
12814
  *
12813
- */var HQCHART_VERSION="1.1.12942";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();//把给外界调用的方法暴露出来
12815
+ */var HQCHART_VERSION="1.1.12954";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();//把给外界调用的方法暴露出来
12814
12816
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
12815
12817
  // BaseIndex:BaseIndex,
12816
12818
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.12943",
3
+ "version": "1.1.12955",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -19539,6 +19539,7 @@ function ScriptIndex(name,script,args,option)
19539
19539
  this.ID; //指标ID
19540
19540
  this.FloatPrecision=2; //小数位数
19541
19541
  this.StringFormat;
19542
+ this.IsShowIndexTitle=true; //是否显示指标标题
19542
19543
  this.KLineType=null; //K线显示类型
19543
19544
  this.InstructionType; //五彩K线, 交易指标
19544
19545
  this.YSpecificMaxMin=null; //最大最小值
@@ -19576,6 +19577,7 @@ function ScriptIndex(name,script,args,option)
19576
19577
  {
19577
19578
  if (option.FloatPrecision>=0) this.FloatPrecision=option.FloatPrecision;
19578
19579
  if (option.StringFormat>0) this.StringFormat=option.StringFormat;
19580
+ if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) this.IsShowIndexTitle=option.IsShowIndexTitle;
19579
19581
  if (option.ID) this.ID=option.ID;
19580
19582
  if (option.KLineType>=0 || option.KLineType===-1) this.KLineType=option.KLineType;
19581
19583
  if (option.InstructionType) this.InstructionType=option.InstructionType;
@@ -21322,7 +21324,7 @@ function ScriptIndex(name,script,args,option)
21322
21324
  }
21323
21325
  */
21324
21326
 
21325
- for(let i in this.OutVar)
21327
+ for(let i=0; i<this.OutVar.length; ++i)
21326
21328
  {
21327
21329
  let item=this.OutVar[i];
21328
21330
  if (item.IsExData===true) continue; //扩展数据不显示图形
@@ -21535,11 +21537,13 @@ function ScriptIndex(name,script,args,option)
21535
21537
  }
21536
21538
 
21537
21539
  let titleIndex=windowIndex+1;
21538
- hqChart.TitlePaint[titleIndex].Title=this.Name;
21539
- hqChart.TitlePaint[titleIndex].Identify=this.Guid; //指标ID
21540
- hqChart.TitlePaint[titleIndex].ArgumentsText=null;
21541
- hqChart.TitlePaint[titleIndex].Script=this;
21542
-
21540
+ var titlePaint=hqChart.TitlePaint[titleIndex];
21541
+ titlePaint.Title=this.Name;
21542
+ titlePaint.Identify=this.Guid; //指标ID
21543
+ titlePaint.ArgumentsText=null;
21544
+ titlePaint.Script=this;
21545
+ titlePaint.IsShowMainIndexTitle=this.IsShowIndexTitle;
21546
+
21543
21547
  if (!this.IsShortTitle)
21544
21548
  {
21545
21549
  let indexParam='';
@@ -21550,10 +21554,10 @@ function ScriptIndex(name,script,args,option)
21550
21554
  indexParam+=item.Value.toString();
21551
21555
  }
21552
21556
 
21553
- if (indexParam.length>0) hqChart.TitlePaint[titleIndex].ArgumentsText=`(${indexParam})`;
21557
+ if (indexParam.length>0) titlePaint.ArgumentsText=`(${indexParam})`;
21554
21558
  }
21555
21559
 
21556
- if (this.TitleFont) hqChart.TitlePaint[titleIndex].Font=this.TitleFont;
21560
+ if (this.TitleFont) titlePaint.Font=this.TitleFont;
21557
21561
 
21558
21562
  return true;
21559
21563
  }
@@ -21687,7 +21691,7 @@ function OverlayScriptIndex(name,script,args,option)
21687
21691
  }
21688
21692
 
21689
21693
  //指标名字
21690
- var titleInfo={ Data:[], Title:this.Name, Frame:this.OverlayIndex.Frame.Frame, Script:this };
21694
+ var titleInfo={ Data:[], Title:this.Name, Frame:this.OverlayIndex.Frame.Frame, Script:this, IsShowIndexTitle:this.IsShowIndexTitle };
21691
21695
  let indexParam='';
21692
21696
  for(var i in this.Arguments)
21693
21697
  {
@@ -181,6 +181,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
181
181
  if (attribute.TitleFont) indexInfo.TitleFont=attribute.TitleFont;
182
182
  if (attribute.Lock) indexInfo.Lock=attribute.Lock;
183
183
  if (IFrameSplitOperator.IsNumber(attribute.YSplitType)) indexInfo.YSplitType=attribute.YSplitType;
184
+ if (IFrameSplitOperator.IsBool(attribute.IsShowIndexTitle)) indexInfo.IsShowIndexTitle=attribute.IsShowIndexTitle;
184
185
 
185
186
  if (attribute.YAxis)
186
187
  {
@@ -50293,6 +50293,8 @@ function DynamicChartTitlePainting()
50293
50293
  this.DynamicTitle={ OutName:null, OutValue:null };
50294
50294
  this.OverlayDynamicTitle=new Map(); //key , value={ OutName, OutValue }
50295
50295
 
50296
+ this.IsShowMainIndexTitle=true; //是否显示主图指标标题
50297
+
50296
50298
  this.ReloadResource=function()
50297
50299
  {
50298
50300
  this.Font=g_JSChartResource.TitleFont;
@@ -50756,7 +50758,7 @@ function DynamicChartTitlePainting()
50756
50758
  this.Canvas.textBaseline="middle";
50757
50759
  this.Canvas.font=this.Font;
50758
50760
  var pixelRatio=GetDevicePixelRatio();
50759
- if (this.Title && this.IsShowIndexName)
50761
+ if (this.Title && this.IsShowIndexName && this.IsShowMainIndexTitle)
50760
50762
  {
50761
50763
  if (this.IsDrawTitleBG)
50762
50764
  {
@@ -50785,7 +50787,7 @@ function DynamicChartTitlePainting()
50785
50787
  }
50786
50788
  }
50787
50789
 
50788
- if (this.ArgumentsText && this.IsShowIndexName)
50790
+ if (this.ArgumentsText && this.IsShowIndexName && this.IsShowMainIndexTitle)
50789
50791
  {
50790
50792
  var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;
50791
50793
  this.Canvas.fillStyle=this.TitleColor;
@@ -50805,7 +50807,7 @@ function DynamicChartTitlePainting()
50805
50807
  if (isShowLastData) return;
50806
50808
  }
50807
50809
 
50808
- for(var i=0; i<this.Data.length; ++i)
50810
+ for(var i=0; i<this.Data.length && this.IsShowMainIndexTitle; ++i)
50809
50811
  {
50810
50812
  var item=this.Data[i];
50811
50813
  var outText=this.GetTitleItem(item, isShowLastData, i);
@@ -50904,7 +50906,9 @@ function DynamicChartTitlePainting()
50904
50906
  }
50905
50907
  else
50906
50908
  {
50907
- this.DrawOverlayIndex(left+10*GetDevicePixelRatio()); //间距多空点 和主指标区分开
50909
+ var xOffset=10*GetDevicePixelRatio(); //主指标区分开 间距多空点
50910
+ if (!this.IsShowMainIndexTitle) xOffset=0;
50911
+ this.DrawOverlayIndex(left+xOffset);
50908
50912
  }
50909
50913
  }
50910
50914
 
@@ -51094,6 +51098,7 @@ function DynamicChartTitlePainting()
51094
51098
  else
51095
51099
  {
51096
51100
  var top=border.TopTitle+2*pixelRatio;
51101
+ if (!this.IsShowMainIndexTitle) top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;
51097
51102
  var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;
51098
51103
  var right=border.Right;
51099
51104
  var bottom=border.Bottom;
@@ -51111,6 +51116,7 @@ function DynamicChartTitlePainting()
51111
51116
  var toolbarInfo={ Width:0, YCenter:y, ID:overlayID };
51112
51117
  this.DrawOverlayToolbar(overlayItem,toolbarInfo,moveonPoint, mouseStatus);
51113
51118
 
51119
+ if (!overlayItem.IsShowIndexTitle) continue;
51114
51120
  if (!overlayItem.Frame.IsShowIndexTitle) continue;
51115
51121
 
51116
51122
  x=left+toolbarInfo.Width;
@@ -51250,9 +51256,10 @@ function DynamicChartTitlePainting()
51250
51256
 
51251
51257
  var spaceWidth=5*GetDevicePixelRatio();
51252
51258
  var drawLeft=left;
51259
+ var indexCount=0;
51253
51260
  for(item of this.OverlayIndex)
51254
51261
  {
51255
- left+=spaceWidth;
51262
+ if (indexCount>0) left+=spaceWidth;
51256
51263
  var overlayItem=item[1];
51257
51264
  var overlayID=item[0];
51258
51265
  if (overlayItem.Title && this.IsShowOverlayIndexName)
@@ -51318,6 +51325,8 @@ function DynamicChartTitlePainting()
51318
51325
  }
51319
51326
 
51320
51327
  if (left>right) break;
51328
+
51329
+ ++indexCount;
51321
51330
  }
51322
51331
  }
51323
51332
 
@@ -68011,7 +68020,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
68011
68020
  else if (obj.ShowRightText===false) frame.IsShow=false;
68012
68021
  if (IFrameSplitOperator.IsBool(obj.ShowToolbar)) frame.IsShowToolbar=obj.ShowToolbar; //废弃
68013
68022
  if (IFrameSplitOperator.IsBool(obj.IsShareY)) frame.IsShareY=obj.IsShareY;
68014
- if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
68023
+ //if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
68015
68024
  if (IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin)) frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin; //是否计算Y最大最小值
68016
68025
 
68017
68026
  frame.YSplitOperator=new FrameSplitY();
@@ -68453,6 +68462,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
68453
68462
  }
68454
68463
  }
68455
68464
 
68465
+ this.Frame.SetSizeChage(true);
68466
+
68456
68467
  if (!bRefreshData)
68457
68468
  {
68458
68469
  var bindData=this.ChartPaint[0].Data;
@@ -68468,7 +68479,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
68468
68479
  }
68469
68480
 
68470
68481
  this.UpdataDataoffset(); //更新数据偏移
68471
- this.Frame.SetSizeChage(true);
68472
68482
  this.ResetFrameXYSplit();
68473
68483
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
68474
68484
  this.Draw();
@@ -68476,7 +68486,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
68476
68486
  else
68477
68487
  {
68478
68488
  if (!symbol) symbol=this.Symbol;
68479
-
68480
68489
  var optionData={ KLine:{} };
68481
68490
  if (IFrameSplitOperator.IsNumber(period)) optionData.KLine.Period=period;
68482
68491
  if (IFrameSplitOperator.IsNumber(right)) optionData.KLine.Right=right;
@@ -73298,9 +73307,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
73298
73307
  if (this.EnableIndexChartDrag) this.CreateExtendChart("DragMovePaint");
73299
73308
 
73300
73309
  //子窗口动态标题
73301
- for(var i in this.Frame.SubFrame)
73310
+ for(var i=0;i<this.Frame.SubFrame.length; ++i)
73302
73311
  {
73303
73312
  var titlePaint=new DynamicChartTitlePainting();
73313
+ if (i==0 || i==1) titlePaint.IsShowMainIndexTitle=false;
73304
73314
  titlePaint.Frame=this.Frame.SubFrame[i].Frame;
73305
73315
  titlePaint.Canvas=this.Canvas;
73306
73316
  titlePaint.LanguageID=this.LanguageID;
@@ -73787,9 +73797,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
73787
73797
  var startWindowIndex=2;
73788
73798
  count+=startWindowIndex;
73789
73799
 
73790
- var dayCount=null;
73800
+ var dayCount=null, symbol=null;
73791
73801
  if (IFrameSplitOperator.IsNumber(option.DayCount) && option.DayCount!=this.DayCount) dayCount= option.DayCount; //天数
73792
- var bRefreshData= (dayCount!=null);
73802
+ if (option.Symbol) symbol=option.Symbol;
73803
+ var bRefreshData= (dayCount!=null || symbol!=null);
73793
73804
 
73794
73805
  //清空所有的指标图型
73795
73806
  for(var i=startWindowIndex;i<currentLength;++i)
@@ -73913,6 +73924,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
73913
73924
  }
73914
73925
  }
73915
73926
 
73927
+ this.Frame.SetSizeChage(true);
73928
+
73916
73929
  if (!bRefreshData)
73917
73930
  {
73918
73931
  var bindData=this.SourceData;
@@ -73928,7 +73941,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
73928
73941
  }
73929
73942
 
73930
73943
  this.UpdataDataoffset(); //更新数据偏移
73931
- this.Frame.SetSizeChage(true);
73944
+
73932
73945
  if (this.UpdateXShowText) this.UpdateXShowText();
73933
73946
  this.ResetFrameXYSplit();
73934
73947
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
@@ -73936,8 +73949,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
73936
73949
  }
73937
73950
  else
73938
73951
  {
73939
- this.Frame.SetSizeChage(true);
73940
- if (dayCount!=null) this.ChangeDayCount(dayCount);
73952
+ if (!symbol) symbol=this.Symbol;
73953
+ var option={ };
73954
+ if (IFrameSplitOperator.IsNumber(dayCount)) option.DayCount=dayCount;
73955
+ this.ChangeSymbol(symbol, option);
73941
73956
  }
73942
73957
  }
73943
73958
 
@@ -76129,10 +76144,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
76129
76144
  }
76130
76145
  else if (indexInfo)
76131
76146
  {
76132
- let indexData = indexInfo;
76133
- if (obj.Args) indexData.Args=obj.Args; //外部可以设置参数
76134
-
76135
- var scriptIndex=new OverlayScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
76147
+ JSIndexScript.ModifyAttribute(indexInfo, obj);
76148
+ var scriptIndex=new OverlayScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
76136
76149
  scriptIndex.OverlayIndex={ IsOverlay:true, Identify:overlayFrame.Identify, WindowIndex:windowIndex, Frame:overlayFrame }; //叠加指标信息
76137
76150
  overlayFrame.Script=scriptIndex;
76138
76151
  }
@@ -193,6 +193,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
193
193
  if (attribute.TitleFont) indexInfo.TitleFont=attribute.TitleFont;
194
194
  if (attribute.Lock) indexInfo.Lock=attribute.Lock;
195
195
  if (IFrameSplitOperator.IsNumber(attribute.YSplitType)) indexInfo.YSplitType=attribute.YSplitType;
196
+ if (IFrameSplitOperator.IsBool(attribute.IsShowIndexTitle)) indexInfo.IsShowIndexTitle=attribute.IsShowIndexTitle;
196
197
 
197
198
  if (attribute.YAxis)
198
199
  {
@@ -54485,6 +54486,8 @@ function DynamicChartTitlePainting()
54485
54486
  this.DynamicTitle={ OutName:null, OutValue:null };
54486
54487
  this.OverlayDynamicTitle=new Map(); //key , value={ OutName, OutValue }
54487
54488
 
54489
+ this.IsShowMainIndexTitle=true; //是否显示主图指标标题
54490
+
54488
54491
  this.ReloadResource=function()
54489
54492
  {
54490
54493
  this.Font=g_JSChartResource.TitleFont;
@@ -54948,7 +54951,7 @@ function DynamicChartTitlePainting()
54948
54951
  this.Canvas.textBaseline="middle";
54949
54952
  this.Canvas.font=this.Font;
54950
54953
  var pixelRatio=GetDevicePixelRatio();
54951
- if (this.Title && this.IsShowIndexName)
54954
+ if (this.Title && this.IsShowIndexName && this.IsShowMainIndexTitle)
54952
54955
  {
54953
54956
  if (this.IsDrawTitleBG)
54954
54957
  {
@@ -54977,7 +54980,7 @@ function DynamicChartTitlePainting()
54977
54980
  }
54978
54981
  }
54979
54982
 
54980
- if (this.ArgumentsText && this.IsShowIndexName)
54983
+ if (this.ArgumentsText && this.IsShowIndexName && this.IsShowMainIndexTitle)
54981
54984
  {
54982
54985
  var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;
54983
54986
  this.Canvas.fillStyle=this.TitleColor;
@@ -54997,7 +55000,7 @@ function DynamicChartTitlePainting()
54997
55000
  if (isShowLastData) return;
54998
55001
  }
54999
55002
 
55000
- for(var i=0; i<this.Data.length; ++i)
55003
+ for(var i=0; i<this.Data.length && this.IsShowMainIndexTitle; ++i)
55001
55004
  {
55002
55005
  var item=this.Data[i];
55003
55006
  var outText=this.GetTitleItem(item, isShowLastData, i);
@@ -55096,7 +55099,9 @@ function DynamicChartTitlePainting()
55096
55099
  }
55097
55100
  else
55098
55101
  {
55099
- this.DrawOverlayIndex(left+10*GetDevicePixelRatio()); //间距多空点 和主指标区分开
55102
+ var xOffset=10*GetDevicePixelRatio(); //主指标区分开 间距多空点
55103
+ if (!this.IsShowMainIndexTitle) xOffset=0;
55104
+ this.DrawOverlayIndex(left+xOffset);
55100
55105
  }
55101
55106
  }
55102
55107
 
@@ -55286,6 +55291,7 @@ function DynamicChartTitlePainting()
55286
55291
  else
55287
55292
  {
55288
55293
  var top=border.TopTitle+2*pixelRatio;
55294
+ if (!this.IsShowMainIndexTitle) top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;
55289
55295
  var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;
55290
55296
  var right=border.Right;
55291
55297
  var bottom=border.Bottom;
@@ -55303,6 +55309,7 @@ function DynamicChartTitlePainting()
55303
55309
  var toolbarInfo={ Width:0, YCenter:y, ID:overlayID };
55304
55310
  this.DrawOverlayToolbar(overlayItem,toolbarInfo,moveonPoint, mouseStatus);
55305
55311
 
55312
+ if (!overlayItem.IsShowIndexTitle) continue;
55306
55313
  if (!overlayItem.Frame.IsShowIndexTitle) continue;
55307
55314
 
55308
55315
  x=left+toolbarInfo.Width;
@@ -55442,9 +55449,10 @@ function DynamicChartTitlePainting()
55442
55449
 
55443
55450
  var spaceWidth=5*GetDevicePixelRatio();
55444
55451
  var drawLeft=left;
55452
+ var indexCount=0;
55445
55453
  for(item of this.OverlayIndex)
55446
55454
  {
55447
- left+=spaceWidth;
55455
+ if (indexCount>0) left+=spaceWidth;
55448
55456
  var overlayItem=item[1];
55449
55457
  var overlayID=item[0];
55450
55458
  if (overlayItem.Title && this.IsShowOverlayIndexName)
@@ -55510,6 +55518,8 @@ function DynamicChartTitlePainting()
55510
55518
  }
55511
55519
 
55512
55520
  if (left>right) break;
55521
+
55522
+ ++indexCount;
55513
55523
  }
55514
55524
  }
55515
55525
 
@@ -72203,7 +72213,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72203
72213
  else if (obj.ShowRightText===false) frame.IsShow=false;
72204
72214
  if (IFrameSplitOperator.IsBool(obj.ShowToolbar)) frame.IsShowToolbar=obj.ShowToolbar; //废弃
72205
72215
  if (IFrameSplitOperator.IsBool(obj.IsShareY)) frame.IsShareY=obj.IsShareY;
72206
- if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
72216
+ //if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
72207
72217
  if (IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin)) frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin; //是否计算Y最大最小值
72208
72218
 
72209
72219
  frame.YSplitOperator=new FrameSplitY();
@@ -72645,6 +72655,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72645
72655
  }
72646
72656
  }
72647
72657
 
72658
+ this.Frame.SetSizeChage(true);
72659
+
72648
72660
  if (!bRefreshData)
72649
72661
  {
72650
72662
  var bindData=this.ChartPaint[0].Data;
@@ -72660,7 +72672,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72660
72672
  }
72661
72673
 
72662
72674
  this.UpdataDataoffset(); //更新数据偏移
72663
- this.Frame.SetSizeChage(true);
72664
72675
  this.ResetFrameXYSplit();
72665
72676
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
72666
72677
  this.Draw();
@@ -72668,7 +72679,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72668
72679
  else
72669
72680
  {
72670
72681
  if (!symbol) symbol=this.Symbol;
72671
-
72672
72682
  var optionData={ KLine:{} };
72673
72683
  if (IFrameSplitOperator.IsNumber(period)) optionData.KLine.Period=period;
72674
72684
  if (IFrameSplitOperator.IsNumber(right)) optionData.KLine.Right=right;
@@ -77490,9 +77500,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77490
77500
  if (this.EnableIndexChartDrag) this.CreateExtendChart("DragMovePaint");
77491
77501
 
77492
77502
  //子窗口动态标题
77493
- for(var i in this.Frame.SubFrame)
77503
+ for(var i=0;i<this.Frame.SubFrame.length; ++i)
77494
77504
  {
77495
77505
  var titlePaint=new DynamicChartTitlePainting();
77506
+ if (i==0 || i==1) titlePaint.IsShowMainIndexTitle=false;
77496
77507
  titlePaint.Frame=this.Frame.SubFrame[i].Frame;
77497
77508
  titlePaint.Canvas=this.Canvas;
77498
77509
  titlePaint.LanguageID=this.LanguageID;
@@ -77979,9 +77990,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77979
77990
  var startWindowIndex=2;
77980
77991
  count+=startWindowIndex;
77981
77992
 
77982
- var dayCount=null;
77993
+ var dayCount=null, symbol=null;
77983
77994
  if (IFrameSplitOperator.IsNumber(option.DayCount) && option.DayCount!=this.DayCount) dayCount= option.DayCount; //天数
77984
- var bRefreshData= (dayCount!=null);
77995
+ if (option.Symbol) symbol=option.Symbol;
77996
+ var bRefreshData= (dayCount!=null || symbol!=null);
77985
77997
 
77986
77998
  //清空所有的指标图型
77987
77999
  for(var i=startWindowIndex;i<currentLength;++i)
@@ -78105,6 +78117,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78105
78117
  }
78106
78118
  }
78107
78119
 
78120
+ this.Frame.SetSizeChage(true);
78121
+
78108
78122
  if (!bRefreshData)
78109
78123
  {
78110
78124
  var bindData=this.SourceData;
@@ -78120,7 +78134,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78120
78134
  }
78121
78135
 
78122
78136
  this.UpdataDataoffset(); //更新数据偏移
78123
- this.Frame.SetSizeChage(true);
78137
+
78124
78138
  if (this.UpdateXShowText) this.UpdateXShowText();
78125
78139
  this.ResetFrameXYSplit();
78126
78140
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
@@ -78128,8 +78142,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78128
78142
  }
78129
78143
  else
78130
78144
  {
78131
- this.Frame.SetSizeChage(true);
78132
- if (dayCount!=null) this.ChangeDayCount(dayCount);
78145
+ if (!symbol) symbol=this.Symbol;
78146
+ var option={ };
78147
+ if (IFrameSplitOperator.IsNumber(dayCount)) option.DayCount=dayCount;
78148
+ this.ChangeSymbol(symbol, option);
78133
78149
  }
78134
78150
  }
78135
78151
 
@@ -80321,10 +80337,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
80321
80337
  }
80322
80338
  else if (indexInfo)
80323
80339
  {
80324
- let indexData = indexInfo;
80325
- if (obj.Args) indexData.Args=obj.Args; //外部可以设置参数
80326
-
80327
- var scriptIndex=new OverlayScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
80340
+ JSIndexScript.ModifyAttribute(indexInfo, obj);
80341
+ var scriptIndex=new OverlayScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
80328
80342
  scriptIndex.OverlayIndex={ IsOverlay:true, Identify:overlayFrame.Identify, WindowIndex:windowIndex, Frame:overlayFrame }; //叠加指标信息
80329
80343
  overlayFrame.Script=scriptIndex;
80330
80344
  }
@@ -112459,6 +112473,7 @@ function ScriptIndex(name,script,args,option)
112459
112473
  this.ID; //指标ID
112460
112474
  this.FloatPrecision=2; //小数位数
112461
112475
  this.StringFormat;
112476
+ this.IsShowIndexTitle=true; //是否显示指标标题
112462
112477
  this.KLineType=null; //K线显示类型
112463
112478
  this.InstructionType; //五彩K线, 交易指标
112464
112479
  this.YSpecificMaxMin=null; //最大最小值
@@ -112496,6 +112511,7 @@ function ScriptIndex(name,script,args,option)
112496
112511
  {
112497
112512
  if (option.FloatPrecision>=0) this.FloatPrecision=option.FloatPrecision;
112498
112513
  if (option.StringFormat>0) this.StringFormat=option.StringFormat;
112514
+ if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) this.IsShowIndexTitle=option.IsShowIndexTitle;
112499
112515
  if (option.ID) this.ID=option.ID;
112500
112516
  if (option.KLineType>=0 || option.KLineType===-1) this.KLineType=option.KLineType;
112501
112517
  if (option.InstructionType) this.InstructionType=option.InstructionType;
@@ -114242,7 +114258,7 @@ function ScriptIndex(name,script,args,option)
114242
114258
  }
114243
114259
  */
114244
114260
 
114245
- for(let i in this.OutVar)
114261
+ for(let i=0; i<this.OutVar.length; ++i)
114246
114262
  {
114247
114263
  let item=this.OutVar[i];
114248
114264
  if (item.IsExData===true) continue; //扩展数据不显示图形
@@ -114455,11 +114471,13 @@ function ScriptIndex(name,script,args,option)
114455
114471
  }
114456
114472
 
114457
114473
  let titleIndex=windowIndex+1;
114458
- hqChart.TitlePaint[titleIndex].Title=this.Name;
114459
- hqChart.TitlePaint[titleIndex].Identify=this.Guid; //指标ID
114460
- hqChart.TitlePaint[titleIndex].ArgumentsText=null;
114461
- hqChart.TitlePaint[titleIndex].Script=this;
114462
-
114474
+ var titlePaint=hqChart.TitlePaint[titleIndex];
114475
+ titlePaint.Title=this.Name;
114476
+ titlePaint.Identify=this.Guid; //指标ID
114477
+ titlePaint.ArgumentsText=null;
114478
+ titlePaint.Script=this;
114479
+ titlePaint.IsShowMainIndexTitle=this.IsShowIndexTitle;
114480
+
114463
114481
  if (!this.IsShortTitle)
114464
114482
  {
114465
114483
  let indexParam='';
@@ -114470,10 +114488,10 @@ function ScriptIndex(name,script,args,option)
114470
114488
  indexParam+=item.Value.toString();
114471
114489
  }
114472
114490
 
114473
- if (indexParam.length>0) hqChart.TitlePaint[titleIndex].ArgumentsText=`(${indexParam})`;
114491
+ if (indexParam.length>0) titlePaint.ArgumentsText=`(${indexParam})`;
114474
114492
  }
114475
114493
 
114476
- if (this.TitleFont) hqChart.TitlePaint[titleIndex].Font=this.TitleFont;
114494
+ if (this.TitleFont) titlePaint.Font=this.TitleFont;
114477
114495
 
114478
114496
  return true;
114479
114497
  }
@@ -114607,7 +114625,7 @@ function OverlayScriptIndex(name,script,args,option)
114607
114625
  }
114608
114626
 
114609
114627
  //指标名字
114610
- var titleInfo={ Data:[], Title:this.Name, Frame:this.OverlayIndex.Frame.Frame, Script:this };
114628
+ var titleInfo={ Data:[], Title:this.Name, Frame:this.OverlayIndex.Frame.Frame, Script:this, IsShowIndexTitle:this.IsShowIndexTitle };
114611
114629
  let indexParam='';
114612
114630
  for(var i in this.Arguments)
114613
114631
  {
@@ -129385,7 +129403,7 @@ function ScrollBarBGChart()
129385
129403
 
129386
129404
 
129387
129405
 
129388
- var HQCHART_VERSION="1.1.12942";
129406
+ var HQCHART_VERSION="1.1.12954";
129389
129407
 
129390
129408
  function PrintHQChartVersion()
129391
129409
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12942";
8
+ var HQCHART_VERSION="1.1.12954";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -237,6 +237,7 @@ JSIndexScript.ModifyAttribute=function(indexInfo, attribute)
237
237
  if (attribute.TitleFont) indexInfo.TitleFont=attribute.TitleFont;
238
238
  if (attribute.Lock) indexInfo.Lock=attribute.Lock;
239
239
  if (IFrameSplitOperator.IsNumber(attribute.YSplitType)) indexInfo.YSplitType=attribute.YSplitType;
240
+ if (IFrameSplitOperator.IsBool(attribute.IsShowIndexTitle)) indexInfo.IsShowIndexTitle=attribute.IsShowIndexTitle;
240
241
 
241
242
  if (attribute.YAxis)
242
243
  {
@@ -54529,6 +54530,8 @@ function DynamicChartTitlePainting()
54529
54530
  this.DynamicTitle={ OutName:null, OutValue:null };
54530
54531
  this.OverlayDynamicTitle=new Map(); //key , value={ OutName, OutValue }
54531
54532
 
54533
+ this.IsShowMainIndexTitle=true; //是否显示主图指标标题
54534
+
54532
54535
  this.ReloadResource=function()
54533
54536
  {
54534
54537
  this.Font=g_JSChartResource.TitleFont;
@@ -54992,7 +54995,7 @@ function DynamicChartTitlePainting()
54992
54995
  this.Canvas.textBaseline="middle";
54993
54996
  this.Canvas.font=this.Font;
54994
54997
  var pixelRatio=GetDevicePixelRatio();
54995
- if (this.Title && this.IsShowIndexName)
54998
+ if (this.Title && this.IsShowIndexName && this.IsShowMainIndexTitle)
54996
54999
  {
54997
55000
  if (this.IsDrawTitleBG)
54998
55001
  {
@@ -55021,7 +55024,7 @@ function DynamicChartTitlePainting()
55021
55024
  }
55022
55025
  }
55023
55026
 
55024
- if (this.ArgumentsText && this.IsShowIndexName)
55027
+ if (this.ArgumentsText && this.IsShowIndexName && this.IsShowMainIndexTitle)
55025
55028
  {
55026
55029
  var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;
55027
55030
  this.Canvas.fillStyle=this.TitleColor;
@@ -55041,7 +55044,7 @@ function DynamicChartTitlePainting()
55041
55044
  if (isShowLastData) return;
55042
55045
  }
55043
55046
 
55044
- for(var i=0; i<this.Data.length; ++i)
55047
+ for(var i=0; i<this.Data.length && this.IsShowMainIndexTitle; ++i)
55045
55048
  {
55046
55049
  var item=this.Data[i];
55047
55050
  var outText=this.GetTitleItem(item, isShowLastData, i);
@@ -55140,7 +55143,9 @@ function DynamicChartTitlePainting()
55140
55143
  }
55141
55144
  else
55142
55145
  {
55143
- this.DrawOverlayIndex(left+10*GetDevicePixelRatio()); //间距多空点 和主指标区分开
55146
+ var xOffset=10*GetDevicePixelRatio(); //主指标区分开 间距多空点
55147
+ if (!this.IsShowMainIndexTitle) xOffset=0;
55148
+ this.DrawOverlayIndex(left+xOffset);
55144
55149
  }
55145
55150
  }
55146
55151
 
@@ -55330,6 +55335,7 @@ function DynamicChartTitlePainting()
55330
55335
  else
55331
55336
  {
55332
55337
  var top=border.TopTitle+2*pixelRatio;
55338
+ if (!this.IsShowMainIndexTitle) top=this.Frame.ChartBorder.GetTop()+2*pixelRatio;
55333
55339
  var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;
55334
55340
  var right=border.Right;
55335
55341
  var bottom=border.Bottom;
@@ -55347,6 +55353,7 @@ function DynamicChartTitlePainting()
55347
55353
  var toolbarInfo={ Width:0, YCenter:y, ID:overlayID };
55348
55354
  this.DrawOverlayToolbar(overlayItem,toolbarInfo,moveonPoint, mouseStatus);
55349
55355
 
55356
+ if (!overlayItem.IsShowIndexTitle) continue;
55350
55357
  if (!overlayItem.Frame.IsShowIndexTitle) continue;
55351
55358
 
55352
55359
  x=left+toolbarInfo.Width;
@@ -55486,9 +55493,10 @@ function DynamicChartTitlePainting()
55486
55493
 
55487
55494
  var spaceWidth=5*GetDevicePixelRatio();
55488
55495
  var drawLeft=left;
55496
+ var indexCount=0;
55489
55497
  for(item of this.OverlayIndex)
55490
55498
  {
55491
- left+=spaceWidth;
55499
+ if (indexCount>0) left+=spaceWidth;
55492
55500
  var overlayItem=item[1];
55493
55501
  var overlayID=item[0];
55494
55502
  if (overlayItem.Title && this.IsShowOverlayIndexName)
@@ -55554,6 +55562,8 @@ function DynamicChartTitlePainting()
55554
55562
  }
55555
55563
 
55556
55564
  if (left>right) break;
55565
+
55566
+ ++indexCount;
55557
55567
  }
55558
55568
  }
55559
55569
 
@@ -72247,7 +72257,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72247
72257
  else if (obj.ShowRightText===false) frame.IsShow=false;
72248
72258
  if (IFrameSplitOperator.IsBool(obj.ShowToolbar)) frame.IsShowToolbar=obj.ShowToolbar; //废弃
72249
72259
  if (IFrameSplitOperator.IsBool(obj.IsShareY)) frame.IsShareY=obj.IsShareY;
72250
- if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
72260
+ //if (IFrameSplitOperator.IsBool(obj.IsShowIndexTitle)) frame.IsShowIndexTitle=obj.IsShowIndexTitle;
72251
72261
  if (IFrameSplitOperator.IsBool(obj.IsCalculateYMaxMin)) frame.IsCalculateYMaxMin=obj.IsCalculateYMaxMin; //是否计算Y最大最小值
72252
72262
 
72253
72263
  frame.YSplitOperator=new FrameSplitY();
@@ -72689,6 +72699,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72689
72699
  }
72690
72700
  }
72691
72701
 
72702
+ this.Frame.SetSizeChage(true);
72703
+
72692
72704
  if (!bRefreshData)
72693
72705
  {
72694
72706
  var bindData=this.ChartPaint[0].Data;
@@ -72704,7 +72716,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72704
72716
  }
72705
72717
 
72706
72718
  this.UpdataDataoffset(); //更新数据偏移
72707
- this.Frame.SetSizeChage(true);
72708
72719
  this.ResetFrameXYSplit();
72709
72720
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
72710
72721
  this.Draw();
@@ -72712,7 +72723,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72712
72723
  else
72713
72724
  {
72714
72725
  if (!symbol) symbol=this.Symbol;
72715
-
72716
72726
  var optionData={ KLine:{} };
72717
72727
  if (IFrameSplitOperator.IsNumber(period)) optionData.KLine.Period=period;
72718
72728
  if (IFrameSplitOperator.IsNumber(right)) optionData.KLine.Right=right;
@@ -77534,9 +77544,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77534
77544
  if (this.EnableIndexChartDrag) this.CreateExtendChart("DragMovePaint");
77535
77545
 
77536
77546
  //子窗口动态标题
77537
- for(var i in this.Frame.SubFrame)
77547
+ for(var i=0;i<this.Frame.SubFrame.length; ++i)
77538
77548
  {
77539
77549
  var titlePaint=new DynamicChartTitlePainting();
77550
+ if (i==0 || i==1) titlePaint.IsShowMainIndexTitle=false;
77540
77551
  titlePaint.Frame=this.Frame.SubFrame[i].Frame;
77541
77552
  titlePaint.Canvas=this.Canvas;
77542
77553
  titlePaint.LanguageID=this.LanguageID;
@@ -78023,9 +78034,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78023
78034
  var startWindowIndex=2;
78024
78035
  count+=startWindowIndex;
78025
78036
 
78026
- var dayCount=null;
78037
+ var dayCount=null, symbol=null;
78027
78038
  if (IFrameSplitOperator.IsNumber(option.DayCount) && option.DayCount!=this.DayCount) dayCount= option.DayCount; //天数
78028
- var bRefreshData= (dayCount!=null);
78039
+ if (option.Symbol) symbol=option.Symbol;
78040
+ var bRefreshData= (dayCount!=null || symbol!=null);
78029
78041
 
78030
78042
  //清空所有的指标图型
78031
78043
  for(var i=startWindowIndex;i<currentLength;++i)
@@ -78149,6 +78161,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78149
78161
  }
78150
78162
  }
78151
78163
 
78164
+ this.Frame.SetSizeChage(true);
78165
+
78152
78166
  if (!bRefreshData)
78153
78167
  {
78154
78168
  var bindData=this.SourceData;
@@ -78164,7 +78178,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78164
78178
  }
78165
78179
 
78166
78180
  this.UpdataDataoffset(); //更新数据偏移
78167
- this.Frame.SetSizeChage(true);
78181
+
78168
78182
  if (this.UpdateXShowText) this.UpdateXShowText();
78169
78183
  this.ResetFrameXYSplit();
78170
78184
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
@@ -78172,8 +78186,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78172
78186
  }
78173
78187
  else
78174
78188
  {
78175
- this.Frame.SetSizeChage(true);
78176
- if (dayCount!=null) this.ChangeDayCount(dayCount);
78189
+ if (!symbol) symbol=this.Symbol;
78190
+ var option={ };
78191
+ if (IFrameSplitOperator.IsNumber(dayCount)) option.DayCount=dayCount;
78192
+ this.ChangeSymbol(symbol, option);
78177
78193
  }
78178
78194
  }
78179
78195
 
@@ -80365,10 +80381,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
80365
80381
  }
80366
80382
  else if (indexInfo)
80367
80383
  {
80368
- let indexData = indexInfo;
80369
- if (obj.Args) indexData.Args=obj.Args; //外部可以设置参数
80370
-
80371
- var scriptIndex=new OverlayScriptIndex(indexData.Name,indexData.Script,indexData.Args,indexData); //脚本执行
80384
+ JSIndexScript.ModifyAttribute(indexInfo, obj);
80385
+ var scriptIndex=new OverlayScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
80372
80386
  scriptIndex.OverlayIndex={ IsOverlay:true, Identify:overlayFrame.Identify, WindowIndex:windowIndex, Frame:overlayFrame }; //叠加指标信息
80373
80387
  overlayFrame.Script=scriptIndex;
80374
80388
  }
@@ -112503,6 +112517,7 @@ function ScriptIndex(name,script,args,option)
112503
112517
  this.ID; //指标ID
112504
112518
  this.FloatPrecision=2; //小数位数
112505
112519
  this.StringFormat;
112520
+ this.IsShowIndexTitle=true; //是否显示指标标题
112506
112521
  this.KLineType=null; //K线显示类型
112507
112522
  this.InstructionType; //五彩K线, 交易指标
112508
112523
  this.YSpecificMaxMin=null; //最大最小值
@@ -112540,6 +112555,7 @@ function ScriptIndex(name,script,args,option)
112540
112555
  {
112541
112556
  if (option.FloatPrecision>=0) this.FloatPrecision=option.FloatPrecision;
112542
112557
  if (option.StringFormat>0) this.StringFormat=option.StringFormat;
112558
+ if (IFrameSplitOperator.IsBool(option.IsShowIndexTitle)) this.IsShowIndexTitle=option.IsShowIndexTitle;
112543
112559
  if (option.ID) this.ID=option.ID;
112544
112560
  if (option.KLineType>=0 || option.KLineType===-1) this.KLineType=option.KLineType;
112545
112561
  if (option.InstructionType) this.InstructionType=option.InstructionType;
@@ -114286,7 +114302,7 @@ function ScriptIndex(name,script,args,option)
114286
114302
  }
114287
114303
  */
114288
114304
 
114289
- for(let i in this.OutVar)
114305
+ for(let i=0; i<this.OutVar.length; ++i)
114290
114306
  {
114291
114307
  let item=this.OutVar[i];
114292
114308
  if (item.IsExData===true) continue; //扩展数据不显示图形
@@ -114499,11 +114515,13 @@ function ScriptIndex(name,script,args,option)
114499
114515
  }
114500
114516
 
114501
114517
  let titleIndex=windowIndex+1;
114502
- hqChart.TitlePaint[titleIndex].Title=this.Name;
114503
- hqChart.TitlePaint[titleIndex].Identify=this.Guid; //指标ID
114504
- hqChart.TitlePaint[titleIndex].ArgumentsText=null;
114505
- hqChart.TitlePaint[titleIndex].Script=this;
114506
-
114518
+ var titlePaint=hqChart.TitlePaint[titleIndex];
114519
+ titlePaint.Title=this.Name;
114520
+ titlePaint.Identify=this.Guid; //指标ID
114521
+ titlePaint.ArgumentsText=null;
114522
+ titlePaint.Script=this;
114523
+ titlePaint.IsShowMainIndexTitle=this.IsShowIndexTitle;
114524
+
114507
114525
  if (!this.IsShortTitle)
114508
114526
  {
114509
114527
  let indexParam='';
@@ -114514,10 +114532,10 @@ function ScriptIndex(name,script,args,option)
114514
114532
  indexParam+=item.Value.toString();
114515
114533
  }
114516
114534
 
114517
- if (indexParam.length>0) hqChart.TitlePaint[titleIndex].ArgumentsText=`(${indexParam})`;
114535
+ if (indexParam.length>0) titlePaint.ArgumentsText=`(${indexParam})`;
114518
114536
  }
114519
114537
 
114520
- if (this.TitleFont) hqChart.TitlePaint[titleIndex].Font=this.TitleFont;
114538
+ if (this.TitleFont) titlePaint.Font=this.TitleFont;
114521
114539
 
114522
114540
  return true;
114523
114541
  }
@@ -114651,7 +114669,7 @@ function OverlayScriptIndex(name,script,args,option)
114651
114669
  }
114652
114670
 
114653
114671
  //指标名字
114654
- var titleInfo={ Data:[], Title:this.Name, Frame:this.OverlayIndex.Frame.Frame, Script:this };
114672
+ var titleInfo={ Data:[], Title:this.Name, Frame:this.OverlayIndex.Frame.Frame, Script:this, IsShowIndexTitle:this.IsShowIndexTitle };
114655
114673
  let indexParam='';
114656
114674
  for(var i in this.Arguments)
114657
114675
  {
@@ -129543,7 +129561,7 @@ function HQChartScriptWorker()
129543
129561
 
129544
129562
 
129545
129563
 
129546
- var HQCHART_VERSION="1.1.12942";
129564
+ var HQCHART_VERSION="1.1.12954";
129547
129565
 
129548
129566
  function PrintHQChartVersion()
129549
129567
  {