hqchart 1.1.14705 → 1.1.14713
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/umychart.vue.js
CHANGED
|
@@ -1201,7 +1201,7 @@ option.CorssCursor={};option.CorssCursor.TitleHeight=chart.ChartCorssCursor.Text
|
|
|
1201
1201
|
}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;//显示右边刻度
|
|
1202
1202
|
}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;//反转坐标
|
|
1203
1203
|
if(IFrameSplitOperator.IsNumber(item.PercentageTextFormat))subFrame.YSplitOperator.PercentageTextFormat=item.PercentageTextFormat;//百分比坐标格式
|
|
1204
|
-
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(IFrameSplitOperator.IsNumber(item.UnchangeBarType))klineChart.UnchangeBarType=item.UnchangeBarType;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(IFrameSplitOperator.IsBool(item.EnablePrediction))klineChart.PredictionConfig.Enable=item.EnablePrediction;if(IFrameSplitOperator.IsBool(item.EnableDaySummary))klineChart.DaySummary.Enable=item.EnableDaySummary;}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)//显示位置高级配置
|
|
1204
|
+
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(IFrameSplitOperator.IsNumber(item.UnchangeBarType))klineChart.UnchangeBarType=item.UnchangeBarType;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(IFrameSplitOperator.IsBool(item.EnablePrediction))klineChart.PredictionConfig.Enable=item.EnablePrediction;if(IFrameSplitOperator.IsBool(item.EnableDaySummary))klineChart.DaySummary.Enable=item.EnableDaySummary;}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.IsShowDateTime))chartTitle.IsShowDateTime=item.IsShowDateTime;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(item.ShowPosition||item.ShowPostion)//显示位置高级配置
|
|
1205
1205
|
{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;}}}//叠加股票
|
|
1206
1206
|
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);}}//创建子窗口的指标
|
|
1207
1207
|
var scriptData=new JSIndexScript();if(option.ColorIndex)//五彩K线
|
|
@@ -2237,7 +2237,7 @@ if(IFrameSplitOperator.IsBool(windowItem.IsShowNameArrow))frame.IsShowNameArrow=
|
|
|
2237
2237
|
{frame.CustomToolbar=item.CustomToolbar.slice();}}if(IFrameSplitOperator.IsNumber(option.SplitCount))subFrame.Frame.YSplitOperator.SplitCount=option.SplitCount;if(IFrameSplitOperator.IsNumber(option.TitleHeight))subFrame.Frame.ChartBorder.TitleHeight=option.TitleHeight;if(IFrameSplitOperator.IsBool(option.IsShowTitleArrow))subFrame.Frame.IsShowTitleArrow=option.IsShowTitleArrow;if(IFrameSplitOperator.IsNumber(option.TitleArrowType))subFrame.Frame.TitleArrowType=option.TitleArrowType;if(IFrameSplitOperator.IsBool(option.IsShowIndexName))subFrame.Frame.IsShowIndexName=option.IsShowIndexName;if(IFrameSplitOperator.IsBool(option.IsShowOverlayIndexName))subFrame.Frame.IsShowOverlayIndexName=option.IsShowOverlayIndexName;if(IFrameSplitOperator.IsNumber(option.IndexParamSpace))subFrame.Frame.IndexParamSpace=option.IndexParamSpace;if(IFrameSplitOperator.IsBool(option.IsShowXLine))subFrame.Frame.IsShowXLine=option.IsShowXLine;if(IFrameSplitOperator.IsBool(option.IsShowYLine))subFrame.Frame.IsShowYLine=option.IsShowYLine;if(IFrameSplitOperator.IsBool(option.IsShowIndexTitle))subFrame.Frame.IsShowIndexTitle=option.IsShowIndexTitle;if(IFrameSplitOperator.IsNumber(option.Height))subFrame.Height=option.Height;//高度
|
|
2238
2238
|
if(IFrameSplitOperator.IsBool(option.IsShowLeftText)){subFrame.Frame.IsShowYText[0]=option.IsShowLeftText;subFrame.Frame.YSplitOperator.IsShowLeftText=option.IsShowLeftText;//显示左边刻度
|
|
2239
2239
|
}if(IFrameSplitOperator.IsBool(option.IsShowRightText)){subFrame.Frame.IsShowYText[1]=option.IsShowRightText;subFrame.Frame.YSplitOperator.IsShowRightText=option.IsShowRightText;//显示右边刻度
|
|
2240
|
-
}};this.AddNewSubFrame=function(option){var _this15=this;var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this15.GetEventCallback(id);};this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);this.UpdateSubFrameDataWidth(subFrame.Frame);//最后一个显示X轴坐标
|
|
2240
|
+
}};this.AddNewSubFrame=function(option){var _this15=this;var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this15.GetEventCallback(id);};titlePaint.HQChart=this;this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);this.UpdateSubFrameDataWidth(subFrame.Frame);//最后一个显示X轴坐标
|
|
2241
2241
|
for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.UpdataDataoffset();//更新数据偏移
|
|
2242
2242
|
this.Frame.SetSizeChage(true);if(this.UpdateXShowText)this.UpdateXShowText();this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
2243
2243
|
this.Draw();return index;};this.UpdateSubFrameDataWidth=function(frame){//同步柱子宽度
|
|
@@ -2283,7 +2283,7 @@ this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
|
2283
2283
|
this.Draw();}};//移动指标到新的指标窗口 src={ WindowIndex:指标窗口索引,IndexID:指标ID } , option={ Operator: 0=移动, 1=复制 }
|
|
2284
2284
|
this.MoveIndexToNewWindow=function(src,option){var _this17=this;if(!src||!option)return false;if(!IFrameSplitOperator.IsNumber(src.WindowIndex)||src.WindowIndex<0||src.WindowIndex>=this.Frame.SubFrame.length)return false;var find=this.FindScriptIndex(src.IndexID,src.WindowIndex);if(!find)return false;var findItem=null,findOverlayItem=null;if(find.Type==0)findItem=find.Data;else if(find.Type==1)findOverlayItem=find.Data;if(!findOverlayItem&&!findItem)return false;if(src.WindowIndex==this.Frame.SubFrame.length-1&&this.Frame.SubFrame[src.WindowIndex].OverlayIndex<=0)return false;//指标在最后一个窗口不需要移动
|
|
2285
2285
|
this.RemoveMinSizeWindows();//清空隐藏的指标
|
|
2286
|
-
var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.SelectedChart=this.SelectedChart;titlePaint.GetEventCallback=function(id){return _this17.GetEventCallback(id);};this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);//最后一个显示X轴坐标
|
|
2286
|
+
var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.SelectedChart=this.SelectedChart;titlePaint.GetEventCallback=function(id){return _this17.GetEventCallback(id);};titlePaint.HQChart=this;this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);//最后一个显示X轴坐标
|
|
2287
2287
|
for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}if(option.Operator==0)//移动模式, 删除原来的
|
|
2288
2288
|
{if(findOverlayItem)this.DeleteOverlayIndex(findOverlayItem.Identify,src.WindowIndex);else if(findItem)this.DeleteMainIndex(findItem.Guid,src.WindowIndex);}this.UpdataDataoffset();//更新数据偏移
|
|
2289
2289
|
this.Frame.SetSizeChage(true);if(this.UpdateXShowText)this.UpdateXShowText();this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
@@ -6038,7 +6038,7 @@ var text=g_JSChartLocalization.GetText('KTitle-Exchange',this.LanguageID)+IFrame
|
|
|
6038
6038
|
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())//鼠标不在图形上 显示最后一条数据
|
|
6039
6039
|
{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;}//叠加股票
|
|
6040
6040
|
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线指标标题信息
|
|
6041
|
-
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;//派生
|
|
6041
|
+
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(){if(this.HQChart&&this.HQChart.EnableClickModel&&this.HQChart.ClickModel){var clickModel=this.HQChart.ClickModel;if(clickModel.IsShowCorssCursor)return false;}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;//派生
|
|
6042
6042
|
this.newMethod();delete this.newMethod;this.ClassName='DynamicMinuteTitlePainting';this.SpaceWidth=1*GetDevicePixelRatio();this.YClose;this.IsShowDate=false;//标题是否显示日期
|
|
6043
6043
|
this.IsShowTime=true;//标题是否显示时间
|
|
6044
6044
|
this.IsShowName=true;//标题是否显示股票名字
|
|
@@ -6122,6 +6122,7 @@ this.SelectedChart;//选中的图形
|
|
|
6122
6122
|
this.ArgumentsText;//参数信息
|
|
6123
6123
|
this.MerginLeft=g_JSChartResource.IndexTitleMerginLeft;//标题输出左边间距
|
|
6124
6124
|
this.Buttons=[];//按钮
|
|
6125
|
+
this.NameButtonHeight=0;//指标名字按钮高度
|
|
6125
6126
|
this.UpDownArrowConfig={UpColor:g_JSChartResource.IndexTitle.UpDownArrow.UpColor,DownColor:g_JSChartResource.IndexTitle.UpDownArrow.DownColor,UnchangeColor:g_JSChartResource.IndexTitle.UpDownArrow.UnchangeColor};//K线标题颜色
|
|
6126
6127
|
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;//持仓
|
|
6127
6128
|
//动态标题
|
|
@@ -6136,9 +6137,9 @@ this.FormatStackedBarTitle=function(aryBar,dataInfo){if(!IFrameSplitOperator.IsN
|
|
|
6136
6137
|
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});}//涨幅
|
|
6137
6138
|
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))//成交量
|
|
6138
6139
|
{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))//成交金额
|
|
6139
|
-
{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.FormatIndexTitle=function(kItem,dataInfo){var result=null;var aryText=[];if(dataInfo.Name){aryText.push({Text:dataInfo.Name,Color:dataInfo.Color});result={Text:null,ArrayText:aryText};}if(!kItem)return result;if(!dataInfo.Chart)return result;var titleItem=dataInfo.Chart.GetItem(kItem);if(!titleItem||!titleItem.Data)return result;if(!IFrameSplitOperator.IsNonEmptyArray(titleItem.Data.AryText))return result;if(!result)result={Text:null,ArrayText:aryText};for(var i=0;i<titleItem.Data.AryText.length;++i){var item=titleItem.Data.AryText[i];if(!item)continue;var textItem={Name:null,Text:null};if(item.Name)textItem.Name=item.Name;if(item.Text)textItem.Text=item.Text;if(item.Color)textItem.Color=item.Color;if(IFrameSplitOperator.IsNumber(item.LeftSpace))textItem.LeftSpace=item.LeftSpace;aryText.push(textItem);}return result;};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;}//十字光标锁定状态 禁用显示最后一个数据
|
|
6140
|
+
{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.FormatIndexTitle=function(kItem,dataInfo){var result=null;var aryText=[];if(dataInfo.Name){aryText.push({Text:dataInfo.Name,Color:dataInfo.Color});result={Text:null,ArrayText:aryText};}if(!kItem)return result;if(!dataInfo.Chart)return result;var titleItem=dataInfo.Chart.GetItem(kItem);if(!titleItem||!titleItem.Data)return result;if(!IFrameSplitOperator.IsNonEmptyArray(titleItem.Data.AryText))return result;if(!result)result={Text:null,ArrayText:aryText};for(var i=0;i<titleItem.Data.AryText.length;++i){var item=titleItem.Data.AryText[i];if(!item)continue;var textItem={Name:null,Text:null};if(item.Name)textItem.Name=item.Name;if(item.Text)textItem.Text=item.Text;if(item.Color)textItem.Color=item.Color;if(IFrameSplitOperator.IsNumber(item.LeftSpace))textItem.LeftSpace=item.LeftSpace;aryText.push(textItem);}return result;};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(){if(this.HQChart&&this.HQChart.EnableClickModel&&this.HQChart.ClickModel){var clickModel=this.HQChart.ClickModel;if(clickModel.IsShowCorssCursor)return false;}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;}//十字光标锁定状态 禁用显示最后一个数据
|
|
6140
6141
|
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;//当前屏数据索引
|
|
6141
|
-
}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();/* 测试用
|
|
6142
|
+
}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=[];this.NameButtonHeight=0;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();/* 测试用
|
|
6142
6143
|
if (this.TitleRect)
|
|
6143
6144
|
{
|
|
6144
6145
|
this.Canvas.strokeStyle='rgba(200,0,50,0.5)';
|
|
@@ -6146,7 +6147,7 @@ if(this.GlobalOption&&this.GlobalOption.LockCorssCursor&&this.GlobalOption.LockC
|
|
|
6146
6147
|
}
|
|
6147
6148
|
*/return;}var left=this.Frame.ChartBorder.GetLeft()+this.MerginLeft;var bottom=this.Frame.ChartBorder.GetTop()+this.Frame.ChartBorder.TitleHeight/2;//上下居中显示
|
|
6148
6149
|
var right=this.Frame.ChartBorder.GetRight();var toolbarInfo={Width:0,YCenter:bottom};this.DrawToolbar(toolbarInfo,moveonPoint,mouseStatus);left+=toolbarInfo.Width;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.font=this.Font;var pixelRatio=GetDevicePixelRatio();if(this.Title&&this.IsShowIndexName&&this.IsShowMainIndexTitle){if(this.IsDrawTitleBG){var rtButton={Left:left,YCenter:bottom,Width:0};this.DrawNameButton(rtButton,moveonPoint,mouseStatus);this.Buttons.push({ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON,Rect:rtButton,FrameID:this.Frame.Identify,Type:2});//Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
6149
|
-
if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);this.TitleRect=rtButton;left+=rtButton.Width+3*pixelRatio;left+=this.TitleSpace;}else{var textWidth=this.Canvas.measureText(this.Title).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.Title,left,bottom,textWidth);if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}}if(this.ArgumentsText&&this.IsShowIndexName&&this.IsShowMainIndexTitle){var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.ArgumentsText,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}var isShowLastData=this.IsShowLastData();var lockRect=this.Frame.GetLockRect();if(lockRect)//指标上锁区域不显示动态标题
|
|
6150
|
+
this.NameButtonHeight=rtButton.Height;if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);this.TitleRect=rtButton;left+=rtButton.Width+3*pixelRatio;left+=this.TitleSpace;}else{var textWidth=this.Canvas.measureText(this.Title).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.Title,left,bottom,textWidth);if(this.IsSelectedChart(this.Identify))this.DrawSelectedLine(left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}}if(this.ArgumentsText&&this.IsShowIndexName&&this.IsShowMainIndexTitle){var textWidth=this.Canvas.measureText(this.ArgumentsText).width+2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.fillText(this.ArgumentsText,left,bottom,textWidth);left+=textWidth;left+=this.TitleSpace;}var isShowLastData=this.IsShowLastData();var lockRect=this.Frame.GetLockRect();if(lockRect)//指标上锁区域不显示动态标题
|
|
6150
6151
|
{var index=Math.abs(this.CursorIndex);if(this.IsKLineFrame)index=this.CursorIndex;var x=this.Frame.GetXFromIndex(index.toFixed(0));if(x>=lockRect.Left)return;if(isShowLastData)return;}var rtText={Left:left,Right:left};if(this.IsMinuteFrame&&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)){var result={PreventDefault:false};this.DrawMainCallAuction({Left:left,Right:right,Bottom:bottom},rtText,result);if(result.PreventDefault===false)this.DrawMainIndexTitle({Left:left,Right:right,Bottom:bottom},isShowLastData,rtText);}else{var yRight=right;if(this.Frame.ToolbarCacheSize&&this.Frame.ToolbarCacheSize.RToolbar)yRight=this.Frame.ToolbarCacheSize.RToolbar.Left-2;//右侧按钮宽度要去掉
|
|
6151
6152
|
this.DrawMainIndexTitle({Left:left,Right:yRight,Bottom:bottom},isShowLastData,rtText);if(IFrameSplitOperator.IsNumber(rtText.Bottom))bottom=rtText.Bottom;}left=rtText.Left;if(this.Explain)//说明信息
|
|
6152
6153
|
{this.Canvas.fillStyle=this.TitleColor;var text="说明:"+this.Explain;var textWidth=this.Canvas.measureText(text).width+2;if(left+textWidth<right){this.Canvas.fillText(text,left,bottom,textWidth);left+=textWidth;}}if(this.ColorIndex&&this.IsShowColorIndexTitle){this.Canvas.fillStyle=g_JSChartResource.Title.ColorIndexColor;var tradeName=this.ColorIndex.Name+this.ColorIndex.Param;var textWidth=this.Canvas.measureText(tradeName).width+2;//后空2个像素
|
|
@@ -6164,7 +6165,7 @@ var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线
|
|
|
6164
6165
|
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);//动态标题
|
|
6165
6166
|
if(dyTitle)text=dyTitle;outItem.Name=text;}//outItem.BG='rgb(100,100,100)';
|
|
6166
6167
|
aryText=[outItem];valueText=null;}}}return{Text:valueText,ArrayText:aryText};};//绘制主图指标 rtText 返回画完以后的区域
|
|
6167
|
-
this.DrawMainIndexTitle=function(positionInfo,isShowLastData,rtText){if(!this.IsShowMainIndexTitle)return;var left=positionInfo.Left;var newLineLeft=this.Frame.ChartBorder.GetLeft()+this.MerginLeft+5;var right=positionInfo.Right;var bottom=positionInfo.Bottom;var pixelRatio=GetDevicePixelRatio();var lineHeight=this.Canvas.measureText("擎").width+2;for(var i=0;i<this.Data.length;++i){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText)//多变量输出
|
|
6168
|
+
this.DrawMainIndexTitle=function(positionInfo,isShowLastData,rtText){if(!this.IsShowMainIndexTitle)return;var left=positionInfo.Left;var newLineLeft=this.Frame.ChartBorder.GetLeft()+this.MerginLeft+5;var right=positionInfo.Right;var bottom=positionInfo.Bottom;var pixelRatio=GetDevicePixelRatio();var lineHeight=this.Canvas.measureText("擎").width+2;if(lineHeight<this.NameButtonHeight)lineHeight=this.NameButtonHeight;for(var i=0;i<this.Data.length;++i){var item=this.Data[i];var outText=this.GetTitleItem(item,isShowLastData,i);if(!outText)continue;var valueText=outText.Text;var aryText=outText.ArrayText;if(aryText)//多变量输出
|
|
6168
6169
|
{var text;for(var k=0;k<aryText.length;++k){var titleItem=aryText[k];if(titleItem.Name)text=titleItem.Name+":"+titleItem.Text;else text=titleItem.Text;if(IFrameSplitOperator.IsNumber(titleItem.LeftSpace))left+=titleItem.LeftSpace*pixelRatio;var space=this.ParamSpace*pixelRatio;var indexTextWidth=this.Canvas.measureText(text).width;//标题+数值长度
|
|
6169
6170
|
var textWidth=indexTextWidth;if(IFrameSplitOperator.IsNonEmptyArray(titleItem.TextEx)){var xLeft=left;for(var n=0;n<titleItem.TextEx.length;++n){var outItem=titleItem.TextEx[n];var outTextWidth=this.Canvas.measureText(outItem.Text).width+2;outItem.Width=outTextWidth;outItem.Left=xLeft;textWidth+=outTextWidth;xLeft+=outTextWidth;}}if(left+textWidth+space>right){left=newLineLeft;bottom+=lineHeight;right=this.Frame.ChartBorder.GetRight();//第2行以后 右侧边框
|
|
6170
6171
|
}if(titleItem.BG)//背景
|
|
@@ -7456,7 +7457,7 @@ this.ChartSplashPaint=new ChartSplashPaint();this.ChartSplashPaint.Canvas=this.C
|
|
|
7456
7457
|
this.Frame=new HQTradeFrame();this.Frame.ChartBorder=new ChartBorder();this.Frame.ChartBorder.UIElement=this.UIElement;this.Frame.ChartBorder.Top=30;this.Frame.ChartBorder.Left=5;this.Frame.ChartBorder.Bottom=20;this.Frame.Canvas=this.Canvas;this.Frame.GetExtendChartRightWidth=function(){return _this20.GetExtendChartRightWidth();};this.Frame.GetExtendChartByClassName=function(name){return _this20.GetExtendChartByClassName(name);};this.Frame.GetEventCallback=function(id){return _this20.GetEventCallback(id);};this.ChartCorssCursor.Frame=this.Frame;//十字光标绑定框架
|
|
7457
7458
|
this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.CreateMainKLine();this.CreateExtendChart("RectSelectPaint",option?option.SelectRect:null);//区间统计
|
|
7458
7459
|
if(this.EnableIndexChartDrag)this.CreateExtendChart("DragMovePaint");this.CreateDragSelectRect(option?option.DragSelectRect:null);//子窗口动态标题
|
|
7459
|
-
for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this20.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;var bRegisterKeydown=true;var bRegisterWheel=true;if(option&&option.Listener){var item=option.Listener;if(item.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[KLineChartContainer::Create] not register keydown event.');}if(item.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[KLineChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this20.OnKeyDown(e);},true);//键盘消息
|
|
7460
|
+
for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this20.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;var bRegisterKeydown=true;var bRegisterWheel=true;if(option&&option.Listener){var item=option.Listener;if(item.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[KLineChartContainer::Create] not register keydown event.');}if(item.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[KLineChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this20.OnKeyDown(e);},true);//键盘消息
|
|
7460
7461
|
if(bRegisterWheel)this.UIElement.addEventListener("wheel",function(e){_this20.OnWheel(e);},true);//上下滚动消息
|
|
7461
7462
|
this.InitalPopMinuteChart(option);};this.InitalPopMinuteChart=function(option){if(!option)return false;if(option.PopMinuteChart&&option.PopMinuteChart.Enable)//新的配置格式
|
|
7462
7463
|
{var item=option.PopMinuteChart;this.PopMinuteChart=new JSPopMinuteChart();this.PopMinuteChart.Inital(this,item);this.PopMinuteChart.Create();return true;}else if(option.KLine&&option.KLine.KLineDoubleClick===true)//旧的格式 不要使用了
|
|
@@ -7998,7 +7999,7 @@ this.Frame.SetSizeChage(true);this.Draw();};//设置指标窗口个数
|
|
|
7998
7999
|
this.ChangeIndexWindowCount=function(count,option){var _this25=this;if(count<=0)return;if(this.Frame.SubFrame.length==count)return;this.Frame.RestoreIndexWindows();var currentLength=this.Frame.SubFrame.length;if(currentLength>count){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);for(var i=currentLength-1;i>=count;--i){this.DeleteIndexPaint(i);this.DeleteChartPaintExtend({WindowIndex:i});this.Frame.SubFrame[i].Frame.ClearToolbar();if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}this.Frame.SubFrame.splice(count,currentLength-count);this.WindowIndex.splice(count,currentLength-count);this.TitlePaint.splice(count+1,currentLength-count);//最后一个显示X轴坐标
|
|
7999
8000
|
for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.Frame.SetSizeChage(true);this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
8000
8001
|
this.Draw();}else{//创建新的指标窗口
|
|
8001
|
-
var pixelRatio=GetDevicePixelRatio();for(var i=currentLength;i<count;++i){var subFrame=this.CreateSubFrameItem(i);subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this25.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint[i+1]=titlePaint;}//最后一个显示X轴坐标
|
|
8002
|
+
var pixelRatio=GetDevicePixelRatio();for(var i=currentLength;i<count;++i){var subFrame=this.CreateSubFrameItem(i);subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this25.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint[i+1]=titlePaint;}//最后一个显示X轴坐标
|
|
8002
8003
|
for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.Frame.SetSizeChage(true);this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
8003
8004
|
this.Draw();//创建指标
|
|
8004
8005
|
var indexName=[{Index:"RSI"},{Index:"MACD"},{Index:"VOL"},{Index:"UOS"},{Index:"CHO"},{Index:"BRAR"}];//增加的指标名字
|
|
@@ -8014,7 +8015,7 @@ var subFrame=this.Frame.SubFrame[i];if(item.Modify!=null)this.Frame.SubFrame[i].
|
|
|
8014
8015
|
if(IFrameSplitOperator.IsNumber(option.KLine.Right)&&option.KLine.Right!=this.Right)right=option.KLine.Right;//复权
|
|
8015
8016
|
}var bRefreshData=period!=null||right!=null||symbol!=null;//清空所有的指标图型
|
|
8016
8017
|
for(var i=0;i<currentLength;++i){this.DeleteIndexPaint(i);var frame=this.Frame.SubFrame[i];frame.YSpecificMaxMin=null;frame.IsLocked=false;frame.YSplitScale=null;}if(currentLength>count){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);for(var i=currentLength-1;i>=count;--i){this.Frame.SubFrame[i].Frame.ClearToolbar();if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}this.Frame.SubFrame.splice(count,currentLength-count);this.WindowIndex.splice(count,currentLength-count);this.TitlePaint.splice(count+1,currentLength-count);}else{for(var i=currentLength;i<count;++i)//创建新的指标窗口
|
|
8017
|
-
{var subFrame=this.CreateSubFrameItem(i);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this26.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint[i+1]=titlePaint;}}for(var i=0;i<count;++i){var windowIndex=i;var item=option.Windows[i];var frameItem=null;if(option.Frame&&option.Frame.length>i)frameItem=option.Frame[i];var titleIndex=windowIndex+1;this.TitlePaint[titleIndex].Data=[];this.TitlePaint[titleIndex].Title=null;var frame=this.Frame.SubFrame[i];this.DeleteWindowsOverlayIndex(i);//清空叠加指标
|
|
8018
|
+
{var subFrame=this.CreateSubFrameItem(i);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this26.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint[i+1]=titlePaint;}}for(var i=0;i<count;++i){var windowIndex=i;var item=option.Windows[i];var frameItem=null;if(option.Frame&&option.Frame.length>i)frameItem=option.Frame[i];var titleIndex=windowIndex+1;this.TitlePaint[titleIndex].Data=[];this.TitlePaint[titleIndex].Title=null;var frame=this.Frame.SubFrame[i];this.DeleteWindowsOverlayIndex(i);//清空叠加指标
|
|
8018
8019
|
if(item.Script)//自定义指标脚本
|
|
8019
8020
|
{this.WindowIndex[i]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
|
|
8020
8021
|
}else if(item.API)//后台指标
|
|
@@ -8665,12 +8666,12 @@ this.ChartSplashPaint=new ChartSplashPaint();this.ChartSplashPaint.Canvas=this.C
|
|
|
8665
8666
|
this.Frame=new HQTradeFrame();this.Frame.ChartBorder=new ChartBorder();this.Frame.ChartBorder.UIElement=this.UIElement;this.Frame.ChartBorder.Top=25;this.Frame.ChartBorder.TitleHeight=0;this.Frame.ChartBorder.Left=50;this.Frame.ChartBorder.Bottom=20;this.Frame.Canvas=this.Canvas;this.Frame.GetExtendChartRightWidth=function(){return _this29.GetExtendChartRightWidth();};this.Frame.GetEventCallback=function(id){return _this29.GetEventCallback(id);};this.Frame.ZoomStartWindowIndex=2;this.ChartCorssCursor.Frame=this.Frame;//十字光标绑定框架
|
|
8666
8667
|
this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.CreateMainKLine();this.CreateExtendChart("RectSelectPaint",option?option.SelectRect:null);//区间统计
|
|
8667
8668
|
if(this.EnableIndexChartDrag)this.CreateExtendChart("DragMovePaint");this.CreateDragSelectRect(option?option.DragSelectRect:null);//子窗口动态标题
|
|
8668
|
-
for(var i=0;i<this.Frame.SubFrame.length;++i){var titlePaint=new DynamicChartTitlePainting();if(i==0||i==1)titlePaint.IsShowMainIndexTitle=false;titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this29.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.MainTitlePaint=this.TitlePaint[0];this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;if(this.ChartCorssCursor.CallAcutionXOperator)this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;var bRegisterKeydown=true;var bRegisterWheel=true;if(option&&option.Listener){var item=option.Listener;if(item.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register keydown event.');}if(item.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this29.OnKeyDown(e);},true);//键盘消息
|
|
8669
|
+
for(var i=0;i<this.Frame.SubFrame.length;++i){var titlePaint=new DynamicChartTitlePainting();if(i==0||i==1)titlePaint.IsShowMainIndexTitle=false;titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this29.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.MainTitlePaint=this.TitlePaint[0];titlePaint.HQChart=this;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;if(this.ChartCorssCursor.CallAcutionXOperator)this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;var bRegisterKeydown=true;var bRegisterWheel=true;if(option&&option.Listener){var item=option.Listener;if(item.KeyDown===false){bRegisterKeydown=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register keydown event.');}if(item.Wheel===false){bRegisterWheel=false;JSConsole.Chart.Log('[MinuteChartContainer::Create] not register wheel event.');}}if(bRegisterKeydown)this.UIElement.addEventListener("keydown",function(e){_this29.OnKeyDown(e);},true);//键盘消息
|
|
8669
8670
|
if(bRegisterWheel)this.UIElement.addEventListener("wheel",function(e){_this29.OnWheel(e);},true);//上下滚动消息
|
|
8670
8671
|
};//创建子窗口
|
|
8671
8672
|
this.CreateChildWindow=function(windowCount){var _this30=this;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_FRAME);for(var i=0;i<windowCount;++i){var border=new ChartBorder();border.UIElement=this.UIElement;var frame=new MinuteFrame();frame.Canvas=this.Canvas;frame.ChartBorder=border;frame.Identify=i;frame.GlobalOption=this.GlobalOption;if(i<2)frame.ChartBorder.TitleHeight=0;frame.XPointCount=243;frame.HQChart=this;frame.GetEventCallback=function(id){return _this30.GetEventCallback(id);};if(i>=2){}var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];frame.HorizontalMax=DEFAULT_HORIZONTAL[0];frame.HorizontalMin=DEFAULT_HORIZONTAL[DEFAULT_HORIZONTAL.length-1];if(i==0){frame.YSplitOperator=new FrameSplitMinutePriceY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');frame.YSplitOperator.GetEventCallback=function(id){return _this30.GetEventCallback(id);};frame.YSplitOperator.DayOffset=this.DayOffset;frame.YSplitOperator.GlobalOption=this.GlobalOption;frame.YSplitOperator.HQChart=this;}else{frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this30.GetEventCallback(id);};if(i==1)frame.YSplitOperator.ShareAfterVol=this.ShareAfterVol;}frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitMinuteX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.DayOffset=this.DayOffset;frame.XSplitOperator.GetEventCallback=function(id){return _this30.GetEventCallback(id);};if(i!=windowCount-1)frame.XSplitOperator.ShowText=false;frame.XSplitOperator.Operator();for(var j in DEFAULT_HORIZONTAL){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=DEFAULT_HORIZONTAL[j];if(i==0&&j==frame.HorizontalMin)continue;frame.HorizontalInfo[j].Message[1]=DEFAULT_HORIZONTAL[j].toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;if(i==0)subFrame.Height=20;else subFrame.Height=10;this.Frame.SubFrame[i]=subFrame;if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}};this.CreateSubFrameItem=function(id,mainFrame){var _this31=this;var border=new ChartBorder();border.UIElement=this.UIElement;if(mainFrame&&mainFrame.ChartBorder&&mainFrame.ChartBorder.MultiDayMinute){var item=mainFrame.ChartBorder.MultiDayMinute;border.MultiDayMinute.Count=item.Count;border.MultiDayMinute.Left=item.Left;border.MultiDayMinute.Right=item.Right;}var frame=null;if(this.ClassName=="MinuteChartHScreenContainer")frame=new MinuteHScreenFrame();else frame=new MinuteFrame();frame.Canvas=this.Canvas;frame.ChartBorder=border;frame.Identify=id;//窗口序号
|
|
8672
8673
|
frame.XPointCount=243;frame.GlobalOption=this.GlobalOption;frame.HQChart=this;frame.GetEventCallback=function(id){return _this31.GetEventCallback(id);};var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];frame.HorizontalMax=DEFAULT_HORIZONTAL[0];frame.HorizontalMin=DEFAULT_HORIZONTAL[DEFAULT_HORIZONTAL.length-1];frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitMinuteX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.ShowText=false;frame.XSplitOperator.DayOffset=this.DayOffset;frame.XSplitOperator.GetEventCallback=function(id){return _this31.GetEventCallback(id);};frame.YSplitOperator.GetEventCallback=function(id){return _this31.GetEventCallback(id);};frame.XSplitOperator.Symbol=this.Symbol;if(this.DayCount>1){var dayCount=this.DayCount;if(IFrameSplitOperator.IsNonEmptyArray(this.DayData))dayCount=this.DayData.length;frame.XSplitOperator.DayCount=dayCount;frame.XSplitOperator.DayData=this.DayData;frame.DayCount=dayCount;}//K线数据绑定
|
|
8673
|
-
var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;frame.XPointCount=xPointCouont;frame.Data=this.ChartPaint[0].Data;for(var j in DEFAULT_HORIZONTAL){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=DEFAULT_HORIZONTAL[j];frame.HorizontalInfo[j].Message[1]=DEFAULT_HORIZONTAL[j].toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;subFrame.Height=10;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_FRAME);if(event&&event.Callback){var sendData={SubFrame:subFrame,WindowIndex:id};event.Callback(event,sendData,this);}return subFrame;};this.AddNewSubFrame=function(option){var _this32=this;var mainFrame=this.Frame.SubFrame[0].Frame;var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index,mainFrame);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this32.GetEventCallback(id);};titlePaint.MainTitlePaint=this.TitlePaint[0];this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);this.UpdateSubFrameDataWidth(subFrame.Frame);//最后一个显示X轴坐标
|
|
8674
|
+
var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;frame.XPointCount=xPointCouont;frame.Data=this.ChartPaint[0].Data;for(var j in DEFAULT_HORIZONTAL){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=DEFAULT_HORIZONTAL[j];frame.HorizontalInfo[j].Message[1]=DEFAULT_HORIZONTAL[j].toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;subFrame.Height=10;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_FRAME);if(event&&event.Callback){var sendData={SubFrame:subFrame,WindowIndex:id};event.Callback(event,sendData,this);}return subFrame;};this.AddNewSubFrame=function(option){var _this32=this;var mainFrame=this.Frame.SubFrame[0].Frame;var index=this.Frame.SubFrame.length;var subFrame=this.CreateSubFrameItem(index,mainFrame);var pixelRatio=GetDevicePixelRatio();subFrame.Frame.ChartBorder.TitleHeight*=pixelRatio;this.Frame.SubFrame[index]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[index].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this32.GetEventCallback(id);};titlePaint.MainTitlePaint=this.TitlePaint[0];titlePaint.HQChart=this;this.TitlePaint[index+1]=titlePaint;this.SetSubFrameOption(subFrame,option);this.UpdateSubFrameDataWidth(subFrame.Frame);//最后一个显示X轴坐标
|
|
8674
8675
|
for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.UpdataDataoffset();//更新数据偏移
|
|
8675
8676
|
this.Frame.SetSizeChage(true);if(this.UpdateXShowText)this.UpdateXShowText();this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
8676
8677
|
this.Draw();return index;};this.UpdateXShowText=function(){var bLastFrame=true;for(var i=this.Frame.SubFrame.length-1;i>=0;--i){var item=this.Frame.SubFrame[i].Frame;var subFrame=this.Frame.SubFrame[i];if(bLastFrame){item.XSplitOperator.ShowText=true;if(subFrame.Height>0)bLastFrame=false;}else{item.XSplitOperator.ShowText=false;}}};//删除某一个窗口的指标
|
|
@@ -8699,7 +8700,7 @@ this.Draw();};this.ChangeIndex=function(windowIndex,indexName,option){if(this.Fr
|
|
|
8699
8700
|
var scriptData=new JSIndexScript();var indexInfo=scriptData.Get(indexName);if(!indexInfo)return;if(windowIndex<2)windowIndex=2;if(windowIndex>=this.Frame.SubFrame.length)windowIndex=2;JSIndexScript.ModifyAttribute(indexInfo,option);return this.ChangeScriptIndex(windowIndex,indexInfo,option);};//设置指标窗口个数
|
|
8700
8701
|
this.ChangeIndexWindowCount=function(count){var _this34=this;if(count<2)return;//1,2个窗口固定的不能动
|
|
8701
8702
|
if(this.Frame.SubFrame.length==count)return;var currentLength=this.Frame.SubFrame.length;if(currentLength>count){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);for(var i=currentLength-1;i>=count;--i){this.DeleteIndexPaint(i);this.DeleteChartPaintExtend({WindowIndex:i});var item=this.Frame.SubFrame[i].Frame;if(item.ClearToolbar)item.ClearToolbar();if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}this.Frame.SubFrame.splice(count,currentLength-count);this.WindowIndex.splice(count,currentLength-count);this.TitlePaint.splice(count+1,currentLength-count);}else{//创建新的指标窗口
|
|
8702
|
-
var mainFrame=this.Frame.SubFrame[0].Frame;for(var i=currentLength;i<count;++i){var subFrame=this.CreateSubFrameItem(i,mainFrame);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this34.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.MainTitlePaint=this.TitlePaint[0];this.TitlePaint[i+1]=titlePaint;}//创建指标
|
|
8703
|
+
var mainFrame=this.Frame.SubFrame[0].Frame;for(var i=currentLength;i<count;++i){var subFrame=this.CreateSubFrameItem(i,mainFrame);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this34.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.MainTitlePaint=this.TitlePaint[0];titlePaint.HQChart=this;this.TitlePaint[i+1]=titlePaint;}//创建指标
|
|
8703
8704
|
var indexName=["RSI","MACD","DMA","DMI","KDJ","WR"];var scriptData=new JSIndexScript();for(var i=currentLength;i<count;++i){var name=indexName[i%indexName.length];var indexInfo=scriptData.Get(name);this.WindowIndex[i]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
|
|
8704
8705
|
var bindData=this.SourceData;this.BindIndexData(i,bindData);//执行脚本
|
|
8705
8706
|
}//最后一个显示X轴坐标
|
|
@@ -8709,7 +8710,7 @@ this.Draw();};this.ChangeIndexTemplate=function(option)//切换指标模板 可
|
|
|
8709
8710
|
{var _this35=this;if(!Array.isArray(option.Windows))return;var count=option.Windows.length;var currentLength=this.Frame.SubFrame.length;var startWindowIndex=2;count+=startWindowIndex;var dayCount=null,symbol=null;if(IFrameSplitOperator.IsNumber(option.DayCount)&&option.DayCount!=this.DayCount)dayCount=option.DayCount;//天数
|
|
8710
8711
|
if(option.Symbol)symbol=option.Symbol;var bRefreshData=dayCount!=null||symbol!=null;//清空所有的指标图型
|
|
8711
8712
|
for(var i=startWindowIndex;i<currentLength;++i){this.DeleteIndexPaint(i);var frame=this.Frame.SubFrame[i];frame.YSpecificMaxMin=null;frame.IsLocked=false;frame.YSplitScale=null;}if(currentLength>count){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);for(var i=currentLength-1;i>=count;--i){this.Frame.SubFrame[i].Frame.ClearToolbar();if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}this.Frame.SubFrame.splice(count,currentLength-count);this.WindowIndex.splice(count,currentLength-count);this.TitlePaint.splice(count+1,currentLength-count);}else{for(var i=currentLength;i<count;++i)//创建新的指标窗口
|
|
8712
|
-
{var subFrame=this.CreateSubFrameItem(i);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this35.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.MainTitlePaint=this.TitlePaint[0];this.TitlePaint[i+1]=titlePaint;}}for(var i=0;i<count;++i){var windowIndex=i;var item=null,frameItem=null;if(option.Frame&&option.Frame.length>i)frameItem=option.Frame[windowIndex];if(windowIndex>=startWindowIndex)item=option.Windows[windowIndex-startWindowIndex];var titleIndex=windowIndex+1;this.TitlePaint[titleIndex].Data=[];this.TitlePaint[titleIndex].Title=null;if(item){if(item.Script)//自定义指标脚本
|
|
8713
|
+
{var subFrame=this.CreateSubFrameItem(i);this.Frame.SubFrame[i]=subFrame;var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this35.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.MainTitlePaint=this.TitlePaint[0];titlePaint.HQChart=this;this.TitlePaint[i+1]=titlePaint;}}for(var i=0;i<count;++i){var windowIndex=i;var item=null,frameItem=null;if(option.Frame&&option.Frame.length>i)frameItem=option.Frame[windowIndex];if(windowIndex>=startWindowIndex)item=option.Windows[windowIndex-startWindowIndex];var titleIndex=windowIndex+1;this.TitlePaint[titleIndex].Data=[];this.TitlePaint[titleIndex].Title=null;if(item){if(item.Script)//自定义指标脚本
|
|
8713
8714
|
{this.WindowIndex[windowIndex]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
|
|
8714
8715
|
}else if(item.API)//后台指标
|
|
8715
8716
|
{var apiItem=item.API;this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);}else{var indexID=item.Index;var indexItem=JSIndexMap.Get(indexID);if(indexItem){this.WindowIndex[windowIndex]=indexItem.Create();this.CreateWindowIndex(windowIndex);}else{var systemScript=new JSIndexScript();var indexInfo=systemScript.Get(indexID);if(indexInfo){JSIndexScript.ModifyAttribute(indexInfo,item);this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
|
|
@@ -9213,7 +9214,7 @@ this.ChartCorssCursor=new ChartCorssCursor();this.ChartCorssCursor.Canvas=this.C
|
|
|
9213
9214
|
this.ChartSplashPaint=new ChartSplashPaint();this.ChartSplashPaint.Canvas=this.Canvas;this.ChartSplashPaint.HQChart=this;//创建框架容器
|
|
9214
9215
|
this.Frame=new HQTradeHScreenFrame();this.Frame.ChartBorder=new ChartBorder();this.Frame.ChartBorder.UIElement=this.UIElement;this.Frame.ChartBorder.Top=30;this.Frame.ChartBorder.Left=5;this.Frame.ChartBorder.Bottom=20;this.Frame.Canvas=this.Canvas;this.ChartCorssCursor.Frame=this.Frame;//十字光标绑定框架
|
|
9215
9216
|
this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.CreateMainKLine();//子窗口动态标题
|
|
9216
|
-
for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this39.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint.push(titlePaint);}this.UIElement.addEventListener("keydown",OnKeyDown,true);//键盘消息
|
|
9217
|
+
for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this39.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint.push(titlePaint);}this.UIElement.addEventListener("keydown",OnKeyDown,true);//键盘消息
|
|
9217
9218
|
};//创建子窗口
|
|
9218
9219
|
this.CreateChildWindow=function(windowCount){var _this40=this;for(var i=0;i<windowCount;++i){var border=new ChartBorder();border.UIElement=this.UIElement;var frame=g_ChartFrameFactory.Create("KLineHScreenFrame",{ID:i});frame.Canvas=this.Canvas;frame.GetExtraCanvas=function(name){return _this40.GetExtraCanvas(name);};frame.ChartBorder=border;frame.Identify=i;//窗口序号
|
|
9219
9220
|
frame.RightSpaceCount=this.RightSpaceCount;//右边
|
|
@@ -9233,7 +9234,7 @@ this.ChartCorssCursor=new ChartCorssCursor();this.ChartCorssCursor.PtInClient=fu
|
|
|
9233
9234
|
this.ChartSplashPaint=new ChartSplashPaint();this.ChartSplashPaint.Canvas=this.Canvas;this.ChartSplashPaint.HQChart=this;//创建框架容器
|
|
9234
9235
|
this.Frame=new HQTradeHScreenFrame();this.Frame.ChartBorder=new ChartBorder();this.Frame.ChartBorder.UIElement=this.UIElement;this.Frame.ChartBorder.Top=25;this.Frame.ChartBorder.Left=50;this.Frame.ChartBorder.Bottom=20;this.Frame.Canvas=this.Canvas;this.ChartCorssCursor.Frame=this.Frame;//十字光标绑定框架
|
|
9235
9236
|
this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.CreateMainKLine();//子窗口动态标题
|
|
9236
|
-
for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this41.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;this.UIElement.addEventListener("keydown",OnKeyDown,true);//键盘消息
|
|
9237
|
+
for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this41.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;this.ChartCorssCursor.CallAcutionXOperator.Frame=this.Frame.SubFrame[0].Frame;this.UIElement.addEventListener("keydown",OnKeyDown,true);//键盘消息
|
|
9237
9238
|
};//创建子窗口
|
|
9238
9239
|
this.CreateChildWindow=function(windowCount){var _this42=this;for(var i=0;i<windowCount;++i){var border=new ChartBorder();border.UIElement=this.UIElement;var frame=new MinuteHScreenFrame();frame.Canvas=this.Canvas;frame.ChartBorder=border;frame.Identify=i;if(i<2)frame.ChartBorder.TitleHeight=0;frame.XPointCount=243;frame.HQChart=this;frame.GetEventCallback=function(id){return _this42.GetEventCallback(id);};var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];frame.HorizontalMax=DEFAULT_HORIZONTAL[0];frame.HorizontalMin=DEFAULT_HORIZONTAL[DEFAULT_HORIZONTAL.length-1];if(i==0){frame.YSplitOperator=new FrameSplitMinutePriceY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');frame.YSplitOperator.GetEventCallback=function(id){return _this42.GetEventCallback(id);};frame.YSplitOperator.DayOffset=this.DayOffset;frame.YSplitOperator.HQChart=this;}else{frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this42.GetEventCallback(id);};}frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitMinuteX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.DayOffset=this.DayOffset;frame.XSplitOperator.GetEventCallback=function(id){return _this42.GetEventCallback(id);};if(i!=windowCount-1)frame.XSplitOperator.ShowText=false;frame.XSplitOperator.Operator();for(var j in DEFAULT_HORIZONTAL){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=DEFAULT_HORIZONTAL[j];if(i==0&&j==frame.HorizontalMin)continue;frame.HorizontalInfo[j].Message[1]=DEFAULT_HORIZONTAL[j].toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;if(i==0)subFrame.Height=20;else subFrame.Height=10;this.Frame.SubFrame[i]=subFrame;}};}/////////////////////////////////////////////////////////////////////////////////
|
|
9239
9240
|
// 深度图
|
|
@@ -14788,7 +14789,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
14788
14789
|
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);};}/********************************************************************************
|
|
14789
14790
|
* 版本信息输出
|
|
14790
14791
|
*
|
|
14791
|
-
*/var HQCHART_VERSION="1.1.
|
|
14792
|
+
*/var HQCHART_VERSION="1.1.14712";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();//把给外界调用的方法暴露出来
|
|
14792
14793
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
14793
14794
|
// BaseIndex:BaseIndex,
|
|
14794
14795
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -613,7 +613,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
613
613
|
if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
|
|
614
614
|
if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
|
|
615
615
|
if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
|
|
616
|
-
if(IFrameSplitOperator.IsBool(item.
|
|
616
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
617
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
617
618
|
|
|
618
619
|
if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
|
|
619
620
|
{
|
|
@@ -9768,6 +9769,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9768
9769
|
titlePaint.Canvas=this.Canvas;
|
|
9769
9770
|
titlePaint.LanguageID=this.LanguageID;
|
|
9770
9771
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
9772
|
+
titlePaint.HQChart=this;
|
|
9771
9773
|
this.TitlePaint[index+1]=titlePaint;
|
|
9772
9774
|
|
|
9773
9775
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -10261,6 +10263,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10261
10263
|
titlePaint.LanguageID=this.LanguageID;
|
|
10262
10264
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
10263
10265
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
10266
|
+
titlePaint.HQChart=this;
|
|
10264
10267
|
this.TitlePaint[index+1]=titlePaint;
|
|
10265
10268
|
|
|
10266
10269
|
this.SetSubFrameOption(subFrame, option);
|
|
@@ -59357,7 +59360,14 @@ function DynamicKLineTitlePainting()
|
|
|
59357
59360
|
|
|
59358
59361
|
this.IsShowLastData=function()
|
|
59359
59362
|
{
|
|
59363
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
59364
|
+
{
|
|
59365
|
+
var clickModel=this.HQChart.ClickModel;
|
|
59366
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
59367
|
+
}
|
|
59368
|
+
|
|
59360
59369
|
var isShow=false;
|
|
59370
|
+
|
|
59361
59371
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
59362
59372
|
{
|
|
59363
59373
|
var status=this.DrawStatus;
|
|
@@ -60134,6 +60144,7 @@ function DynamicChartTitlePainting()
|
|
|
60134
60144
|
this.MerginLeft=g_JSChartResource.IndexTitleMerginLeft; //标题输出左边间距
|
|
60135
60145
|
|
|
60136
60146
|
this.Buttons=[]; //按钮
|
|
60147
|
+
this.NameButtonHeight=0; //指标名字按钮高度
|
|
60137
60148
|
|
|
60138
60149
|
this.UpDownArrowConfig=
|
|
60139
60150
|
{
|
|
@@ -60702,6 +60713,12 @@ function DynamicChartTitlePainting()
|
|
|
60702
60713
|
|
|
60703
60714
|
this.IsShowLastData=function()
|
|
60704
60715
|
{
|
|
60716
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
60717
|
+
{
|
|
60718
|
+
var clickModel=this.HQChart.ClickModel;
|
|
60719
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
60720
|
+
}
|
|
60721
|
+
|
|
60705
60722
|
var isShowLastData=false;
|
|
60706
60723
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
60707
60724
|
{
|
|
@@ -60760,6 +60777,7 @@ function DynamicChartTitlePainting()
|
|
|
60760
60777
|
this.Draw=function(moveonPoint, mouseStatus)
|
|
60761
60778
|
{
|
|
60762
60779
|
this.Buttons=[];
|
|
60780
|
+
this.NameButtonHeight=0;
|
|
60763
60781
|
if (this.Frame.IsMinSize) return;
|
|
60764
60782
|
|
|
60765
60783
|
this.IsKLineFrame= this.Frame.IsKLineFrame(false);
|
|
@@ -60822,6 +60840,7 @@ function DynamicChartTitlePainting()
|
|
|
60822
60840
|
this.DrawNameButton(rtButton, moveonPoint, mouseStatus);
|
|
60823
60841
|
|
|
60824
60842
|
this.Buttons.push({ ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON, Rect:rtButton, FrameID:this.Frame.Identify, Type:2 }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
60843
|
+
this.NameButtonHeight=rtButton.Height;
|
|
60825
60844
|
|
|
60826
60845
|
if (this.IsSelectedChart(this.Identify))
|
|
60827
60846
|
this.DrawSelectedLine(left, bottom, textWidth);
|
|
@@ -61110,6 +61129,7 @@ function DynamicChartTitlePainting()
|
|
|
61110
61129
|
var bottom=positionInfo.Bottom;
|
|
61111
61130
|
var pixelRatio=GetDevicePixelRatio();
|
|
61112
61131
|
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
61132
|
+
if (lineHeight<this.NameButtonHeight) lineHeight=this.NameButtonHeight;
|
|
61113
61133
|
for(var i=0; i<this.Data.length; ++i)
|
|
61114
61134
|
{
|
|
61115
61135
|
var item=this.Data[i];
|
|
@@ -79165,7 +79185,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
79165
79185
|
titlePaint.LanguageID=this.LanguageID;
|
|
79166
79186
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
79167
79187
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
79168
|
-
|
|
79188
|
+
titlePaint.HQChart=this;
|
|
79169
79189
|
this.TitlePaint.push(titlePaint);
|
|
79170
79190
|
}
|
|
79171
79191
|
|
|
@@ -82653,6 +82673,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82653
82673
|
titlePaint.LanguageID=this.LanguageID;
|
|
82654
82674
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
82655
82675
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
82676
|
+
titlePaint.HQChart=this;
|
|
82656
82677
|
this.TitlePaint[i+1]=titlePaint;
|
|
82657
82678
|
}
|
|
82658
82679
|
|
|
@@ -82797,6 +82818,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82797
82818
|
titlePaint.LanguageID=this.LanguageID;
|
|
82798
82819
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
82799
82820
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
82821
|
+
titlePaint.HQChart=this;
|
|
82800
82822
|
this.TitlePaint[i+1]=titlePaint;
|
|
82801
82823
|
}
|
|
82802
82824
|
}
|
|
@@ -89034,6 +89056,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89034
89056
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
89035
89057
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
89036
89058
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89059
|
+
titlePaint.HQChart=this;
|
|
89037
89060
|
this.TitlePaint.push(titlePaint);
|
|
89038
89061
|
}
|
|
89039
89062
|
|
|
@@ -89245,6 +89268,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89245
89268
|
titlePaint.LanguageID=this.LanguageID;
|
|
89246
89269
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
89247
89270
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89271
|
+
titlePaint.HQChart=this;
|
|
89248
89272
|
this.TitlePaint[index+1]=titlePaint;
|
|
89249
89273
|
|
|
89250
89274
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -89495,6 +89519,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89495
89519
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
89496
89520
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
89497
89521
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89522
|
+
titlePaint.HQChart=this;
|
|
89498
89523
|
this.TitlePaint[i+1]=titlePaint;
|
|
89499
89524
|
}
|
|
89500
89525
|
|
|
@@ -89582,6 +89607,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
89582
89607
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
89583
89608
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
89584
89609
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
89610
|
+
titlePaint.HQChart=this;
|
|
89585
89611
|
this.TitlePaint[i+1]=titlePaint;
|
|
89586
89612
|
}
|
|
89587
89613
|
}
|
|
@@ -94544,6 +94570,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
94544
94570
|
titlePaint.LanguageID=this.LanguageID;
|
|
94545
94571
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
94546
94572
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
94573
|
+
titlePaint.HQChart=this;
|
|
94547
94574
|
this.TitlePaint.push(titlePaint);
|
|
94548
94575
|
}
|
|
94549
94576
|
|
|
@@ -94725,6 +94752,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
94725
94752
|
titlePaint.LanguageID=this.LanguageID;
|
|
94726
94753
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
94727
94754
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
94755
|
+
titlePaint.HQChart=this;
|
|
94728
94756
|
this.TitlePaint.push(titlePaint);
|
|
94729
94757
|
}
|
|
94730
94758
|
|
|
@@ -4709,7 +4709,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4709
4709
|
if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
|
|
4710
4710
|
if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
|
|
4711
4711
|
if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
|
|
4712
|
-
if(IFrameSplitOperator.IsBool(item.
|
|
4712
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
4713
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
4713
4714
|
|
|
4714
4715
|
if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
|
|
4715
4716
|
{
|
|
@@ -13864,6 +13865,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13864
13865
|
titlePaint.Canvas=this.Canvas;
|
|
13865
13866
|
titlePaint.LanguageID=this.LanguageID;
|
|
13866
13867
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
13868
|
+
titlePaint.HQChart=this;
|
|
13867
13869
|
this.TitlePaint[index+1]=titlePaint;
|
|
13868
13870
|
|
|
13869
13871
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -14357,6 +14359,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14357
14359
|
titlePaint.LanguageID=this.LanguageID;
|
|
14358
14360
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
14359
14361
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
14362
|
+
titlePaint.HQChart=this;
|
|
14360
14363
|
this.TitlePaint[index+1]=titlePaint;
|
|
14361
14364
|
|
|
14362
14365
|
this.SetSubFrameOption(subFrame, option);
|
|
@@ -63453,7 +63456,14 @@ function DynamicKLineTitlePainting()
|
|
|
63453
63456
|
|
|
63454
63457
|
this.IsShowLastData=function()
|
|
63455
63458
|
{
|
|
63459
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
63460
|
+
{
|
|
63461
|
+
var clickModel=this.HQChart.ClickModel;
|
|
63462
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
63463
|
+
}
|
|
63464
|
+
|
|
63456
63465
|
var isShow=false;
|
|
63466
|
+
|
|
63457
63467
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
63458
63468
|
{
|
|
63459
63469
|
var status=this.DrawStatus;
|
|
@@ -64230,6 +64240,7 @@ function DynamicChartTitlePainting()
|
|
|
64230
64240
|
this.MerginLeft=g_JSChartResource.IndexTitleMerginLeft; //标题输出左边间距
|
|
64231
64241
|
|
|
64232
64242
|
this.Buttons=[]; //按钮
|
|
64243
|
+
this.NameButtonHeight=0; //指标名字按钮高度
|
|
64233
64244
|
|
|
64234
64245
|
this.UpDownArrowConfig=
|
|
64235
64246
|
{
|
|
@@ -64798,6 +64809,12 @@ function DynamicChartTitlePainting()
|
|
|
64798
64809
|
|
|
64799
64810
|
this.IsShowLastData=function()
|
|
64800
64811
|
{
|
|
64812
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
64813
|
+
{
|
|
64814
|
+
var clickModel=this.HQChart.ClickModel;
|
|
64815
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
64816
|
+
}
|
|
64817
|
+
|
|
64801
64818
|
var isShowLastData=false;
|
|
64802
64819
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
64803
64820
|
{
|
|
@@ -64856,6 +64873,7 @@ function DynamicChartTitlePainting()
|
|
|
64856
64873
|
this.Draw=function(moveonPoint, mouseStatus)
|
|
64857
64874
|
{
|
|
64858
64875
|
this.Buttons=[];
|
|
64876
|
+
this.NameButtonHeight=0;
|
|
64859
64877
|
if (this.Frame.IsMinSize) return;
|
|
64860
64878
|
|
|
64861
64879
|
this.IsKLineFrame= this.Frame.IsKLineFrame(false);
|
|
@@ -64918,6 +64936,7 @@ function DynamicChartTitlePainting()
|
|
|
64918
64936
|
this.DrawNameButton(rtButton, moveonPoint, mouseStatus);
|
|
64919
64937
|
|
|
64920
64938
|
this.Buttons.push({ ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON, Rect:rtButton, FrameID:this.Frame.Identify, Type:2 }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
64939
|
+
this.NameButtonHeight=rtButton.Height;
|
|
64921
64940
|
|
|
64922
64941
|
if (this.IsSelectedChart(this.Identify))
|
|
64923
64942
|
this.DrawSelectedLine(left, bottom, textWidth);
|
|
@@ -65206,6 +65225,7 @@ function DynamicChartTitlePainting()
|
|
|
65206
65225
|
var bottom=positionInfo.Bottom;
|
|
65207
65226
|
var pixelRatio=GetDevicePixelRatio();
|
|
65208
65227
|
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
65228
|
+
if (lineHeight<this.NameButtonHeight) lineHeight=this.NameButtonHeight;
|
|
65209
65229
|
for(var i=0; i<this.Data.length; ++i)
|
|
65210
65230
|
{
|
|
65211
65231
|
var item=this.Data[i];
|
|
@@ -83261,7 +83281,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83261
83281
|
titlePaint.LanguageID=this.LanguageID;
|
|
83262
83282
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
83263
83283
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
83264
|
-
|
|
83284
|
+
titlePaint.HQChart=this;
|
|
83265
83285
|
this.TitlePaint.push(titlePaint);
|
|
83266
83286
|
}
|
|
83267
83287
|
|
|
@@ -86749,6 +86769,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86749
86769
|
titlePaint.LanguageID=this.LanguageID;
|
|
86750
86770
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86751
86771
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86772
|
+
titlePaint.HQChart=this;
|
|
86752
86773
|
this.TitlePaint[i+1]=titlePaint;
|
|
86753
86774
|
}
|
|
86754
86775
|
|
|
@@ -86893,6 +86914,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86893
86914
|
titlePaint.LanguageID=this.LanguageID;
|
|
86894
86915
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86895
86916
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86917
|
+
titlePaint.HQChart=this;
|
|
86896
86918
|
this.TitlePaint[i+1]=titlePaint;
|
|
86897
86919
|
}
|
|
86898
86920
|
}
|
|
@@ -93130,6 +93152,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93130
93152
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93131
93153
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93132
93154
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93155
|
+
titlePaint.HQChart=this;
|
|
93133
93156
|
this.TitlePaint.push(titlePaint);
|
|
93134
93157
|
}
|
|
93135
93158
|
|
|
@@ -93341,6 +93364,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93341
93364
|
titlePaint.LanguageID=this.LanguageID;
|
|
93342
93365
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
93343
93366
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93367
|
+
titlePaint.HQChart=this;
|
|
93344
93368
|
this.TitlePaint[index+1]=titlePaint;
|
|
93345
93369
|
|
|
93346
93370
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -93591,6 +93615,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93591
93615
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93592
93616
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93593
93617
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93618
|
+
titlePaint.HQChart=this;
|
|
93594
93619
|
this.TitlePaint[i+1]=titlePaint;
|
|
93595
93620
|
}
|
|
93596
93621
|
|
|
@@ -93678,6 +93703,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93678
93703
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93679
93704
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93680
93705
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93706
|
+
titlePaint.HQChart=this;
|
|
93681
93707
|
this.TitlePaint[i+1]=titlePaint;
|
|
93682
93708
|
}
|
|
93683
93709
|
}
|
|
@@ -98640,6 +98666,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
98640
98666
|
titlePaint.LanguageID=this.LanguageID;
|
|
98641
98667
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98642
98668
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98669
|
+
titlePaint.HQChart=this;
|
|
98643
98670
|
this.TitlePaint.push(titlePaint);
|
|
98644
98671
|
}
|
|
98645
98672
|
|
|
@@ -98821,6 +98848,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
98821
98848
|
titlePaint.LanguageID=this.LanguageID;
|
|
98822
98849
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98823
98850
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98851
|
+
titlePaint.HQChart=this;
|
|
98824
98852
|
this.TitlePaint.push(titlePaint);
|
|
98825
98853
|
}
|
|
98826
98854
|
|
|
@@ -147862,7 +147890,7 @@ function ScrollBarBGChart()
|
|
|
147862
147890
|
|
|
147863
147891
|
|
|
147864
147892
|
|
|
147865
|
-
var HQCHART_VERSION="1.1.
|
|
147893
|
+
var HQCHART_VERSION="1.1.14712";
|
|
147866
147894
|
|
|
147867
147895
|
function PrintHQChartVersion()
|
|
147868
147896
|
{
|
|
@@ -4753,7 +4753,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4753
4753
|
if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
|
|
4754
4754
|
if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
|
|
4755
4755
|
if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
|
|
4756
|
-
if(IFrameSplitOperator.IsBool(item.
|
|
4756
|
+
if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
|
|
4757
|
+
if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
|
|
4757
4758
|
|
|
4758
4759
|
if (item.ShowPosition || item.ShowPostion) //显示位置高级配置
|
|
4759
4760
|
{
|
|
@@ -13908,6 +13909,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13908
13909
|
titlePaint.Canvas=this.Canvas;
|
|
13909
13910
|
titlePaint.LanguageID=this.LanguageID;
|
|
13910
13911
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
13912
|
+
titlePaint.HQChart=this;
|
|
13911
13913
|
this.TitlePaint[index+1]=titlePaint;
|
|
13912
13914
|
|
|
13913
13915
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -14401,6 +14403,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14401
14403
|
titlePaint.LanguageID=this.LanguageID;
|
|
14402
14404
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
14403
14405
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
14406
|
+
titlePaint.HQChart=this;
|
|
14404
14407
|
this.TitlePaint[index+1]=titlePaint;
|
|
14405
14408
|
|
|
14406
14409
|
this.SetSubFrameOption(subFrame, option);
|
|
@@ -63497,7 +63500,14 @@ function DynamicKLineTitlePainting()
|
|
|
63497
63500
|
|
|
63498
63501
|
this.IsShowLastData=function()
|
|
63499
63502
|
{
|
|
63503
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
63504
|
+
{
|
|
63505
|
+
var clickModel=this.HQChart.ClickModel;
|
|
63506
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
63507
|
+
}
|
|
63508
|
+
|
|
63500
63509
|
var isShow=false;
|
|
63510
|
+
|
|
63501
63511
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
63502
63512
|
{
|
|
63503
63513
|
var status=this.DrawStatus;
|
|
@@ -64274,6 +64284,7 @@ function DynamicChartTitlePainting()
|
|
|
64274
64284
|
this.MerginLeft=g_JSChartResource.IndexTitleMerginLeft; //标题输出左边间距
|
|
64275
64285
|
|
|
64276
64286
|
this.Buttons=[]; //按钮
|
|
64287
|
+
this.NameButtonHeight=0; //指标名字按钮高度
|
|
64277
64288
|
|
|
64278
64289
|
this.UpDownArrowConfig=
|
|
64279
64290
|
{
|
|
@@ -64842,6 +64853,12 @@ function DynamicChartTitlePainting()
|
|
|
64842
64853
|
|
|
64843
64854
|
this.IsShowLastData=function()
|
|
64844
64855
|
{
|
|
64856
|
+
if (this.HQChart && this.HQChart.EnableClickModel && this.HQChart.ClickModel)
|
|
64857
|
+
{
|
|
64858
|
+
var clickModel=this.HQChart.ClickModel;
|
|
64859
|
+
if (clickModel.IsShowCorssCursor) return false;
|
|
64860
|
+
}
|
|
64861
|
+
|
|
64845
64862
|
var isShowLastData=false;
|
|
64846
64863
|
if (this.DrawStatus && this.DrawStatus.IsTitleShowLatestData)
|
|
64847
64864
|
{
|
|
@@ -64900,6 +64917,7 @@ function DynamicChartTitlePainting()
|
|
|
64900
64917
|
this.Draw=function(moveonPoint, mouseStatus)
|
|
64901
64918
|
{
|
|
64902
64919
|
this.Buttons=[];
|
|
64920
|
+
this.NameButtonHeight=0;
|
|
64903
64921
|
if (this.Frame.IsMinSize) return;
|
|
64904
64922
|
|
|
64905
64923
|
this.IsKLineFrame= this.Frame.IsKLineFrame(false);
|
|
@@ -64962,6 +64980,7 @@ function DynamicChartTitlePainting()
|
|
|
64962
64980
|
this.DrawNameButton(rtButton, moveonPoint, mouseStatus);
|
|
64963
64981
|
|
|
64964
64982
|
this.Buttons.push({ ID:JSCHART_BUTTON_ID.INDEX_NAME_BUTTON, Rect:rtButton, FrameID:this.Frame.Identify, Type:2 }); //Type 0=主图按钮 1=附图按钮 2=主图指标名字按钮
|
|
64983
|
+
this.NameButtonHeight=rtButton.Height;
|
|
64965
64984
|
|
|
64966
64985
|
if (this.IsSelectedChart(this.Identify))
|
|
64967
64986
|
this.DrawSelectedLine(left, bottom, textWidth);
|
|
@@ -65250,6 +65269,7 @@ function DynamicChartTitlePainting()
|
|
|
65250
65269
|
var bottom=positionInfo.Bottom;
|
|
65251
65270
|
var pixelRatio=GetDevicePixelRatio();
|
|
65252
65271
|
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
65272
|
+
if (lineHeight<this.NameButtonHeight) lineHeight=this.NameButtonHeight;
|
|
65253
65273
|
for(var i=0; i<this.Data.length; ++i)
|
|
65254
65274
|
{
|
|
65255
65275
|
var item=this.Data[i];
|
|
@@ -83305,7 +83325,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
83305
83325
|
titlePaint.LanguageID=this.LanguageID;
|
|
83306
83326
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
83307
83327
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
83308
|
-
|
|
83328
|
+
titlePaint.HQChart=this;
|
|
83309
83329
|
this.TitlePaint.push(titlePaint);
|
|
83310
83330
|
}
|
|
83311
83331
|
|
|
@@ -86793,6 +86813,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86793
86813
|
titlePaint.LanguageID=this.LanguageID;
|
|
86794
86814
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86795
86815
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86816
|
+
titlePaint.HQChart=this;
|
|
86796
86817
|
this.TitlePaint[i+1]=titlePaint;
|
|
86797
86818
|
}
|
|
86798
86819
|
|
|
@@ -86937,6 +86958,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
86937
86958
|
titlePaint.LanguageID=this.LanguageID;
|
|
86938
86959
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
86939
86960
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
86961
|
+
titlePaint.HQChart=this;
|
|
86940
86962
|
this.TitlePaint[i+1]=titlePaint;
|
|
86941
86963
|
}
|
|
86942
86964
|
}
|
|
@@ -93174,6 +93196,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93174
93196
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93175
93197
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93176
93198
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93199
|
+
titlePaint.HQChart=this;
|
|
93177
93200
|
this.TitlePaint.push(titlePaint);
|
|
93178
93201
|
}
|
|
93179
93202
|
|
|
@@ -93385,6 +93408,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93385
93408
|
titlePaint.LanguageID=this.LanguageID;
|
|
93386
93409
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
93387
93410
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93411
|
+
titlePaint.HQChart=this;
|
|
93388
93412
|
this.TitlePaint[index+1]=titlePaint;
|
|
93389
93413
|
|
|
93390
93414
|
this.SetSubFrameOption(subFrame,option);
|
|
@@ -93635,6 +93659,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93635
93659
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93636
93660
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93637
93661
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93662
|
+
titlePaint.HQChart=this;
|
|
93638
93663
|
this.TitlePaint[i+1]=titlePaint;
|
|
93639
93664
|
}
|
|
93640
93665
|
|
|
@@ -93722,6 +93747,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
93722
93747
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
93723
93748
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
93724
93749
|
titlePaint.MainTitlePaint=this.TitlePaint[0];
|
|
93750
|
+
titlePaint.HQChart=this;
|
|
93725
93751
|
this.TitlePaint[i+1]=titlePaint;
|
|
93726
93752
|
}
|
|
93727
93753
|
}
|
|
@@ -98684,6 +98710,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
98684
98710
|
titlePaint.LanguageID=this.LanguageID;
|
|
98685
98711
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98686
98712
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98713
|
+
titlePaint.HQChart=this;
|
|
98687
98714
|
this.TitlePaint.push(titlePaint);
|
|
98688
98715
|
}
|
|
98689
98716
|
|
|
@@ -98865,6 +98892,7 @@ function MinuteChartHScreenContainer(uielement)
|
|
|
98865
98892
|
titlePaint.LanguageID=this.LanguageID;
|
|
98866
98893
|
titlePaint.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
98867
98894
|
titlePaint.SelectedChart=this.SelectedChart;
|
|
98895
|
+
titlePaint.HQChart=this;
|
|
98868
98896
|
this.TitlePaint.push(titlePaint);
|
|
98869
98897
|
}
|
|
98870
98898
|
|
|
@@ -158677,7 +158705,7 @@ function HQChartScriptWorker()
|
|
|
158677
158705
|
|
|
158678
158706
|
|
|
158679
158707
|
|
|
158680
|
-
var HQCHART_VERSION="1.1.
|
|
158708
|
+
var HQCHART_VERSION="1.1.14712";
|
|
158681
158709
|
|
|
158682
158710
|
function PrintHQChartVersion()
|
|
158683
158711
|
{
|