hqchart 1.1.14190 → 1.1.14197

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.
@@ -1175,8 +1175,8 @@ option.CorssCursor={};option.CorssCursor.TitleHeight=chart.ChartCorssCursor.Text
1175
1175
  }if(item.IsShowRightText===false||item.IsShowRightText===true){chart.Frame.SubFrame[i].Frame.IsShowYText[1]=item.IsShowRightText;chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowRightText=item.IsShowRightText;//显示右边刻度
1176
1176
  }if(item.TopSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.TopSpace=item.TopSpace*pixelRatio;if(item.BottomSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.BottomSpace=item.BottomSpace*pixelRatio;if(item.RightTextPosition>0)chart.Frame.SubFrame[i].Frame.YTextPosition[1]=item.RightTextPosition;if(item.LeftTextPosition>0)chart.Frame.SubFrame[i].Frame.YTextPosition[0]=item.LeftTextPosition;if(item.IsShowXLine==false)chart.Frame.SubFrame[i].Frame.IsShowXLine=item.IsShowXLine;if(item.IsShowYLine==false)chart.Frame.SubFrame[i].Frame.IsShowYLine=item.IsShowYLine;if(IFrameSplitOperator.IsNumber(item.YTextBaseline))chart.Frame.SubFrame[i].Frame.YTextBaseline=item.YTextBaseline;if(item.YCoordinateType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=item.YCoordinateType;if(item.IsYReverse==true)chart.Frame.SubFrame[0].Frame.CoordinateType=1;//反转坐标
1177
1177
  if(IFrameSplitOperator.IsNumber(item.PercentageTextFormat))subFrame.YSplitOperator.PercentageTextFormat=item.PercentageTextFormat;//百分比坐标格式
1178
- if(item.DefaultYMaxMin)chart.Frame.SubFrame[i].Frame.YSplitOperator.DefaultYMaxMin=item.DefaultYMaxMin;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsPlusNumber(item.MinYDistance))chart.Frame.SubFrame[i].Frame.MinYDistance=item.MinYDistance;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(item.IsDrawTitleBottomLine))subFrame.IsDrawTitleBottomLine=item.IsDrawTitleBottomLine;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;if(item.ClientBGColor)subFrame.ClientBGColor=item.ClientBGColor;}}if(option.KLine){var item=option.KLine;var klineChart=chart.ChartPaint[0];if(option.KLine.ShowKLine==false)klineChart.IsShow=false;if(option.KLine.InfoPosition>0)klineChart.InfoPosition=option.KLine.InfoPosition;if(IFrameSplitOperator.IsBool(item.IsShowMaxMinPrice))klineChart.IsShowMaxMinPrice=item.IsShowMaxMinPrice;if(IFrameSplitOperator.IsNumber(item.OneLimitBarType))klineChart.OneLimitBarType=item.OneLimitBarType;if(item.PriceGap){if(IFrameSplitOperator.IsBool(item.PriceGap.Enable))klineChart.PriceGap.Enable=item.PriceGap.Enable;if(IFrameSplitOperator.IsNumber(item.PriceGap.Count))klineChart.PriceGap.Count=item.PriceGap.Count;}}if(option.KLineTitle){var item=option.KLineTitle;var chartTitle=chart.TitlePaint[0];if(option.KLineTitle.IsShowName==false)chart.TitlePaint[0].IsShowName=false;if(option.KLineTitle.IsShowSettingInfo==false)chart.TitlePaint[0].IsShowSettingInfo=false;if(option.KLineTitle.IsShow==false)chart.TitlePaint[0].IsShow=false;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(item.ShowPostion)//显示位置高级配置
1179
- {var subItem=item.ShowPostion;if(!chartTitle.ShowPositionConfig)chartTitle.ShowPositionConfig={Margin:{}};if(IFrameSplitOperator.IsNumber(subItem.Type))chartTitle.ShowPositionConfig.Type=subItem.Type;if(subItem.Margin){if(IFrameSplitOperator.IsNumber(subItem.Margin.Left))chartTitle.ShowPositionConfig.Margin.Left=subItem.Margin.Left;if(IFrameSplitOperator.IsNumber(subItem.Margin.Right))chartTitle.ShowPositionConfig.Margin.Right=subItem.Margin.Right;if(IFrameSplitOperator.IsNumber(subItem.Margin.Bottom))chartTitle.ShowPositionConfig.Margin.Bottom=subItem.Margin.Bottom;}}}//叠加股票
1178
+ if(item.DefaultYMaxMin)chart.Frame.SubFrame[i].Frame.YSplitOperator.DefaultYMaxMin=item.DefaultYMaxMin;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsPlusNumber(item.MinYDistance))chart.Frame.SubFrame[i].Frame.MinYDistance=item.MinYDistance;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(IFrameSplitOperator.IsBool(item.IsDrawTitleBottomLine))subFrame.IsDrawTitleBottomLine=item.IsDrawTitleBottomLine;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;if(item.ClientBGColor)subFrame.ClientBGColor=item.ClientBGColor;}}if(option.KLine){var item=option.KLine;var klineChart=chart.ChartPaint[0];if(option.KLine.ShowKLine==false)klineChart.IsShow=false;if(option.KLine.InfoPosition>0)klineChart.InfoPosition=option.KLine.InfoPosition;if(IFrameSplitOperator.IsBool(item.IsShowMaxMinPrice))klineChart.IsShowMaxMinPrice=item.IsShowMaxMinPrice;if(IFrameSplitOperator.IsNumber(item.OneLimitBarType))klineChart.OneLimitBarType=item.OneLimitBarType;if(item.PriceGap){if(IFrameSplitOperator.IsBool(item.PriceGap.Enable))klineChart.PriceGap.Enable=item.PriceGap.Enable;if(IFrameSplitOperator.IsNumber(item.PriceGap.Count))klineChart.PriceGap.Count=item.PriceGap.Count;}}if(option.KLineTitle){var item=option.KLineTitle;var chartTitle=chart.TitlePaint[0];if(option.KLineTitle.IsShowName==false)chart.TitlePaint[0].IsShowName=false;if(option.KLineTitle.IsShowSettingInfo==false)chart.TitlePaint[0].IsShowSettingInfo=false;if(option.KLineTitle.IsShow==false)chart.TitlePaint[0].IsShow=false;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(item.ShowPosition||item.ShowPostion)//显示位置高级配置
1179
+ {var subItem=item.ShowPostion;if(item.ShowPosition)subItem=item.ShowPosition;if(!chartTitle.ShowPositionConfig)chartTitle.ShowPositionConfig={Margin:{}};if(IFrameSplitOperator.IsNumber(subItem.Type))chartTitle.ShowPositionConfig.Type=subItem.Type;if(subItem.Margin){if(IFrameSplitOperator.IsNumber(subItem.Margin.Left))chartTitle.ShowPositionConfig.Margin.Left=subItem.Margin.Left;if(IFrameSplitOperator.IsNumber(subItem.Margin.Right))chartTitle.ShowPositionConfig.Margin.Right=subItem.Margin.Right;if(IFrameSplitOperator.IsNumber(subItem.Margin.Bottom))chartTitle.ShowPositionConfig.Margin.Bottom=subItem.Margin.Bottom;}}}//叠加股票
1180
1180
  if(option.Overlay){for(var i=0;i<option.Overlay.length;++i){var item=option.Overlay[i];chart.OverlaySymbol(item.Symbol,item);}}if(option.ExtendChart){for(var i=0;i<option.ExtendChart.length;++i){var item=option.ExtendChart[i];chart.CreateExtendChart(item.Name,item);}}//创建子窗口的指标
1181
1181
  var scriptData=new JSIndexScript();if(option.ColorIndex)//五彩K线
1182
1182
  {var item=option.ColorIndex;var indexInfo=scriptData.Get(item.Index);if(indexInfo){indexInfo.ID=item.Index;chart.ColorIndex=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
@@ -1215,8 +1215,8 @@ if(IFrameSplitOperator.IsBool(option.CorssCursorInfo.IsFixXLastTime))chart.Chart
1215
1215
  }if(item.Height>=0)chart.Frame.SubFrame[i].Height=item.Height;if(item.Custom)chart.Frame.SubFrame[i].Frame.YSplitOperator.Custom=item.Custom;if(item.RightTextFormat>0)chart.Frame.SubFrame[i].Frame.YSplitOperator.RightTextFormat=item.RightTextFormat;if(IFrameSplitOperator.IsNumber(item.TitleHeight))chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsNumber(item.FloatPrecision))chart.Frame.SubFrame[i].Frame.YSplitOperator.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsBool(item.IsShowXLine))chart.Frame.SubFrame[i].Frame.IsShowXLine=item.IsShowXLine;if(IFrameSplitOperator.IsBool(item.IsShowYLine))chart.Frame.SubFrame[i].Frame.IsShowYLine=item.IsShowYLine;if(IFrameSplitOperator.IsNumber(item.YTextBaseline))chart.Frame.SubFrame[i].Frame.YTextBaseline=item.YTextBaseline;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(item.TopSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.TopSpace=item.TopSpace*pixelRatio;if(item.BottomSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.BottomSpace=item.BottomSpace*pixelRatio;//是否显示关闭集合竞价按钮
1216
1216
  if(IFrameSplitOperator.IsNumber(item.CloseBeforeButton))chart.Frame.SubFrame[i].Frame.IsShowCloseButton=item.CloseBeforeButton;if(item.ClientBGColor)subFrame.ClientBGColor=item.ClientBGColor;if(!IFrameSplitOperator.IsUndefined(item.HorizontalReserved))subFrame.HorizontalReserved=item.HorizontalReserved;}chart.UpdateXShowText();}if(option.ExtendChart){for(var i=0;i<option.ExtendChart.length;++i){var item=option.ExtendChart[i];chart.CreateExtendChart(item.Name,item);}}//叠加股票
1217
1217
  if(option.Overlay){for(var i=0;i<option.Overlay.length;++i){var item=option.Overlay[i];chart.OverlaySymbol(item.Symbol,item);}}if(option.MinuteLine){if(option.MinuteLine.IsDrawAreaPrice==false)chart.ChartPaint[0].IsDrawArea=false;if(option.MinuteLine.IsShowLead==false)chart.IsShowLead=false;if(option.MinuteLine.IsShowAveragePrice==false){chart.ChartPaint[1].IsShow=false;chart.TitlePaint[0].IsShowAveragePrice=false;//标题栏均线也不显示
1218
- for(var i=0;i<chart.ExtendChartPaint.length;++i){var item=chart.ExtendChartPaint[i];if(item.ClassName=="MinuteTooltipPaint")item.IsShowAveragePrice=false;}}if(option.MinuteLine.SplitType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.SplitType=option.MinuteLine.SplitType;}if(option.MinuteVol){var item=option.MinuteVol;if(IFrameSplitOperator.IsNumber(item.BarColorType))chart.ChartPaint[2].BarColorType=item.BarColorType;}if(option.MinuteTitle){var item=option.MinuteTitle;var chartTitle=chart.TitlePaint[0];if(IFrameSplitOperator.IsBool(item.IsShowName))chart.TitlePaint[0].IsShowName=item.IsShowName;if(IFrameSplitOperator.IsBool(item.IsShowDate))chart.TitlePaint[0].IsShowDate=item.IsShowDate;if(IFrameSplitOperator.IsBool(item.IsShowTime))chart.TitlePaint[0].IsShowTime=item.IsShowTime;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData))chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat))chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;if(item.TimeFormat)chart.TitlePaint[0].TimeFormat=item.TimeFormat;if(item.ShowPostion)//显示位置高级配置
1219
- {var subItem=item.ShowPostion;if(!chartTitle.ShowPositionConfig)chartTitle.ShowPositionConfig={Margin:{}};if(IFrameSplitOperator.IsNumber(subItem.Type))chartTitle.ShowPositionConfig.Type=subItem.Type;if(subItem.Margin){if(IFrameSplitOperator.IsNumber(subItem.Margin.Left))chartTitle.ShowPositionConfig.Margin.Left=subItem.Margin.Left;if(IFrameSplitOperator.IsNumber(subItem.Margin.Right))chartTitle.ShowPositionConfig.Margin.Right=subItem.Margin.Right;if(IFrameSplitOperator.IsNumber(subItem.Margin.Bottom))chartTitle.ShowPositionConfig.Margin.Bottom=subItem.Margin.Bottom;}}}if(IFrameSplitOperator.IsBool(option.CorssCursorTouchEnd))chart.CorssCursorTouchEnd=option.CorssCursorTouchEnd;if(IFrameSplitOperator.IsBool(option.IsClickShowCorssCursor))chart.IsClickShowCorssCursor=option.IsClickShowCorssCursor;if(option.IsShowBeforeData===true)chart.IsShowBeforeData=option.IsShowBeforeData;//分钟数据指标从第3个指标窗口设置
1218
+ for(var i=0;i<chart.ExtendChartPaint.length;++i){var item=chart.ExtendChartPaint[i];if(item.ClassName=="MinuteTooltipPaint")item.IsShowAveragePrice=false;}}if(option.MinuteLine.SplitType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.SplitType=option.MinuteLine.SplitType;}if(option.MinuteVol){var item=option.MinuteVol;if(IFrameSplitOperator.IsNumber(item.BarColorType))chart.ChartPaint[2].BarColorType=item.BarColorType;}if(option.MinuteTitle){var item=option.MinuteTitle;var chartTitle=chart.TitlePaint[0];if(IFrameSplitOperator.IsBool(item.IsShowName))chart.TitlePaint[0].IsShowName=item.IsShowName;if(IFrameSplitOperator.IsBool(item.IsShowDate))chart.TitlePaint[0].IsShowDate=item.IsShowDate;if(IFrameSplitOperator.IsBool(item.IsShowTime))chart.TitlePaint[0].IsShowTime=item.IsShowTime;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData))chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat))chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;if(item.TimeFormat)chart.TitlePaint[0].TimeFormat=item.TimeFormat;if(item.ShowPostion||item.ShowPosition)//显示位置高级配置
1219
+ {var subItem=item.ShowPostion;if(item.ShowPosition)subItem=item.ShowPosition;if(!chartTitle.ShowPositionConfig)chartTitle.ShowPositionConfig={Margin:{}};if(IFrameSplitOperator.IsNumber(subItem.Type))chartTitle.ShowPositionConfig.Type=subItem.Type;if(subItem.Margin){if(IFrameSplitOperator.IsNumber(subItem.Margin.Left))chartTitle.ShowPositionConfig.Margin.Left=subItem.Margin.Left;if(IFrameSplitOperator.IsNumber(subItem.Margin.Right))chartTitle.ShowPositionConfig.Margin.Right=subItem.Margin.Right;if(IFrameSplitOperator.IsNumber(subItem.Margin.Bottom))chartTitle.ShowPositionConfig.Margin.Bottom=subItem.Margin.Bottom;}}}if(IFrameSplitOperator.IsBool(option.CorssCursorTouchEnd))chart.CorssCursorTouchEnd=option.CorssCursorTouchEnd;if(IFrameSplitOperator.IsBool(option.IsClickShowCorssCursor))chart.IsClickShowCorssCursor=option.IsClickShowCorssCursor;if(option.IsShowBeforeData===true)chart.IsShowBeforeData=option.IsShowBeforeData;//分钟数据指标从第3个指标窗口设置
1220
1220
  if(IFrameSplitOperator.IsNonEmptyArray(option.Windows)){var scriptData=new JSIndexScript();for(var i=0;i<option.Windows.length;++i){var index=2+i;var item=option.Windows[i];if(item.Script){chart.WindowIndex[index]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
1221
1221
  }else if(item.API)//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
1222
1222
  {var apiItem=item.API;chart.WindowIndex[index]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);}else{var indexItem=JSIndexMap.Get(item.Index);if(indexItem){chart.WindowIndex[index]=indexItem.Create();//创建子窗口的指标
@@ -4631,7 +4631,7 @@ left=2*pixelRatio;top=3*pixelRatio;}this.Canvas.textBaseline="top";var right=lef
4631
4631
  if (this.IsHScreen) this.Canvas.restore();
4632
4632
  }
4633
4633
  */this.DrawBorder=function(){var isHScreen=this.ChartFrame.IsHScreen===true;var left=this.GetLeft();var top=this.GetTop();this.Canvas.strokeStyle=this.BorderColor;if(isHScreen)this.Canvas.strokeRect(ToFixedPoint(left),ToFixedPoint(top),this.Height,this.Width);else this.Canvas.strokeRect(ToFixedPoint(left),ToFixedPoint(top),ToFixedRect(this.Width),ToFixedRect(this.Height));};this.DrawBG=function(){var isHScreen=this.ChartFrame.IsHScreen===true;var left=this.GetLeft();var top=this.GetTop();this.Canvas.fillStyle=this.BGColor;if(isHScreen)this.Canvas.fillRect(left,top,this.Height,this.Width);else this.Canvas.fillRect(left,top,this.Width,this.Height);};//设置参数接口
4634
- this.SetOption=function(option){if(option.LineHeight>0)this.LineHeight=option.LineHeight*GetDevicePixelRatio();if(option.BGColor)this.BGColor=option.BGColor;if(option.LanguageID>0)this.LanguageID=option.LanguageID;};}function MinuteTooltipPaint(){this.newMethod=KLineTooltipPaint;//派生
4634
+ this.SetOption=function(option){if(!option)return;if(option.LineHeight>0)this.LineHeight=option.LineHeight*GetDevicePixelRatio();if(option.BGColor)this.BGColor=option.BGColor;if(option.LanguageID>0)this.LanguageID=option.LanguageID;if(IFrameSplitOperator.IsNumber(option.LineSpace))this.LineSpace=option.LineSpace;if(IFrameSplitOperator.IsNumber(option.ExtendLineWidth))this.ExtendLineWidth=option.ExtendLineWidth;CopyMarginConfig(this.Mergin,option.Mergin);};}function MinuteTooltipPaint(){this.newMethod=KLineTooltipPaint;//派生
4635
4635
  this.newMethod();delete this.newMethod;this.ClassName='MinuteTooltipPaint';this.Left=1*GetDevicePixelRatio();this.Top=1*GetDevicePixelRatio();this.YClose;this.IsShowAveragePrice=true;//是否显示均价
4636
4636
  this.TitlePaint;this.GetTop=function(){if(this.IsHScreen){var border=this.ChartBorder.GetHScreenBorder();if(this.ShowPosition==0)return border.TopEx+this.Left;else return border.BottomEx-this.Width-this.Left;}else{var border=this.ChartBorder.GetBorder();return border.Top+this.Top;}};this.GetLeft=function(){if(this.IsHScreen){var border=this.ChartBorder.GetHScreenBorder();return border.Right-this.Height-this.Top;}else{var border=this.ChartBorder.GetBorder();if(this.ShowPosition==0)return border.LeftEx+this.Left;else return border.RightEx-this.Width-this.Left;}};this.Draw=function(){if(!this.IsEnableDraw())return;this.IsHScreen=this.ChartFrame.IsHScreen===true;this.TitlePaint=this.HQChart.TitlePaint[0];if(!this.TitlePaint)return;var drawData;//{ Type:0=连续交易 1=集合竞价, Data:数据 }
4637
4637
  var pointInfo=this.TitlePaint.PointInfo;if(pointInfo&&(pointInfo.ClientPos==2||pointInfo.ClientPos==3||pointInfo.ClientPos>=200&&pointInfo.ClientPos<=299||pointInfo.ClientPos>=300&&pointInfo.ClientPos<=399)){var auctionData=this.TitlePaint.GetCurrentAuctionData();if(!auctionData)return;drawData={Type:1,Data:auctionData};}else{var minuteData=this.TitlePaint.GetCurrentKLineData();if(!minuteData)return;drawData={Type:0,Data:minuteData};}var titleData=this.GetFormatTitle(drawData);if(!titleData||!IFrameSplitOperator.IsNonEmptyArray(titleData.AryText))return;this.CalculateTooltipSize(titleData);this.CalculateShowPosition();this.DrawBG();this.DrawTooltipData(titleData);this.DrawBorder();};this.GetFormatTitle=function(data){if(!data||!data.Data)return;var item;var close,vol,amount;if(data.Type==0)//盘中
@@ -5615,7 +5615,7 @@ this.OverlayChartPaint;//叠加画法
5615
5615
  this.IsShowName=true;//是否显示股票名称
5616
5616
  this.IsShowSettingInfo=true;//是否显示设置信息(周期 复权)
5617
5617
  this.IsShowDateTime=true;//是否显示日期
5618
- this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;this.ShowPositionConfig={Margin:{Bottom:2}};//显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
5618
+ this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;this.ShowPositionConfig={Margin:{Bottom:2,Left:2}};//显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
5619
5619
  this.OnDrawEvent;this.OnMouseMoveEvent;this.HQChart;this.ReloadResource=function(){this.Font=g_JSChartResource.TitleFont;this.TitleColor=g_JSChartResource.DefaultTextColor;this.UpColor=g_JSChartResource.UpTextColor;this.DownColor=g_JSChartResource.DownTextColor;this.UnchagneColor=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.SettingColor=g_JSChartResource.Title.SettingColor;this.TurnoverRateColor=g_JSChartResource.Title.TurnoverRateColor;//换手率
5620
5620
  this.PositionColor=g_JSChartResource.Title.PositionColor;//持仓
5621
5621
  };this.GetCurrentKLineData=function()//获取当天鼠标位置所在的K线数据
@@ -5630,7 +5630,7 @@ if(item.YFClose>0&&MARKET_SUFFIX_NAME.IsChinaFutures(upperSymbol)){var value=(it
5630
5630
  {var value=item.Vol/item.FlowCapital*100;//成交量/流通A股*100
5631
5631
  var text=g_JSChartLocalization.GetText('KTitle-Exchange',this.LanguageID)+IFrameSplitOperator.FormatValueString(value,2,this.LanguageID)+'%';aryText.push({Text:text,Color:this.TurnoverRateColor});}if(MARKET_SUFFIX_NAME.IsFutures(upperSymbol)&&IFrameSplitOperator.IsNumber(item.Position))//持仓量
5632
5632
  {var text=g_JSChartLocalization.GetText('KTitle-Position',this.LanguageID)+item.Position;aryText.push({Text:text,Color:this.PositionColor});}//叠加股票的名字
5633
- if(IFrameSplitOperator.IsNonEmptyArray(this.OverlayChartPaint)){for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(!item.Symbol||!item.Title)continue;var clrText=item.Color;var text='['+item.Title+']';aryText.push({Text:text,Color:clrText});}}return result;};this.GetLeft=function(isHScreen){if(isHScreen){var left=this.Frame.ChartBorder.GetTop();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)left=0;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Left))left+=item.Margin.Left;}return left;}else{var left=this.Frame.ChartBorder.GetLeft();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)left=0;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Left))left+=item.Margin.Left;}return left;}};this.GetRight=function(isHScreen){if(isHScreen){var right=this.Frame.ChartBorder.GetHeight();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)right=this.Frame.ChartBorder.GetChartHeight();if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Right))right-=item.Margin.Right;}return right;}else{var right=this.Frame.ChartBorder.GetRight();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)right=this.Frame.ChartBorder.GetChartWidth();if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Right))right-=item.Margin.Right;}return right;}};this.GetBottom=function(isHScreen){if(isHScreen){var bottom=this.Frame.ChartBorder.GetRight();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Bottom))bottom+=item.Margin.Bottom;}return bottom;}else{var bottom=this.Frame.ChartBorder.GetTop();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Bottom))bottom-=item.Margin.Bottom;}return bottom;}};this.DrawItem=function(item){var isHScreen=this.Frame.IsHScreen===true;var left=this.GetLeft(isHScreen);var right=this.GetRight(isHScreen);var bottom=this.GetBottom(isHScreen);var pixelRatio=GetDevicePixelRatio();if(isHScreen){if(this.Frame.ChartBorder.Right<5*pixelRatio)return;var xText=bottom;var yText=left;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);left=bottom=0;}else{if(this.Frame.ChartBorder.Top<5*pixelRatio)return;}this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.font=this.Font;var position={Left:left,MaxRight:right,Bottom:bottom,IsHScreen:isHScreen};var titleData=this.GetFormatTitle({Data:item});if(titleData&&IFrameSplitOperator.IsNonEmptyArray(titleData.AryText)){for(var i=0;i<titleData.AryText.length;++i){var item=titleData.AryText[i];if(!this.DrawText(item.Text,item.Color,position))break;}}};this.Draw=function(){if(!this.IsShow)return;if(this.CursorIndex==null||!this.Data||this.Data.length<=0){this.OnDrawEventCallback(null);return;}this.Canvas.font=this.Font;this.SpaceWidth=this.Canvas.measureText('0').width;var index=this.CursorIndex;index=parseInt(index.toFixed(0));var dataIndex=this.Data.DataOffset+index;if(dataIndex>=this.Data.Data.length)dataIndex=this.Data.Data.length-1;if(dataIndex<0){this.OnDrawEventCallback(null);return;}if(this.IsShowLastData())//鼠标不在图形上 显示最后一条数据
5633
+ if(IFrameSplitOperator.IsNonEmptyArray(this.OverlayChartPaint)){for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(!item.Symbol||!item.Title)continue;var clrText=item.Color;var text='['+item.Title+']';aryText.push({Text:text,Color:clrText});}}return result;};this.GetLeft=function(isHScreen){if(isHScreen){var left=this.Frame.ChartBorder.GetTop();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)left=0;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Left))left+=item.Margin.Left;}return left;}else{var left=this.Frame.ChartBorder.Left;if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)left=0;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Left))left+=item.Margin.Left;}return left;}};this.GetRight=function(isHScreen){if(isHScreen){var right=this.Frame.ChartBorder.GetHeight();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)right=this.Frame.ChartBorder.GetChartHeight();if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Right))right-=item.Margin.Right;}return right;}else{var right=this.Frame.ChartBorder.GetRight();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Type===1)right=this.Frame.ChartBorder.GetChartWidth();if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Right))right-=item.Margin.Right;}return right;}};this.GetBottom=function(isHScreen){if(isHScreen){var bottom=this.Frame.ChartBorder.GetRight();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Bottom))bottom+=item.Margin.Bottom;}return bottom;}else{var bottom=this.Frame.ChartBorder.GetTop();if(this.ShowPositionConfig){var item=this.ShowPositionConfig;if(item.Margin&&IFrameSplitOperator.IsNumber(item.Margin.Bottom))bottom-=item.Margin.Bottom;}return bottom;}};this.DrawItem=function(item){var isHScreen=this.Frame.IsHScreen===true;var left=this.GetLeft(isHScreen);var right=this.GetRight(isHScreen);var bottom=this.GetBottom(isHScreen);var pixelRatio=GetDevicePixelRatio();if(isHScreen){if(this.Frame.ChartBorder.Right<5*pixelRatio)return;var xText=bottom;var yText=left;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);left=bottom=0;}else{if(this.Frame.ChartBorder.Top<5*pixelRatio)return;}this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.font=this.Font;var position={Left:left,MaxRight:right,Bottom:bottom,IsHScreen:isHScreen};var titleData=this.GetFormatTitle({Data:item});if(titleData&&IFrameSplitOperator.IsNonEmptyArray(titleData.AryText)){for(var i=0;i<titleData.AryText.length;++i){var item=titleData.AryText[i];if(!this.DrawText(item.Text,item.Color,position))break;}}};this.Draw=function(){if(!this.IsShow)return;if(this.CursorIndex==null||!this.Data||this.Data.length<=0){this.OnDrawEventCallback(null);return;}this.Canvas.font=this.Font;this.SpaceWidth=this.Canvas.measureText('0').width;var index=this.CursorIndex;index=parseInt(index.toFixed(0));var dataIndex=this.Data.DataOffset+index;if(dataIndex>=this.Data.Data.length)dataIndex=this.Data.Data.length-1;if(dataIndex<0){this.OnDrawEventCallback(null);return;}if(this.IsShowLastData())//鼠标不在图形上 显示最后一条数据
5634
5634
  {dataIndex=this.Data.Data.length-1;}var item=this.Data.Data[dataIndex];this.OnDrawEventCallback(item);this.Canvas.save();this.DrawItem(item);this.Canvas.restore();};this.OnDrawEventCallback=function(drawData){var bDrawEvent=this.OnDrawEvent&&this.OnDrawEvent.Callback;var bMouseMoveEvent=this.OnMouseMoveEvent&&this.OnMouseMoveEvent.Callback;if(!bDrawEvent&&!bMouseMoveEvent)return;var data={Draw:drawData,Name:this.ClassName};if(this.Data&&this.Data.Data){var index=Math.abs(this.CursorIndex);index=parseInt(index.toFixed(0));var dataIndex=this.Data.DataOffset+index;var dataCount=this.Data.Data.length;data.DataIndex=dataIndex;data.DataCount=dataCount;}//叠加股票
5635
5635
  if(IFrameSplitOperator.IsNonEmptyArray(this.OverlayChartPaint)){data.OverlayStock=[];for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(!item.Symbol||!item.Title)continue;data.OverlayStock.push({Symbol:item.Symbol,Name:item.Title,Data:item.Data,Color:item.Color});}}if(bDrawEvent)this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);if(bMouseMoveEvent)this.OnMouseMoveEvent.Callback(this.OnMouseMoveEvent,data,this);};this.GetColor=function(price,yclse){if(price>yclse)return this.UpColor;else if(price<yclse)return this.DownColor;else return this.UnchagneColor;};this.OnUnchangeTitleColor=function(event,sendData){if(!event||!event.Callback)return false;sendData.ClassName=this.ClassName;event.Callback(event,sendData,this);if(sendData&&sendData.TitleColor)return true;return false;};this.DrawText=function(title,color,position){if(!title)return true;var isHScreen=this.Frame.IsHScreen===true;var right=this.Frame.ChartBorder.GetRight();if(isHScreen)right=this.Frame.ChartBorder.GetHeight();if(IFrameSplitOperator.IsNumber(position.MaxRight))right=position.MaxRight;this.Canvas.fillStyle=color;var textWidth=this.Canvas.measureText(title).width;if(position.Left+textWidth>right)return false;if(this.IsShow)this.Canvas.fillText(title,position.Left,position.Bottom,textWidth);position.Left+=textWidth+this.SpaceWidth;return true;};//计算K线指标标题信息
5636
5636
  this.GetKLineCalculateTitle=function(){if(!this.HQChart)return null;var klineCalulate=this.HQChart.GetKLineCalulate();if(!klineCalulate||!klineCalulate.GetTitle)return null;return klineCalulate.GetTitle();};this.IsShowLastData=function(){var isShow=false;if(this.DrawStatus&&this.DrawStatus.IsTitleShowLatestData){var status=this.DrawStatus;if(!IFrameSplitOperator.IsNumber(status.FrameID)||status.FrameID<0)isShow=true;else if(status.CorssCursorTouchEnd&&status.IsOnTouch==false)isShow=true;}return isShow;};}function DynamicMinuteTitlePainting(){this.newMethod=DynamicKLineTitlePainting;//派生
@@ -5676,102 +5676,11 @@ if(IFrameSplitOperator.IsNumber(item.Vol[0])&&this.CallAuctionShowTitle.has("MTi
5676
5676
  if(IFrameSplitOperator.IsNumber(item.Vol[1])&&this.CallAuctionShowTitle.has("MTitle-AC-NotMatchVol")){var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchVol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[1]/unit,2);aryText.push({Text:text,Color:this.VolColor});}if(item.ExtendData&&IFrameSplitOperator.IsNonEmptyArray(item.ExtendData.Amount)){var aryAmount=item.ExtendData.Amount;if(IFrameSplitOperator.IsNumber(aryAmount[0])&&this.CallAuctionShowTitle.has("MTitle-AC-Amount"))//匹配量金额
5677
5677
  {var text=g_JSChartLocalization.GetText('MTitle-AC-Amount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[0],2);aryText.push({Text:text,Color:this.AmountColor});}if(IFrameSplitOperator.IsNumber(aryAmount[1])&&this.CallAuctionShowTitle.has("MTitle-AC-NotMatchAmount"))//未匹配量金额
5678
5678
  {var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchAmount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[1],2);aryText.push({Text:text,Color:this.AmountColor});}}}return{AryText:aryText};};this.DrawCallAuction=function()//集合竞价标题
5679
- {var isHScreen=this.Frame.IsHScreen===true;var border=this.Frame.GetBorder();var pixelRatio=GetDevicePixelRatio();var left=border.Left;var bottom=border.Top-this.Frame.ChartBorder.Top/2;var bDraw=true;if(isHScreen){if(this.Frame.ChartBorder.Right<5*pixelRatio)return;var left=2;var bottom=this.Frame.ChartBorder.Right/2;//上下居中显示
5680
- var xText=border.ChartWidth;var yText=border.Top;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);}else{if(this.Frame.ChartBorder.Top<5)bDraw=false;}this.Canvas.textAlign="left";this.Canvas.font=this.Font;if(this.TitleBaseLine==0)//上
5681
- {this.Canvas.textBaseline="top";bottom=2*pixelRatio;}else if(this.TitleBaseLine==2)//下
5682
- {this.Canvas.textBaseline="bottom";var bottom=border.Top;}else//中
5683
- {this.Canvas.textBaseline="middle";}var position={Left:left,Bottom:bottom,IsHScreen:isHScreen};var auctionData=this.GetCurrentAuctionData();var titleData=this.FormatCallAuctionTitle(auctionData);if(bDraw&&titleData&&IFrameSplitOperator.IsNonEmptyArray(titleData.AryText)){for(var i=0;i<titleData.AryText.length;++i){var item=titleData.AryText[i];if(!this.DrawText(item.Text,item.Color,position))break;}}this.OnDrawCallAuctionEventCallback(auctionData);};this.OnDrawCallAuctionEventCallback=function(drawData){if(this.OnDrawEvent&&this.OnDrawEvent.Callback){var data={Draw:drawData,Name:this.ClassName};this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);}if(this.OnMouseMoveEvent&&this.OnMouseMoveEvent.Callback){var data={Draw:drawData,Name:this.ClassName};this.OnMouseMoveEvent.Callback(this.OnDrawEvent,data,this);}};this.DrawNone=function(){this.OnDrawEventCallback(null);if(this.IsAlwaysShowLastData){this.Canvas.save();this.DrawLastDataItem();this.Canvas.restore();}};this.Draw=function(){this.LastShowData=null;this.GlobalOption=this.Frame.GlobalOption;if(!this.IsShow){//隐藏标题 并且没有回调事件
5679
+ {var isHScreen=this.Frame.IsHScreen===true;var border=this.Frame.GetBorder();var pixelRatio=GetDevicePixelRatio();var left=this.GetLeft(isHScreen);var right=this.GetRight(isHScreen);var bottom=this.GetBottom(isHScreen);var bDraw=true;if(isHScreen){if(this.Frame.ChartBorder.Right<5*pixelRatio)return;var xText=bottom;var yText=left;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);left=bottom=0;}else{if(this.Frame.ChartBorder.Top<5*pixelRatio)bDraw=false;}this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.font=this.Font;var position={Left:left,Bottom:bottom,MaxRight:right,IsHScreen:isHScreen};var auctionData=this.GetCurrentAuctionData();var titleData=this.FormatCallAuctionTitle(auctionData);if(bDraw&&titleData&&IFrameSplitOperator.IsNonEmptyArray(titleData.AryText)){for(var i=0;i<titleData.AryText.length;++i){var item=titleData.AryText[i];if(!this.DrawText(item.Text,item.Color,position))break;}}this.OnDrawCallAuctionEventCallback(auctionData);};this.OnDrawCallAuctionEventCallback=function(drawData){if(this.OnDrawEvent&&this.OnDrawEvent.Callback){var data={Draw:drawData,Name:this.ClassName};this.OnDrawEvent.Callback(this.OnDrawEvent,data,this);}if(this.OnMouseMoveEvent&&this.OnMouseMoveEvent.Callback){var data={Draw:drawData,Name:this.ClassName};this.OnMouseMoveEvent.Callback(this.OnDrawEvent,data,this);}};this.DrawNone=function(){this.OnDrawEventCallback(null);if(this.IsAlwaysShowLastData){this.Canvas.save();this.DrawLastDataItem();this.Canvas.restore();}};this.Draw=function(){this.LastShowData=null;this.GlobalOption=this.Frame.GlobalOption;if(!this.IsShow){//隐藏标题 并且没有回调事件
5684
5680
  var bEvent=this.OnDrawEvent&&this.OnDrawEvent.Callback||this.OnMouseMoveEvent&&this.OnMouseMoveEvent.Callback;if(!bEvent)return;}if(this.PointInfo&&(this.PointInfo.ClientPos==2||this.PointInfo.ClientPos==3||this.PointInfo.ClientPos>=200&&this.PointInfo.ClientPos<=299||this.PointInfo.ClientPos>=300&&this.PointInfo.ClientPos<=399)){//集合竞价区域
5685
5681
  this.Canvas.save();this.DrawCallAuction();this.Canvas.restore();return;}if(!this.Data||!this.Data.Data||this.Data.Data.length<=0){this.DrawNone();return;}if(this.CursorIndex==null&&!(this.GlobalOption&&this.GlobalOption.IsDisplayLatest)){this.DrawNone();return;}this.Canvas.font=this.Font;this.SpaceWidth=this.Canvas.measureText('0').width;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;}var isLastOne=false;if(isShowLastData){var item=null;var lastItem=this.GetLatestKLineData(true);if(lastItem&&lastItem.Type==0)item=lastItem.Data;isLastOne=true;}else{//var index=Math.abs(this.CursorIndex-0.5);
5686
- var index=this.CursorIndex;index=parseInt(index.toFixed(0));var dataIndex=index+this.Data.DataOffset;if(dataIndex>=this.Data.Data.length)dataIndex=this.Data.Data.length-1;var item=this.Data.Data[dataIndex];if(dataIndex==this.Data.Data.length-1)isLastOne=true;}this.LastShowData=item;this.Canvas.save();this.OnDrawEventCallback(item);if(this.IsAlwaysShowLastData){this.DrawLastDataItem();}else{this.DrawItem(item,isLastOne);}this.Canvas.restore();};this.DrawCallAuctionItem=function(callAuctionItem,isLastOne){if(!callAuctionItem)return;var item=callAuctionItem.Data;var dataVersion=callAuctionItem.Ver;var isHScreen=this.Frame.IsHScreen===true;var border=this.Frame.GetBorder();var left=border.Left;var bottom=border.Top-this.Frame.ChartBorder.Top/2;//var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
5687
- var bDraw=true;if(isHScreen){var left=2;var bottom=this.Frame.ChartBorder.Right/2;//上下居中显示
5688
- var xText=border.ChartWidth;var yText=border.Top;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);}else{if(this.Frame.ChartBorder.Top<5)bDraw=false;}this.Canvas.textAlign="left";this.Canvas.font=this.Font;if(this.TitleBaseLine==0)//上
5689
- {this.Canvas.textBaseline="top";bottom=2*GetDevicePixelRatio();}else if(this.TitleBaseLine==2)//下
5690
- {this.Canvas.textBaseline="bottom";var bottom=border.Top;}else//中
5691
- {this.Canvas.textBaseline="middle";}var position={Left:left,Bottom:bottom,IsHScreen:isHScreen};var titleData=this.FormatCallAuctionTitle(callAuctionItem);if(bDraw&&titleData&&IFrameSplitOperator.IsNonEmptyArray(titleData.AryText)){for(var i=0;i<titleData.AryText.length;++i){var item=titleData.AryText[i];if(!this.DrawText(item.Text,item.Color,position))break;}}/*
5692
- if(bDraw && this.IsShowName)
5693
- {
5694
- if (!this.DrawText(this.Name,this.NameColor,position)) return;
5695
- }
5696
-
5697
- var time=item.Time;
5698
- var strTime;
5699
- if (dataVersion==1.0) strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM");
5700
- else strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM:SS");
5701
- var strDate=IFrameSplitOperator.FormatDateString(item.Date);
5702
- strTime=`${strDate} ${strTime}`;
5703
-
5704
- if (bDraw && this.IsShowTime && strTime )
5705
- {
5706
- if (!this.DrawText(strTime,this.DateTimeColor,position)) return;
5707
- }
5708
-
5709
- //匹配价
5710
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Price"))
5711
- {
5712
- var color=this.GetColor(item.Price,this.YClose);
5713
- var filedName='MTitle-AC-Price';
5714
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Close";
5715
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+item.Price.toFixed(defaultfloatPrecision);
5716
- if (!this.DrawText(text,color,position)) return;
5717
- }
5718
-
5719
- //竞价涨幅
5720
- if (bDraw && item && IFrameSplitOperator.IsPlusNumber(this.YClose) && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Increase"))
5721
- {
5722
- var value=(item.Price-this.YClose)/this.YClose*100;
5723
- var color=this.GetColor(value,0);
5724
- var filedName='MTitle-AC-Increase';
5725
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Increase";
5726
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+value.toFixed(2)+"%";
5727
- if (!this.DrawText(text,color,position)) return;
5728
- }
5729
-
5730
- if (dataVersion==3.0)
5731
- {
5732
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.AvPrice) && this.CallAuctionShowTitle.has("MTitle-AC-AvPrice"))
5733
- {
5734
- var color=this.GetColor(item.Price,this.YClose);
5735
- var text=g_JSChartLocalization.GetText('MTitle-AC-AvPrice',this.LanguageID)+item.AvPrice.toFixed(defaultfloatPrecision);
5736
- if (!this.DrawText(text,color,position)) return;
5737
- }
5738
- }
5739
-
5740
- //匹配量
5741
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Vol"))
5742
- {
5743
- var filedName='MTitle-AC-Vol';
5744
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Vol";
5745
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[0],2);
5746
- if (!this.DrawText(text,this.VolColor,position)) return;
5747
- }
5748
-
5749
- //未匹配量
5750
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchVol"))
5751
- {
5752
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchVol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[1],2);
5753
- if (!this.DrawText(text,this.VolColor,position)) return;
5754
- }
5755
-
5756
- if (bDraw)
5757
- {
5758
- if (item.ExtendData && IFrameSplitOperator.IsNonEmptyArray(item.ExtendData.Amount))
5759
- {
5760
- var aryAmount=item.ExtendData.Amount;
5761
- if (IFrameSplitOperator.IsNumber(aryAmount[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Amount")) //匹配量金额
5762
- {
5763
- var text=g_JSChartLocalization.GetText('MTitle-AC-Amount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[0],2);
5764
- if (!this.DrawText(text,this.AmountColor,position)) return;
5765
- }
5766
-
5767
- if (IFrameSplitOperator.IsNumber(aryAmount[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchAmount")) //未匹配量金额
5768
- {
5769
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchAmount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[1],2);
5770
- if (!this.DrawText(text,this.AmountColor,position)) return;
5771
- }
5772
- }
5773
- }
5774
- */};this.DrawLastDataItem=function(){var lastItem=this.GetLatestKLineData(true);if(lastItem){if(lastItem.Type==0)this.DrawItem(lastItem.Data,true);else if(lastItem.Type==1||lastItem.Type==2)this.DrawCallAuctionItem(lastItem,true);}};}//字符串输出格式
5682
+ var index=this.CursorIndex;index=parseInt(index.toFixed(0));var dataIndex=index+this.Data.DataOffset;if(dataIndex>=this.Data.Data.length)dataIndex=this.Data.Data.length-1;var item=this.Data.Data[dataIndex];if(dataIndex==this.Data.Data.length-1)isLastOne=true;}this.LastShowData=item;this.Canvas.save();this.OnDrawEventCallback(item);if(this.IsAlwaysShowLastData){this.DrawLastDataItem();}else{this.DrawItem(item,isLastOne);}this.Canvas.restore();};this.DrawCallAuctionItem=function(callAuctionItem,isLastOne){if(!callAuctionItem)return;var item=callAuctionItem.Data;var isHScreen=this.Frame.IsHScreen===true;var pixelRatio=GetDevicePixelRatio();var border=this.Frame.GetBorder();var left=this.GetLeft(isHScreen);var right=this.GetRight(isHScreen);var bottom=this.GetBottom(isHScreen);var bDraw=true;if(isHScreen){if(this.Frame.ChartBorder.Right<5*pixelRatio)return;var xText=bottom;var yText=left;this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);left=bottom=0;//旋转以后 位置调整0
5683
+ }else{if(this.Frame.ChartBorder.Top<5*pixelRatio)bDraw=false;}this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.font=this.Font;var position={Left:left,Bottom:bottom,MaxRight:right,IsHScreen:isHScreen};var titleData=this.FormatCallAuctionTitle(callAuctionItem);if(bDraw&&titleData&&IFrameSplitOperator.IsNonEmptyArray(titleData.AryText)){for(var i=0;i<titleData.AryText.length;++i){var item=titleData.AryText[i];if(!this.DrawText(item.Text,item.Color,position))break;}}};this.DrawLastDataItem=function(){var lastItem=this.GetLatestKLineData(true);if(lastItem){if(lastItem.Type==0)this.DrawItem(lastItem.Data,true);else if(lastItem.Type==1||lastItem.Type==2)this.DrawCallAuctionItem(lastItem,true);}};}//字符串输出格式
5775
5684
  var STRING_FORMAT_TYPE={DEFAULT:1,//默认 2位小数 单位自动转化 (万 亿)
5776
5685
  ORIGINAL:2,//原始数据
5777
5686
  INTEGER:3,//整形数据输出 如果不是整形使用 DEFAULT
@@ -13904,7 +13813,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13904
13813
  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);};}/********************************************************************************
13905
13814
  * 版本信息输出
13906
13815
  *
13907
- */var HQCHART_VERSION="1.1.14189";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();//把给外界调用的方法暴露出来
13816
+ */var HQCHART_VERSION="1.1.14196";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();//把给外界调用的方法暴露出来
13908
13817
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13909
13818
  // BaseIndex:BaseIndex,
13910
13819
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14190",
3
+ "version": "1.1.14197",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -587,9 +587,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
587
587
  if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
588
588
  if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
589
589
 
590
- if (item.ShowPostion) //显示位置高级配置
590
+ if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
591
591
  {
592
592
  var subItem=item.ShowPostion;
593
+ if (item.ShowPosition) subItem=item.ShowPosition;
593
594
  if (!chartTitle.ShowPositionConfig) chartTitle.ShowPositionConfig={ Margin:{ } };
594
595
  if (IFrameSplitOperator.IsNumber(subItem.Type)) chartTitle.ShowPositionConfig.Type=subItem.Type;
595
596
  if (subItem.Margin)
@@ -1100,9 +1101,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1100
1101
  if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData)) chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;
1101
1102
  if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat)) chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;
1102
1103
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
1103
- if (item.ShowPostion) //显示位置高级配置
1104
+ if (item.ShowPostion || item.ShowPosition) //显示位置高级配置
1104
1105
  {
1105
1106
  var subItem=item.ShowPostion;
1107
+ if (item.ShowPosition) subItem=item.ShowPosition;
1106
1108
  if (!chartTitle.ShowPositionConfig) chartTitle.ShowPositionConfig={ Margin:{ } };
1107
1109
  if (IFrameSplitOperator.IsNumber(subItem.Type)) chartTitle.ShowPositionConfig.Type=subItem.Type;
1108
1110
  if (subItem.Margin)
@@ -43230,9 +43232,15 @@ function KLineTooltipPaint()
43230
43232
  //设置参数接口
43231
43233
  this.SetOption=function(option)
43232
43234
  {
43235
+ if (!option) return;
43236
+
43233
43237
  if (option.LineHeight>0) this.LineHeight=option.LineHeight*GetDevicePixelRatio();
43234
43238
  if (option.BGColor) this.BGColor=option.BGColor;
43235
43239
  if (option.LanguageID>0) this.LanguageID=option.LanguageID;
43240
+ if (IFrameSplitOperator.IsNumber(option.LineSpace)) this.LineSpace=option.LineSpace;
43241
+ if (IFrameSplitOperator.IsNumber(option.ExtendLineWidth)) this.ExtendLineWidth=option.ExtendLineWidth;
43242
+ CopyMarginConfig(this.Mergin, option.Mergin);
43243
+
43236
43244
  }
43237
43245
  }
43238
43246
 
@@ -54577,7 +54585,7 @@ function DynamicKLineTitlePainting()
54577
54585
  this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
54578
54586
  this.IsShowDateTime=true; //是否显示日期
54579
54587
  this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
54580
- this.ShowPositionConfig={ Margin:{ Bottom:2 } }; //显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
54588
+ this.ShowPositionConfig={ Margin:{ Bottom:2, Left:2 } }; //显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
54581
54589
  this.OnDrawEvent;
54582
54590
  this.OnMouseMoveEvent;
54583
54591
  this.HQChart;
@@ -54825,7 +54833,7 @@ function DynamicKLineTitlePainting()
54825
54833
  }
54826
54834
  else
54827
54835
  {
54828
- var left=this.Frame.ChartBorder.GetLeft();
54836
+ var left=this.Frame.ChartBorder.Left;
54829
54837
  if (this.ShowPositionConfig)
54830
54838
  {
54831
54839
  var item=this.ShowPositionConfig;
@@ -55541,43 +55549,29 @@ function DynamicMinuteTitlePainting()
55541
55549
  var isHScreen=this.Frame.IsHScreen===true;
55542
55550
  var border=this.Frame.GetBorder();
55543
55551
  var pixelRatio=GetDevicePixelRatio();
55544
- var left=border.Left;
55545
- var bottom=border.Top-this.Frame.ChartBorder.Top/2;
55552
+ var left=this.GetLeft(isHScreen);
55553
+ var right=this.GetRight(isHScreen);
55554
+ var bottom=this.GetBottom(isHScreen);
55546
55555
  var bDraw=true;
55547
55556
  if (isHScreen)
55548
55557
  {
55549
55558
  if (this.Frame.ChartBorder.Right<5*pixelRatio) return;
55550
- var left=2;
55551
- var bottom=this.Frame.ChartBorder.Right/2; //上下居中显示
55552
- var xText=border.ChartWidth;
55553
- var yText=border.Top;
55559
+ var xText=bottom;
55560
+ var yText=left;
55554
55561
  this.Canvas.translate(xText, yText);
55555
55562
  this.Canvas.rotate(90 * Math.PI / 180);
55563
+ left=bottom=0;
55556
55564
  }
55557
55565
  else
55558
55566
  {
55559
- if (this.Frame.ChartBorder.Top<5) bDraw=false;
55567
+ if (this.Frame.ChartBorder.Top<5*pixelRatio) bDraw=false;
55560
55568
  }
55561
55569
 
55562
55570
  this.Canvas.textAlign="left";
55571
+ this.Canvas.textBaseline="bottom";
55563
55572
  this.Canvas.font=this.Font;
55564
55573
 
55565
- if (this.TitleBaseLine==0) //上
55566
- {
55567
- this.Canvas.textBaseline="top";
55568
- bottom=2*pixelRatio;
55569
- }
55570
- else if (this.TitleBaseLine==2) //下
55571
- {
55572
- this.Canvas.textBaseline="bottom";
55573
- var bottom=border.Top
55574
- }
55575
- else //中
55576
- {
55577
- this.Canvas.textBaseline="middle";
55578
- }
55579
-
55580
- var position = { Left: left, Bottom: bottom, IsHScreen: isHScreen };
55574
+ var position = { Left: left, Bottom: bottom, MaxRight:right, IsHScreen: isHScreen };
55581
55575
  var auctionData=this.GetCurrentAuctionData();
55582
55576
  var titleData=this.FormatCallAuctionTitle(auctionData);
55583
55577
 
@@ -55714,48 +55708,33 @@ function DynamicMinuteTitlePainting()
55714
55708
  if (!callAuctionItem) return;
55715
55709
 
55716
55710
  var item=callAuctionItem.Data;
55717
- var dataVersion=callAuctionItem.Ver;
55718
-
55719
55711
  var isHScreen=this.Frame.IsHScreen===true;
55712
+ var pixelRatio=GetDevicePixelRatio();
55720
55713
  var border=this.Frame.GetBorder();
55714
+ var left=this.GetLeft(isHScreen);
55715
+ var right=this.GetRight(isHScreen);
55716
+ var bottom =this.GetBottom(isHScreen);
55721
55717
 
55722
- var left=border.Left;
55723
- var bottom=border.Top-this.Frame.ChartBorder.Top/2;
55724
- //var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
55725
55718
  var bDraw=true;
55726
55719
  if (isHScreen)
55727
55720
  {
55728
- var left=2;
55729
- var bottom=this.Frame.ChartBorder.Right/2; //上下居中显示
55730
- var xText=border.ChartWidth;
55731
- var yText=border.Top;
55721
+ if (this.Frame.ChartBorder.Right<5*pixelRatio) return;
55722
+ var xText=bottom;
55723
+ var yText=left;
55732
55724
  this.Canvas.translate(xText, yText);
55733
55725
  this.Canvas.rotate(90 * Math.PI / 180);
55726
+ left=bottom=0; //旋转以后 位置调整0
55734
55727
  }
55735
55728
  else
55736
55729
  {
55737
- if (this.Frame.ChartBorder.Top<5) bDraw=false;
55730
+ if (this.Frame.ChartBorder.Top<5*pixelRatio) bDraw=false;
55738
55731
  }
55739
55732
 
55740
55733
  this.Canvas.textAlign="left";
55734
+ this.Canvas.textBaseline="bottom";
55741
55735
  this.Canvas.font=this.Font;
55742
55736
 
55743
- if (this.TitleBaseLine==0) //上
55744
- {
55745
- this.Canvas.textBaseline="top";
55746
- bottom=2*GetDevicePixelRatio();
55747
- }
55748
- else if (this.TitleBaseLine==2) //下
55749
- {
55750
- this.Canvas.textBaseline="bottom";
55751
- var bottom=border.Top
55752
- }
55753
- else //中
55754
- {
55755
- this.Canvas.textBaseline="middle";
55756
- }
55757
-
55758
- var position = { Left: left, Bottom: bottom, IsHScreen: isHScreen };
55737
+ var position = { Left: left, Bottom: bottom, MaxRight:right, IsHScreen: isHScreen };
55759
55738
  var titleData=this.FormatCallAuctionTitle(callAuctionItem);
55760
55739
 
55761
55740
  if (bDraw && titleData && IFrameSplitOperator.IsNonEmptyArray(titleData.AryText))
@@ -55766,91 +55745,6 @@ function DynamicMinuteTitlePainting()
55766
55745
  if (!this.DrawText(item.Text,item.Color,position)) break;
55767
55746
  }
55768
55747
  }
55769
-
55770
- /*
55771
- if(bDraw && this.IsShowName)
55772
- {
55773
- if (!this.DrawText(this.Name,this.NameColor,position)) return;
55774
- }
55775
-
55776
- var time=item.Time;
55777
- var strTime;
55778
- if (dataVersion==1.0) strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM");
55779
- else strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM:SS");
55780
- var strDate=IFrameSplitOperator.FormatDateString(item.Date);
55781
- strTime=`${strDate} ${strTime}`;
55782
-
55783
- if (bDraw && this.IsShowTime && strTime )
55784
- {
55785
- if (!this.DrawText(strTime,this.DateTimeColor,position)) return;
55786
- }
55787
-
55788
- //匹配价
55789
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Price"))
55790
- {
55791
- var color=this.GetColor(item.Price,this.YClose);
55792
- var filedName='MTitle-AC-Price';
55793
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Close";
55794
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+item.Price.toFixed(defaultfloatPrecision);
55795
- if (!this.DrawText(text,color,position)) return;
55796
- }
55797
-
55798
- //竞价涨幅
55799
- if (bDraw && item && IFrameSplitOperator.IsPlusNumber(this.YClose) && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Increase"))
55800
- {
55801
- var value=(item.Price-this.YClose)/this.YClose*100;
55802
- var color=this.GetColor(value,0);
55803
- var filedName='MTitle-AC-Increase';
55804
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Increase";
55805
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+value.toFixed(2)+"%";
55806
- if (!this.DrawText(text,color,position)) return;
55807
- }
55808
-
55809
- if (dataVersion==3.0)
55810
- {
55811
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.AvPrice) && this.CallAuctionShowTitle.has("MTitle-AC-AvPrice"))
55812
- {
55813
- var color=this.GetColor(item.Price,this.YClose);
55814
- var text=g_JSChartLocalization.GetText('MTitle-AC-AvPrice',this.LanguageID)+item.AvPrice.toFixed(defaultfloatPrecision);
55815
- if (!this.DrawText(text,color,position)) return;
55816
- }
55817
- }
55818
-
55819
- //匹配量
55820
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Vol"))
55821
- {
55822
- var filedName='MTitle-AC-Vol';
55823
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Vol";
55824
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[0],2);
55825
- if (!this.DrawText(text,this.VolColor,position)) return;
55826
- }
55827
-
55828
- //未匹配量
55829
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchVol"))
55830
- {
55831
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchVol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[1],2);
55832
- if (!this.DrawText(text,this.VolColor,position)) return;
55833
- }
55834
-
55835
- if (bDraw)
55836
- {
55837
- if (item.ExtendData && IFrameSplitOperator.IsNonEmptyArray(item.ExtendData.Amount))
55838
- {
55839
- var aryAmount=item.ExtendData.Amount;
55840
- if (IFrameSplitOperator.IsNumber(aryAmount[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Amount")) //匹配量金额
55841
- {
55842
- var text=g_JSChartLocalization.GetText('MTitle-AC-Amount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[0],2);
55843
- if (!this.DrawText(text,this.AmountColor,position)) return;
55844
- }
55845
-
55846
- if (IFrameSplitOperator.IsNumber(aryAmount[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchAmount")) //未匹配量金额
55847
- {
55848
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchAmount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[1],2);
55849
- if (!this.DrawText(text,this.AmountColor,position)) return;
55850
- }
55851
- }
55852
- }
55853
- */
55854
55748
  }
55855
55749
 
55856
55750
  this.DrawLastDataItem=function()
@@ -4512,9 +4512,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4512
4512
  if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
4513
4513
  if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
4514
4514
 
4515
- if (item.ShowPostion) //显示位置高级配置
4515
+ if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
4516
4516
  {
4517
4517
  var subItem=item.ShowPostion;
4518
+ if (item.ShowPosition) subItem=item.ShowPosition;
4518
4519
  if (!chartTitle.ShowPositionConfig) chartTitle.ShowPositionConfig={ Margin:{ } };
4519
4520
  if (IFrameSplitOperator.IsNumber(subItem.Type)) chartTitle.ShowPositionConfig.Type=subItem.Type;
4520
4521
  if (subItem.Margin)
@@ -5025,9 +5026,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5025
5026
  if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData)) chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;
5026
5027
  if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat)) chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;
5027
5028
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
5028
- if (item.ShowPostion) //显示位置高级配置
5029
+ if (item.ShowPostion || item.ShowPosition) //显示位置高级配置
5029
5030
  {
5030
5031
  var subItem=item.ShowPostion;
5032
+ if (item.ShowPosition) subItem=item.ShowPosition;
5031
5033
  if (!chartTitle.ShowPositionConfig) chartTitle.ShowPositionConfig={ Margin:{ } };
5032
5034
  if (IFrameSplitOperator.IsNumber(subItem.Type)) chartTitle.ShowPositionConfig.Type=subItem.Type;
5033
5035
  if (subItem.Margin)
@@ -58502,7 +58504,7 @@ function DynamicKLineTitlePainting()
58502
58504
  this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
58503
58505
  this.IsShowDateTime=true; //是否显示日期
58504
58506
  this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
58505
- this.ShowPositionConfig={ Margin:{ Bottom:2 } }; //显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
58507
+ this.ShowPositionConfig={ Margin:{ Bottom:2, Left:2 } }; //显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
58506
58508
  this.OnDrawEvent;
58507
58509
  this.OnMouseMoveEvent;
58508
58510
  this.HQChart;
@@ -58750,7 +58752,7 @@ function DynamicKLineTitlePainting()
58750
58752
  }
58751
58753
  else
58752
58754
  {
58753
- var left=this.Frame.ChartBorder.GetLeft();
58755
+ var left=this.Frame.ChartBorder.Left;
58754
58756
  if (this.ShowPositionConfig)
58755
58757
  {
58756
58758
  var item=this.ShowPositionConfig;
@@ -59466,43 +59468,29 @@ function DynamicMinuteTitlePainting()
59466
59468
  var isHScreen=this.Frame.IsHScreen===true;
59467
59469
  var border=this.Frame.GetBorder();
59468
59470
  var pixelRatio=GetDevicePixelRatio();
59469
- var left=border.Left;
59470
- var bottom=border.Top-this.Frame.ChartBorder.Top/2;
59471
+ var left=this.GetLeft(isHScreen);
59472
+ var right=this.GetRight(isHScreen);
59473
+ var bottom=this.GetBottom(isHScreen);
59471
59474
  var bDraw=true;
59472
59475
  if (isHScreen)
59473
59476
  {
59474
59477
  if (this.Frame.ChartBorder.Right<5*pixelRatio) return;
59475
- var left=2;
59476
- var bottom=this.Frame.ChartBorder.Right/2; //上下居中显示
59477
- var xText=border.ChartWidth;
59478
- var yText=border.Top;
59478
+ var xText=bottom;
59479
+ var yText=left;
59479
59480
  this.Canvas.translate(xText, yText);
59480
59481
  this.Canvas.rotate(90 * Math.PI / 180);
59482
+ left=bottom=0;
59481
59483
  }
59482
59484
  else
59483
59485
  {
59484
- if (this.Frame.ChartBorder.Top<5) bDraw=false;
59486
+ if (this.Frame.ChartBorder.Top<5*pixelRatio) bDraw=false;
59485
59487
  }
59486
59488
 
59487
59489
  this.Canvas.textAlign="left";
59490
+ this.Canvas.textBaseline="bottom";
59488
59491
  this.Canvas.font=this.Font;
59489
59492
 
59490
- if (this.TitleBaseLine==0) //上
59491
- {
59492
- this.Canvas.textBaseline="top";
59493
- bottom=2*pixelRatio;
59494
- }
59495
- else if (this.TitleBaseLine==2) //下
59496
- {
59497
- this.Canvas.textBaseline="bottom";
59498
- var bottom=border.Top
59499
- }
59500
- else //中
59501
- {
59502
- this.Canvas.textBaseline="middle";
59503
- }
59504
-
59505
- var position = { Left: left, Bottom: bottom, IsHScreen: isHScreen };
59493
+ var position = { Left: left, Bottom: bottom, MaxRight:right, IsHScreen: isHScreen };
59506
59494
  var auctionData=this.GetCurrentAuctionData();
59507
59495
  var titleData=this.FormatCallAuctionTitle(auctionData);
59508
59496
 
@@ -59639,48 +59627,33 @@ function DynamicMinuteTitlePainting()
59639
59627
  if (!callAuctionItem) return;
59640
59628
 
59641
59629
  var item=callAuctionItem.Data;
59642
- var dataVersion=callAuctionItem.Ver;
59643
-
59644
59630
  var isHScreen=this.Frame.IsHScreen===true;
59631
+ var pixelRatio=GetDevicePixelRatio();
59645
59632
  var border=this.Frame.GetBorder();
59633
+ var left=this.GetLeft(isHScreen);
59634
+ var right=this.GetRight(isHScreen);
59635
+ var bottom =this.GetBottom(isHScreen);
59646
59636
 
59647
- var left=border.Left;
59648
- var bottom=border.Top-this.Frame.ChartBorder.Top/2;
59649
- //var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
59650
59637
  var bDraw=true;
59651
59638
  if (isHScreen)
59652
59639
  {
59653
- var left=2;
59654
- var bottom=this.Frame.ChartBorder.Right/2; //上下居中显示
59655
- var xText=border.ChartWidth;
59656
- var yText=border.Top;
59640
+ if (this.Frame.ChartBorder.Right<5*pixelRatio) return;
59641
+ var xText=bottom;
59642
+ var yText=left;
59657
59643
  this.Canvas.translate(xText, yText);
59658
59644
  this.Canvas.rotate(90 * Math.PI / 180);
59645
+ left=bottom=0; //旋转以后 位置调整0
59659
59646
  }
59660
59647
  else
59661
59648
  {
59662
- if (this.Frame.ChartBorder.Top<5) bDraw=false;
59649
+ if (this.Frame.ChartBorder.Top<5*pixelRatio) bDraw=false;
59663
59650
  }
59664
59651
 
59665
59652
  this.Canvas.textAlign="left";
59653
+ this.Canvas.textBaseline="bottom";
59666
59654
  this.Canvas.font=this.Font;
59667
59655
 
59668
- if (this.TitleBaseLine==0) //上
59669
- {
59670
- this.Canvas.textBaseline="top";
59671
- bottom=2*GetDevicePixelRatio();
59672
- }
59673
- else if (this.TitleBaseLine==2) //下
59674
- {
59675
- this.Canvas.textBaseline="bottom";
59676
- var bottom=border.Top
59677
- }
59678
- else //中
59679
- {
59680
- this.Canvas.textBaseline="middle";
59681
- }
59682
-
59683
- var position = { Left: left, Bottom: bottom, IsHScreen: isHScreen };
59656
+ var position = { Left: left, Bottom: bottom, MaxRight:right, IsHScreen: isHScreen };
59684
59657
  var titleData=this.FormatCallAuctionTitle(callAuctionItem);
59685
59658
 
59686
59659
  if (bDraw && titleData && IFrameSplitOperator.IsNonEmptyArray(titleData.AryText))
@@ -59691,91 +59664,6 @@ function DynamicMinuteTitlePainting()
59691
59664
  if (!this.DrawText(item.Text,item.Color,position)) break;
59692
59665
  }
59693
59666
  }
59694
-
59695
- /*
59696
- if(bDraw && this.IsShowName)
59697
- {
59698
- if (!this.DrawText(this.Name,this.NameColor,position)) return;
59699
- }
59700
-
59701
- var time=item.Time;
59702
- var strTime;
59703
- if (dataVersion==1.0) strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM");
59704
- else strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM:SS");
59705
- var strDate=IFrameSplitOperator.FormatDateString(item.Date);
59706
- strTime=`${strDate} ${strTime}`;
59707
-
59708
- if (bDraw && this.IsShowTime && strTime )
59709
- {
59710
- if (!this.DrawText(strTime,this.DateTimeColor,position)) return;
59711
- }
59712
-
59713
- //匹配价
59714
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Price"))
59715
- {
59716
- var color=this.GetColor(item.Price,this.YClose);
59717
- var filedName='MTitle-AC-Price';
59718
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Close";
59719
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+item.Price.toFixed(defaultfloatPrecision);
59720
- if (!this.DrawText(text,color,position)) return;
59721
- }
59722
-
59723
- //竞价涨幅
59724
- if (bDraw && item && IFrameSplitOperator.IsPlusNumber(this.YClose) && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Increase"))
59725
- {
59726
- var value=(item.Price-this.YClose)/this.YClose*100;
59727
- var color=this.GetColor(value,0);
59728
- var filedName='MTitle-AC-Increase';
59729
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Increase";
59730
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+value.toFixed(2)+"%";
59731
- if (!this.DrawText(text,color,position)) return;
59732
- }
59733
-
59734
- if (dataVersion==3.0)
59735
- {
59736
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.AvPrice) && this.CallAuctionShowTitle.has("MTitle-AC-AvPrice"))
59737
- {
59738
- var color=this.GetColor(item.Price,this.YClose);
59739
- var text=g_JSChartLocalization.GetText('MTitle-AC-AvPrice',this.LanguageID)+item.AvPrice.toFixed(defaultfloatPrecision);
59740
- if (!this.DrawText(text,color,position)) return;
59741
- }
59742
- }
59743
-
59744
- //匹配量
59745
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Vol"))
59746
- {
59747
- var filedName='MTitle-AC-Vol';
59748
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Vol";
59749
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[0],2);
59750
- if (!this.DrawText(text,this.VolColor,position)) return;
59751
- }
59752
-
59753
- //未匹配量
59754
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchVol"))
59755
- {
59756
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchVol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[1],2);
59757
- if (!this.DrawText(text,this.VolColor,position)) return;
59758
- }
59759
-
59760
- if (bDraw)
59761
- {
59762
- if (item.ExtendData && IFrameSplitOperator.IsNonEmptyArray(item.ExtendData.Amount))
59763
- {
59764
- var aryAmount=item.ExtendData.Amount;
59765
- if (IFrameSplitOperator.IsNumber(aryAmount[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Amount")) //匹配量金额
59766
- {
59767
- var text=g_JSChartLocalization.GetText('MTitle-AC-Amount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[0],2);
59768
- if (!this.DrawText(text,this.AmountColor,position)) return;
59769
- }
59770
-
59771
- if (IFrameSplitOperator.IsNumber(aryAmount[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchAmount")) //未匹配量金额
59772
- {
59773
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchAmount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[1],2);
59774
- if (!this.DrawText(text,this.AmountColor,position)) return;
59775
- }
59776
- }
59777
- }
59778
- */
59779
59667
  }
59780
59668
 
59781
59669
  this.DrawLastDataItem=function()
@@ -140143,7 +140031,7 @@ function ScrollBarBGChart()
140143
140031
 
140144
140032
 
140145
140033
 
140146
- var HQCHART_VERSION="1.1.14189";
140034
+ var HQCHART_VERSION="1.1.14192";
140147
140035
 
140148
140036
  function PrintHQChartVersion()
140149
140037
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14189";
8
+ var HQCHART_VERSION="1.1.14196";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -4556,9 +4556,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4556
4556
  if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
4557
4557
  if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
4558
4558
 
4559
- if (item.ShowPostion) //显示位置高级配置
4559
+ if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
4560
4560
  {
4561
4561
  var subItem=item.ShowPostion;
4562
+ if (item.ShowPosition) subItem=item.ShowPosition;
4562
4563
  if (!chartTitle.ShowPositionConfig) chartTitle.ShowPositionConfig={ Margin:{ } };
4563
4564
  if (IFrameSplitOperator.IsNumber(subItem.Type)) chartTitle.ShowPositionConfig.Type=subItem.Type;
4564
4565
  if (subItem.Margin)
@@ -5069,9 +5070,10 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5069
5070
  if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData)) chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;
5070
5071
  if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat)) chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;
5071
5072
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
5072
- if (item.ShowPostion) //显示位置高级配置
5073
+ if (item.ShowPostion || item.ShowPosition) //显示位置高级配置
5073
5074
  {
5074
5075
  var subItem=item.ShowPostion;
5076
+ if (item.ShowPosition) subItem=item.ShowPosition;
5075
5077
  if (!chartTitle.ShowPositionConfig) chartTitle.ShowPositionConfig={ Margin:{ } };
5076
5078
  if (IFrameSplitOperator.IsNumber(subItem.Type)) chartTitle.ShowPositionConfig.Type=subItem.Type;
5077
5079
  if (subItem.Margin)
@@ -47199,9 +47201,15 @@ function KLineTooltipPaint()
47199
47201
  //设置参数接口
47200
47202
  this.SetOption=function(option)
47201
47203
  {
47204
+ if (!option) return;
47205
+
47202
47206
  if (option.LineHeight>0) this.LineHeight=option.LineHeight*GetDevicePixelRatio();
47203
47207
  if (option.BGColor) this.BGColor=option.BGColor;
47204
47208
  if (option.LanguageID>0) this.LanguageID=option.LanguageID;
47209
+ if (IFrameSplitOperator.IsNumber(option.LineSpace)) this.LineSpace=option.LineSpace;
47210
+ if (IFrameSplitOperator.IsNumber(option.ExtendLineWidth)) this.ExtendLineWidth=option.ExtendLineWidth;
47211
+ CopyMarginConfig(this.Mergin, option.Mergin);
47212
+
47205
47213
  }
47206
47214
  }
47207
47215
 
@@ -58546,7 +58554,7 @@ function DynamicKLineTitlePainting()
58546
58554
  this.IsShowSettingInfo=true; //是否显示设置信息(周期 复权)
58547
58555
  this.IsShowDateTime=true; //是否显示日期
58548
58556
  this.LanguageID=JSCHART_LANGUAGE_ID.LANGUAGE_CHINESE_ID;
58549
- this.ShowPositionConfig={ Margin:{ Bottom:2 } }; //显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
58557
+ this.ShowPositionConfig={ Margin:{ Bottom:2, Left:2 } }; //显示位置高级配置 { Type:1 左对齐, Margin:{ Left, Right, Bottom } }
58550
58558
  this.OnDrawEvent;
58551
58559
  this.OnMouseMoveEvent;
58552
58560
  this.HQChart;
@@ -58794,7 +58802,7 @@ function DynamicKLineTitlePainting()
58794
58802
  }
58795
58803
  else
58796
58804
  {
58797
- var left=this.Frame.ChartBorder.GetLeft();
58805
+ var left=this.Frame.ChartBorder.Left;
58798
58806
  if (this.ShowPositionConfig)
58799
58807
  {
58800
58808
  var item=this.ShowPositionConfig;
@@ -59510,43 +59518,29 @@ function DynamicMinuteTitlePainting()
59510
59518
  var isHScreen=this.Frame.IsHScreen===true;
59511
59519
  var border=this.Frame.GetBorder();
59512
59520
  var pixelRatio=GetDevicePixelRatio();
59513
- var left=border.Left;
59514
- var bottom=border.Top-this.Frame.ChartBorder.Top/2;
59521
+ var left=this.GetLeft(isHScreen);
59522
+ var right=this.GetRight(isHScreen);
59523
+ var bottom=this.GetBottom(isHScreen);
59515
59524
  var bDraw=true;
59516
59525
  if (isHScreen)
59517
59526
  {
59518
59527
  if (this.Frame.ChartBorder.Right<5*pixelRatio) return;
59519
- var left=2;
59520
- var bottom=this.Frame.ChartBorder.Right/2; //上下居中显示
59521
- var xText=border.ChartWidth;
59522
- var yText=border.Top;
59528
+ var xText=bottom;
59529
+ var yText=left;
59523
59530
  this.Canvas.translate(xText, yText);
59524
59531
  this.Canvas.rotate(90 * Math.PI / 180);
59532
+ left=bottom=0;
59525
59533
  }
59526
59534
  else
59527
59535
  {
59528
- if (this.Frame.ChartBorder.Top<5) bDraw=false;
59536
+ if (this.Frame.ChartBorder.Top<5*pixelRatio) bDraw=false;
59529
59537
  }
59530
59538
 
59531
59539
  this.Canvas.textAlign="left";
59540
+ this.Canvas.textBaseline="bottom";
59532
59541
  this.Canvas.font=this.Font;
59533
59542
 
59534
- if (this.TitleBaseLine==0) //上
59535
- {
59536
- this.Canvas.textBaseline="top";
59537
- bottom=2*pixelRatio;
59538
- }
59539
- else if (this.TitleBaseLine==2) //下
59540
- {
59541
- this.Canvas.textBaseline="bottom";
59542
- var bottom=border.Top
59543
- }
59544
- else //中
59545
- {
59546
- this.Canvas.textBaseline="middle";
59547
- }
59548
-
59549
- var position = { Left: left, Bottom: bottom, IsHScreen: isHScreen };
59543
+ var position = { Left: left, Bottom: bottom, MaxRight:right, IsHScreen: isHScreen };
59550
59544
  var auctionData=this.GetCurrentAuctionData();
59551
59545
  var titleData=this.FormatCallAuctionTitle(auctionData);
59552
59546
 
@@ -59683,48 +59677,33 @@ function DynamicMinuteTitlePainting()
59683
59677
  if (!callAuctionItem) return;
59684
59678
 
59685
59679
  var item=callAuctionItem.Data;
59686
- var dataVersion=callAuctionItem.Ver;
59687
-
59688
59680
  var isHScreen=this.Frame.IsHScreen===true;
59681
+ var pixelRatio=GetDevicePixelRatio();
59689
59682
  var border=this.Frame.GetBorder();
59683
+ var left=this.GetLeft(isHScreen);
59684
+ var right=this.GetRight(isHScreen);
59685
+ var bottom =this.GetBottom(isHScreen);
59690
59686
 
59691
- var left=border.Left;
59692
- var bottom=border.Top-this.Frame.ChartBorder.Top/2;
59693
- //var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//价格小数位数
59694
59687
  var bDraw=true;
59695
59688
  if (isHScreen)
59696
59689
  {
59697
- var left=2;
59698
- var bottom=this.Frame.ChartBorder.Right/2; //上下居中显示
59699
- var xText=border.ChartWidth;
59700
- var yText=border.Top;
59690
+ if (this.Frame.ChartBorder.Right<5*pixelRatio) return;
59691
+ var xText=bottom;
59692
+ var yText=left;
59701
59693
  this.Canvas.translate(xText, yText);
59702
59694
  this.Canvas.rotate(90 * Math.PI / 180);
59695
+ left=bottom=0; //旋转以后 位置调整0
59703
59696
  }
59704
59697
  else
59705
59698
  {
59706
- if (this.Frame.ChartBorder.Top<5) bDraw=false;
59699
+ if (this.Frame.ChartBorder.Top<5*pixelRatio) bDraw=false;
59707
59700
  }
59708
59701
 
59709
59702
  this.Canvas.textAlign="left";
59703
+ this.Canvas.textBaseline="bottom";
59710
59704
  this.Canvas.font=this.Font;
59711
59705
 
59712
- if (this.TitleBaseLine==0) //上
59713
- {
59714
- this.Canvas.textBaseline="top";
59715
- bottom=2*GetDevicePixelRatio();
59716
- }
59717
- else if (this.TitleBaseLine==2) //下
59718
- {
59719
- this.Canvas.textBaseline="bottom";
59720
- var bottom=border.Top
59721
- }
59722
- else //中
59723
- {
59724
- this.Canvas.textBaseline="middle";
59725
- }
59726
-
59727
- var position = { Left: left, Bottom: bottom, IsHScreen: isHScreen };
59706
+ var position = { Left: left, Bottom: bottom, MaxRight:right, IsHScreen: isHScreen };
59728
59707
  var titleData=this.FormatCallAuctionTitle(callAuctionItem);
59729
59708
 
59730
59709
  if (bDraw && titleData && IFrameSplitOperator.IsNonEmptyArray(titleData.AryText))
@@ -59735,91 +59714,6 @@ function DynamicMinuteTitlePainting()
59735
59714
  if (!this.DrawText(item.Text,item.Color,position)) break;
59736
59715
  }
59737
59716
  }
59738
-
59739
- /*
59740
- if(bDraw && this.IsShowName)
59741
- {
59742
- if (!this.DrawText(this.Name,this.NameColor,position)) return;
59743
- }
59744
-
59745
- var time=item.Time;
59746
- var strTime;
59747
- if (dataVersion==1.0) strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM");
59748
- else strTime=IFrameSplitOperator.FormatTimeString(time,"HH:MM:SS");
59749
- var strDate=IFrameSplitOperator.FormatDateString(item.Date);
59750
- strTime=`${strDate} ${strTime}`;
59751
-
59752
- if (bDraw && this.IsShowTime && strTime )
59753
- {
59754
- if (!this.DrawText(strTime,this.DateTimeColor,position)) return;
59755
- }
59756
-
59757
- //匹配价
59758
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Price"))
59759
- {
59760
- var color=this.GetColor(item.Price,this.YClose);
59761
- var filedName='MTitle-AC-Price';
59762
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Close";
59763
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+item.Price.toFixed(defaultfloatPrecision);
59764
- if (!this.DrawText(text,color,position)) return;
59765
- }
59766
-
59767
- //竞价涨幅
59768
- if (bDraw && item && IFrameSplitOperator.IsPlusNumber(this.YClose) && IFrameSplitOperator.IsNumber(item.Price) && this.CallAuctionShowTitle.has("MTitle-AC-Increase"))
59769
- {
59770
- var value=(item.Price-this.YClose)/this.YClose*100;
59771
- var color=this.GetColor(value,0);
59772
- var filedName='MTitle-AC-Increase';
59773
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Increase";
59774
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+value.toFixed(2)+"%";
59775
- if (!this.DrawText(text,color,position)) return;
59776
- }
59777
-
59778
- if (dataVersion==3.0)
59779
- {
59780
- if (bDraw && item && IFrameSplitOperator.IsNumber(item.AvPrice) && this.CallAuctionShowTitle.has("MTitle-AC-AvPrice"))
59781
- {
59782
- var color=this.GetColor(item.Price,this.YClose);
59783
- var text=g_JSChartLocalization.GetText('MTitle-AC-AvPrice',this.LanguageID)+item.AvPrice.toFixed(defaultfloatPrecision);
59784
- if (!this.DrawText(text,color,position)) return;
59785
- }
59786
- }
59787
-
59788
- //匹配量
59789
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Vol"))
59790
- {
59791
- var filedName='MTitle-AC-Vol';
59792
- if (this.BeforeOpenData && this.BeforeOpenData.Ver==1.0) filedName="MTitle-Vol";
59793
- var text=g_JSChartLocalization.GetText(filedName,this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[0],2);
59794
- if (!this.DrawText(text,this.VolColor,position)) return;
59795
- }
59796
-
59797
- //未匹配量
59798
- if (bDraw && IFrameSplitOperator.IsNumber(item.Vol[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchVol"))
59799
- {
59800
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchVol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Vol[1],2);
59801
- if (!this.DrawText(text,this.VolColor,position)) return;
59802
- }
59803
-
59804
- if (bDraw)
59805
- {
59806
- if (item.ExtendData && IFrameSplitOperator.IsNonEmptyArray(item.ExtendData.Amount))
59807
- {
59808
- var aryAmount=item.ExtendData.Amount;
59809
- if (IFrameSplitOperator.IsNumber(aryAmount[0]) && this.CallAuctionShowTitle.has("MTitle-AC-Amount")) //匹配量金额
59810
- {
59811
- var text=g_JSChartLocalization.GetText('MTitle-AC-Amount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[0],2);
59812
- if (!this.DrawText(text,this.AmountColor,position)) return;
59813
- }
59814
-
59815
- if (IFrameSplitOperator.IsNumber(aryAmount[1]) && this.CallAuctionShowTitle.has("MTitle-AC-NotMatchAmount")) //未匹配量金额
59816
- {
59817
- var text=g_JSChartLocalization.GetText('MTitle-AC-NotMatchAmount',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(aryAmount[1],2);
59818
- if (!this.DrawText(text,this.AmountColor,position)) return;
59819
- }
59820
- }
59821
- }
59822
- */
59823
59717
  }
59824
59718
 
59825
59719
  this.DrawLastDataItem=function()
@@ -149748,7 +149642,7 @@ function HQChartScriptWorker()
149748
149642
 
149749
149643
 
149750
149644
 
149751
- var HQCHART_VERSION="1.1.14189";
149645
+ var HQCHART_VERSION="1.1.14196";
149752
149646
 
149753
149647
  function PrintHQChartVersion()
149754
149648
  {