hqchart 1.1.14773 → 1.1.14775

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.
@@ -13377,11 +13377,11 @@ case REPORT_COLUMN_ID.FUTURES_POSITION_ID:case REPORT_COLUMN_ID.FUTURES_CLOSE_ID
13377
13377
  return this.LoacCustomNumberSort(left,right,column,sortType);case REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID://自定义字符串字段
13378
13378
  return this.LoacCustomStringSort(left,right,column,sortType);case REPORT_COLUMN_ID.CUSTOM_DATETIME_TEXT_ID:return this.LoacCustomDateTimeSort(left,right,column,sortType);default:return 0;}};this.GetStockExtendData=function(symbol,column){if(IFrameSplitOperator.IsNumber(column.DataIndex)){if(column.DataIndex<0)return null;var stock=this.GetStockData(symbol);if(!stock||!stock.ExtendData)return null;return stock.ExtendData[column.DataIndex];}if(IFrameSplitOperator.IsNumber(column.BlockIndex)){if(column.BlockIndex<0)return null;var stock=this.GetBlockData(symbol);if(!stock)return null;return stock[column.BlockIndex];}return null;};this.LocalNameExSort=function(left,right,column,sortType){var leftStock=this.GetStockData(left);var rightStock=this.GetStockData(right);var leftValue="",rightValue="";if(sortType==2){leftValue="啊啊啊啊啊";rightValue="啊啊啊啊啊";}if(leftStock&&leftStock.Name)leftValue=leftStock.Name;if(rightStock&&rightStock.Name)rightValue=rightStock.Name;if(sortType==1){if(rightValue<leftValue)return-1;else if(rightValue<leftValue)return 1;else return 0;}else{if(leftValue<rightValue)return-1;else if(leftValue>rightValue)return 1;else return 0;}};this.LocalStringSort=function(left,right,column,sortType){var leftStock=this.GetStockData(left);var rightStock=this.GetStockData(right);var leftValue="",rightValue="";if(sortType==2){leftValue="啊啊啊啊啊";rightValue="啊啊啊啊啊";}var filedName=MAP_COLUMN_FIELD.get(column.Type);if(leftStock&&leftStock[filedName])leftValue=leftStock[filedName];if(rightStock&&rightStock[filedName])rightValue=rightStock[filedName];if(sortType==1){if(rightValue<leftValue)return-1;else if(rightValue<leftValue)return 1;else return 0;}else{if(leftValue<rightValue)return-1;else if(leftValue>rightValue)return 1;else return 0;}};this.LocalNumberSort=function(left,right,column,sortType){var leftStock=this.GetStockData(left);var rightStock=this.GetStockData(right);var leftValue=-99999999999999,rightValue=-99999999999999;if(sortType==2)leftValue=rightValue=99999999999999;var filedName=MAP_COLUMN_FIELD.get(column.Type);if(leftStock&&IFrameSplitOperator.IsNumber(leftStock[filedName]))leftValue=leftStock[filedName];if(rightStock&&IFrameSplitOperator.IsNumber(rightStock[filedName]))rightValue=rightStock[filedName];if(sortType==1){if(rightValue<leftValue)return-1;else if(rightValue<leftValue)return 1;else return 0;}else{if(leftValue<rightValue)return-1;else if(leftValue>rightValue)return 1;else return 0;}};this.LoacCustomNumberSort=function(left,right,column,sortType){var leftValue=-99999999999999,rightValue=-99999999999999;if(sortType==2)leftValue=rightValue=99999999999999;var value=this.GetStockExtendData(left,column);if(IFrameSplitOperator.IsNumber(value))leftValue=value;var value=this.GetStockExtendData(right,column);if(IFrameSplitOperator.IsNumber(value))rightValue=value;if(sortType==1){if(rightValue<leftValue)return-1;else if(rightValue<leftValue)return 1;else return 0;}else{if(leftValue<rightValue)return-1;else if(leftValue>rightValue)return 1;else return 0;}};this.LoacCustomDateTimeSort=function(left,right,column,sortType){var leftValue=-99999999999999,rightValue=-99999999999999;if(sortType==2)leftValue=rightValue=99999999999999;var value=this.GetStockExtendData(left,column);if(IFrameSplitOperator.IsNumber(value))leftValue=value;var value=this.GetStockExtendData(right,column);if(IFrameSplitOperator.IsNumber(value))rightValue=value;if(sortType==1){if(rightValue<leftValue)return-1;else if(rightValue<leftValue)return 1;else return 0;}else{if(leftValue<rightValue)return-1;else if(leftValue>rightValue)return 1;else return 0;}};this.LoacCustomStringSort=function(left,right,column,sortType){var leftValue="",rightValue="";if(sortType==2)rightValue=leftValue="啊啊啊啊啊";var value=this.GetStockExtendData(left,column);if(IFrameSplitOperator.IsString(value))leftValue=value;var value=this.GetStockExtendData(right,column);if(IFrameSplitOperator.IsString(value))rightValue=value;if(sortType==1){if(rightValue<leftValue)return-1;else if(rightValue<leftValue)return 1;else return 0;}else{if(leftValue<rightValue)return-1;else if(leftValue>rightValue)return 1;else return 0;}};this.RequestStockSortData=function(column,filedid,sortType){var chart=this.ChartPaint[0];if(!chart)return;var self=this;var startIndex=this.Data.YOffset;var pageSize=chart.GetPageSize();var endIndex=startIndex+pageSize;if(endIndex>=this.Data.Data.length)endIndex=this.Data.Data.length-1;if(this.NetworkFilter){var obj={Name:'JSDealChartContainer::RequestStockSortData',//类名::函数名
13379
13379
  Explain:'报价列表股票排序数据',Request:{Data:{range:{start:startIndex,end:endIndex,count:this.Data.Data.length},column:{name:column.Title,type:column.Type,index:filedid,ID:column.ID},sort:sortType,symbol:this.Symbol,name:this.Name,pageSize:pageSize}},Self:this,PreventDefault:false};if(chart.FixedRowCount>0&&chart.FixedRowData.Type==1){var arySymbol=[];for(var i=0;i<chart.FixedRowData.Symbol.length;++i){var item=chart.FixedRowData.Symbol[i];if(item)arySymbol.push(item);}obj.Request.FixedSymbol=arySymbol;}this.NetworkFilter(obj,function(data){self.RecvStockSortData(data);self.AutoUpdate();});if(obj.PreventDefault==true)return;}//throw { Name:'JSReportChartContainer::RequestStockSortData', Error:'(报价列表股票排序数据)不提供内置测试数据' };
13380
- };this.RecvStockSortData=function(data){var chart=this.ChartPaint[0];if(!chart)return;//更新股票数据
13380
+ };this.RecvStockSortData=function(data){var chart=this.ChartPaint[0];if(!chart)return;var selectedSymbol=chart.GetSelectedSingleSymbol();//更新股票数据
13381
13381
  var arySymbol=[];if(IFrameSplitOperator.IsNonEmptyArray(data.data)){for(var i=0;i<data.data.length;++i){var item=data.data[i];//数据
13382
13382
  var symbol=item[0];if(!symbol)continue;var stock=null;if(this.MapStockData.has(symbol)){stock=this.MapStockData.get(symbol);}else{stock=new HQReportItem();stock.OriginalSymbol=symbol;stock.Symbol=this.GetSymbolNoSuffix(symbol);this.MapStockData.set(symbol,stock);}this.ReadStockJsonData(stock,item);arySymbol.push(symbol);}}//更新股票顺序
13383
13383
  if(IFrameSplitOperator.IsNonEmptyArray(data.index)){for(var i=0;i<data.index.length;++i){var index=data.index[i];var newSymbol=arySymbol[i];var oldSymbol=this.Data.Data[index];if(newSymbol==oldSymbol)continue;this.Data.Data[index]=newSymbol;}}if(data.Virtual){var item=data.Virtual;if(IFrameSplitOperator.IsNumber(item.Count))this.Data.Virtual.Count=item.Count;}//更新选中行
13384
- if(data.SelectedRow){var item=data.SelectedRow;chart.SetSelectedRow({Symbol:item.Symbol});}//更新的股票在当前页面,需要重绘
13384
+ if(data.SelectedRow){var item=data.SelectedRow;if(item.Symbol)chart.SetSelectedRow({Symbol:item.Symbol});}else{if(selectedSymbol)chart.SetSelectedRow({Symbol:selectedSymbol});}//更新的股票在当前页面,需要重绘
13385
13385
  var bUpdate=true;if(bUpdate)this.Draw();};//虚拟表格 请求序号 所有数据后台返回
13386
13386
  this.RequestVirtualStockData=function(){var chart=this.ChartPaint[0];if(!chart)return;var self=this;var startIndex=this.Data.YOffset;var pageSize=chart.GetPageSize();var endIndex=startIndex+pageSize;var dataCount=chart.GetAllRowCount();if(endIndex>=dataCount)endIndex=dataCount-1;if(!this.NetworkFilter)return;var requestData={range:{start:startIndex,end:endIndex,count:chart.GetAllRowCount()},column:null,sort:0,symbol:this.Symbol,name:this.Name,pageSize:pageSize};if(this.SortInfo&&this.SortInfo.Field>=0&&this.SortInfo.Sort>0)//排序
13387
13387
  {var column=chart.Column[this.SortInfo.Field];requestData.column={name:column.Title,type:column.Type,index:this.SortInfo.Field,ID:column.ID};requestData.sort=this.SortInfo.Sort;}var obj={Name:'JSDealChartContainer::RequestVirtualStockData',//类名::函数名
@@ -13583,7 +13583,10 @@ var textTop=top;this.Canvas.font=this.ItemFixedFont;for(var i=0;i<this.FixedRowC
13583
13583
  }else{if(i==this.SelectedRow)bFillRow=true;//选中行
13584
13584
  }}if(this.DragRow){if(this.DragRow.Data){var dataIndex=this.DragRow.Data.Row.DataIndex;if(dataIndex==i){this.Canvas.fillStyle=this.DragSrcRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}if(this.DragRow.MoveRow){var dataIndex=this.DragRow.MoveRow.Data.DataIndex;if(dataIndex==i){this.Canvas.fillStyle=this.DragMoveRowColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}bFillRow=false;}if(eventDrawBG&&eventDrawBG.Callback){//Out:{ BGColor: }
13585
13585
  var sendData={RowIndex:i,Symbol:symbol,Out:null,Selected:selectedSymbol,MultiSelectModel:this.MultiSelectModel};eventDrawBG.Callback(eventDrawBG,sendData,this);if(sendData.Out&&sendData.Out.BGColor){this.Canvas.fillStyle=sendData.Out.BGColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}}if(bFillRow){var rtRowBG={Left:left,Top:textTop,Width:rowWidth,Height:this.RowHeight};rtRowBG.Right=rtRowBG.Left+rtRowBG.Width;rtRowBG.Bottom=rtRowBG.Top+rtRowBG.Height;this.AryFullSelectedRow.push(rtRowBG);if(this.SelectedStyle===1){this.Canvas.fillStyle=this.SelectedColor;this.Canvas.fillRect(rtRowBG.Left,rtRowBG.Top,rtRowBG.Width,rtRowBG.Height);}}this.DrawRow(symbol,textTop,i);this.ShowSymbol.push({Index:i,Symbol:symbol});textTop+=this.RowHeight;}};this.DrawSelectedRow=function(){if(this.SelectedStyle===2&&IFrameSplitOperator.IsNonEmptyArray(this.AryFullSelectedRow)){this.Canvas.fillStyle=this.SelectedLineConfig.Color;var lineWidth=this.SelectedLineConfig.Width;for(var i=0;i<this.AryFullSelectedRow.length;++i){var rtBG=this.AryFullSelectedRow[i];this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);}}};this.GetSelectedSymbol=function(){if(this.MultiSelectModel==1){if(!IFrameSplitOperator.IsNonEmptyArray(this.MultiSelectedRow))return null;var aryData=[];for(var i=0;i<this.MultiSelectedRow.length;++i){var item=this.Data.Data[this.MultiSelectedRow[i]];if(!item)continue;aryData.push(item);}return aryData;}else{if(this.SelectedRow<0)return null;var index=this.SelectedRow;if(this.SelectedModel==0)//当前屏选中
13586
- index=this.Data.YOffset+this.SelectedRow;var symbol=this.Data.Data[index];return[symbol];}};this.DrawFixedSymbolRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Symbol))return;var symbol=this.FixedRowData.Symbol[dataIndex];if(!symbol)return;this.DrawRow(symbol,top,dataIndex,1);this.ShowSymbol.push({Index:dataIndex,Symbol:symbol,RowType:1});};this.DrawFixedRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);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.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}};this.DrawFixedItem=function(dataIndex,colIndex,column,left,top){var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(this.GetFixedRowTextDrawInfo(dataIndex,colIndex,column,drawInfo)){this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);return;}if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Data))return;var data=this.FixedRowData.Data;var rowData=data[dataIndex];if(!IFrameSplitOperator.IsNonEmptyArray(rowData))return;var itemData=rowData[colIndex];if(!itemData||!itemData.Text)return;drawInfo.Text=itemData.Text;if(itemData.Color)drawInfo.TextColor=itemData.Color;if(itemData.TextAlign)drawInfo.TextAlign=itemData.TextAlign;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawRow=function(symbol,top,dataIndex,rowType)//rowType 0=表格行 1=顶部固定行 2=拖拽行
13586
+ index=this.Data.YOffset+this.SelectedRow;var symbol=this.Data.Data[index];return[symbol];}};//单行选中模式选中股票
13587
+ this.GetSelectedSingleSymbol=function(){if(this.MultiSelectModel==1)return null;//多选
13588
+ if(this.SelectedModel==0)return null;//当前屏选中
13589
+ if(this.SelectedRow<0)return null;var symbol=this.Data.Data[this.SelectedRow];return symbol;};this.DrawFixedSymbolRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Symbol))return;var symbol=this.FixedRowData.Symbol[dataIndex];if(!symbol)return;this.DrawRow(symbol,top,dataIndex,1);this.ShowSymbol.push({Index:dataIndex,Symbol:symbol,RowType:1});};this.DrawFixedRow=function(top,dataIndex){var left=this.RectClient.Left;var chartRight=this.RectClient.Right;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawFixedItem(dataIndex,i,item,left,top);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.DrawFixedItem(dataIndex,i,item,left,top);left+=item.Width;if(left>=chartRight)break;}};this.DrawFixedItem=function(dataIndex,colIndex,column,left,top){var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign};if(this.GetFixedRowTextDrawInfo(dataIndex,colIndex,column,drawInfo)){this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);return;}if(!this.FixedRowData||!IFrameSplitOperator.IsNonEmptyArray(this.FixedRowData.Data))return;var data=this.FixedRowData.Data;var rowData=data[dataIndex];if(!IFrameSplitOperator.IsNonEmptyArray(rowData))return;var itemData=rowData[colIndex];if(!itemData||!itemData.Text)return;drawInfo.Text=itemData.Text;if(itemData.Color)drawInfo.TextColor=itemData.Color;if(itemData.TextAlign)drawInfo.TextAlign=itemData.TextAlign;this.DrawItemText(drawInfo.Text,drawInfo.TextColor,drawInfo.TextAlign,x,top,textWidth);};this.DrawRow=function(symbol,top,dataIndex,rowType)//rowType 0=表格行 1=顶部固定行 2=拖拽行
13587
13590
  {var left=this.RectClient.Left;var chartRight=this.RectClient.Right;var data={Symbol:symbol,Stock:null,Block:null};if(this.GetStockDataCallback)data.Stock=this.GetStockDataCallback(symbol);if(this.GetBlockDataCallback)data.Block=this.GetBlockDataCallback(symbol);if(this.GetFlashBGDataCallback)data.FlashBG=this.GetFlashBGDataCallback(symbol,Date.now());data.Decimal=GetfloatPrecision(symbol);//小数位数
13588
13591
  for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];this.DrawItem(dataIndex,data,item,left,top,rowType,i);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,rowType,i);left+=item.Width;if(left>=chartRight)break;}};this.BuildSubCellTextData=function(subItem,column,stock,drawInfo,data,option){switch(subItem.Type){case REPORT_COLUMN_ID.NAME_ID:if(stock&&stock.Name)drawInfo.Text=stock.Name;else drawInfo.Text=data.Name;break;case REPORT_COLUMN_ID.SYMBOL_ID:if(stock&&stock.Symbol)drawInfo.Text=stock.Symbol;else drawInfo.Text=data.Symbol;break;case REPORT_COLUMN_ID.PRICE_ID:case REPORT_COLUMN_ID.OPEN_ID:case REPORT_COLUMN_ID.HIGH_ID:case REPORT_COLUMN_ID.LOW_ID:case REPORT_COLUMN_ID.YCLOSE_ID:case REPORT_COLUMN_ID.BUY_PRICE_ID:case REPORT_COLUMN_ID.SELL_PRICE_ID:case REPORT_COLUMN_ID.AVERAGE_PRICE_ID:case REPORT_COLUMN_ID.FUTURES_CLOSE_ID:case REPORT_COLUMN_ID.FUTURES_YCLOSE_ID:var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName]))this.GetPriceDrawInfo(stock[fieldName],stock,data,drawInfo,option);break;case REPORT_COLUMN_ID.INCREASE_ID:case REPORT_COLUMN_ID.AMPLITUDE_ID:case REPORT_COLUMN_ID.UPDOWN_ID:case REPORT_COLUMN_ID.RISING_SPEED_1M_ID:case REPORT_COLUMN_ID.RISING_SPEED_3M_ID:case REPORT_COLUMN_ID.RISING_SPEED_5M_ID:case REPORT_COLUMN_ID.RISING_SPEED_10M_ID:case REPORT_COLUMN_ID.RISING_SPEED_15M_ID:var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);if(stock&&IFrameSplitOperator.IsNumber(stock[fieldName])){var value=stock[fieldName];var text=value.toFixed(2);if(subItem.DynamicFormat)text=subItem.DynamicFormat.replace('{Value}',text);drawInfo.Text=text;drawInfo.TextColor=this.GetUpDownColor(value,0);}break;}};this.DrawSubCellText=function(drawInfo,column,rtText){if(!drawInfo.Text)return;var text=drawInfo.Text;var x=rtText.Left;if(drawInfo.TextAlign=='center'){x=rtText.Left+rtText.Width/2;this.Canvas.textAlign="center";}else if(drawInfo.TextAlign=='right'){x=rtText.Left+rtText.Width-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var bClip=false;this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=drawInfo.TextColor;this.Canvas.fillText(text,x,rtText.Bottom);if(bClip)this.Canvas.restore();};this.DrawItem=function(index,data,column,left,top,rowType,columnIndex){var itemWidth=column.Width;var x=left+this.ItemMergin.Left;var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;var stock=data.Stock;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign,Tooltip:null,Index:index,ColumnIndex:columnIndex};var rtItem={Left:left,Top:top,Width:column.Width,Height:this.RowHeight};rtItem.Right=rtItem.Left+rtItem.Width;rtItem.Bottom=rtItem.Top+rtItem.Height;drawInfo.Rect=rtItem;if(column.FullColBGColor){this.DrawItemBG({Rect:rtItem,BGColor:column.FullColBGColor});}if(column.Type==REPORT_COLUMN_ID.INDEX_ID){if(rowType==1)return;//固定行序号空
13589
13592
  drawInfo.Text=(index+1).toString();}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_ID){if(stock&&stock.Symbol)drawInfo.Text=stock.Symbol;else drawInfo.Text=data.Symbol;this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.DrawSymbolName(data,column,left,top,rowType);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID){this.DrawSymbolNameV2(data,column,left,top,rowType);this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.NAME_ID){if(stock&&stock.Name){if(IFrameSplitOperator.IsString(stock.Name)){drawInfo.Text=this.TextEllipsis(stock.Name,textWidth,column.MaxText);drawInfo.TextColor=this.GetNameColor(column,data.Symbol,rowType);}}this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.NAME_EX_ID){//复杂格式 { Text:, Symbol:{ Family:'iconfont', Size:, Data:[ { Text:'\ue631', Color:'#1c65db'}, ...] } ]}
@@ -14971,7 +14974,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
14971
14974
  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);};}/********************************************************************************
14972
14975
  * 版本信息输出
14973
14976
  *
14974
- */var HQCHART_VERSION="1.1.14772";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();//把给外界调用的方法暴露出来
14977
+ */var HQCHART_VERSION="1.1.14774";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();//把给外界调用的方法暴露出来
14975
14978
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
14976
14979
  // BaseIndex:BaseIndex,
14977
14980
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14773",
3
+ "version": "1.1.14775",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -4276,6 +4276,8 @@ function JSReportChartContainer(uielement)
4276
4276
  var chart=this.ChartPaint[0];
4277
4277
  if (!chart) return;
4278
4278
 
4279
+ var selectedSymbol=chart.GetSelectedSingleSymbol();
4280
+
4279
4281
  //更新股票数据
4280
4282
  var arySymbol=[];
4281
4283
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -4327,7 +4329,11 @@ function JSReportChartContainer(uielement)
4327
4329
  if (data.SelectedRow)
4328
4330
  {
4329
4331
  var item=data.SelectedRow;
4330
- chart.SetSelectedRow({Symbol:item.Symbol});
4332
+ if (item.Symbol) chart.SetSelectedRow({Symbol:item.Symbol});
4333
+ }
4334
+ else
4335
+ {
4336
+ if (selectedSymbol) chart.SetSelectedRow({Symbol:selectedSymbol});
4331
4337
  }
4332
4338
 
4333
4339
  //更新的股票在当前页面,需要重绘
@@ -6118,6 +6124,17 @@ function ChartReport()
6118
6124
  }
6119
6125
  }
6120
6126
 
6127
+ //单行选中模式选中股票
6128
+ this.GetSelectedSingleSymbol=function()
6129
+ {
6130
+ if (this.MultiSelectModel==1) return null; //多选
6131
+ if (this.SelectedModel==0) return null; //当前屏选中
6132
+ if (this.SelectedRow<0) return null;
6133
+
6134
+ var symbol=this.Data.Data[this.SelectedRow];
6135
+ return symbol;
6136
+ }
6137
+
6121
6138
 
6122
6139
  this.DrawFixedSymbolRow=function(top, dataIndex)
6123
6140
  {
@@ -140110,6 +140110,8 @@ function JSReportChartContainer(uielement)
140110
140110
  var chart=this.ChartPaint[0];
140111
140111
  if (!chart) return;
140112
140112
 
140113
+ var selectedSymbol=chart.GetSelectedSingleSymbol();
140114
+
140113
140115
  //更新股票数据
140114
140116
  var arySymbol=[];
140115
140117
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -140161,7 +140163,11 @@ function JSReportChartContainer(uielement)
140161
140163
  if (data.SelectedRow)
140162
140164
  {
140163
140165
  var item=data.SelectedRow;
140164
- chart.SetSelectedRow({Symbol:item.Symbol});
140166
+ if (item.Symbol) chart.SetSelectedRow({Symbol:item.Symbol});
140167
+ }
140168
+ else
140169
+ {
140170
+ if (selectedSymbol) chart.SetSelectedRow({Symbol:selectedSymbol});
140165
140171
  }
140166
140172
 
140167
140173
  //更新的股票在当前页面,需要重绘
@@ -141952,6 +141958,17 @@ function ChartReport()
141952
141958
  }
141953
141959
  }
141954
141960
 
141961
+ //单行选中模式选中股票
141962
+ this.GetSelectedSingleSymbol=function()
141963
+ {
141964
+ if (this.MultiSelectModel==1) return null; //多选
141965
+ if (this.SelectedModel==0) return null; //当前屏选中
141966
+ if (this.SelectedRow<0) return null;
141967
+
141968
+ var symbol=this.Data.Data[this.SelectedRow];
141969
+ return symbol;
141970
+ }
141971
+
141955
141972
 
141956
141973
  this.DrawFixedSymbolRow=function(top, dataIndex)
141957
141974
  {
@@ -148899,7 +148916,7 @@ function ScrollBarBGChart()
148899
148916
 
148900
148917
 
148901
148918
 
148902
- var HQCHART_VERSION="1.1.14772";
148919
+ var HQCHART_VERSION="1.1.14774";
148903
148920
 
148904
148921
  function PrintHQChartVersion()
148905
148922
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14772";
8
+ var HQCHART_VERSION="1.1.14774";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -140154,6 +140154,8 @@ function JSReportChartContainer(uielement)
140154
140154
  var chart=this.ChartPaint[0];
140155
140155
  if (!chart) return;
140156
140156
 
140157
+ var selectedSymbol=chart.GetSelectedSingleSymbol();
140158
+
140157
140159
  //更新股票数据
140158
140160
  var arySymbol=[];
140159
140161
  if (IFrameSplitOperator.IsNonEmptyArray(data.data))
@@ -140205,7 +140207,11 @@ function JSReportChartContainer(uielement)
140205
140207
  if (data.SelectedRow)
140206
140208
  {
140207
140209
  var item=data.SelectedRow;
140208
- chart.SetSelectedRow({Symbol:item.Symbol});
140210
+ if (item.Symbol) chart.SetSelectedRow({Symbol:item.Symbol});
140211
+ }
140212
+ else
140213
+ {
140214
+ if (selectedSymbol) chart.SetSelectedRow({Symbol:selectedSymbol});
140209
140215
  }
140210
140216
 
140211
140217
  //更新的股票在当前页面,需要重绘
@@ -141996,6 +142002,17 @@ function ChartReport()
141996
142002
  }
141997
142003
  }
141998
142004
 
142005
+ //单行选中模式选中股票
142006
+ this.GetSelectedSingleSymbol=function()
142007
+ {
142008
+ if (this.MultiSelectModel==1) return null; //多选
142009
+ if (this.SelectedModel==0) return null; //当前屏选中
142010
+ if (this.SelectedRow<0) return null;
142011
+
142012
+ var symbol=this.Data.Data[this.SelectedRow];
142013
+ return symbol;
142014
+ }
142015
+
141999
142016
 
142000
142017
  this.DrawFixedSymbolRow=function(top, dataIndex)
142001
142018
  {
@@ -159846,7 +159863,7 @@ function HQChartScriptWorker()
159846
159863
 
159847
159864
 
159848
159865
 
159849
- var HQCHART_VERSION="1.1.14772";
159866
+ var HQCHART_VERSION="1.1.14774";
159850
159867
 
159851
159868
  function PrintHQChartVersion()
159852
159869
  {