hqchart 1.1.13085 → 1.1.13090

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.
@@ -1420,7 +1420,8 @@ ON_DBCLICK_TREPORT_ROW:122,//双击T型报报价列表
1420
1420
  ON_RCLICK_TREPORT_ROW:123,//右键点击T型报价列表
1421
1421
  ON_CLICK_TREPORT_HEADER:124,//单击T型报价表头
1422
1422
  ON_RCLICK_TREPORT_HEADER:125,//右键点击T型报价表头
1423
- ON_TREPORT_LOCAL_SORT:126//T型报价列表本地排序
1423
+ ON_TREPORT_LOCAL_SORT:126,//T型报价列表本地排序
1424
+ ON_CLICK_TREPORT_ROW:127//左键点击点击T型报价列表
1424
1425
  };var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
1425
1426
  OP_SCROLL_RIGHT:2,//往右移动
1426
1427
  OP_ZOOM_OUT:3,//缩小
@@ -12598,7 +12599,7 @@ if(item[33])stock.KLine=item[33];//33=K线
12598
12599
  var frequency=this.AutoUpdateFrequency;if(marketStatus==1)//盘前
12599
12600
  {this.AutoUpdateTimer=setTimeout(function(){self.AutoUpdate();},frequency);}else if(marketStatus==2)//盘中
12600
12601
  {this.AutoUpdateTimer=setTimeout(function(){self.UpdateStockData();},frequency);}};//delay=是否延迟
12601
- this.DelayUpdateStockData=function(){var _this58=this;if(this.DelayUpdateTimer!=null){clearTimeout(this.DelayUpdateTimer);this.DelayUpdateTimer=null;}var frequency=this.DelayUpdateFrequency;this.DelayUpdateTimer=setTimeout(function(){_this58.UpdateStockData();},frequency);};this.UIOnMouseDown=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(!chart)return;var clickData=chart.OnMouseDown(x,y,e);if(!clickData)return;if(clickData.Type==2&&(e.button==0||e.button==2))//点击行
12602
+ this.DelayUpdateStockData=function(){var _this58=this;if(this.DelayUpdateTimer!=null){clearTimeout(this.DelayUpdateTimer);this.DelayUpdateTimer=null;}var frequency=this.DelayUpdateFrequency;this.DelayUpdateTimer=setTimeout(function(){_this58.UpdateStockData();},frequency);};this.UIOnDblClick=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.GetTReportChart();if(chart)chart.OnDblClick(x,y,e);};this.UIOnMouseDown=function(e){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var chart=this.ChartPaint[0];if(!chart)return;var clickData=chart.OnMouseDown(x,y,e);if(!clickData)return;if(clickData.Type==2&&(e.button==0||e.button==2))//点击行
12602
12603
  {if(clickData.Redraw==true)this.Draw();}else if(clickData.Type==3&&e.button==0)//表头
12603
12604
  {this.OnClickHeader(clickData,e);}//document.onmousemove=(e)=>{ this.DocOnMouseMove(e); }
12604
12605
  //document.onmouseup=(e)=> { this.DocOnMouseUp(e); }
@@ -12631,7 +12632,10 @@ case TREPORT_COLUMN_ID.AMPLITUDE_ID:case TREPORT_COLUMN_ID.INCREASE_ID:return th
12631
12632
  var result=this.MoveSelectedRow(-1);if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();}break;case 40://down
12632
12633
  var result=this.MoveSelectedRow(1);if(result){if(result.Redraw)this.Draw();if(result.Update)this.DelayUpdateStockData();}break;}//不让滚动条滚动
12633
12634
  if(e.preventDefault)e.preventDefault();else e.returnValue=false;};this.MoveSelectedRow=function(step){var chart=this.ChartPaint[0];if(!chart)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var result={Redraw:false,Update:false};//Redraw=重绘, Update=更新数据
12634
- var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selectedIndex=pageStatus.Start;var cellType=1;if(pageStatus.SelectedRow){cellType=pageStatus.SelectedRow.CellType;for(var i=0;i<this.Data.Data.length;++i){if(pageStatus.SelectedRow.ExePrice==this.Data.Data[i]){selectedIndex=i;break;}}}if(step>0){if(selectedIndex<0||selectedIndex<pageStatus.Start||selectedIndex>pageStatus.End){chart.SelectedRow={ExePrice:this.Data.Data[pageStatus.Start],CellType:cellType};result.Redraw=true;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){++selectedIndex;if(selectedIndex>pageStatus.End)++offset;if(selectedIndex>=this.Data.Data.length){selectedIndex=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow={ExePrice:this.Data.Data[selectedIndex],CellType:cellType};this.Data.YOffset=offset;return result;}else if(step<0){if(selectedIndex<0||selectedIndex<pageStatus.Start||selectedIndex>pageStatus.End){chart.SelectedRow={ExePrice:this.Data.Data[pageStatus.End],CellType:cellType};result.Redraw=true;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){--selectedIndex;if(selectedIndex<pageStatus.Start)--offset;if(selectedIndex<0){selectedIndex=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow={ExePrice:this.Data.Data[selectedIndex],CellType:cellType};this.Data.YOffset=offset;return result;}return null;};}function JSTReportFrame(){this.ChartBorder;this.Canvas;//画布
12635
+ var pageStatus=chart.GetCurrentPageStatus();var pageSize=pageStatus.PageSize;var selectedIndex=pageStatus.Start;var cellType=1;if(pageStatus.SelectedRow){cellType=pageStatus.SelectedRow.CellType;for(var i=0;i<this.Data.Data.length;++i){if(pageStatus.SelectedRow.ExePrice==this.Data.Data[i]){selectedIndex=i;break;}}}if(step>0){if(selectedIndex<0||selectedIndex<pageStatus.Start||selectedIndex>pageStatus.End){chart.SelectedRow={ExePrice:this.Data.Data[pageStatus.Start],CellType:cellType};result.Redraw=true;return result;}var offset=this.Data.YOffset;for(var i=0;i<step;++i){++selectedIndex;if(selectedIndex>pageStatus.End)++offset;if(selectedIndex>=this.Data.Data.length){selectedIndex=0;offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow={ExePrice:this.Data.Data[selectedIndex],CellType:cellType};this.Data.YOffset=offset;return result;}else if(step<0){if(selectedIndex<0||selectedIndex<pageStatus.Start||selectedIndex>pageStatus.End){chart.SelectedRow={ExePrice:this.Data.Data[pageStatus.End],CellType:cellType};result.Redraw=true;return result;}step=Math.abs(step);var offset=this.Data.YOffset;for(var i=0;i<step;++i){--selectedIndex;if(selectedIndex<pageStatus.Start)--offset;if(selectedIndex<0){selectedIndex=this.Data.Data.length-1;offset=this.Data.Data.length-pageSize;if(offset<0)offset=0;}}result.Redraw=true;result.Update=offset!=this.Data.YOffset;chart.SelectedRow={ExePrice:this.Data.Data[selectedIndex],CellType:cellType};this.Data.YOffset=offset;return result;}return null;};//obj={ ID:, Color: , Time:, Count: }
12636
+ this.SetFlashBGItem=function(symbol,obj){var item={ID:obj.ID,Color:obj.Color,Count:1};if(IFrameSplitOperator.IsNumber(obj.Count))item.Count=obj.Count;if(IFrameSplitOperator.IsNumber(obj.Time))item.Time=obj.Time;else item.Time=Date.now();if(this.FlashBG.has(symbol)){var stockItem=this.FlashBG.get(symbol);stockItem.LastTime=item.Time;stockItem.Data.set(item.ID,item);}else{var stockItem={LastTime:item.Time,Data:new _map2.default([[item.ID,item]])};this.FlashBG.set(symbol,stockItem);}};this.GetFlashBGData=function(symbol,time){if(!this.FlashBG)return null;if(!this.FlashBG.has(symbol))return null;var timeDiff=3*1000;var stockItem=this.FlashBG.get(symbol);if(time-stockItem.LastTime>=timeDiff)//超时的删除
12637
+ {this.FlashBG.delete(symbol);return null;}if(!stockItem.Data||stockItem.Data.size<=0){this.FlashBG.delete(symbol);return null;}var aryDelID=[];//超时需要参数的
12638
+ var _iteratorNormalCompletion24=true;var _didIteratorError24=false;var _iteratorError24=undefined;try{for(var _iterator24=(0,_getIterator3.default)(stockItem.Data),_step24;!(_iteratorNormalCompletion24=(_step24=_iterator24.next()).done);_iteratorNormalCompletion24=true){var mapItem=_step24.value;var item=mapItem[1];if(time-item.Time>=timeDiff||item.Count<=0)aryDelID.push(item.ID);}}catch(err){_didIteratorError24=true;_iteratorError24=err;}finally{try{if(!_iteratorNormalCompletion24&&_iterator24.return){_iterator24.return();}}finally{if(_didIteratorError24){throw _iteratorError24;}}}if(IFrameSplitOperator.IsNonEmptyArray(aryDelID)){for(var i=0;i<aryDelID.length;++i){stockItem.Data.delete(aryDelID[i]);}if(stockItem.Data.size<=0){this.FlashBG.delete(symbol);return null;}}return stockItem;};}function JSTReportFrame(){this.ChartBorder;this.Canvas;//画布
12635
12639
  this.BorderLine=null;//1=上 2=下 4=左 8=右
12636
12640
  this.ClassName="JSTReportFrame";this.BorderColor=g_JSChartResource.TReport.BorderColor;//边框线
12637
12641
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSChartResource.FrameLogo.Font;this.ReloadResource=function(resource){this.BorderColor=g_JSChartResource.TReport.BorderColor;//边框线
@@ -12713,8 +12717,9 @@ var xRight=rtCenterItem.Right;//右边
12713
12717
  for(var i=this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width+this.ItemExtraWidth;var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;var x=xLeft-itemWidth+this.HeaderMergin.Left;if(xLeft-itemWidth<reportleft)break;var bSort=this.SortInfo&&this.SortInfo.Field==i&&this.SortInfo.Sort>0;if(bSort&&this.SortInfo.CellType==1)this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);else this.DrawText(item.Title,item.TextAlign,x,y,textWidth);xLeft-=itemWidth;var x=xRight+this.HeaderMergin.Left;if(bSort&&this.SortInfo.CellType==2)this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);else this.DrawText(item.Title,item.TextAlign,x,y,textWidth);xRight+=itemWidth;}};this.DrawSortHeader=function(text,textAlign,x,y,width,sortType){var sortText=sortType==1?"↓":"↑";var sortTextWidth=this.Canvas.measureText(sortText).width;var textWidth=this.Canvas.measureText(text).width+2;this.Canvas.textBaseline="middle";this.Canvas.textAlign="left";if(textAlign=='center'){x=x+width/2-(sortTextWidth+textWidth)/2;}else if(textAlign=='right'){x=x+width-sortTextWidth-textWidth;}else{}this.Canvas.fillText(text,x,y);this.Canvas.fillStyle=this.SortColor;this.Canvas.fillText(sortText,x+textWidth,y);this.Canvas.fillStyle=this.HeaderColor;};this.DrawText=function(text,textAlign,x,y,textWidth){if(textAlign=='center'){x=x+textWidth/2;this.Canvas.textAlign="center";}else if(textAlign=='right'){x=x+textWidth;this.Canvas.textAlign="right";}else{this.Canvas.textAlign="left";}this.Canvas.textBaseline="middle";this.Canvas.fillText(text,x,y);};this.GetFontHeight=function(font,word){return GetFontHeight(this.Canvas,font,word);};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;var textTop=top;this.Canvas.font=this.ItemFont;for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var exePrice=this.Data.Data[i];this.DrawRow(exePrice,textTop,i);this.ShowSymbol.push({Index:i,ExePrice:exePrice});textTop+=this.RowHeight;}if(this.RectSelectedRow){this.Canvas.fillStyle=this.SelectedColor;var lineWidth=2;this.Canvas.fillRect(this.RectSelectedRow.Left,this.RectSelectedRow.Bottom-lineWidth,this.RectSelectedRow.Right-this.RectSelectedRow.Left,lineWidth);}};this.GetCenterItemRect=function(){var xCenter=(this.RectClient.Right-this.RectClient.Left)/2+this.RectClient.Left;//中间列
12714
12718
  var item=this.CenterColumn;var itemWidth=item.Width+this.ItemExtraWidth;var left=xCenter-itemWidth/2;var right=xCenter+itemWidth/2;var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;return{Left:left,Right:right,TextWidth:textWidth,Width:itemWidth};};this.DrawRow=function(exePrice,top,dataIndex){var rtCenterItem=this.GetCenterItemRect();var xLeft=rtCenterItem.Left;//左边
12715
12719
  var xRight=rtCenterItem.Right;//右边
12716
- var reportleft=this.RectClient.Left;var reportRight=this.RectClient.Right;var data={ExePrice:exePrice,TData:null};if(this.GetExePriceDataCallback)data.TData=this.GetExePriceDataCallback(exePrice);//if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(exePrice, Date.now());
12717
- data.Decimal=2;var bSelected=false;if(this.SelectedRow&&this.SelectedRow.ExePrice==exePrice)bSelected=true;var rtItem={Left:xLeft,Right:xRight,Top:top,Height:this.RowHeight};rtItem.Bottom=rtItem.Top+rtItem.Height;rtItem.Width=rtItem.Right-rtItem.Left;this.DrawCenterItem(dataIndex,data,this.CenterColumn,rtItem,0);if(bSelected&&this.SelectedRow.CellType==0)this.RectSelectedRow=rtItem;if(IFrameSplitOperator.IsNumber(this.Data.BaseExePrice)){var leftBGColor=null,rightBGColor=null;if(exePrice>this.Data.BaseExePrice){leftBGColor=this.UpBGColor;rightBGColor=this.DownBGColor;}else{leftBGColor=this.DownBGColor;rightBGColor=this.UpBGColor;}if(leftBGColor){var rtBG={Left:reportleft+1,Right:rtCenterItem.Left,Top:top,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width=rtBG.Right-rtBG.Left;this.Canvas.fillStyle=leftBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(rightBGColor){var rtBG={Left:rtCenterItem.Right,Right:reportRight,Top:top,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width=rtBG.Right-rtBG.Left;this.Canvas.fillStyle=rightBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}for(var i=this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width+this.ItemExtraWidth;xLeft-=itemWidth;if(xLeft<reportleft)break;var leftData=null,rightData=null;if(data.TData)leftData=data.TData.LeftData;if(data.TData)rightData=data.TData.RightData;rtItem={Left:xLeft,Right:xLeft+itemWidth,Top:top,Height:this.RowHeight,Width:itemWidth};rtItem.Bottom=rtItem.Top+rtItem.Height;this.DrawItem(dataIndex,data,leftData,item,rtItem,1);if(bSelected&&this.SelectedRow.CellType==1){if(!this.RectSelectedRow)this.RectSelectedRow=rtItem;else this.RectSelectedRow.Left=rtItem.Left;}rtItem={Left:xRight,Right:xRight+itemWidth,Top:top,Height:this.RowHeight,Width:itemWidth};rtItem.Bottom=rtItem.Top+rtItem.Height;this.DrawItem(dataIndex,data,rightData,item,rtItem,2);xRight+=itemWidth;if(bSelected&&this.SelectedRow.CellType==2){if(!this.RectSelectedRow)this.RectSelectedRow=rtItem;else this.RectSelectedRow.Right=rtItem.Right;}}};this.DrawCenterItem=function(index,data,column,rtItem,cellType)//cellType 0=中间字段 1=左侧 2=右侧
12720
+ var reportleft=this.RectClient.Left;var reportRight=this.RectClient.Right;var data={ExePrice:exePrice,TData:null};if(this.GetExePriceDataCallback)data.TData=this.GetExePriceDataCallback(exePrice);if(this.GetFlashBGDataCallback&&data.TData){if(data.TData.LeftData)//左侧
12721
+ {var item=data.TData.LeftData;data.TData.LeftFlashBG=this.GetFlashBGDataCallback(item.Symbol,Date.now());}if(data.TData.RightData)//右侧
12722
+ {var item=data.TData.RightData;data.TData.RightFlashBG=this.GetFlashBGDataCallback(item.Symbol,Date.now());}}data.Decimal=2;var bSelected=false;if(this.SelectedRow&&this.SelectedRow.ExePrice==exePrice)bSelected=true;var rtItem={Left:xLeft,Right:xRight,Top:top,Height:this.RowHeight};rtItem.Bottom=rtItem.Top+rtItem.Height;rtItem.Width=rtItem.Right-rtItem.Left;this.DrawCenterItem(dataIndex,data,this.CenterColumn,rtItem,0);if(bSelected&&this.SelectedRow.CellType==0)this.RectSelectedRow=rtItem;if(IFrameSplitOperator.IsNumber(this.Data.BaseExePrice)){var leftBGColor=null,rightBGColor=null;if(exePrice>this.Data.BaseExePrice){leftBGColor=this.UpBGColor;rightBGColor=this.DownBGColor;}else{leftBGColor=this.DownBGColor;rightBGColor=this.UpBGColor;}if(leftBGColor){var rtBG={Left:reportleft+1,Right:rtCenterItem.Left,Top:top,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width=rtBG.Right-rtBG.Left;this.Canvas.fillStyle=leftBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(rightBGColor){var rtBG={Left:rtCenterItem.Right,Right:reportRight,Top:top,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width=rtBG.Right-rtBG.Left;this.Canvas.fillStyle=rightBGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}}for(var i=this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width+this.ItemExtraWidth;xLeft-=itemWidth;if(xLeft<reportleft)break;var leftData=null,rightData=null;if(data.TData)leftData=data.TData.LeftData;if(data.TData)rightData=data.TData.RightData;rtItem={Left:xLeft,Right:xLeft+itemWidth,Top:top,Height:this.RowHeight,Width:itemWidth};rtItem.Bottom=rtItem.Top+rtItem.Height;this.DrawItem(dataIndex,data,leftData,item,rtItem,1);if(bSelected&&this.SelectedRow.CellType==1){if(!this.RectSelectedRow)this.RectSelectedRow=rtItem;else this.RectSelectedRow.Left=rtItem.Left;}rtItem={Left:xRight,Right:xRight+itemWidth,Top:top,Height:this.RowHeight,Width:itemWidth};rtItem.Bottom=rtItem.Top+rtItem.Height;this.DrawItem(dataIndex,data,rightData,item,rtItem,2);xRight+=itemWidth;if(bSelected&&this.SelectedRow.CellType==2){if(!this.RectSelectedRow)this.RectSelectedRow=rtItem;else this.RectSelectedRow.Right=rtItem.Right;}}};this.DrawCenterItem=function(index,data,column,rtItem,cellType)//cellType 0=中间字段 1=左侧 2=右侧
12718
12723
  {//tooltip提示
12719
12724
  if(column.EnableTooltip===true)this.TooltipRect.push({Rect:rtItem,data:data,Index:index,Column:column,CellType:cellType});var rtText={Left:rtItem.Left+this.ItemMergin.Left,Right:rtItem.Right-this.ItemMergin.Right,Top:rtItem.Top+this.ItemMergin.Top,Bottom:rtItem.Bottom-this.ItemMergin.Bottom};rtText.Width=rtText.Right-rtText.Left;rtText.Height=rtText.Bottom-rtText.Top;var drawInfo={Text:null,TextColor:this.CenterItemConfig.TextColor,BGColor:this.CenterItemConfig.BGColor,TextAlign:column.TextAlign,Rect:rtItem,RectText:rtText};drawInfo.Text=''+data.ExePrice.toFixed(data.Decimal);this.DrawCell(drawInfo);};this.DrawItem=function(index,exePriceData,data,column,rtItem,cellType){if(column.EnableTooltip===true)this.TooltipRect.push({Rect:rtItem,data:data,Index:index,Column:column,CellType:cellType});var rtText={Left:rtItem.Left+this.ItemMergin.Left,Right:rtItem.Right-this.ItemMergin.Right,Top:rtItem.Top+this.ItemMergin.Top,Bottom:rtItem.Bottom-this.ItemMergin.Bottom};rtText.Width=rtText.Right-rtText.Left;rtText.Height=rtText.Bottom-rtText.Top;var drawInfo={Text:null,TextColor:column.TextColor,TextAlign:column.TextAlign,Rect:rtItem,RectText:rtText};if(data){switch(column.Type){case TREPORT_COLUMN_ID.SYMBOL_ID:case TREPORT_COLUMN_ID.NAME_ID:var fieldName=MAP_TREPORT_COLUMN_FIELD.get(column.Type);if(fieldName)drawInfo.Text=data[fieldName];break;case TREPORT_COLUMN_ID.PRICE_ID://最新价格
12720
12725
  case TREPORT_COLUMN_ID.BUY_PRICE_ID://买价
@@ -12722,9 +12727,10 @@ case TREPORT_COLUMN_ID.SELL_PRICE_ID://卖价
12722
12727
  var fieldName=MAP_TREPORT_COLUMN_FIELD.get(column.Type);if(fieldName)this.GetPriceDrawInfo(data[fieldName],data,exePriceData,drawInfo);break;case TREPORT_COLUMN_ID.SELL_VOL_ID://卖量
12723
12728
  case TREPORT_COLUMN_ID.BUY_VOL_ID://买量
12724
12729
  case TREPORT_COLUMN_ID.POSITION_ID://持仓量
12725
- var fieldName=MAP_TREPORT_COLUMN_FIELD.get(column.Type);if(fieldName)drawInfo.Text=this.FormatVolString(data[fieldName]);break;case TREPORT_COLUMN_ID.INCREASE_ID:case TREPORT_COLUMN_ID.UPDOWN_ID:case TREPORT_COLUMN_ID.AMPLITUDE_ID:var fieldName=MAP_TREPORT_COLUMN_FIELD.get(column.Type);if(fieldName){var value=data[fieldName];if(IFrameSplitOperator.IsNumber(value)){drawInfo.Text=value.toFixed(2);drawInfo.TextColor=this.GetUpDownColor(value,0);}else{this.GetNullDrawInfo(drawInfo);}}break;default:drawInfo.Text='-----';}this.GetMarkBorderData(drawInfo,exePriceData.ExePrice,column.Type,cellType);}this.DrawCell(drawInfo);};this.GetMarkBorderData=function(drawInfo,exePrice,columnType,cellType){if(!this.BorderData||!this.BorderData.MapData)return;if(!this.BorderData.MapData.has(columnType))return;var borderData=this.BorderData.MapData.get(columnType);if(!IFrameSplitOperator.IsNonEmptyArray(borderData.Data))return;if(cellType==1){var leftBorder=borderData.Data[1];if(!leftBorder)return;if(leftBorder.ExePrice==exePrice){drawInfo.BorderColor=this.MarkBorderConfig.MaxPositionColor;}}else if(cellType==2){var rightBorder=borderData.Data[2];if(!rightBorder)return;if(rightBorder.ExePrice==exePrice){drawInfo.BorderColor=this.MarkBorderConfig.MaxPositionColor;}}};this.GetNullDrawInfo=function(drawInfo){drawInfo.Text="--";drawInfo.TextColor=this.UnchangeColor;};this.GetPriceDrawInfo=function(price,stock,data,drawInfo){if(!IFrameSplitOperator.IsNumber(price)){this.GetNullDrawInfo(drawInfo);return;}drawInfo.Text=price.toFixed(data.Decimal);if(!IFrameSplitOperator.IsNumber(stock.YClose))drawInfo.TextColor=this.UnchangeColor;else drawInfo.TextColor=this.GetUpDownColor(price,stock.YClose);};//单独处理成交量显示
12730
+ var fieldName=MAP_TREPORT_COLUMN_FIELD.get(column.Type);if(fieldName)drawInfo.Text=this.FormatVolString(data[fieldName]);break;case TREPORT_COLUMN_ID.INCREASE_ID:case TREPORT_COLUMN_ID.UPDOWN_ID:case TREPORT_COLUMN_ID.AMPLITUDE_ID:var fieldName=MAP_TREPORT_COLUMN_FIELD.get(column.Type);if(fieldName){var value=data[fieldName];if(IFrameSplitOperator.IsNumber(value)){drawInfo.Text=value.toFixed(2);drawInfo.TextColor=this.GetUpDownColor(value,0);}else{this.GetNullDrawInfo(drawInfo);}}break;default:drawInfo.Text='-----';}this.GetMarkBorderData(drawInfo,exePriceData.ExePrice,column.Type,cellType);this.GetFlashBGData(drawInfo,exePriceData,column.Type,cellType);}this.DrawCell(drawInfo,exePriceData,column.Type,cellType);};this.GetFlashBGData=function(drawInfo,exePriceData,columnType,cellType){if(!exePriceData.TData)return;var data=null;if(cellType==1)data=exePriceData.TData.LeftFlashBG;else if(cellType==2)data=exePriceData.TData.RightFlashBG;if(!data||!data.Data)return;if(data.Data.has(columnType)){var item=data.Data.get(columnType);drawInfo.FlashBGColor=item.Color;--item.Count;if(this.GlobalOption)++this.GlobalOption.FlashBGCount;}};this.GetMarkBorderData=function(drawInfo,exePrice,columnType,cellType){if(!this.BorderData||!this.BorderData.MapData)return;if(!this.BorderData.MapData.has(columnType))return;var borderData=this.BorderData.MapData.get(columnType);if(!IFrameSplitOperator.IsNonEmptyArray(borderData.Data))return;if(cellType==1){var leftBorder=borderData.Data[1];if(!leftBorder)return;if(leftBorder.ExePrice==exePrice){drawInfo.BorderColor=this.MarkBorderConfig.MaxPositionColor;}}else if(cellType==2){var rightBorder=borderData.Data[2];if(!rightBorder)return;if(rightBorder.ExePrice==exePrice){drawInfo.BorderColor=this.MarkBorderConfig.MaxPositionColor;}}};this.GetNullDrawInfo=function(drawInfo){drawInfo.Text="--";drawInfo.TextColor=this.UnchangeColor;};this.GetPriceDrawInfo=function(price,stock,data,drawInfo){if(!IFrameSplitOperator.IsNumber(price)){this.GetNullDrawInfo(drawInfo);return;}drawInfo.Text=price.toFixed(data.Decimal);if(!IFrameSplitOperator.IsNumber(stock.YClose))drawInfo.TextColor=this.UnchangeColor;else drawInfo.TextColor=this.GetUpDownColor(price,stock.YClose);};//单独处理成交量显示
12726
12731
  this.FormatVolString=function(value,languageID){if(!IFrameSplitOperator.IsNumber(value))return null;return IFrameSplitOperator.FormatVolString(value,languageID);};this.GetUpDownColor=function(price,price2){if(price>price2)return this.UpColor;else if(price<price2)return this.DownColor;else return this.UnchangeColor;};this.DrawCell=function(drawInfo){var rtText=drawInfo.RectText;var yCenter=rtText.Top+rtText.Height/2;if(drawInfo.BGColor)//背景
12727
- {var rtItem=drawInfo.Rect;this.Canvas.fillStyle=drawInfo.BGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);}if(drawInfo.BorderColor)//边框
12732
+ {var rtItem=drawInfo.Rect;this.Canvas.fillStyle=drawInfo.BGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);}if(drawInfo.FlashBGColor)//闪动背景
12733
+ {var rtItem=drawInfo.Rect;this.Canvas.fillStyle=drawInfo.FlashBGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);}if(drawInfo.BorderColor)//边框
12728
12734
  {var rtItem=drawInfo.Rect;this.Canvas.strokeStyle=drawInfo.BorderColor;this.Canvas.strokeRect(ToFixedPoint(rtItem.Left),ToFixedPoint(rtItem.Top+1),ToFixedRect(rtItem.Width),ToFixedRect(rtItem.Height-3));}if(drawInfo.Text)//文字
12729
12735
  {if(drawInfo.TextColor)this.Canvas.fillStyle=drawInfo.TextColor;this.DrawText(drawInfo.Text,drawInfo.TextAlign,rtText.Left,yCenter,rtText.Width);}};this.OnMouseDown=function(x,y,e)//Type: 2=行 3=表头
12730
12736
  {if(!this.Data)return null;var pixelTatio=GetDevicePixelRatio();var insidePoint={X:x/pixelTatio,Y:y/pixelTatio};if(this.UIElement)var uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};else var uiElement={Left:null,Top:null};var row=this.PtInBody(x,y);if(row){var bRedraw=false;if(!this.SelectedRow){this.SelectedRow={ExePrice:row.ExePrice,CellType:row.CellType};bRedraw=true;}else if(this.SelectedRow.ExePrice!=row.ExePrice||this.SelectedRow.CellType!=row.CellType){this.SelectedRow.ExePrice=row.ExePrice;this.SelectedRow.CellType=row.CellType;bRedraw=true;}var eventID=JSCHART_EVENT_ID.ON_CLICK_TREPORT_ROW;if(e.button==2)eventID=JSCHART_EVENT_ID.ON_RCLICK_TREPORT_ROW;this.SendClickEvent(eventID,{Data:row,X:x,Y:y,e:e,Inside:insidePoint,UIElement:uiElement});return{Type:2,Redraw:bRedraw,Row:row};//行
@@ -12732,7 +12738,7 @@ this.FormatVolString=function(value,languageID){if(!IFrameSplitOperator.IsNumber
12732
12738
  }return null;};this.PtInBody=function(x,y){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var top=this.RectClient.Top+this.HeaderHeight;var left=this.RectClient.Left;var right=this.RectClient.Right;var textTop=top;for(var i=this.Data.YOffset,j=0;i<this.Data.Data.length&&j<this.RowCount;++i,++j){var exePrice=this.Data.Data[i];var rtRow={Left:left,Top:textTop,Right:right,Bottom:textTop+this.RowHeight};rtRow.Height=rtRow.Bottom-rtRow.Top;rtRow.Width=rtRow.Right-rtRow.Left;if(x>=rtRow.Left&&x<=rtRow.Right&&y>=rtRow.Top&&y<=rtRow.Bottom){var data={RectRow:rtRow,DataIndex:i,Index:j,ExePrice:exePrice};return this.PtInItem(x,y,data);}textTop+=this.RowHeight;}return null;};this.PtInItem=function(x,y,info,exePrice){var rtCenterItem=this.GetCenterItemRect();var rtRow=info.RectRow;var rtCenter={Left:rtCenterItem.Left,Right:rtCenterItem.Right,Top:rtRow.Top,Height:rtRow.Height,Bottom:rtRow.Bottom};if(x>=rtCenter.Left&&x<=rtCenter.Right&&y>=rtCenter.Top&&y<=rtCenter.Bottom){var data={Rect:rtCenter,DataIndex:info.DataIndex,Index:info.Index,ExePrice:info.ExePrice,CellType:0,Column:this.CenterColumn};data.Item=this.GetExePriceDataCallback(info.ExePrice);return data;}var xLeft=rtCenterItem.Left;//左边
12733
12739
  var xRight=rtCenterItem.Right;//右边
12734
12740
  var reportleft=this.RectClient.Left;var reportRight=this.RectClient.Right;for(var i=this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width+this.ItemExtraWidth;xLeft-=itemWidth;if(xLeft<reportleft)break;var rtItem={Left:xLeft,Right:xLeft+itemWidth,Top:rtRow.Top,Height:rtRow.Height,Bottom:rtRow.Bottom,Width:itemWidth};if(x>=rtItem.Left&&x<=rtItem.Right&&y>=rtItem.Top&&y<=rtItem.Bottom){var data={Rect:rtCenter,DataIndex:info.DataIndex,Index:info.Index,ExePrice:info.ExePrice,CellType:1,ColumnIndex:i,Column:item};data.Item=this.GetExePriceDataCallback(info.ExePrice);return data;}rtItem={Left:xRight,Right:xRight+itemWidth,Top:rtRow.Top,Height:rtRow.Height,Bottom:rtRow.Bottom,Width:itemWidth};if(x>=rtItem.Left&&x<=rtItem.Right&&y>=rtItem.Top&&y<=rtItem.Bottom){var data={Rect:rtCenter,DataIndex:info.DataIndex,Index:info.Index,ExePrice:info.ExePrice,CellType:2,ColumnIndex:i,Column:item};data.Item=this.GetExePriceDataCallback(info.ExePrice);return data;}xRight+=itemWidth;}return null;};this.PtInHeader=function(x,y){if(!this.IsShowHeader)return null;var left=this.RectClient.Left;var right=this.RectClient.Right;var top=this.RectClient.Top;var bottom=top+this.HeaderHeight;if(!(x>=left&&x<=right&&y>=top&&y<=bottom))return null;var rtHeader={Left:left,Right:right,Top:top,Bottom:bottom};rtHeader.Width=rtHeader.Right-rtHeader.Left;rtHeader.Height=rtHeader.Bottom-rtHeader.Top;var data={RectRow:rtHeader,DataIndex:-1,Index:-1,ExePrice:null};return this.PtInItem(x,y,data);};this.SendClickEvent=function(id,data){var event=this.GetEventCallback(id);if(event&&event.Callback){event.Callback(event,data,this);}};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
12735
- {var result={Start:this.Data.YOffset,PageSize:this.RowCount,IsEnd:false,SelectedRow:this.SelectedRow,IsSinglePage:false,DataCount:0};if(IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)){result.End=this.Data.YOffset+this.RowCount-1;result.IsSinglePage=this.Data.Data.length<=this.RowCount;result.DataCount=this.Data.Data.length;if(result.End>=this.Data.Data.length-1)result.IsEnd=true;if(result.End>=this.Data.Data.length)result.End=this.Data.Data.length-1;}else{result.Start=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};}/*
12741
+ {var result={Start:this.Data.YOffset,PageSize:this.RowCount,IsEnd:false,SelectedRow:this.SelectedRow,IsSinglePage:false,DataCount:0};if(IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)){result.End=this.Data.YOffset+this.RowCount-1;result.IsSinglePage=this.Data.Data.length<=this.RowCount;result.DataCount=this.Data.Data.length;if(result.End>=this.Data.Data.length-1)result.IsEnd=true;if(result.End>=this.Data.Data.length)result.End=this.Data.Data.length-1;}else{result.Start=0;result.End=0;result.IsEnd=true;result.IsSinglePage=true;}return result;};this.OnDblClick=function(x,y,e){if(!this.Data)return false;var row=this.PtInBody(x,y);if(row){this.SendClickEvent(JSCHART_EVENT_ID.ON_DBCLICK_TREPORT_ROW,{Data:row,X:x,Y:y});return true;}return false;};}/*
12736
12742
  Copyright (c) 2018 jones
12737
12743
 
12738
12744
  http://www.apache.org/licenses/LICENSE-2.0
@@ -13000,7 +13006,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13000
13006
  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);};}/********************************************************************************
13001
13007
  * 版本信息输出
13002
13008
  *
13003
- */var HQCHART_VERSION="1.1.13083";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13009
+ */var HQCHART_VERSION="1.1.13089";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13004
13010
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13005
13011
  // BaseIndex:BaseIndex,
13006
13012
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13085",
3
+ "version": "1.1.13090",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -855,6 +855,16 @@ function JSTReportChartContainer(uielement)
855
855
  },frequency);
856
856
  }
857
857
 
858
+ this.UIOnDblClick=function(e)
859
+ {
860
+ var pixelTatio = GetDevicePixelRatio();
861
+ var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
862
+ var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
863
+
864
+ var chart=this.GetTReportChart();
865
+ if (chart) chart.OnDblClick(x,y,e);
866
+ }
867
+
858
868
  this.UIOnMouseDown=function(e)
859
869
  {
860
870
  var pixelTatio = GetDevicePixelRatio();
@@ -1235,6 +1245,71 @@ function JSTReportChartContainer(uielement)
1235
1245
 
1236
1246
  return null;
1237
1247
  }
1248
+
1249
+ //obj={ ID:, Color: , Time:, Count: }
1250
+ this.SetFlashBGItem=function(symbol, obj)
1251
+ {
1252
+ var item={ ID:obj.ID, Color:obj.Color, Count:1 };
1253
+ if (IFrameSplitOperator.IsNumber(obj.Count)) item.Count=obj.Count;
1254
+ if (IFrameSplitOperator.IsNumber(obj.Time)) item.Time=obj.Time;
1255
+ else item.Time=Date.now();
1256
+
1257
+ if (this.FlashBG.has(symbol))
1258
+ {
1259
+ var stockItem=this.FlashBG.get(symbol);
1260
+ stockItem.LastTime=item.Time;
1261
+ stockItem.Data.set(item.ID, item);
1262
+ }
1263
+ else
1264
+ {
1265
+ var stockItem={ LastTime:item.Time, Data:new Map([ [item.ID, item ] ]) };
1266
+ this.FlashBG.set(symbol, stockItem);
1267
+ }
1268
+ }
1269
+
1270
+ this.GetFlashBGData=function(symbol, time)
1271
+ {
1272
+ if (!this.FlashBG) return null;
1273
+ if (!this.FlashBG.has(symbol)) return null;
1274
+
1275
+ var timeDiff=3*1000;
1276
+ var stockItem=this.FlashBG.get(symbol);
1277
+ if (time-stockItem.LastTime>=timeDiff) //超时的删除
1278
+ {
1279
+ this.FlashBG.delete(symbol);
1280
+ return null;
1281
+ }
1282
+
1283
+ if (!stockItem.Data || stockItem.Data.size<=0)
1284
+ {
1285
+ this.FlashBG.delete(symbol);
1286
+ return null;
1287
+ }
1288
+
1289
+ var aryDelID=[]; //超时需要参数的
1290
+ for(var mapItem of stockItem.Data)
1291
+ {
1292
+ var item=mapItem[1];
1293
+ if (time-item.Time>=timeDiff || item.Count<=0)
1294
+ aryDelID.push(item.ID);
1295
+ }
1296
+
1297
+ if (IFrameSplitOperator.IsNonEmptyArray(aryDelID))
1298
+ {
1299
+ for(var i=0; i<aryDelID.length; ++i)
1300
+ {
1301
+ stockItem.Data.delete(aryDelID[i]);
1302
+ }
1303
+
1304
+ if (stockItem.Data.size<=0)
1305
+ {
1306
+ this.FlashBG.delete(symbol);
1307
+ return null;
1308
+ }
1309
+ }
1310
+
1311
+ return stockItem;
1312
+ }
1238
1313
  }
1239
1314
 
1240
1315
  function JSTReportFrame()
@@ -1831,7 +1906,21 @@ function ChartTReport()
1831
1906
 
1832
1907
  var data= { ExePrice:exePrice , TData:null };
1833
1908
  if (this.GetExePriceDataCallback) data.TData=this.GetExePriceDataCallback(exePrice);
1834
- //if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(exePrice, Date.now());
1909
+ if (this.GetFlashBGDataCallback && data.TData)
1910
+ {
1911
+ if (data.TData.LeftData) //左侧
1912
+ {
1913
+ var item=data.TData.LeftData;
1914
+ data.TData.LeftFlashBG=this.GetFlashBGDataCallback(item.Symbol, Date.now());
1915
+ }
1916
+
1917
+ if (data.TData.RightData) //右侧
1918
+ {
1919
+ var item=data.TData.RightData;
1920
+ data.TData.RightFlashBG=this.GetFlashBGDataCallback(item.Symbol, Date.now());
1921
+ }
1922
+ }
1923
+
1835
1924
  data.Decimal=2;
1836
1925
 
1837
1926
  var bSelected=false;
@@ -1984,9 +2073,30 @@ function ChartTReport()
1984
2073
  }
1985
2074
 
1986
2075
  this.GetMarkBorderData(drawInfo, exePriceData.ExePrice, column.Type, cellType);
2076
+ this.GetFlashBGData(drawInfo, exePriceData, column.Type, cellType);
1987
2077
  }
1988
2078
 
1989
- this.DrawCell(drawInfo);
2079
+ this.DrawCell(drawInfo, exePriceData, column.Type, cellType);
2080
+ }
2081
+
2082
+ this.GetFlashBGData=function(drawInfo, exePriceData, columnType, cellType)
2083
+ {
2084
+ if (!exePriceData.TData) return;
2085
+
2086
+ var data=null;
2087
+ if (cellType==1) data=exePriceData.TData.LeftFlashBG;
2088
+ else if (cellType==2) data=exePriceData.TData.RightFlashBG;
2089
+
2090
+ if (!data || !data.Data) return;
2091
+
2092
+ if (data.Data.has(columnType))
2093
+ {
2094
+ var item=data.Data.get(columnType);
2095
+ drawInfo.FlashBGColor=item.Color;
2096
+ --item.Count;
2097
+
2098
+ if (this.GlobalOption) ++this.GlobalOption.FlashBGCount;
2099
+ }
1990
2100
  }
1991
2101
 
1992
2102
  this.GetMarkBorderData=function(drawInfo, exePrice, columnType, cellType)
@@ -2066,6 +2176,13 @@ function ChartTReport()
2066
2176
  this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);
2067
2177
  }
2068
2178
 
2179
+ if (drawInfo.FlashBGColor) //闪动背景
2180
+ {
2181
+ var rtItem=drawInfo.Rect;
2182
+ this.Canvas.fillStyle=drawInfo.FlashBGColor;
2183
+ this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);
2184
+ }
2185
+
2069
2186
  if (drawInfo.BorderColor) //边框
2070
2187
  {
2071
2188
  var rtItem=drawInfo.Rect;
@@ -2262,6 +2379,20 @@ function ChartTReport()
2262
2379
  return result;
2263
2380
  }
2264
2381
 
2382
+ this.OnDblClick=function(x,y,e)
2383
+ {
2384
+ if (!this.Data) return false;
2385
+
2386
+ var row=this.PtInBody(x,y);
2387
+ if (row)
2388
+ {
2389
+ this.SendClickEvent(JSCHART_EVENT_ID.ON_DBCLICK_TREPORT_ROW, { Data:row, X:x, Y:y });
2390
+ return true;
2391
+ }
2392
+
2393
+ return false;
2394
+ }
2395
+
2265
2396
  }
2266
2397
 
2267
2398
 
@@ -2491,6 +2491,7 @@ var JSCHART_EVENT_ID=
2491
2491
  ON_CLICK_TREPORT_HEADER:124, //单击T型报价表头
2492
2492
  ON_RCLICK_TREPORT_HEADER:125, //右键点击T型报价表头
2493
2493
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
2494
+ ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
2494
2495
  }
2495
2496
 
2496
2497
  var JSCHART_OPERATOR_ID=
@@ -6383,6 +6383,7 @@ var JSCHART_EVENT_ID=
6383
6383
  ON_CLICK_TREPORT_HEADER:124, //单击T型报价表头
6384
6384
  ON_RCLICK_TREPORT_HEADER:125, //右键点击T型报价表头
6385
6385
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
6386
+ ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6386
6387
  }
6387
6388
 
6388
6389
  var JSCHART_OPERATOR_ID=
@@ -130965,7 +130966,7 @@ function ScrollBarBGChart()
130965
130966
 
130966
130967
 
130967
130968
 
130968
- var HQCHART_VERSION="1.1.13083";
130969
+ var HQCHART_VERSION="1.1.13089";
130969
130970
 
130970
130971
  function PrintHQChartVersion()
130971
130972
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13083";
8
+ var HQCHART_VERSION="1.1.13089";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -6427,6 +6427,7 @@ var JSCHART_EVENT_ID=
6427
6427
  ON_CLICK_TREPORT_HEADER:124, //单击T型报价表头
6428
6428
  ON_RCLICK_TREPORT_HEADER:125, //右键点击T型报价表头
6429
6429
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
6430
+ ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6430
6431
  }
6431
6432
 
6432
6433
  var JSCHART_OPERATOR_ID=
@@ -128848,6 +128849,16 @@ function JSTReportChartContainer(uielement)
128848
128849
  },frequency);
128849
128850
  }
128850
128851
 
128852
+ this.UIOnDblClick=function(e)
128853
+ {
128854
+ var pixelTatio = GetDevicePixelRatio();
128855
+ var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
128856
+ var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
128857
+
128858
+ var chart=this.GetTReportChart();
128859
+ if (chart) chart.OnDblClick(x,y,e);
128860
+ }
128861
+
128851
128862
  this.UIOnMouseDown=function(e)
128852
128863
  {
128853
128864
  var pixelTatio = GetDevicePixelRatio();
@@ -129228,6 +129239,71 @@ function JSTReportChartContainer(uielement)
129228
129239
 
129229
129240
  return null;
129230
129241
  }
129242
+
129243
+ //obj={ ID:, Color: , Time:, Count: }
129244
+ this.SetFlashBGItem=function(symbol, obj)
129245
+ {
129246
+ var item={ ID:obj.ID, Color:obj.Color, Count:1 };
129247
+ if (IFrameSplitOperator.IsNumber(obj.Count)) item.Count=obj.Count;
129248
+ if (IFrameSplitOperator.IsNumber(obj.Time)) item.Time=obj.Time;
129249
+ else item.Time=Date.now();
129250
+
129251
+ if (this.FlashBG.has(symbol))
129252
+ {
129253
+ var stockItem=this.FlashBG.get(symbol);
129254
+ stockItem.LastTime=item.Time;
129255
+ stockItem.Data.set(item.ID, item);
129256
+ }
129257
+ else
129258
+ {
129259
+ var stockItem={ LastTime:item.Time, Data:new Map([ [item.ID, item ] ]) };
129260
+ this.FlashBG.set(symbol, stockItem);
129261
+ }
129262
+ }
129263
+
129264
+ this.GetFlashBGData=function(symbol, time)
129265
+ {
129266
+ if (!this.FlashBG) return null;
129267
+ if (!this.FlashBG.has(symbol)) return null;
129268
+
129269
+ var timeDiff=3*1000;
129270
+ var stockItem=this.FlashBG.get(symbol);
129271
+ if (time-stockItem.LastTime>=timeDiff) //超时的删除
129272
+ {
129273
+ this.FlashBG.delete(symbol);
129274
+ return null;
129275
+ }
129276
+
129277
+ if (!stockItem.Data || stockItem.Data.size<=0)
129278
+ {
129279
+ this.FlashBG.delete(symbol);
129280
+ return null;
129281
+ }
129282
+
129283
+ var aryDelID=[]; //超时需要参数的
129284
+ for(var mapItem of stockItem.Data)
129285
+ {
129286
+ var item=mapItem[1];
129287
+ if (time-item.Time>=timeDiff || item.Count<=0)
129288
+ aryDelID.push(item.ID);
129289
+ }
129290
+
129291
+ if (IFrameSplitOperator.IsNonEmptyArray(aryDelID))
129292
+ {
129293
+ for(var i=0; i<aryDelID.length; ++i)
129294
+ {
129295
+ stockItem.Data.delete(aryDelID[i]);
129296
+ }
129297
+
129298
+ if (stockItem.Data.size<=0)
129299
+ {
129300
+ this.FlashBG.delete(symbol);
129301
+ return null;
129302
+ }
129303
+ }
129304
+
129305
+ return stockItem;
129306
+ }
129231
129307
  }
129232
129308
 
129233
129309
  function JSTReportFrame()
@@ -129824,7 +129900,21 @@ function ChartTReport()
129824
129900
 
129825
129901
  var data= { ExePrice:exePrice , TData:null };
129826
129902
  if (this.GetExePriceDataCallback) data.TData=this.GetExePriceDataCallback(exePrice);
129827
- //if (this.GetFlashBGDataCallback) data.FlashBG=this.GetFlashBGDataCallback(exePrice, Date.now());
129903
+ if (this.GetFlashBGDataCallback && data.TData)
129904
+ {
129905
+ if (data.TData.LeftData) //左侧
129906
+ {
129907
+ var item=data.TData.LeftData;
129908
+ data.TData.LeftFlashBG=this.GetFlashBGDataCallback(item.Symbol, Date.now());
129909
+ }
129910
+
129911
+ if (data.TData.RightData) //右侧
129912
+ {
129913
+ var item=data.TData.RightData;
129914
+ data.TData.RightFlashBG=this.GetFlashBGDataCallback(item.Symbol, Date.now());
129915
+ }
129916
+ }
129917
+
129828
129918
  data.Decimal=2;
129829
129919
 
129830
129920
  var bSelected=false;
@@ -129977,9 +130067,30 @@ function ChartTReport()
129977
130067
  }
129978
130068
 
129979
130069
  this.GetMarkBorderData(drawInfo, exePriceData.ExePrice, column.Type, cellType);
130070
+ this.GetFlashBGData(drawInfo, exePriceData, column.Type, cellType);
129980
130071
  }
129981
130072
 
129982
- this.DrawCell(drawInfo);
130073
+ this.DrawCell(drawInfo, exePriceData, column.Type, cellType);
130074
+ }
130075
+
130076
+ this.GetFlashBGData=function(drawInfo, exePriceData, columnType, cellType)
130077
+ {
130078
+ if (!exePriceData.TData) return;
130079
+
130080
+ var data=null;
130081
+ if (cellType==1) data=exePriceData.TData.LeftFlashBG;
130082
+ else if (cellType==2) data=exePriceData.TData.RightFlashBG;
130083
+
130084
+ if (!data || !data.Data) return;
130085
+
130086
+ if (data.Data.has(columnType))
130087
+ {
130088
+ var item=data.Data.get(columnType);
130089
+ drawInfo.FlashBGColor=item.Color;
130090
+ --item.Count;
130091
+
130092
+ if (this.GlobalOption) ++this.GlobalOption.FlashBGCount;
130093
+ }
129983
130094
  }
129984
130095
 
129985
130096
  this.GetMarkBorderData=function(drawInfo, exePrice, columnType, cellType)
@@ -130059,6 +130170,13 @@ function ChartTReport()
130059
130170
  this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);
130060
130171
  }
130061
130172
 
130173
+ if (drawInfo.FlashBGColor) //闪动背景
130174
+ {
130175
+ var rtItem=drawInfo.Rect;
130176
+ this.Canvas.fillStyle=drawInfo.FlashBGColor;
130177
+ this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);
130178
+ }
130179
+
130062
130180
  if (drawInfo.BorderColor) //边框
130063
130181
  {
130064
130182
  var rtItem=drawInfo.Rect;
@@ -130255,6 +130373,20 @@ function ChartTReport()
130255
130373
  return result;
130256
130374
  }
130257
130375
 
130376
+ this.OnDblClick=function(x,y,e)
130377
+ {
130378
+ if (!this.Data) return false;
130379
+
130380
+ var row=this.PtInBody(x,y);
130381
+ if (row)
130382
+ {
130383
+ this.SendClickEvent(JSCHART_EVENT_ID.ON_DBCLICK_TREPORT_ROW, { Data:row, X:x, Y:y });
130384
+ return true;
130385
+ }
130386
+
130387
+ return false;
130388
+ }
130389
+
130258
130390
  }
130259
130391
 
130260
130392
 
@@ -133390,7 +133522,7 @@ function HQChartScriptWorker()
133390
133522
 
133391
133523
 
133392
133524
 
133393
- var HQCHART_VERSION="1.1.13083";
133525
+ var HQCHART_VERSION="1.1.13089";
133394
133526
 
133395
133527
  function PrintHQChartVersion()
133396
133528
  {