hqchart 1.1.13120 → 1.1.13127

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.
@@ -7104,7 +7104,7 @@ case 11://2小时
7104
7104
  case 12://4小时
7105
7105
  if(this.SourceData.DataType!=1)isDataTypeChange=true;break;case 10://分笔线
7106
7106
  if(this.SourceData.DataType!=2)isDataTypeChange=true;break;}}}this.Period=period;if(right!=null)this.Right=right;this.ReloadChartDrawPicture();//切换周期了 清空画图工具
7107
- this.ClearRectSelect(true);this.Frame.ClearUpDonwFrameYData();this.ClearCustomKLine();var kLineDrawType=this.GetKLineDrawType();if(kLineDrawType==10||kLineDrawType==11||kLineDrawType==12||kLineDrawType==16)isDataTypeChange=true;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CHANGE_KLINE_PERIOD);if(event&&event.Callback){var sendData={IsApiPeriod:this.IsApiPeriod,Old:oldData,Now:{Period:this.Period,Right:this.Right,KLineDrawType:this.KLineDrawType},IsDataTypeChange:isDataTypeChange//数据类型是否改变 true 重新请求数据
7107
+ this.ClearRectSelect(true);this.Frame.ClearUpDonwFrameYData();this.ClearCustomKLine();this.ClearKLineCaluate();var kLineDrawType=this.GetKLineDrawType();if(kLineDrawType==10||kLineDrawType==11||kLineDrawType==12||kLineDrawType==16)isDataTypeChange=true;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CHANGE_KLINE_PERIOD);if(event&&event.Callback){var sendData={IsApiPeriod:this.IsApiPeriod,Old:oldData,Now:{Period:this.Period,Right:this.Right,KLineDrawType:this.KLineDrawType},IsDataTypeChange:isDataTypeChange//数据类型是否改变 true 重新请求数据
7108
7108
  };event.Callback(event,sendData,this);isDataTypeChange=sendData.IsDataTypeChange;}if(isDataTypeChange==false&&!this.IsApiPeriod){this.ClearIndexRunCount();this.Update({UpdateCursorIndexType:2});//更新的时候 取消显示十字光标
7109
7109
  return;}this.ClearIndexPaint();if(ChartData.IsDayPeriod(this.Period,true)){this.CancelAutoUpdate();//先停止定时器
7110
7110
  this.AutoUpdateEvent(false,'KLineChartContainer::ChangePeriod');//切换周期先停止更新
@@ -12079,7 +12079,7 @@ this.CanvasElement=document.createElement("canvas");this.CanvasElement.className
12079
12079
  var height=parseInt(this.DivElement.style.height.replace("px",""));this.CanvasElement.height=height;this.CanvasElement.width=parseInt(this.DivElement.style.width.replace("px",""));this.CanvasElement.style.width=this.CanvasElement.width+'px';this.CanvasElement.style.height=this.CanvasElement.height+'px';var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
12080
12080
  this.CanvasElement.height*=pixelTatio;this.CanvasElement.width*=pixelTatio;JSConsole.Chart.Log('[JSReportChart::OnSize] devicePixelRatio='+window.devicePixelRatio+', height='+this.CanvasElement.height+', width='+this.CanvasElement.width);if(this.JSChartContainer&&this.JSChartContainer.OnSize){this.JSChartContainer.OnSize();}};this.SetOption=function(option){var chart=this.CreateJSReportChartContainer(option);if(!chart)return false;if(option.OnCreatedCallback)option.OnCreatedCallback(chart);this.JSChartContainer=chart;this.DivElement.JSChart=this;//div中保存一份
12081
12081
  if(option.Symbol)chart.Symbol=option.Symbol;if(option.Name)chart.Name=option.Name;var requestOption={Callback:null};if(chart.Symbol)requestOption.Callback=function(){chart.RequestMemberListData();};chart.RequestStockListData(requestOption);//下载码表
12082
- };this.CreateJSReportChartContainer=function(option){var chart=new JSReportChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNonEmptyArray(option.Tab))chart.SetTab(option.Tab);if(IFrameSplitOperator.IsNumber(option.TabSelected))chart.SetSelectedTab(option.TabSelected);if(IFrameSplitOperator.IsBool(option.EnableDragRow))chart.EnableDragRow=option.EnableDragRow;if(IFrameSplitOperator.IsNumber(option.DragRowType))chart.DragRowType=option.DragRowType;if(IFrameSplitOperator.IsBool(option.EnableDragHeader))chart.EnableDragHeader=option.EnableDragHeader;if(option.VScrollbar)chart.SetVScrollbar(option.VScrollbar);if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))chart.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))chart.SortInfo.Sort=item.Sort;}this.SetChartBorder(chart,option);//是否自动更新
12082
+ };this.CreateJSReportChartContainer=function(option){var chart=new JSReportChartContainer(this.CanvasElement);chart.Create(option);if(option.NetworkFilter)chart.NetworkFilter=option.NetworkFilter;if(IFrameSplitOperator.IsNonEmptyArray(option.Column))chart.SetColumn(option.Column);if(IFrameSplitOperator.IsNonEmptyArray(option.Tab))chart.SetTab(option.Tab);if(IFrameSplitOperator.IsNumber(option.TabSelected))chart.SetSelectedTab(option.TabSelected);if(IFrameSplitOperator.IsBool(option.EnableDragRow))chart.EnableDragRow=option.EnableDragRow;if(IFrameSplitOperator.IsNumber(option.DragRowType))chart.DragRowType=option.DragRowType;if(IFrameSplitOperator.IsBool(option.EnableDragHeader))chart.EnableDragHeader=option.EnableDragHeader;if(option.VScrollbar)chart.SetVScrollbar(option.VScrollbar);if(option.SortInfo){var item=option.SortInfo;if(IFrameSplitOperator.IsNumber(item.Field))chart.SortInfo.Field=item.Field;if(IFrameSplitOperator.IsNumber(item.Sort))chart.SortInfo.Sort=item.Sort;}var reportChart=chart.GetReportChart();if(reportChart){if(IFrameSplitOperator.IsNumber(option.TextOverflowStyle))reportChart.TextOverflowStyle=option.TextOverflowStyle;}this.SetChartBorder(chart,option);//是否自动更新
12083
12083
  if(option.IsAutoUpdate!=null)chart.IsAutoUpdate=option.IsAutoUpdate;if(option.AutoUpdateFrequency>0)chart.AutoUpdateFrequency=option.AutoUpdateFrequency;if(IFrameSplitOperator.IsBool(option.EnableFilter))chart.EnableFilter=option.EnableFilter;//注册事件
12084
12084
  if(option.EventCallback){for(var i=0;i<option.EventCallback.length;++i){var item=option.EventCallback[i];chart.AddEventCallback(item);}}return chart;};this.SetChartBorder=function(chart,option){if(!option.Border)return;var item=option.Border;if(IFrameSplitOperator.IsNumber(option.Border.Left))chart.Frame.ChartBorder.Left=option.Border.Left;if(IFrameSplitOperator.IsNumber(option.Border.Right))chart.Frame.ChartBorder.Right=option.Border.Right;if(IFrameSplitOperator.IsNumber(option.Border.Top))chart.Frame.ChartBorder.Top=option.Border.Top;if(IFrameSplitOperator.IsNumber(option.Border.Bottom))chart.Frame.ChartBorder.Bottom=option.Border.Bottom;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
12085
12085
  chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;};/////////////////////////////////////////////////////////////////////////////
@@ -12361,7 +12361,8 @@ this.SelectedFixedRow=-1;//选中固定行ID
12361
12361
  this.IsDrawBorder=1;//是否绘制单元格边框
12362
12362
  this.ShowSymbol=[];//显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
12363
12363
  this.DragRow;//拖拽行
12364
- this.Tab;this.VScrollbar;this.GlobalOption;//涨跌颜色
12364
+ this.Tab;this.VScrollbar;this.GlobalOption;this.TextOverflowStyle=0;//输出内容比单元格长度大 0=裁剪 1=输出"####"
12365
+ //涨跌颜色
12365
12366
  this.UpColor=g_JSChartResource.Report.UpTextColor;this.DownColor=g_JSChartResource.Report.DownTextColor;this.UnchagneColor=g_JSChartResource.Report.UnchagneTextColor;this.BorderColor=g_JSChartResource.Report.BorderColor;//边框线
12366
12367
  this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
12367
12368
  //表头配置
@@ -12385,7 +12386,9 @@ this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
12385
12386
  //表头配置
12386
12387
  this.HeaderFontConfig={Size:g_JSChartResource.Report.Header.Font.Size,Name:g_JSChartResource.Report.Header.Font.Name};this.HeaderColor=g_JSChartResource.Report.Header.Color;this.SortColor=g_JSChartResource.Report.Header.SortColor;//排序箭头颜色
12387
12388
  this.HeaderMergin={Left:g_JSChartResource.Report.Header.Mergin.Left,Right:g_JSChartResource.Report.Header.Mergin.Right,Top:g_JSChartResource.Report.Header.Mergin.Top,Bottom:g_JSChartResource.Report.Header.Mergin.Bottom};//表格内容配置
12388
- this.ItemFontConfig={Size:g_JSChartResource.Report.Item.Font.Size,Name:g_JSChartResource.Report.Item.Font.Name};this.ItemMergin={Left:g_JSChartResource.Report.Item.Mergin.Left,Right:g_JSChartResource.Report.Item.Mergin.Right,Top:g_JSChartResource.Report.Item.Mergin.Top,Bottom:g_JSChartResource.Report.Item.Mergin.Bottom};this.BarMergin={Top:g_JSChartResource.Report.Item.BarMergin.Top,Left:g_JSChartResource.Report.Item.BarMergin.Left,Right:g_JSChartResource.Report.Item.BarMergin.Right,Bottom:g_JSChartResource.Report.Item.BarMergin.Bottom};this.LimitBorderColor=g_JSChartResource.Report.LimitBorder.Color;this.LimitMergin={Top:g_JSChartResource.Report.LimitBorder.Mergin.Top,Left:g_JSChartResource.Report.LimitBorder.Mergin.Left,Right:g_JSChartResource.Report.LimitBorder.Mergin.Right,Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom};for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(item.Type==REPORT_COLUMN_ID.INDEX_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Index;else if(item.Type==REPORT_COLUMN_ID.SYMBOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Symbol;else if(item.Type==REPORT_COLUMN_ID.NAME_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Name;else if(item.Type==REPORT_COLUMN_ID.VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.BUY_VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.SELL_VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.AMOUNT_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Amount;else if(item.Type==REPORT_COLUMN_ID.VOL_IN_ID)item.TextColor=g_JSChartResource.Report.DownTextColor;else if(item.Type==REPORT_COLUMN_ID.VOL_OUT_ID)item.TextColor=g_JSChartResource.Report.UpTextColor;else item.TextColor=g_JSChartResource.Report.FieldColor.Text;}if(this.Tab)this.Tab.ReloadResource(resource);if(this.VScrollbar)this.VScrollbar.ReloadResource(resource);};this.SetColumn=function(aryColumn){if(!IFrameSplitOperator.IsNonEmptyArray(aryColumn))return;this.Column=[];for(var i=0;i<aryColumn.length;++i){var item=aryColumn[i];var colItem=this.GetDefaultColunm(item.Type);if(!colItem)continue;if(item.Title)colItem.Title=item.Title;if(item.TextAlign)colItem.TextAlign=item.TextAlign;if(item.TextColor)colItem.TextColor=item.TextColor;if(item.HeaderColor)colItem.HeaderColor=item.HeaderColor;if(item.MaxText)colItem.MaxText=item.MaxText;if(item.ID)colItem.ID=item.ID;if(IFrameSplitOperator.IsNumber(item.Sort))colItem.Sort=item.Sort;if(IFrameSplitOperator.IsBool(item.EnableTooltip))colItem.EnableTooltip=item.EnableTooltip;if(IFrameSplitOperator.IsNumber(item.FixedWidth))colItem.FixedWidth=item.FixedWidth;if(IFrameSplitOperator.IsBool(item.EnableDragWidth))colItem.EnableDragWidth=item.EnableDragWidth;if(IFrameSplitOperator.IsBool(item.IsDrawCallback))colItem.IsDrawCallback=item.IsDrawCallback;else colItem.IsDrawCallback=false;if(item.Sort==1||item.Sort==2)//1本地排序 2=远程排序
12389
+ this.ItemFontConfig={Size:g_JSChartResource.Report.Item.Font.Size,Name:g_JSChartResource.Report.Item.Font.Name};this.ItemMergin={Left:g_JSChartResource.Report.Item.Mergin.Left,Right:g_JSChartResource.Report.Item.Mergin.Right,Top:g_JSChartResource.Report.Item.Mergin.Top,Bottom:g_JSChartResource.Report.Item.Mergin.Bottom};this.BarMergin={Top:g_JSChartResource.Report.Item.BarMergin.Top,Left:g_JSChartResource.Report.Item.BarMergin.Left,Right:g_JSChartResource.Report.Item.BarMergin.Right,Bottom:g_JSChartResource.Report.Item.BarMergin.Bottom};this.LimitBorderColor=g_JSChartResource.Report.LimitBorder.Color;this.LimitMergin={Top:g_JSChartResource.Report.LimitBorder.Mergin.Top,Left:g_JSChartResource.Report.LimitBorder.Mergin.Left,Right:g_JSChartResource.Report.LimitBorder.Mergin.Right,Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom};for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(item.Type==REPORT_COLUMN_ID.INDEX_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Index;else if(item.Type==REPORT_COLUMN_ID.SYMBOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Symbol;else if(item.Type==REPORT_COLUMN_ID.NAME_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Name;else if(item.Type==REPORT_COLUMN_ID.VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.BUY_VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.SELL_VOL_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Vol;else if(item.Type==REPORT_COLUMN_ID.AMOUNT_ID)item.TextColor=g_JSChartResource.Report.FieldColor.Amount;else if(item.Type==REPORT_COLUMN_ID.VOL_IN_ID)item.TextColor=g_JSChartResource.Report.DownTextColor;else if(item.Type==REPORT_COLUMN_ID.VOL_OUT_ID)item.TextColor=g_JSChartResource.Report.UpTextColor;else item.TextColor=g_JSChartResource.Report.FieldColor.Text;}if(this.Tab)this.Tab.ReloadResource(resource);if(this.VScrollbar)this.VScrollbar.ReloadResource(resource);};this.SetColumn=function(aryColumn){if(!IFrameSplitOperator.IsNonEmptyArray(aryColumn))return;this.Column=[];for(var i=0;i<aryColumn.length;++i){var item=aryColumn[i];var colItem=this.GetDefaultColunm(item.Type);if(!colItem)continue;if(item.Title)colItem.Title=item.Title;if(item.TextAlign)colItem.TextAlign=item.TextAlign;if(item.TextColor)colItem.TextColor=item.TextColor;if(item.HeaderColor)colItem.HeaderColor=item.HeaderColor;if(item.MaxText)colItem.MaxText=item.MaxText;if(item.ID)colItem.ID=item.ID;if(item.FullColBGColor)colItem.FullColBGColor=item.FullColBGColor;//整列背景色
12390
+ if(item.HeaderBGColor)colItem.HeaderBGColor=item.HeaderBGColor;//表头背景色
12391
+ if(IFrameSplitOperator.IsNumber(item.Sort))colItem.Sort=item.Sort;if(IFrameSplitOperator.IsBool(item.EnableTooltip))colItem.EnableTooltip=item.EnableTooltip;if(IFrameSplitOperator.IsNumber(item.FixedWidth))colItem.FixedWidth=item.FixedWidth;if(IFrameSplitOperator.IsBool(item.EnableDragWidth))colItem.EnableDragWidth=item.EnableDragWidth;if(IFrameSplitOperator.IsBool(item.IsDrawCallback))colItem.IsDrawCallback=item.IsDrawCallback;else colItem.IsDrawCallback=false;if(item.Sort==1||item.Sort==2)//1本地排序 2=远程排序
12389
12392
  {colItem.SortType=[1,2];//默认 降序 ,升序
12390
12393
  if(IFrameSplitOperator.IsNonEmptyArray(item.SortType))colItem.SortType=item.SortType.slice();}if(item.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID){if(!IFrameSplitOperator.IsNumber(item.DataIndex)&&!IFrameSplitOperator.IsNumber(item.BlockIndex))continue;if(IFrameSplitOperator.IsNumber(item.DataIndex))colItem.DataIndex=item.DataIndex;//数据在扩展数据索引列
12391
12394
  if(IFrameSplitOperator.IsNumber(item.BlockIndex))colItem.BlockIndex=item.BlockIndex;}else if(item.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID){if(!IFrameSplitOperator.IsNumber(item.DataIndex)&&!IFrameSplitOperator.IsNumber(item.BlockIndex))continue;if(IFrameSplitOperator.IsNumber(item.DataIndex))colItem.DataIndex=item.DataIndex;//数据在扩展数据索引列
@@ -12406,15 +12409,15 @@ this.Canvas.clip();this.DrawHeader();this.DrawBody();this.Canvas.restore();if(th
12406
12409
  this.UpdateCacheData=function(){this.RectClient.Left=this.ChartBorder.GetLeft();this.RectClient.Right=this.ChartBorder.GetRight();this.RectClient.Top=this.ChartBorder.GetTop();this.RectClient.Bottom=this.ChartBorder.GetBottom()-this.BottomToolbarHeight;};this.GetPageSize=function(recalculate)//recalculate 是否重新计算
12407
12410
  {if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
12408
12411
  {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.CalculateSize=function()//计算大小
12409
- {if(this.Tab&&this.Tab.IsShow){this.Tab.CalculateSize();this.BottomToolbarHeight=this.Tab.Height;}else{this.BottomToolbarHeight=0;}if(this.VScrollbar&&this.VScrollbar.Enable)this.VScrollbar.CalculateSize();this.UpdateCacheData();var pixelRatio=GetDevicePixelRatio();this.HeaderFont=this.HeaderFontConfig.Size*pixelRatio+'px '+this.HeaderFontConfig.Name;this.ItemFont=this.ItemFontConfig.Size*pixelRatio+'px '+this.ItemFontConfig.Name;this.ItemFixedFont=this.ItemFixedFontConfg.Size*pixelRatio+'px '+this.ItemFixedFontConfg.Name;this.ItemSymbolFont=this.ItemSymbolFontConfig.Size*pixelRatio+'px '+this.ItemSymbolFontConfig.Name;this.ItemNameFont=this.ItemNameFontConfg.Size*pixelRatio+'px '+this.ItemNameFontConfg.Name;this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+this.ItemMergin.Top+this.ItemMergin.Bottom;this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+this.ItemMergin.Top+this.ItemMergin.Bottom;this.Canvas.font=this.ItemFont;var itemWidth=0;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.Canvas.font=this.ItemNameFont;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.ItemNameHeight=nameHeight;this.Canvas.font=this.ItemSymbolFont;var symbolWidth=this.Canvas.measureText(item.MaxText).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.Canvas.font=this.ItemFont;itemWidth=Math.max(nameWidth,symbolWidth);item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;var rowHeight=nameHeight+symboHeight+this.ItemMergin.Top+this.ItemMergin.Bottom;if(rowHeight>this.RowHeight)this.RowHeight=rowHeight;if(rowHeight>this.FixedRowHeight)this.FixedRowHeight=rowHeight;}else{if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}}this.Canvas.font=this.HeaderFont;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(!item.Title||item.Title.length<=0)continue;var text=item.Title;if(item.Sort>0)text+="↓";itemWidth=this.Canvas.measureText(text).width;itemWidth+=4+this.HeaderMergin.Left+this.HeaderMergin.Right;if(item.Width<itemWidth)item.Width=itemWidth;}this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+this.HeaderMergin.Top+this.HeaderMergin.Bottom;if(!this.IsShowHeader)this.HeaderHeight=0;if(this.FixedRowCount<=0)this.FixedRowHeight=0;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-this.FixedRowHeight*this.FixedRowCount)/this.RowHeight);var subWidth=0;var reportWidth=this.RectClient.Right-this.RectClient.Left;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];subWidth+=item.Width;}this.IsShowAllColumn=subWidth<reportWidth;};this.DrawHeader=function(){if(!this.IsShowHeader)return;var left=this.RectClient.Left;var top=this.RectClient.Top;var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;this.Canvas.font=this.HeaderFont;this.Canvas.fillStyle=this.HeaderColor;var textLeft=left;//固定列
12410
- for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width;var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;var x=textLeft+this.HeaderMergin.Left;if(item.HeaderColor)this.Canvas.fillStyle=item.HeaderColor;if(this.SortInfo&&this.SortInfo.Field==i&&this.SortInfo.Sort>0){this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);}else{this.DrawText(item.Title,item.TextAlign,x,y,textWidth);}if(item.HeaderColor)this.Canvas.fillStyle=this.HeaderColor;textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width;var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;var x=textLeft+this.HeaderMergin.Left;if(item.HeaderColor)this.Canvas.fillStyle=item.HeaderColor;if(this.SortInfo&&this.SortInfo.Field==i&&this.SortInfo.Sort>0){this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);}else{this.DrawText(item.Title,item.TextAlign,x,y,textWidth);}if(item.HeaderColor)this.Canvas.fillStyle=this.HeaderColor;textLeft+=item.Width;}};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.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.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;//横线
12412
+ {if(this.Tab&&this.Tab.IsShow){this.Tab.CalculateSize();this.BottomToolbarHeight=this.Tab.Height;}else{this.BottomToolbarHeight=0;}if(this.VScrollbar&&this.VScrollbar.Enable)this.VScrollbar.CalculateSize();this.UpdateCacheData();var pixelRatio=GetDevicePixelRatio();this.HeaderFont=this.HeaderFontConfig.Size*pixelRatio+'px '+this.HeaderFontConfig.Name;this.ItemFont=this.ItemFontConfig.Size*pixelRatio+'px '+this.ItemFontConfig.Name;this.ItemFixedFont=this.ItemFixedFontConfg.Size*pixelRatio+'px '+this.ItemFixedFontConfg.Name;this.ItemSymbolFont=this.ItemSymbolFontConfig.Size*pixelRatio+'px '+this.ItemSymbolFontConfig.Name;this.ItemNameFont=this.ItemNameFontConfg.Size*pixelRatio+'px '+this.ItemNameFontConfg.Name;this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+this.ItemMergin.Top+this.ItemMergin.Bottom;this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+this.ItemMergin.Top+this.ItemMergin.Bottom;this.Canvas.font=this.ItemFont;var itemWidth=0;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_ID){this.Canvas.font=this.ItemNameFont;var nameWidth=this.Canvas.measureText(item.MaxText).width;var nameHeight=this.GetFontHeight(this.ItemNameFont,"擎");this.ItemNameHeight=nameHeight;this.Canvas.font=this.ItemSymbolFont;var symbolWidth=this.Canvas.measureText(item.MaxText).width;var symboHeight=this.GetFontHeight(this.ItemSymbolFont,"擎");this.Canvas.font=this.ItemFont;itemWidth=Math.max(nameWidth,symbolWidth);item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;var rowHeight=nameHeight+symboHeight+this.ItemMergin.Top+this.ItemMergin.Bottom;if(rowHeight>this.RowHeight)this.RowHeight=rowHeight;if(rowHeight>this.FixedRowHeight)this.FixedRowHeight=rowHeight;}else{if(IFrameSplitOperator.IsNumber(item.FixedWidth))itemWidth=item.FixedWidth;else itemWidth=this.Canvas.measureText(item.MaxText).width;item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;}}this.Canvas.font=this.HeaderFont;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];if(!item.Title||item.Title.length<=0)continue;var text=item.Title;if(item.Sort>0)text+="↓";itemWidth=this.Canvas.measureText(text).width;itemWidth+=4+this.HeaderMergin.Left+this.HeaderMergin.Right;if(item.Width<itemWidth)item.Width=itemWidth;}this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+this.HeaderMergin.Top+this.HeaderMergin.Bottom;if(!this.IsShowHeader)this.HeaderHeight=0;if(this.FixedRowCount<=0)this.FixedRowHeight=0;this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-this.FixedRowHeight*this.FixedRowCount)/this.RowHeight);var subWidth=0;var reportWidth=this.RectClient.Right-this.RectClient.Left;for(var i=0;i<this.Column.length;++i){var item=this.Column[i];subWidth+=item.Width;}this.IsShowAllColumn=subWidth<reportWidth;};this.DrawHeader=function(){if(!this.IsShowHeader)return;var left=this.RectClient.Left;var top=this.RectClient.Top;var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;this.Canvas.font=this.HeaderFont;var textLeft=left;//固定列
12413
+ for(var i=0;i<this.FixedColumn&&i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width;var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;var x=textLeft+this.HeaderMergin.Left;if(item.HeaderBGColor){var rtBG={Left:textLeft,Top:top,Width:itemWidth,Height:this.HeaderHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.DrawItemBG({Rect:rtBG,BGColor:item.HeaderBGColor});}if(item.HeaderColor)this.Canvas.fillStyle=item.HeaderColor;else this.Canvas.fillStyle=this.HeaderColor;if(this.SortInfo&&this.SortInfo.Field==i&&this.SortInfo.Sort>0){this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);}else{this.DrawText(item.Title,item.TextAlign,x,y,textWidth);}this.Canvas.fillStyle=this.HeaderColor;textLeft+=item.Width;}for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i){var item=this.Column[i];var itemWidth=item.Width;var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;var x=textLeft+this.HeaderMergin.Left;if(item.HeaderBGColor){var rtBG={Left:textLeft,Top:top,Width:itemWidth,Height:this.HeaderHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.DrawItemBG({Rect:rtBG,BGColor:item.HeaderBGColor});}if(item.HeaderColor)this.Canvas.fillStyle=item.HeaderColor;else this.Canvas.fillStyle=this.HeaderColor;if(this.SortInfo&&this.SortInfo.Field==i&&this.SortInfo.Sort>0){this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);}else{this.DrawText(item.Title,item.TextAlign,x,y,textWidth);}textLeft+=item.Width;}};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.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.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;//横线
12411
12414
  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;}//竖线
12412
12415
  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;//固定行
12413
12416
  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;//选中行
12414
12417
  }else{if(i==this.SelectedRow)bFillRow=true;//选中行
12415
12418
  }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=拖拽行
12416
12419
  {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);//小数位数
12417
- 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};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;//tooltip提示
12420
+ 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};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});}//tooltip提示
12418
12421
  if(column.EnableTooltip===true){this.TooltipRect.push({Rect:rtItem,Stock:stock,Index:index,Column:column,RowType:rowType});}if(column.Type==REPORT_COLUMN_ID.INDEX_ID){if(rowType==1)return;//固定行序号空
12419
12422
  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'}, ...] } ]}
12420
12423
  if(stock&&stock.NameEx){var nameEx=stock.NameEx;drawInfo.Text=this.TextEllipsis(nameEx.Text,textWidth,column.MaxText);drawInfo.TextColor=this.GetNameColor(column,data.Symbol,rowType);if(nameEx.Symbol)drawInfo.Symbol=nameEx.Symbol;}}else if(column.Type==REPORT_COLUMN_ID.PRICE_ID){if(stock)this.GetPriceDrawInfo(stock.Price,stock,data,drawInfo,{LimitBG:true});this.FormatDrawInfo(column,stock,drawInfo,data);}else if(column.Type==REPORT_COLUMN_ID.OPEN_ID){//如果行情开盘价为涨停价或跌停价,则对内容加灰框
@@ -12432,8 +12435,9 @@ switch(column.ColorType){case 1:drawInfo.TextColor=this.GetUpDownColor(value,0);
12432
12435
  this.GetCustomIconData=function(columnInfo,symbol,drawInfo,data){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_DRAW_CUSTOM_ICON);if(!event||!event.Callback)return false;var sendData={Symbol:symbol,Column:columnInfo,Data:data,Out:{Text:null,TextColor:null,TextAlign:null,Font:null}};event.Callback(event,sendData,this);if(sendData.Out.Text)drawInfo.Text=sendData.Out.Text;if(sendData.Out.TextColor)drawInfo.TextColor=sendData.Out.TextColor;if(sendData.Out.TextAlign)drawInfo.TextAlign=sendData.Out.TextAlign;if(sendData.Out.BGColor)drawInfo.BGColor=sendData.Out.BGColor;if(sendData.Out.Font)drawInfo.Font=sendData.Out.Font;return true;};this.GetPriceDrawInfo=function(price,stock,data,drawInfo,option){if(!IFrameSplitOperator.IsNumber(price))return false;drawInfo.Text=price.toFixed(data.Decimal);if(!IFrameSplitOperator.IsNumber(stock.YClose))drawInfo.TextColor=this.UnchagneColor;else drawInfo.TextColor=this.GetUpDownColor(price,stock.YClose);if(option&&option.LimitBG){if(IFrameSplitOperator.IsNumber(stock.LimitHigh)){if(price>=stock.LimitHigh){drawInfo.BGColor=this.LimitUpBGColor;drawInfo.TextColor=this.LimitTextColor;}}if(IFrameSplitOperator.IsNumber(stock.LimitLow)){if(price<=stock.LimitLow){drawInfo.BGColor=this.LimitDownBGColor;drawInfo.TextColor=this.LimitTextColor;}}}};this.GetUpDownColor=function(price,price2){if(price>price2)return this.UpColor;else if(price<price2)return this.DownColor;else return this.UnchagneColor;};//单独处理成交量显示
12433
12436
  this.FormatVolString=function(value,languageID){return IFrameSplitOperator.FormatVolString(value,languageID);};this.DrawItemBG=function(drawInfo){if(drawInfo.BGColor&&drawInfo.Rect)//绘制背景色
12434
12437
  {var rtItem=drawInfo.Rect;this.Canvas.fillStyle=drawInfo.BGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);//画一个背景色, 不然是一个黑的背景
12435
- }};this.DrawItemText=function(text,textColor,textAlign,left,top,width,bgColor){if(!text)return;var x=left;if(textAlign=='center'){x=left+width/2;this.Canvas.textAlign="center";}else if(textAlign=='right'){x=left+width-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var textWidth=this.Canvas.measureText(text).width+1;var bClip=false;if(textWidth>=width){this.Canvas.save();bClip=true;var rtCell={Left:left,Top:top+this.ItemMergin.Top,Width:width,Height:this.RowHeight};this.Canvas.beginPath();this.Canvas.rect(rtCell.Left,rtCell.Top,rtCell.Width,rtCell.Height);//this.Canvas.stroke(); //调试用
12436
- this.Canvas.clip();}this.Canvas.textBaseline="middle";this.Canvas.fillStyle=textColor;this.Canvas.fillText(text,x,top+this.ItemMergin.Top+this.RowHeight/2);if(bClip)this.Canvas.restore();};//{ Text:, Symbol:{ Family:'iconfont', Size:, Data:[ { Text:'\ue631', Color:'#1c65db'}, ...] } ]}
12438
+ }};this.DrawItemText=function(text,textColor,textAlign,left,top,width,bgColor){if(!text)return;var x=left;if(textAlign=='center'){x=left+width/2;this.Canvas.textAlign="center";}else if(textAlign=='right'){x=left+width-2;this.Canvas.textAlign="right";}else{x+=2;this.Canvas.textAlign="left";}var textWidth=this.Canvas.measureText(text).width+1;var bClip=false;if(textWidth>=width)//长度超过单元格 裁剪
12439
+ {this.Canvas.save();bClip=true;var rtCell={Left:left,Top:top+this.ItemMergin.Top,Width:width,Height:this.RowHeight};this.Canvas.beginPath();this.Canvas.rect(rtCell.Left,rtCell.Top,rtCell.Width,rtCell.Height);//this.Canvas.stroke(); //调试用
12440
+ this.Canvas.clip();if(this.TextOverflowStyle==1){var count=text.length+5;text="";for(var i=0;i<count;++i){text+="#";}}}this.Canvas.textBaseline="middle";this.Canvas.fillStyle=textColor;this.Canvas.fillText(text,x,top+this.ItemMergin.Top+this.RowHeight/2);if(bClip)this.Canvas.restore();};//{ Text:, Symbol:{ Family:'iconfont', Size:, Data:[ { Text:'\ue631', Color:'#1c65db'}, ...] } ]}
12437
12441
  this.DrawItemTextEx=function(drawInfo,left,top,width){var text=drawInfo.Text;var clrText=drawInfo.TextColor;var symbol=drawInfo.Symbol;//符号
12438
12442
  var textAlign=drawInfo.TextAlign;var textWidth=this.Canvas.measureText(text).width+1;;var totalWidth=textWidth;var font=symbol.Size*GetDevicePixelRatio()+'px '+symbol.Family;this.Canvas.font=font;var aryIconWidth=[];for(var i=0;i<symbol.Data.length;++i){var item=symbol.Data[i];var iconWidth=this.Canvas.measureText(item.Text).width+1;if(totalWidth+iconWidth>width)break;totalWidth+=iconWidth;aryIconWidth[i]=iconWidth;}var x=left;var y=top+this.ItemMergin.Top+this.RowHeight/2;if(textAlign=='center'){x=left+(width-totalWidth)/2;}else if(textAlign=='right'){x=left+(width-totalWidth);}else{x+=2;}this.Canvas.textBaseline="middle";this.Canvas.textAlign="left";this.Canvas.font=this.ItemFont;this.Canvas.fillStyle=clrText;this.Canvas.fillText(text,x,y);x+=textWidth;this.Canvas.font=font;for(var i=0;i<aryIconWidth.length;++i){var item=symbol.Data[i];this.Canvas.fillStyle=item.Color;this.Canvas.fillText(item.Text,x,y);x+=aryIconWidth[i];}this.Canvas.font=this.ItemFont;};this.DrawIconItem=function(drawInfo,left,top,width){if(!drawInfo||!drawInfo.Font||!drawInfo.Text)return;var text=drawInfo.Text;var clrText=drawInfo.TextColor;var textAlign=drawInfo.TextAlign;this.Canvas.font=drawInfo.Font;var textWidth=this.Canvas.measureText(text).width+1;;var x=left;var y=top+this.ItemMergin.Top+this.RowHeight/2;if(textAlign=='center'){x=left+(width-textWidth)/2;}else if(textAlign=='right'){x=left+(width-textWidth);}else{x+=2;}this.Canvas.textBaseline="middle";this.Canvas.textAlign="left";this.Canvas.fillStyle=clrText;this.Canvas.fillText(text,x,y);this.Canvas.font=this.ItemFont;};//字体由外面设置
12439
12443
  this.TextEllipsis=function(text,maxWidth,maxText){if(!text)return null;if(text.length<maxText.length)return text;var start=maxText.length-3;if(start<0)return null;var newText=text.slice(0,start);for(var i=start;i<text.length;++i){var value=newText+text[i]+"...";var width=this.Canvas.measureText(value).width;if(width>maxWidth){newText+="...";break;}newText+=text[i];}return newText;};this.DrawMultiBar=function(colunmInfo,data,rtItem){if(!data.Source||!IFrameSplitOperator.IsNonEmptyArray(data.Source))return false;var barData=data.Source[colunmInfo.DataIndex];//{ Value:[0.4,0,2], Color:[0,1] };
@@ -13034,7 +13038,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13034
13038
  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);};}/********************************************************************************
13035
13039
  * 版本信息输出
13036
13040
  *
13037
- */var HQCHART_VERSION="1.1.13119";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();//把给外界调用的方法暴露出来
13041
+ */var HQCHART_VERSION="1.1.13126";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();//把给外界调用的方法暴露出来
13038
13042
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13039
13043
  // BaseIndex:BaseIndex,
13040
13044
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13120",
3
+ "version": "1.1.13127",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -69077,6 +69077,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
69077
69077
  this.ClearRectSelect(true);
69078
69078
  this.Frame.ClearUpDonwFrameYData();
69079
69079
  this.ClearCustomKLine();
69080
+ this.ClearKLineCaluate();
69080
69081
 
69081
69082
 
69082
69083
  var kLineDrawType=this.GetKLineDrawType();
@@ -90,6 +90,12 @@ function JSReportChart(divElement)
90
90
  if (IFrameSplitOperator.IsNumber(item.Sort)) chart.SortInfo.Sort=item.Sort;
91
91
  }
92
92
 
93
+ var reportChart=chart.GetReportChart();
94
+ if (reportChart)
95
+ {
96
+ if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
97
+ }
98
+
93
99
  this.SetChartBorder(chart, option);
94
100
 
95
101
  //是否自动更新
@@ -3192,6 +3198,7 @@ function ChartReport()
3192
3198
  this.VScrollbar;
3193
3199
 
3194
3200
  this.GlobalOption;
3201
+ this.TextOverflowStyle=0; //输出内容比单元格长度大 0=裁剪 1=输出"####"
3195
3202
 
3196
3203
  //涨跌颜色
3197
3204
  this.UpColor=g_JSChartResource.Report.UpTextColor;
@@ -3392,6 +3399,8 @@ function ChartReport()
3392
3399
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
3393
3400
  if (item.MaxText) colItem.MaxText=item.MaxText;
3394
3401
  if (item.ID) colItem.ID=item.ID;
3402
+ if (item.FullColBGColor) colItem.FullColBGColor=item.FullColBGColor; //整列背景色
3403
+ if (item.HeaderBGColor) colItem.HeaderBGColor=item.HeaderBGColor; //表头背景色
3395
3404
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
3396
3405
  if (IFrameSplitOperator.IsBool(item.EnableTooltip)) colItem.EnableTooltip=item.EnableTooltip;
3397
3406
  if (IFrameSplitOperator.IsNumber(item.FixedWidth)) colItem.FixedWidth=item.FixedWidth;
@@ -3724,7 +3733,6 @@ function ChartReport()
3724
3733
  var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;
3725
3734
 
3726
3735
  this.Canvas.font=this.HeaderFont;
3727
- this.Canvas.fillStyle=this.HeaderColor;
3728
3736
 
3729
3737
  var textLeft=left;
3730
3738
  //固定列
@@ -3735,7 +3743,16 @@ function ChartReport()
3735
3743
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
3736
3744
  var x=textLeft+this.HeaderMergin.Left;
3737
3745
 
3746
+ if (item.HeaderBGColor)
3747
+ {
3748
+ var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
3749
+ rtBG.Right=rtBG.Left+rtBG.Width;
3750
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
3751
+ this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
3752
+ }
3753
+
3738
3754
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
3755
+ else this.Canvas.fillStyle=this.HeaderColor;
3739
3756
 
3740
3757
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
3741
3758
  {
@@ -3746,7 +3763,7 @@ function ChartReport()
3746
3763
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
3747
3764
  }
3748
3765
 
3749
- if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
3766
+ this.Canvas.fillStyle=this.HeaderColor;
3750
3767
 
3751
3768
  textLeft+=item.Width;
3752
3769
  }
@@ -3758,7 +3775,16 @@ function ChartReport()
3758
3775
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
3759
3776
  var x=textLeft+this.HeaderMergin.Left;
3760
3777
 
3778
+ if (item.HeaderBGColor)
3779
+ {
3780
+ var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
3781
+ rtBG.Right=rtBG.Left+rtBG.Width;
3782
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
3783
+ this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
3784
+ }
3785
+
3761
3786
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
3787
+ else this.Canvas.fillStyle=this.HeaderColor;
3762
3788
 
3763
3789
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
3764
3790
  {
@@ -3769,8 +3795,6 @@ function ChartReport()
3769
3795
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
3770
3796
  }
3771
3797
 
3772
- if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
3773
-
3774
3798
  textLeft+=item.Width;
3775
3799
  }
3776
3800
  }
@@ -4079,6 +4103,11 @@ function ChartReport()
4079
4103
  rtItem.Right=rtItem.Left+rtItem.Width;
4080
4104
  rtItem.Bottom=rtItem.Top+rtItem.Height;
4081
4105
  drawInfo.Rect=rtItem;
4106
+
4107
+ if (column.FullColBGColor)
4108
+ {
4109
+ this.DrawItemBG({ Rect:rtItem, BGColor:column.FullColBGColor });
4110
+ }
4082
4111
 
4083
4112
  //tooltip提示
4084
4113
  if (column.EnableTooltip===true)
@@ -4613,7 +4642,7 @@ function ChartReport()
4613
4642
 
4614
4643
  var textWidth=this.Canvas.measureText(text).width+1;
4615
4644
  var bClip=false;
4616
- if (textWidth>=width)
4645
+ if (textWidth>=width) //长度超过单元格 裁剪
4617
4646
  {
4618
4647
  this.Canvas.save();
4619
4648
  bClip=true;
@@ -4623,6 +4652,16 @@ function ChartReport()
4623
4652
  this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
4624
4653
  //this.Canvas.stroke(); //调试用
4625
4654
  this.Canvas.clip();
4655
+
4656
+ if (this.TextOverflowStyle==1)
4657
+ {
4658
+ var count=text.length+5;
4659
+ text="";
4660
+ for(var i=0;i<count;++i)
4661
+ {
4662
+ text+="#";
4663
+ }
4664
+ }
4626
4665
  }
4627
4666
 
4628
4667
  this.Canvas.textBaseline="middle";
@@ -72969,6 +72969,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
72969
72969
  this.ClearRectSelect(true);
72970
72970
  this.Frame.ClearUpDonwFrameYData();
72971
72971
  this.ClearCustomKLine();
72972
+ this.ClearKLineCaluate();
72972
72973
 
72973
72974
 
72974
72975
  var kLineDrawType=this.GetKLineDrawType();
@@ -122403,6 +122404,12 @@ function JSReportChart(divElement)
122403
122404
  if (IFrameSplitOperator.IsNumber(item.Sort)) chart.SortInfo.Sort=item.Sort;
122404
122405
  }
122405
122406
 
122407
+ var reportChart=chart.GetReportChart();
122408
+ if (reportChart)
122409
+ {
122410
+ if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
122411
+ }
122412
+
122406
122413
  this.SetChartBorder(chart, option);
122407
122414
 
122408
122415
  //是否自动更新
@@ -125505,6 +125512,7 @@ function ChartReport()
125505
125512
  this.VScrollbar;
125506
125513
 
125507
125514
  this.GlobalOption;
125515
+ this.TextOverflowStyle=0; //输出内容比单元格长度大 0=裁剪 1=输出"####"
125508
125516
 
125509
125517
  //涨跌颜色
125510
125518
  this.UpColor=g_JSChartResource.Report.UpTextColor;
@@ -125705,6 +125713,8 @@ function ChartReport()
125705
125713
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
125706
125714
  if (item.MaxText) colItem.MaxText=item.MaxText;
125707
125715
  if (item.ID) colItem.ID=item.ID;
125716
+ if (item.FullColBGColor) colItem.FullColBGColor=item.FullColBGColor; //整列背景色
125717
+ if (item.HeaderBGColor) colItem.HeaderBGColor=item.HeaderBGColor; //表头背景色
125708
125718
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
125709
125719
  if (IFrameSplitOperator.IsBool(item.EnableTooltip)) colItem.EnableTooltip=item.EnableTooltip;
125710
125720
  if (IFrameSplitOperator.IsNumber(item.FixedWidth)) colItem.FixedWidth=item.FixedWidth;
@@ -126037,7 +126047,6 @@ function ChartReport()
126037
126047
  var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;
126038
126048
 
126039
126049
  this.Canvas.font=this.HeaderFont;
126040
- this.Canvas.fillStyle=this.HeaderColor;
126041
126050
 
126042
126051
  var textLeft=left;
126043
126052
  //固定列
@@ -126048,7 +126057,16 @@ function ChartReport()
126048
126057
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126049
126058
  var x=textLeft+this.HeaderMergin.Left;
126050
126059
 
126060
+ if (item.HeaderBGColor)
126061
+ {
126062
+ var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
126063
+ rtBG.Right=rtBG.Left+rtBG.Width;
126064
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
126065
+ this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
126066
+ }
126067
+
126051
126068
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126069
+ else this.Canvas.fillStyle=this.HeaderColor;
126052
126070
 
126053
126071
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126054
126072
  {
@@ -126059,7 +126077,7 @@ function ChartReport()
126059
126077
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126060
126078
  }
126061
126079
 
126062
- if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126080
+ this.Canvas.fillStyle=this.HeaderColor;
126063
126081
 
126064
126082
  textLeft+=item.Width;
126065
126083
  }
@@ -126071,7 +126089,16 @@ function ChartReport()
126071
126089
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126072
126090
  var x=textLeft+this.HeaderMergin.Left;
126073
126091
 
126092
+ if (item.HeaderBGColor)
126093
+ {
126094
+ var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
126095
+ rtBG.Right=rtBG.Left+rtBG.Width;
126096
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
126097
+ this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
126098
+ }
126099
+
126074
126100
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126101
+ else this.Canvas.fillStyle=this.HeaderColor;
126075
126102
 
126076
126103
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126077
126104
  {
@@ -126082,8 +126109,6 @@ function ChartReport()
126082
126109
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126083
126110
  }
126084
126111
 
126085
- if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126086
-
126087
126112
  textLeft+=item.Width;
126088
126113
  }
126089
126114
  }
@@ -126392,6 +126417,11 @@ function ChartReport()
126392
126417
  rtItem.Right=rtItem.Left+rtItem.Width;
126393
126418
  rtItem.Bottom=rtItem.Top+rtItem.Height;
126394
126419
  drawInfo.Rect=rtItem;
126420
+
126421
+ if (column.FullColBGColor)
126422
+ {
126423
+ this.DrawItemBG({ Rect:rtItem, BGColor:column.FullColBGColor });
126424
+ }
126395
126425
 
126396
126426
  //tooltip提示
126397
126427
  if (column.EnableTooltip===true)
@@ -126926,7 +126956,7 @@ function ChartReport()
126926
126956
 
126927
126957
  var textWidth=this.Canvas.measureText(text).width+1;
126928
126958
  var bClip=false;
126929
- if (textWidth>=width)
126959
+ if (textWidth>=width) //长度超过单元格 裁剪
126930
126960
  {
126931
126961
  this.Canvas.save();
126932
126962
  bClip=true;
@@ -126936,6 +126966,16 @@ function ChartReport()
126936
126966
  this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
126937
126967
  //this.Canvas.stroke(); //调试用
126938
126968
  this.Canvas.clip();
126969
+
126970
+ if (this.TextOverflowStyle==1)
126971
+ {
126972
+ var count=text.length+5;
126973
+ text="";
126974
+ for(var i=0;i<count;++i)
126975
+ {
126976
+ text+="#";
126977
+ }
126978
+ }
126939
126979
  }
126940
126980
 
126941
126981
  this.Canvas.textBaseline="middle";
@@ -131473,7 +131513,7 @@ function ScrollBarBGChart()
131473
131513
 
131474
131514
 
131475
131515
 
131476
- var HQCHART_VERSION="1.1.13119";
131516
+ var HQCHART_VERSION="1.1.13126";
131477
131517
 
131478
131518
  function PrintHQChartVersion()
131479
131519
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13119";
8
+ var HQCHART_VERSION="1.1.13126";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -73013,6 +73013,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73013
73013
  this.ClearRectSelect(true);
73014
73014
  this.Frame.ClearUpDonwFrameYData();
73015
73015
  this.ClearCustomKLine();
73016
+ this.ClearKLineCaluate();
73016
73017
 
73017
73018
 
73018
73019
  var kLineDrawType=this.GetKLineDrawType();
@@ -122447,6 +122448,12 @@ function JSReportChart(divElement)
122447
122448
  if (IFrameSplitOperator.IsNumber(item.Sort)) chart.SortInfo.Sort=item.Sort;
122448
122449
  }
122449
122450
 
122451
+ var reportChart=chart.GetReportChart();
122452
+ if (reportChart)
122453
+ {
122454
+ if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
122455
+ }
122456
+
122450
122457
  this.SetChartBorder(chart, option);
122451
122458
 
122452
122459
  //是否自动更新
@@ -125549,6 +125556,7 @@ function ChartReport()
125549
125556
  this.VScrollbar;
125550
125557
 
125551
125558
  this.GlobalOption;
125559
+ this.TextOverflowStyle=0; //输出内容比单元格长度大 0=裁剪 1=输出"####"
125552
125560
 
125553
125561
  //涨跌颜色
125554
125562
  this.UpColor=g_JSChartResource.Report.UpTextColor;
@@ -125749,6 +125757,8 @@ function ChartReport()
125749
125757
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
125750
125758
  if (item.MaxText) colItem.MaxText=item.MaxText;
125751
125759
  if (item.ID) colItem.ID=item.ID;
125760
+ if (item.FullColBGColor) colItem.FullColBGColor=item.FullColBGColor; //整列背景色
125761
+ if (item.HeaderBGColor) colItem.HeaderBGColor=item.HeaderBGColor; //表头背景色
125752
125762
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
125753
125763
  if (IFrameSplitOperator.IsBool(item.EnableTooltip)) colItem.EnableTooltip=item.EnableTooltip;
125754
125764
  if (IFrameSplitOperator.IsNumber(item.FixedWidth)) colItem.FixedWidth=item.FixedWidth;
@@ -126081,7 +126091,6 @@ function ChartReport()
126081
126091
  var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;
126082
126092
 
126083
126093
  this.Canvas.font=this.HeaderFont;
126084
- this.Canvas.fillStyle=this.HeaderColor;
126085
126094
 
126086
126095
  var textLeft=left;
126087
126096
  //固定列
@@ -126092,7 +126101,16 @@ function ChartReport()
126092
126101
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126093
126102
  var x=textLeft+this.HeaderMergin.Left;
126094
126103
 
126104
+ if (item.HeaderBGColor)
126105
+ {
126106
+ var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
126107
+ rtBG.Right=rtBG.Left+rtBG.Width;
126108
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
126109
+ this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
126110
+ }
126111
+
126095
126112
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126113
+ else this.Canvas.fillStyle=this.HeaderColor;
126096
126114
 
126097
126115
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126098
126116
  {
@@ -126103,7 +126121,7 @@ function ChartReport()
126103
126121
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126104
126122
  }
126105
126123
 
126106
- if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126124
+ this.Canvas.fillStyle=this.HeaderColor;
126107
126125
 
126108
126126
  textLeft+=item.Width;
126109
126127
  }
@@ -126115,7 +126133,16 @@ function ChartReport()
126115
126133
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126116
126134
  var x=textLeft+this.HeaderMergin.Left;
126117
126135
 
126136
+ if (item.HeaderBGColor)
126137
+ {
126138
+ var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
126139
+ rtBG.Right=rtBG.Left+rtBG.Width;
126140
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
126141
+ this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
126142
+ }
126143
+
126118
126144
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126145
+ else this.Canvas.fillStyle=this.HeaderColor;
126119
126146
 
126120
126147
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126121
126148
  {
@@ -126126,8 +126153,6 @@ function ChartReport()
126126
126153
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126127
126154
  }
126128
126155
 
126129
- if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126130
-
126131
126156
  textLeft+=item.Width;
126132
126157
  }
126133
126158
  }
@@ -126436,6 +126461,11 @@ function ChartReport()
126436
126461
  rtItem.Right=rtItem.Left+rtItem.Width;
126437
126462
  rtItem.Bottom=rtItem.Top+rtItem.Height;
126438
126463
  drawInfo.Rect=rtItem;
126464
+
126465
+ if (column.FullColBGColor)
126466
+ {
126467
+ this.DrawItemBG({ Rect:rtItem, BGColor:column.FullColBGColor });
126468
+ }
126439
126469
 
126440
126470
  //tooltip提示
126441
126471
  if (column.EnableTooltip===true)
@@ -126970,7 +127000,7 @@ function ChartReport()
126970
127000
 
126971
127001
  var textWidth=this.Canvas.measureText(text).width+1;
126972
127002
  var bClip=false;
126973
- if (textWidth>=width)
127003
+ if (textWidth>=width) //长度超过单元格 裁剪
126974
127004
  {
126975
127005
  this.Canvas.save();
126976
127006
  bClip=true;
@@ -126980,6 +127010,16 @@ function ChartReport()
126980
127010
  this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
126981
127011
  //this.Canvas.stroke(); //调试用
126982
127012
  this.Canvas.clip();
127013
+
127014
+ if (this.TextOverflowStyle==1)
127015
+ {
127016
+ var count=text.length+5;
127017
+ text="";
127018
+ for(var i=0;i<count;++i)
127019
+ {
127020
+ text+="#";
127021
+ }
127022
+ }
126983
127023
  }
126984
127024
 
126985
127025
  this.Canvas.textBaseline="middle";
@@ -134037,7 +134077,7 @@ function HQChartScriptWorker()
134037
134077
 
134038
134078
 
134039
134079
 
134040
- var HQCHART_VERSION="1.1.13119";
134080
+ var HQCHART_VERSION="1.1.13126";
134041
134081
 
134042
134082
  function PrintHQChartVersion()
134043
134083
  {