hqchart 1.1.15170 → 1.1.15176

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.
@@ -6823,7 +6823,8 @@ IsShow:true};this.LabelTitle;this.SetOption=function(option){if(this.Super_SetOp
6823
6823
 
6824
6824
  return this.PointRange(drawPoint);
6825
6825
  }
6826
- */this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}var eventData=this.BeforeDrawEvent(drawPoint[0]);if(eventData&&!eventData.IsShow)return;this.ClipFrame();this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(drawPoint[0].X,left);this.Canvas.lineTo(drawPoint[0].X,right);}else{var yFixed=ToFixedPoint2(this.LineWidth,drawPoint[0].Y);this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);}this.Canvas.stroke();this.RestoreLineWidth();var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoint[0].X;line.Start.Y=left;line.End.X=drawPoint[0].X;line.End.Y=right;}else{line.Start.X=left;line.Start.Y=drawPoint[0].Y;line.End.X=right;line.End.Y=drawPoint[0].Y;}this.LinePoint.push(line);//画点
6826
+ *///跨周期 X轴索引调整为0
6827
+ this.ChangePeriod=function(period){var kData=this.GetKData();if(!kData)return;var index=0;this.Value[0].XValue=0;};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}var eventData=this.BeforeDrawEvent(drawPoint[0]);if(eventData&&!eventData.IsShow)return;this.ClipFrame();this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(drawPoint[0].X,left);this.Canvas.lineTo(drawPoint[0].X,right);}else{var yFixed=ToFixedPoint2(this.LineWidth,drawPoint[0].Y);this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);}this.Canvas.stroke();this.RestoreLineWidth();var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoint[0].X;line.Start.Y=left;line.End.X=drawPoint[0].X;line.End.Y=right;}else{line.Start.X=left;line.Start.Y=drawPoint[0].Y;line.End.X=right;line.End.Y=drawPoint[0].Y;}this.LinePoint.push(line);//画点
6827
6828
  this.DrawPoint(drawPoint);//显示价格
6828
6829
  this.DrawInsideLabel(drawPoint[0]);this.Canvas.restore();this.DrawValueLabel(drawPoint[0]);};this.BeforeDrawEvent=function(point){if(!this.HQChart)return null;var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW_HLINE);if(!event||!event.Callback)return null;var sendData={ID:this.Guid,LabelConfig:this.LabelConfig,InsideLabelConfig:this.InsideLabelConfig,IsShow:true};event.Callback(event,sendData,this);return sendData;};this.DrawValueLabel=function(point){if(!point)return;if(this.Frame.IsHScreen)return;//不支持横屏
6829
6830
  var y=point.Y;var yFixed=ToFixedPoint2(this.LineWidth,y);var yValue=this.Frame.GetYData(y);var text=yValue.toFixed(2);var border=this.Frame.GetBorder();var config=this.LabelConfig;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;if(config.Left.IsShow&&this.Frame.ChartBorder.Left>5){var leftText=text;if(config.Left.Text)leftText=config.Left.Text;var textWidth=this.Canvas.measureText(leftText).width;var left=border.Left;if(IFrameSplitOperator.IsNumber(config.Left.LineOffset)&&config.Left.LineOffset!==0){left-=config.Left.LineOffset;this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(border.Left,yFixed);this.Canvas.lineTo(left,yFixed);this.Canvas.stroke();this.RestoreLineWidth();}var margin=config.Left.Margin;var rtBG={Right:left+1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Left=rtBG.Right-rtBG.Width;if(config.BGColor)this.Canvas.fillStyle=config.BGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(leftText,xText,yText);}if(config.Right.IsShow&&this.Frame.ChartBorder.Right>5){var rightText=text;if(config.Right.Text)rightText=config.Right.Text;var textWidth=this.Canvas.measureText(rightText).width;var left=border.Right;if(IFrameSplitOperator.IsNumber(config.Right.LineOffset)&&config.Right.LineOffset!==0){left+=config.Right.LineOffset;this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(border.Right,yFixed);this.Canvas.lineTo(left,yFixed);this.Canvas.stroke();this.RestoreLineWidth();}var margin=config.Right.Margin;var rtBG={Left:left-1,Height:textHeight+margin.Top+margin.Bottom,Width:textWidth+margin.Left+margin.Right};rtBG.Top=y-textHeight/2-margin.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Right=rtBG.Left+rtBG.Width;if(config.BGColor)this.Canvas.fillStyle=config.BGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var xText=rtBG.Left+margin.Left;var yText=rtBG.Top+margin.Top;this.Canvas.fillStyle=config.TextColor;this.Canvas.fillText(rightText,xText,yText);}};this.DrawInsideLabel=function(point){if(!point)return;var isHScreen=this.Frame.IsHScreen;var config=this.InsideLabelConfig;if(!config.IsShow)return;if(config.Position!=0&&config.Position!=1)return;var margin=config.Margin;this.Canvas.fillStyle=this.LineColor;this.Canvas.font=config.Font;var textHeight=this.Canvas.measureText("擎").width;var border=this.Frame.GetBorder();if(isHScreen){var yValue=this.Frame.GetYData(point.X);var text=yValue.toFixed(2);if(this.LabelTitle)text=this.LabelTitle+text;var textWidth=this.Canvas.measureText(text).width;var rtBG=null;if(config.Position==0)//左
@@ -6862,7 +6863,8 @@ this.IsPointIn=this.IsPointIn_XYValue_Line;this.SetOption=function(option){if(th
6862
6863
 
6863
6864
  return this.PointRange(drawPoint);
6864
6865
  }
6865
- */this.IsDrawMain=function()//选中绘制在动态绘图上, 没有选中绘制在背景上
6866
+ *///跨周期 X轴索引调整为0
6867
+ this.ChangePeriod=function(period){var kData=this.GetKData();if(!kData)return;var index=0;this.Value[0].XValue=0;};this.IsDrawMain=function()//选中绘制在动态绘图上, 没有选中绘制在背景上
6866
6868
  {if(!this.GetActiveDrawPicture)return true;var active=this.GetActiveDrawPicture();if(active.Select.Guid==this.Guid)return false;return true;};this.MainDraw=function(){this.Draw();};//获取需要显示的按钮 系统按钮+自定义按钮
6867
6869
  this.GetShowButton=function(){var aryButton=[];var item=this.Button.SettingIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});item=this.Button.CloseIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomButton)){for(var i=0;i<this.CustomButton.length;++i){item=this.CustomButton[i];if(item&&item.Text)aryButton.push({Data:item,Width:null});}}return aryButton;};this.Draw=function(moveonPoint,mouseStatus){this.AryShowButton=[];this.LinePoint=[];this.AryButton=[];this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.LableInfo=null;this.VerticalButtonInfo.Width=0;this.VerticalButtonInfo.Height=0;if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;var bVisibleRange=this.IsYValueInFrame(this.Value[0].YValue);//是否在可视范围
6868
6870
  if(!this.AlwaysShowLab&&!bVisibleRange)return;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}this.ClipFrame();//画线段
@@ -13708,11 +13710,13 @@ this.Canvas.lineWidth=pixelTatio;//手机端需要根据分辨率比调整线段
13708
13710
  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();//框架内图形
13709
13711
  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.DelayDraw=function(frequency){var _this64=this;if(typeof this.FlashBGTimer=='number'){clearTimeout(this.FlashBGTimer);this.FlashBGTimer=null;}this.FlashBGTimer=setTimeout(function(){_this64.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.Data.Virtual.Count=0;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();};//设置股票列表
13710
13712
  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 _this65=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(item.Search)this.SortInfo.Field=this.FindFiledIndex(item.Search);if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}if(IFrameSplitOperator.IsNonEmptyArray(option.Column))//字段重新设置
13711
- {this.SetColumn(option.Column,{Draw:false});}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)&&option.IsReloadStockList){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this65.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStatus.IsFinishStockList=false;this.RequestStatus.IsFinishMemberList=false;this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据
13712
- this.UpdateFullData=function(data){var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称
13713
+ {this.SetColumn(option.Column,{Draw:false});}if(IFrameSplitOperator.IsBool(option.IsReloadStockList)&&option.IsReloadStockList){var requestOption={Callback:null};if(this.Symbol)requestOption.Callback=function(){_this65.RequestMemberListData();};this.MapStockData=new _map2.default();this.RequestStatus.IsFinishStockList=false;this.RequestStatus.IsFinishMemberList=false;this.RequestStockListData(requestOption);return;}}this.RequestMemberListData();};//更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
13714
+ this.UpdateFullData=function(data,option){var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){//0=证券代码 1=股票名称
13713
13715
  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);}}//设置显示数据
13714
- this.Data.Data=[];this.SourceData.Data=[];if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);this.SourceData.Data.push(arySymbol[i]);}}this.Draw();};//设置全部的数据
13715
- this.SetFullData=function(data){this.ClearMapStockData();this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();this.UpdateFullData(data);/*
13716
+ this.Data.Data=[];this.SourceData.Data=[];if(IFrameSplitOperator.IsNonEmptyArray(arySymbol)){for(var i=0;i<arySymbol.length;++i){this.Data.Data.push(arySymbol[i]);this.SourceData.Data.push(arySymbol[i]);}}if(option&&option.SortInfo){//本地排序
13717
+ var item=option.SortInfo;if(item.Search)this.SortInfo.Field=this.FindFiledIndex(item.Search);if(IFrameSplitOperator.IsNumber(item.Field))this.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))this.SortInfo.Sort=item.Sort;}//排序
13718
+ var chart=this.GetReportChart();if(chart&&(this.SortInfo.Sort==1||this.SortInfo.Sort==2)&&IFrameSplitOperator.IsNumber(this.SortInfo.Field)&&this.SortInfo.Field>=0){var column=chart.Column[this.SortInfo.Field];this.LocalDataSort(column,this.SortInfo);}this.Draw();};//设置全部的数据
13719
+ this.SetFullData=function(data,option){this.ClearMapStockData();this.ClearData();this.ResetReportStatus();this.ResetSortStatus();this.ResetReportSelectStatus();this.UpdateFullData(data,option);/*
13716
13720
  //缓存所有数据
13717
13721
  var arySymbol=[];
13718
13722
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -15628,7 +15632,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15628
15632
  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);};}/********************************************************************************
15629
15633
  * 版本信息输出
15630
15634
  *
15631
- */var HQCHART_VERSION="1.1.15169";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();//把给外界调用的方法暴露出来
15635
+ */var HQCHART_VERSION="1.1.15175";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();//把给外界调用的方法暴露出来
15632
15636
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15633
15637
  // BaseIndex:BaseIndex,
15634
15638
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15170",
3
+ "version": "1.1.15176",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -67075,6 +67075,16 @@ function ChartDrawPictureHorizontalLine()
67075
67075
  }
67076
67076
  */
67077
67077
 
67078
+ //跨周期 X轴索引调整为0
67079
+ this.ChangePeriod=function(period)
67080
+ {
67081
+ var kData=this.GetKData();
67082
+ if (!kData) return;
67083
+
67084
+ var index=0;
67085
+ this.Value[0].XValue=0;
67086
+ }
67087
+
67078
67088
  this.Draw=function()
67079
67089
  {
67080
67090
  this.LinePoint=[];
@@ -67656,6 +67666,16 @@ function ChartDrawHLine()
67656
67666
  }
67657
67667
  */
67658
67668
 
67669
+ //跨周期 X轴索引调整为0
67670
+ this.ChangePeriod=function(period)
67671
+ {
67672
+ var kData=this.GetKData();
67673
+ if (!kData) return;
67674
+
67675
+ var index=0;
67676
+ this.Value[0].XValue=0;
67677
+ }
67678
+
67659
67679
  this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
67660
67680
  {
67661
67681
  if (!this.GetActiveDrawPicture) return true;
@@ -1069,8 +1069,8 @@ function JSReportChartContainer(uielement)
1069
1069
  this.RequestMemberListData();
1070
1070
  }
1071
1071
 
1072
- //更新数据
1073
- this.UpdateFullData=function(data)
1072
+ //更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
1073
+ this.UpdateFullData=function(data, option)
1074
1074
  {
1075
1075
  var arySymbol=[];
1076
1076
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -1112,11 +1112,28 @@ function JSReportChartContainer(uielement)
1112
1112
  }
1113
1113
  }
1114
1114
 
1115
+ if (option && option.SortInfo)
1116
+ {
1117
+ //本地排序
1118
+ var item=option.SortInfo;
1119
+ if (item.Search) this.SortInfo.Field=this.FindFiledIndex(item.Search);
1120
+ if (IFrameSplitOperator.IsNumber(item.Field)) this.SortInfo.Field=item.Field;
1121
+ if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
1122
+ }
1123
+
1124
+ //排序
1125
+ var chart=this.GetReportChart();
1126
+ if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
1127
+ {
1128
+ var column=chart.Column[this.SortInfo.Field];
1129
+ this.LocalDataSort(column, this.SortInfo);
1130
+ }
1131
+
1115
1132
  this.Draw();
1116
1133
  }
1117
1134
 
1118
1135
  //设置全部的数据
1119
- this.SetFullData=function(data)
1136
+ this.SetFullData=function(data, option)
1120
1137
  {
1121
1138
  this.ClearMapStockData();
1122
1139
  this.ClearData();
@@ -1124,7 +1141,7 @@ function JSReportChartContainer(uielement)
1124
1141
  this.ResetSortStatus();
1125
1142
  this.ResetReportSelectStatus();
1126
1143
 
1127
- this.UpdateFullData(data);
1144
+ this.UpdateFullData(data, option);
1128
1145
 
1129
1146
  /*
1130
1147
  //缓存所有数据
@@ -71171,6 +71171,16 @@ function ChartDrawPictureHorizontalLine()
71171
71171
  }
71172
71172
  */
71173
71173
 
71174
+ //跨周期 X轴索引调整为0
71175
+ this.ChangePeriod=function(period)
71176
+ {
71177
+ var kData=this.GetKData();
71178
+ if (!kData) return;
71179
+
71180
+ var index=0;
71181
+ this.Value[0].XValue=0;
71182
+ }
71183
+
71174
71184
  this.Draw=function()
71175
71185
  {
71176
71186
  this.LinePoint=[];
@@ -71752,6 +71762,16 @@ function ChartDrawHLine()
71752
71762
  }
71753
71763
  */
71754
71764
 
71765
+ //跨周期 X轴索引调整为0
71766
+ this.ChangePeriod=function(period)
71767
+ {
71768
+ var kData=this.GetKData();
71769
+ if (!kData) return;
71770
+
71771
+ var index=0;
71772
+ this.Value[0].XValue=0;
71773
+ }
71774
+
71755
71775
  this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
71756
71776
  {
71757
71777
  if (!this.GetActiveDrawPicture) return true;
@@ -141365,8 +141385,8 @@ function JSReportChartContainer(uielement)
141365
141385
  this.RequestMemberListData();
141366
141386
  }
141367
141387
 
141368
- //更新数据
141369
- this.UpdateFullData=function(data)
141388
+ //更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
141389
+ this.UpdateFullData=function(data, option)
141370
141390
  {
141371
141391
  var arySymbol=[];
141372
141392
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -141408,11 +141428,28 @@ function JSReportChartContainer(uielement)
141408
141428
  }
141409
141429
  }
141410
141430
 
141431
+ if (option && option.SortInfo)
141432
+ {
141433
+ //本地排序
141434
+ var item=option.SortInfo;
141435
+ if (item.Search) this.SortInfo.Field=this.FindFiledIndex(item.Search);
141436
+ if (IFrameSplitOperator.IsNumber(item.Field)) this.SortInfo.Field=item.Field;
141437
+ if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
141438
+ }
141439
+
141440
+ //排序
141441
+ var chart=this.GetReportChart();
141442
+ if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
141443
+ {
141444
+ var column=chart.Column[this.SortInfo.Field];
141445
+ this.LocalDataSort(column, this.SortInfo);
141446
+ }
141447
+
141411
141448
  this.Draw();
141412
141449
  }
141413
141450
 
141414
141451
  //设置全部的数据
141415
- this.SetFullData=function(data)
141452
+ this.SetFullData=function(data, option)
141416
141453
  {
141417
141454
  this.ClearMapStockData();
141418
141455
  this.ClearData();
@@ -141420,7 +141457,7 @@ function JSReportChartContainer(uielement)
141420
141457
  this.ResetSortStatus();
141421
141458
  this.ResetReportSelectStatus();
141422
141459
 
141423
- this.UpdateFullData(data);
141460
+ this.UpdateFullData(data, option);
141424
141461
 
141425
141462
  /*
141426
141463
  //缓存所有数据
@@ -154092,7 +154129,7 @@ function ScrollBarBGChart()
154092
154129
 
154093
154130
 
154094
154131
 
154095
- var HQCHART_VERSION="1.1.15169";
154132
+ var HQCHART_VERSION="1.1.15175";
154096
154133
 
154097
154134
  function PrintHQChartVersion()
154098
154135
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15169";
8
+ var HQCHART_VERSION="1.1.15175";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -71215,6 +71215,16 @@ function ChartDrawPictureHorizontalLine()
71215
71215
  }
71216
71216
  */
71217
71217
 
71218
+ //跨周期 X轴索引调整为0
71219
+ this.ChangePeriod=function(period)
71220
+ {
71221
+ var kData=this.GetKData();
71222
+ if (!kData) return;
71223
+
71224
+ var index=0;
71225
+ this.Value[0].XValue=0;
71226
+ }
71227
+
71218
71228
  this.Draw=function()
71219
71229
  {
71220
71230
  this.LinePoint=[];
@@ -71796,6 +71806,16 @@ function ChartDrawHLine()
71796
71806
  }
71797
71807
  */
71798
71808
 
71809
+ //跨周期 X轴索引调整为0
71810
+ this.ChangePeriod=function(period)
71811
+ {
71812
+ var kData=this.GetKData();
71813
+ if (!kData) return;
71814
+
71815
+ var index=0;
71816
+ this.Value[0].XValue=0;
71817
+ }
71818
+
71799
71819
  this.IsDrawMain=function() //选中绘制在动态绘图上, 没有选中绘制在背景上
71800
71820
  {
71801
71821
  if (!this.GetActiveDrawPicture) return true;
@@ -141409,8 +141429,8 @@ function JSReportChartContainer(uielement)
141409
141429
  this.RequestMemberListData();
141410
141430
  }
141411
141431
 
141412
- //更新数据
141413
- this.UpdateFullData=function(data)
141432
+ //更新数据 option={ SortInfo:{ Search:, Field:, Sort: } }
141433
+ this.UpdateFullData=function(data, option)
141414
141434
  {
141415
141435
  var arySymbol=[];
141416
141436
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -141452,11 +141472,28 @@ function JSReportChartContainer(uielement)
141452
141472
  }
141453
141473
  }
141454
141474
 
141475
+ if (option && option.SortInfo)
141476
+ {
141477
+ //本地排序
141478
+ var item=option.SortInfo;
141479
+ if (item.Search) this.SortInfo.Field=this.FindFiledIndex(item.Search);
141480
+ if (IFrameSplitOperator.IsNumber(item.Field)) this.SortInfo.Field=item.Field;
141481
+ if (IFrameSplitOperator.IsNumber(item.Sort)) this.SortInfo.Sort=item.Sort;
141482
+ }
141483
+
141484
+ //排序
141485
+ var chart=this.GetReportChart();
141486
+ if (chart && (this.SortInfo.Sort==1 || this.SortInfo.Sort==2) && IFrameSplitOperator.IsNumber(this.SortInfo.Field) && this.SortInfo.Field>=0)
141487
+ {
141488
+ var column=chart.Column[this.SortInfo.Field];
141489
+ this.LocalDataSort(column, this.SortInfo);
141490
+ }
141491
+
141455
141492
  this.Draw();
141456
141493
  }
141457
141494
 
141458
141495
  //设置全部的数据
141459
- this.SetFullData=function(data)
141496
+ this.SetFullData=function(data, option)
141460
141497
  {
141461
141498
  this.ClearMapStockData();
141462
141499
  this.ClearData();
@@ -141464,7 +141501,7 @@ function JSReportChartContainer(uielement)
141464
141501
  this.ResetSortStatus();
141465
141502
  this.ResetReportSelectStatus();
141466
141503
 
141467
- this.UpdateFullData(data);
141504
+ this.UpdateFullData(data, option);
141468
141505
 
141469
141506
  /*
141470
141507
  //缓存所有数据
@@ -166105,7 +166142,7 @@ function HQChartScriptWorker()
166105
166142
 
166106
166143
 
166107
166144
 
166108
- var HQCHART_VERSION="1.1.15169";
166145
+ var HQCHART_VERSION="1.1.15175";
166109
166146
 
166110
166147
  function PrintHQChartVersion()
166111
166148
  {