hqchart 1.1.15347 → 1.1.15352

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.
@@ -1187,7 +1187,7 @@ this.CreateKLineChartContainer=function(option){var _this=this;var chart=null;if
1187
1187
  if(IFrameSplitOperator.IsBool(option.IsShowRightMenu))chart.IsShowRightMenu=option.IsShowRightMenu;if(option.ScriptError)chart.ScriptErrorCallback=option.ScriptError;if(option.EnableScrollUpDown==true)chart.EnableScrollUpDown=option.EnableScrollUpDown;if(option.DisableMouse==true)chart.DisableMouse=option.DisableMouse;if(option.TouchMoveMinAngle)chart.TouchMoveMinAngle=option.TouchMoveMinAngle;if(option.EnableZoomUpDown)chart.EnableZoomUpDown=option.EnableZoomUpDown;if(IFrameSplitOperator.IsString(option.SplashTitle))chart.LoadDataSplashTitle=option.SplashTitle;if(IFrameSplitOperator.IsBool(option.EnableZoomIndexWindow))chart.EnableZoomIndexWindow=option.EnableZoomIndexWindow;if(IFrameSplitOperator.IsBool(option.IsDrawPictureXY))chart.IsDrawPictureXY=option.IsDrawPictureXY;if(IFrameSplitOperator.IsNumber(option.CtrlMoveStep))chart.CtrlMoveStep=option.CtrlMoveStep;if(IFrameSplitOperator.IsNumber(option.ShiftMoveStep))chart.ShiftMoveStep=option.ShiftMoveStep;if(IFrameSplitOperator.IsBool(option.EnableIndexChartDrag))chart.EnableIndexChartDrag=option.EnableIndexChartDrag;if(IFrameSplitOperator.IsBool(option.EnableVerifyRecvData))chart.EnableVerifyRecvData=option.EnableVerifyRecvData;if(option.GlobalOption){var item=option.GlobalOption;if(IFrameSplitOperator.IsBool(item.IsValueFullRange))chart.GlobalOption.IsValueFullRange=item.IsValueFullRange;if(IFrameSplitOperator.IsBool(item.EnableXShortDate))chart.GlobalOption.EnableXShortDate=item.EnableXShortDate;if(item.SelectedBorder){var subItem=item.SelectedBorder;if(IFrameSplitOperator.IsNumber(subItem.Mode))chart.GlobalOption.SelectedBorder.Mode=subItem.Mode;}}if(option.EnableYDrag){var item=option.EnableYDrag;if(IFrameSplitOperator.IsBool(item.Left))chart.EnableYDrag.Left=item.Left;if(IFrameSplitOperator.IsBool(item.Right))chart.EnableYDrag.Right=item.Right;if(IFrameSplitOperator.IsBool(item.Wheel))chart.EnableYDrag.Wheel=item.Wheel;if(IFrameSplitOperator.IsNumber(item.WheelYMove))chart.EnableYDrag.WheelYMove=item.WheelYMove;}if(option.EnableXDrag){var item=option.EnableXDrag;if(IFrameSplitOperator.IsBool(item.Bottom))chart.EnableXDrag.Bottom=item.Bottom;if(item.LButton&&IFrameSplitOperator.IsNumber(item.LButton.Type))chart.EnableXDrag.LButton.Type=item.LButton.Type;if(item.RButton&&IFrameSplitOperator.IsNumber(item.RButton.Type))chart.EnableXDrag.RButton.Type=item.RButton.Type;}if(option.KLineTooltip){var item=option.KLineTooltip;if(IFrameSplitOperator.IsBool(item.Enable))chart.KLineTooltipConfig.Enable=item.Enable;if(IFrameSplitOperator.IsBool(item.EnableKeyDown))chart.KLineTooltipConfig.EnableKeyDown=item.EnableKeyDown;}if(option.KLine)//k线图的属性设置
1188
1188
  {var item=option.KLine;if(option.KLine.DragMode>=0)chart.DragMode=option.KLine.DragMode;if(option.KLine.Right>=0)chart.Right=option.KLine.Right;if(option.KLine.Period>=0)chart.Period=option.KLine.Period;if(option.KLine.MaxReqeustDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxReqeustDataCount;//兼容老版本
1189
1189
  if(option.KLine.MaxRequestDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;if(option.KLine.Info&&option.KLine.Info.length>0)chart.SetKLineInfo(option.KLine.Info,false);if(IFrameSplitOperator.IsBool(item.IsShowTooltip))chart.IsShowTooltip=item.IsShowTooltip;if(option.KLine.MaxRequestMinuteDayCount>0)chart.MaxRequestMinuteDayCount=option.KLine.MaxRequestMinuteDayCount;if(option.KLine.DrawType)chart.KLineDrawType=option.KLine.DrawType;if(option.KLine.FirstShowDate>19910101)chart.CustomShow={Date:option.KLine.FirstShowDate,PageSize:option.KLine.PageSize};//!!已弃用 新的格式"CustomShow"
1190
- if(option.KLine.RightSpaceCount>0)chart.RightSpaceCount=option.KLine.RightSpaceCount;if(option.KLine.ZoomType>0)chart.ZoomType=option.KLine.ZoomType;if(option.KLine.DataWidth>=1)chart.KLineSize={DataWidth:option.KLine.DataWidth};if(IFrameSplitOperator.IsNumber(option.KLine.RightFormula))chart.RightFormula=option.KLine.RightFormula;}//自定义显示位置
1190
+ if(option.KLine.RightSpaceCount>0)chart.RightSpaceCount=option.KLine.RightSpaceCount;if(option.KLine.ZoomType>0)chart.ZoomType=option.KLine.ZoomType;if(IFrameSplitOperator.IsNumber(option.KLine.PageSizeV2))chart.KLineSize={PageSize:option.KLine.PageSizeV2};if(option.KLine.DataWidth>=1)chart.KLineSize={DataWidth:option.KLine.DataWidth};if(IFrameSplitOperator.IsNumber(option.KLine.RightFormula))chart.RightFormula=option.KLine.RightFormula;}//自定义显示位置
1191
1191
  if(option.CustomShow&&IFrameSplitOperator.IsPlusNumber(option.CustomShow.Date)){var item=option.CustomShow;chart.CustomShow={Date:item.Date};if(IFrameSplitOperator.IsNumber(item.Time))chart.CustomShow.Time=item.Time;if(IFrameSplitOperator.IsPlusNumber(item.PageSize))chart.CustomShow.PageSize=item.PageSize;}if(option.EnableFlowCapital){var item=option.EnableFlowCapital;if(item.BIT==true)chart.EnableFlowCapital.BIT=item.BIT;}if(IFrameSplitOperator.IsBool(option.EnableBorderDrag)){chart.EnableBorderDrag=option.EnableBorderDrag;}if(option.Page){if(option.Page.Day&&option.Page.Day.Enable==true)chart.Page.Day.Enable=true;if(option.Page.Minute&&option.Page.Minute.Enable==true)chart.Page.Minute.Enable=true;}if(option.DragDownload){if(option.DragDownload.Day&&option.DragDownload.Day.Enable==true)chart.DragDownload.Day.Enable=true;if(option.DragDownload.Minute&&option.DragDownload.Minute.Enable==true)chart.DragDownload.Minute.Enable=true;}if(option.ZoomDownload){if(option.ZoomDownload.Day&&IFrameSplitOperator.IsBool(option.ZoomDownload.Day.Enable))chart.ZoomDownload.Day.Enable=option.ZoomDownload.Day.Enable;if(option.ZoomDownload.Minute&&IFrameSplitOperator.IsBool(option.ZoomDownload.Minute.Enable))chart.ZoomDownload.Minute.Enable=option.ZoomDownload.Minute.Enable;}if(option.Language){var value=g_JSChartLocalization.GetLanguageID(option.Language);if(IFrameSplitOperator.IsNumber(value))chart.LanguageID=value;}if(option.SourceDatatLimit)chart.SetSourceDatatLimit(option.SourceDatatLimit);if(option.DrawPicture)//画图工具
1192
1192
  {if(option.DrawPicture.StorageKey&&chart.ChartDrawStorage)chart.ChartDrawStorage.SetKey(option.DrawPicture.StorageKey);}if(option.DrawTool)//画图工具
1193
1193
  {var item=option.DrawTool;if(chart.ChartDrawStorage){if(item.StorageKey)chart.ChartDrawStorage.SetKey(item.StorageKey);if(IFrameSplitOperator.IsBool(item.EnableCrossPeriod))chart.ChartDrawStorage.EnableCrossPeriod=item.EnableCrossPeriod;}}if(chart.ChartDrawStorage)chart.ChartDrawStorage.Load();if(option.KeyboardMove){var item=option.KeyboardMove;if(IFrameSplitOperator.IsPlusNumber(item.Delay))chart.KeyboardMove.Delay=item.Delay;if(IFrameSplitOperator.IsPlusNumber(item.PressTime))chart.KeyboardMove.PressTime=item.PressTime;}if(IFrameSplitOperator.IsNumber(option.StepPixel))chart.StepPixel=option.StepPixel;if(option.ZoomStepPixel>0)chart.ZoomStepPixel=option.ZoomStepPixel;if(option.IsApiPeriod==true)chart.IsApiPeriod=option.IsApiPeriod;//图形选中
@@ -4352,14 +4352,15 @@ this.RowHeightType=1;//0=均分 1=固定高度
4352
4352
  this.TextFontConfig=CloneData(g_JSChartResource.ChartKLineTable.TextFont);this.ItemMargin=CloneData(g_JSChartResource.ChartKLineTable.ItemMargin);this.CellWidth=12*GetDevicePixelRatio();this.TextFont;this.TextColor='rgb(0,0,0)';this.Style=0;//0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
4353
4353
  this.AryTableData=[];this.MapCache=null;//key=date/date-time value={ Date:, Time:, Data:[ ] }
4354
4354
  this.GetKValue=ChartData.GetKValue;this.AryCellRect=[];//保存单元格信息
4355
+ this.AryNameRect=[];//右侧行的名字
4355
4356
  this.SetOption=function(option){if(!option)return;if(option.BGColor)this.BGColor=option.BGColor;if(option.TextColor)this.TextColor=option.TextColor;if(option.BorderColor)this.BorderColor=option.BorderColor;if(IFrameSplitOperator.IsNumber(option.RowNamePosition))this.RowNamePosition=option.RowNamePosition;if(IFrameSplitOperator.IsNumber(option.RowHeightType))this.RowHeightType=option.RowHeightType;if(IFrameSplitOperator.IsNumber(option.Style))this.Style=option.Style;if(option.ItemMargin){var subItem=option.ItemMargin;if(IFrameSplitOperator.IsNumber(subItem.Left))this.ItemMargin.Left=subItem.Left;if(IFrameSplitOperator.IsNumber(subItem.Top))this.ItemMargin.Top=subItem.Top;if(IFrameSplitOperator.IsNumber(subItem.Bottom))this.ItemMargin.Bottom=subItem.Bottom;if(IFrameSplitOperator.IsNumber(subItem.Right))this.ItemMargin.Right=subItem.Right;if(IFrameSplitOperator.IsNumber(subItem.YOffset))this.ItemMargin.YOffset=subItem.YOffset;}if(option.TextFont){var subItem=option.TextFont;if(IFrameSplitOperator.IsNumber(subItem.FontMaxSize))this.TextFontConfig.FontMaxSize=subItem.FontMaxSize;if(subItem.Family)this.TextFontConfig.Family=subItem.Family;}if(IFrameSplitOperator.IsPlusNumber(option.CellWidth))this.CellWidth=option.CellWidth;};this.BuildCacheData=function(){var mapData=new _map2.default();this.MapCache=mapData;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData))return;for(var i=0;i<this.AryTableData.length;++i){var item=this.AryTableData[i];var key=this.BuildKey(item);mapData.set(key,item);}};//绘制背景色
4356
4357
  this.DrawBG=function(rtBG){if(!this.BGColor)return;this.Canvas.fillStyle=this.BGColor;if((this.Style===1||this.Style===2)&&this.RowHeightType==1){var height=this.RowCount*this.RowHeight;height=Math.min(rtBG.Height,height);this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-2,height);}else{this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-1,rtBG.Height);}};this.DrawBorder=function(rtBG){if(!this.BorderColor)return;var lineCount=30;if(this.Style===1||this.Style===2)lineCount=this.RowCount+1;this.Canvas.strokeStyle=this.BorderColor;var yLine=rtBG.Top;for(var i=0;i<lineCount;++i){this.Canvas.beginPath();this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));this.Canvas.lineTo(rtBG.Right,ToFixedPoint(yLine));this.Canvas.stroke();yLine+=this.RowHeight;if(yLine>rtBG.Bottom)break;}};//计算行高
4357
- this.CalculateRowHeight=function(rtBG){if(this.RowHeightType==1){this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMargin.Top+this.ItemMargin.Bottom;}else{this.RowHeight=rtBG.Height/this.RowCount;}};this.Draw=function(){this.AryCellRect=[];if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;//if (!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData)) return;
4358
+ this.CalculateRowHeight=function(rtBG){if(this.RowHeightType==1){this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMargin.Top+this.ItemMargin.Bottom;}else{this.RowHeight=rtBG.Height/this.RowCount;}};this.Draw=function(){this.AryCellRect=[];this.AryNameRect=[];if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;//if (!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData)) return;
4358
4359
  //if (!this.MapCache || this.MapCache.size<=0) return;
4359
4360
  var isHScreen=this.ChartFrame.IsHScreen===true;if(isHScreen)return;if(this.RowCount<=0)return;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;var border=this.ChartFrame.GetBorder();var height=border.Bottom-border.TopTitle;var xOffset=border.LeftEx+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var top=border.TopTitle;var bottom=border.Bottom;//绘制背景
4360
4361
  if(this.Style===1){var rtBG={Left:border.LeftEx,Top:border.TopTitle,Right:border.RightEx,Bottom:border.TopEx};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;}else if(this.Style===2){var rtBG={Left:border.LeftEx,Top:border.BottomEx,Right:border.RightEx,Bottom:border.Bottom};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;top=rtBG.Top;}else{var rtBG={Left:border.LeftEx,Top:top,Right:border.RightEx,Bottom:bottom};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;}this.CalculateRowHeight(rtBG);this.DrawBG(rtBG);var itemHeight=this.RowHeight;var itemWidth=dataWidth+distanceWidth;if(itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom>0)itemHeight=itemHeight-this.ItemMargin.Top-this.ItemMargin.Bottom;if(itemWidth-this.ItemMargin.Left-this.ItemMargin.Right>0)itemWidth=itemWidth-this.ItemMargin.Left-this.ItemMargin.Right;var font=this.GetDynamicTextFont(itemHeight,itemWidth);this.TextFont=font;this.Canvas.font=this.TextFont;var bMinute=this.IsMinuteFrame();var cellWidth=1;if(bMinute){cellWidth=(border.Right-border.Left)/this.ChartFrame.XPointCount;if(cellWidth<1)cellWidth=1;}for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var kItem=this.Data.Data[i];if(!kItem)continue;if(bMinute){var x=this.ChartFrame.GetXFromIndex(j);var left=x-cellWidth/2;var right=x+cellWidth/2;}else{var left=xOffset;var right=xOffset+dataWidth+distanceWidth;if(right>chartright)break;var x=left+(right-left)/2;if(x>chartright)break;}var bDrawName=false;if(j==0&&this.RowNamePosition===1)bDrawName=true;if(bDrawName)this.DrawRowName(top,bottom,left,right);var key=this.BuildKey(kItem);if(!this.MapCache.has(key))continue;var mapItem=this.MapCache.get(key);if(!bDrawName)this.DrawRow(mapItem,top,bottom,left,right);//绘制一列
4361
4362
  }if(this.RowNamePosition==3)this.DrawRightRowName(rtBG);this.DrawBorder(rtBG);};this.DrawRowName=function(top,bottom,left,right){if(!IFrameSplitOperator.IsNonEmptyArray(this.RowName))return;var x=left,y=top,width=right-left;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];var rtBG={Left:x,Top:y,Right:right,Height:this.RowHeight,Width:width};rtBG.Bottom=rtBG.Top+this.RowHeight;var yText=rtBG.Bottom-yOffset;if(item.Name&&rtBG.Width>10){this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;this.Canvas.textBaseline='bottom';if(item.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(item.Name,rtBG.Right-2,yText,width-4);}else if(item.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(item.Name,rtBG.Left+rtBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(item.Name,rtBG.Left+2,yText,width-4);}}y+=this.RowHeight;}};//绘制右侧行名
4362
- this.DrawRightRowName=function(rtBG){var border=this.ChartFrame.GetBorder();if(this.BGColor){if(this.Style===1){var height=this.RowCount*this.RowHeight;height=Math.min(rtBG.Height,height);var width=border.ChartWidth-rtBG.Right-2;var maxTextWidth=0;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];if(!item||!item.Name)continue;var textWidth=this.Canvas.measureText(item.Name).width;if(textWidth>maxTextWidth)maxTextWidth=textWidth;}if(maxTextWidth>0){maxTextWidth+=4;width=Math.min(width,maxTextWidth);}var rtRightBG={Left:rtBG.Right+1,Top:rtBG.Top+1,Width:width,Height:height};rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtRightBG.Left,rtRightBG.Top,rtRightBG.Width,rtRightBG.Height);}else{var rtRightBG={Left:border.RightEx,Top:border.Top,Right:border.ChartWidth,Bottom:border.Bottom};rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtRightBG.Left+1,rtRightBG.Top,rtRightBG.Width-2,rtRightBG.Height);}}var x=rtBG.Right,y=rtBG.Top;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];var rtBG={Left:x,Top:y,Right:border.ChartWidth,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+this.RowHeight;rtBG.Width=rtBG.Right-rtBG.Left;var yText=rtBG.Bottom-yOffset;if(rtBG.Bottom>border.Bottom)break;if(item.Name&&rtBG.Width>10){this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;this.Canvas.textBaseline='bottom';this.Canvas.textAlign='left';this.Canvas.fillText(item.Name,rtBG.Left+2,yText);}y+=this.RowHeight;}};this.DrawRow=function(data,top,bottom,left,right){if(!IFrameSplitOperator.IsNonEmptyArray(data.Data))return;var x=left,y=top,width=right-left;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<data.Data.length;++i,y+=this.RowHeight){var item=data.Data[i];if(!item)continue;var rtBG={Left:x,Top:y,Right:right,Height:this.RowHeight,Width:width};rtBG.Bottom=rtBG.Top+this.RowHeight;if(rtBG.Bottom>bottom)break;if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))//左右显示
4363
+ this.DrawRightRowName=function(rtBG){var border=this.ChartFrame.GetBorder();if(this.BGColor){if(this.Style===1){var height=this.RowCount*this.RowHeight;height=Math.min(rtBG.Height,height);var width=border.ChartWidth-rtBG.Right-2;var maxTextWidth=0;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];if(!item||!item.Name)continue;var textWidth=this.Canvas.measureText(item.Name).width;if(textWidth>maxTextWidth)maxTextWidth=textWidth;}if(maxTextWidth>0){maxTextWidth+=4;width=Math.min(width,maxTextWidth);}var rtRightBG={Left:rtBG.Right+1,Top:rtBG.Top+1,Width:width,Height:height};rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtRightBG.Left,rtRightBG.Top,rtRightBG.Width,rtRightBG.Height);}else{var rtRightBG={Left:border.RightEx,Top:border.Top,Right:border.ChartWidth,Bottom:border.Bottom};rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtRightBG.Left+1,rtRightBG.Top,rtRightBG.Width-2,rtRightBG.Height);}}var x=rtBG.Right,y=rtBG.Top;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<this.RowName.length;++i){var item=this.RowName[i];var rtBG={Left:x,Top:y,Right:border.ChartWidth,Height:this.RowHeight};rtBG.Bottom=rtBG.Top+this.RowHeight;rtBG.Width=rtBG.Right-rtBG.Left;var yText=rtBG.Bottom-yOffset;if(rtBG.Bottom>border.Bottom)break;if(item.Name&&rtBG.Width>10){this.Canvas.fillStyle=item.Color?item.Color:this.TextColor;this.Canvas.textBaseline='bottom';this.Canvas.textAlign='left';this.Canvas.fillText(item.Name,rtBG.Left+2,yText);this.AryNameRect.push({Rect:rtBG,Item:item,Index:i});}y+=this.RowHeight;}};this.DrawRow=function(data,top,bottom,left,right){if(!IFrameSplitOperator.IsNonEmptyArray(data.Data))return;var x=left,y=top,width=right-left;var yOffset=3;if(this.ItemMargin.YOffset)yOffset=this.ItemMargin.YOffset;for(var i=0;i<data.Data.length;++i,y+=this.RowHeight){var item=data.Data[i];if(!item)continue;var rtBG={Left:x,Top:y,Right:right,Height:this.RowHeight,Width:width};rtBG.Bottom=rtBG.Top+this.RowHeight;if(rtBG.Bottom>bottom)break;if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))//左右显示
4363
4364
  {var subCellWidth=rtBG.Width/item.AryText.length;var xCell=rtBG.Left;for(var j=0;j<item.AryText.length;++j){var subItem=item.AryText[j];var rtSubBG={Left:xCell,Top:rtBG.Top,Bottom:rtBG.Bottom,Width:subCellWidth,Height:rtBG.Height};rtSubBG.Right=rtSubBG.Left+rtSubBG.Width;if(subItem&&subItem.BGColor){this.Canvas.fillStyle=subItem.BGColor;this.Canvas.fillRect(rtSubBG.Left,rtSubBG.Top,rtSubBG.Width,rtSubBG.Height);}if(subItem&&subItem.Color&&subCellWidth>10){this.Canvas.fillStyle=subItem.Color;this.Canvas.textBaseline='bottom';var yText=rtSubBG.Bottom-yOffset;if(subItem.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(subItem.Text,rtSubBG.Right-2,yText,width-4);}else if(subItem.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(subItem.Text,rtSubBG.Left+rtSubBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(subItem.Text,rtSubBG.Left+2,yText,width-4);}}if(rtBG.Width>5){this.AryCellRect.push({Item:{Cell:item,Colunm:data,RowIndex:i,SubCell:subItem,SubIndex:j,Tooltip:subItem.Tooltip,Type:2},Rect:rtSubBG});}xCell+=subCellWidth;}}else{if(item.BGColor){this.Canvas.fillStyle=item.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(item.Text&&rtBG.Width>10){if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.TextColor;this.Canvas.textBaseline='bottom';var yText=rtBG.Bottom-yOffset;if(item.TextAlign=='right'){this.Canvas.textAlign='right';this.Canvas.fillText(item.Text,rtBG.Right-2,yText,width-4);}else if(item.TextAlign=='center'){this.Canvas.textAlign='center';this.Canvas.fillText(item.Text,rtBG.Left+rtBG.Width/2,yText,width-4);}else{this.Canvas.textAlign='left';this.Canvas.fillText(item.Text,rtBG.Left+2,yText,width-4);}}if(rtBG.Width>5){this.AryCellRect.push({Item:{Cell:item,Colunm:data,RowIndex:i,Tooltip:item.Tooltip,Type:1},Rect:rtBG});}}}};this.GetDynamicTextFont=function(cellHeight,width,fontOption){var fontSize=parseInt(cellHeight)-2;if(cellHeight<5)fontSize=parseInt(cellHeight);//高度太小了就不要上下间距了
4364
4365
  if(fontSize>this.TextFontConfig.FontMaxSize)fontSize=this.TextFontConfig.FontMaxSize;else if(fontSize<=0)fontSize=1;var font=this.FormatFontString(fontSize,this.TextFontConfig.Family,fontOption);return font;};this.FormatFontString=function(fontSize,family,option){var font;if(!option){font=fontSize+'px '+family;}else{if(option.Weight)font=option.Weight+' '+fontSize+'px '+family;}return font;};this.GetMaxMin=function(){return{Min:0,Max:this.RowCount};};this.GetTooltipData=function(x,y,tooltip){if(!this.IsShow)return false;for(var i=0;i<this.AryCellRect.length;++i){var item=this.AryCellRect[i];if(!item.Rect)continue;var rect=item.Rect;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom){var data=item.Item;JSConsole.Chart.Log('[ChartKLineTable::GetTooltipData] cell',item);tooltip.Data={Rect:item.Rect,Item:data};tooltip.ChartPaint=this;tooltip.Type=9;//ChartKLineTable
4365
4366
  return true;}}return false;};}//表格
@@ -8051,7 +8052,7 @@ var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;frame.XPointCount=xPoi
8051
8052
  this.CreateMainKLine=function(){var _this28=this;var kline=g_ChartPaintFactory.Create("ChartKLine");kline.Canvas=this.Canvas;kline.ChartBorder=this.Frame.SubFrame[0].Frame.ChartBorder;kline.ChartFrame=this.Frame.SubFrame[0].Frame;kline.Name="Main-KLine";kline.DrawType=this.KLineDrawType;kline.Identify="Main-KLine";kline.HQChart=this;kline.GetEventCallback=function(id){return _this28.GetEventCallback(id);};this.ChartPaint[0]=kline;this.TitlePaint[0]=new DynamicKLineTitlePainting();this.TitlePaint[0].Frame=this.Frame.SubFrame[0].Frame;this.TitlePaint[0].Canvas=this.Canvas;this.TitlePaint[0].OverlayChartPaint=this.OverlayChartPaint;//绑定叠加
8052
8053
  this.TitlePaint[0].LanguageID=this.LanguageID;this.TitlePaint[0].HQChart=this;this.TitlePaint[0].GetEventCallback=function(id){return _this28.GetEventCallback(id);};};this.BindKLineBreakPoint=function(data){var klineChart=this.ChartPaint[0];if(!klineChart)return;if(!IFrameSplitOperator.IsNonEmptyArray(data.AryBreakPoint))return;klineChart.AryBreakPoint=data.AryBreakPoint.slice();};//绑定主图K线数据
8053
8054
  this.BindMainData=function(hisData,showCount,chartOperator){var isShowAll=false;//全部显示
8054
- if(chartOperator&&chartOperator.IsShowAll===true)isShowAll=true;this.ChartPaint[0].Data=hisData;this.ChartPaint[0].Symbol=this.Symbol;if(this.KLineSize){if(!IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth)){showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;}else{var obj=this.Frame.SetDataWidth(this.KLineSize.DataWidth);showCount=obj.XPointCount-this.RightSpaceCount;this.KLineSize.DataWidth=null;}}for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(isShowAll)item.XPointCount=hisData.Data.length+this.RightSpaceCount;else item.XPointCount=showCount+this.RightSpaceCount;item.Data=this.ChartPaint[0].Data;item.XSplitOperator.Symbol=this.Symbol;item.XSplitOperator.Period=this.Period;}this.TitlePaint[0].Data=this.ChartPaint[0].Data;//动态标题
8055
+ if(chartOperator&&chartOperator.IsShowAll===true)isShowAll=true;this.ChartPaint[0].Data=hisData;this.ChartPaint[0].Symbol=this.Symbol;if(this.KLineSize){if(IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth)){var obj=this.Frame.SetDataWidth(this.KLineSize.DataWidth);showCount=obj.XPointCount-this.RightSpaceCount;this.KLineSize.DataWidth=null;this.KLineSize.PageSize=null;}else if(IFrameSplitOperator.IsNumber(this.KLineSize.PageSize)){showCount=this.KLineSize.PageSize;this.KLineSize.PageSize=null;this.KLineSize.DataWidth=null;}else{showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;}}for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i].Frame;if(isShowAll)item.XPointCount=hisData.Data.length+this.RightSpaceCount;else item.XPointCount=showCount+this.RightSpaceCount;item.Data=this.ChartPaint[0].Data;item.XSplitOperator.Symbol=this.Symbol;item.XSplitOperator.Period=this.Period;}this.TitlePaint[0].Data=this.ChartPaint[0].Data;//动态标题
8055
8056
  this.TitlePaint[0].Symbol=this.Symbol;this.TitlePaint[0].Name=this.Name;this.TitlePaint[0].Period=this.Period;this.ChartCorssCursor.StringFormatX.Data=this.ChartPaint[0].Data;//十字光标
8056
8057
  this.Frame.Data=this.ChartPaint[0].Data;for(var i=0;i<this.OverlayChartPaint.length;++i)//K线叠加 主图股票数据绑定到叠加上
8057
8058
  {var item=this.OverlayChartPaint[i];item.MainData=this.ChartPaint[0].Data;}if(isShowAll){var dataOffset=0;this.CursorIndex=0;}else{var dataOffset=hisData.Data.length-showCount;if(dataOffset<0)dataOffset=0;this.ChartPaint[0].Data.DataOffset=dataOffset;this.CursorIndex=showCount;if(this.CursorIndex+dataOffset>=hisData.Data.length)this.CursorIndex=hisData.Data.length-1-dataOffset;if(this.CursorIndex<0)this.CursorIndex=0;//不一定对啊
@@ -8730,7 +8731,8 @@ this.UpdateWindowIndex=function(index){var bindData=new ChartData();bindData.Dat
8730
8731
  this.UpdateFrameMaxMin();//调整坐标最大 最小值
8731
8732
  this.Draw();};this.GetOverlayIndexByIdentify=function(identify){for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];if(!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex))continue;for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];if(overlayItem.Identify===identify)return{OverlayItem:overlayItem,WindowIndex:i};}}return null;};//更新叠加指标
8732
8733
  this.UpdateOverlayIndex=function(identify){var overlayIndex=this.GetOverlayIndexByIdentify(identify);if(overlayIndex==null){console.warn('[KLineChartContainer::UpdateOverlayIndex] can\'t find overlay index. [identify='+identify+']');return;}if(!this.ChartPaint[0])return;var kData=this.ChartPaint[0].Data;if(!kData)return;this.BindOverlayIndexData(overlayIndex.OverlayItem,overlayIndex.WindowIndex,kData);};//修改参数指标
8733
- this.ChangeWindowIndexParam=function(index){this.WindowIndex[index].Index[0].Param+=1;this.WindowIndex[index].Index[1].Param+=1;this.UpdateWindowIndex(index);};this.OnDoubleClick=function(x,y,e){var bDraw=false;if(this.ChartCorssCursor){var data={e:e,X:x,Y:y,Draw:false};this.ChartCorssCursor.OnDBClick(data);bDraw=data.Draw;}if(this.EnableYDrag&&(this.EnableYDrag.Left||this.EnableYDrag.Right)&&this.Frame&&this.Frame.PtInFrameY){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var dragY=this.Frame.PtInFrameY(x,y);if(dragY&&dragY.Index>=0){this.CancelZoomUpDownFrameY(dragY);}}var selectedChart;//图形选中
8734
+ this.ChangeWindowIndexParam=function(index){this.WindowIndex[index].Index[0].Param+=1;this.WindowIndex[index].Index[1].Param+=1;this.UpdateWindowIndex(index);};this.OnDoubleClick=function(x,y,e){var bDraw=false;if(this.ChartCorssCursor){var data={e:e,X:x,Y:y,Draw:false};this.ChartCorssCursor.OnDBClick(data);bDraw=data.Draw;}if(this.TryDBClickChartTooltipData)//外部预留接口
8735
+ {var data={e:e,X:x,Y:y,Draw:false,PreventDefault:false};this.TryDBClickChartTooltipData(data,this);if(data.Draw)bDraw=true;if(data.PreventDefault){if(bDraw)this.Draw();return;}}if(this.EnableYDrag&&(this.EnableYDrag.Left||this.EnableYDrag.Right)&&this.Frame&&this.Frame.PtInFrameY){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var dragY=this.Frame.PtInFrameY(x,y);if(dragY&&dragY.Index>=0){this.CancelZoomUpDownFrameY(dragY);}}var selectedChart;//图形选中
8734
8736
  if(this.SelectedChart.EnableSelected){selectedChart=this.PtInChart(x,y);}var dbClickInfo={SelectedChart:selectedChart};this.DBClickEvent(dbClickInfo,e);if(!selectedChart&&this.EnableZoomIndexWindow)//双击放大缩小
8735
8737
  {var frameId=this.Frame.PtInFrame(x,y);JSConsole.Chart.Log("[KLineChartContainer::OnDoubleClick] frameId",frameId);if(frameId>=this.Frame.ZoomStartWindowIndex){if(this.ZoomIndexWindow(frameId,{X:x,Y:y})){this.Frame.SetSizeChage(true);this.Draw();return true;}}}if(bDraw)this.Draw();var tooltip=new TooltipData();if(!this.PtInChartPaintTooltip(x,y,tooltip)){if(!this.PtInOverlayIndexTooltip(x,y,tooltip))return;}if(!tooltip.Data)return;var event=null;if(this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE))event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);if(event){if(this.ClickChartTimer!=null)//清空单击定时器
8736
8738
  {clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var data={Tooltip:tooltip,Stock:{Symbol:this.Symbol,Name:this.Name},X:e.clientX,Y:e.clientY,PreventDefault:false};event.Callback(event,data,this);if(data.PreventDefault)return;}//内置弹分时图
@@ -15758,7 +15760,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15758
15760
  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);};}/********************************************************************************
15759
15761
  * 版本信息输出
15760
15762
  *
15761
- */var HQCHART_VERSION="1.1.15346";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
15763
+ */var HQCHART_VERSION="1.1.15351";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
15762
15764
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15763
15765
  // BaseIndex:BaseIndex,
15764
15766
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15347",
3
+ "version": "1.1.15352",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -55672,6 +55672,10 @@ HQData.NetworkFilter=function(data, callback)
55672
55672
  HQData.INDEX_RequestData(data,callback);
55673
55673
  break;
55674
55674
 
55675
+ case "JSSymbolData::GetIndustryData":
55676
+ HQData.INDUSTRY_RequestData(data,callback);
55677
+ break;
55678
+
55675
55679
  case 'JSSymbolData::GetSymbolData':
55676
55680
  //HQChart使用教程30-K线图如何对接第3方数据38-通达信指标K线数据
55677
55681
  HQData.RequestSymbolData(data,callback); //计算指标需要的K线数据
@@ -57324,6 +57328,30 @@ HQData.INDEX_RequestData=function(data,callback)
57324
57328
  callback(hqchartData);
57325
57329
  }
57326
57330
 
57331
+ HQData.INDUSTRY_RequestData=function(data, callback)
57332
+ {
57333
+ data.PreventDefault=true;
57334
+ var period=data.Period;
57335
+ var symbol=data.Request.Data.symbol;
57336
+ var indexSymbol="399001.sz";
57337
+ var dateRange=data.Request.Data.dateRange;
57338
+ var aryData=[];
57339
+ if (ChartData.IsMinutePeriod(period, true))
57340
+ {
57341
+ var fullData=HQData.GetM1KLineDataBySymbol(symbol);
57342
+ if (fullData) aryData=HQData.GetKLineDataByDateTime(fullData, dateRange.Start.Date, dateRange.Start.Time, dateRange.End.Date, dateRange.End.Time);
57343
+ }
57344
+ else if (ChartData.IsDayPeriod(period,true))
57345
+ {
57346
+ var fullData=HQData.GetDayKLineDataBySymbol(indexSymbol);
57347
+ if (fullData) aryData=HQData.GetKLineDataByDate(fullData, dateRange.Start.Date, dateRange.End.Date);
57348
+ }
57349
+
57350
+ var hqchartData={ name:indexSymbol, symbol:indexSymbol, data:aryData, ver:2.0 };
57351
+
57352
+ callback(hqchartData);
57353
+ }
57354
+
57327
57355
  HQData.RequestSymbolData=function(data,callback)
57328
57356
  {
57329
57357
  data.PreventDefault=true;
@@ -59003,6 +59031,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
59003
59031
  //{Date:20190916, Time: Value:15.5, Value2:0 },
59004
59032
  ],
59005
59033
  //Width:10
59034
+ AdWidth:{ Type:1, Value:0.8 }
59006
59035
  };
59007
59036
 
59008
59037
  var point2=
@@ -59016,6 +59045,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
59016
59045
  //{Date:20190916, Time: Value:15.5, Value2:0 },
59017
59046
  ],
59018
59047
  //Width:10
59048
+ AdWidth:{ Type:1, Value:0.5 }
59019
59049
  };
59020
59050
 
59021
59051
  for(var i=0;i<kData.Data.length;++i)
@@ -59342,6 +59372,8 @@ HQData.APIIndex_SCATTER_PLOT_V2=function(data, callback)
59342
59372
  };
59343
59373
  }
59344
59374
 
59375
+ //if ((i%6)==2) item.Radius2=20;
59376
+
59345
59377
 
59346
59378
  item.Tooltip=
59347
59379
  [
@@ -59404,6 +59436,7 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
59404
59436
  { Name:"账户4", DayCount:8, OperatorID:0 },
59405
59437
  ]
59406
59438
 
59439
+
59407
59440
  for(var i=0;i<kData.Data.length;++i)
59408
59441
  {
59409
59442
  var kItem=kData.Data[i];
@@ -59464,6 +59497,7 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
59464
59497
 
59465
59498
  tableData.Draw.DrawData.push(colItem);
59466
59499
  }
59500
+
59467
59501
 
59468
59502
  var apiData=
59469
59503
  {
@@ -368,6 +368,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
368
368
  if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize }; //!!已弃用 新的格式"CustomShow"
369
369
  if (option.KLine.RightSpaceCount>0) chart.RightSpaceCount=option.KLine.RightSpaceCount;
370
370
  if (option.KLine.ZoomType>0) chart.ZoomType=option.KLine.ZoomType;
371
+ if (IFrameSplitOperator.IsNumber(option.KLine.PageSizeV2)) chart.KLineSize={ PageSize:option.KLine.PageSizeV2 };
371
372
  if (option.KLine.DataWidth>=1) chart.KLineSize={ DataWidth:option.KLine.DataWidth };
372
373
  if (IFrameSplitOperator.IsNumber(option.KLine.RightFormula)) chart.RightFormula=option.KLine.RightFormula;
373
374
  }
@@ -13425,7 +13426,7 @@ function IChartFramePainting()
13425
13426
  this.HorizontalMax; //Y轴最大值
13426
13427
  this.HorizontalMin; //Y轴最小值
13427
13428
  this.HorizontalReserved=null; //Y轴预留高度 { Top:上, Bottom:下 }
13428
- this.XPointCount=10; //X轴数据个数
13429
+ this.XPointCount=g_JSChartResource.Frame.XPointCount; //X轴数据个数
13429
13430
 
13430
13431
  this.ClientBGColor; //客户区背景色
13431
13432
 
@@ -34462,6 +34463,7 @@ function ChartKLineTable()
34462
34463
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
34463
34464
  this.GetKValue=ChartData.GetKValue;
34464
34465
  this.AryCellRect=[]; //保存单元格信息
34466
+ this.AryNameRect=[]; //右侧行的名字
34465
34467
 
34466
34468
 
34467
34469
  this.SetOption=function(option)
@@ -34564,6 +34566,7 @@ function ChartKLineTable()
34564
34566
  this.Draw=function()
34565
34567
  {
34566
34568
  this.AryCellRect=[];
34569
+ this.AryNameRect=[];
34567
34570
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
34568
34571
  if (this.IsShowIndexTitleOnly()) return;
34569
34572
  if (this.IsHideScriptIndex()) return;
@@ -34770,6 +34773,8 @@ function ChartKLineTable()
34770
34773
  this.Canvas.textBaseline='bottom';
34771
34774
  this.Canvas.textAlign='left';
34772
34775
  this.Canvas.fillText(item.Name,rtBG.Left+2,yText);
34776
+
34777
+ this.AryNameRect.push({ Rect:rtBG, Item:item, Index:i });
34773
34778
  }
34774
34779
 
34775
34780
  y+=this.RowHeight;
@@ -78187,7 +78192,8 @@ function JSChartResource()
78187
78192
  YTopOffset:2*GetDevicePixelRatio(), //Y轴顶部文字向下偏移
78188
78193
  YTextPadding:[2,2],
78189
78194
  EnableRemoveZero:true, //移除小数点后面的0
78190
- StringFormat:0
78195
+ StringFormat:0,
78196
+ XPointCount:10,
78191
78197
  };
78192
78198
  this.ToolbarButtonStyle=0;
78193
78199
 
@@ -79827,6 +79833,7 @@ function JSChartResource()
79827
79833
  {
79828
79834
  if (style.Frame.XBottomOffset) this.Frame.XBottomOffset=style.Frame.XBottomOffset;
79829
79835
  if (style.Frame.YTopOffset) this.Frame.YTopOffset=style.Frame.YTopOffset;
79836
+ if (IFrameSplitOperator.IsNumber(style.Frame.XPointCount)) this.Frame.XPointCount=style.Frame.XPointCount;
79830
79837
  if (style.Frame.PercentageText)
79831
79838
  {
79832
79839
  var item=style.Frame.PercentageText;
@@ -84088,21 +84095,32 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
84088
84095
  this.BindMainData=function(hisData, showCount, chartOperator)
84089
84096
  {
84090
84097
  var isShowAll=false; //全部显示
84091
- if (chartOperator && chartOperator.IsShowAll===true) isShowAll=true;
84098
+ if (chartOperator)
84099
+ {
84100
+ if (chartOperator.IsShowAll===true) isShowAll=true;
84101
+ if (IFrameSplitOperator.IsPlusNumber(chartOperator.PageSize)) showCount=chartOperator.PageSize;
84102
+ }
84092
84103
  this.ChartPaint[0].Data=hisData;
84093
84104
  this.ChartPaint[0].Symbol=this.Symbol;
84094
84105
 
84095
84106
  if (this.KLineSize)
84096
84107
  {
84097
- if (!IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth))
84098
- {
84099
- showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;
84100
- }
84101
- else
84108
+ if (IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth))
84102
84109
  {
84103
84110
  var obj=this.Frame.SetDataWidth(this.KLineSize.DataWidth);
84104
84111
  showCount=obj.XPointCount-this.RightSpaceCount;
84105
84112
  this.KLineSize.DataWidth=null;
84113
+ this.KLineSize.PageSize=null;
84114
+ }
84115
+ else if (IFrameSplitOperator.IsNumber(this.KLineSize.PageSize))
84116
+ {
84117
+ showCount=this.KLineSize.PageSize;
84118
+ this.KLineSize.PageSize=null;
84119
+ this.KLineSize.DataWidth=null;
84120
+ }
84121
+ else
84122
+ {
84123
+ showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;
84106
84124
  }
84107
84125
  }
84108
84126
 
@@ -84766,7 +84784,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
84766
84784
  {
84767
84785
  var item=data.ChartOperator;
84768
84786
  chartOperator={ };
84769
- if (item.IsShowAll===true) chartOperator.IsShowAll=true; //全部显示
84787
+ if (item.IsShowAll===true) chartOperator.IsShowAll=true;
84788
+ if (IFrameSplitOperator.IsNumber(item.PageSize)) chartOperator.PageSize=item.PageSize; //全部显示
84770
84789
  }
84771
84790
 
84772
84791
  this.BindMainData(bindData,this.PageSize,chartOperator);
@@ -89324,6 +89343,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89324
89343
  this.ChartCorssCursor.OnDBClick(data);
89325
89344
  bDraw=data.Draw
89326
89345
  }
89346
+
89347
+ if (this.TryDBClickChartTooltipData) //外部预留接口
89348
+ {
89349
+ var data={ e:e, X:x, Y:y, Draw:false, PreventDefault:false };
89350
+ this.TryDBClickChartTooltipData(data, this);
89351
+ if (data.Draw) bDraw=true;
89352
+
89353
+ if (data.PreventDefault)
89354
+ {
89355
+ if (bDraw) this.Draw();
89356
+ return;
89357
+ }
89358
+ }
89327
89359
 
89328
89360
  if (this.EnableYDrag && (this.EnableYDrag.Left || this.EnableYDrag.Right) && this.Frame && this.Frame.PtInFrameY)
89329
89361
  {
@@ -158,6 +158,10 @@ HQData.NetworkFilter=function(data, callback)
158
158
  HQData.INDEX_RequestData(data,callback);
159
159
  break;
160
160
 
161
+ case "JSSymbolData::GetIndustryData":
162
+ HQData.INDUSTRY_RequestData(data,callback);
163
+ break;
164
+
161
165
  case 'JSSymbolData::GetSymbolData':
162
166
  //HQChart使用教程30-K线图如何对接第3方数据38-通达信指标K线数据
163
167
  HQData.RequestSymbolData(data,callback); //计算指标需要的K线数据
@@ -1810,6 +1814,30 @@ HQData.INDEX_RequestData=function(data,callback)
1810
1814
  callback(hqchartData);
1811
1815
  }
1812
1816
 
1817
+ HQData.INDUSTRY_RequestData=function(data, callback)
1818
+ {
1819
+ data.PreventDefault=true;
1820
+ var period=data.Period;
1821
+ var symbol=data.Request.Data.symbol;
1822
+ var indexSymbol="399001.sz";
1823
+ var dateRange=data.Request.Data.dateRange;
1824
+ var aryData=[];
1825
+ if (ChartData.IsMinutePeriod(period, true))
1826
+ {
1827
+ var fullData=HQData.GetM1KLineDataBySymbol(symbol);
1828
+ if (fullData) aryData=HQData.GetKLineDataByDateTime(fullData, dateRange.Start.Date, dateRange.Start.Time, dateRange.End.Date, dateRange.End.Time);
1829
+ }
1830
+ else if (ChartData.IsDayPeriod(period,true))
1831
+ {
1832
+ var fullData=HQData.GetDayKLineDataBySymbol(indexSymbol);
1833
+ if (fullData) aryData=HQData.GetKLineDataByDate(fullData, dateRange.Start.Date, dateRange.End.Date);
1834
+ }
1835
+
1836
+ var hqchartData={ name:indexSymbol, symbol:indexSymbol, data:aryData, ver:2.0 };
1837
+
1838
+ callback(hqchartData);
1839
+ }
1840
+
1813
1841
  HQData.RequestSymbolData=function(data,callback)
1814
1842
  {
1815
1843
  data.PreventDefault=true;
@@ -3489,6 +3517,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
3489
3517
  //{Date:20190916, Time: Value:15.5, Value2:0 },
3490
3518
  ],
3491
3519
  //Width:10
3520
+ AdWidth:{ Type:1, Value:0.8 }
3492
3521
  };
3493
3522
 
3494
3523
  var point2=
@@ -3502,6 +3531,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
3502
3531
  //{Date:20190916, Time: Value:15.5, Value2:0 },
3503
3532
  ],
3504
3533
  //Width:10
3534
+ AdWidth:{ Type:1, Value:0.5 }
3505
3535
  };
3506
3536
 
3507
3537
  for(var i=0;i<kData.Data.length;++i)
@@ -3828,6 +3858,8 @@ HQData.APIIndex_SCATTER_PLOT_V2=function(data, callback)
3828
3858
  };
3829
3859
  }
3830
3860
 
3861
+ //if ((i%6)==2) item.Radius2=20;
3862
+
3831
3863
 
3832
3864
  item.Tooltip=
3833
3865
  [
@@ -3890,6 +3922,7 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
3890
3922
  { Name:"账户4", DayCount:8, OperatorID:0 },
3891
3923
  ]
3892
3924
 
3925
+
3893
3926
  for(var i=0;i<kData.Data.length;++i)
3894
3927
  {
3895
3928
  var kItem=kData.Data[i];
@@ -3950,6 +3983,7 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
3950
3983
 
3951
3984
  tableData.Draw.DrawData.push(colItem);
3952
3985
  }
3986
+
3953
3987
 
3954
3988
  var apiData=
3955
3989
  {
@@ -4464,6 +4464,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4464
4464
  if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize }; //!!已弃用 新的格式"CustomShow"
4465
4465
  if (option.KLine.RightSpaceCount>0) chart.RightSpaceCount=option.KLine.RightSpaceCount;
4466
4466
  if (option.KLine.ZoomType>0) chart.ZoomType=option.KLine.ZoomType;
4467
+ if (IFrameSplitOperator.IsNumber(option.KLine.PageSizeV2)) chart.KLineSize={ PageSize:option.KLine.PageSizeV2 };
4467
4468
  if (option.KLine.DataWidth>=1) chart.KLineSize={ DataWidth:option.KLine.DataWidth };
4468
4469
  if (IFrameSplitOperator.IsNumber(option.KLine.RightFormula)) chart.RightFormula=option.KLine.RightFormula;
4469
4470
  }
@@ -38558,6 +38559,7 @@ function ChartKLineTable()
38558
38559
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
38559
38560
  this.GetKValue=ChartData.GetKValue;
38560
38561
  this.AryCellRect=[]; //保存单元格信息
38562
+ this.AryNameRect=[]; //右侧行的名字
38561
38563
 
38562
38564
 
38563
38565
  this.SetOption=function(option)
@@ -38660,6 +38662,7 @@ function ChartKLineTable()
38660
38662
  this.Draw=function()
38661
38663
  {
38662
38664
  this.AryCellRect=[];
38665
+ this.AryNameRect=[];
38663
38666
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
38664
38667
  if (this.IsShowIndexTitleOnly()) return;
38665
38668
  if (this.IsHideScriptIndex()) return;
@@ -38866,6 +38869,8 @@ function ChartKLineTable()
38866
38869
  this.Canvas.textBaseline='bottom';
38867
38870
  this.Canvas.textAlign='left';
38868
38871
  this.Canvas.fillText(item.Name,rtBG.Left+2,yText);
38872
+
38873
+ this.AryNameRect.push({ Rect:rtBG, Item:item, Index:i });
38869
38874
  }
38870
38875
 
38871
38876
  y+=this.RowHeight;
@@ -88190,15 +88195,22 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
88190
88195
 
88191
88196
  if (this.KLineSize)
88192
88197
  {
88193
- if (!IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth))
88194
- {
88195
- showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;
88196
- }
88197
- else
88198
+ if (IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth))
88198
88199
  {
88199
88200
  var obj=this.Frame.SetDataWidth(this.KLineSize.DataWidth);
88200
88201
  showCount=obj.XPointCount-this.RightSpaceCount;
88201
88202
  this.KLineSize.DataWidth=null;
88203
+ this.KLineSize.PageSize=null;
88204
+ }
88205
+ else if (IFrameSplitOperator.IsNumber(this.KLineSize.PageSize))
88206
+ {
88207
+ showCount=this.KLineSize.PageSize;
88208
+ this.KLineSize.PageSize=null;
88209
+ this.KLineSize.DataWidth=null;
88210
+ }
88211
+ else
88212
+ {
88213
+ showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;
88202
88214
  }
88203
88215
  }
88204
88216
 
@@ -93420,6 +93432,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
93420
93432
  this.ChartCorssCursor.OnDBClick(data);
93421
93433
  bDraw=data.Draw
93422
93434
  }
93435
+
93436
+ if (this.TryDBClickChartTooltipData) //外部预留接口
93437
+ {
93438
+ var data={ e:e, X:x, Y:y, Draw:false, PreventDefault:false };
93439
+ this.TryDBClickChartTooltipData(data, this);
93440
+ if (data.Draw) bDraw=true;
93441
+
93442
+ if (data.PreventDefault)
93443
+ {
93444
+ if (bDraw) this.Draw();
93445
+ return;
93446
+ }
93447
+ }
93423
93448
 
93424
93449
  if (this.EnableYDrag && (this.EnableYDrag.Left || this.EnableYDrag.Right) && this.Frame && this.Frame.PtInFrameY)
93425
93450
  {
@@ -155369,7 +155394,7 @@ function ScrollBarBGChart()
155369
155394
 
155370
155395
 
155371
155396
 
155372
- var HQCHART_VERSION="1.1.15346";
155397
+ var HQCHART_VERSION="1.1.15351";
155373
155398
 
155374
155399
  function PrintHQChartVersion()
155375
155400
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15346";
8
+ var HQCHART_VERSION="1.1.15351";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -55690,6 +55690,10 @@ HQData.NetworkFilter=function(data, callback)
55690
55690
  HQData.INDEX_RequestData(data,callback);
55691
55691
  break;
55692
55692
 
55693
+ case "JSSymbolData::GetIndustryData":
55694
+ HQData.INDUSTRY_RequestData(data,callback);
55695
+ break;
55696
+
55693
55697
  case 'JSSymbolData::GetSymbolData':
55694
55698
  //HQChart使用教程30-K线图如何对接第3方数据38-通达信指标K线数据
55695
55699
  HQData.RequestSymbolData(data,callback); //计算指标需要的K线数据
@@ -57342,6 +57346,30 @@ HQData.INDEX_RequestData=function(data,callback)
57342
57346
  callback(hqchartData);
57343
57347
  }
57344
57348
 
57349
+ HQData.INDUSTRY_RequestData=function(data, callback)
57350
+ {
57351
+ data.PreventDefault=true;
57352
+ var period=data.Period;
57353
+ var symbol=data.Request.Data.symbol;
57354
+ var indexSymbol="399001.sz";
57355
+ var dateRange=data.Request.Data.dateRange;
57356
+ var aryData=[];
57357
+ if (ChartData.IsMinutePeriod(period, true))
57358
+ {
57359
+ var fullData=HQData.GetM1KLineDataBySymbol(symbol);
57360
+ if (fullData) aryData=HQData.GetKLineDataByDateTime(fullData, dateRange.Start.Date, dateRange.Start.Time, dateRange.End.Date, dateRange.End.Time);
57361
+ }
57362
+ else if (ChartData.IsDayPeriod(period,true))
57363
+ {
57364
+ var fullData=HQData.GetDayKLineDataBySymbol(indexSymbol);
57365
+ if (fullData) aryData=HQData.GetKLineDataByDate(fullData, dateRange.Start.Date, dateRange.End.Date);
57366
+ }
57367
+
57368
+ var hqchartData={ name:indexSymbol, symbol:indexSymbol, data:aryData, ver:2.0 };
57369
+
57370
+ callback(hqchartData);
57371
+ }
57372
+
57345
57373
  HQData.RequestSymbolData=function(data,callback)
57346
57374
  {
57347
57375
  data.PreventDefault=true;
@@ -59021,6 +59049,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
59021
59049
  //{Date:20190916, Time: Value:15.5, Value2:0 },
59022
59050
  ],
59023
59051
  //Width:10
59052
+ AdWidth:{ Type:1, Value:0.8 }
59024
59053
  };
59025
59054
 
59026
59055
  var point2=
@@ -59034,6 +59063,7 @@ HQData.APIIndex_MULTI_BAR=function(data, callback)
59034
59063
  //{Date:20190916, Time: Value:15.5, Value2:0 },
59035
59064
  ],
59036
59065
  //Width:10
59066
+ AdWidth:{ Type:1, Value:0.5 }
59037
59067
  };
59038
59068
 
59039
59069
  for(var i=0;i<kData.Data.length;++i)
@@ -59360,6 +59390,8 @@ HQData.APIIndex_SCATTER_PLOT_V2=function(data, callback)
59360
59390
  };
59361
59391
  }
59362
59392
 
59393
+ //if ((i%6)==2) item.Radius2=20;
59394
+
59363
59395
 
59364
59396
  item.Tooltip=
59365
59397
  [
@@ -59422,6 +59454,7 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
59422
59454
  { Name:"账户4", DayCount:8, OperatorID:0 },
59423
59455
  ]
59424
59456
 
59457
+
59425
59458
  for(var i=0;i<kData.Data.length;++i)
59426
59459
  {
59427
59460
  var kItem=kData.Data[i];
@@ -59482,6 +59515,7 @@ HQData.APIIndex_KLINE_TABLE=function(data, callback)
59482
59515
 
59483
59516
  tableData.Draw.DrawData.push(colItem);
59484
59517
  }
59518
+
59485
59519
 
59486
59520
  var apiData=
59487
59521
  {
@@ -4508,6 +4508,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4508
4508
  if (option.KLine.FirstShowDate>19910101) chart.CustomShow={ Date:option.KLine.FirstShowDate, PageSize:option.KLine.PageSize }; //!!已弃用 新的格式"CustomShow"
4509
4509
  if (option.KLine.RightSpaceCount>0) chart.RightSpaceCount=option.KLine.RightSpaceCount;
4510
4510
  if (option.KLine.ZoomType>0) chart.ZoomType=option.KLine.ZoomType;
4511
+ if (IFrameSplitOperator.IsNumber(option.KLine.PageSizeV2)) chart.KLineSize={ PageSize:option.KLine.PageSizeV2 };
4511
4512
  if (option.KLine.DataWidth>=1) chart.KLineSize={ DataWidth:option.KLine.DataWidth };
4512
4513
  if (IFrameSplitOperator.IsNumber(option.KLine.RightFormula)) chart.RightFormula=option.KLine.RightFormula;
4513
4514
  }
@@ -38602,6 +38603,7 @@ function ChartKLineTable()
38602
38603
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
38603
38604
  this.GetKValue=ChartData.GetKValue;
38604
38605
  this.AryCellRect=[]; //保存单元格信息
38606
+ this.AryNameRect=[]; //右侧行的名字
38605
38607
 
38606
38608
 
38607
38609
  this.SetOption=function(option)
@@ -38704,6 +38706,7 @@ function ChartKLineTable()
38704
38706
  this.Draw=function()
38705
38707
  {
38706
38708
  this.AryCellRect=[];
38709
+ this.AryNameRect=[];
38707
38710
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
38708
38711
  if (this.IsShowIndexTitleOnly()) return;
38709
38712
  if (this.IsHideScriptIndex()) return;
@@ -38910,6 +38913,8 @@ function ChartKLineTable()
38910
38913
  this.Canvas.textBaseline='bottom';
38911
38914
  this.Canvas.textAlign='left';
38912
38915
  this.Canvas.fillText(item.Name,rtBG.Left+2,yText);
38916
+
38917
+ this.AryNameRect.push({ Rect:rtBG, Item:item, Index:i });
38913
38918
  }
38914
38919
 
38915
38920
  y+=this.RowHeight;
@@ -88234,15 +88239,22 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
88234
88239
 
88235
88240
  if (this.KLineSize)
88236
88241
  {
88237
- if (!IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth))
88238
- {
88239
- showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;
88240
- }
88241
- else
88242
+ if (IFrameSplitOperator.IsNumber(this.KLineSize.DataWidth))
88242
88243
  {
88243
88244
  var obj=this.Frame.SetDataWidth(this.KLineSize.DataWidth);
88244
88245
  showCount=obj.XPointCount-this.RightSpaceCount;
88245
88246
  this.KLineSize.DataWidth=null;
88247
+ this.KLineSize.PageSize=null;
88248
+ }
88249
+ else if (IFrameSplitOperator.IsNumber(this.KLineSize.PageSize))
88250
+ {
88251
+ showCount=this.KLineSize.PageSize;
88252
+ this.KLineSize.PageSize=null;
88253
+ this.KLineSize.DataWidth=null;
88254
+ }
88255
+ else
88256
+ {
88257
+ showCount=this.Frame.SubFrame[0].Frame.XPointCount-this.RightSpaceCount;
88246
88258
  }
88247
88259
  }
88248
88260
 
@@ -93464,6 +93476,19 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
93464
93476
  this.ChartCorssCursor.OnDBClick(data);
93465
93477
  bDraw=data.Draw
93466
93478
  }
93479
+
93480
+ if (this.TryDBClickChartTooltipData) //外部预留接口
93481
+ {
93482
+ var data={ e:e, X:x, Y:y, Draw:false, PreventDefault:false };
93483
+ this.TryDBClickChartTooltipData(data, this);
93484
+ if (data.Draw) bDraw=true;
93485
+
93486
+ if (data.PreventDefault)
93487
+ {
93488
+ if (bDraw) this.Draw();
93489
+ return;
93490
+ }
93491
+ }
93467
93492
 
93468
93493
  if (this.EnableYDrag && (this.EnableYDrag.Left || this.EnableYDrag.Right) && this.Frame && this.Frame.PtInFrameY)
93469
93494
  {
@@ -167428,7 +167453,7 @@ function HQChartScriptWorker()
167428
167453
 
167429
167454
 
167430
167455
 
167431
- var HQCHART_VERSION="1.1.15346";
167456
+ var HQCHART_VERSION="1.1.15351";
167432
167457
 
167433
167458
  function PrintHQChartVersion()
167434
167459
  {