hqchart 1.1.13110 → 1.1.13120

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.
@@ -1796,7 +1796,7 @@ for(var i=0;i<this.Frame.SubFrame.length;++i){var subFrame=this.Frame.SubFrame[i
1796
1796
  for(var i in this.Frame.SubFrame){var subFrame=this.Frame.SubFrame[i];for(var j in subFrame.OverlayIndex){var overlayItem=subFrame.OverlayIndex[j];for(var k in overlayItem.ChartPaint){var item=overlayItem.ChartPaint[k];if(!item.Data)continue;item.Data.DataOffset=data.DataOffset;}}}};this.GetMoveOneStepWidth=function(){if(IFrameSplitOperator.IsPlusNumber(this.StepPixel))return this.StepPixel;var pixelRatio=GetDevicePixelRatio();var mainFrame=this.Frame.SubFrame[0].Frame;var dataWidth=mainFrame.DataWidth;var distanceWidth=mainFrame.DistanceWidth;var oneStepWidth=this.StepPixel;var oneStepWidth=(dataWidth+distanceWidth)/pixelRatio;if(oneStepWidth<1)oneStepWidth=1;return oneStepWidth;};this.DataMove=function(step,isLeft){var oneStepWidth=this.GetMoveOneStepWidth();var moveStep=step;step=parseInt(step/oneStepWidth);//除以4个像素
1797
1797
  if(step<=0)return false;var data=null;if(!this.Frame.Data)data=this.Frame.Data;else data=this.Frame.SubFrame[0].Frame.Data;if(!data)return false;var xPointcount=0;if(this.Frame.XPointCount)xPointcount=this.Frame.XPointCount;else xPointcount=this.Frame.SubFrame[0].Frame.XPointCount;if(!xPointcount)return false;if(this.Frame.SubFrame&&this.Frame.SubFrame.length>0&&this.Frame.SubFrame[0].Frame){var fristFrame=this.Frame.SubFrame[0].Frame;if(fristFrame.DataWidth<=1||fristFrame.DistanceWidth<=1)//K线在缩放很小的时候 移动加速
1798
1798
  {if(IFrameSplitOperator.IsPlusNumber(this.StepPixel))step=parseInt(moveStep)*this.StepPixel;}}if(isLeft)//-->
1799
- {if(this.RightSpaceCount>0){if(xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount-1)return false;data.DataOffset+=step;if(data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)data.DataOffset=data.Data.length-(xPointcount-this.RightSpaceCount);}else{if(xPointcount+data.DataOffset>=data.Data.length)return false;data.DataOffset+=step;if(data.DataOffset+xPointcount>=data.Data.length)data.DataOffset=data.Data.length-xPointcount;}return true;}else//<--
1799
+ {if(this.RightSpaceCount>0){if(xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount)return false;data.DataOffset+=step;if(data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)data.DataOffset=data.Data.length-(xPointcount-this.RightSpaceCount);}else{if(xPointcount+data.DataOffset>=data.Data.length)return false;data.DataOffset+=step;if(data.DataOffset+xPointcount>=data.Data.length)data.DataOffset=data.Data.length-xPointcount;}return true;}else//<--
1800
1800
  {if(data.DataOffset<=0)return false;data.DataOffset-=step;if(data.DataOffset<0)data.DataOffset=0;return true;}};this.XCoordinateZoom=function(step,isMoveLeft){var oneStepWidth=this.GetMoveOneStepWidth();var moveStep=step;step=parseInt(step/oneStepWidth);//除以4个像素
1801
1801
  if(step<=0)return false;return this.Frame.XCoordinateZoom(isMoveLeft);};//获取鼠标在当前子窗口id
1802
1802
  this.GetSubFrameIndex=function(x,y){if(!this.Frame.SubFrame||this.Frame.SubFrame.length<=0)return-1;for(var i in this.Frame.SubFrame){var frame=this.Frame.SubFrame[i].Frame;var left=frame.ChartBorder.GetLeft();var top=frame.ChartBorder.GetTop();var height=frame.ChartBorder.GetHeight();var width=frame.ChartBorder.GetWidth();this.Canvas.beginPath();this.Canvas.rect(left,top,width,height);if(this.Canvas.isPointInPath(x,y))return parseInt(i);}return 0;};//根据X坐标获取数据索引
@@ -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();//调整坐标最大 最小值
@@ -12382,7 +12385,7 @@ this.SelectedColor=g_JSChartResource.Report.SelectedColor;//选中行
12382
12385
  //表头配置
12383
12386
  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
12387
  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=远程排序
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=远程排序
12386
12389
  {colItem.SortType=[1,2];//默认 降序 ,升序
12387
12390
  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
12391
  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 +12407,7 @@ this.UpdateCacheData=function(){this.RectClient.Left=this.ChartBorder.GetLeft();
12404
12407
  {if(recalculate)this.CalculateSize();var size=this.RowCount;return size;};this.GetCurrentPageStatus=function()//{ Start:起始索引, End:结束索引(数据), PageSize:页面可以显示几条记录, IsEnd:是否是最后一页, IsSinglePage:是否只有一页数据}
12405
12408
  {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
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;//固定列
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;//横线
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;//横线
12408
12411
  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
12412
  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
12413
  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;//选中行
@@ -13031,7 +13034,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13031
13034
  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
13035
  * 版本信息输出
13033
13036
  *
13034
- */var HQCHART_VERSION="1.1.13109";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();//把给外界调用的方法暴露出来
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();//把给外界调用的方法暴露出来
13035
13038
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13036
13039
  // BaseIndex:BaseIndex,
13037
13040
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13110",
3
+ "version": "1.1.13120",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -7264,7 +7264,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7264
7264
  {
7265
7265
  if (this.RightSpaceCount>0)
7266
7266
  {
7267
- if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount-1) return false;
7267
+ if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount) return false;
7268
7268
  data.DataOffset+=step;
7269
7269
 
7270
7270
  if (data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)
@@ -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();
@@ -3389,6 +3389,7 @@ function ChartReport()
3389
3389
  if (item.Title) colItem.Title=item.Title;
3390
3390
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
3391
3391
  if (item.TextColor) colItem.TextColor=item.TextColor;
3392
+ if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
3392
3393
  if (item.MaxText) colItem.MaxText=item.MaxText;
3393
3394
  if (item.ID) colItem.ID=item.ID;
3394
3395
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
@@ -3734,6 +3735,8 @@ function ChartReport()
3734
3735
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
3735
3736
  var x=textLeft+this.HeaderMergin.Left;
3736
3737
 
3738
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
3739
+
3737
3740
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
3738
3741
  {
3739
3742
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -3743,6 +3746,8 @@ function ChartReport()
3743
3746
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
3744
3747
  }
3745
3748
 
3749
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
3750
+
3746
3751
  textLeft+=item.Width;
3747
3752
  }
3748
3753
 
@@ -3753,6 +3758,8 @@ function ChartReport()
3753
3758
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
3754
3759
  var x=textLeft+this.HeaderMergin.Left;
3755
3760
 
3761
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
3762
+
3756
3763
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
3757
3764
  {
3758
3765
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -3762,6 +3769,8 @@ function ChartReport()
3762
3769
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
3763
3770
  }
3764
3771
 
3772
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
3773
+
3765
3774
  textLeft+=item.Width;
3766
3775
  }
3767
3776
  }
@@ -11156,7 +11156,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11156
11156
  {
11157
11157
  if (this.RightSpaceCount>0)
11158
11158
  {
11159
- if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount-1) return false;
11159
+ if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount) return false;
11160
11160
  data.DataOffset+=step;
11161
11161
 
11162
11162
  if (data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)
@@ -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();
@@ -125691,6 +125702,7 @@ function ChartReport()
125691
125702
  if (item.Title) colItem.Title=item.Title;
125692
125703
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
125693
125704
  if (item.TextColor) colItem.TextColor=item.TextColor;
125705
+ if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
125694
125706
  if (item.MaxText) colItem.MaxText=item.MaxText;
125695
125707
  if (item.ID) colItem.ID=item.ID;
125696
125708
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
@@ -126036,6 +126048,8 @@ function ChartReport()
126036
126048
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126037
126049
  var x=textLeft+this.HeaderMergin.Left;
126038
126050
 
126051
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126052
+
126039
126053
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126040
126054
  {
126041
126055
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126045,6 +126059,8 @@ function ChartReport()
126045
126059
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126046
126060
  }
126047
126061
 
126062
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126063
+
126048
126064
  textLeft+=item.Width;
126049
126065
  }
126050
126066
 
@@ -126055,6 +126071,8 @@ function ChartReport()
126055
126071
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126056
126072
  var x=textLeft+this.HeaderMergin.Left;
126057
126073
 
126074
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126075
+
126058
126076
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126059
126077
  {
126060
126078
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126064,6 +126082,8 @@ function ChartReport()
126064
126082
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126065
126083
  }
126066
126084
 
126085
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126086
+
126067
126087
  textLeft+=item.Width;
126068
126088
  }
126069
126089
  }
@@ -131453,7 +131473,7 @@ function ScrollBarBGChart()
131453
131473
 
131454
131474
 
131455
131475
 
131456
- var HQCHART_VERSION="1.1.13109";
131476
+ var HQCHART_VERSION="1.1.13119";
131457
131477
 
131458
131478
  function PrintHQChartVersion()
131459
131479
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13109";
8
+ var HQCHART_VERSION="1.1.13119";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -11200,7 +11200,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11200
11200
  {
11201
11201
  if (this.RightSpaceCount>0)
11202
11202
  {
11203
- if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount-1) return false;
11203
+ if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount) return false;
11204
11204
  data.DataOffset+=step;
11205
11205
 
11206
11206
  if (data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)
@@ -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();
@@ -125735,6 +125746,7 @@ function ChartReport()
125735
125746
  if (item.Title) colItem.Title=item.Title;
125736
125747
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
125737
125748
  if (item.TextColor) colItem.TextColor=item.TextColor;
125749
+ if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
125738
125750
  if (item.MaxText) colItem.MaxText=item.MaxText;
125739
125751
  if (item.ID) colItem.ID=item.ID;
125740
125752
  if (IFrameSplitOperator.IsNumber(item.Sort)) colItem.Sort=item.Sort;
@@ -126080,6 +126092,8 @@ function ChartReport()
126080
126092
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126081
126093
  var x=textLeft+this.HeaderMergin.Left;
126082
126094
 
126095
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126096
+
126083
126097
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126084
126098
  {
126085
126099
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126089,6 +126103,8 @@ function ChartReport()
126089
126103
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126090
126104
  }
126091
126105
 
126106
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126107
+
126092
126108
  textLeft+=item.Width;
126093
126109
  }
126094
126110
 
@@ -126099,6 +126115,8 @@ function ChartReport()
126099
126115
  var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
126100
126116
  var x=textLeft+this.HeaderMergin.Left;
126101
126117
 
126118
+ if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
126119
+
126102
126120
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
126103
126121
  {
126104
126122
  this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
@@ -126108,6 +126126,8 @@ function ChartReport()
126108
126126
  this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
126109
126127
  }
126110
126128
 
126129
+ if (item.HeaderColor) this.Canvas.fillStyle=this.HeaderColor;
126130
+
126111
126131
  textLeft+=item.Width;
126112
126132
  }
126113
126133
  }
@@ -134017,7 +134037,7 @@ function HQChartScriptWorker()
134017
134037
 
134018
134038
 
134019
134039
 
134020
- var HQCHART_VERSION="1.1.13109";
134040
+ var HQCHART_VERSION="1.1.13119";
134021
134041
 
134022
134042
  function PrintHQChartVersion()
134023
134043
  {