hqchart 1.1.13158 → 1.1.13162

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.
@@ -1148,8 +1148,8 @@ for(var i=0;i<chart.Frame.SubFrame.length;++i){chart.Frame.SubFrame[i].Frame.Cha
1148
1148
  this.CreateKLineChartContainer=function(option){var _this2=this;var chart=null;if(option.Type==="历史K线图横屏")chart=new KLineChartHScreenContainer(this.CanvasElement);else chart=new KLineChartContainer(this.CanvasElement,this.OffscreenCanvasElement,this.CacheCanvasElement);chart.GetExtraCanvas=function(name){return _this2.GetExtraCanvas(name);};var extraElement=this.GetExtraCanvas(JSChart.CorssCursorCanvasKey);if(extraElement)chart.SetCorssCursorElement(extraElement);if(option.EventCallback)this.SetEventCallback(chart,option.EventCallback);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;//创建改参数div
1149
1149
  chart.ModifyIndexDialog=this.ModifyIndexDialog;chart.ChangeIndexDialog=this.ChangeIndexDialog;chart.MinuteDialog=this.MinuteDialog;//右键菜单
1150
1150
  if(option.IsShowRightMenu==true)chart.RightMenu=new KLineRightMenu(this.DivElement);if(option.ScriptError)chart.ScriptErrorCallback=option.ScriptError;chart.SelectRectRightMenu=new KLineSelectRightMenu(this.DivElement);if(option.EnableScrollUpDown==true)chart.EnableScrollUpDown=option.EnableScrollUpDown;if(option.DisableMouse==true)chart.DisableMouse=option.DisableMouse;if(option.TouchMoveMinAngle)chart.TouchMoveMinAngle=option.TouchMoveMinAngle;if(option.EnableZoomUpDown)chart.EnableZoomUpDown=option.EnableZoomUpDown;if(IFrameSplitOperator.IsString(option.SplashTitle))chart.LoadDataSplashTitle=option.SplashTitle;if(IFrameSplitOperator.IsBool(option.EnableZoomIndexWindow))chart.EnableZoomIndexWindow=option.EnableZoomIndexWindow;if(IFrameSplitOperator.IsBool(option.IsDrawPictureXY))chart.IsDrawPictureXY=option.IsDrawPictureXY;if(IFrameSplitOperator.IsNumber(option.CtrlMoveStep))chart.CtrlMoveStep=option.CtrlMoveStep;if(IFrameSplitOperator.IsBool(option.EnableIndexChartDrag))chart.EnableIndexChartDrag=option.EnableIndexChartDrag;if(IFrameSplitOperator.IsBool(option.EnableVerifyRecvData))chart.EnableVerifyRecvData=option.EnableVerifyRecvData;if(option.GlobalOption){var item=option.GlobalOption;if(IFrameSplitOperator.IsBool(item.IsValueFullRange))chart.GlobalOption.IsValueFullRange=item.IsValueFullRange;if(item.SelectedBorder){var subItem=item.SelectedBorder;if(IFrameSplitOperator.IsNumber(subItem.Mode))chart.GlobalOption.SelectedBorder.Mode=subItem.Mode;}}if(option.EnableYDrag){var item=option.EnableYDrag;if(IFrameSplitOperator.IsBool(item.Left))chart.EnableYDrag.Left=item.Left;if(IFrameSplitOperator.IsBool(item.Right))chart.EnableYDrag.Right=item.Right;if(IFrameSplitOperator.IsBool(item.Wheel))chart.EnableYDrag.Wheel=item.Wheel;if(IFrameSplitOperator.IsNumber(item.WheelYMove))chart.EnableYDrag.WheelYMove=item.WheelYMove;}if(option.KLine)//k线图的属性设置
1151
- {if(option.KLine.DragMode>=0)chart.DragMode=option.KLine.DragMode;if(option.KLine.Right>=0)chart.Right=option.KLine.Right;if(option.KLine.Period>=0)chart.Period=option.KLine.Period;if(option.KLine.MaxReqeustDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxReqeustDataCount;//兼容老版本
1152
- if(option.KLine.MaxRequestDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;if(option.KLine.Info&&option.KLine.Info.length>0)chart.SetKLineInfo(option.KLine.Info,false);if(option.KLine.KLineDoubleClick==false)chart.MinuteDialog=this.MinuteDialog=null;if(option.KLine.IsShowTooltip==false)chart.IsShowTooltip=false;if(option.KLine.MaxRequestMinuteDayCount>0)chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;if(option.KLine.DrawType)chart.KLineDrawType=option.KLine.DrawType;if(option.KLine.FirstShowDate>19910101)chart.CustomShow={Date:option.KLine.FirstShowDate,PageSize:option.KLine.PageSize};if(option.KLine.RightSpaceCount>0)chart.RightSpaceCount=option.KLine.RightSpaceCount;if(option.KLine.ZoomType>0)chart.ZoomType=option.KLine.ZoomType;if(option.KLine.DataWidth>=1)chart.KLineSize={DataWidth:option.KLine.DataWidth};if(IFrameSplitOperator.IsNumber(option.KLine.RightFormula))chart.RightFormula=option.KLine.RightFormula;}if(option.EnableFlowCapital){var item=option.EnableFlowCapital;if(item.BIT==true)chart.EnableFlowCapital.BIT=item.BIT;}if(IFrameSplitOperator.IsBool(option.EnableBorderDrag)){chart.EnableBorderDrag=option.EnableBorderDrag;}if(option.Page){if(option.Page.Day&&option.Page.Day.Enable==true)chart.Page.Day.Enable=true;if(option.Page.Minute&&option.Page.Minute.Enable==true)chart.Page.Minute.Enable=true;}if(option.DragDownload){if(option.DragDownload.Day&&option.DragDownload.Day.Enable==true)chart.DragDownload.Day.Enable=true;if(option.DragDownload.Minute&&option.DragDownload.Minute.Enable==true)chart.DragDownload.Minute.Enable=true;}if(option.ZoomDownload){if(option.ZoomDownload.Day&&IFrameSplitOperator.IsBool(option.ZoomDownload.Day.Enable))chart.ZoomDownload.Day.Enable=option.ZoomDownload.Day.Enable;if(option.ZoomDownload.Minute&&IFrameSplitOperator.IsBool(option.ZoomDownload.Minute.Enable))chart.ZoomDownload.Minute.Enable=option.ZoomDownload.Minute.Enable;}if(option.Language){var value=g_JSChartLocalization.GetLanguageID(option.Language);if(IFrameSplitOperator.IsNumber(value))chart.LanguageID=value;}if(option.SourceDatatLimit)chart.SetSourceDatatLimit(option.SourceDatatLimit);if(option.DrawPicture)//画图工具
1151
+ {var item=option.KLine;if(option.KLine.DragMode>=0)chart.DragMode=option.KLine.DragMode;if(option.KLine.Right>=0)chart.Right=option.KLine.Right;if(option.KLine.Period>=0)chart.Period=option.KLine.Period;if(option.KLine.MaxReqeustDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxReqeustDataCount;//兼容老版本
1152
+ if(option.KLine.MaxRequestDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;if(option.KLine.Info&&option.KLine.Info.length>0)chart.SetKLineInfo(option.KLine.Info,false);if(option.KLine.KLineDoubleClick==false)chart.MinuteDialog=this.MinuteDialog=null;if(IFrameSplitOperator.IsBool(item.IsShowTooltip))chart.IsShowTooltip=item.IsShowTooltip;if(IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip))chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;if(option.KLine.MaxRequestMinuteDayCount>0)chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;if(option.KLine.DrawType)chart.KLineDrawType=option.KLine.DrawType;if(option.KLine.FirstShowDate>19910101)chart.CustomShow={Date:option.KLine.FirstShowDate,PageSize:option.KLine.PageSize};if(option.KLine.RightSpaceCount>0)chart.RightSpaceCount=option.KLine.RightSpaceCount;if(option.KLine.ZoomType>0)chart.ZoomType=option.KLine.ZoomType;if(option.KLine.DataWidth>=1)chart.KLineSize={DataWidth:option.KLine.DataWidth};if(IFrameSplitOperator.IsNumber(option.KLine.RightFormula))chart.RightFormula=option.KLine.RightFormula;}if(option.EnableFlowCapital){var item=option.EnableFlowCapital;if(item.BIT==true)chart.EnableFlowCapital.BIT=item.BIT;}if(IFrameSplitOperator.IsBool(option.EnableBorderDrag)){chart.EnableBorderDrag=option.EnableBorderDrag;}if(option.Page){if(option.Page.Day&&option.Page.Day.Enable==true)chart.Page.Day.Enable=true;if(option.Page.Minute&&option.Page.Minute.Enable==true)chart.Page.Minute.Enable=true;}if(option.DragDownload){if(option.DragDownload.Day&&option.DragDownload.Day.Enable==true)chart.DragDownload.Day.Enable=true;if(option.DragDownload.Minute&&option.DragDownload.Minute.Enable==true)chart.DragDownload.Minute.Enable=true;}if(option.ZoomDownload){if(option.ZoomDownload.Day&&IFrameSplitOperator.IsBool(option.ZoomDownload.Day.Enable))chart.ZoomDownload.Day.Enable=option.ZoomDownload.Day.Enable;if(option.ZoomDownload.Minute&&IFrameSplitOperator.IsBool(option.ZoomDownload.Minute.Enable))chart.ZoomDownload.Minute.Enable=option.ZoomDownload.Minute.Enable;}if(option.Language){var value=g_JSChartLocalization.GetLanguageID(option.Language);if(IFrameSplitOperator.IsNumber(value))chart.LanguageID=value;}if(option.SourceDatatLimit)chart.SetSourceDatatLimit(option.SourceDatatLimit);if(option.DrawPicture)//画图工具
1153
1153
  {if(option.DrawPicture.StorageKey&&chart.ChartDrawStorage)chart.ChartDrawStorage.Load(option.DrawPicture.StorageKey);}if(option.DrawTool)//画图工具
1154
1154
  {if(option.DrawTool.StorageKey&&chart.ChartDrawStorage)chart.ChartDrawStorage.Load(option.DrawTool.StorageKey);}if(IFrameSplitOperator.IsNumber(option.StepPixel))chart.StepPixel=option.StepPixel;if(option.ZoomStepPixel>0)chart.ZoomStepPixel=option.ZoomStepPixel;if(option.IsApiPeriod==true)chart.IsApiPeriod=option.IsApiPeriod;//图形选中
1155
1155
  if(option.SelectedChart){var item=option.SelectedChart;if(IFrameSplitOperator.IsBool(item.EnableSelected))chart.SelectedChart.EnableSelected=item.EnableSelected;if(IFrameSplitOperator.IsBool(item.EnableMoveOn))chart.SelectedChart.EnableMoveOn=item.EnableMoveOn;}if(!option.Windows||option.Windows.length<=0)return null;//K线扩展计算方法配置
@@ -1713,7 +1713,7 @@ if(option&&option.Point&&(option.ParentFunction=='OnMouseMove'||option.ParentFun
1713
1713
  {var frame=this.LastMouseStatus.MouseOnToolbar.Frame;if(frame&&frame.DrawToolbarTooltip)frame.DrawToolbarTooltip(this.LastMouseStatus.MouseOnToolbar);}this.OffscreenToShowCanvas();++this.TouchDrawCount;};this.DrawAnimation=function()//绘制动画 如弹幕
1714
1714
  {if(!this.EnableAnimation)return;if(this.Frame.ScreenImageData&&!this.IsOnTouch){for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.IsAnimation===true)item.IsMoveStep=true;//移动弹幕
1715
1715
  }this.DrawDynamicInfo();}var self=this;window.requestAnimationFrame(function(){self.DrawAnimation();});};this.StartAnimation=function(option){var bCreated=false;//是否已经创建了弹幕画法
1716
- var barrageData=null;for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.ClassName==='BarragePaint'){bCreated=true;barrageData=item.BarrageList;break;}}if(!bCreated){var chart=new BarragePaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);barrageData=chart.BarrageList;}this.EnableAnimation=true;var self=this;window.requestAnimationFrame(function(){self.DrawAnimation();});return barrageData;};this.StopAnimation=function(){this.EnableAnimation=false;this.DrawDynamicInfo();};this.GetChartTooltipData=function(x,y,option){var toolTip=new TooltipData();if(this.ChartInfoPaint){if(this.ChartInfoPaint.GetTooltipData(x,y,toolTip))return toolTip;}if(this.PtInChartPaintTooltip(x,y,toolTip))return toolTip;if(IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)){for(var i=0;i<this.Frame.SubFrame.length;++i){var subFrame=this.Frame.SubFrame[i];for(var j=0;j<subFrame.OverlayIndex.length;++j){var overlayItem=subFrame.OverlayIndex[j];for(var k=0;k<overlayItem.ChartPaint.length;++k){var item=overlayItem.ChartPaint[k];if(item.GetTooltipData(x,y,toolTip))return toolTip;}}}}if(this.PtInOverlayChartPaintTooltip(x,y,toolTip))return toolTip;if(this.PtInExtendChartPaintTooltip(x,y,toolTip))return tooltip;return null;};this.PtInExtendChartButtons=function(x,y){for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.PtInButtons){var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}}return null;};this.ClickExtendChartButton=function(button,e){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_EXTENDCHART_BUTTON);if(event&&event.Callback){var data={Info:button,PreventDefault:false};//PreventDefault 是否阻止内置的点击处理
1716
+ var barrageData=null;for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.ClassName==='BarragePaint'){bCreated=true;barrageData=item.BarrageList;break;}}if(!bCreated){var chart=new BarragePaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);barrageData=chart.BarrageList;}this.EnableAnimation=true;var self=this;window.requestAnimationFrame(function(){self.DrawAnimation();});return barrageData;};this.StopAnimation=function(){this.EnableAnimation=false;this.DrawDynamicInfo();};this.GetChartTooltipData=function(x,y,option){var toolTip=new TooltipData();if(this.ChartInfoPaint){if(this.ChartInfoPaint.GetTooltipData(x,y,toolTip))return toolTip;}if(this.PtInChartPaintTooltip(x,y,toolTip))return toolTip;if(IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)){for(var i=0;i<this.Frame.SubFrame.length;++i){var subFrame=this.Frame.SubFrame[i];for(var j=0;j<subFrame.OverlayIndex.length;++j){var overlayItem=subFrame.OverlayIndex[j];for(var k=0;k<overlayItem.ChartPaint.length;++k){var item=overlayItem.ChartPaint[k];if(item.GetTooltipData(x,y,toolTip))return toolTip;}}}}if(this.PtInOverlayChartPaintTooltip(x,y,toolTip))return toolTip;if(this.PtInExtendChartPaintTooltip(x,y,toolTip))return toolTip;return null;};this.PtInExtendChartButtons=function(x,y){for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.PtInButtons){var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}}return null;};this.ClickExtendChartButton=function(button,e){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_EXTENDCHART_BUTTON);if(event&&event.Callback){var data={Info:button,PreventDefault:false};//PreventDefault 是否阻止内置的点击处理
1717
1717
  event.Callback(event,data,this);if(data.PreventDefault)return;}};this.PtInDrawPictureButtons=function(x,y){for(var i=0;i<this.ChartDrawPicture.length;++i){var item=this.ChartDrawPicture[i];if(!item.PtInButtons)continue;var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}return null;};this.ClickDrawPictureButton=function(button,e){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE_BUTTON);if(event&&event.Callback){var data={Info:button,PreventDefault:false};//PreventDefault 是否阻止内置的点击处理
1718
1718
  event.Callback(event,data,this);if(data.PreventDefault)return;}if(button.ID==JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE){JSConsole.Chart.Log(button,"ClickDrawPictureButton");this.ClearChartDrawPicture(button.Chart);//删除画图工具
1719
1719
  }else if(button.ID==JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING){}};this.PtInTitleButtons=function(x,y){for(var i=0;i<this.TitlePaint.length;++i){var item=this.TitlePaint[i];if(!item.PtInButtons)continue;var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}return null;};this.OnMouseMove=function(x,y,e,isPhone){var _this9=this;this.StopDrawDynamicInfo();this.LastPoint.X=x;this.LastPoint.Y=y;var mouseStatus=null;//鼠标状态
@@ -1762,7 +1762,7 @@ this.Frame.SetFrameBorderSizeChange();this.Frame.ReDrawToolbar();this.Draw();};t
1762
1762
  this.ShowTooltip(this.LastPoint.X/pixelTatio,this.LastPoint.Y/pixelTatio,toolTip);};this.ShowTooltip=function(x,y,toolTip){var _this11=this;if(!this.IsShowTooltip)return;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
1763
1763
  var xMove=15/pixelTatio;//顶部坐标偏移位置
1764
1764
  this.TooltipCache.Type=toolTip.Type;this.TooltipCache.Data=null;this.TooltipCache.X=x;this.TooltipCache.Y=y;if(toolTip.Type===0)//K线信息
1765
- {var scrollPos=GetScrollPosition();var left=x;var top=y;var format=g_DivTooltipDataForamt.Create('HistoryDataStringFormat');format.Value=toolTip;format.Symbol=this.Symbol;format.LanguageID=this.LanguageID;format.GetEventCallback=function(id){return _this11.GetEventCallback(id);};if(!format.Operator())return;var textHeight=format.LineCount*25;//每行的行高25
1765
+ {if(!this.IsShowKLineDivTooltip)return;var scrollPos=GetScrollPosition();var left=x;var top=y;var format=g_DivTooltipDataForamt.Create('HistoryDataStringFormat');format.Value=toolTip;format.Symbol=this.Symbol;format.LanguageID=this.LanguageID;format.GetEventCallback=function(id){return _this11.GetEventCallback(id);};if(!format.Operator())return;var textHeight=format.LineCount*25;//每行的行高25
1766
1766
  if(format.Height>0)textHeight=format.Height;//新版本高度有格式化类计算完成
1767
1767
  var width=format.Width;this.Tooltip.style.width=width+"px";this.Tooltip.style.height=textHeight+"px";//JSConsole.Chart.Log(`[JSChartContainer::ShowTooltip] left=${left} top=${top} xMove=${xMove}` );
1768
1768
  //if (toolTip.ChartPaint.Name=="Overlay-KLine") this.Tooltip.style.height =220+"px";
@@ -6787,6 +6787,7 @@ this.KLineCalculate=null;//K线定制指标计算
6787
6787
  this.KLineCalcOption=new _map2.default();//K线定制指标配置
6788
6788
  this.ScrollBar=null;//横向滚动条
6789
6789
  this.IsAutoSyncDataOffset=true;//增量更新时,是否移动当前屏数据
6790
+ this.IsShowKLineDivTooltip=true;//是否显示K线tooltip
6790
6791
  this.GetKLineCalulate=function(){var kLineDrawType=this.GetKLineDrawType();var className;if(kLineDrawType==10)className="RenkoCalculate";else if(kLineDrawType==11)className="HeikinAshiCalculate";else if(kLineDrawType==12)className="LineBreakCalcuate";else if(kLineDrawType==16)className="KagiCalculate";else return null;if(!this.KLineCalculate||this.KLineCalculate.ClassName!=className){this.KLineCalculate=g_KLineCustomCalulate.Create(className);if(this.KLineCalculate.SetOption&&this.KLineCalcOption.has(className)){var option=this.KLineCalcOption.get(className);this.KLineCalculate.SetOption(option);}}return this.KLineCalculate;};this.SetKLineCalcOption=function(className,option){this.KLineCalcOption.set(className,option);if(this.KLineCalculate&&this.KLineCalculate.ClassName==className&&this.KLineCalculate.SetOption){this.KLineCalculate.SetOption(option);}};this.ClearKLineCaluate=function(){if(!this.KLineCalculate)return;if(!this.KLineCalculate.Clear)return;this.KLineCalculate.Clear();};this.ResetDragDownload=function(){this.DragDownload.Day.Status=0;this.DragDownload.Day.IsEnd=false;this.DragDownload.Minute.Status=0;this.DragDownload.Minute.IsEnd=false;this.DragDownload.Tick.Status=0;this.DragDownload.Tick.IsEnd=false;};this.ResetZoomDownload=function(){this.ZoomDownload.Day.Status=0;this.ZoomDownload.Day.IsEnd=false;this.ZoomDownload.Minute.Status=0;this.ZoomDownload.Minute.IsEnd=false;this.ZoomDownload.Tick.Status=0;this.ZoomDownload.Tick.IsEnd=false;};this.ResetPage=function()//重置分页下载
6791
6792
  {this.Page.Day.Finish=false;this.Page.Day.Index=0;this.Page.Minute.Finish=false;this.Page.Minute.Index=0;};this.AddCustomKLine=function(kline,option){var klineChart=this.ChartPaint[0];if(!klineChart)return;if(!kline)return;if(!klineChart.CustomKLine)klineChart.CustomKLine=new _map2.default();if(Array.isArray(kline)){for(var i=0;i<kline.length;++i){var item=kline[i];klineChart.CustomKLine.set(item.Key,item.Data);}}else if(kline){klineChart.CustomKLine.set(kline.Key,kline.Data);}if(option&&option.Draw==true)this.Draw();};this.ClearCustomKLine=function(option){var klineChart=this.ChartPaint[0];if(!klineChart)return;klineChart.ClearCustomKLine();if(option&&option.Draw==true)this.Draw();};this.StopAutoUpdate=function(){this.CancelAutoUpdate();this.AutoUpdateEvent(false,'KLineChartContainer::StopAutoUpdate');if(!this.IsAutoUpdate)return;this.IsAutoUpdate=false;};//沙盘操作 { ID: 1=开始, Data:绑定K线数据(可选)
6792
6793
  // ID: 2=更新数据, Data:绑定K线数据
@@ -7272,7 +7273,7 @@ this.ChangeCoordinateType=function(obj){if(!this.Frame)return;if(!IFrameSplitOpe
7272
7273
  {frame.Frame.YSplitOperator.CoordinateType=2;}else{return;}}else{if(obj.Type>=0&&obj.Type<=5)frame.YSplitOperator.CoordinateType=obj.Type;if(obj.IsReverse===true)frame.CoordinateType=1;else if(obj.IsReverse==false)frame.CoordinateType=0;}//请求缓存的最大最小值
7273
7274
  frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;this.UpdateFrameMaxMin();//调整坐标最大 最小值
7274
7275
  this.Frame.SetSizeChage(true);this.Draw();};//设置指标窗口个数
7275
- this.ChangeIndexWindowCount=function(count,option){var _this23=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.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);//最后一个显示X轴坐标
7276
+ this.ChangeIndexWindowCount=function(count,option){var _this23=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.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轴坐标
7276
7277
  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();//调整坐标最大 最小值
7277
7278
  this.Draw();}else{//创建新的指标窗口
7278
7279
  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 _this23.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint[i+1]=titlePaint;}//最后一个显示X轴坐标
@@ -7800,7 +7801,7 @@ this.UpdateFrameMaxMin();//调整坐标最大 最小值
7800
7801
  this.Draw();};this.ChangeIndex=function(windowIndex,indexName,option){if(this.Frame.SubFrame.length<3)return;if(option&&option.API)return this.ChangeAPIIndex(windowIndex,option);//查找系统指标
7801
7802
  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);};//设置指标窗口个数
7802
7803
  this.ChangeIndexWindowCount=function(count){var _this32=this;if(count<2)return;//1,2个窗口固定的不能动
7803
- 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);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);}else{//创建新的指标窗口
7804
+ 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);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{//创建新的指标窗口
7804
7805
  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 _this32.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;this.TitlePaint[i+1]=titlePaint;}//创建指标
7805
7806
  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);//脚本执行
7806
7807
  var bindData=this.SourceData;this.BindIndexData(i,bindData);//执行脚本
@@ -13103,7 +13104,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13103
13104
  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);};}/********************************************************************************
13104
13105
  * 版本信息输出
13105
13106
  *
13106
- */var HQCHART_VERSION="1.1.13157";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13107
+ */var HQCHART_VERSION="1.1.13161";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13107
13108
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13108
13109
  // BaseIndex:BaseIndex,
13109
13110
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13158",
3
+ "version": "1.1.13162",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -313,6 +313,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
313
313
 
314
314
  if (option.KLine) //k线图的属性设置
315
315
  {
316
+ var item=option.KLine;
316
317
  if (option.KLine.DragMode>=0) chart.DragMode=option.KLine.DragMode;
317
318
  if (option.KLine.Right>=0) chart.Right=option.KLine.Right;
318
319
  if (option.KLine.Period>=0) chart.Period=option.KLine.Period;
@@ -320,7 +321,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
320
321
  if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
321
322
  if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
322
323
  if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
323
- if (option.KLine.IsShowTooltip==false) chart.IsShowTooltip=false;
324
+ if (IFrameSplitOperator.IsBool(item.IsShowTooltip)) chart.IsShowTooltip=item.IsShowTooltip;
325
+ if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
324
326
  if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
325
327
  if (option.KLine.DrawType) chart.KLineDrawType=option.KLine.DrawType;
326
328
  if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize };
@@ -5794,7 +5796,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
5794
5796
  return toolTip;
5795
5797
 
5796
5798
  if (this.PtInExtendChartPaintTooltip(x,y,toolTip))
5797
- return tooltip;
5799
+ return toolTip;
5798
5800
 
5799
5801
  return null;
5800
5802
  }
@@ -6570,6 +6572,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6570
6572
 
6571
6573
  if (toolTip.Type===0) //K线信息
6572
6574
  {
6575
+ if (!this.IsShowKLineDivTooltip) return;
6576
+
6573
6577
  var scrollPos=GetScrollPosition();
6574
6578
  var left = x;
6575
6579
  var top = y;
@@ -66491,6 +66495,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
66491
66495
 
66492
66496
  this.ScrollBar=null; //横向滚动条
66493
66497
  this.IsAutoSyncDataOffset=true; //增量更新时,是否移动当前屏数据
66498
+ this.IsShowKLineDivTooltip=true; //是否显示K线tooltip
66494
66499
 
66495
66500
  this.GetKLineCalulate=function()
66496
66501
  {
@@ -70341,6 +70346,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
70341
70346
 
70342
70347
  this.Frame.SubFrame.splice(count,currentLength-count);
70343
70348
  this.WindowIndex.splice(count,currentLength-count);
70349
+ this.TitlePaint.splice(count+1,currentLength-count);
70344
70350
 
70345
70351
  //最后一个显示X轴坐标
70346
70352
  for(var i=0;i<this.Frame.SubFrame.length;++i)
@@ -75864,6 +75870,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
75864
75870
 
75865
75871
  this.Frame.SubFrame.splice(count,currentLength-count);
75866
75872
  this.WindowIndex.splice(count,currentLength-count);
75873
+ this.TitlePaint.splice(count+1,currentLength-count);
75867
75874
  }
75868
75875
  else
75869
75876
  {
@@ -4205,6 +4205,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4205
4205
 
4206
4206
  if (option.KLine) //k线图的属性设置
4207
4207
  {
4208
+ var item=option.KLine;
4208
4209
  if (option.KLine.DragMode>=0) chart.DragMode=option.KLine.DragMode;
4209
4210
  if (option.KLine.Right>=0) chart.Right=option.KLine.Right;
4210
4211
  if (option.KLine.Period>=0) chart.Period=option.KLine.Period;
@@ -4212,7 +4213,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4212
4213
  if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
4213
4214
  if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
4214
4215
  if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
4215
- if (option.KLine.IsShowTooltip==false) chart.IsShowTooltip=false;
4216
+ if (IFrameSplitOperator.IsBool(item.IsShowTooltip)) chart.IsShowTooltip=item.IsShowTooltip;
4217
+ if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
4216
4218
  if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
4217
4219
  if (option.KLine.DrawType) chart.KLineDrawType=option.KLine.DrawType;
4218
4220
  if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize };
@@ -9686,7 +9688,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9686
9688
  return toolTip;
9687
9689
 
9688
9690
  if (this.PtInExtendChartPaintTooltip(x,y,toolTip))
9689
- return tooltip;
9691
+ return toolTip;
9690
9692
 
9691
9693
  return null;
9692
9694
  }
@@ -10462,6 +10464,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10462
10464
 
10463
10465
  if (toolTip.Type===0) //K线信息
10464
10466
  {
10467
+ if (!this.IsShowKLineDivTooltip) return;
10468
+
10465
10469
  var scrollPos=GetScrollPosition();
10466
10470
  var left = x;
10467
10471
  var top = y;
@@ -70383,6 +70387,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
70383
70387
 
70384
70388
  this.ScrollBar=null; //横向滚动条
70385
70389
  this.IsAutoSyncDataOffset=true; //增量更新时,是否移动当前屏数据
70390
+ this.IsShowKLineDivTooltip=true; //是否显示K线tooltip
70386
70391
 
70387
70392
  this.GetKLineCalulate=function()
70388
70393
  {
@@ -74233,6 +74238,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
74233
74238
 
74234
74239
  this.Frame.SubFrame.splice(count,currentLength-count);
74235
74240
  this.WindowIndex.splice(count,currentLength-count);
74241
+ this.TitlePaint.splice(count+1,currentLength-count);
74236
74242
 
74237
74243
  //最后一个显示X轴坐标
74238
74244
  for(var i=0;i<this.Frame.SubFrame.length;++i)
@@ -79756,6 +79762,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
79756
79762
 
79757
79763
  this.Frame.SubFrame.splice(count,currentLength-count);
79758
79764
  this.WindowIndex.splice(count,currentLength-count);
79765
+ this.TitlePaint.splice(count+1,currentLength-count);
79759
79766
  }
79760
79767
  else
79761
79768
  {
@@ -132187,7 +132194,7 @@ function ScrollBarBGChart()
132187
132194
 
132188
132195
 
132189
132196
 
132190
- var HQCHART_VERSION="1.1.13157";
132197
+ var HQCHART_VERSION="1.1.13161";
132191
132198
 
132192
132199
  function PrintHQChartVersion()
132193
132200
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13157";
8
+ var HQCHART_VERSION="1.1.13161";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -4249,6 +4249,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4249
4249
 
4250
4250
  if (option.KLine) //k线图的属性设置
4251
4251
  {
4252
+ var item=option.KLine;
4252
4253
  if (option.KLine.DragMode>=0) chart.DragMode=option.KLine.DragMode;
4253
4254
  if (option.KLine.Right>=0) chart.Right=option.KLine.Right;
4254
4255
  if (option.KLine.Period>=0) chart.Period=option.KLine.Period;
@@ -4256,7 +4257,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4256
4257
  if (option.KLine.MaxRequestDataCount>0) chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;
4257
4258
  if (option.KLine.Info && option.KLine.Info.length>0) chart.SetKLineInfo(option.KLine.Info,false);
4258
4259
  if (option.KLine.KLineDoubleClick==false) chart.MinuteDialog=this.MinuteDialog=null;
4259
- if (option.KLine.IsShowTooltip==false) chart.IsShowTooltip=false;
4260
+ if (IFrameSplitOperator.IsBool(item.IsShowTooltip)) chart.IsShowTooltip=item.IsShowTooltip;
4261
+ if (IFrameSplitOperator.IsBool(item.IsShowKLineDivTooltip)) chart.IsShowKLineDivTooltip=item.IsShowKLineDivTooltip;
4260
4262
  if (option.KLine.MaxRequestMinuteDayCount>0) chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;
4261
4263
  if (option.KLine.DrawType) chart.KLineDrawType=option.KLine.DrawType;
4262
4264
  if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize };
@@ -9730,7 +9732,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9730
9732
  return toolTip;
9731
9733
 
9732
9734
  if (this.PtInExtendChartPaintTooltip(x,y,toolTip))
9733
- return tooltip;
9735
+ return toolTip;
9734
9736
 
9735
9737
  return null;
9736
9738
  }
@@ -10506,6 +10508,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10506
10508
 
10507
10509
  if (toolTip.Type===0) //K线信息
10508
10510
  {
10511
+ if (!this.IsShowKLineDivTooltip) return;
10512
+
10509
10513
  var scrollPos=GetScrollPosition();
10510
10514
  var left = x;
10511
10515
  var top = y;
@@ -70427,6 +70431,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
70427
70431
 
70428
70432
  this.ScrollBar=null; //横向滚动条
70429
70433
  this.IsAutoSyncDataOffset=true; //增量更新时,是否移动当前屏数据
70434
+ this.IsShowKLineDivTooltip=true; //是否显示K线tooltip
70430
70435
 
70431
70436
  this.GetKLineCalulate=function()
70432
70437
  {
@@ -74277,6 +74282,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
74277
74282
 
74278
74283
  this.Frame.SubFrame.splice(count,currentLength-count);
74279
74284
  this.WindowIndex.splice(count,currentLength-count);
74285
+ this.TitlePaint.splice(count+1,currentLength-count);
74280
74286
 
74281
74287
  //最后一个显示X轴坐标
74282
74288
  for(var i=0;i<this.Frame.SubFrame.length;++i)
@@ -79800,6 +79806,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
79800
79806
 
79801
79807
  this.Frame.SubFrame.splice(count,currentLength-count);
79802
79808
  this.WindowIndex.splice(count,currentLength-count);
79809
+ this.TitlePaint.splice(count+1,currentLength-count);
79803
79810
  }
79804
79811
  else
79805
79812
  {
@@ -134751,7 +134758,7 @@ function HQChartScriptWorker()
134751
134758
 
134752
134759
 
134753
134760
 
134754
- var HQCHART_VERSION="1.1.13157";
134761
+ var HQCHART_VERSION="1.1.13161";
134755
134762
 
134756
134763
  function PrintHQChartVersion()
134757
134764
  {