hqchart 1.1.13114 → 1.1.13123

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.
@@ -6118,11 +6118,13 @@ this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPriceLineV2';thi
6118
6118
  this.TextPosition=[null,0];//[0]=左侧(没有做) [1]=右侧 0=自动 1=内部 2=外部
6119
6119
  this.Super_SetOption=this.SetOption;//父类函数
6120
6120
  this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.TextColor)this.TextColor=option.TextColor;if(option.Title)this.Title=option.Title;if(IFrameSplitOperator.IsNonEmptyArray(option.TextPosition))this.TextPosition=option.TextPosition.slice();}};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:false,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return;this.IsHScreen=this.Frame.IsHScreen;var chartBorder=this.Frame.ChartBorder;var border=this.Frame.GetBorder();if(this.IsHScreen){var left=border.LeftEx;var right=border.RightEx;var bottom=border.Bottom;var top=border.Top;var ptStart={X:drawPoint[0].X,Y:top};if(ptStart.X<left||ptStart.X>right)return;var ptEnd={X:drawPoint[0].X,Y:bottom};var price=this.Frame.GetYData(ptStart.X,false);}else{var bottom=border.BottomEx;var top=border.TopTitle;var left=border.Left;var right=border.Right;var ptStart={X:left,Y:drawPoint[0].Y};if(ptStart.Y<top||ptStart.Y>bottom)return;var ptEnd={X:right,Y:drawPoint[0].Y};var price=this.Frame.GetYData(ptStart.Y,false);}//this.ClipFrame();
6121
- this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(ptStart.X),ToFixedPoint(ptStart.Y));this.Canvas.lineTo(ToFixedPoint(ptEnd.X),ToFixedPoint(ptEnd.Y));this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);var pixelTatio=GetDevicePixelRatio();this.Canvas.font=this.Font;var offset=2*pixelTatio;var xText=ptEnd.X;var yText=ptEnd.Y;this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';var textHeight=this.GetFontHeight();var text=price.toFixed(2);var textWidth=this.Canvas.measureText(text).width+2*offset;if(this.IsHScreen){var position=this.TextPosition[1];var bDrawInside=false;//在内部绘制
6121
+ this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(ptStart.X),ToFixedPoint(ptStart.Y));this.Canvas.lineTo(ToFixedPoint(ptEnd.X),ToFixedPoint(ptEnd.Y));this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);var pixelTatio=GetDevicePixelRatio();this.Canvas.font=this.Font;var offset=2*pixelTatio;var xText=ptEnd.X;var yText=ptEnd.Y;this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';var textHeight=this.GetFontHeight();var text=price.toFixed(2);var textWidth=this.Canvas.measureText(text).width+2*offset;var centerPoint=null;if(this.IsHScreen){var position=this.TextPosition[1];var bDrawInside=false;//在内部绘制
6122
6122
  if(position==0)bDrawInside=chartBorder.Bottom<=10;else if(position==1)bDrawInside=true;else if(position==2)bDrawInside=false;if(bDrawInside){yText=yText-textWidth;var rtBG={Left:xText-textHeight/2,Top:yText,Width:textHeight,Height:textWidth};}else//框架内部显示
6123
- {var rtBG={Left:xText-textHeight/2,Top:yText,Width:textHeight,Height:textWidth};}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.save();this.Canvas.translate(xText,yText+1*pixelTatio);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,0,0);this.Canvas.restore();if(this.Title){var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;if(bDrawInside){var rtTitle={Left:rtBG.Left,Top:rtBG.Top-textWidth-1*pixelTatio,Width:textHeight,Height:textWidth};}else{var rtTitle={Left:rtBG.Left,Top:bottom-textWidth-1*pixelTatio,Width:textHeight,Height:textWidth};}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtTitle.Left,rtTitle.Top,rtTitle.Width,rtTitle.Height);this.Canvas.save();this.Canvas.translate(xText,rtTitle.Top+1*pixelTatio);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(this.Title,0,0);this.Canvas.restore();}}else{var position=this.TextPosition[1];var bDrawInside=false;//在内部绘制
6123
+ {var rtBG={Left:xText-textHeight/2,Top:yText,Width:textHeight,Height:textWidth};}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.save();this.Canvas.translate(xText,yText+1*pixelTatio);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,0,0);this.Canvas.restore();if(this.Title){var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;if(bDrawInside){var rtTitle={Left:rtBG.Left,Top:rtBG.Top-textWidth-1*pixelTatio,Width:textHeight,Height:textWidth};}else{var rtTitle={Left:rtBG.Left,Top:bottom-textWidth-1*pixelTatio,Width:textHeight,Height:textWidth};}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtTitle.Left,rtTitle.Top,rtTitle.Width,rtTitle.Height);this.Canvas.save();this.Canvas.translate(xText,rtTitle.Top+1*pixelTatio);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(this.Title,0,0);this.Canvas.restore();}centerPoint={X:ptStart.X,Y:ptStart.Y+(ptEnd.Y-ptStart.Y)/2};//中心点
6124
+ }else{var position=this.TextPosition[1];var bDrawInside=false;//在内部绘制
6124
6125
  if(position==0)bDrawInside=chartBorder.Right<=10;else if(position==1)bDrawInside=true;else if(position==2)bDrawInside=false;if(bDrawInside){var rtBG={Left:xText-textWidth,Top:yText-textHeight/2-1*pixelTatio,Width:textWidth,Height:textHeight};}else//框架内部显示
6125
- {var rtBG={Left:xText,Top:yText-textHeight/2-1*pixelTatio,Width:textWidth,Height:textHeight};if(rtBG.Left+rtBG.Width>border.ChartWidth)rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,rtBG.Left+offset,yText);if(this.Title){var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;if(bDrawInside){var rtTitle={Left:rtBG.Left-textWidth,Top:rtBG.Top,Width:textWidth,Height:textHeight};}else{var rtTitle={Left:right-textWidth-1*pixelTatio,Top:rtBG.Top,Width:textWidth,Height:textHeight};if(rtBG.Left!=right)rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtTitle.Left,rtTitle.Top,rtTitle.Width,rtTitle.Height);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(this.Title,rtTitle.Left+1*pixelTatio,yText);}}};this.DrawPrice=function(){};}//画图工具-竖线 支持横屏
6126
+ {var rtBG={Left:xText,Top:yText-textHeight/2-1*pixelTatio,Width:textWidth,Height:textHeight};if(rtBG.Left+rtBG.Width>border.ChartWidth)rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,rtBG.Left+offset,yText);if(this.Title){var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;if(bDrawInside){var rtTitle={Left:rtBG.Left-textWidth,Top:rtBG.Top,Width:textWidth,Height:textHeight};}else{var rtTitle={Left:right-textWidth-1*pixelTatio,Top:rtBG.Top,Width:textWidth,Height:textHeight};if(rtBG.Left!=right)rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtTitle.Left,rtTitle.Top,rtTitle.Width,rtTitle.Height);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(this.Title,rtTitle.Left+1*pixelTatio,yText);}centerPoint={X:ptStart.X+(ptEnd.X-ptStart.X)/2,Y:ptStart.Y};//中心点
6127
+ }if(centerPoint)this.DrawPoint([centerPoint]);};this.DrawPrice=function(){};}//画图工具-竖线 支持横屏
6126
6128
  function ChartDrawVerticalLine(){this.newMethod=IChartDrawPicture;//派生
6127
6129
  this.newMethod();delete this.newMethod;this.ClassName='ChartDrawVerticalLine';this.PointCount=1;this.IsPointIn=this.IsPointIn_XYValue_Line;this.IsHScreen=false;this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;if(!this.Frame||!this.Frame.Data)return;var data=this.Frame.Data;var drawPoint=this.CalculateDrawPoint({IsCheckX:true,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=1)return;this.IsHScreen=this.Frame.IsHScreen;var pt=drawPoint[0];var chartBorder=this.Frame.ChartBorder;if(this.IsHScreen){var xValue=Math.round(this.Frame.GetXData(pt.Y,false))+data.DataOffset;if(xValue<0)xValue=0;else if(xValue>=data.Data.length)xValue=data.Data.length-1;var yLine=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);yLine=ToFixedPoint2(this.LineWidth,yLine);var left=chartBorder.GetLeftEx();var right=chartBorder.GetRightEx();var ptStart={X:left,Y:yLine};var ptEnd={X:right,Y:yLine};}else{var xValue=Math.round(this.Frame.GetXData(pt.X,false))+data.DataOffset;if(xValue<0)xValue=0;else if(xValue>=data.Data.length)xValue=data.Data.length-1;var xLine=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);xLine=ToFixedPoint2(this.LineWidth,xLine);var top=chartBorder.GetTopEx();var bottom=chartBorder.GetBottomEx();var ptStart={X:xLine,Y:top};var ptEnd={X:xLine,Y:bottom};}this.ClipFrame();this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);if(this.Status==10)this.DrawPoint(drawPoint);//画点
6128
6130
  this.Canvas.restore();};}//画图工具-波浪尺
@@ -7204,10 +7206,11 @@ this.AutoUpdateEvent(false,'KLineChartContainer::ChangeKLineDrawType');if(ChartD
7204
7206
  {var item=this.OverlayChartPaint[i];item.DrawType=this.KLineDrawType;}if(isDraw==false)return;this.UpdateFrameMaxMin();//调整坐标最大 最小值
7205
7207
  this.Frame.SetSizeChage(true);this.Draw();};//修改坐标类型
7206
7208
  //{ Type: 0=普通坐标 1=百分比坐标 (右边坐标刻度) 2=对数对标 3=等比坐标, IsReverse:是否反转坐标 }
7207
- this.ChangeCoordinateType=function(obj){if(!this.Frame&&!this.Frame.SubFrame)return;if(!this.Frame.SubFrame.length)return;if(IFrameSplitOperator.IsNumber(obj))//老版本
7209
+ this.ChangeCoordinateType=function(obj){if(!this.Frame)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame))return;if(!this.Frame.SubFrame[0])return;var frame=this.Frame.SubFrame[0].Frame;if(IFrameSplitOperator.IsNumber(obj))//老版本
7208
7210
  {var type=obj;if(type==2)//反转坐标
7209
- {this.Frame.SubFrame[0].Frame.CoordinateType=1;}else if(type==1){this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=type;}else if(type==0){this.Frame.SubFrame[0].Frame.CoordinateType=0;this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=0;}else if(type==3)//对数坐标
7210
- {this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=2;}else{return;}}else{if(obj.Type>=0&&obj.Type<=5)this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=obj.Type;if(obj.IsReverse===true)this.Frame.SubFrame[0].Frame.CoordinateType=1;else if(obj.IsReverse==false)this.Frame.SubFrame[0].Frame.CoordinateType=0;}this.UpdateFrameMaxMin();//调整坐标最大 最小值
7211
+ {frame.CoordinateType=1;}else if(type==1){frame.YSplitOperator.CoordinateType=type;}else if(type==0){frame.CoordinateType=0;frame.YSplitOperator.CoordinateType=0;}else if(type==3)//对数坐标
7212
+ {frame.Frame.YSplitOperator.CoordinateType=2;}else{return;}}else{if(obj.Type>=0&&obj.Type<=5)frame.YSplitOperator.CoordinateType=obj.Type;if(obj.IsReverse===true)frame.CoordinateType=1;else if(obj.IsReverse==false)frame.CoordinateType=0;}//请求缓存的最大最小值
7213
+ frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;this.UpdateFrameMaxMin();//调整坐标最大 最小值
7211
7214
  this.Frame.SetSizeChage(true);this.Draw();};//设置指标窗口个数
7212
7215
  this.ChangeIndexWindowCount=function(count,option){var _this23=this;if(count<=0)return;if(this.Frame.SubFrame.length==count)return;this.Frame.RestoreIndexWindows();var currentLength=this.Frame.SubFrame.length;if(currentLength>count){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DELETE_FRAME);for(var i=currentLength-1;i>=count;--i){this.DeleteIndexPaint(i);this.Frame.SubFrame[i].Frame.ClearToolbar();if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}this.Frame.SubFrame.splice(count,currentLength-count);this.WindowIndex.splice(count,currentLength-count);//最后一个显示X轴坐标
7213
7216
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(i==this.Frame.SubFrame.length-1)item.XSplitOperator.ShowText=true;else item.XSplitOperator.ShowText=false;}this.Frame.SetSizeChage(true);this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
@@ -12076,7 +12079,7 @@ this.CanvasElement=document.createElement("canvas");this.CanvasElement.className
12076
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();//获取设备的分辨率
12077
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中保存一份
12078
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);//下载码表
12079
- };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);//是否自动更新
12080
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;//注册事件
12081
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();//获取设备的分辨率
12082
12085
  chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;};/////////////////////////////////////////////////////////////////////////////
@@ -12358,7 +12361,8 @@ this.SelectedFixedRow=-1;//选中固定行ID
12358
12361
  this.IsDrawBorder=1;//是否绘制单元格边框
12359
12362
  this.ShowSymbol=[];//显示的股票列表 { Index:序号(排序用), Symbol:股票代码 }
12360
12363
  this.DragRow;//拖拽行
12361
- this.Tab;this.VScrollbar;this.GlobalOption;//涨跌颜色
12364
+ this.Tab;this.VScrollbar;this.GlobalOption;this.TextOverflowStyle=0;//输出内容比单元格长度大 0=裁剪 1=输出"####"
12365
+ //涨跌颜色
12362
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;//边框线
12363
12367
  this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
12364
12368
  //表头配置
@@ -12382,7 +12386,7 @@ this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
12382
12386
  //表头配置
12383
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;//排序箭头颜色
12384
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};//表格内容配置
12385
- 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.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(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=远程排序
12386
12390
  {colItem.SortType=[1,2];//默认 降序 ,升序
12387
12391
  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;//数据在扩展数据索引列
12388
12392
  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;//数据在扩展数据索引列
@@ -12404,7 +12408,7 @@ this.UpdateCacheData=function(){this.RectClient.Left=this.ChartBorder.GetLeft();
12404
12408
  {if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
12405
12409
  {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()//计算大小
12406
12410
  {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;//固定列
12407
- 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(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;}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(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
+ 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;//横线
12408
12412
  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;}//竖线
12409
12413
  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;//固定行
12410
12414
  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;//选中行
@@ -12429,8 +12433,9 @@ switch(column.ColorType){case 1:drawInfo.TextColor=this.GetUpDownColor(value,0);
12429
12433
  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;};//单独处理成交量显示
12430
12434
  this.FormatVolString=function(value,languageID){return IFrameSplitOperator.FormatVolString(value,languageID);};this.DrawItemBG=function(drawInfo){if(drawInfo.BGColor&&drawInfo.Rect)//绘制背景色
12431
12435
  {var rtItem=drawInfo.Rect;this.Canvas.fillStyle=drawInfo.BGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);//画一个背景色, 不然是一个黑的背景
12432
- }};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(); //调试用
12433
- 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'}, ...] } ]}
12436
+ }};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)//长度超过单元格 裁剪
12437
+ {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(); //调试用
12438
+ 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'}, ...] } ]}
12434
12439
  this.DrawItemTextEx=function(drawInfo,left,top,width){var text=drawInfo.Text;var clrText=drawInfo.TextColor;var symbol=drawInfo.Symbol;//符号
12435
12440
  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;};//字体由外面设置
12436
12441
  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] };
@@ -13031,7 +13036,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13031
13036
  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);};}/********************************************************************************
13032
13037
  * 版本信息输出
13033
13038
  *
13034
- */var HQCHART_VERSION="1.1.13113";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();//把给外界调用的方法暴露出来
13039
+ */var HQCHART_VERSION="1.1.13122";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();//把给外界调用的方法暴露出来
13035
13040
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13036
13041
  // BaseIndex:BaseIndex,
13037
13042
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13114",
3
+ "version": "1.1.13123",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -58702,6 +58702,7 @@ function ChartDrawPriceLineV2()
58702
58702
  var text=price.toFixed(2);
58703
58703
  var textWidth=this.Canvas.measureText(text).width+2*offset;
58704
58704
 
58705
+ var centerPoint=null;
58705
58706
  if (this.IsHScreen)
58706
58707
  {
58707
58708
  var position=this.TextPosition[1];
@@ -58752,6 +58753,8 @@ function ChartDrawPriceLineV2()
58752
58753
  this.Canvas.fillText(this.Title,0,0);
58753
58754
  this.Canvas.restore();
58754
58755
  }
58756
+
58757
+ centerPoint={ X:ptStart.X, Y:ptStart.Y+(ptEnd.Y-ptStart.Y)/2 }; //中心点
58755
58758
  }
58756
58759
  else
58757
58760
  {
@@ -58796,9 +58799,11 @@ function ChartDrawPriceLineV2()
58796
58799
  this.Canvas.fillStyle=this.TextColor;
58797
58800
  this.Canvas.fillText(this.Title, rtTitle.Left+1*pixelTatio, yText);
58798
58801
  }
58802
+
58803
+ centerPoint={ X:ptStart.X+(ptEnd.X-ptStart.X)/2, Y:ptStart.Y }; //中心点
58799
58804
  }
58800
58805
 
58801
-
58806
+ if (centerPoint) this.DrawPoint([centerPoint]);
58802
58807
  }
58803
58808
 
58804
58809
  this.DrawPrice=function()
@@ -69680,28 +69685,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
69680
69685
  //{ Type: 0=普通坐标 1=百分比坐标 (右边坐标刻度) 2=对数对标 3=等比坐标, IsReverse:是否反转坐标 }
69681
69686
  this.ChangeCoordinateType=function(obj)
69682
69687
  {
69683
- if (!this.Frame && !this.Frame.SubFrame) return;
69684
- if (!this.Frame.SubFrame.length) return;
69688
+ if (!this.Frame) return;
69689
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
69690
+ if (!this.Frame.SubFrame[0]) return;
69685
69691
 
69692
+ var frame=this.Frame.SubFrame[0].Frame;
69686
69693
  if (IFrameSplitOperator.IsNumber(obj)) //老版本
69687
69694
  {
69688
69695
  var type=obj;
69689
69696
  if (type==2) //反转坐标
69690
69697
  {
69691
- this.Frame.SubFrame[0].Frame.CoordinateType=1;
69698
+ frame.CoordinateType=1;
69692
69699
  }
69693
69700
  else if(type==1)
69694
69701
  {
69695
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=type;
69702
+ frame.YSplitOperator.CoordinateType=type;
69696
69703
  }
69697
69704
  else if (type==0)
69698
69705
  {
69699
- this.Frame.SubFrame[0].Frame.CoordinateType=0;
69700
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=0;
69706
+ frame.CoordinateType=0;
69707
+ frame.YSplitOperator.CoordinateType=0;
69701
69708
  }
69702
69709
  else if (type==3) //对数坐标
69703
69710
  {
69704
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=2;
69711
+ frame.Frame.YSplitOperator.CoordinateType=2;
69705
69712
  }
69706
69713
  else
69707
69714
  {
@@ -69710,11 +69717,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
69710
69717
  }
69711
69718
  else
69712
69719
  {
69713
- if (obj.Type>=0 && obj.Type<=5) this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=obj.Type;
69714
- if (obj.IsReverse===true) this.Frame.SubFrame[0].Frame.CoordinateType=1;
69715
- else if (obj.IsReverse==false) this.Frame.SubFrame[0].Frame.CoordinateType=0;
69720
+ if (obj.Type>=0 && obj.Type<=5) frame.YSplitOperator.CoordinateType=obj.Type;
69721
+ if (obj.IsReverse===true) frame.CoordinateType=1;
69722
+ else if (obj.IsReverse==false) frame.CoordinateType=0;
69716
69723
  }
69717
69724
 
69725
+ //请求缓存的最大最小值
69726
+ frame.YMaxMin.Max=null;
69727
+ frame.YMaxMin.Min=null;
69728
+
69718
69729
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
69719
69730
  this.Frame.SetSizeChage(true);
69720
69731
  this.Draw();
@@ -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;
@@ -3389,6 +3396,7 @@ function ChartReport()
3389
3396
  if (item.Title) colItem.Title=item.Title;
3390
3397
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
3391
3398
  if (item.TextColor) colItem.TextColor=item.TextColor;
3399
+ if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
3392
3400
  if (item.MaxText) colItem.MaxText=item.MaxText;
3393
3401
  if (item.ID) colItem.ID=item.ID;
3394
3402
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
@@ -3734,6 +3742,8 @@ function ChartReport()
3734
3742
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
3735
3743
  var x=textLeft+this.HeaderMergin.Left;
3736
3744
 
3745
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
3746
+
3737
3747
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
3738
3748
  {
3739
3749
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -3743,6 +3753,8 @@ function ChartReport()
3743
3753
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
3744
3754
  }
3745
3755
 
3756
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
3757
+
3746
3758
  textLeft+=item.Width;
3747
3759
  }
3748
3760
 
@@ -3753,6 +3765,8 @@ function ChartReport()
3753
3765
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
3754
3766
  var x=textLeft+this.HeaderMergin.Left;
3755
3767
 
3768
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
3769
+
3756
3770
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
3757
3771
  {
3758
3772
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -3762,6 +3776,8 @@ function ChartReport()
3762
3776
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
3763
3777
  }
3764
3778
 
3779
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
3780
+
3765
3781
  textLeft+=item.Width;
3766
3782
  }
3767
3783
  }
@@ -4604,7 +4620,7 @@ function ChartReport()
4604
4620
 
4605
4621
  var textWidth=this.Canvas.measureText(text).width+1;
4606
4622
  var bClip=false;
4607
- if (textWidth>=width)
4623
+ if (textWidth>=width) //长度超过单元格 裁剪
4608
4624
  {
4609
4625
  this.Canvas.save();
4610
4626
  bClip=true;
@@ -4614,6 +4630,16 @@ function ChartReport()
4614
4630
  this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
4615
4631
  //this.Canvas.stroke(); //调试用
4616
4632
  this.Canvas.clip();
4633
+
4634
+ if (this.TextOverflowStyle==1)
4635
+ {
4636
+ var count=text.length+5;
4637
+ text="";
4638
+ for(var i=0;i<count;++i)
4639
+ {
4640
+ text+="#";
4641
+ }
4642
+ }
4617
4643
  }
4618
4644
 
4619
4645
  this.Canvas.textBaseline="middle";
@@ -62594,6 +62594,7 @@ function ChartDrawPriceLineV2()
62594
62594
  var text=price.toFixed(2);
62595
62595
  var textWidth=this.Canvas.measureText(text).width+2*offset;
62596
62596
 
62597
+ var centerPoint=null;
62597
62598
  if (this.IsHScreen)
62598
62599
  {
62599
62600
  var position=this.TextPosition[1];
@@ -62644,6 +62645,8 @@ function ChartDrawPriceLineV2()
62644
62645
  this.Canvas.fillText(this.Title,0,0);
62645
62646
  this.Canvas.restore();
62646
62647
  }
62648
+
62649
+ centerPoint={ X:ptStart.X, Y:ptStart.Y+(ptEnd.Y-ptStart.Y)/2 }; //中心点
62647
62650
  }
62648
62651
  else
62649
62652
  {
@@ -62688,9 +62691,11 @@ function ChartDrawPriceLineV2()
62688
62691
  this.Canvas.fillStyle=this.TextColor;
62689
62692
  this.Canvas.fillText(this.Title, rtTitle.Left+1*pixelTatio, yText);
62690
62693
  }
62694
+
62695
+ centerPoint={ X:ptStart.X+(ptEnd.X-ptStart.X)/2, Y:ptStart.Y }; //中心点
62691
62696
  }
62692
62697
 
62693
-
62698
+ if (centerPoint) this.DrawPoint([centerPoint]);
62694
62699
  }
62695
62700
 
62696
62701
  this.DrawPrice=function()
@@ -73572,28 +73577,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73572
73577
  //{ Type: 0=普通坐标 1=百分比坐标 (右边坐标刻度) 2=对数对标 3=等比坐标, IsReverse:是否反转坐标 }
73573
73578
  this.ChangeCoordinateType=function(obj)
73574
73579
  {
73575
- if (!this.Frame && !this.Frame.SubFrame) return;
73576
- if (!this.Frame.SubFrame.length) return;
73580
+ if (!this.Frame) return;
73581
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
73582
+ if (!this.Frame.SubFrame[0]) return;
73577
73583
 
73584
+ var frame=this.Frame.SubFrame[0].Frame;
73578
73585
  if (IFrameSplitOperator.IsNumber(obj)) //老版本
73579
73586
  {
73580
73587
  var type=obj;
73581
73588
  if (type==2) //反转坐标
73582
73589
  {
73583
- this.Frame.SubFrame[0].Frame.CoordinateType=1;
73590
+ frame.CoordinateType=1;
73584
73591
  }
73585
73592
  else if(type==1)
73586
73593
  {
73587
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=type;
73594
+ frame.YSplitOperator.CoordinateType=type;
73588
73595
  }
73589
73596
  else if (type==0)
73590
73597
  {
73591
- this.Frame.SubFrame[0].Frame.CoordinateType=0;
73592
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=0;
73598
+ frame.CoordinateType=0;
73599
+ frame.YSplitOperator.CoordinateType=0;
73593
73600
  }
73594
73601
  else if (type==3) //对数坐标
73595
73602
  {
73596
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=2;
73603
+ frame.Frame.YSplitOperator.CoordinateType=2;
73597
73604
  }
73598
73605
  else
73599
73606
  {
@@ -73602,11 +73609,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73602
73609
  }
73603
73610
  else
73604
73611
  {
73605
- if (obj.Type>=0 && obj.Type<=5) this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=obj.Type;
73606
- if (obj.IsReverse===true) this.Frame.SubFrame[0].Frame.CoordinateType=1;
73607
- else if (obj.IsReverse==false) this.Frame.SubFrame[0].Frame.CoordinateType=0;
73612
+ if (obj.Type>=0 && obj.Type<=5) frame.YSplitOperator.CoordinateType=obj.Type;
73613
+ if (obj.IsReverse===true) frame.CoordinateType=1;
73614
+ else if (obj.IsReverse==false) frame.CoordinateType=0;
73608
73615
  }
73609
73616
 
73617
+ //请求缓存的最大最小值
73618
+ frame.YMaxMin.Max=null;
73619
+ frame.YMaxMin.Min=null;
73620
+
73610
73621
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
73611
73622
  this.Frame.SetSizeChage(true);
73612
73623
  this.Draw();
@@ -122392,6 +122403,12 @@ function JSReportChart(divElement)
122392
122403
  if (IFrameSplitOperator.IsNumber(item.Sort)) chart.SortInfo.Sort=item.Sort;
122393
122404
  }
122394
122405
 
122406
+ var reportChart=chart.GetReportChart();
122407
+ if (reportChart)
122408
+ {
122409
+ if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
122410
+ }
122411
+
122395
122412
  this.SetChartBorder(chart, option);
122396
122413
 
122397
122414
  //是否自动更新
@@ -125494,6 +125511,7 @@ function ChartReport()
125494
125511
  this.VScrollbar;
125495
125512
 
125496
125513
  this.GlobalOption;
125514
+ this.TextOverflowStyle=0; //输出内容比单元格长度大 0=裁剪 1=输出"####"
125497
125515
 
125498
125516
  //涨跌颜色
125499
125517
  this.UpColor=g_JSChartResource.Report.UpTextColor;
@@ -125691,6 +125709,7 @@ function ChartReport()
125691
125709
  if (item.Title) colItem.Title=item.Title;
125692
125710
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
125693
125711
  if (item.TextColor) colItem.TextColor=item.TextColor;
125712
+ if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
125694
125713
  if (item.MaxText) colItem.MaxText=item.MaxText;
125695
125714
  if (item.ID) colItem.ID=item.ID;
125696
125715
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
@@ -126036,6 +126055,8 @@ function ChartReport()
126036
126055
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126037
126056
  var x=textLeft+this.HeaderMergin.Left;
126038
126057
 
126058
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126059
+
126039
126060
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126040
126061
  {
126041
126062
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126045,6 +126066,8 @@ function ChartReport()
126045
126066
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126046
126067
  }
126047
126068
 
126069
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126070
+
126048
126071
  textLeft+=item.Width;
126049
126072
  }
126050
126073
 
@@ -126055,6 +126078,8 @@ function ChartReport()
126055
126078
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126056
126079
  var x=textLeft+this.HeaderMergin.Left;
126057
126080
 
126081
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126082
+
126058
126083
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126059
126084
  {
126060
126085
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126064,6 +126089,8 @@ function ChartReport()
126064
126089
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126065
126090
  }
126066
126091
 
126092
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126093
+
126067
126094
  textLeft+=item.Width;
126068
126095
  }
126069
126096
  }
@@ -126906,7 +126933,7 @@ function ChartReport()
126906
126933
 
126907
126934
  var textWidth=this.Canvas.measureText(text).width+1;
126908
126935
  var bClip=false;
126909
- if (textWidth>=width)
126936
+ if (textWidth>=width) //长度超过单元格 裁剪
126910
126937
  {
126911
126938
  this.Canvas.save();
126912
126939
  bClip=true;
@@ -126916,6 +126943,16 @@ function ChartReport()
126916
126943
  this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
126917
126944
  //this.Canvas.stroke(); //调试用
126918
126945
  this.Canvas.clip();
126946
+
126947
+ if (this.TextOverflowStyle==1)
126948
+ {
126949
+ var count=text.length+5;
126950
+ text="";
126951
+ for(var i=0;i<count;++i)
126952
+ {
126953
+ text+="#";
126954
+ }
126955
+ }
126919
126956
  }
126920
126957
 
126921
126958
  this.Canvas.textBaseline="middle";
@@ -131453,7 +131490,7 @@ function ScrollBarBGChart()
131453
131490
 
131454
131491
 
131455
131492
 
131456
- var HQCHART_VERSION="1.1.13113";
131493
+ var HQCHART_VERSION="1.1.13122";
131457
131494
 
131458
131495
  function PrintHQChartVersion()
131459
131496
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13113";
8
+ var HQCHART_VERSION="1.1.13122";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -62638,6 +62638,7 @@ function ChartDrawPriceLineV2()
62638
62638
  var text=price.toFixed(2);
62639
62639
  var textWidth=this.Canvas.measureText(text).width+2*offset;
62640
62640
 
62641
+ var centerPoint=null;
62641
62642
  if (this.IsHScreen)
62642
62643
  {
62643
62644
  var position=this.TextPosition[1];
@@ -62688,6 +62689,8 @@ function ChartDrawPriceLineV2()
62688
62689
  this.Canvas.fillText(this.Title,0,0);
62689
62690
  this.Canvas.restore();
62690
62691
  }
62692
+
62693
+ centerPoint={ X:ptStart.X, Y:ptStart.Y+(ptEnd.Y-ptStart.Y)/2 }; //中心点
62691
62694
  }
62692
62695
  else
62693
62696
  {
@@ -62732,9 +62735,11 @@ function ChartDrawPriceLineV2()
62732
62735
  this.Canvas.fillStyle=this.TextColor;
62733
62736
  this.Canvas.fillText(this.Title, rtTitle.Left+1*pixelTatio, yText);
62734
62737
  }
62738
+
62739
+ centerPoint={ X:ptStart.X+(ptEnd.X-ptStart.X)/2, Y:ptStart.Y }; //中心点
62735
62740
  }
62736
62741
 
62737
-
62742
+ if (centerPoint) this.DrawPoint([centerPoint]);
62738
62743
  }
62739
62744
 
62740
62745
  this.DrawPrice=function()
@@ -73616,28 +73621,30 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73616
73621
  //{ Type: 0=普通坐标 1=百分比坐标 (右边坐标刻度) 2=对数对标 3=等比坐标, IsReverse:是否反转坐标 }
73617
73622
  this.ChangeCoordinateType=function(obj)
73618
73623
  {
73619
- if (!this.Frame && !this.Frame.SubFrame) return;
73620
- if (!this.Frame.SubFrame.length) return;
73624
+ if (!this.Frame) return;
73625
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return;
73626
+ if (!this.Frame.SubFrame[0]) return;
73621
73627
 
73628
+ var frame=this.Frame.SubFrame[0].Frame;
73622
73629
  if (IFrameSplitOperator.IsNumber(obj)) //老版本
73623
73630
  {
73624
73631
  var type=obj;
73625
73632
  if (type==2) //反转坐标
73626
73633
  {
73627
- this.Frame.SubFrame[0].Frame.CoordinateType=1;
73634
+ frame.CoordinateType=1;
73628
73635
  }
73629
73636
  else if(type==1)
73630
73637
  {
73631
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=type;
73638
+ frame.YSplitOperator.CoordinateType=type;
73632
73639
  }
73633
73640
  else if (type==0)
73634
73641
  {
73635
- this.Frame.SubFrame[0].Frame.CoordinateType=0;
73636
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=0;
73642
+ frame.CoordinateType=0;
73643
+ frame.YSplitOperator.CoordinateType=0;
73637
73644
  }
73638
73645
  else if (type==3) //对数坐标
73639
73646
  {
73640
- this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=2;
73647
+ frame.Frame.YSplitOperator.CoordinateType=2;
73641
73648
  }
73642
73649
  else
73643
73650
  {
@@ -73646,11 +73653,15 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
73646
73653
  }
73647
73654
  else
73648
73655
  {
73649
- if (obj.Type>=0 && obj.Type<=5) this.Frame.SubFrame[0].Frame.YSplitOperator.CoordinateType=obj.Type;
73650
- if (obj.IsReverse===true) this.Frame.SubFrame[0].Frame.CoordinateType=1;
73651
- else if (obj.IsReverse==false) this.Frame.SubFrame[0].Frame.CoordinateType=0;
73656
+ if (obj.Type>=0 && obj.Type<=5) frame.YSplitOperator.CoordinateType=obj.Type;
73657
+ if (obj.IsReverse===true) frame.CoordinateType=1;
73658
+ else if (obj.IsReverse==false) frame.CoordinateType=0;
73652
73659
  }
73653
73660
 
73661
+ //请求缓存的最大最小值
73662
+ frame.YMaxMin.Max=null;
73663
+ frame.YMaxMin.Min=null;
73664
+
73654
73665
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
73655
73666
  this.Frame.SetSizeChage(true);
73656
73667
  this.Draw();
@@ -122436,6 +122447,12 @@ function JSReportChart(divElement)
122436
122447
  if (IFrameSplitOperator.IsNumber(item.Sort)) chart.SortInfo.Sort=item.Sort;
122437
122448
  }
122438
122449
 
122450
+ var reportChart=chart.GetReportChart();
122451
+ if (reportChart)
122452
+ {
122453
+ if (IFrameSplitOperator.IsNumber(option.TextOverflowStyle)) reportChart.TextOverflowStyle=option.TextOverflowStyle;
122454
+ }
122455
+
122439
122456
  this.SetChartBorder(chart, option);
122440
122457
 
122441
122458
  //是否自动更新
@@ -125538,6 +125555,7 @@ function ChartReport()
125538
125555
  this.VScrollbar;
125539
125556
 
125540
125557
  this.GlobalOption;
125558
+ this.TextOverflowStyle=0; //输出内容比单元格长度大 0=裁剪 1=输出"####"
125541
125559
 
125542
125560
  //涨跌颜色
125543
125561
  this.UpColor=g_JSChartResource.Report.UpTextColor;
@@ -125735,6 +125753,7 @@ function ChartReport()
125735
125753
  if (item.Title) colItem.Title=item.Title;
125736
125754
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
125737
125755
  if (item.TextColor) colItem.TextColor=item.TextColor;
125756
+ if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
125738
125757
  if (item.MaxText) colItem.MaxText=item.MaxText;
125739
125758
  if (item.ID) colItem.ID=item.ID;
125740
125759
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
@@ -126080,6 +126099,8 @@ function ChartReport()
126080
126099
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126081
126100
  var x=textLeft+this.HeaderMergin.Left;
126082
126101
 
126102
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126103
+
126083
126104
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126084
126105
  {
126085
126106
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126089,6 +126110,8 @@ function ChartReport()
126089
126110
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126090
126111
  }
126091
126112
 
126113
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126114
+
126092
126115
  textLeft+=item.Width;
126093
126116
  }
126094
126117
 
@@ -126099,6 +126122,8 @@ function ChartReport()
126099
126122
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126100
126123
  var x=textLeft+this.HeaderMergin.Left;
126101
126124
 
126125
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126126
+
126102
126127
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126103
126128
  {
126104
126129
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126108,6 +126133,8 @@ function ChartReport()
126108
126133
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126109
126134
  }
126110
126135
 
126136
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126137
+
126111
126138
  textLeft+=item.Width;
126112
126139
  }
126113
126140
  }
@@ -126950,7 +126977,7 @@ function ChartReport()
126950
126977
 
126951
126978
  var textWidth=this.Canvas.measureText(text).width+1;
126952
126979
  var bClip=false;
126953
- if (textWidth>=width)
126980
+ if (textWidth>=width) //长度超过单元格 裁剪
126954
126981
  {
126955
126982
  this.Canvas.save();
126956
126983
  bClip=true;
@@ -126960,6 +126987,16 @@ function ChartReport()
126960
126987
  this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
126961
126988
  //this.Canvas.stroke(); //调试用
126962
126989
  this.Canvas.clip();
126990
+
126991
+ if (this.TextOverflowStyle==1)
126992
+ {
126993
+ var count=text.length+5;
126994
+ text="";
126995
+ for(var i=0;i<count;++i)
126996
+ {
126997
+ text+="#";
126998
+ }
126999
+ }
126963
127000
  }
126964
127001
 
126965
127002
  this.Canvas.textBaseline="middle";
@@ -134017,7 +134054,7 @@ function HQChartScriptWorker()
134017
134054
 
134018
134055
 
134019
134056
 
134020
- var HQCHART_VERSION="1.1.13113";
134057
+ var HQCHART_VERSION="1.1.13122";
134021
134058
 
134022
134059
  function PrintHQChartVersion()
134023
134060
  {