hqchart 1.1.13545 → 1.1.13550

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.
@@ -3,21 +3,40 @@
3
3
  //
4
4
  //
5
5
  /////////////////////////////////////////////////////////////////////
6
- };function HQData(){}HQData.Explain="本地测试数据";HQData.NetworkFilter=function(data,callback){console.log("[HQData::NetworkFilter] "+HQData.Explain,data);switch(data.Name){case'MinuteChartContainer::RequestMinuteData'://分时图数据对接
6
+ };function HQData(){}HQData.Explain="本地测试数据";HQData.NetworkFilter=function(data,callback){console.log("[HQData::NetworkFilter] "+HQData.Explain,data);switch(data.Name){//HQChart使用教程29-走势图如何对接第3方数据1
7
+ case'MinuteChartContainer::RequestMinuteData'://分时图数据对接
8
+ //HQChart使用教程29-走势图如何对接第3方数据2-最新分时数据
7
9
  HQData.RequestMinuteData(data,callback);break;case"MinuteChartContainer::RequestHistoryMinuteData"://多日分时图
8
- HQData.RequestMinuteDaysData(data,callback);break;case'KLineChartContainer::RequestHistoryData'://日线全量数据下载
10
+ //HQChart使用教程29-走势图如何对接第3方数据3-多日分时数据
11
+ HQData.RequestMinuteDaysData(data,callback);break;//HQChart使用教程30-K线图如何对接第3方数据1
12
+ case'KLineChartContainer::RequestHistoryData'://日线全量数据下载
13
+ //HQChart使用教程30-K线图如何对接第3方数据2-日K数据
9
14
  HQData.RequestHistoryData(data,callback);break;case'KLineChartContainer::RequestRealtimeData'://日线实时数据更新
15
+ //HQChart使用教程30-K线图如何对接第3方数据14-轮询增量更新日K数据
10
16
  HQData.RequestRealtimeData(data,callback);break;case'KLineChartContainer::RequestFlowCapitalData'://流通股本
17
+ //HQChart使用教程30-K线图如何对接第3方数据4-流通股本数据
11
18
  HQData.RequestFlowCapitalData(data,callback);break;case'KLineChartContainer::ReqeustHistoryMinuteData'://分钟全量数据下载
19
+ //HQChart使用教程30-K线图如何对接第3方数据3-1分钟K数据
12
20
  HQData.RequestHistoryMinuteData(data,callback);break;case'KLineChartContainer::RequestMinuteRealtimeData'://分钟增量数据更新
21
+ //HQChart使用教程30-K线图如何对接第3方数据15-轮询增量更新1分钟K线数据
13
22
  HQData.RequestMinuteRealtimeData(data,callback);break;case"JSSymbolData::GetVariantData"://额外的变量数据
14
- HQData.RequestIndexVariantData(data,callback);break;case"JSSymbolData::GetOtherSymbolData":HQData.RequestOtherSymbolData(data,callback);break;case"AnnouncementInfo::RequestData":HQData.AnnouncementInfo_RequestData(data,callback);break;case"JSSymbolData::GetLatestData":HQData.RequestLatestData(data,callback);break;case"KLineChartContainer::RequestOverlayHistoryData"://叠加股票
15
- HQData.RequestOverlayHistoryData(data,callback);break;case"KLineChartContainer::RequestOverlayHistoryMinuteData":HQData.RequestOverlayHistoryMinuteData(data,callback);break;case"PforecastInfo::RequestData":HQData.PforecastInfo_RequestData(data,callback);break;case"InvestorInfo::RequestData":HQData.InvestorInfo_RequestData(data,callback);break;case"ResearchInfo::RequestData":break;case"BlockTrading::RequestData":HQData.BlockTrading_RequestData(data,callback);break;case"TradeDetail::RequestData":HQData.TradeDetail_RequestData(data,callback);break;//////////////////////////////////////////////////////
23
+ //HQChart使用教程30-K线图如何对接第3方数据29-板块字符串函数数据[GNBLOCK,GNBLOCKNUM......]
24
+ HQData.RequestIndexVariantData(data,callback);break;case"JSSymbolData::GetOtherSymbolData"://HQChart使用教程30-K线图如何对接第3方数据31-获取指定品种的K线数据
25
+ HQData.RequestOtherSymbolData(data,callback);break;case"AnnouncementInfo::RequestData"://HQChart使用教程30-K线图如何对接第3方数据20-信息地雷公告数据
26
+ HQData.AnnouncementInfo_RequestData(data,callback);break;case"JSSymbolData::GetLatestData"://HQChart使用教程30-K线图如何对接第3方数据30-即时行情数据DYNAINFO
27
+ HQData.RequestLatestData(data,callback);break;case"KLineChartContainer::RequestOverlayHistoryData"://叠加股票
28
+ //HQChart使用教程30-K线图如何对接第3方数据16-日K叠加股票
29
+ HQData.RequestOverlayHistoryData(data,callback);break;case"KLineChartContainer::RequestOverlayHistoryMinuteData"://HQChart使用教程30-K线图如何对接第3方数据17- 分钟K叠加股票
30
+ HQData.RequestOverlayHistoryMinuteData(data,callback);break;case"PforecastInfo::RequestData":HQData.PforecastInfo_RequestData(data,callback);break;case"InvestorInfo::RequestData":HQData.InvestorInfo_RequestData(data,callback);break;case"ResearchInfo::RequestData":break;case"BlockTrading::RequestData":HQData.BlockTrading_RequestData(data,callback);break;case"TradeDetail::RequestData":HQData.TradeDetail_RequestData(data,callback);break;//////////////////////////////////////////////////////
16
31
  //报价列表数据
17
- case"JSReportChartContainer::RequestStockListData":HQData.Report_RequestStockListData(data,callback);//码表
32
+ case"JSReportChartContainer::RequestStockListData"://HQChart使用教程95-报价列表对接第3方数据1-码表数据
33
+ HQData.Report_RequestStockListData(data,callback);//码表
18
34
  break;case"JSReportChartContainer::RequestMemberListData"://板块成分
35
+ //HQChart使用教程95-报价列表对接第3方数据2-板块成分数据
19
36
  HQData.Report_RequestMemberListDat(data,callback);break;case"JSDealChartContainer::RequestStockData"://股票数据更新
37
+ //HQChart使用教程95-报价列表对接第3方数据3-股票数据
20
38
  HQData.Report_RequestStockData(data,callback);break;case"JSDealChartContainer::RequestStockSortData"://股票排序数据
39
+ //HQChart使用教程95-报价列表对接第3方数据4-股票排序数据
21
40
  HQData.Report_RequestStockSortData(data,callback);break;}};HQData.RequestMinuteData=function(data,callback){data.PreventDefault=true;var symbol=data.Request.Data.symbol[0];//请求的股票代码
22
41
  var callcation=data.Request.Data.callcation;//集合竞价
23
42
  console.log("[HQData::RequestMinuteData] Symbol="+symbol);var srcStock=MINUTE_1DAY_DATA.stock[0];var stockItem={date:srcStock.date,minute:srcStock.minute,yclose:srcStock.yclose,symbol:srcStock.symbol,name:srcStock.name};if(callcation.Before){var before=[//[交易时间, 价格,成交量, 成交金额, 日期(可选,YYYYMMDD)],
@@ -1437,6 +1437,7 @@ ON_CLICK_TREPORT_HEADER:124,//单击T型报价表头
1437
1437
  ON_RCLICK_TREPORT_HEADER:125,//右键点击T型报价表头
1438
1438
  ON_TREPORT_LOCAL_SORT:126,//T型报价列表本地排序
1439
1439
  ON_CLICK_TREPORT_ROW:127,//左键点击点击T型报价列表
1440
+ ON_DRAW_REPORT_ROW_BG:140,//报价列表整行背景
1440
1441
  ON_CHANGE_INDEX:150,//切换指标
1441
1442
  ON_MENU_COMMAND:151,//菜单事件回调
1442
1443
  ON_CREATE_RIGHT_MENU:152,//创建右键菜单
@@ -12577,9 +12578,11 @@ for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i
12577
12578
  {var iconWidth=item.Icon.Size;if(item.Icon.Margin){var margin=item.Icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))iconWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))iconWidth+=margin.Right;}}textWidth-=iconWidth;if(item.HeaderColor)this.Canvas.fillStyle=item.HeaderColor;else this.Canvas.fillStyle=this.HeaderColor;var textSize={};if(this.SortInfo&&this.SortInfo.Field==i&&this.SortInfo.Sort>0){this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,this.SortInfo.Sort,textSize);}else{this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);}if(iconWidth>0){this.DrawHeaderIcon(item.Icon,textSize.Right,yBottom,i,item);this.Canvas.font=this.HeaderFont;}textLeft+=item.Width;}};this.DrawText=function(text,textAlign,x,yBottom,cellWidth,textSize){var textWidth=this.Canvas.measureText(text).width;if(textAlign=='center'){x=x+(cellWidth-textWidth)/2;}else if(textAlign=='right'){x=x+cellWidth-textWidth;}this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillText(text,x,yBottom-this.HeaderMergin.Bottom);if(textSize){textSize.Right=x+textWidth;textSize.Width=textWidth;}};this.DrawHeaderIcon=function(icon,x,yBottom,index,column){var iconFont=icon.Size+'px '+icon.Family;this.Canvas.font=iconFont;this.Canvas.textAlign="left";if(icon.Color)this.Canvas.fillStyle=icon.Color;var xIcon=x;var yIcon=yBottom;if(icon.Margin&&IFrameSplitOperator.IsNumber(icon.Margin.Left))xIcon+=icon.Margin.Left;if(icon.Margin&&IFrameSplitOperator.IsNumber(icon.Margin.Bottom))yIcon-=icon.Margin.Bottom;this.Canvas.fillText(icon.Symbol,xIcon,yIcon);if(icon.Tooltip){var rtIcon={Left:xIcon,Bottom:yIcon,Width:icon.Size,Height:icon.Size};rtIcon.Right=rtIcon.Left+rtIcon.Width;rtIcon.Top=rtIcon.Bottom-rtIcon.Height;var tooltipData={Rect:rtIcon,Type:2,Column:column,Index:index,Data:icon.Tooltip.Data};this.TooltipRect.push(tooltipData);}};this.DrawSortHeader=function(text,textAlign,x,yBottom,width,sortType,textSize){var pixelRatio=GetDevicePixelRatio();var sortText=this.SortConfig.Arrow[sortType];this.Canvas.font=this.HeaderFont;var textWidth=this.Canvas.measureText(text).width;var sortTextWidth=this.SortConfig.Size*pixelRatio+this.SortConfig.Margin.Left;if(textAlign=='center'){x=x+width/2-(sortTextWidth+textWidth)/2;}else if(textAlign=='right'){x=x+width-sortTextWidth-textWidth;}this.Canvas.textBaseline="bottom";this.Canvas.textAlign="left";var xText=x;this.Canvas.font=this.HeaderFont;this.Canvas.fillStyle=this.HeaderColor;this.Canvas.fillText(text,xText,yBottom-this.HeaderMergin.Bottom);xText+=textWidth+this.SortConfig.Margin.Left;this.Canvas.font=this.SortFont;this.Canvas.fillStyle=this.SortConfig.Color[sortType];this.Canvas.fillText(sortText,xText,yBottom-this.SortConfig.Margin.Bottom);this.Canvas.font=this.HeaderFont;this.Canvas.fillStyle=this.HeaderColor;if(textSize){textSize.Right=x+textWidth+sortTextWidth;textSize.Width=textWidth+sortTextWidth;}};this.DrawBorder=function(){if(!this.IsDrawBorder)return;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=this.RectClient.Bottom;this.Canvas.strokeStyle=this.BorderColor;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(top+this.HeaderHeight));this.Canvas.lineTo(right,ToFixedPoint(top+this.HeaderHeight));var rowTop=top+this.HeaderHeight+this.RowHeight;var rotBottom=rowTop;for(var i=0;i<this.FixedRowCount;++i){var drawTop=ToFixedPoint(rowTop);this.Canvas.moveTo(left,drawTop);this.Canvas.lineTo(right,drawTop);rotBottom=rowTop;rowTop+=this.FixedRowHeight;}var rowTop=top+this.HeaderHeight+this.RowHeight+this.FixedRowHeight*this.FixedRowCount;var rotBottom=rowTop;//横线
12578
12579
  for(var i=0;i<this.RowCount;++i){var drawTop=ToFixedPoint(rowTop);this.Canvas.moveTo(left,drawTop);this.Canvas.lineTo(right,drawTop);rotBottom=rowTop;rowTop+=this.RowHeight;}//竖线
12579
12580
  var columnLeft=left;for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var drawLeft=ToFixedPoint(columnLeft+item.Width);this.Canvas.moveTo(drawLeft,top);this.Canvas.lineTo(drawLeft,rotBottom);columnLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var drawLeft=ToFixedPoint(columnLeft+item.Width);this.Canvas.moveTo(drawLeft,top);this.Canvas.lineTo(drawLeft,rotBottom);columnLeft+=item.Width;}this.Canvas.stroke();};this.DrawBody=function(){if(!this.Data)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.Canvas.font=this.ItemFont;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var rowWidth=this.RectClient.Right-this.RectClient.Left;//固定行
12580
- var textTop=top;this.Canvas.font=this.ItemFixedFont;for(var i=0;i<this.FixedRowCount;++i){if(this.SelectedFixedRow==i){this.Canvas.fillStyle=this.SelectedColor;;this.Canvas.fillRect(left,textTop,rowWidth,this.FixedRowHeight);}if(this.FixedRowData.Type==1)this.DrawFixedSymbolRow(textTop,i);else this.DrawFixedRow(textTop,i);textTop+=this.FixedRowHeight;}textTop=top+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var bFillRow=false;if(this.SelectedModel==0){if(j==this.SelectedRow)bFillRow=true;//选中行
12581
+ var textTop=top;this.Canvas.font=this.ItemFixedFont;for(var i=0;i<this.FixedRowCount;++i){if(this.SelectedFixedRow==i){this.Canvas.fillStyle=this.SelectedColor;;this.Canvas.fillRect(left,textTop,rowWidth,this.FixedRowHeight);}if(this.FixedRowData.Type==1)this.DrawFixedSymbolRow(textTop,i);else this.DrawFixedRow(textTop,i);textTop+=this.FixedRowHeight;}textTop=top+this.FixedRowHeight*this.FixedRowCount;this.Canvas.font=this.ItemFont;var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);var selectedSymbol=this.GetSelectedSymbol();for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var symbol=this.Data.Data[i];var bFillRow=false;if(this.SelectedModel==0){if(j==this.SelectedRow)bFillRow=true;//选中行
12581
12582
  }else{if(i==this.SelectedRow)bFillRow=true;//选中行
12582
- }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(bFillRow){this.Canvas.fillStyle=this.SelectedColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}this.DrawRow(symbol,textTop,i);this.ShowSymbol.push({Index:i,Symbol:symbol});textTop+=this.RowHeight;}};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=拖拽行
12583
+ }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: }
12584
+ var sendData={RowIndex:i,Symbol:symbol,Out:null,Selected:selectedSymbol};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){this.Canvas.fillStyle=this.SelectedColor;this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);}this.DrawRow(symbol,textTop,i);this.ShowSymbol.push({Index:i,Symbol:symbol});textTop+=this.RowHeight;}};this.GetSelectedSymbol=function(){if(this.SelectedRow<0)return null;var index=this.SelectedRow;if(this.SelectedModel==0)//当前屏选中
12585
+ 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=拖拽行
12583
12586
  {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);//小数位数
12584
12587
  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);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);left+=item.Width;if(left>=chartRight)break;}};this.DrawItem=function(index,data,column,left,top,rowType){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};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;//固定行序号空
12585
12588
  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.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'}, ...] } ]}
@@ -13222,18 +13225,19 @@ this.SelectedClassName="UMyChart_MenuItem_Tr_Selected";this.AryTDClassName=["UMy
13222
13225
  "UMyChart_MenuItem_Td_Shortcut",//快捷方式
13223
13226
  "UMyChart_MenuItem_Td_Arrow"//箭头
13224
13227
  ];this.Inital=function(){var _this71=this;window.addEventListener('mousedown',function(e){_this71.OnWindowMouseDown(e);});};//创建菜单
13225
- this.CreatePopMenu=function(data){this.Clear();if(!IFrameSplitOperator.IsNonEmptyArray(data.Menu))return;var root=document.createElement("div");root.className="UMyChart_PopMenu";var table=document.createElement("table");table.className="UMyChart_PopMenu_Table";root.appendChild(table);var tbody=document.createElement("tbody");tbody.className="UMyChart_PopMenu_Tbody";table.appendChild(tbody);var rootData={Root:root,TBody:tbody,Table:table};for(var i=0;i<data.Menu.length;++i){var item=data.Menu[i];if(item.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)tbody.appendChild(trSeparator);continue;}var trDom=this.CreateMenu(rootData,item);tbody.appendChild(trDom);}document.body.appendChild(root);this.RootDOM=root;this.TBodyDOM=tbody;if(IFrameSplitOperator.IsNumber(data.Position))this.Data.Position=data.Position;if(data.ClickCallback)this.ClickCallback=data.ClickCallback;};//清除菜单
13228
+ this.CreatePopMenu=function(data){this.Clear();if(!IFrameSplitOperator.IsNonEmptyArray(data.Menu))return;var root=document.createElement("div");root.className="UMyChart_PopMenu";var table=document.createElement("table");table.className="UMyChart_PopMenu_Table";root.appendChild(table);var tbody=document.createElement("tbody");tbody.className="UMyChart_PopMenu_Tbody";table.appendChild(tbody);var rootData={Root:root,TBody:tbody,Table:table};root.JSMenuData=rootData;for(var i=0;i<data.Menu.length;++i){var item=data.Menu[i];if(item.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)tbody.appendChild(trSeparator);continue;}var trDom=this.CreateMenu(rootData,item);tbody.appendChild(trDom);}document.body.appendChild(root);this.RootDOM=root;this.TBodyDOM=tbody;if(IFrameSplitOperator.IsNumber(data.Position))this.Data.Position=data.Position;if(data.ClickCallback)this.ClickCallback=data.ClickCallback;};//清除菜单
13226
13229
  this.Clear=function(){this.Data.Menu=[];this.Data.Position=JSPopMenu.POSITION_ID.RIGHT_MENU_ID;this.ClickCallback=null;if(!this.RootDOM)return;document.body.removeChild(this.RootDOM);this.RootDOM=null;this.TBodyDOM=null;for(var i=0;i<this.ArySubRootDOM.length;++i){document.body.removeChild(this.ArySubRootDOM[i]);}this.ArySubRootDOM=[];};this.CreateMenu=function(parentItem,item){var _this72=this;var trDom=document.createElement("tr");trDom.className='UMyChart_MenuItem_Tr';if(item.Disable===true)trDom.classList.add('UMyChart_DrawTool_Disable_Tr');var prtTdDom=null;for(var i=0;i<this.AryTDClassName.length;++i){var tdDom=document.createElement("td");tdDom.className=this.AryTDClassName[i];if(i==0)//图标
13227
13230
  {if(item.Checked){var spanDom=document.createElement("span");spanDom.className=this.CheckedClassName;spanDom.style["font-size"]="10px";tdDom.appendChild(spanDom);}}else if(i==1)//内容
13228
13231
  {tdDom.innerText=item.Name;}else if(i==2)//快捷方式
13229
13232
  {}else if(i==3)//箭头
13230
13233
  {if(IFrameSplitOperator.IsNonEmptyArray(item.SubMenu)){var spanDom=document.createElement("span");spanDom.className=this.RightArrowClassName;spanDom.style["font-size"]="10px";tdDom.appendChild(spanDom);}}trDom.appendChild(tdDom);}if(IFrameSplitOperator.IsNonEmptyArray(item.SubMenu))//子菜单
13231
- {var subRoot=document.createElement("div");subRoot.className="UMyChart_PopSubMenu";var subTable=document.createElement("table");subTable.className="UMyChart_PopMenu_Table";subRoot.appendChild(subTable);var subTbody=document.createElement("tbody");subTbody.className="UMyChart_PopMenu_TBody";subTable.appendChild(subTbody);var subRootData={Root:subRoot,TBody:subTbody,Table:subTable};var preTrDom=null;for(var i=0;i<item.SubMenu.length;++i){var subItem=item.SubMenu[i];if(subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)subTbody.appendChild(trSeparator);continue;}var subTrDom=this.CreateMenu(subRootData,subItem);preTrDom=subTrDom;subTbody.appendChild(subTrDom);}trDom.onmouseover=function(e){_this72.OnMouseOver(e,parentItem,trDom,subRoot);};document.body.appendChild(subRoot);this.ArySubRootDOM.push(subRoot);}else{if(item.Disable===true){}else{trDom.onmousedown=function(e){_this72.OnClickMenu(e,item,false);};//菜单点击
13234
+ {var subRoot=document.createElement("div");subRoot.className="UMyChart_PopSubMenu";var subTable=document.createElement("table");subTable.className="UMyChart_PopMenu_Table";subRoot.appendChild(subTable);var subTbody=document.createElement("tbody");subTbody.className="UMyChart_PopMenu_TBody";subTable.appendChild(subTbody);var subRootData={Root:subRoot,TBody:subTbody,Table:subTable};subRoot.JSMenuData=subRootData;var preTrDom=null;for(var i=0;i<item.SubMenu.length;++i){var subItem=item.SubMenu[i];if(subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)subTbody.appendChild(trSeparator);continue;}var subTrDom=this.CreateMenu(subRootData,subItem);preTrDom=subTrDom;subTbody.appendChild(subTrDom);}trDom.onmouseover=function(e){_this72.OnMouseOver(e,parentItem,trDom,subRoot);};document.body.appendChild(subRoot);this.ArySubRootDOM.push(subRoot);}else{if(item.Disable===true){}else{trDom.onmousedown=function(e){_this72.OnClickMenu(e,item,false);};//菜单点击
13232
13235
  trDom.onmouseover=function(e){_this72.OnMouseOver(e,parentItem);};}}return trDom;};this.CreateSeparatorTr=function(){var trSeparator=document.createElement("tr");trSeparator.className='UMyChart_MenuItem_Tr_Separator';var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Status_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);return trSeparator;};//弹tab菜单
13233
13236
  this.PopupMenuByTab=function(rtTab){if(!this.RootDOM)return;if(!rtTab)return;var xLeft=rtTab.Left;var yTop=rtTab.Top-this.RootDOM.offsetHeight;this.RootDOM.style.visibility='visible';this.RootDOM.style.top=yTop+"px";this.RootDOM.style.left=xLeft+"px";};//弹右键菜单
13234
13237
  this.PopupMenuByRight=function(x,y){if(!this.RootDOM)return;if(!IFrameSplitOperator.IsNumber(x)||!IFrameSplitOperator.IsNumber(y))return;//菜单在当前屏幕无法显示需要调整
13235
13238
  var menuHeight=this.RootDOM.offsetHeight;var yMenuBottom=y+menuHeight;var yBottom=window.innerHeight-15;if(yMenuBottom>yBottom)y=yBottom-menuHeight;var menuWidth=this.RootDOM.offsetWidth;var yMenuRight=x+menuWidth;var yRight=window.innerWidth-15;if(yMenuRight>yRight)x=yRight-menuWidth;this.RootDOM.style.visibility='visible';this.RootDOM.style.top=y+"px";this.RootDOM.style.left=x+"px";};//下拉菜单
13236
- this.PopupMenuByDrapdown=function(rtButton){if(!this.RootDOM)return;if(!rtButton)return;var xLeft=rtButton.Left;var yTop=rtButton.Bottom;var menuHeight=this.RootDOM.offsetHeight;var yMenuBottom=yTop+menuHeight;var yBottom=window.innerHeight-15;if(yMenuBottom>yBottom)yTop=rtButton.Top-menuHeight;if(this.Data.Position==JSPopMenu.POSITION_ID.DROPDOWN_RIGHT_MENU_ID){var menuWidth=this.RootDOM.offsetWidth;xLeft=rtButton.Right-menuWidth;}this.RootDOM.style.visibility='visible';this.RootDOM.style.top=yTop+"px";this.RootDOM.style.left=xLeft+"px";};this.OnClickMenu=function(e,item,bSubMenu){console.log("[JSPopMenu::OnClickMenu] e=, item=, bSubMenu",e,item,bSubMenu);if(!this.ClickCallback)return;this.ClickCallback(item);};this.OnMouseOver=function(e,parentItem,trDom,subMenu){if(parentItem&&parentItem.PopMenu&&parentItem.PopMenu!=subMenu){parentItem.PopMenu.style.visibility="hidden";if(parentItem.PopRow)parentItem.PopRow.classList.remove(this.SelectedClassName);parentItem.PopMenu=null;parentItem.PopRow=null;}if(subMenu){if(subMenu.style.visibility=="visible"){}else{var rtParent=trDom.getBoundingClientRect();var x=rtParent.right,y=rtParent.top;//菜单在当前屏幕无法显示需要调整
13239
+ this.PopupMenuByDrapdown=function(rtButton){if(!this.RootDOM)return;if(!rtButton)return;var xLeft=rtButton.Left;var yTop=rtButton.Bottom;var menuHeight=this.RootDOM.offsetHeight;var yMenuBottom=yTop+menuHeight;var yBottom=window.innerHeight-15;if(yMenuBottom>yBottom)yTop=rtButton.Top-menuHeight;if(this.Data.Position==JSPopMenu.POSITION_ID.DROPDOWN_RIGHT_MENU_ID){var menuWidth=this.RootDOM.offsetWidth;xLeft=rtButton.Right-menuWidth;}this.RootDOM.style.visibility='visible';this.RootDOM.style.top=yTop+"px";this.RootDOM.style.left=xLeft+"px";};this.OnClickMenu=function(e,item,bSubMenu){console.log("[JSPopMenu::OnClickMenu] e=, item=, bSubMenu",e,item,bSubMenu);if(!this.ClickCallback)return;this.ClickCallback(item);};this.OnMouseOver=function(e,parentItem,trDom,subMenu){if(parentItem&&parentItem.PopMenu&&parentItem.PopMenu!=subMenu){parentItem.PopMenu.style.visibility="hidden";if(parentItem.PopRow)parentItem.PopRow.classList.remove(this.SelectedClassName);var popMenuData=parentItem.PopMenu.JSMenuData;for(var i=0;i<50;++i)//隐藏子菜单 最多50层
13240
+ {if(!popMenuData)break;if(!popMenuData.PopMenu)break;popMenuData.PopMenu.style.visibility="hidden";popMenuData=popMenuData.PopMenu;}parentItem.PopMenu=null;parentItem.PopRow=null;}if(subMenu){if(subMenu.style.visibility=="visible"){}else{var rtParent=trDom.getBoundingClientRect();var x=rtParent.right,y=rtParent.top;//菜单在当前屏幕无法显示需要调整
13237
13241
  var yBottom=window.innerHeight-15;var yRight=window.innerWidth-15;var menuHeight=subMenu.offsetHeight;var menuWidth=subMenu.offsetWidth;var yMenuBottom=y+menuHeight;var yMenuRight=x+menuWidth;if(yMenuBottom>yBottom)y=yBottom-menuHeight;if(yMenuRight>yRight)x=rtParent.left-menuWidth;subMenu.style.left=x+'px';subMenu.style.top=y+'px';trDom.classList.add(this.SelectedClassName);/*
13238
13242
  if (this.Data.Position==JSPopMenu.POSITION_ID.TAB_MENU_ID)
13239
13243
  {
@@ -13302,7 +13306,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13302
13306
  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);};}/********************************************************************************
13303
13307
  * 版本信息输出
13304
13308
  *
13305
- */var HQCHART_VERSION="1.1.13544";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();//把给外界调用的方法暴露出来
13309
+ */var HQCHART_VERSION="1.1.13549";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();//把给外界调用的方法暴露出来
13306
13310
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13307
13311
  // BaseIndex:BaseIndex,
13308
13312
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13545",
3
+ "version": "1.1.13550",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -48690,52 +48690,68 @@ HQData.NetworkFilter=function(data, callback)
48690
48690
 
48691
48691
  switch(data.Name)
48692
48692
  {
48693
+ //HQChart使用教程29-走势图如何对接第3方数据1
48693
48694
  case 'MinuteChartContainer::RequestMinuteData': //分时图数据对接
48695
+ //HQChart使用教程29-走势图如何对接第3方数据2-最新分时数据
48694
48696
  HQData.RequestMinuteData(data, callback);
48695
48697
  break;
48698
+
48696
48699
  case "MinuteChartContainer::RequestHistoryMinuteData": //多日分时图
48700
+ //HQChart使用教程29-走势图如何对接第3方数据3-多日分时数据
48697
48701
  HQData.RequestMinuteDaysData(data, callback);
48698
48702
  break;
48699
48703
 
48704
+ //HQChart使用教程30-K线图如何对接第3方数据1
48700
48705
  case 'KLineChartContainer::RequestHistoryData': //日线全量数据下载
48706
+ //HQChart使用教程30-K线图如何对接第3方数据2-日K数据
48701
48707
  HQData.RequestHistoryData(data,callback);
48702
48708
  break;
48703
48709
  case 'KLineChartContainer::RequestRealtimeData': //日线实时数据更新
48710
+ //HQChart使用教程30-K线图如何对接第3方数据14-轮询增量更新日K数据
48704
48711
  HQData.RequestRealtimeData(data,callback);
48705
48712
  break;
48706
48713
  case 'KLineChartContainer::RequestFlowCapitalData': //流通股本
48714
+ //HQChart使用教程30-K线图如何对接第3方数据4-流通股本数据
48707
48715
  HQData.RequestFlowCapitalData(data,callback);
48708
48716
  break;
48709
48717
 
48710
48718
  case 'KLineChartContainer::ReqeustHistoryMinuteData': //分钟全量数据下载
48719
+ //HQChart使用教程30-K线图如何对接第3方数据3-1分钟K数据
48711
48720
  HQData.RequestHistoryMinuteData(data, callback);
48712
48721
  break;
48713
48722
  case 'KLineChartContainer::RequestMinuteRealtimeData': //分钟增量数据更新
48723
+ //HQChart使用教程30-K线图如何对接第3方数据15-轮询增量更新1分钟K线数据
48714
48724
  HQData.RequestMinuteRealtimeData(data,callback);
48715
48725
  break;
48716
48726
 
48717
48727
  case "JSSymbolData::GetVariantData": //额外的变量数据
48728
+ //HQChart使用教程30-K线图如何对接第3方数据29-板块字符串函数数据[GNBLOCK,GNBLOCKNUM......]
48718
48729
  HQData.RequestIndexVariantData(data,callback);
48719
48730
  break;
48720
48731
 
48721
48732
  case "JSSymbolData::GetOtherSymbolData":
48733
+ //HQChart使用教程30-K线图如何对接第3方数据31-获取指定品种的K线数据
48722
48734
  HQData.RequestOtherSymbolData(data, callback);
48723
48735
  break;
48724
48736
 
48725
48737
  case "AnnouncementInfo::RequestData":
48738
+ //HQChart使用教程30-K线图如何对接第3方数据20-信息地雷公告数据
48726
48739
  HQData.AnnouncementInfo_RequestData(data,callback);
48727
48740
  break;
48728
48741
 
48729
48742
  case "JSSymbolData::GetLatestData":
48743
+ //HQChart使用教程30-K线图如何对接第3方数据30-即时行情数据DYNAINFO
48730
48744
  HQData.RequestLatestData(data,callback);
48731
48745
  break;
48732
48746
 
48733
48747
 
48734
48748
  case "KLineChartContainer::RequestOverlayHistoryData": //叠加股票
48749
+ //HQChart使用教程30-K线图如何对接第3方数据16-日K叠加股票
48735
48750
  HQData.RequestOverlayHistoryData(data, callback);
48736
48751
  break;
48737
48752
 
48738
48753
  case "KLineChartContainer::RequestOverlayHistoryMinuteData":
48754
+ //HQChart使用教程30-K线图如何对接第3方数据17- 分钟K叠加股票
48739
48755
  HQData.RequestOverlayHistoryMinuteData(data, callback);
48740
48756
  break;
48741
48757
 
@@ -48764,16 +48780,20 @@ HQData.NetworkFilter=function(data, callback)
48764
48780
  //////////////////////////////////////////////////////
48765
48781
  //报价列表数据
48766
48782
  case "JSReportChartContainer::RequestStockListData":
48783
+ //HQChart使用教程95-报价列表对接第3方数据1-码表数据
48767
48784
  HQData.Report_RequestStockListData(data, callback); //码表
48768
48785
  break;
48769
48786
 
48770
48787
  case "JSReportChartContainer::RequestMemberListData": //板块成分
48788
+ //HQChart使用教程95-报价列表对接第3方数据2-板块成分数据
48771
48789
  HQData.Report_RequestMemberListDat(data, callback);
48772
48790
  break;
48773
48791
  case "JSDealChartContainer::RequestStockData": //股票数据更新
48792
+ //HQChart使用教程95-报价列表对接第3方数据3-股票数据
48774
48793
  HQData.Report_RequestStockData(data, callback);
48775
48794
  break;
48776
48795
  case "JSDealChartContainer::RequestStockSortData": //股票排序数据
48796
+ //HQChart使用教程95-报价列表对接第3方数据4-股票排序数据
48777
48797
  HQData.Report_RequestStockSortData(data, callback);
48778
48798
  break;
48779
48799
  }
@@ -2598,6 +2598,8 @@ var JSCHART_EVENT_ID=
2598
2598
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
2599
2599
  ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
2600
2600
 
2601
+ ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
2602
+
2601
2603
 
2602
2604
  ON_CHANGE_INDEX:150, //切换指标
2603
2605
  ON_MENU_COMMAND:151, //菜单事件回调
@@ -56,6 +56,7 @@ function JSPopMenu()
56
56
 
57
57
 
58
58
  var rootData={ Root:root, TBody:tbody, Table:table };
59
+ root.JSMenuData=rootData;
59
60
  for(var i=0;i<data.Menu.length;++i)
60
61
  {
61
62
  var item=data.Menu[i];
@@ -158,6 +159,7 @@ function JSPopMenu()
158
159
  subTable.appendChild(subTbody);
159
160
 
160
161
  var subRootData={ Root:subRoot, TBody:subTbody, Table:subTable };
162
+ subRoot.JSMenuData=subRootData;
161
163
  var preTrDom=null;
162
164
  for(var i=0;i<item.SubMenu.length;++i)
163
165
  {
@@ -293,6 +295,17 @@ function JSPopMenu()
293
295
  parentItem.PopMenu.style.visibility="hidden";
294
296
  if (parentItem.PopRow) parentItem.PopRow.classList.remove(this.SelectedClassName);
295
297
 
298
+ var popMenuData=parentItem.PopMenu.JSMenuData;
299
+ for(var i=0;i<50;++i) //隐藏子菜单 最多50层
300
+ {
301
+ if (!popMenuData) break;
302
+ if (!popMenuData.PopMenu) break;
303
+
304
+ popMenuData.PopMenu.style.visibility="hidden";
305
+
306
+ popMenuData=popMenuData.PopMenu;
307
+ }
308
+
296
309
  parentItem.PopMenu=null;
297
310
  parentItem.PopRow=null;
298
311
  }
@@ -4539,6 +4539,9 @@ function ChartReport()
4539
4539
 
4540
4540
  textTop=top+this.FixedRowHeight*this.FixedRowCount;
4541
4541
  this.Canvas.font=this.ItemFont;
4542
+
4543
+ var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);
4544
+ var selectedSymbol=this.GetSelectedSymbol();
4542
4545
  for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
4543
4546
  {
4544
4547
  var symbol=this.Data.Data[i];
@@ -4578,6 +4581,18 @@ function ChartReport()
4578
4581
  bFillRow=false;
4579
4582
  }
4580
4583
 
4584
+ if (eventDrawBG && eventDrawBG.Callback)
4585
+ {
4586
+ //Out:{ BGColor: }
4587
+ var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol };
4588
+ eventDrawBG.Callback(eventDrawBG,sendData,this);
4589
+ if (sendData.Out && sendData.Out.BGColor)
4590
+ {
4591
+ this.Canvas.fillStyle=sendData.Out.BGColor;
4592
+ this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);
4593
+ }
4594
+ }
4595
+
4581
4596
  if (bFillRow)
4582
4597
  {
4583
4598
  this.Canvas.fillStyle=this.SelectedColor;
@@ -4592,6 +4607,18 @@ function ChartReport()
4592
4607
  }
4593
4608
  }
4594
4609
 
4610
+ this.GetSelectedSymbol=function()
4611
+ {
4612
+ if (this.SelectedRow<0) return null;
4613
+
4614
+ var index=this.SelectedRow;
4615
+ if (this.SelectedModel==0) //当前屏选中
4616
+ index=this.Data.YOffset+this.SelectedRow;
4617
+
4618
+ var symbol=this.Data.Data[index];
4619
+ return symbol;
4620
+ }
4621
+
4595
4622
 
4596
4623
  this.DrawFixedSymbolRow=function(top, dataIndex)
4597
4624
  {
@@ -15,52 +15,68 @@ HQData.NetworkFilter=function(data, callback)
15
15
 
16
16
  switch(data.Name)
17
17
  {
18
+ //HQChart使用教程29-走势图如何对接第3方数据1
18
19
  case 'MinuteChartContainer::RequestMinuteData': //分时图数据对接
20
+ //HQChart使用教程29-走势图如何对接第3方数据2-最新分时数据
19
21
  HQData.RequestMinuteData(data, callback);
20
22
  break;
23
+
21
24
  case "MinuteChartContainer::RequestHistoryMinuteData": //多日分时图
25
+ //HQChart使用教程29-走势图如何对接第3方数据3-多日分时数据
22
26
  HQData.RequestMinuteDaysData(data, callback);
23
27
  break;
24
28
 
29
+ //HQChart使用教程30-K线图如何对接第3方数据1
25
30
  case 'KLineChartContainer::RequestHistoryData': //日线全量数据下载
31
+ //HQChart使用教程30-K线图如何对接第3方数据2-日K数据
26
32
  HQData.RequestHistoryData(data,callback);
27
33
  break;
28
34
  case 'KLineChartContainer::RequestRealtimeData': //日线实时数据更新
35
+ //HQChart使用教程30-K线图如何对接第3方数据14-轮询增量更新日K数据
29
36
  HQData.RequestRealtimeData(data,callback);
30
37
  break;
31
38
  case 'KLineChartContainer::RequestFlowCapitalData': //流通股本
39
+ //HQChart使用教程30-K线图如何对接第3方数据4-流通股本数据
32
40
  HQData.RequestFlowCapitalData(data,callback);
33
41
  break;
34
42
 
35
43
  case 'KLineChartContainer::ReqeustHistoryMinuteData': //分钟全量数据下载
44
+ //HQChart使用教程30-K线图如何对接第3方数据3-1分钟K数据
36
45
  HQData.RequestHistoryMinuteData(data, callback);
37
46
  break;
38
47
  case 'KLineChartContainer::RequestMinuteRealtimeData': //分钟增量数据更新
48
+ //HQChart使用教程30-K线图如何对接第3方数据15-轮询增量更新1分钟K线数据
39
49
  HQData.RequestMinuteRealtimeData(data,callback);
40
50
  break;
41
51
 
42
52
  case "JSSymbolData::GetVariantData": //额外的变量数据
53
+ //HQChart使用教程30-K线图如何对接第3方数据29-板块字符串函数数据[GNBLOCK,GNBLOCKNUM......]
43
54
  HQData.RequestIndexVariantData(data,callback);
44
55
  break;
45
56
 
46
57
  case "JSSymbolData::GetOtherSymbolData":
58
+ //HQChart使用教程30-K线图如何对接第3方数据31-获取指定品种的K线数据
47
59
  HQData.RequestOtherSymbolData(data, callback);
48
60
  break;
49
61
 
50
62
  case "AnnouncementInfo::RequestData":
63
+ //HQChart使用教程30-K线图如何对接第3方数据20-信息地雷公告数据
51
64
  HQData.AnnouncementInfo_RequestData(data,callback);
52
65
  break;
53
66
 
54
67
  case "JSSymbolData::GetLatestData":
68
+ //HQChart使用教程30-K线图如何对接第3方数据30-即时行情数据DYNAINFO
55
69
  HQData.RequestLatestData(data,callback);
56
70
  break;
57
71
 
58
72
 
59
73
  case "KLineChartContainer::RequestOverlayHistoryData": //叠加股票
74
+ //HQChart使用教程30-K线图如何对接第3方数据16-日K叠加股票
60
75
  HQData.RequestOverlayHistoryData(data, callback);
61
76
  break;
62
77
 
63
78
  case "KLineChartContainer::RequestOverlayHistoryMinuteData":
79
+ //HQChart使用教程30-K线图如何对接第3方数据17- 分钟K叠加股票
64
80
  HQData.RequestOverlayHistoryMinuteData(data, callback);
65
81
  break;
66
82
 
@@ -89,16 +105,20 @@ HQData.NetworkFilter=function(data, callback)
89
105
  //////////////////////////////////////////////////////
90
106
  //报价列表数据
91
107
  case "JSReportChartContainer::RequestStockListData":
108
+ //HQChart使用教程95-报价列表对接第3方数据1-码表数据
92
109
  HQData.Report_RequestStockListData(data, callback); //码表
93
110
  break;
94
111
 
95
112
  case "JSReportChartContainer::RequestMemberListData": //板块成分
113
+ //HQChart使用教程95-报价列表对接第3方数据2-板块成分数据
96
114
  HQData.Report_RequestMemberListDat(data, callback);
97
115
  break;
98
116
  case "JSDealChartContainer::RequestStockData": //股票数据更新
117
+ //HQChart使用教程95-报价列表对接第3方数据3-股票数据
99
118
  HQData.Report_RequestStockData(data, callback);
100
119
  break;
101
120
  case "JSDealChartContainer::RequestStockSortData": //股票排序数据
121
+ //HQChart使用教程95-报价列表对接第3方数据4-股票排序数据
102
122
  HQData.Report_RequestStockSortData(data, callback);
103
123
  break;
104
124
  }
@@ -6523,6 +6523,8 @@ var JSCHART_EVENT_ID=
6523
6523
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
6524
6524
  ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6525
6525
 
6526
+ ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
6527
+
6526
6528
 
6527
6529
  ON_CHANGE_INDEX:150, //切换指标
6528
6530
  ON_MENU_COMMAND:151, //菜单事件回调
@@ -129695,6 +129697,9 @@ function ChartReport()
129695
129697
 
129696
129698
  textTop=top+this.FixedRowHeight*this.FixedRowCount;
129697
129699
  this.Canvas.font=this.ItemFont;
129700
+
129701
+ var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);
129702
+ var selectedSymbol=this.GetSelectedSymbol();
129698
129703
  for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
129699
129704
  {
129700
129705
  var symbol=this.Data.Data[i];
@@ -129734,6 +129739,18 @@ function ChartReport()
129734
129739
  bFillRow=false;
129735
129740
  }
129736
129741
 
129742
+ if (eventDrawBG && eventDrawBG.Callback)
129743
+ {
129744
+ //Out:{ BGColor: }
129745
+ var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol };
129746
+ eventDrawBG.Callback(eventDrawBG,sendData,this);
129747
+ if (sendData.Out && sendData.Out.BGColor)
129748
+ {
129749
+ this.Canvas.fillStyle=sendData.Out.BGColor;
129750
+ this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);
129751
+ }
129752
+ }
129753
+
129737
129754
  if (bFillRow)
129738
129755
  {
129739
129756
  this.Canvas.fillStyle=this.SelectedColor;
@@ -129748,6 +129765,18 @@ function ChartReport()
129748
129765
  }
129749
129766
  }
129750
129767
 
129768
+ this.GetSelectedSymbol=function()
129769
+ {
129770
+ if (this.SelectedRow<0) return null;
129771
+
129772
+ var index=this.SelectedRow;
129773
+ if (this.SelectedModel==0) //当前屏选中
129774
+ index=this.Data.YOffset+this.SelectedRow;
129775
+
129776
+ var symbol=this.Data.Data[index];
129777
+ return symbol;
129778
+ }
129779
+
129751
129780
 
129752
129781
  this.DrawFixedSymbolRow=function(top, dataIndex)
129753
129782
  {
@@ -135297,7 +135326,7 @@ function ScrollBarBGChart()
135297
135326
 
135298
135327
 
135299
135328
 
135300
- var HQCHART_VERSION="1.1.13544";
135329
+ var HQCHART_VERSION="1.1.13549";
135301
135330
 
135302
135331
  function PrintHQChartVersion()
135303
135332
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13544";
8
+ var HQCHART_VERSION="1.1.13549";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -48690,52 +48690,68 @@ HQData.NetworkFilter=function(data, callback)
48690
48690
 
48691
48691
  switch(data.Name)
48692
48692
  {
48693
+ //HQChart使用教程29-走势图如何对接第3方数据1
48693
48694
  case 'MinuteChartContainer::RequestMinuteData': //分时图数据对接
48695
+ //HQChart使用教程29-走势图如何对接第3方数据2-最新分时数据
48694
48696
  HQData.RequestMinuteData(data, callback);
48695
48697
  break;
48698
+
48696
48699
  case "MinuteChartContainer::RequestHistoryMinuteData": //多日分时图
48700
+ //HQChart使用教程29-走势图如何对接第3方数据3-多日分时数据
48697
48701
  HQData.RequestMinuteDaysData(data, callback);
48698
48702
  break;
48699
48703
 
48704
+ //HQChart使用教程30-K线图如何对接第3方数据1
48700
48705
  case 'KLineChartContainer::RequestHistoryData': //日线全量数据下载
48706
+ //HQChart使用教程30-K线图如何对接第3方数据2-日K数据
48701
48707
  HQData.RequestHistoryData(data,callback);
48702
48708
  break;
48703
48709
  case 'KLineChartContainer::RequestRealtimeData': //日线实时数据更新
48710
+ //HQChart使用教程30-K线图如何对接第3方数据14-轮询增量更新日K数据
48704
48711
  HQData.RequestRealtimeData(data,callback);
48705
48712
  break;
48706
48713
  case 'KLineChartContainer::RequestFlowCapitalData': //流通股本
48714
+ //HQChart使用教程30-K线图如何对接第3方数据4-流通股本数据
48707
48715
  HQData.RequestFlowCapitalData(data,callback);
48708
48716
  break;
48709
48717
 
48710
48718
  case 'KLineChartContainer::ReqeustHistoryMinuteData': //分钟全量数据下载
48719
+ //HQChart使用教程30-K线图如何对接第3方数据3-1分钟K数据
48711
48720
  HQData.RequestHistoryMinuteData(data, callback);
48712
48721
  break;
48713
48722
  case 'KLineChartContainer::RequestMinuteRealtimeData': //分钟增量数据更新
48723
+ //HQChart使用教程30-K线图如何对接第3方数据15-轮询增量更新1分钟K线数据
48714
48724
  HQData.RequestMinuteRealtimeData(data,callback);
48715
48725
  break;
48716
48726
 
48717
48727
  case "JSSymbolData::GetVariantData": //额外的变量数据
48728
+ //HQChart使用教程30-K线图如何对接第3方数据29-板块字符串函数数据[GNBLOCK,GNBLOCKNUM......]
48718
48729
  HQData.RequestIndexVariantData(data,callback);
48719
48730
  break;
48720
48731
 
48721
48732
  case "JSSymbolData::GetOtherSymbolData":
48733
+ //HQChart使用教程30-K线图如何对接第3方数据31-获取指定品种的K线数据
48722
48734
  HQData.RequestOtherSymbolData(data, callback);
48723
48735
  break;
48724
48736
 
48725
48737
  case "AnnouncementInfo::RequestData":
48738
+ //HQChart使用教程30-K线图如何对接第3方数据20-信息地雷公告数据
48726
48739
  HQData.AnnouncementInfo_RequestData(data,callback);
48727
48740
  break;
48728
48741
 
48729
48742
  case "JSSymbolData::GetLatestData":
48743
+ //HQChart使用教程30-K线图如何对接第3方数据30-即时行情数据DYNAINFO
48730
48744
  HQData.RequestLatestData(data,callback);
48731
48745
  break;
48732
48746
 
48733
48747
 
48734
48748
  case "KLineChartContainer::RequestOverlayHistoryData": //叠加股票
48749
+ //HQChart使用教程30-K线图如何对接第3方数据16-日K叠加股票
48735
48750
  HQData.RequestOverlayHistoryData(data, callback);
48736
48751
  break;
48737
48752
 
48738
48753
  case "KLineChartContainer::RequestOverlayHistoryMinuteData":
48754
+ //HQChart使用教程30-K线图如何对接第3方数据17- 分钟K叠加股票
48739
48755
  HQData.RequestOverlayHistoryMinuteData(data, callback);
48740
48756
  break;
48741
48757
 
@@ -48764,16 +48780,20 @@ HQData.NetworkFilter=function(data, callback)
48764
48780
  //////////////////////////////////////////////////////
48765
48781
  //报价列表数据
48766
48782
  case "JSReportChartContainer::RequestStockListData":
48783
+ //HQChart使用教程95-报价列表对接第3方数据1-码表数据
48767
48784
  HQData.Report_RequestStockListData(data, callback); //码表
48768
48785
  break;
48769
48786
 
48770
48787
  case "JSReportChartContainer::RequestMemberListData": //板块成分
48788
+ //HQChart使用教程95-报价列表对接第3方数据2-板块成分数据
48771
48789
  HQData.Report_RequestMemberListDat(data, callback);
48772
48790
  break;
48773
48791
  case "JSDealChartContainer::RequestStockData": //股票数据更新
48792
+ //HQChart使用教程95-报价列表对接第3方数据3-股票数据
48774
48793
  HQData.Report_RequestStockData(data, callback);
48775
48794
  break;
48776
48795
  case "JSDealChartContainer::RequestStockSortData": //股票排序数据
48796
+ //HQChart使用教程95-报价列表对接第3方数据4-股票排序数据
48777
48797
  HQData.Report_RequestStockSortData(data, callback);
48778
48798
  break;
48779
48799
  }
@@ -6567,6 +6567,8 @@ var JSCHART_EVENT_ID=
6567
6567
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
6568
6568
  ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6569
6569
 
6570
+ ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
6571
+
6570
6572
 
6571
6573
  ON_CHANGE_INDEX:150, //切换指标
6572
6574
  ON_MENU_COMMAND:151, //菜单事件回调
@@ -129739,6 +129741,9 @@ function ChartReport()
129739
129741
 
129740
129742
  textTop=top+this.FixedRowHeight*this.FixedRowCount;
129741
129743
  this.Canvas.font=this.ItemFont;
129744
+
129745
+ var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);
129746
+ var selectedSymbol=this.GetSelectedSymbol();
129742
129747
  for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
129743
129748
  {
129744
129749
  var symbol=this.Data.Data[i];
@@ -129778,6 +129783,18 @@ function ChartReport()
129778
129783
  bFillRow=false;
129779
129784
  }
129780
129785
 
129786
+ if (eventDrawBG && eventDrawBG.Callback)
129787
+ {
129788
+ //Out:{ BGColor: }
129789
+ var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol };
129790
+ eventDrawBG.Callback(eventDrawBG,sendData,this);
129791
+ if (sendData.Out && sendData.Out.BGColor)
129792
+ {
129793
+ this.Canvas.fillStyle=sendData.Out.BGColor;
129794
+ this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);
129795
+ }
129796
+ }
129797
+
129781
129798
  if (bFillRow)
129782
129799
  {
129783
129800
  this.Canvas.fillStyle=this.SelectedColor;
@@ -129792,6 +129809,18 @@ function ChartReport()
129792
129809
  }
129793
129810
  }
129794
129811
 
129812
+ this.GetSelectedSymbol=function()
129813
+ {
129814
+ if (this.SelectedRow<0) return null;
129815
+
129816
+ var index=this.SelectedRow;
129817
+ if (this.SelectedModel==0) //当前屏选中
129818
+ index=this.Data.YOffset+this.SelectedRow;
129819
+
129820
+ var symbol=this.Data.Data[index];
129821
+ return symbol;
129822
+ }
129823
+
129795
129824
 
129796
129825
  this.DrawFixedSymbolRow=function(top, dataIndex)
129797
129826
  {
@@ -137798,6 +137827,7 @@ function JSPopMenu()
137798
137827
 
137799
137828
 
137800
137829
  var rootData={ Root:root, TBody:tbody, Table:table };
137830
+ root.JSMenuData=rootData;
137801
137831
  for(var i=0;i<data.Menu.length;++i)
137802
137832
  {
137803
137833
  var item=data.Menu[i];
@@ -137900,6 +137930,7 @@ function JSPopMenu()
137900
137930
  subTable.appendChild(subTbody);
137901
137931
 
137902
137932
  var subRootData={ Root:subRoot, TBody:subTbody, Table:subTable };
137933
+ subRoot.JSMenuData=subRootData;
137903
137934
  var preTrDom=null;
137904
137935
  for(var i=0;i<item.SubMenu.length;++i)
137905
137936
  {
@@ -138035,6 +138066,17 @@ function JSPopMenu()
138035
138066
  parentItem.PopMenu.style.visibility="hidden";
138036
138067
  if (parentItem.PopRow) parentItem.PopRow.classList.remove(this.SelectedClassName);
138037
138068
 
138069
+ var popMenuData=parentItem.PopMenu.JSMenuData;
138070
+ for(var i=0;i<50;++i) //隐藏子菜单 最多50层
138071
+ {
138072
+ if (!popMenuData) break;
138073
+ if (!popMenuData.PopMenu) break;
138074
+
138075
+ popMenuData.PopMenu.style.visibility="hidden";
138076
+
138077
+ popMenuData=popMenuData.PopMenu;
138078
+ }
138079
+
138038
138080
  parentItem.PopMenu=null;
138039
138081
  parentItem.PopRow=null;
138040
138082
  }
@@ -139238,7 +139280,7 @@ function HQChartScriptWorker()
139238
139280
 
139239
139281
 
139240
139282
 
139241
- var HQCHART_VERSION="1.1.13544";
139283
+ var HQCHART_VERSION="1.1.13549";
139242
139284
 
139243
139285
  function PrintHQChartVersion()
139244
139286
  {