hqchart 1.1.14482 → 1.1.14484

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.
@@ -6002,14 +6002,21 @@ this.SelectedChart;//选中的图形
6002
6002
  this.ArgumentsText;//参数信息
6003
6003
  this.MerginLeft=g_JSChartResource.IndexTitleMerginLeft;//标题输出左边间距
6004
6004
  this.Buttons=[];//按钮
6005
- this.UpDownArrowConfig={UpColor:g_JSChartResource.IndexTitle.UpDownArrow.UpColor,DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor};//动态标题
6005
+ this.UpDownArrowConfig={UpColor:g_JSChartResource.IndexTitle.UpDownArrow.UpColor,DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor};//K线标题颜色
6006
+ this.UpColor=g_JSChartResource.UpTextColor;this.DownColor=g_JSChartResource.DownTextColor;this.UnchangeColor=g_JSChartResource.UnchagneTextColor;this.VolColor=g_JSChartResource.Title.VolColor;this.AmountColor=g_JSChartResource.Title.AmountColor;this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;this.NameColor=g_JSChartResource.Title.NameColor;this.PositionColor=g_JSChartResource.Title.PositionColor;//持仓
6007
+ //动态标题
6006
6008
  //动态标题
6007
6009
  this.DynamicTitle={OutName:null,OutValue:null};this.OverlayDynamicTitle=new _map2.default();//key , value={ OutName, OutValue }
6008
6010
  this.IsShowMainIndexTitle=true;//是否显示主图指标标题
6009
6011
  this.MainTitlePaint=null;//主标题
6010
- this.ReloadResource=function(){this.Font=g_JSChartResource.TitleFont;this.TitleColor=g_JSChartResource.DefaultTextColor;this.SelectedColor=g_JSChartResource.IndexTitleSelectedColor;this.OverlayIndexType.BGColor=g_JSChartResource.OverlayIndexTitleBGColor;this.BGColor=g_JSChartResource.IndexTitleBGColor;this.BGBorderColor=g_JSChartResource.IndexTitleBorderColor;this.BGBorderMoveOnColor=g_JSChartResource.IndexTitleBorderMoveOnColor;};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)//是否点击了指标标题
6012
+ this.ReloadResource=function(){this.Font=g_JSChartResource.TitleFont;this.TitleColor=g_JSChartResource.DefaultTextColor;this.SelectedColor=g_JSChartResource.IndexTitleSelectedColor;this.OverlayIndexType.BGColor=g_JSChartResource.OverlayIndexTitleBGColor;this.BGColor=g_JSChartResource.IndexTitleBGColor;this.BGBorderColor=g_JSChartResource.IndexTitleBorderColor;this.BGBorderMoveOnColor=g_JSChartResource.IndexTitleBorderMoveOnColor;this.UpColor=g_JSChartResource.UpTextColor;this.DownColor=g_JSChartResource.DownTextColor;this.UnchangeColor=g_JSChartResource.UnchagneTextColor;this.VolColor=g_JSChartResource.Title.VolColor;this.AmountColor=g_JSChartResource.Title.AmountColor;this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;this.PositionColor=g_JSChartResource.Title.PositionColor;//持仓
6013
+ };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)//是否点击了指标标题
6011
6014
  {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 _value2=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(_value2,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;};//多变量输出
6012
- 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(!dataInfo.GetItemCallback)return null;if(!dataInfo.Data||!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Data.Data))return null;var kItem=dataInfo.Data.Data[dataIndex];if(!kItem)return null;var group=dataInfo.GetItemCallback(kItem);if(!group||!IFrameSplitOperator.IsNonEmptyArray(group.Data))return null;var aryText=[];for(var i=0;i<group.Data.length;++i){var item=group.Data[i];var config=item.ColorConfig;var color=null;if(config.BGColor)color=config.BGColor;else if(config.Color)color=config.Color;if(config.Name)aryText.push({Text:config.Name+':',Color:color});var value=item.Data.Value;if(IFrameSplitOperator.IsString(item.Data.Value))value=ChartData.GetKValue(kItem,item.Data.Value);aryText.push({Text:this.FormatValue(value,dataInfo),Color:color});}if(!IFrameSplitOperator.IsNonEmptyArray(aryText))return null;return aryText;};this.ForamtMultiBarTitle=function(dataIndex,dataInfo){if(!dataInfo.GetItemCallback)return null;if(!dataInfo.Data||!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Data.Data))return null;var kItem=dataInfo.Data.Data[dataIndex];if(!kItem)return null;var group=dataInfo.GetItemCallback(kItem);if(!group||!IFrameSplitOperator.IsNonEmptyArray(group.Data))return null;var aryText=[];for(var i=0;i<group.Data.length;++i){var item=group.Data[i];var config=item.ColorConfig;var color=null;if(config.BGColor)color=config.BGColor;else if(config.Color)color=config.Color;if(config.Name)aryText.push({Text:config.Name+':',Color:color});var value=item.Data.Value;if(IFrameSplitOperator.IsString(item.Data.Value))value=ChartData.GetKValue(kItem,item.Data.Value);var value2=item.Data.Value2;if(IFrameSplitOperator.IsString(item.Data.Value2))value2=ChartData.GetKValue(kItem,item.Data.Value2);aryText.push({Text:'['+this.FormatValue(value,dataInfo)+', '+this.FormatValue(value2,dataInfo)+'] ',Color:color});}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;}//十字光标锁定状态 禁用显示最后一个数据
6015
+ 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.FromatKLineTitle=function(item,dataInfo){var defaultfloatPrecision=GetfloatPrecision(dataInfo.Symbol);//价格小数位数
6016
+ var upperSymbol="";if(dataInfo.Symbol)upperSymbol=dataInfo.Symbol.toUpperCase();var pixelRatio=GetDevicePixelRatio();var leftSpace=3*pixelRatio;var aryText=[];if(IFrameSplitOperator.IsNumber(item.Date)){var text=IFrameSplitOperator.FormatDateString(item.Date);aryText.push({Text:text,Color:this.DateTimeColor});}if(IFrameSplitOperator.IsNumber(item.Open)){var color=this.GetColor(item.Open,item.YClose);var text=g_JSChartLocalization.GetText('KTitle-Open',this.LanguageID)+item.Open.toFixed(defaultfloatPrecision);aryText.push({Text:text,Color:color,LeftSpace:leftSpace});}if(IFrameSplitOperator.IsNumber(item.High)){var color=this.GetColor(item.High,item.YClose);var text=g_JSChartLocalization.GetText('KTitle-High',this.LanguageID)+item.High.toFixed(defaultfloatPrecision);aryText.push({Text:text,Color:color,LeftSpace:leftSpace});}if(IFrameSplitOperator.IsNumber(item.Low)){var color=this.GetColor(item.Low,item.YClose);var text=g_JSChartLocalization.GetText('KTitle-Low',this.LanguageID)+item.Low.toFixed(defaultfloatPrecision);aryText.push({Text:text,Color:color,LeftSpace:leftSpace});}if(IFrameSplitOperator.IsNumber(item.Close)){var color=this.GetColor(item.Close,item.YClose);var text=g_JSChartLocalization.GetText('KTitle-Close',this.LanguageID)+item.Close.toFixed(defaultfloatPrecision);aryText.push({Text:text,Color:color,LeftSpace:leftSpace});}//涨幅
6017
+ if(item.YFClose>0&&MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol)){var value=(item.Close-item.YFClose)/item.YFClose*100;var color=this.GetColor(value,0);var text=g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID)+value.toFixed(2)+'%';aryText.push({Text:text,Color:color,LeftSpace:leftSpace});}else if(item.YClose>0){var value=(item.Close-item.YClose)/item.YClose*100;var color=this.GetColor(value,0);var text=g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID)+value.toFixed(2)+'%';aryText.push({Text:text,Color:color,LeftSpace:leftSpace});}if(IFrameSplitOperator.IsNumber(item.Vol))//成交量
6018
+ {var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);var vol=item.Vol/unit;var text=g_JSChartLocalization.GetText('KTitle-Vol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(vol,2,this.LanguageID);aryText.push({Text:text,Color:this.VolColor,LeftSpace:leftSpace});}if(IFrameSplitOperator.IsNumber(item.Amount))//成交金额
6019
+ {var text=g_JSChartLocalization.GetText('KTitle-Amount',this.LanguageID)+IFrameSplitOperator.FormatValueString(item.Amount,2,this.LanguageID);aryText.push({Text:text,Color:this.AmountColor,LeftSpace:leftSpace});}return aryText;};this.GetColor=function(price,yClose){if(!IFrameSplitOperator.IsNumber(yClose))return this.UnchangeColor;if(price>yClose)return this.UpColor;else if(price<yClose)return this.DownColor;else return this.UnchangeColor;};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(!dataInfo.GetItemCallback)return null;if(!dataInfo.Data||!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Data.Data))return null;var kItem=dataInfo.Data.Data[dataIndex];if(!kItem)return null;var group=dataInfo.GetItemCallback(kItem);if(!group||!IFrameSplitOperator.IsNonEmptyArray(group.Data))return null;var aryText=[];for(var i=0;i<group.Data.length;++i){var item=group.Data[i];var config=item.ColorConfig;var color=null;if(config.BGColor)color=config.BGColor;else if(config.Color)color=config.Color;if(config.Name)aryText.push({Text:config.Name+':',Color:color});var value=item.Data.Value;if(IFrameSplitOperator.IsString(item.Data.Value))value=ChartData.GetKValue(kItem,item.Data.Value);aryText.push({Text:this.FormatValue(value,dataInfo),Color:color});}if(!IFrameSplitOperator.IsNonEmptyArray(aryText))return null;return aryText;};this.ForamtMultiBarTitle=function(dataIndex,dataInfo){if(!dataInfo.GetItemCallback)return null;if(!dataInfo.Data||!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Data.Data))return null;var kItem=dataInfo.Data.Data[dataIndex];if(!kItem)return null;var group=dataInfo.GetItemCallback(kItem);if(!group||!IFrameSplitOperator.IsNonEmptyArray(group.Data))return null;var aryText=[];for(var i=0;i<group.Data.length;++i){var item=group.Data[i];var config=item.ColorConfig;var color=null;if(config.BGColor)color=config.BGColor;else if(config.Color)color=config.Color;if(config.Name)aryText.push({Text:config.Name+':',Color:color});var value=item.Data.Value;if(IFrameSplitOperator.IsString(item.Data.Value))value=ChartData.GetKValue(kItem,item.Data.Value);var value2=item.Data.Value2;if(IFrameSplitOperator.IsString(item.Data.Value2))value2=ChartData.GetKValue(kItem,item.Data.Value2);aryText.push({Text:'['+this.FormatValue(value,dataInfo)+', '+this.FormatValue(value2,dataInfo)+'] ',Color:color});}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;}//十字光标锁定状态 禁用显示最后一个数据
6013
6020
  if(this.GlobalOption&&this.GlobalOption.LockCorssCursor&&this.GlobalOption.LockCorssCursor.X.Enable)isShowLastData=false;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;//当前屏数据索引
6014
6021
  }var pixelTatio=GetDevicePixelRatio();var border=this.Frame.GetBorder();data.Left=border.LeftEx/pixelTatio;data.Top=border.Top/pixelTatio;data.Right=border.RightEx/pixelTatio;event.Callback(event,data,this);};this.IsSelectedChart=function(id){if(!id)return false;if(!this.SelectedChart)return false;if(!this.SelectedChart.Selected)return false;return this.SelectedChart.Selected.Identify==id;};this.Draw=function(moveonPoint,mouseStatus){this.Buttons=[];if(this.Frame.IsMinSize)return;this.IsKLineFrame=this.Frame.IsKLineFrame(false);this.IsMinuteFrame=this.Frame.IsMinuteFrame(false);this.IsDrawTitleBG=this.Frame.IsDrawTitleBG;this.IsShowNameArrow=this.Frame.IsShowNameArrow;this.IsShowUpDownArrow=this.Frame.IsShowTitleArrow;this.TitleArrowType=this.Frame.TitleArrowType;this.IsShowIndexName=this.Frame.IsShowIndexName;this.IsShowOverlayIndexName=this.Frame.IsShowOverlayIndexName;this.OverlayIndexType.Position=this.Frame.OverlayIndexType.Position;this.OverlayIndexType.LineSpace=this.Frame.OverlayIndexType.LineSpace;this.ParamSpace=this.Frame.IndexParamSpace;this.TitleSpace=this.Frame.IndexTitleSpace;this.TitleRect=null;this.GlobalOption=this.Frame.GlobalOption;this.OnDrawTitleEvent();if(this.Frame.IsShowIndexTitle==false)return;if(g_JSChartResource.IsDOMFrameTitle===true)return;if(!this.Data)return;if(this.Frame.ChartBorder.TitleHeight<5)return;if(this.CursorIndex==null&&!(this.GlobalOption&&this.GlobalOption.IsDisplayLatest))return;if(this.Frame.IsHScreen===true){this.Canvas.save();this.HScreenDraw();this.Canvas.restore();/* 测试用
6015
6022
  if (this.TitleRect)
@@ -6030,7 +6037,7 @@ var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线
6030
6037
  {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;//显示最后一个数据
6031
6038
  }else{var index=Math.abs(this.CursorIndex);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)return null;}if(item.DataType=="ChartMultiLine")//多线段数据
6032
6039
  {aryText=this.ForamtMultiLineTitle(dataIndex,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="ChartMultiPoint"){aryText=this.ForamtMultiPointTitle(dataIndex,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="ChartMultiBar"){aryText=this.ForamtMultiBarTitle(dataIndex,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}value=item.Data.Data[dataIndex];if(value==null&&item.ChartClassName=="ChartStepLine")//当前值无效,上一个值延续
6033
- {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))//外部挂接
6040
+ {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(item.DataType=="DRAWKLINE"){aryText=this.FromatKLineTitle(value,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(g_ScriptIndexChartFactory.Has(item.DataType))//外部挂接
6034
6041
  {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;}}if(item.DataType=="ChartBand")//默认不输出
6035
6042
  return null;var arrowSuper=null;//独立颜色
6036
6043
  if(this.IsShowUpDownArrow){var preValue=null;if(dataIndex-1>=0)preValue=item.Data.Data[dataIndex-1];if(IFrameSplitOperator.IsNumber(preValue)){if(preValue>value)arrowSuper={Text:'↓',TextColor:this.UpDownArrowConfig.DownColor};else if(preValue<value)arrowSuper={Text:'↑',TextColor:this.UpDownArrowConfig.UpColor};else arrowSuper={Text:'→',TextColor:this.UpDownArrowConfig.UnchangeColor};if(this.TitleArrowType==1)arrowSuper.TextColor=item.Color;}}valueText=this.FormatValue(value,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,valueText);if(dyValue)valueText=dyValue;}if(arrowSuper){var outItem={Name:null,Text:valueText,Color:item.Color,TextEx:[arrowSuper]};if(item.Name){var text=item.Name;var dyTitle=this.GetDynamicOutName(item.Name);//动态标题
@@ -11807,7 +11814,8 @@ chart.Identify=this.Guid;if(varItem.Color)chart.Color=this.GetColor(varItem.Colo
11807
11814
  {}else if(IFrameSplitOperator.IsString(varItem.Name)&&varItem.Name.indexOf("NOTEXT")==0)//标题中包含NOTEXT不绘制标题
11808
11815
  {}else{var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);hqChart.TitlePaint[titleIndex].Data[id]=titleData;this.SetTitleData(titleData,chart);}this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateBand=function(hqChart,windowIndex,varItem,id){var chart=new ChartBand();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.FirstColor=varItem.Draw.Color[0];chart.SecondColor=varItem.Draw.Color[1];chart.Data.Data=varItem.Draw.DrawData;if(IFrameSplitOperator.IsBool(varItem.IsFirstDraw))chart.IsDrawFirst=varItem.IsFirstDraw;var titleIndex=windowIndex+1;var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);titleData.DataType=chart.ClassName;titleData.ExtendData={Color:[chart.FirstColor,chart.SecondColor]};hqChart.TitlePaint[titleIndex].Data[id]=titleData;this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateFillRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartLineArea();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);hqChart.ChartPaint.push(chart);};this.CreateFillRGN2=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillRGN();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFillBGRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFillBGRGN();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateFLOATRGN=function(hqChart,windowIndex,varItem,id){var chart=new ChartFLOATRGN();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};//创建K线图
11809
11816
  this.CreateKLine=function(hqChart,windowIndex,varItem,id){var chart=new ChartKLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.Identify=this.Guid;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;chart.IsShowMaxMinPrice=false;chart.IsShowKTooltip=false;if(IFrameSplitOperator.IsNumber(varItem.KLineType))chart.DrawType=varItem.KLineType;if(varItem.Color)//如果设置了颜色,使用外面设置的颜色
11810
- chart.UnchagneColor=chart.DownColor=chart.UpColor=this.GetColor(varItem.Color);if(varItem.Draw.Config){var config=varItem.Draw.Config;if(IFrameSplitOperator.IsBool(config.IsShowMaxMinPrice))chart.IsShowMaxMinPrice=config.IsShowMaxMinPrice;if(IFrameSplitOperator.IsBool(config.IsShowKTooltip))chart.IsShowKTooltip=config.IsShowKTooltip;if(config.Symbol)chart.Symbol=config.Symbol;if(config.Name)chart.Title=config.Name;}this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateOverlayKLine=function(hqChart,windowIndex,varItem,id){var chart=null;if(hqChart.IsKLineContainer())chart=new ChartOverlayKLine();else if(hqChart.IsMinuteContainer())chart=new ChartOverlayMinutePriceLine();else return;chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.Identify=this.Guid;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);//如果设置了颜色,使用外面设置的颜色
11817
+ chart.UnchagneColor=chart.DownColor=chart.UpColor=this.GetColor(varItem.Color);if(varItem.Draw.Config){var config=varItem.Draw.Config;if(IFrameSplitOperator.IsBool(config.IsShowMaxMinPrice))chart.IsShowMaxMinPrice=config.IsShowMaxMinPrice;if(IFrameSplitOperator.IsBool(config.IsShowKTooltip))chart.IsShowKTooltip=config.IsShowKTooltip;if(config.Symbol)chart.Symbol=config.Symbol;if(config.Name)chart.Title=config.Name;}var bShowTitle=false;if(IFrameSplitOperator.IsBool(varItem.IsShowTitle))bShowTitle=varItem.IsShowTitle;if(bShowTitle){var titleIndex=windowIndex+1;var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);//标题
11818
+ titleData.DataType="DRAWKLINE";titleData.Symbol=chart.Symbol;hqChart.TitlePaint[titleIndex].Data[id]=titleData;}this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateOverlayKLine=function(hqChart,windowIndex,varItem,id){var chart=null;if(hqChart.IsKLineContainer())chart=new ChartOverlayKLine();else if(hqChart.IsMinuteContainer())chart=new ChartOverlayMinutePriceLine();else return;chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.Identify=this.Guid;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);//如果设置了颜色,使用外面设置的颜色
11811
11819
  else chart.Color=this.GetDefaultColor(id);chart.Data.Data=varItem.Draw.DrawData;chart.MainData=hqChart.ChartPaint[0].Data;//绑定K线
11812
11820
  hqChart.ChartPaint.push(chart);};this.CreateDrawColorKLine=function(hqChart,windowIndex,varItem,i){var chart=new ChartColorKline();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.DrawName="DRAWCOLORKLINE";chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data.Data=varItem.Draw.DrawData;if(IFrameSplitOperator.IsBool(varItem.Draw.IsEmptyBar))chart.IsEmptyBar=varItem.Draw.IsEmptyBar;if(varItem.Draw.Color)chart.Color=varItem.Draw.Color;hqChart.ChartPaint.push(chart);};this.CreatePolyLine=function(hqChart,windowIndex,varItem,id){var line=new ChartLine();line.Canvas=hqChart.Canvas;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.IsDotLine)line.IsDotLine=true;//虚线
11813
11821
  if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}var titleIndex=windowIndex+1;line.Data.Data=varItem.Draw.DrawData;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,' ',line.Color);//给一个空的标题
@@ -14355,7 +14363,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
14355
14363
  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);};}/********************************************************************************
14356
14364
  * 版本信息输出
14357
14365
  *
14358
- */var HQCHART_VERSION="1.1.14481";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
14366
+ */var HQCHART_VERSION="1.1.14483";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
14359
14367
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
14360
14368
  // BaseIndex:BaseIndex,
14361
14369
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14482",
3
+ "version": "1.1.14484",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -58350,7 +58350,8 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
58350
58350
  DrawType:"DRAWKLINE",
58351
58351
  DrawData:[],
58352
58352
  Config:{ IsShowMaxMinPrice:true, IsShowKTooltip:true, Symbol:"000001.sh", Name:"上证指数11" }
58353
- }
58353
+ },
58354
+ IsShowTitle:true,
58354
58355
  };
58355
58356
 
58356
58357
  var aryDate=[];
@@ -21336,6 +21336,17 @@ function ScriptIndex(name,script,args,option)
21336
21336
  if (config.Name) chart.Title=config.Name;
21337
21337
  }
21338
21338
 
21339
+ var bShowTitle=false;
21340
+ if (IFrameSplitOperator.IsBool(varItem.IsShowTitle)) bShowTitle=varItem.IsShowTitle;
21341
+ if (bShowTitle)
21342
+ {
21343
+ let titleIndex=windowIndex+1;
21344
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color); //标题
21345
+ titleData.DataType="DRAWKLINE";
21346
+ titleData.Symbol=chart.Symbol;
21347
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
21348
+ }
21349
+
21339
21350
  this.SetChartIndexName(chart);
21340
21351
  hqChart.ChartPaint.push(chart);
21341
21352
  }
@@ -57782,6 +57782,19 @@ function DynamicChartTitlePainting()
57782
57782
  DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,
57783
57783
  UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor
57784
57784
  };
57785
+
57786
+
57787
+ //K线标题颜色
57788
+ this.UpColor=g_JSChartResource.UpTextColor;
57789
+ this.DownColor=g_JSChartResource.DownTextColor;
57790
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
57791
+
57792
+ this.VolColor=g_JSChartResource.Title.VolColor;
57793
+ this.AmountColor=g_JSChartResource.Title.AmountColor;
57794
+ this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
57795
+ this.NameColor = g_JSChartResource.Title.NameColor;
57796
+ this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
57797
+
57785
57798
 
57786
57799
 
57787
57800
  //动态标题
@@ -57802,6 +57815,15 @@ function DynamicChartTitlePainting()
57802
57815
  this.BGColor=g_JSChartResource.IndexTitleBGColor;
57803
57816
  this.BGBorderColor=g_JSChartResource.IndexTitleBorderColor;
57804
57817
  this.BGBorderMoveOnColor=g_JSChartResource.IndexTitleBorderMoveOnColor;
57818
+
57819
+ this.UpColor=g_JSChartResource.UpTextColor;
57820
+ this.DownColor=g_JSChartResource.DownTextColor;
57821
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
57822
+
57823
+ this.VolColor=g_JSChartResource.Title.VolColor;
57824
+ this.AmountColor=g_JSChartResource.Title.AmountColor;
57825
+ this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
57826
+ this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
57805
57827
  }
57806
57828
 
57807
57829
  this.SetDynamicTitleData=function(outName, args, data)
@@ -58025,6 +58047,93 @@ function DynamicChartTitlePainting()
58025
58047
  return aryText;
58026
58048
  }
58027
58049
 
58050
+ this.FromatKLineTitle=function(item, dataInfo)
58051
+ {
58052
+ var defaultfloatPrecision=GetfloatPrecision(dataInfo.Symbol);//价格小数位数
58053
+ var upperSymbol="";
58054
+ if (dataInfo.Symbol) upperSymbol=dataInfo.Symbol.toUpperCase();
58055
+ var pixelRatio=GetDevicePixelRatio();
58056
+ var leftSpace=3*pixelRatio;
58057
+
58058
+ var aryText=[];
58059
+
58060
+
58061
+ if (IFrameSplitOperator.IsNumber(item.Date))
58062
+ {
58063
+ var text=IFrameSplitOperator.FormatDateString(item.Date);
58064
+ aryText.push({ Text:text, Color:this.DateTimeColor });
58065
+ }
58066
+
58067
+ if (IFrameSplitOperator.IsNumber(item.Open))
58068
+ {
58069
+ var color=this.GetColor(item.Open,item.YClose);
58070
+ var text=g_JSChartLocalization.GetText('KTitle-Open',this.LanguageID)+item.Open.toFixed(defaultfloatPrecision);
58071
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
58072
+ }
58073
+
58074
+ if (IFrameSplitOperator.IsNumber(item.High))
58075
+ {
58076
+ var color=this.GetColor(item.High,item.YClose);
58077
+ var text=g_JSChartLocalization.GetText('KTitle-High',this.LanguageID)+item.High.toFixed(defaultfloatPrecision);
58078
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace });
58079
+ }
58080
+
58081
+ if (IFrameSplitOperator.IsNumber(item.Low))
58082
+ {
58083
+ var color=this.GetColor(item.Low,item.YClose);
58084
+ var text=g_JSChartLocalization.GetText('KTitle-Low',this.LanguageID)+item.Low.toFixed(defaultfloatPrecision);
58085
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
58086
+ }
58087
+
58088
+ if (IFrameSplitOperator.IsNumber(item.Close))
58089
+ {
58090
+ var color=this.GetColor(item.Close,item.YClose);
58091
+ var text=g_JSChartLocalization.GetText('KTitle-Close',this.LanguageID)+item.Close.toFixed(defaultfloatPrecision);
58092
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
58093
+ }
58094
+
58095
+ //涨幅
58096
+ if (item.YFClose>0 && MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol))
58097
+ {
58098
+ var value=(item.Close-item.YFClose)/item.YFClose*100;
58099
+ var color = this.GetColor(value, 0);
58100
+ var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
58101
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
58102
+ }
58103
+ else if (item.YClose>0)
58104
+ {
58105
+ var value=(item.Close-item.YClose)/item.YClose*100;
58106
+ var color = this.GetColor(value, 0);
58107
+ var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
58108
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
58109
+ }
58110
+
58111
+ if (IFrameSplitOperator.IsNumber(item.Vol)) //成交量
58112
+ {
58113
+ var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);
58114
+ var vol=item.Vol/unit;
58115
+ var text=g_JSChartLocalization.GetText('KTitle-Vol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(vol,2,this.LanguageID);
58116
+ aryText.push({ Text:text, Color:this.VolColor, LeftSpace:leftSpace});
58117
+ }
58118
+
58119
+ if (IFrameSplitOperator.IsNumber(item.Amount)) //成交金额
58120
+ {
58121
+ var text=g_JSChartLocalization.GetText('KTitle-Amount',this.LanguageID)+IFrameSplitOperator.FormatValueString(item.Amount,2,this.LanguageID);
58122
+ aryText.push({ Text:text, Color:this.AmountColor, LeftSpace:leftSpace});
58123
+ }
58124
+
58125
+ return aryText;
58126
+ }
58127
+
58128
+ this.GetColor=function(price,yClose)
58129
+ {
58130
+ if (!IFrameSplitOperator.IsNumber(yClose)) return this.UnchangeColor;
58131
+
58132
+ if(price>yClose) return this.UpColor;
58133
+ else if (price<yClose) return this.DownColor;
58134
+ else return this.UnchangeColor;
58135
+ }
58136
+
58028
58137
  this.ForamtMultiLineTitle=function(dataIndex, dataInfo)
58029
58138
  {
58030
58139
  if (!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Lines)) return null;
@@ -58510,6 +58619,12 @@ function DynamicChartTitlePainting()
58510
58619
  if (!aryText) return null;
58511
58620
  return { Text:null, ArrayText:aryText };
58512
58621
  }
58622
+ else if (item.DataType=="DRAWKLINE")
58623
+ {
58624
+ aryText=this.FromatKLineTitle(value, item);
58625
+ if (!aryText) return null;
58626
+ return { Text:null, ArrayText:aryText };
58627
+ }
58513
58628
  else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
58514
58629
  {
58515
58630
  var find=g_ScriptIndexChartFactory.Get(item.DataType);
@@ -2836,7 +2836,8 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
2836
2836
  DrawType:"DRAWKLINE",
2837
2837
  DrawData:[],
2838
2838
  Config:{ IsShowMaxMinPrice:true, IsShowKTooltip:true, Symbol:"000001.sh", Name:"上证指数11" }
2839
- }
2839
+ },
2840
+ IsShowTitle:true,
2840
2841
  };
2841
2842
 
2842
2843
  var aryDate=[];
@@ -61707,6 +61707,19 @@ function DynamicChartTitlePainting()
61707
61707
  DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,
61708
61708
  UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor
61709
61709
  };
61710
+
61711
+
61712
+ //K线标题颜色
61713
+ this.UpColor=g_JSChartResource.UpTextColor;
61714
+ this.DownColor=g_JSChartResource.DownTextColor;
61715
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
61716
+
61717
+ this.VolColor=g_JSChartResource.Title.VolColor;
61718
+ this.AmountColor=g_JSChartResource.Title.AmountColor;
61719
+ this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
61720
+ this.NameColor = g_JSChartResource.Title.NameColor;
61721
+ this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
61722
+
61710
61723
 
61711
61724
 
61712
61725
  //动态标题
@@ -61727,6 +61740,15 @@ function DynamicChartTitlePainting()
61727
61740
  this.BGColor=g_JSChartResource.IndexTitleBGColor;
61728
61741
  this.BGBorderColor=g_JSChartResource.IndexTitleBorderColor;
61729
61742
  this.BGBorderMoveOnColor=g_JSChartResource.IndexTitleBorderMoveOnColor;
61743
+
61744
+ this.UpColor=g_JSChartResource.UpTextColor;
61745
+ this.DownColor=g_JSChartResource.DownTextColor;
61746
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
61747
+
61748
+ this.VolColor=g_JSChartResource.Title.VolColor;
61749
+ this.AmountColor=g_JSChartResource.Title.AmountColor;
61750
+ this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
61751
+ this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
61730
61752
  }
61731
61753
 
61732
61754
  this.SetDynamicTitleData=function(outName, args, data)
@@ -61950,6 +61972,93 @@ function DynamicChartTitlePainting()
61950
61972
  return aryText;
61951
61973
  }
61952
61974
 
61975
+ this.FromatKLineTitle=function(item, dataInfo)
61976
+ {
61977
+ var defaultfloatPrecision=GetfloatPrecision(dataInfo.Symbol);//价格小数位数
61978
+ var upperSymbol="";
61979
+ if (dataInfo.Symbol) upperSymbol=dataInfo.Symbol.toUpperCase();
61980
+ var pixelRatio=GetDevicePixelRatio();
61981
+ var leftSpace=3*pixelRatio;
61982
+
61983
+ var aryText=[];
61984
+
61985
+
61986
+ if (IFrameSplitOperator.IsNumber(item.Date))
61987
+ {
61988
+ var text=IFrameSplitOperator.FormatDateString(item.Date);
61989
+ aryText.push({ Text:text, Color:this.DateTimeColor });
61990
+ }
61991
+
61992
+ if (IFrameSplitOperator.IsNumber(item.Open))
61993
+ {
61994
+ var color=this.GetColor(item.Open,item.YClose);
61995
+ var text=g_JSChartLocalization.GetText('KTitle-Open',this.LanguageID)+item.Open.toFixed(defaultfloatPrecision);
61996
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
61997
+ }
61998
+
61999
+ if (IFrameSplitOperator.IsNumber(item.High))
62000
+ {
62001
+ var color=this.GetColor(item.High,item.YClose);
62002
+ var text=g_JSChartLocalization.GetText('KTitle-High',this.LanguageID)+item.High.toFixed(defaultfloatPrecision);
62003
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace });
62004
+ }
62005
+
62006
+ if (IFrameSplitOperator.IsNumber(item.Low))
62007
+ {
62008
+ var color=this.GetColor(item.Low,item.YClose);
62009
+ var text=g_JSChartLocalization.GetText('KTitle-Low',this.LanguageID)+item.Low.toFixed(defaultfloatPrecision);
62010
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62011
+ }
62012
+
62013
+ if (IFrameSplitOperator.IsNumber(item.Close))
62014
+ {
62015
+ var color=this.GetColor(item.Close,item.YClose);
62016
+ var text=g_JSChartLocalization.GetText('KTitle-Close',this.LanguageID)+item.Close.toFixed(defaultfloatPrecision);
62017
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62018
+ }
62019
+
62020
+ //涨幅
62021
+ if (item.YFClose>0 && MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol))
62022
+ {
62023
+ var value=(item.Close-item.YFClose)/item.YFClose*100;
62024
+ var color = this.GetColor(value, 0);
62025
+ var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
62026
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62027
+ }
62028
+ else if (item.YClose>0)
62029
+ {
62030
+ var value=(item.Close-item.YClose)/item.YClose*100;
62031
+ var color = this.GetColor(value, 0);
62032
+ var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
62033
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62034
+ }
62035
+
62036
+ if (IFrameSplitOperator.IsNumber(item.Vol)) //成交量
62037
+ {
62038
+ var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);
62039
+ var vol=item.Vol/unit;
62040
+ var text=g_JSChartLocalization.GetText('KTitle-Vol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(vol,2,this.LanguageID);
62041
+ aryText.push({ Text:text, Color:this.VolColor, LeftSpace:leftSpace});
62042
+ }
62043
+
62044
+ if (IFrameSplitOperator.IsNumber(item.Amount)) //成交金额
62045
+ {
62046
+ var text=g_JSChartLocalization.GetText('KTitle-Amount',this.LanguageID)+IFrameSplitOperator.FormatValueString(item.Amount,2,this.LanguageID);
62047
+ aryText.push({ Text:text, Color:this.AmountColor, LeftSpace:leftSpace});
62048
+ }
62049
+
62050
+ return aryText;
62051
+ }
62052
+
62053
+ this.GetColor=function(price,yClose)
62054
+ {
62055
+ if (!IFrameSplitOperator.IsNumber(yClose)) return this.UnchangeColor;
62056
+
62057
+ if(price>yClose) return this.UpColor;
62058
+ else if (price<yClose) return this.DownColor;
62059
+ else return this.UnchangeColor;
62060
+ }
62061
+
61953
62062
  this.ForamtMultiLineTitle=function(dataIndex, dataInfo)
61954
62063
  {
61955
62064
  if (!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Lines)) return null;
@@ -62435,6 +62544,12 @@ function DynamicChartTitlePainting()
62435
62544
  if (!aryText) return null;
62436
62545
  return { Text:null, ArrayText:aryText };
62437
62546
  }
62547
+ else if (item.DataType=="DRAWKLINE")
62548
+ {
62549
+ aryText=this.FromatKLineTitle(value, item);
62550
+ if (!aryText) return null;
62551
+ return { Text:null, ArrayText:aryText };
62552
+ }
62438
62553
  else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
62439
62554
  {
62440
62555
  var find=g_ScriptIndexChartFactory.Get(item.DataType);
@@ -123558,6 +123673,17 @@ function ScriptIndex(name,script,args,option)
123558
123673
  if (config.Name) chart.Title=config.Name;
123559
123674
  }
123560
123675
 
123676
+ var bShowTitle=false;
123677
+ if (IFrameSplitOperator.IsBool(varItem.IsShowTitle)) bShowTitle=varItem.IsShowTitle;
123678
+ if (bShowTitle)
123679
+ {
123680
+ let titleIndex=windowIndex+1;
123681
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color); //标题
123682
+ titleData.DataType="DRAWKLINE";
123683
+ titleData.Symbol=chart.Symbol;
123684
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
123685
+ }
123686
+
123561
123687
  this.SetChartIndexName(chart);
123562
123688
  hqChart.ChartPaint.push(chart);
123563
123689
  }
@@ -143923,7 +144049,7 @@ function ScrollBarBGChart()
143923
144049
 
143924
144050
 
143925
144051
 
143926
- var HQCHART_VERSION="1.1.14481";
144052
+ var HQCHART_VERSION="1.1.14483";
143927
144053
 
143928
144054
  function PrintHQChartVersion()
143929
144055
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14481";
8
+ var HQCHART_VERSION="1.1.14483";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -58368,7 +58368,8 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
58368
58368
  DrawType:"DRAWKLINE",
58369
58369
  DrawData:[],
58370
58370
  Config:{ IsShowMaxMinPrice:true, IsShowKTooltip:true, Symbol:"000001.sh", Name:"上证指数11" }
58371
- }
58371
+ },
58372
+ IsShowTitle:true,
58372
58373
  };
58373
58374
 
58374
58375
  var aryDate=[];
@@ -61751,6 +61751,19 @@ function DynamicChartTitlePainting()
61751
61751
  DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,
61752
61752
  UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor
61753
61753
  };
61754
+
61755
+
61756
+ //K线标题颜色
61757
+ this.UpColor=g_JSChartResource.UpTextColor;
61758
+ this.DownColor=g_JSChartResource.DownTextColor;
61759
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
61760
+
61761
+ this.VolColor=g_JSChartResource.Title.VolColor;
61762
+ this.AmountColor=g_JSChartResource.Title.AmountColor;
61763
+ this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
61764
+ this.NameColor = g_JSChartResource.Title.NameColor;
61765
+ this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
61766
+
61754
61767
 
61755
61768
 
61756
61769
  //动态标题
@@ -61771,6 +61784,15 @@ function DynamicChartTitlePainting()
61771
61784
  this.BGColor=g_JSChartResource.IndexTitleBGColor;
61772
61785
  this.BGBorderColor=g_JSChartResource.IndexTitleBorderColor;
61773
61786
  this.BGBorderMoveOnColor=g_JSChartResource.IndexTitleBorderMoveOnColor;
61787
+
61788
+ this.UpColor=g_JSChartResource.UpTextColor;
61789
+ this.DownColor=g_JSChartResource.DownTextColor;
61790
+ this.UnchangeColor=g_JSChartResource.UnchagneTextColor;
61791
+
61792
+ this.VolColor=g_JSChartResource.Title.VolColor;
61793
+ this.AmountColor=g_JSChartResource.Title.AmountColor;
61794
+ this.DateTimeColor=g_JSChartResource.Title.DateTimeColor;
61795
+ this.PositionColor=g_JSChartResource.Title.PositionColor; //持仓
61774
61796
  }
61775
61797
 
61776
61798
  this.SetDynamicTitleData=function(outName, args, data)
@@ -61994,6 +62016,93 @@ function DynamicChartTitlePainting()
61994
62016
  return aryText;
61995
62017
  }
61996
62018
 
62019
+ this.FromatKLineTitle=function(item, dataInfo)
62020
+ {
62021
+ var defaultfloatPrecision=GetfloatPrecision(dataInfo.Symbol);//价格小数位数
62022
+ var upperSymbol="";
62023
+ if (dataInfo.Symbol) upperSymbol=dataInfo.Symbol.toUpperCase();
62024
+ var pixelRatio=GetDevicePixelRatio();
62025
+ var leftSpace=3*pixelRatio;
62026
+
62027
+ var aryText=[];
62028
+
62029
+
62030
+ if (IFrameSplitOperator.IsNumber(item.Date))
62031
+ {
62032
+ var text=IFrameSplitOperator.FormatDateString(item.Date);
62033
+ aryText.push({ Text:text, Color:this.DateTimeColor });
62034
+ }
62035
+
62036
+ if (IFrameSplitOperator.IsNumber(item.Open))
62037
+ {
62038
+ var color=this.GetColor(item.Open,item.YClose);
62039
+ var text=g_JSChartLocalization.GetText('KTitle-Open',this.LanguageID)+item.Open.toFixed(defaultfloatPrecision);
62040
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62041
+ }
62042
+
62043
+ if (IFrameSplitOperator.IsNumber(item.High))
62044
+ {
62045
+ var color=this.GetColor(item.High,item.YClose);
62046
+ var text=g_JSChartLocalization.GetText('KTitle-High',this.LanguageID)+item.High.toFixed(defaultfloatPrecision);
62047
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace });
62048
+ }
62049
+
62050
+ if (IFrameSplitOperator.IsNumber(item.Low))
62051
+ {
62052
+ var color=this.GetColor(item.Low,item.YClose);
62053
+ var text=g_JSChartLocalization.GetText('KTitle-Low',this.LanguageID)+item.Low.toFixed(defaultfloatPrecision);
62054
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62055
+ }
62056
+
62057
+ if (IFrameSplitOperator.IsNumber(item.Close))
62058
+ {
62059
+ var color=this.GetColor(item.Close,item.YClose);
62060
+ var text=g_JSChartLocalization.GetText('KTitle-Close',this.LanguageID)+item.Close.toFixed(defaultfloatPrecision);
62061
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62062
+ }
62063
+
62064
+ //涨幅
62065
+ if (item.YFClose>0 && MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol))
62066
+ {
62067
+ var value=(item.Close-item.YFClose)/item.YFClose*100;
62068
+ var color = this.GetColor(value, 0);
62069
+ var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
62070
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62071
+ }
62072
+ else if (item.YClose>0)
62073
+ {
62074
+ var value=(item.Close-item.YClose)/item.YClose*100;
62075
+ var color = this.GetColor(value, 0);
62076
+ var text = g_JSChartLocalization.GetText('KTitle-Increase',this.LanguageID) + value.toFixed(2)+'%';
62077
+ aryText.push({ Text:text, Color:color, LeftSpace:leftSpace});
62078
+ }
62079
+
62080
+ if (IFrameSplitOperator.IsNumber(item.Vol)) //成交量
62081
+ {
62082
+ var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);
62083
+ var vol=item.Vol/unit;
62084
+ var text=g_JSChartLocalization.GetText('KTitle-Vol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(vol,2,this.LanguageID);
62085
+ aryText.push({ Text:text, Color:this.VolColor, LeftSpace:leftSpace});
62086
+ }
62087
+
62088
+ if (IFrameSplitOperator.IsNumber(item.Amount)) //成交金额
62089
+ {
62090
+ var text=g_JSChartLocalization.GetText('KTitle-Amount',this.LanguageID)+IFrameSplitOperator.FormatValueString(item.Amount,2,this.LanguageID);
62091
+ aryText.push({ Text:text, Color:this.AmountColor, LeftSpace:leftSpace});
62092
+ }
62093
+
62094
+ return aryText;
62095
+ }
62096
+
62097
+ this.GetColor=function(price,yClose)
62098
+ {
62099
+ if (!IFrameSplitOperator.IsNumber(yClose)) return this.UnchangeColor;
62100
+
62101
+ if(price>yClose) return this.UpColor;
62102
+ else if (price<yClose) return this.DownColor;
62103
+ else return this.UnchangeColor;
62104
+ }
62105
+
61997
62106
  this.ForamtMultiLineTitle=function(dataIndex, dataInfo)
61998
62107
  {
61999
62108
  if (!IFrameSplitOperator.IsNonEmptyArray(dataInfo.Lines)) return null;
@@ -62479,6 +62588,12 @@ function DynamicChartTitlePainting()
62479
62588
  if (!aryText) return null;
62480
62589
  return { Text:null, ArrayText:aryText };
62481
62590
  }
62591
+ else if (item.DataType=="DRAWKLINE")
62592
+ {
62593
+ aryText=this.FromatKLineTitle(value, item);
62594
+ if (!aryText) return null;
62595
+ return { Text:null, ArrayText:aryText };
62596
+ }
62482
62597
  else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
62483
62598
  {
62484
62599
  var find=g_ScriptIndexChartFactory.Get(item.DataType);
@@ -123602,6 +123717,17 @@ function ScriptIndex(name,script,args,option)
123602
123717
  if (config.Name) chart.Title=config.Name;
123603
123718
  }
123604
123719
 
123720
+ var bShowTitle=false;
123721
+ if (IFrameSplitOperator.IsBool(varItem.IsShowTitle)) bShowTitle=varItem.IsShowTitle;
123722
+ if (bShowTitle)
123723
+ {
123724
+ let titleIndex=windowIndex+1;
123725
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color); //标题
123726
+ titleData.DataType="DRAWKLINE";
123727
+ titleData.Symbol=chart.Symbol;
123728
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
123729
+ }
123730
+
123605
123731
  this.SetChartIndexName(chart);
123606
123732
  hqChart.ChartPaint.push(chart);
123607
123733
  }
@@ -153743,7 +153869,7 @@ function HQChartScriptWorker()
153743
153869
 
153744
153870
 
153745
153871
 
153746
- var HQCHART_VERSION="1.1.14481";
153872
+ var HQCHART_VERSION="1.1.14483";
153747
153873
 
153748
153874
  function PrintHQChartVersion()
153749
153875
  {