hqchart 1.1.13802 → 1.1.13804

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.
@@ -12495,7 +12495,7 @@ if(option.EventCallback){for(var i=0;i<option.EventCallback.length;++i){var item
12495
12495
  chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;};this.CreateResizeListener=function(){var _this52=this;this.ResizeListener=new ResizeObserver(function(entries){_this52.OnDivResize(entries);});this.ResizeListener.observe(this.DivElement);};this.OnDivResize=function(entries){JSConsole.Chart.Log("[JSReportChart::OnDivResize] entries=",entries);this.OnSize();};/////////////////////////////////////////////////////////////////////////////
12496
12496
  //对外接口
12497
12497
  //切换股票代码接口
12498
- this.ChangeSymbol=function(symbol,option){if(this.JSChartContainer)this.JSChartContainer.ChangeSymbol(symbol,option);};this.SetColumn=function(aryColumn,option){if(this.JSChartContainer)this.JSChartContainer.SetColumn(aryColumn,option);};this.EnableFilter=function(bEnable,option)//启动|关闭筛选
12498
+ this.ChangeSymbol=function(symbol,option){if(this.JSChartContainer)this.JSChartContainer.ChangeSymbol(symbol,option);};this.SetColumn=function(aryColumn,option){if(this.JSChartContainer)this.JSChartContainer.SetColumn(aryColumn,option);};this.SetSelectedRow=function(option){if(this.JSChartContainer)this.JSChartContainer.SetSelectedRow(option);};this.EnableFilter=function(bEnable,option)//启动|关闭筛选
12499
12499
  {if(this.JSChartContainer)this.JSChartContainer.EnableFilter(bEnable,option);};//事件回调
12500
12500
  this.AddEventCallback=function(obj){if(this.JSChartContainer&&typeof this.JSChartContainer.AddEventCallback=='function'){JSConsole.Chart.Log('[JSReportChart:AddEventCallback] obj=',obj);this.JSChartContainer.AddEventCallback(obj);}};//重新加载配置
12501
12501
  this.ReloadResource=function(option){if(this.JSChartContainer&&typeof this.JSChartContainer.ReloadResource=='function'){JSConsole.Chart.Log('[JSReportChart:ReloadResource] ');this.JSChartContainer.ReloadResource(option);}};this.ChartDestory=function(){if(this.JSChartContainer&&typeof this.JSChartContainer.ChartDestory=='function'){this.JSChartContainer.ChartDestory();}};this.Draw=function(){if(this.JSChartContainer&&typeof this.JSChartContainer.Draw=='function'){JSConsole.Chart.Log('[JSReportChart:Draw] ');this.JSChartContainer.Draw();}};}JSReportChart.TooltipCursorCanvasKey="hq_report_tooltip";//提示信息
@@ -12579,7 +12579,7 @@ this.UIElement.ondblclick=function(e){_this54.UIOnDblClick(e);};this.UIElement.o
12579
12579
  this.UIElement.ontouchstart=function(e){_this54.OnTouchStart(e);};this.UIElement.ontouchmove=function(e){_this54.OnTouchMove(e);};this.UIElement.ontouchend=function(e){_this54.OnTouchEnd(e);};};this.Draw=function(){if(this.UIElement.width<=0||this.UIElement.height<=0)return;this.Canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
12580
12580
  this.Canvas.lineWidth=pixelTatio;//手机端需要根据分辨率比调整线段宽度
12581
12581
  this.LastMouseStatus.MouseOnStatus=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash){this.Frame.Draw({IsEnableSplash:this.ChartSplashPaint.IsEnableSplash});this.ChartSplashPaint.Draw();return;}this.Frame.Draw();this.Frame.DrawLogo();//框架内图形
12582
- for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsDrawFirst)item.Draw(this.LastMouseStatus);}for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.IsDrawFirst)item.Draw(this.LastMouseStatus);}if(this.GlobalOption.FlashBGCount>0){this.DelayDraw(500);}this.DrawTooltip(this.LastMouseStatus.TooltipStatus);};this.DelayDraw=function(frequency){var _this55=this;if(typeof this.FlashBGTimer=='number'){clearTimeout(this.FlashBGTimer);this.FlashBGTimer=null;}this.FlashBGTimer=setTimeout(function(){_this55.Draw();},frequency);};this.ResetReportStatus=function(){this.Data.XOffset=0;this.Data.YOffset=0;};this.ResetReportSelectStatus=function(){var chart=this.GetReportChart();if(chart){chart.SelectedRow=-1;chart.SelectedFixedRow=-1;chart.MultiSelectedRow=[];}};this.ClearData=function(){this.SourceData.Data=[];this.Data.Data=[];this.BlockData=new _map2.default();};this.ClearMapStockData=function(){this.MapStockData=new _map2.default();};this.ResetSortStatus=function(){this.SortInfo.Field=-1;this.SortInfo.Sort=0;};//设置股票列表
12582
+ for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsDrawFirst)item.Draw(this.LastMouseStatus);}for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.IsDrawFirst)item.Draw(this.LastMouseStatus);}if(this.GlobalOption.FlashBGCount>0){this.DelayDraw(500);}this.DrawTooltip(this.LastMouseStatus.TooltipStatus);};this.DelayDraw=function(frequency){var _this55=this;if(typeof this.FlashBGTimer=='number'){clearTimeout(this.FlashBGTimer);this.FlashBGTimer=null;}this.FlashBGTimer=setTimeout(function(){_this55.Draw();},frequency);};this.ResetReportStatus=function(){this.Data.XOffset=0;this.Data.YOffset=0;};this.ResetReportSelectStatus=function(){var chart=this.GetReportChart();if(chart){chart.SelectedRow=-1;chart.SelectedFixedRow=-1;chart.MultiSelectedRow=[];}};this.ClearData=function(){this.SourceData.Data=[];this.Data.Data=[];this.BlockData=new _map2.default();};this.ClearMapStockData=function(){this.MapStockData=new _map2.default();};this.ResetSortStatus=function(){this.SortInfo.Field=-1;this.SortInfo.Sort=0;};this.SetSelectedRow=function(option){var reportChart=this.GetReportChart();if(!reportChart)return false;if(!reportChart.SetSelectedRow(option))return false;this.Draw();};//设置股票列表
12583
12583
  this.SetSymbolList=function(arySymbol,option){this.ClearData();this.ResetReportStatus();this.ResetSortStatus();if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);}}var chart=this.ChartPaint[0];if(chart)chart.Data=this.Data;this.Draw();};this.ChangeSymbol=function(symbol,option){var _this56=this;this.Symbol=symbol;this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();if(option){if(IFrameSplitOperator.IsNumber(option.TabSelected)){var chartTab=this.GetTabChart();if(chartTab)chartTab.SelectedTabIndex=option.TabSelected;}if(Array.isArray(option.FixedSymbol)){var chart=this.GetReportChart();if(chart){chart.FixedRowCount=0;this.FixedRowData.Type=1;this.FixedRowData.Symbol=[];var aryData=option.FixedSymbol;for(var i=0;i<aryData.length;++i){var item=aryData[i];this.FixedRowData.Symbol.push(item.Symbol);++chart.FixedRowCount;}this.SetSizeChange(true);}}if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this56.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据
12584
12584
  this.UpdateFullData=function(data){var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称
12585
12585
  for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];var stock=null;if(this.MapStockData.has(symbol)){stock=this.MapStockData.get(symbol);}else{stock=new HQReportItem();stock.OriginalSymbol=symbol;this.MapStockData.set(symbol,stock);}stock.Symbol=this.GetSymbolNoSuffix(symbol);stock.Name=item[1];this.ReadStockJsonData(stock,item);arySymbol.push(symbol);}}//设置显示数据
@@ -13019,7 +13019,9 @@ this.GetNameColor=function(colunmInfo,symbol,rowType){var event=this.GetEventCal
13019
13019
  for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var header={Left:textLeft,Right:textLeft+item.Width,Top:top,Bottom:bottom};if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:true};}textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(textLeft>=right)break;var header={Left:textLeft,Right:textLeft+item.Width,Top:top,Bottom:bottom};if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:false};}textLeft+=item.Width;}return null;};this.PtInHeader=function(x,y){if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(!(x>=left&&x<=right&&y>=top&&y<=bottom))return null;return this.PtInItem(x,y,top,bottom);};this.IsPtInBody=function(x,y){var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var right=this.RectClient.Right;var bottom=this.RectClient.Bottom;if(x>=left&&x<=right&&y>=top&&y<=bottom)return true;return false;};this.IsPtInHeader=function(x,y){if(!this.IsShowHeader)return false;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(x>=left&&x<=right&&y>=top&&y<=bottom)return true;return false;};this.SendClickEvent=function(id,data){var event=this.GetEventCallback(id);if(event&&event.Callback){event.Callback(event,data,this);}};this.DrawDragRow=function(){if(!this.DragRow)return;var drag=this.DragRow;if(!drag.Data||!drag.Inside||!drag.Data.Row)return;var dataIndex=drag.Data.Row.DataIndex;if(!IFrameSplitOperator.IsNumber(dataIndex)||dataIndex<0)return;var textTop=drag.Inside.Y-this.RowHeight/2;var top=textTop;var left=this.RectClient.Left;var rowWidth=this.RectClient.Right-this.RectClient.Left;//背景
13020
13020
  this.Canvas.fillStyle=this.DragRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);var symbol=this.Data.Data[dataIndex];var data={Symbol:symbol,Stock:null,Block:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(this.GetBlockDataCallback)data.Block=this.GetBlockDataCallback(symbol);data.Decimal=GetfloatPrecision(symbol);//小数位数
13021
13021
  var chartRight=this.RectClient.Right;this.Canvas.font=this.ItemFont;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,3);left+=item.Width;if(left>=chartRight)break;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,3);left+=item.Width;if(left>=chartRight)break;}};this.GetTooltipData=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.TooltipRect))return null;for(var i=0;i<this.TooltipRect.length;++i){var item=this.TooltipRect[i];var rt=item.Rect;if(!rt)continue;if(x>=rt.Left&&x<=rt.Right&&y>=rt.Top&&y<=rt.Bottom){return{Rect:item.Rect,Stock:item.Stock,Column:item.Column,Index:item.Index,Type:item.Type,Data:item.Data};}}return null;};this.GetButtonData=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.ButtonRect))return null;for(var i=0;i<this.ButtonRect.length;++i){var item=this.ButtonRect[i];var rt=item.Rect;if(!rt)continue;if(x>=rt.Left&&x<=rt.Right&&y>=rt.Top&&y<=rt.Bottom){return{Rect:item.Rect,Stock:item.Stock,Column:item.Column,Index:item.Index,Type:item.Type,Data:item.Data,ColumnIndex:item.ColumnIndex};}}};this.PtInHeaderDragBorder=function(x,y){if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(!(x>=left&&x<=right&&y>=top&&y<=bottom))return null;var textLeft=left;var dragBarWidth=5*GetDevicePixelRatio();//固定列
13022
- for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:true};}}textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(textLeft>=right)break;if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:false};}}textLeft+=item.Width;}return null;};}//报价列表底部tab和横向滚动条
13022
+ for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:true};}}textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];if(textLeft>=right)break;if(item.EnableDragWidth===true){var header={Right:textLeft+item.Width,Top:top,Bottom:bottom};header.Left=header.Right-dragBarWidth;if(x>=header.Left&&x<=header.Right&&y>=header.Top&&y<=header.Bottom){return{Rect:header,Column:item,Index:i,IsFixed:false};}}textLeft+=item.Width;}return null;};//设置选中行 data={ Symbol:, AutoYScroll:true/false Y滚动条自定定位 }
13023
+ this.SetSelectedRow=function(option){if(!option)return false;if(this.SelectedModel===0)return false;if(option.Symbol){var symbol=option.Symbol;var bFinder=false;for(var i=0;i<this.Data.Data.length;++i){var item=this.Data.Data[i];if(symbol==item){this.SelectedRow=i;bFinder=true;break;}}if(!bFinder)return false;if(option.AutoYScroll===true){this.UpdatePageYOffset({SelectedRow:this.SelectedRow});}return bFinder;}return false;};this.UpdatePageYOffset=function(option){if(!option)return;var selectedRow=option.SelectedRow;if(selectedRow<0)return;var pageStatus=this.GetCurrentPageStatus();if(pageStatus.IsSinglePage)return;if(selectedRow>=pageStatus.Start&&selectedRow<=pageStatus.End)return;this.Data.YOffset=selectedRow;//选中行不在当前屏 设置为第1行
13024
+ };}//报价列表底部tab和横向滚动条
13023
13025
  function ChartReportTab(){this.Canvas;//画布
13024
13026
  this.ChartBorder;//边框信息
13025
13027
  this.ChartFrame;//框架画法
@@ -13763,7 +13765,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13763
13765
  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);};}/********************************************************************************
13764
13766
  * 版本信息输出
13765
13767
  *
13766
- */var HQCHART_VERSION="1.1.13801";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();//把给外界调用的方法暴露出来
13768
+ */var HQCHART_VERSION="1.1.13803";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();//把给外界调用的方法暴露出来
13767
13769
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13768
13770
  // BaseIndex:BaseIndex,
13769
13771
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13802",
3
+ "version": "1.1.13804",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -274,6 +274,11 @@ function JSReportChart(divElement)
274
274
  if (this.JSChartContainer) this.JSChartContainer.SetColumn(aryColumn,option);
275
275
  }
276
276
 
277
+ this.SetSelectedRow=function(option)
278
+ {
279
+ if (this.JSChartContainer) this.JSChartContainer.SetSelectedRow(option);
280
+ }
281
+
277
282
  this.EnableFilter=function(bEnable, option) //启动|关闭筛选
278
283
  {
279
284
  if (this.JSChartContainer) this.JSChartContainer.EnableFilter(bEnable, option);
@@ -795,6 +800,16 @@ function JSReportChartContainer(uielement)
795
800
  this.SortInfo.Sort=0;
796
801
  }
797
802
 
803
+ this.SetSelectedRow=function(option)
804
+ {
805
+ var reportChart=this.GetReportChart();
806
+ if (!reportChart) return false;
807
+
808
+ if (!reportChart.SetSelectedRow(option)) return false;
809
+
810
+ this.Draw();
811
+ }
812
+
798
813
  //设置股票列表
799
814
  this.SetSymbolList=function(arySymbol, option)
800
815
  {
@@ -7483,6 +7498,54 @@ function ChartReport()
7483
7498
 
7484
7499
  return null;
7485
7500
  }
7501
+
7502
+ //设置选中行 data={ Symbol:, AutoYScroll:true/false Y滚动条自定定位 }
7503
+ this.SetSelectedRow=function(option)
7504
+ {
7505
+ if (!option) return false;
7506
+ if (this.SelectedModel===0) return false;
7507
+
7508
+ if (option.Symbol)
7509
+ {
7510
+ var symbol=option.Symbol;
7511
+ var bFinder=false;
7512
+ for(var i=0;i<this.Data.Data.length;++i)
7513
+ {
7514
+ var item=this.Data.Data[i];
7515
+ if (symbol==item)
7516
+ {
7517
+ this.SelectedRow=i;
7518
+ bFinder=true;
7519
+ break;
7520
+ }
7521
+ }
7522
+
7523
+ if (!bFinder) return false;
7524
+
7525
+ if (option.AutoYScroll===true)
7526
+ {
7527
+ this.UpdatePageYOffset({ SelectedRow:this.SelectedRow });
7528
+ }
7529
+
7530
+ return bFinder;
7531
+ }
7532
+
7533
+
7534
+ return false;
7535
+ }
7536
+
7537
+ this.UpdatePageYOffset=function(option)
7538
+ {
7539
+ if (!option) return;
7540
+ var selectedRow=option.SelectedRow;
7541
+ if (selectedRow<0) return;
7542
+
7543
+ var pageStatus=this.GetCurrentPageStatus();
7544
+ if (pageStatus.IsSinglePage) return;
7545
+ if (selectedRow>=pageStatus.Start && selectedRow<=pageStatus.End) return;
7546
+
7547
+ this.Data.YOffset=selectedRow; //选中行不在当前屏 设置为第1行
7548
+ }
7486
7549
  }
7487
7550
 
7488
7551
  //报价列表底部tab和横向滚动条
@@ -127280,6 +127280,11 @@ function JSReportChart(divElement)
127280
127280
  if (this.JSChartContainer) this.JSChartContainer.SetColumn(aryColumn,option);
127281
127281
  }
127282
127282
 
127283
+ this.SetSelectedRow=function(option)
127284
+ {
127285
+ if (this.JSChartContainer) this.JSChartContainer.SetSelectedRow(option);
127286
+ }
127287
+
127283
127288
  this.EnableFilter=function(bEnable, option) //启动|关闭筛选
127284
127289
  {
127285
127290
  if (this.JSChartContainer) this.JSChartContainer.EnableFilter(bEnable, option);
@@ -127801,6 +127806,16 @@ function JSReportChartContainer(uielement)
127801
127806
  this.SortInfo.Sort=0;
127802
127807
  }
127803
127808
 
127809
+ this.SetSelectedRow=function(option)
127810
+ {
127811
+ var reportChart=this.GetReportChart();
127812
+ if (!reportChart) return false;
127813
+
127814
+ if (!reportChart.SetSelectedRow(option)) return false;
127815
+
127816
+ this.Draw();
127817
+ }
127818
+
127804
127819
  //设置股票列表
127805
127820
  this.SetSymbolList=function(arySymbol, option)
127806
127821
  {
@@ -134489,6 +134504,54 @@ function ChartReport()
134489
134504
 
134490
134505
  return null;
134491
134506
  }
134507
+
134508
+ //设置选中行 data={ Symbol:, AutoYScroll:true/false Y滚动条自定定位 }
134509
+ this.SetSelectedRow=function(option)
134510
+ {
134511
+ if (!option) return false;
134512
+ if (this.SelectedModel===0) return false;
134513
+
134514
+ if (option.Symbol)
134515
+ {
134516
+ var symbol=option.Symbol;
134517
+ var bFinder=false;
134518
+ for(var i=0;i<this.Data.Data.length;++i)
134519
+ {
134520
+ var item=this.Data.Data[i];
134521
+ if (symbol==item)
134522
+ {
134523
+ this.SelectedRow=i;
134524
+ bFinder=true;
134525
+ break;
134526
+ }
134527
+ }
134528
+
134529
+ if (!bFinder) return false;
134530
+
134531
+ if (option.AutoYScroll===true)
134532
+ {
134533
+ this.UpdatePageYOffset({ SelectedRow:this.SelectedRow });
134534
+ }
134535
+
134536
+ return bFinder;
134537
+ }
134538
+
134539
+
134540
+ return false;
134541
+ }
134542
+
134543
+ this.UpdatePageYOffset=function(option)
134544
+ {
134545
+ if (!option) return;
134546
+ var selectedRow=option.SelectedRow;
134547
+ if (selectedRow<0) return;
134548
+
134549
+ var pageStatus=this.GetCurrentPageStatus();
134550
+ if (pageStatus.IsSinglePage) return;
134551
+ if (selectedRow>=pageStatus.Start && selectedRow<=pageStatus.End) return;
134552
+
134553
+ this.Data.YOffset=selectedRow; //选中行不在当前屏 设置为第1行
134554
+ }
134492
134555
  }
134493
134556
 
134494
134557
  //报价列表底部tab和横向滚动条
@@ -138528,7 +138591,7 @@ function ScrollBarBGChart()
138528
138591
 
138529
138592
 
138530
138593
 
138531
- var HQCHART_VERSION="1.1.13801";
138594
+ var HQCHART_VERSION="1.1.13803";
138532
138595
 
138533
138596
  function PrintHQChartVersion()
138534
138597
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13801";
8
+ var HQCHART_VERSION="1.1.13803";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -127324,6 +127324,11 @@ function JSReportChart(divElement)
127324
127324
  if (this.JSChartContainer) this.JSChartContainer.SetColumn(aryColumn,option);
127325
127325
  }
127326
127326
 
127327
+ this.SetSelectedRow=function(option)
127328
+ {
127329
+ if (this.JSChartContainer) this.JSChartContainer.SetSelectedRow(option);
127330
+ }
127331
+
127327
127332
  this.EnableFilter=function(bEnable, option) //启动|关闭筛选
127328
127333
  {
127329
127334
  if (this.JSChartContainer) this.JSChartContainer.EnableFilter(bEnable, option);
@@ -127845,6 +127850,16 @@ function JSReportChartContainer(uielement)
127845
127850
  this.SortInfo.Sort=0;
127846
127851
  }
127847
127852
 
127853
+ this.SetSelectedRow=function(option)
127854
+ {
127855
+ var reportChart=this.GetReportChart();
127856
+ if (!reportChart) return false;
127857
+
127858
+ if (!reportChart.SetSelectedRow(option)) return false;
127859
+
127860
+ this.Draw();
127861
+ }
127862
+
127848
127863
  //设置股票列表
127849
127864
  this.SetSymbolList=function(arySymbol, option)
127850
127865
  {
@@ -134533,6 +134548,54 @@ function ChartReport()
134533
134548
 
134534
134549
  return null;
134535
134550
  }
134551
+
134552
+ //设置选中行 data={ Symbol:, AutoYScroll:true/false Y滚动条自定定位 }
134553
+ this.SetSelectedRow=function(option)
134554
+ {
134555
+ if (!option) return false;
134556
+ if (this.SelectedModel===0) return false;
134557
+
134558
+ if (option.Symbol)
134559
+ {
134560
+ var symbol=option.Symbol;
134561
+ var bFinder=false;
134562
+ for(var i=0;i<this.Data.Data.length;++i)
134563
+ {
134564
+ var item=this.Data.Data[i];
134565
+ if (symbol==item)
134566
+ {
134567
+ this.SelectedRow=i;
134568
+ bFinder=true;
134569
+ break;
134570
+ }
134571
+ }
134572
+
134573
+ if (!bFinder) return false;
134574
+
134575
+ if (option.AutoYScroll===true)
134576
+ {
134577
+ this.UpdatePageYOffset({ SelectedRow:this.SelectedRow });
134578
+ }
134579
+
134580
+ return bFinder;
134581
+ }
134582
+
134583
+
134584
+ return false;
134585
+ }
134586
+
134587
+ this.UpdatePageYOffset=function(option)
134588
+ {
134589
+ if (!option) return;
134590
+ var selectedRow=option.SelectedRow;
134591
+ if (selectedRow<0) return;
134592
+
134593
+ var pageStatus=this.GetCurrentPageStatus();
134594
+ if (pageStatus.IsSinglePage) return;
134595
+ if (selectedRow>=pageStatus.Start && selectedRow<=pageStatus.End) return;
134596
+
134597
+ this.Data.YOffset=selectedRow; //选中行不在当前屏 设置为第1行
134598
+ }
134536
134599
  }
134537
134600
 
134538
134601
  //报价列表底部tab和横向滚动条
@@ -143084,7 +143147,7 @@ function HQChartScriptWorker()
143084
143147
 
143085
143148
 
143086
143149
 
143087
- var HQCHART_VERSION="1.1.13801";
143150
+ var HQCHART_VERSION="1.1.13803";
143088
143151
 
143089
143152
  function PrintHQChartVersion()
143090
143153
  {