hqchart 1.1.14870 → 1.1.14874

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.
@@ -1777,7 +1777,7 @@ this.JSPopMenu.Inital(this);};this.InitalDrawToolDialog=function(){if(this.Dialo
1777
1777
  this.ShowAddIndexWindowDialog=function(option){if(!this.DialogSearchIndex)return;var data=option;if(!data)data={};data.OpType=3;data.Title='\u589E\u52A0\u6307\u6807\u7A97\u53E3';this.DialogSearchIndex.SetOpData(data);this.DialogSearchIndex.Show();};this.ShowModifyIndexParamDialog=function(data){if(!this.DialogModifyIndexParam)return;if(data.Type==1){var indexScript=this.WindowIndex[data.WindowIndex];if(!indexScript)return;data.IndexScript=indexScript;data.Title='['+indexScript.Name+']\u53C2\u6570\u4FEE\u6539 \u7A97\u53E3['+(data.WindowIndex+1)+']';}else if(data.Type==2){var overlayIndex=this.GetOverlayIndexByIdentify(data.Identify);if(!overlayIndex||!overlayIndex.OverlayItem.Script)return;var indexScript=overlayIndex.OverlayItem.Script;data.IndexScript=indexScript;data.Title='['+indexScript.Name+']\u53C2\u6570\u4FEE\u6539 \u53E0\u52A0\u7A97\u53E3['+(data.WindowIndex+1)+']';}this.DialogModifyIndexParam.SetIndexData(data);this.DialogModifyIndexParam.Show();};this.DrawSelectRectDialog=function(){};this.IsShowSelectRectDialog=function(){if(!this.DialogSelectRect)return false;return this.DialogSelectRect.IsShow();};this.ShowDrawToolDialog=function(x,y){if(!this.DialogDrawTool)return;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var top=this.UIElement.offsetTop+15;var left=this.UIElement.offsetWidth-this.DialogDrawTool.DivDialog.offsetWidth-15;left+=rtClient.left+rtScroll.Left;top+=rtClient.top+rtScroll.Top;this.DialogDrawTool.Show(left,top);};this.IsShowDrawToolDialog=function(){if(!this.DialogDrawTool)return false;return this.DialogDrawTool.IsShow();};this.ShowModifyDrawDialog=function(chart,x,y){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.SetChartPicture(chart);if(this.DialogModifyDraw.IsShow())return;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var top=this.UIElement.offsetTop+15;var left=(this.UIElement.offsetWidth-this.DialogModifyDraw.DivDialog.offsetWidth)/2;left+=rtClient.left+rtScroll.Left;top+=rtClient.top+rtScroll.Top;this.DialogModifyDraw.Show(left,top);};this.CloseModifyDrawDialog=function(){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.Close();};this.IsShowTooltipDialog=function(){if(!this.DialogTooltip)return false;return this.DialogTooltip.IsShow();};this.CloseTooltipDialog=function(){if(!this.DialogTooltip)return;this.DialogTooltip.Close();};this.HideFloatTooltip=function(){if(!this.FloatTooltip)return;this.FloatTooltip.Hide();};this.DestroyTooltipDialog=function(){if(!this.DialogTooltip)return;this.DialogTooltip.Destroy();this.DialogTooltip=null;};this.DestroyFloatTooltip=function(){if(!this.FloatTooltip)return;this.FloatTooltip.Destroy();this.FloatTooltip=null;};this.DestroySearchIndexDialog=function(){if(!this.DialogSearchIndex)return;this.DialogSearchIndex.Destroy();this.DialogSearchIndex=null;};this.DestroyDialogDrawTool=function(){if(!this.DialogDrawTool)return;this.DialogDrawTool.Destroy();this.DialogDrawTool=null;};this.DestroyDialogModifyIndexParam=function(){if(!this.DialogModifyIndexParam)return;this.DialogModifyIndexParam.Destroy();this.DialogModifyIndexParam=null;};this.DestroyDialogSelectRect=function(){if(!this.DialogSelectRect)return;this.DialogSelectRect.Destroy();this.DialogSelectRect=null;};this.DestroyDialogModifyDraw=function(){if(!this.DialogModifyDraw)return;this.DialogModifyDraw.Destroy();this.DialogModifyDraw=null;};this.DestroyPopMenu=function(){if(!this.JSPopMenu)return;this.JSPopMenu.Destroy();this.JSPopMenu=null;};//隐藏内置的弹框div
1778
1778
  this.HideAllPopDiv=function(){this.HideFloatTooltip();this.CloseTooltipDialog();if(this.DialogDrawTool)this.DialogDrawTool.Close();this.CloseModifyDrawDialog();if(this.DialogSelectRect)this.DialogSelectRect.Close();if(this.DialogSearchIndex)this.DialogSearchIndex.Close();if(this.DialogModifyIndexParam)this.DialogModifyIndexParam.Close();};//obj={ Element:, Canvas: }
1779
1779
  this.SetCorssCursorElement=function(obj){if(!obj||!obj.Element||!obj.Canvas)return;this.CorssCursorElement=obj.Element;this.CorssCursorCanvas=obj.Canvas;};this.StopDisplayLatest=function(){this.GlobalOption.IsDisplayLatest=false;if(this.DisplayLatestOption.Timer){clearTimeout(this.DisplayLatestOption.Timer);this.DisplayLatestOption.Timer=null;}};this.StartStopDisplayLatest=function(){var _this6=this;this.StopDisplayLatest();if(!this.DisplayLatestOption.Enable)return;this.DisplayLatestOption.Timer=setTimeout(function(){if(_this6.DisplayLatest){JSConsole.Chart.Log('[JSChartContainer:StartStopDisplayLatest] call this.DisplayLatest()');_this6.DisplayLatest();}},this.DisplayLatestOption.DelayTime);};this.StopDrawDynamicInfo=function(){if(this.DrawDynamicInfoOption.Timer){clearTimeout(this.DrawDynamicInfoOption.Timer);this.DrawDynamicInfoOption.Timer=null;}};this.StartLatestPointFlash=function(){var _this7=this;this.LatestPointFlashOption.Timer=setInterval(function(){_this7.DrawLatestPoint();},this.LatestPointFlashOption.DelayTime);};this.StopLatestPointFlash=function(){if(this.LatestPointFlashOption.Timer){clearInterval(this.LatestPointFlashOption.Timer);this.LatestPointFlashOption.Timer=null;}};this.DrawLatestPoint=function(){var finder=this.GetExtendChartByClassName("LatestPointFlashPaint");if(finder&&finder.Chart)finder.Chart.Draw();};this.SetLatestPointFlash=function(flashCount,option){if(!IFrameSplitOperator.IsNumber(flashCount))return;var finder=this.GetExtendChartByClassName("LatestPointFlashPaint");if(!finder||!finder.Chart)return false;var chart=finder.Chart;chart.FlashCount=flashCount;};this.ChartDestroy=function()//销毁
1780
- {this.IsDestroy=true;this.StopAutoUpdate();this.DestroyTooltipDialog();this.DestroyFloatTooltip();this.DestroySearchIndexDialog();this.DestroyDialogModifyIndexParam();this.DestroyDialogDrawTool();this.DestroyDialogModifyDraw();this.DestroyDialogSelectRect();this.DestroyPopMenu();this.StopLatestPointFlash();document.oncontextmenu=null;this.RemoveAllEventListener();};this.ChartDestory=this.ChartDestroy;//老版本写错了,需要兼容下
1780
+ {this.IsDestroy=true;this.StopAutoUpdate();this.DestroyTooltipDialog();this.DestroyFloatTooltip();this.DestroySearchIndexDialog();this.DestroyDialogModifyIndexParam();this.DestroyDialogDrawTool();this.DestroyDialogModifyDraw();this.DestroyDialogSelectRect();this.DestroyPopMenu();if(this.DestroyPopMinuteChart)this.DestroyPopMinuteChart();this.StopLatestPointFlash();document.oncontextmenu=null;this.RemoveAllEventListener();};this.ChartDestory=this.ChartDestroy;//老版本写错了,需要兼容下
1781
1781
  //设置焦点
1782
1782
  this.SetFocus=function(){if(this.UIElement)this.UIElement.focus();};//设置事件回调
1783
1783
  //{event:事件id, callback:回调函数}
@@ -4149,14 +4149,15 @@ this.BorderColor;//分割线颜色
4149
4149
  this.RowCount=5;//行数
4150
4150
  this.RowHeight=10;//行高
4151
4151
  this.RowHeightType=1;//0=均分 1=固定高度
4152
- this.TextFontConfig=CloneData(g_JSChartResource.ChartKLineTable.TextFont);this.ItemMergin=CloneData(g_JSChartResource.ChartKLineTable.ItemMergin);this.TextFont;this.TextColor='rgb(0,0,0)';this.AryTableData=[];this.MapCache=null;//key=date/date-time value={ Date:, Time:, Data:[ ] }
4152
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartKLineTable.TextFont);this.ItemMergin=CloneData(g_JSChartResource.ChartKLineTable.ItemMergin);this.TextFont;this.TextColor='rgb(0,0,0)';this.Style=0;//0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
4153
+ this.AryTableData=[];this.MapCache=null;//key=date/date-time value={ Date:, Time:, Data:[ ] }
4153
4154
  this.GetKValue=ChartData.GetKValue;this.AryCellRect=[];//保存单元格信息
4154
4155
  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);}};//绘制背景色
4155
- this.DrawBG=function(rtBG){if(!this.BGColor)return;if(this.BGColor){this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtBG.Left+1,rtBG.Top,rtBG.Width-1,rtBG.Height);}};this.DrawBorder=function(rtBG){if(!this.BorderColor)return;var yLine=rtBG.Top;for(var i=0;i<30;++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;}};//计算行高
4156
+ 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;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;}};//计算行高
4156
4157
  this.CalculateRowHeight=function(rtBG){if(this.RowHeightType==1){this.RowHeight=this.TextFontConfig.FontMaxSize+this.ItemMergin.Top+this.ItemMergin.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(!IFrameSplitOperator.IsNonEmptyArray(this.AryTableData))return;if(!this.MapCache||this.MapCache.size<=0)return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;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;//绘制背景
4157
- 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.DrawBG(rtBG);this.CalculateRowHeight(rtBG);var itemHeight=this.RowHeight;var itemWidth=dataWidth+distanceWidth;if(itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom>0)itemHeight=itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom;if(itemWidth-this.ItemMergin.Left-this.ItemMergin.Right>0)itemWidth=itemWidth-this.ItemMergin.Left-this.ItemMergin.Right;var font=this.GetDynamicTextFont(itemHeight,itemWidth);this.TextFont=font;this.Canvas.font=this.TextFont;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;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);//绘制一列
4158
- }if(this.RowNamePosition==3)this.DrawRightRowName();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.ItemMergin.YOffset)yOffset=this.ItemMergin.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;}};//绘制右侧行名
4159
- this.DrawRightRowName=function(){var border=this.ChartFrame.GetBorder();if(this.BGColor){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-1,rtRightBG.Height);}var x=border.RightEx,y=border.TopTitle;var yOffset=3;if(this.ItemMergin.YOffset)yOffset=this.ItemMergin.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.ItemMergin.YOffset)yOffset=this.ItemMergin.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))//左右显示
4158
+ 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.ItemMergin.Top-this.ItemMergin.Bottom>0)itemHeight=itemHeight-this.ItemMergin.Top-this.ItemMergin.Bottom;if(itemWidth-this.ItemMergin.Left-this.ItemMergin.Right>0)itemWidth=itemWidth-this.ItemMergin.Left-this.ItemMergin.Right;var font=this.GetDynamicTextFont(itemHeight,itemWidth);this.TextFont=font;this.Canvas.font=this.TextFont;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;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);//绘制一列
4159
+ }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.ItemMergin.YOffset)yOffset=this.ItemMergin.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;}};//绘制右侧行名
4160
+ 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.ItemMergin.YOffset)yOffset=this.ItemMergin.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.ItemMergin.YOffset)yOffset=this.ItemMergin.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))//左右显示
4160
4161
  {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);//高度太小了就不要上下间距了
4161
4162
  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
4162
4163
  return true;}}return false;};}//表格
@@ -7706,7 +7707,7 @@ this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.
7706
7707
  if(this.EnableIndexChartDrag)this.CreateExtendChart("DragMovePaint");this.CreateDragSelectRect(option?option.DragSelectRect:null);//子窗口动态标题
7707
7708
  for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this23.GetEventCallback(id);};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint.push(titlePaint);}this.ChartCorssCursor.StringFormatX.Frame=this.Frame.SubFrame[0].Frame;this.ChartCorssCursor.StringFormatY.Frame=this.Frame;if(option)this.AddDefaultEventListener(option.Listener);this.InitalPopMinuteChart(option);};this.InitalPopMinuteChart=function(option){if(!option)return false;if(option.PopMinuteChart&&option.PopMinuteChart.Enable)//新的配置格式
7708
7709
  {var item=option.PopMinuteChart;this.PopMinuteChart=new JSPopMinuteChart();this.PopMinuteChart.Inital(this,item);this.PopMinuteChart.Create();return true;}else if(option.KLine&&option.KLine.KLineDoubleClick===true)//旧的格式 不要使用了
7709
- {this.PopMinuteChart=new JSPopMinuteChart();this.PopMinuteChart.Inital(this);this.PopMinuteChart.Create();return true;}return false;};this.DestroyPopMinuteChart=function(){if(!this.PopMinuteChart)return;this.PopMinuteChart.Destroy();this.PopMinuteChart=null;};this.ShowMinuteChartDialog=function(data,x,y){if(!this.PopMinuteChart)return;if(!ChartData.IsDayPeriod(this.Period,true))return;//只支持日K
7710
+ {this.PopMinuteChart=new JSPopMinuteChart();this.PopMinuteChart.Inital(this);this.PopMinuteChart.Create();return true;}return false;};this.DestroyPopMinuteChart=function(){if(!this.PopMinuteChart)return;this.PopMinuteChart.Destroy();this.PopMinuteChart=null;};this.ClosePopMinuteChart=function(){if(!this.PopMinuteChart)return;this.PopMinuteChart.Close();};this.ShowMinuteChartDialog=function(data,x,y){if(!this.PopMinuteChart)return;if(!ChartData.IsDayPeriod(this.Period,true))return;//只支持日K
7710
7711
  if(!data.Tooltip||!data.Chart)return;var pixelRatio=GetDevicePixelRatio();var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();x+=rtClient.left+rtScroll.Left;y+=rtClient.top+rtScroll.Top;var item=data.Tooltip.Data;var date=item.Date;var symbol=null;if(data.Tooltip.ChartPaint&&data.Tooltip.ChartPaint.Name=="DRAWKLINE"){if(item.Symbol)symbol=item.Symbol;else if(data.Tooltip.Symbol)symbol=data.Tooltip.Symbol;}else{symbol=data.Chart.Symbol;}if(!symbol)return;this.PopMinuteChart.Show({Date:date,Symbol:symbol,Data:data.Tooltip.Data,Chart:data.Tooltip.ChartPaint},x/pixelRatio,y/pixelRatio);};//Alt+W 区间统计
7711
7712
  //Alt+数字 切换多个窗口
7712
7713
  //Ctrl+I
@@ -8120,7 +8121,7 @@ this.BindAllOverlayIndexData(bindData);};this.ClearIndexPaint=function(){//清
8120
8121
  if(this.Frame&&this.Frame.SubFrame){for(var i=0;i<this.Frame.SubFrame.length;++i){this.DeleteIndexPaint(i,true);var item=this.Frame.SubFrame[i];if(IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)){for(var j=0;j<item.OverlayIndex.length;++j)//清空叠加指标
8121
8122
  {var overlayItem=item.OverlayIndex[j];for(var k=0;k<overlayItem.ChartPaint.length;++k){var overlayChart=overlayItem.ChartPaint[k];if(overlayChart&&overlayChart.OnDestroy)overlayChart.OnDestroy();}overlayItem.ChartPaint=[];}}}}//清空叠加标题
8122
8123
  for(var i=1;i<this.TitlePaint.length;++i){var item=this.TitlePaint[i];item.OverlayIndex=new _map2.default();}};//周期切换
8123
- this.ChangePeriod=function(period,option){var oldData={Period:this.Period,Right:this.Right,KLineDrawType:this.KLineDrawType,Symbol:this.Symbol};var isChangeKLineDrawType=false;var isReload=false;//是否重新请求数据
8124
+ this.ChangePeriod=function(period,option){this.ClosePopMinuteChart();var oldData={Period:this.Period,Right:this.Right,KLineDrawType:this.KLineDrawType,Symbol:this.Symbol};var isChangeKLineDrawType=false;var isReload=false;//是否重新请求数据
8124
8125
  var right=null;//复权
8125
8126
  if(option){if(option.KLine){var item=option.KLine;if(IFrameSplitOperator.IsNumber(item.DrawType))isChangeKLineDrawType=true;if(IFrameSplitOperator.IsNumber(item.Right))right=item.Right;if(IFrameSplitOperator.IsNumber(item.DataWidth))this.KLineSize={DataWidth:item.DataWidth};}if(IFrameSplitOperator.IsBool(option.Reload))isReload=option.Reload;if(IFrameSplitOperator.IsBool(option.IsApiPeriod))this.IsApiPeriod=option.IsApiPeriod;};if(this.Period==period&&isReload==false){if(isChangeKLineDrawType)this.ChangeKLineDrawType(option.KLine.DrawType);return;}if(isChangeKLineDrawType)this.ChangeKLineDrawType(option.KLine.DrawType,false);//切换K线类型, 不重绘
8126
8127
  var isDataTypeChange=true;if(this.SourceData){var isDataTypeChange=false;if(period>CUSTOM_DAY_PERIOD_START&&period<=CUSTOM_DAY_PERIOD_END){if(this.SourceData.DataType!=0)isDataTypeChange=true;}else if(period>CUSTOM_MINUTE_PERIOD_START&&period<=CUSTOM_MINUTE_PERIOD_END||period>CUSTOM_SECOND_PERIOD_START&&period<=CUSTOM_SECOND_PERIOD_END||period>CUSTOM_MILLISECOND_PERIOD_START&&period<=CUSTOM_MILLISECOND_PERIOD_END){if(this.SourceData.DataType!=1)isDataTypeChange=true;else if(ChartData.IsSecondPeriod(period))isDataTypeChange=true;else if(ChartData.IsMilliSecondPeriod(period))isDataTypeChange=true;}else{switch(period){case 0://日线
@@ -8315,7 +8316,7 @@ this.UpdateFrameMaxMin();//调整坐标最大 最小值
8315
8316
  this.Frame.SetSizeChage(true);this.Draw();//叠加指标
8316
8317
  for(var i=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];for(var j in item.OverlayIndex){var overlayItem=item.OverlayIndex[j];this.BindOverlayIndexData(overlayItem,i,bindData);}}};//切换股票代码
8317
8318
  this.ChangeSymbol=function(symbol,option){this.CancelAutoUpdate();//先停止定时器
8318
- this.AutoUpdateEvent(false,'KLineChartContainer::ChangeSymbol');this.ClearRectSelect(true);this.ClearCustomKLine();this.ClearKLineBreakPoint();this.ClearKLineCaluate();this.HideTooltip();this.ResetScrollBar();this.ClearIndexRunCount();this.UnlockCorssCursor();this.Frame.ClearYCoordinateMaxMin();this.Symbol=symbol;if(!symbol){this.DrawEmpty();return;}if(option){if(option.KLine){var item=option.KLine;if(IFrameSplitOperator.IsNumber(item.Right))this.Right=item.Right;if(IFrameSplitOperator.IsNumber(item.Period))this.Period=item.Period;if(IFrameSplitOperator.IsNumber(item.DataWidth))this.KLineSize={DataWidth:item.DataWidth};}}if(MARKET_SUFFIX_NAME.IsSHSZIndex(symbol))this.Right=0;//指数没有复权
8319
+ this.AutoUpdateEvent(false,'KLineChartContainer::ChangeSymbol');this.ClearRectSelect(true);this.ClearCustomKLine();this.ClearKLineBreakPoint();this.ClearKLineCaluate();this.HideTooltip();this.ResetScrollBar();this.ClearIndexRunCount();this.UnlockCorssCursor();this.Frame.ClearYCoordinateMaxMin();this.ClosePopMinuteChart();this.Symbol=symbol;if(!symbol){this.DrawEmpty();return;}if(option){if(option.KLine){var item=option.KLine;if(IFrameSplitOperator.IsNumber(item.Right))this.Right=item.Right;if(IFrameSplitOperator.IsNumber(item.Period))this.Period=item.Period;if(IFrameSplitOperator.IsNumber(item.DataWidth))this.KLineSize={DataWidth:item.DataWidth};}}if(MARKET_SUFFIX_NAME.IsSHSZIndex(symbol))this.Right=0;//指数没有复权
8319
8320
  this.ClearIndexPaint();//清空指标
8320
8321
  if(option){if(IFrameSplitOperator.IsNonEmptyArray(option.Windows)){var windows=option.Windows;for(var i=0;i<windows.length;++i){if(i>=this.WindowIndex.length)break;//暂时不支持 动态增加/减少
8321
8322
  var item=windows[i];if(!item)continue;if(item.Script){this.WindowIndex[i]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
@@ -12520,7 +12521,7 @@ var ySpliter=this.OverlayIndex.Frame.Frame.YSplitOperator;if(ySpliter){ySpliter.
12520
12521
  var titleInfo={Data:[],Title:this.Name,Frame:this.OverlayIndex.Frame.Frame,Script:this,IsShowIndexTitle:this.IsShowIndexTitle};var indexParam='';for(var i in this.Arguments){var _item28=this.Arguments[i];if(indexParam.length>0)indexParam+=',';indexParam+=_item28.Value.toString();}if(indexParam.length>0)titleInfo.Title=this.Name+'('+indexParam+')';var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.OverlayIndex.set(this.OverlayIndex.Identify,titleInfo);if(this.OutName&&this.OutName.length>0&&this.Arguments&&this.Arguments.length>0){titlePaint.SetDynamicTitle(this.OutName,this.Arguments,this.OverlayIndex.Identify);}this.OverlayIndex.Frame.Frame.Title=this.Name;//给子框架设置标题
12521
12522
  if(hqChart.Frame.SubFrame[windowIndex]){var mainFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(mainFrame)this.OverlayIndex.Frame.Frame.XPointCount=mainFrame.XPointCount;//跟主窗口同步下页面显示数据个数
12522
12523
  }for(var i=0;i<this.OutVar.length;++i){var _item29=this.OutVar[i];if(_item29.IsExData===true)continue;//扩展数据不显示图形
12523
- if(_item29.Type==0){this.CreateLine(hqChart,windowIndex,_item29,i,_item29.Type);}else if(_item29.Type==1){switch(_item29.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item29,i);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item29,i);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item29,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item29,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item29,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item29,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item29,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item29,i);break;case'DRAWGBK':case"DRAWGBK2":this.CreateBackgroud(hqChart,windowIndex,_item29,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item29,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item29,i);break;case"TIPICON":this.CreateTipIcon(hqChart,windowIndex,_item29,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item29,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item29,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item29,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item29,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item29,i);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item29,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item29,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item29,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item29,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item29,i);break;case"DRAWTITLE":this.CreateTitle(hqChart,windowIndex,_item29,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_TABLE":this.CreateSimpleTable(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_PIE":this.CreateSimplePie(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_DOUGHNUT":this.CreateSimpleDoughnut(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_RADAR":this.CreateSimpleRadar(hqChart,windowIndex,_item29,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item29,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item29,i);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item29,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item29,i);break;case SCRIPT_CHART_NAME.BASELINE_BAR:this.CreateBaseLineBar(hqChart,windowIndex,_item29,i);break;case"DRAWCOLORKLINE":this.CreateDrawColorKLine(hqChart,windowIndex,_item29,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item29.Draw.DrawType);//外部挂接
12524
+ if(_item29.Type==0){this.CreateLine(hqChart,windowIndex,_item29,i,_item29.Type);}else if(_item29.Type==1){switch(_item29.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item29,i);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item29,i);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item29,i);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item29,i);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item29,i);break;case'DRAWKLINE':this.CreateKLine(hqChart,windowIndex,_item29,i);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item29,i);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item29,i);break;case'DRAWGBK':case"DRAWGBK2":this.CreateBackgroud(hqChart,windowIndex,_item29,i);break;case'DRAWNUMBER':case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item29,i);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item29,i);break;case"TIPICON":this.CreateTipIcon(hqChart,windowIndex,_item29,i);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item29,i);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item29,i);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item29,i);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item29,i);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item29,i);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item29,i);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item29,i);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item29,i);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item29,i);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item29,i);break;case"DRAWTITLE":this.CreateTitle(hqChart,windowIndex,_item29,i);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_TABLE":this.CreateSimpleTable(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_PIE":this.CreateSimplePie(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_DOUGHNUT":this.CreateSimpleDoughnut(hqChart,windowIndex,_item29,i);break;case"DRAW_SIMPLE_RADAR":this.CreateSimpleRadar(hqChart,windowIndex,_item29,i);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item29,i);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item29,i);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item29,i);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item29,i);break;case SCRIPT_CHART_NAME.BASELINE_BAR:this.CreateBaseLineBar(hqChart,windowIndex,_item29,i);break;case SCRIPT_CHART_NAME.KLINE_TABLE:this.CreateKLineTable(hqChart,windowIndex,_item29,i);break;case"DRAWCOLORKLINE":this.CreateDrawColorKLine(hqChart,windowIndex,_item29,i);break;default:{var find=g_ScriptIndexChartFactory.Get(_item29.Draw.DrawType);//外部挂接
12524
12525
  if(find&&find.CreateChartCallback)find.CreateChartCallback(hqChart,windowIndex,_item29,i,this);}break;}}else if(_item29.Type==2){this.CreateMACD(hqChart,windowIndex,_item29,i);}else if(_item29.Type==3){this.CreatePointDot(hqChart,windowIndex,_item29,i,hisData);}else if(_item29.Type==4){this.CreateLineStick(hqChart,windowIndex,_item29,i);}else if(_item29.Type==5){this.CreateStick(hqChart,windowIndex,_item29,i);}else if(_item29.Type==6){this.CreateVolStick(hqChart,windowIndex,_item29,i,hisData);}else if(_item29.Type==7){this.CreateLine(hqChart,windowIndex,_item29,i,_item29.Type);}else if(_item29.Type==8){this.CreateLine(hqChart,windowIndex,_item29,i,_item29.Type);}var titleData=titleInfo.Data[i];if(titleData){if(this.FloatPrecision>=0)titleData.FloatPrecision=this.FloatPrecision;if(IFrameSplitOperator.IsNumber(this.StringFormat))titleData.StringFormat=this.StringFormat;}}/*
12525
12526
  hqChart.TitlePaint[titleIndex].Title=this.Name;
12526
12527
 
@@ -12565,8 +12566,9 @@ if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.
12565
12566
  this.CreateIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartSingleText();chart.Canvas=hqChart.Canvas;chart.TextAlign='center';chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.DrawVAlign>=0){if(varItem.DrawVAlign==0)chart.Direction=1;else if(varItem.DrawVAlign==1)chart.Direction=0;else if(varItem.DrawVAlign==2)chart.Direction=2;}if(varItem.DrawAlign>=0){if(varItem.DrawAlign==0)chart.TextAlign="left";else if(varItem.DrawAlign==1)chart.TextAlign="center";else if(varItem.DrawAlign==2)chart.TextAlign='right';}if(IFrameSplitOperator.IsNumber(varItem.XOffset))chart.ShowOffset.X=varItem.XOffset;if(IFrameSplitOperator.IsNumber(varItem.YOffset))chart.ShowOffset.Y=varItem.YOffset;chart.Data.Data=varItem.Draw.DrawData;var icon=varItem.Draw.Icon;if(icon.IconFont==true){chart.IconFont={Family:icon.Family,Text:icon.Symbol,Color:icon.Color};}else{chart.Text=icon.Symbol;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else if(icon.Color)chart.Color=icon.Color;else chart.Color='rgb(0,0,0)';}//var titleIndex=windowIndex+1;
12566
12567
  //hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(bar.Data,varItem.Name,bar.Color);
12567
12568
  this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateTipIcon=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartDrawSVG();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data=hqChart.GetKData();chart.Family=varItem.Draw.Icon.Family;chart.TextFont=g_JSChartResource.TIPICON.TextFont;var svgSize=g_JSChartResource.TIPICON.Size;var svgColor=g_JSChartResource.TIPICON.Color;var svgYOffset=0;var svgVAlign=2;//上下对齐方式
12568
- if(IFrameSplitOperator.IsNumber(varItem.YOffset))svgYOffset=varItem.YOffset;if(varItem.Color)svgColor=this.GetColor(varItem.Color);if(varItem.DrawFontSize>0)svgSize=varItem.DrawFontSize;if(varItem.DrawVAlign>=0)svgVAlign=varItem.DrawVAlign;if(varItem.Draw&&IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.DrawData)&&varItem.Draw.Icon){var drawData=varItem.Draw.DrawData;var aryData=[];var isArrayTip=Array.isArray(varItem.Draw.Text);var singleTip=null;if(!isArrayTip&&varItem.Draw.Text)singleTip={Text:varItem.Draw.Text};for(var j=0;j<drawData.length;++j){var item=drawData[j];var kItem=chart.Data.Data[j];if(!IFrameSplitOperator.IsNumber(item))continue;var svgItem={Value:item,Date:kItem.Date,Time:kItem.Time,SVG:{Symbol:varItem.Draw.Icon.Symbol,Size:svgSize,Color:svgColor,YOffset:svgYOffset,VAlign:svgVAlign}};if(isArrayTip){var text=varItem.Draw.Text[j];if(text)svgItem.Tooltip={Text:text};}else{svgItem.Tooltip=singleTip;}aryData.push(svgItem);}chart.Texts=aryData;}chart.BuildCacheData();frame.ChartPaint.push(chart);};this.CreateBaseLineBar=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartBaseLineBar();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.HQChart=hqChart;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data=hqChart.GetKData();//绑定K线
12569
- chart.AryData=varItem.Draw.DrawData;var config=varItem.Draw.Config;if(config){if(config.UpColor)chart.UpColor=config.UpColor;if(config.DownColor)chart.DownColor=config.DownColor;if(IFrameSplitOperator.IsNumber(config.DefaultMax))chart.DefaultMax=config.DefaultMax;}chart.BuildCacheData();frame.ChartPaint.push(chart);};//创建通道
12569
+ if(IFrameSplitOperator.IsNumber(varItem.YOffset))svgYOffset=varItem.YOffset;if(varItem.Color)svgColor=this.GetColor(varItem.Color);if(varItem.DrawFontSize>0)svgSize=varItem.DrawFontSize;if(varItem.DrawVAlign>=0)svgVAlign=varItem.DrawVAlign;if(varItem.Draw&&IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.DrawData)&&varItem.Draw.Icon){var drawData=varItem.Draw.DrawData;var aryData=[];var isArrayTip=Array.isArray(varItem.Draw.Text);var singleTip=null;if(!isArrayTip&&varItem.Draw.Text)singleTip={Text:varItem.Draw.Text};for(var j=0;j<drawData.length;++j){var item=drawData[j];var kItem=chart.Data.Data[j];if(!IFrameSplitOperator.IsNumber(item))continue;var svgItem={Value:item,Date:kItem.Date,Time:kItem.Time,SVG:{Symbol:varItem.Draw.Icon.Symbol,Size:svgSize,Color:svgColor,YOffset:svgYOffset,VAlign:svgVAlign}};if(isArrayTip){var text=varItem.Draw.Text[j];if(text)svgItem.Tooltip={Text:text};}else{svgItem.Tooltip=singleTip;}aryData.push(svgItem);}chart.Texts=aryData;}chart.BuildCacheData();this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateBaseLineBar=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartBaseLineBar();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.HQChart=hqChart;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data=hqChart.GetKData();//绑定K线
12570
+ chart.AryData=varItem.Draw.DrawData;var config=varItem.Draw.Config;if(config){if(config.UpColor)chart.UpColor=config.UpColor;if(config.DownColor)chart.DownColor=config.DownColor;if(IFrameSplitOperator.IsNumber(config.DefaultMax))chart.DefaultMax=config.DefaultMax;}chart.BuildCacheData();frame.ChartPaint.push(chart);};this.CreateKLineTable=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartKLineTable();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.HQChart=hqChart;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data=hqChart.GetKData();//绑定K线
12571
+ chart.AryTableData=varItem.Draw.DrawData;if(IFrameSplitOperator.IsNumber(varItem.Draw.RowCount))chart.RowCount=varItem.Draw.RowCount;if(IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName))chart.RowName=varItem.Draw.RowName;var config=varItem.Draw.Config;if(config){if(config.BGColor)chart.BGColor=config.BGColor;if(config.TextColor)chart.TextColor=config.TextColor;if(config.BorderColor)chart.BorderColor=config.BorderColor;if(IFrameSplitOperator.IsNumber(config.RowNamePosition))chart.RowNamePosition=config.RowNamePosition;if(IFrameSplitOperator.IsNumber(config.RowHeightType))chart.RowHeightType=config.RowHeightType;if(IFrameSplitOperator.IsNumber(config.Style))chart.Style=config.Style;if(config.ItemMergin){var subItem=config.ItemMergin;if(IFrameSplitOperator.IsNumber(subItem.Left))chart.ItemMergin.Left=subItem.Left;if(IFrameSplitOperator.IsNumber(subItem.Top))chart.ItemMergin.Top=subItem.Top;if(IFrameSplitOperator.IsNumber(subItem.Bottom))chart.ItemMergin.Bottom=subItem.Bottom;if(IFrameSplitOperator.IsNumber(subItem.Right))chart.ItemMergin.Right=subItem.Right;if(IFrameSplitOperator.IsNumber(subItem.YOffset))chart.ItemMergin.YOffset=subItem.YOffset;}if(config.TextFont){var subItem=config.TextFont;if(IFrameSplitOperator.IsNumber(subItem.FontMaxSize))chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;if(subItem.Family)chart.TextFontConfig.Family=subItem.Family;}}chart.BuildCacheData();frame.ChartPaint.push(chart);var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);titleData.DataType="ChartKLineTable";titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;};//创建通道
12570
12572
  this.CreateChannel=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartChannel();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Draw.AreaColor)chart.AreaColor=varItem.Draw.AreaColor;else if(varItem.Color)chart.AreaColor=this.GetColor(varItem.Color);else chart.AreaColor=this.GetDefaultColor(id);if(varItem.Draw.Border.Color)chart.LineColor=varItem.Draw.Border.Color;else chart.LineColor=null;if(varItem.Draw.Border.Dotted)chart.LineDotted=varItem.Draw.Border.Dotted;if(varItem.Draw.Border.Width>0)chart.LineWidth=varItem.Draw.Border.Width;//let titleIndex=windowIndex+1;
12571
12573
  chart.Data.Data=varItem.Draw.DrawData;frame.ChartPaint.push(chart);};//
12572
12574
  this.CreatePartLine=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartPartLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))chart.LineWidth=width;}if(IFrameSplitOperator.IsBool(varItem.IsDotLine))chart.IsDotLine=varItem.IsDotLine;if(IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash))chart.LineDash=varItem.LineDash;chart.Data.Data=varItem.Draw.DrawData;this.SetChartIndexName(chart);frame.ChartPaint.push(chart);};this.CreateMultiLine=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMultiLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
@@ -15165,7 +15167,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15165
15167
  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);};}/********************************************************************************
15166
15168
  * 版本信息输出
15167
15169
  *
15168
- */var HQCHART_VERSION="1.1.14869";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();//把给外界调用的方法暴露出来
15170
+ */var HQCHART_VERSION="1.1.14873";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();//把给外界调用的方法暴露出来
15169
15171
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15170
15172
  // BaseIndex:BaseIndex,
15171
15173
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14870",
3
+ "version": "1.1.14874",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -23081,6 +23081,9 @@ function OverlayScriptIndex(name,script,args,option)
23081
23081
  case SCRIPT_CHART_NAME.BASELINE_BAR:
23082
23082
  this.CreateBaseLineBar(hqChart,windowIndex,item,i);
23083
23083
  break;
23084
+ case SCRIPT_CHART_NAME.KLINE_TABLE:
23085
+ this.CreateKLineTable(hqChart,windowIndex,item,i);
23086
+ break;
23084
23087
  case "DRAWCOLORKLINE":
23085
23088
  this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
23086
23089
  break;
@@ -23890,6 +23893,7 @@ function OverlayScriptIndex(name,script,args,option)
23890
23893
  }
23891
23894
 
23892
23895
  chart.BuildCacheData();
23896
+ this.SetChartIndexName(chart);
23893
23897
  frame.ChartPaint.push(chart);
23894
23898
  }
23895
23899
 
@@ -23920,6 +23924,61 @@ function OverlayScriptIndex(name,script,args,option)
23920
23924
  frame.ChartPaint.push(chart);
23921
23925
  }
23922
23926
 
23927
+ this.CreateKLineTable=function(hqChart,windowIndex,varItem,id)
23928
+ {
23929
+ var overlayIndex=this.OverlayIndex;
23930
+ var frame=overlayIndex.Frame;
23931
+ var chart=new ChartKLineTable();
23932
+ chart.Canvas=hqChart.Canvas;
23933
+ chart.Name=varItem.Name;
23934
+ chart.HQChart=hqChart;
23935
+ chart.ChartBorder=frame.Frame.ChartBorder;
23936
+ chart.ChartFrame=frame.Frame;
23937
+ chart.Identify=overlayIndex.Identify;
23938
+
23939
+ chart.Data=hqChart.GetKData(); //绑定K线
23940
+ chart.AryTableData=varItem.Draw.DrawData;
23941
+ if (IFrameSplitOperator.IsNumber(varItem.Draw.RowCount)) chart.RowCount=varItem.Draw.RowCount;
23942
+ if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
23943
+
23944
+ var config=varItem.Draw.Config;
23945
+ if (config)
23946
+ {
23947
+ if (config.BGColor) chart.BGColor=config.BGColor;
23948
+ if (config.TextColor) chart.TextColor=config.TextColor;
23949
+ if (config.BorderColor) chart.BorderColor=config.BorderColor;
23950
+ if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
23951
+ if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
23952
+ if (IFrameSplitOperator.IsNumber(config.Style)) chart.Style=config.Style;
23953
+
23954
+ if (config.ItemMergin)
23955
+ {
23956
+ var subItem=config.ItemMergin;
23957
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
23958
+ if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
23959
+ if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
23960
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
23961
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
23962
+ }
23963
+
23964
+ if (config.TextFont)
23965
+ {
23966
+ var subItem=config.TextFont;
23967
+ if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
23968
+ if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
23969
+ }
23970
+ }
23971
+
23972
+ chart.BuildCacheData();
23973
+ frame.ChartPaint.push(chart);
23974
+
23975
+ var titleIndex=windowIndex+1;
23976
+ var titlePaint=hqChart.TitlePaint[titleIndex];
23977
+ var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);
23978
+ titleData.DataType="ChartKLineTable";
23979
+ titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;
23980
+ }
23981
+
23923
23982
 
23924
23983
  //创建通道
23925
23984
  this.CreateChannel=function(hqChart,windowIndex,varItem,id)
@@ -3806,6 +3806,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3806
3806
 
3807
3807
  this.DestroyPopMenu();
3808
3808
 
3809
+ if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
3810
+
3809
3811
  this.StopLatestPointFlash();
3810
3812
 
3811
3813
  document.oncontextmenu=null;
@@ -33785,6 +33787,7 @@ function ChartKLineTable()
33785
33787
 
33786
33788
  this.TextFont;
33787
33789
  this.TextColor='rgb(0,0,0)';
33790
+ this.Style=0; //0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
33788
33791
 
33789
33792
  this.AryTableData=[];
33790
33793
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
@@ -33810,9 +33813,15 @@ function ChartKLineTable()
33810
33813
  {
33811
33814
  if (!this.BGColor) return;
33812
33815
 
33813
- if (this.BGColor)
33816
+ this.Canvas.fillStyle=this.BGColor;
33817
+ if ((this.Style===1 || this.Style===2) && this.RowHeightType==1)
33818
+ {
33819
+ var height=this.RowCount*this.RowHeight;
33820
+ height=Math.min(rtBG.Height,height);
33821
+ this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-2, height);
33822
+ }
33823
+ else
33814
33824
  {
33815
- this.Canvas.fillStyle=this.BGColor;
33816
33825
  this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-1, rtBG.Height);
33817
33826
  }
33818
33827
  }
@@ -33821,8 +33830,11 @@ function ChartKLineTable()
33821
33830
  {
33822
33831
  if (!this.BorderColor) return;
33823
33832
 
33833
+ var lineCount=30;
33834
+ if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
33835
+
33824
33836
  var yLine=rtBG.Top;
33825
- for(var i=0;i<30;++i)
33837
+ for(var i=0;i<lineCount;++i)
33826
33838
  {
33827
33839
  this.Canvas.beginPath();
33828
33840
  this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
@@ -33872,12 +33884,29 @@ function ChartKLineTable()
33872
33884
  var bottom=border.Bottom;
33873
33885
 
33874
33886
  //绘制背景
33875
- var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
33876
- rtBG.Width=rtBG.Right-rtBG.Left;
33877
- rtBG.Height=rtBG.Bottom-rtBG.Top;
33878
- this.DrawBG(rtBG);
33879
-
33887
+ if (this.Style===1)
33888
+ {
33889
+ var rtBG={ Left:border.LeftEx, Top:border.TopTitle, Right:border.RightEx, Bottom:border.TopEx };
33890
+ rtBG.Width=rtBG.Right-rtBG.Left;
33891
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
33892
+ }
33893
+ else if (this.Style===2)
33894
+ {
33895
+ var rtBG={ Left:border.LeftEx, Top:border.BottomEx, Right:border.RightEx, Bottom:border.Bottom };
33896
+ rtBG.Width=rtBG.Right-rtBG.Left;
33897
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
33898
+ top=rtBG.Top;
33899
+ }
33900
+ else
33901
+ {
33902
+ var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
33903
+ rtBG.Width=rtBG.Right-rtBG.Left;
33904
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
33905
+ }
33906
+
33880
33907
  this.CalculateRowHeight(rtBG);
33908
+
33909
+ this.DrawBG(rtBG);
33881
33910
 
33882
33911
  var itemHeight=this.RowHeight;
33883
33912
  var itemWidth=dataWidth+distanceWidth;
@@ -33910,7 +33939,7 @@ function ChartKLineTable()
33910
33939
  if (!bDrawName) this.DrawRow(mapItem, top, bottom, left, right); //绘制一列
33911
33940
  }
33912
33941
 
33913
- if (this.RowNamePosition==3) this.DrawRightRowName();
33942
+ if (this.RowNamePosition==3) this.DrawRightRowName(rtBG);
33914
33943
 
33915
33944
  this.DrawBorder(rtBG);
33916
33945
  }
@@ -33957,20 +33986,51 @@ function ChartKLineTable()
33957
33986
  }
33958
33987
 
33959
33988
  //绘制右侧行名
33960
- this.DrawRightRowName=function()
33989
+ this.DrawRightRowName=function(rtBG)
33961
33990
  {
33962
33991
  var border=this.ChartFrame.GetBorder();
33963
33992
 
33964
33993
  if (this.BGColor)
33965
33994
  {
33966
- var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
33967
- rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
33968
- rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
33969
- this.Canvas.fillStyle=this.BGColor;
33970
- this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-1, rtRightBG.Height);
33995
+ if (this.Style===1)
33996
+ {
33997
+ var height=this.RowCount*this.RowHeight;
33998
+ height=Math.min(rtBG.Height,height);
33999
+ var width=border.ChartWidth-rtBG.Right-2;
34000
+ var maxTextWidth=0;
34001
+ for(var i=0;i<this.RowName.length;++i)
34002
+ {
34003
+ var item=this.RowName[i];
34004
+ if (!item || !item.Name) continue;
34005
+
34006
+ var textWidth=this.Canvas.measureText(item.Name).width;
34007
+ if (textWidth>maxTextWidth) maxTextWidth=textWidth;
34008
+ }
34009
+ if (maxTextWidth>0)
34010
+ {
34011
+ maxTextWidth+=4;
34012
+ width=Math.min(width, maxTextWidth);
34013
+ }
34014
+
34015
+ var rtRightBG={Left:rtBG.Right+1, Top:rtBG.Top+1, Width:width, Height:height };
34016
+ rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;
34017
+ rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;
34018
+
34019
+
34020
+ this.Canvas.fillStyle=this.BGColor;
34021
+ this.Canvas.fillRect(rtRightBG.Left, rtRightBG.Top, rtRightBG.Width, rtRightBG.Height);
34022
+ }
34023
+ else
34024
+ {
34025
+ var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
34026
+ rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
34027
+ rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
34028
+ this.Canvas.fillStyle=this.BGColor;
34029
+ this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-2, rtRightBG.Height);
34030
+ }
33971
34031
  }
33972
34032
 
33973
- var x=border.RightEx, y=border.TopTitle;
34033
+ var x=rtBG.Right, y=rtBG.Top;
33974
34034
  var yOffset=3;
33975
34035
  if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
33976
34036
  for(var i=0;i<this.RowName.length;++i)
@@ -80772,6 +80832,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80772
80832
  this.PopMinuteChart=null;
80773
80833
  }
80774
80834
 
80835
+ this.ClosePopMinuteChart=function()
80836
+ {
80837
+ if (!this.PopMinuteChart) return;
80838
+
80839
+ this.PopMinuteChart.Close();
80840
+ }
80841
+
80775
80842
  this.ShowMinuteChartDialog=function(data, x,y)
80776
80843
  {
80777
80844
  if (!this.PopMinuteChart) return;
@@ -83360,6 +83427,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
83360
83427
  //周期切换
83361
83428
  this.ChangePeriod=function(period,option)
83362
83429
  {
83430
+ this.ClosePopMinuteChart();
83431
+
83363
83432
  var oldData={ Period:this.Period, Right:this.Right, KLineDrawType:this.KLineDrawType, Symbol:this.Symbol};
83364
83433
 
83365
83434
  var isChangeKLineDrawType=false;
@@ -84918,6 +84987,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
84918
84987
  this.ClearIndexRunCount();
84919
84988
  this.UnlockCorssCursor();
84920
84989
  this.Frame.ClearYCoordinateMaxMin();
84990
+ this.ClosePopMinuteChart();
84921
84991
 
84922
84992
 
84923
84993
  this.Symbol=symbol;
@@ -7902,6 +7902,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7902
7902
 
7903
7903
  this.DestroyPopMenu();
7904
7904
 
7905
+ if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
7906
+
7905
7907
  this.StopLatestPointFlash();
7906
7908
 
7907
7909
  document.oncontextmenu=null;
@@ -37881,6 +37883,7 @@ function ChartKLineTable()
37881
37883
 
37882
37884
  this.TextFont;
37883
37885
  this.TextColor='rgb(0,0,0)';
37886
+ this.Style=0; //0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
37884
37887
 
37885
37888
  this.AryTableData=[];
37886
37889
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
@@ -37906,9 +37909,15 @@ function ChartKLineTable()
37906
37909
  {
37907
37910
  if (!this.BGColor) return;
37908
37911
 
37909
- if (this.BGColor)
37912
+ this.Canvas.fillStyle=this.BGColor;
37913
+ if ((this.Style===1 || this.Style===2) && this.RowHeightType==1)
37914
+ {
37915
+ var height=this.RowCount*this.RowHeight;
37916
+ height=Math.min(rtBG.Height,height);
37917
+ this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-2, height);
37918
+ }
37919
+ else
37910
37920
  {
37911
- this.Canvas.fillStyle=this.BGColor;
37912
37921
  this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-1, rtBG.Height);
37913
37922
  }
37914
37923
  }
@@ -37917,8 +37926,11 @@ function ChartKLineTable()
37917
37926
  {
37918
37927
  if (!this.BorderColor) return;
37919
37928
 
37929
+ var lineCount=30;
37930
+ if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
37931
+
37920
37932
  var yLine=rtBG.Top;
37921
- for(var i=0;i<30;++i)
37933
+ for(var i=0;i<lineCount;++i)
37922
37934
  {
37923
37935
  this.Canvas.beginPath();
37924
37936
  this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
@@ -37968,12 +37980,29 @@ function ChartKLineTable()
37968
37980
  var bottom=border.Bottom;
37969
37981
 
37970
37982
  //绘制背景
37971
- var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
37972
- rtBG.Width=rtBG.Right-rtBG.Left;
37973
- rtBG.Height=rtBG.Bottom-rtBG.Top;
37974
- this.DrawBG(rtBG);
37975
-
37983
+ if (this.Style===1)
37984
+ {
37985
+ var rtBG={ Left:border.LeftEx, Top:border.TopTitle, Right:border.RightEx, Bottom:border.TopEx };
37986
+ rtBG.Width=rtBG.Right-rtBG.Left;
37987
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
37988
+ }
37989
+ else if (this.Style===2)
37990
+ {
37991
+ var rtBG={ Left:border.LeftEx, Top:border.BottomEx, Right:border.RightEx, Bottom:border.Bottom };
37992
+ rtBG.Width=rtBG.Right-rtBG.Left;
37993
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
37994
+ top=rtBG.Top;
37995
+ }
37996
+ else
37997
+ {
37998
+ var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
37999
+ rtBG.Width=rtBG.Right-rtBG.Left;
38000
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
38001
+ }
38002
+
37976
38003
  this.CalculateRowHeight(rtBG);
38004
+
38005
+ this.DrawBG(rtBG);
37977
38006
 
37978
38007
  var itemHeight=this.RowHeight;
37979
38008
  var itemWidth=dataWidth+distanceWidth;
@@ -38006,7 +38035,7 @@ function ChartKLineTable()
38006
38035
  if (!bDrawName) this.DrawRow(mapItem, top, bottom, left, right); //绘制一列
38007
38036
  }
38008
38037
 
38009
- if (this.RowNamePosition==3) this.DrawRightRowName();
38038
+ if (this.RowNamePosition==3) this.DrawRightRowName(rtBG);
38010
38039
 
38011
38040
  this.DrawBorder(rtBG);
38012
38041
  }
@@ -38053,20 +38082,51 @@ function ChartKLineTable()
38053
38082
  }
38054
38083
 
38055
38084
  //绘制右侧行名
38056
- this.DrawRightRowName=function()
38085
+ this.DrawRightRowName=function(rtBG)
38057
38086
  {
38058
38087
  var border=this.ChartFrame.GetBorder();
38059
38088
 
38060
38089
  if (this.BGColor)
38061
38090
  {
38062
- var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
38063
- rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
38064
- rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
38065
- this.Canvas.fillStyle=this.BGColor;
38066
- this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-1, rtRightBG.Height);
38091
+ if (this.Style===1)
38092
+ {
38093
+ var height=this.RowCount*this.RowHeight;
38094
+ height=Math.min(rtBG.Height,height);
38095
+ var width=border.ChartWidth-rtBG.Right-2;
38096
+ var maxTextWidth=0;
38097
+ for(var i=0;i<this.RowName.length;++i)
38098
+ {
38099
+ var item=this.RowName[i];
38100
+ if (!item || !item.Name) continue;
38101
+
38102
+ var textWidth=this.Canvas.measureText(item.Name).width;
38103
+ if (textWidth>maxTextWidth) maxTextWidth=textWidth;
38104
+ }
38105
+ if (maxTextWidth>0)
38106
+ {
38107
+ maxTextWidth+=4;
38108
+ width=Math.min(width, maxTextWidth);
38109
+ }
38110
+
38111
+ var rtRightBG={Left:rtBG.Right+1, Top:rtBG.Top+1, Width:width, Height:height };
38112
+ rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;
38113
+ rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;
38114
+
38115
+
38116
+ this.Canvas.fillStyle=this.BGColor;
38117
+ this.Canvas.fillRect(rtRightBG.Left, rtRightBG.Top, rtRightBG.Width, rtRightBG.Height);
38118
+ }
38119
+ else
38120
+ {
38121
+ var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
38122
+ rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
38123
+ rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
38124
+ this.Canvas.fillStyle=this.BGColor;
38125
+ this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-2, rtRightBG.Height);
38126
+ }
38067
38127
  }
38068
38128
 
38069
- var x=border.RightEx, y=border.TopTitle;
38129
+ var x=rtBG.Right, y=rtBG.Top;
38070
38130
  var yOffset=3;
38071
38131
  if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38072
38132
  for(var i=0;i<this.RowName.length;++i)
@@ -84868,6 +84928,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
84868
84928
  this.PopMinuteChart=null;
84869
84929
  }
84870
84930
 
84931
+ this.ClosePopMinuteChart=function()
84932
+ {
84933
+ if (!this.PopMinuteChart) return;
84934
+
84935
+ this.PopMinuteChart.Close();
84936
+ }
84937
+
84871
84938
  this.ShowMinuteChartDialog=function(data, x,y)
84872
84939
  {
84873
84940
  if (!this.PopMinuteChart) return;
@@ -87456,6 +87523,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87456
87523
  //周期切换
87457
87524
  this.ChangePeriod=function(period,option)
87458
87525
  {
87526
+ this.ClosePopMinuteChart();
87527
+
87459
87528
  var oldData={ Period:this.Period, Right:this.Right, KLineDrawType:this.KLineDrawType, Symbol:this.Symbol};
87460
87529
 
87461
87530
  var isChangeKLineDrawType=false;
@@ -89014,6 +89083,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89014
89083
  this.ClearIndexRunCount();
89015
89084
  this.UnlockCorssCursor();
89016
89085
  this.Frame.ClearYCoordinateMaxMin();
89086
+ this.ClosePopMinuteChart();
89017
89087
 
89018
89088
 
89019
89089
  this.Symbol=symbol;
@@ -130463,6 +130533,9 @@ function OverlayScriptIndex(name,script,args,option)
130463
130533
  case SCRIPT_CHART_NAME.BASELINE_BAR:
130464
130534
  this.CreateBaseLineBar(hqChart,windowIndex,item,i);
130465
130535
  break;
130536
+ case SCRIPT_CHART_NAME.KLINE_TABLE:
130537
+ this.CreateKLineTable(hqChart,windowIndex,item,i);
130538
+ break;
130466
130539
  case "DRAWCOLORKLINE":
130467
130540
  this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
130468
130541
  break;
@@ -131272,6 +131345,7 @@ function OverlayScriptIndex(name,script,args,option)
131272
131345
  }
131273
131346
 
131274
131347
  chart.BuildCacheData();
131348
+ this.SetChartIndexName(chart);
131275
131349
  frame.ChartPaint.push(chart);
131276
131350
  }
131277
131351
 
@@ -131302,6 +131376,61 @@ function OverlayScriptIndex(name,script,args,option)
131302
131376
  frame.ChartPaint.push(chart);
131303
131377
  }
131304
131378
 
131379
+ this.CreateKLineTable=function(hqChart,windowIndex,varItem,id)
131380
+ {
131381
+ var overlayIndex=this.OverlayIndex;
131382
+ var frame=overlayIndex.Frame;
131383
+ var chart=new ChartKLineTable();
131384
+ chart.Canvas=hqChart.Canvas;
131385
+ chart.Name=varItem.Name;
131386
+ chart.HQChart=hqChart;
131387
+ chart.ChartBorder=frame.Frame.ChartBorder;
131388
+ chart.ChartFrame=frame.Frame;
131389
+ chart.Identify=overlayIndex.Identify;
131390
+
131391
+ chart.Data=hqChart.GetKData(); //绑定K线
131392
+ chart.AryTableData=varItem.Draw.DrawData;
131393
+ if (IFrameSplitOperator.IsNumber(varItem.Draw.RowCount)) chart.RowCount=varItem.Draw.RowCount;
131394
+ if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
131395
+
131396
+ var config=varItem.Draw.Config;
131397
+ if (config)
131398
+ {
131399
+ if (config.BGColor) chart.BGColor=config.BGColor;
131400
+ if (config.TextColor) chart.TextColor=config.TextColor;
131401
+ if (config.BorderColor) chart.BorderColor=config.BorderColor;
131402
+ if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
131403
+ if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
131404
+ if (IFrameSplitOperator.IsNumber(config.Style)) chart.Style=config.Style;
131405
+
131406
+ if (config.ItemMergin)
131407
+ {
131408
+ var subItem=config.ItemMergin;
131409
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
131410
+ if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
131411
+ if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
131412
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
131413
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
131414
+ }
131415
+
131416
+ if (config.TextFont)
131417
+ {
131418
+ var subItem=config.TextFont;
131419
+ if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
131420
+ if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
131421
+ }
131422
+ }
131423
+
131424
+ chart.BuildCacheData();
131425
+ frame.ChartPaint.push(chart);
131426
+
131427
+ var titleIndex=windowIndex+1;
131428
+ var titlePaint=hqChart.TitlePaint[titleIndex];
131429
+ var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);
131430
+ titleData.DataType="ChartKLineTable";
131431
+ titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;
131432
+ }
131433
+
131305
131434
 
131306
131435
  //创建通道
131307
131436
  this.CreateChannel=function(hqChart,windowIndex,varItem,id)
@@ -150595,7 +150724,7 @@ function ScrollBarBGChart()
150595
150724
 
150596
150725
 
150597
150726
 
150598
- var HQCHART_VERSION="1.1.14869";
150727
+ var HQCHART_VERSION="1.1.14873";
150599
150728
 
150600
150729
  function PrintHQChartVersion()
150601
150730
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14869";
8
+ var HQCHART_VERSION="1.1.14873";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -7946,6 +7946,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7946
7946
 
7947
7947
  this.DestroyPopMenu();
7948
7948
 
7949
+ if (this.DestroyPopMinuteChart) this.DestroyPopMinuteChart();
7950
+
7949
7951
  this.StopLatestPointFlash();
7950
7952
 
7951
7953
  document.oncontextmenu=null;
@@ -37925,6 +37927,7 @@ function ChartKLineTable()
37925
37927
 
37926
37928
  this.TextFont;
37927
37929
  this.TextColor='rgb(0,0,0)';
37930
+ this.Style=0; //0=全部窗口模式 1=顶部指定行数 2=底部指定行数;
37928
37931
 
37929
37932
  this.AryTableData=[];
37930
37933
  this.MapCache=null; //key=date/date-time value={ Date:, Time:, Data:[ ] }
@@ -37950,9 +37953,15 @@ function ChartKLineTable()
37950
37953
  {
37951
37954
  if (!this.BGColor) return;
37952
37955
 
37953
- if (this.BGColor)
37956
+ this.Canvas.fillStyle=this.BGColor;
37957
+ if ((this.Style===1 || this.Style===2) && this.RowHeightType==1)
37958
+ {
37959
+ var height=this.RowCount*this.RowHeight;
37960
+ height=Math.min(rtBG.Height,height);
37961
+ this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-2, height);
37962
+ }
37963
+ else
37954
37964
  {
37955
- this.Canvas.fillStyle=this.BGColor;
37956
37965
  this.Canvas.fillRect(rtBG.Left+1, rtBG.Top, rtBG.Width-1, rtBG.Height);
37957
37966
  }
37958
37967
  }
@@ -37961,8 +37970,11 @@ function ChartKLineTable()
37961
37970
  {
37962
37971
  if (!this.BorderColor) return;
37963
37972
 
37973
+ var lineCount=30;
37974
+ if (this.Style===1 || this.Style===2) lineCount=this.RowCount+1;
37975
+
37964
37976
  var yLine=rtBG.Top;
37965
- for(var i=0;i<30;++i)
37977
+ for(var i=0;i<lineCount;++i)
37966
37978
  {
37967
37979
  this.Canvas.beginPath();
37968
37980
  this.Canvas.moveTo(rtBG.Left,ToFixedPoint(yLine));
@@ -38012,12 +38024,29 @@ function ChartKLineTable()
38012
38024
  var bottom=border.Bottom;
38013
38025
 
38014
38026
  //绘制背景
38015
- var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
38016
- rtBG.Width=rtBG.Right-rtBG.Left;
38017
- rtBG.Height=rtBG.Bottom-rtBG.Top;
38018
- this.DrawBG(rtBG);
38019
-
38027
+ if (this.Style===1)
38028
+ {
38029
+ var rtBG={ Left:border.LeftEx, Top:border.TopTitle, Right:border.RightEx, Bottom:border.TopEx };
38030
+ rtBG.Width=rtBG.Right-rtBG.Left;
38031
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
38032
+ }
38033
+ else if (this.Style===2)
38034
+ {
38035
+ var rtBG={ Left:border.LeftEx, Top:border.BottomEx, Right:border.RightEx, Bottom:border.Bottom };
38036
+ rtBG.Width=rtBG.Right-rtBG.Left;
38037
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
38038
+ top=rtBG.Top;
38039
+ }
38040
+ else
38041
+ {
38042
+ var rtBG={ Left:border.LeftEx, Top:top, Right:border.RightEx, Bottom:bottom };
38043
+ rtBG.Width=rtBG.Right-rtBG.Left;
38044
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
38045
+ }
38046
+
38020
38047
  this.CalculateRowHeight(rtBG);
38048
+
38049
+ this.DrawBG(rtBG);
38021
38050
 
38022
38051
  var itemHeight=this.RowHeight;
38023
38052
  var itemWidth=dataWidth+distanceWidth;
@@ -38050,7 +38079,7 @@ function ChartKLineTable()
38050
38079
  if (!bDrawName) this.DrawRow(mapItem, top, bottom, left, right); //绘制一列
38051
38080
  }
38052
38081
 
38053
- if (this.RowNamePosition==3) this.DrawRightRowName();
38082
+ if (this.RowNamePosition==3) this.DrawRightRowName(rtBG);
38054
38083
 
38055
38084
  this.DrawBorder(rtBG);
38056
38085
  }
@@ -38097,20 +38126,51 @@ function ChartKLineTable()
38097
38126
  }
38098
38127
 
38099
38128
  //绘制右侧行名
38100
- this.DrawRightRowName=function()
38129
+ this.DrawRightRowName=function(rtBG)
38101
38130
  {
38102
38131
  var border=this.ChartFrame.GetBorder();
38103
38132
 
38104
38133
  if (this.BGColor)
38105
38134
  {
38106
- var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
38107
- rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
38108
- rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
38109
- this.Canvas.fillStyle=this.BGColor;
38110
- this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-1, rtRightBG.Height);
38135
+ if (this.Style===1)
38136
+ {
38137
+ var height=this.RowCount*this.RowHeight;
38138
+ height=Math.min(rtBG.Height,height);
38139
+ var width=border.ChartWidth-rtBG.Right-2;
38140
+ var maxTextWidth=0;
38141
+ for(var i=0;i<this.RowName.length;++i)
38142
+ {
38143
+ var item=this.RowName[i];
38144
+ if (!item || !item.Name) continue;
38145
+
38146
+ var textWidth=this.Canvas.measureText(item.Name).width;
38147
+ if (textWidth>maxTextWidth) maxTextWidth=textWidth;
38148
+ }
38149
+ if (maxTextWidth>0)
38150
+ {
38151
+ maxTextWidth+=4;
38152
+ width=Math.min(width, maxTextWidth);
38153
+ }
38154
+
38155
+ var rtRightBG={Left:rtBG.Right+1, Top:rtBG.Top+1, Width:width, Height:height };
38156
+ rtRightBG.Right=rtRightBG.Left+rtRightBG.Width;
38157
+ rtRightBG.Bottom=rtRightBG.Top+rtRightBG.Height;
38158
+
38159
+
38160
+ this.Canvas.fillStyle=this.BGColor;
38161
+ this.Canvas.fillRect(rtRightBG.Left, rtRightBG.Top, rtRightBG.Width, rtRightBG.Height);
38162
+ }
38163
+ else
38164
+ {
38165
+ var rtRightBG={Left:border.RightEx, Top:border.Top, Right:border.ChartWidth, Bottom:border.Bottom };
38166
+ rtRightBG.Width=rtRightBG.Right-rtRightBG.Left;
38167
+ rtRightBG.Height=rtRightBG.Bottom-rtRightBG.Top;
38168
+ this.Canvas.fillStyle=this.BGColor;
38169
+ this.Canvas.fillRect(rtRightBG.Left+1, rtRightBG.Top, rtRightBG.Width-2, rtRightBG.Height);
38170
+ }
38111
38171
  }
38112
38172
 
38113
- var x=border.RightEx, y=border.TopTitle;
38173
+ var x=rtBG.Right, y=rtBG.Top;
38114
38174
  var yOffset=3;
38115
38175
  if (this.ItemMergin.YOffset) yOffset=this.ItemMergin.YOffset;
38116
38176
  for(var i=0;i<this.RowName.length;++i)
@@ -84912,6 +84972,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
84912
84972
  this.PopMinuteChart=null;
84913
84973
  }
84914
84974
 
84975
+ this.ClosePopMinuteChart=function()
84976
+ {
84977
+ if (!this.PopMinuteChart) return;
84978
+
84979
+ this.PopMinuteChart.Close();
84980
+ }
84981
+
84915
84982
  this.ShowMinuteChartDialog=function(data, x,y)
84916
84983
  {
84917
84984
  if (!this.PopMinuteChart) return;
@@ -87500,6 +87567,8 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
87500
87567
  //周期切换
87501
87568
  this.ChangePeriod=function(period,option)
87502
87569
  {
87570
+ this.ClosePopMinuteChart();
87571
+
87503
87572
  var oldData={ Period:this.Period, Right:this.Right, KLineDrawType:this.KLineDrawType, Symbol:this.Symbol};
87504
87573
 
87505
87574
  var isChangeKLineDrawType=false;
@@ -89058,6 +89127,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
89058
89127
  this.ClearIndexRunCount();
89059
89128
  this.UnlockCorssCursor();
89060
89129
  this.Frame.ClearYCoordinateMaxMin();
89130
+ this.ClosePopMinuteChart();
89061
89131
 
89062
89132
 
89063
89133
  this.Symbol=symbol;
@@ -130507,6 +130577,9 @@ function OverlayScriptIndex(name,script,args,option)
130507
130577
  case SCRIPT_CHART_NAME.BASELINE_BAR:
130508
130578
  this.CreateBaseLineBar(hqChart,windowIndex,item,i);
130509
130579
  break;
130580
+ case SCRIPT_CHART_NAME.KLINE_TABLE:
130581
+ this.CreateKLineTable(hqChart,windowIndex,item,i);
130582
+ break;
130510
130583
  case "DRAWCOLORKLINE":
130511
130584
  this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
130512
130585
  break;
@@ -131316,6 +131389,7 @@ function OverlayScriptIndex(name,script,args,option)
131316
131389
  }
131317
131390
 
131318
131391
  chart.BuildCacheData();
131392
+ this.SetChartIndexName(chart);
131319
131393
  frame.ChartPaint.push(chart);
131320
131394
  }
131321
131395
 
@@ -131346,6 +131420,61 @@ function OverlayScriptIndex(name,script,args,option)
131346
131420
  frame.ChartPaint.push(chart);
131347
131421
  }
131348
131422
 
131423
+ this.CreateKLineTable=function(hqChart,windowIndex,varItem,id)
131424
+ {
131425
+ var overlayIndex=this.OverlayIndex;
131426
+ var frame=overlayIndex.Frame;
131427
+ var chart=new ChartKLineTable();
131428
+ chart.Canvas=hqChart.Canvas;
131429
+ chart.Name=varItem.Name;
131430
+ chart.HQChart=hqChart;
131431
+ chart.ChartBorder=frame.Frame.ChartBorder;
131432
+ chart.ChartFrame=frame.Frame;
131433
+ chart.Identify=overlayIndex.Identify;
131434
+
131435
+ chart.Data=hqChart.GetKData(); //绑定K线
131436
+ chart.AryTableData=varItem.Draw.DrawData;
131437
+ if (IFrameSplitOperator.IsNumber(varItem.Draw.RowCount)) chart.RowCount=varItem.Draw.RowCount;
131438
+ if (IFrameSplitOperator.IsNonEmptyArray(varItem.Draw.RowName)) chart.RowName=varItem.Draw.RowName;
131439
+
131440
+ var config=varItem.Draw.Config;
131441
+ if (config)
131442
+ {
131443
+ if (config.BGColor) chart.BGColor=config.BGColor;
131444
+ if (config.TextColor) chart.TextColor=config.TextColor;
131445
+ if (config.BorderColor) chart.BorderColor=config.BorderColor;
131446
+ if (IFrameSplitOperator.IsNumber(config.RowNamePosition)) chart.RowNamePosition=config.RowNamePosition;
131447
+ if (IFrameSplitOperator.IsNumber(config.RowHeightType)) chart.RowHeightType=config.RowHeightType;
131448
+ if (IFrameSplitOperator.IsNumber(config.Style)) chart.Style=config.Style;
131449
+
131450
+ if (config.ItemMergin)
131451
+ {
131452
+ var subItem=config.ItemMergin;
131453
+ if (IFrameSplitOperator.IsNumber(subItem.Left)) chart.ItemMergin.Left=subItem.Left;
131454
+ if (IFrameSplitOperator.IsNumber(subItem.Top)) chart.ItemMergin.Top=subItem.Top;
131455
+ if (IFrameSplitOperator.IsNumber(subItem.Bottom)) chart.ItemMergin.Bottom=subItem.Bottom;
131456
+ if (IFrameSplitOperator.IsNumber(subItem.Right)) chart.ItemMergin.Right=subItem.Right;
131457
+ if (IFrameSplitOperator.IsNumber(subItem.YOffset)) chart.ItemMergin.YOffset=subItem.YOffset;
131458
+ }
131459
+
131460
+ if (config.TextFont)
131461
+ {
131462
+ var subItem=config.TextFont;
131463
+ if (IFrameSplitOperator.IsNumber(subItem.FontMaxSize)) chart.TextFontConfig.FontMaxSize=subItem.FontMaxSize;
131464
+ if (subItem.Family) chart.TextFontConfig.Family=subItem.Family;
131465
+ }
131466
+ }
131467
+
131468
+ chart.BuildCacheData();
131469
+ frame.ChartPaint.push(chart);
131470
+
131471
+ var titleIndex=windowIndex+1;
131472
+ var titlePaint=hqChart.TitlePaint[titleIndex];
131473
+ var titleData=new DynamicTitleData(chart.Data,chart.BarName,chart.BarColor);
131474
+ titleData.DataType="ChartKLineTable";
131475
+ titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;
131476
+ }
131477
+
131349
131478
 
131350
131479
  //创建通道
131351
131480
  this.CreateChannel=function(hqChart,windowIndex,varItem,id)
@@ -161815,7 +161944,7 @@ function HQChartScriptWorker()
161815
161944
 
161816
161945
 
161817
161946
 
161818
- var HQCHART_VERSION="1.1.14869";
161947
+ var HQCHART_VERSION="1.1.14873";
161819
161948
 
161820
161949
  function PrintHQChartVersion()
161821
161950
  {