hqchart 1.1.13065 → 1.1.13070
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.
package/lib/umychart.vue.js
CHANGED
|
@@ -1555,7 +1555,7 @@ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);var titleChart=t
|
|
|
1555
1555
|
if(titleChart)titleChart.OnMouseMoveEvent=null;this.StartStopDisplayLatest();};this.IsMouseOnClient=function(x,y){var rect={Left:this.Frame.ChartBorder.GetLeft(),Top:this.Frame.ChartBorder.GetTop(),Width:this.Frame.ChartBorder.GetWidth(),Height:this.Frame.ChartBorder.GetHeight()};rect.Right=rect.Left+rect.Width;rect.Bottom=rect.Top+rect.Height;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom)return true;return false;};this.UIOnContextMenu=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clientY-this.UIElement.getBoundingClientRect().top;if(typeof this.OnRightMenu=='function')this.OnRightMenu(x,y,e);//右键菜单事件
|
|
1556
1556
|
return false;};this.UIOnDblClick=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;this.OnDoubleClick(x,y,e);};//是否在拖拽Y轴上
|
|
1557
1557
|
this.TryYDrag=function(x,y){if(!this.EnableYDrag)return null;if(!this.EnableYDrag.Left&&!this.EnableYDrag.Right)return null;if(!this.Frame||!this.Frame.PtInFrameY)return null;var dragY=this.Frame.PtInFrameY(x,y);if(!dragY||dragY.Index<0)return null;if(dragY.IsOverlay===true){if(!dragY.Right||!this.EnableYDrag.Right)return null;if(this.Frame.IsEnableOverlayDragY(dragY.Index,dragY.OverlayIndex))return dragY;return null;}if(dragY.Left&&this.EnableYDrag.Left&&this.Frame.IsEnableDragY(dragY.Index)){return dragY;}if(dragY.Right&&this.EnableYDrag.Right&&this.Frame.IsEnableDragY(dragY.Index)){return dragY;}return null;};//是否可以上下拖拽
|
|
1558
|
-
this.TryUpDownDrag=function(x,y){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;var item=this.Frame.SubFrame[windowIndex];if(!item||!item.Frame)return null;var frame=item.Frame;if(!frame.YSplitOperator||!frame.YSplitOperator.FixedYMaxMin)return null;return{Index:windowIndex,X:x,Y:y};};this.TryRectSelectDrag=function(x,y){var paint=this.GetRectSelectPaint();if(!paint)return null;if(paint.GetPointCount()<=0)return null;var item=paint.PtInPaint(x,y);return{Item:item,X:x,Y:y};};this.TryClickCrossCursor=function(x,y,e){if(!this.ChartCorssCursor)return;var button=this.ChartCorssCursor.PtInButton(x,y);if(!button)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);if(event&&event.Callback){var sendData={Button:button,e:e};event.Callback(event,sendData,this);}return true;};this.TryClickButton=function(x,y,e){var button=this.Frame.PtInButtons(x,y);if(button&&this.ClickFrameButton){this.ClickFrameButton(button,e);return true;}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}button=this.PtInDrawPictureButtons(x,y);if(button&&this.ClickDrawPictureButton){this.ClickDrawPictureButton(button,e);return true;}button=this.PtInTitleButtons(x,y);if(button&&this.ClickTitleButton){this.ClickTitleButton(button,e);return true;}return false;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this7=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){return;}var bDrawDynamicInfo=false;if(this.GlobalOption.SelectedBorder&&this.GlobalOption.SelectedBorder.Mode>=1){var item=this.GlobalOption.SelectedBorder;var frameId=this.Frame.PtInFrame(x,y);if(frameId>=0&&frameId!=item.SelFrame){item.SelFrame=frameId;bDrawDynamicInfo=true;}}if(this.GlobalOption.SelectedXBorder&&this.GlobalOption.SelectedXBorder.Mode>=1){if(this.PtInMulitDayMinute){var item=this.GlobalOption.SelectedXBorder;var selectedDate=this.PtInMulitDayMinute(x,y);if(item.Date!=selectedDate){item.Date=selectedDate;
|
|
1558
|
+
this.TryUpDownDrag=function(x,y){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;var item=this.Frame.SubFrame[windowIndex];if(!item||!item.Frame)return null;var frame=item.Frame;if(!frame.YSplitOperator||!frame.YSplitOperator.FixedYMaxMin)return null;return{Index:windowIndex,X:x,Y:y};};this.TryRectSelectDrag=function(x,y){var paint=this.GetRectSelectPaint();if(!paint)return null;if(paint.GetPointCount()<=0)return null;var item=paint.PtInPaint(x,y);return{Item:item,X:x,Y:y};};this.TryClickCrossCursor=function(x,y,e){if(!this.ChartCorssCursor)return;var button=this.ChartCorssCursor.PtInButton(x,y);if(!button)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);if(event&&event.Callback){var sendData={Button:button,e:e};event.Callback(event,sendData,this);}return true;};this.TryClickButton=function(x,y,e){var button=this.Frame.PtInButtons(x,y);if(button&&this.ClickFrameButton){this.ClickFrameButton(button,e);return true;}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}button=this.PtInDrawPictureButtons(x,y);if(button&&this.ClickDrawPictureButton){this.ClickDrawPictureButton(button,e);return true;}button=this.PtInTitleButtons(x,y);if(button&&this.ClickTitleButton){this.ClickTitleButton(button,e);return true;}return false;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this7=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){return;}var bDrawDynamicInfo=false;if(this.GlobalOption.SelectedBorder&&this.GlobalOption.SelectedBorder.Mode>=1){var item=this.GlobalOption.SelectedBorder;var frameId=this.Frame.PtInFrame(x,y);if(frameId>=0&&frameId!=item.SelFrame){item.SelFrame=frameId;bDrawDynamicInfo=true;}}var bRedraw=false;if(this.GlobalOption.SelectedXBorder&&this.GlobalOption.SelectedXBorder.Mode>=1){if(this.PtInMulitDayMinute){var item=this.GlobalOption.SelectedXBorder;var selectedDate=this.PtInMulitDayMinute(x,y);if(item.Date!=selectedDate){item.Date=selectedDate;bRedraw=true;}}}if(this.TryClickCrossCursor(x,y,e)){return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
|
|
1559
1559
|
{return;}if(this.TryClickLock){//JSConsole.Chart.Log('[uielement.onmousedown] left, top ',e.clientX, e.clientY, this.getBoundingClientRect().left,this.getBoundingClientRect().top);
|
|
1560
1560
|
if(this.TryClickLock(x,y))return;}this.HideSelectRect();if(this.SelectRectRightMenu)this.SelectRectRightMenu.Hide();if(this.ChartPictureMenu)this.ChartPictureMenu.Hide();var paint=this.GetRectSelectPaint();if(paint&&paint.GetPointCount()>0){var item=paint.PtInPaint(x,y);if(item){if(item.Type==4){//this.UIElement.style.cursor="pointer";
|
|
1561
1561
|
this.SetCursor({Cursor:"pointer"});var obj={X:e.clientX};if(this.GetXDataIndex(obj)){this.RectSelectDrag={DataIndex:obj.DataIndex,Type:item.Type,X:e.clientX};JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag sub rect select ",obj);}}else{//this.UIElement.style.cursor="ew-resize";
|
|
@@ -1578,7 +1578,7 @@ var bDraw=false;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart
|
|
|
1578
1578
|
//this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
|
|
1579
1579
|
this.SelectChartDrawPicture.DragInfo={Click:{X:e.clientX,Y:e.clientY}};}else{this.CurrentChartDrawPicture=null;this.SelectChartDrawPicture=null;}var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
|
|
1580
1580
|
if(event&&event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};event.Callback(event,sendData,this);}else{this.OnSelectChartPicture(drawPictrueData.ChartDrawPicture);//选中画图工具事件
|
|
1581
|
-
}}else{if(this.ClickChartTimer!=null){clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var self=this;var ptClick={X:this.ClickDownPoint.X,Y:this.ClickDownPoint.Y};this.ClickChartTimer=setTimeout(function(){self.TryClickPaintEvent(JSCHART_EVENT_ID.ON_CLICK_CHART_PAINT,ptClick,e);},250);var bSelectedChartChanged=false;if(this.SelectedChart.EnableSelected){var selectChart=this.PtInChart(x,y);if(selectChart){if(this.SelectedChart.Selected.Identify!=selectChart.Identify){this.SelectedChart.Selected.Identify=selectChart.Identify;this.SelectedChart.Selected.Chart=selectChart.Chart;bSelectedChartChanged=true;}if(this.EnableIndexChartDrag){this.IndexChartDrag={SelectedChart:selectChart,LastMove:{X:x,Y:y},Click:{X:x,Y:y}};this.IndexChartDrag.Info=this.GetSelectedChartInfo(selectChart);if(this.IndexChartDrag.Info)this.IndexChartDrag.Info.FrameID=this.Frame.PtInFrame(x,y);}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;this.SelectedChart.Selected.Chart=null;bSelectedChartChanged=true;}}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;bSelectedChartChanged=true;}}if(drawPictureActive.Select.Guid!=null&&this.SelectChartDrawPicture==null||bSelectedChartChanged){var drawType=0;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)drawType=1;if(bSelectedChartChanged){var chart=selectedChart.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(0);drawType=1;}chart=this.SelectedChart.Selected.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(1);drawType=1;}}if(drawType==1)this.Draw();else this.DrawDynamicInfo();}else if(bDrawDynamicInfo){this.DrawDynamicInfo();}}}document.onmousemove=function(e){_this7.DocOnMouseMove(e);};document.onmouseup=function(e){_this7.DocOnMouseUp(e);};};this.DocOnMouseMove=function(e){//加载数据中,禁用鼠标事件
|
|
1581
|
+
}}else{if(this.ClickChartTimer!=null){clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var self=this;var ptClick={X:this.ClickDownPoint.X,Y:this.ClickDownPoint.Y};this.ClickChartTimer=setTimeout(function(){self.TryClickPaintEvent(JSCHART_EVENT_ID.ON_CLICK_CHART_PAINT,ptClick,e);},250);var bSelectedChartChanged=false;if(this.SelectedChart.EnableSelected){var selectChart=this.PtInChart(x,y);if(selectChart){if(this.SelectedChart.Selected.Identify!=selectChart.Identify){this.SelectedChart.Selected.Identify=selectChart.Identify;this.SelectedChart.Selected.Chart=selectChart.Chart;bSelectedChartChanged=true;}if(this.EnableIndexChartDrag){this.IndexChartDrag={SelectedChart:selectChart,LastMove:{X:x,Y:y},Click:{X:x,Y:y}};this.IndexChartDrag.Info=this.GetSelectedChartInfo(selectChart);if(this.IndexChartDrag.Info)this.IndexChartDrag.Info.FrameID=this.Frame.PtInFrame(x,y);}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;this.SelectedChart.Selected.Chart=null;bSelectedChartChanged=true;}}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;bSelectedChartChanged=true;}}if(drawPictureActive.Select.Guid!=null&&this.SelectChartDrawPicture==null||bSelectedChartChanged){var drawType=0;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)drawType=1;if(bSelectedChartChanged){var chart=selectedChart.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(0);drawType=1;}chart=this.SelectedChart.Selected.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(1);drawType=1;}}if(drawType==1)this.Draw();else this.DrawDynamicInfo();}else if(bRedraw){this.Draw();}else if(bDrawDynamicInfo){this.DrawDynamicInfo();}}}document.onmousemove=function(e){_this7.DocOnMouseMove(e);};document.onmouseup=function(e){_this7.DocOnMouseUp(e);};};this.DocOnMouseMove=function(e){//加载数据中,禁用鼠标事件
|
|
1582
1582
|
if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var drag=this.MouseDrag;if(!drag)return;var moveSetp=Math.abs(drag.LastMove.X-e.clientX);var moveSetpY=Math.abs(drag.LastMove.Y-e.clientY);var isDragSelectRect=this.RectSelectDrag&&this.RectSelectDrag.Index>=0;var isDragSubSelectRect=this.RectSelectDrag&&this.RectSelectDrag.Type==4;if(drag.CurrentMove){drag.CurrentMove.X=e.clientX;drag.CurrentMove.Y=e.clientY;}if(this.BorderDrag&&this.BorderDrag.Index>=0)//边框拖动
|
|
1583
1583
|
{if(Math.abs(drag.LastMove.Y-e.clientY)<5)return;var yMove=e.clientY-drag.LastMove.Y;this.OnMoveFromeBorder(this.BorderDrag.Index,yMove);drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}else if(this.YDrag&&this.YDrag.Index>=0)//Y轴缩放
|
|
1584
1584
|
{if(moveSetpY<5)return;var yMove=e.clientY-drag.LastMove.Y;//this.UIElement.style.cursor="n-resize";
|
|
@@ -2139,7 +2139,7 @@ var textRightPrev=null;//上一次刻度输出右边x坐标
|
|
|
2139
2139
|
for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];var x=null;if(mapX&&mapX.has(item.Value))x=mapX.get(item.Value);else x=this.GetXFromIndex(item.Value);if(x>right)break;if(xPrev!=null&&Math.abs(x-xPrev)<this.MinXDistance)continue;var item=this.VerticalInfo[i];var xFixed=ToFixedPoint(x);if(this.IsShowXLine){if(item.LineType==2)//虚线
|
|
2140
2140
|
{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;if(item.LineDash)this.Canvas.setLineDash(item.LineDash);else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]);this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else if(item.LineType==3){}else if(item.LineType>0)//实线
|
|
2141
2141
|
{if(g_JSChartResource.FrameXLineDash){this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.setLineDash(g_JSChartResource.FrameXLineDash);//虚线
|
|
2142
|
-
this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();}}}if(item.BG&&
|
|
2142
|
+
this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();}}}if(item.BG&&this.DrawDayVertical){this.DrawDayVertical(item,x,border);}if(this.VerticalInfo[i].Message[0]!=null){if(this.VerticalInfo[i].Font)this.Canvas.font=this.VerticalInfo[i].Font;var textLeft=0;this.Canvas.strokeStyle=item.TextColor;var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;var textHeight=this.Canvas.measureText("擎").width;if(bottomTextExtend&&bottomTextExtend.Align==1){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else{if(x<testWidth/2){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else if(x+testWidth/2>=this.ChartBorder.GetChartWidth()){this.Canvas.textAlign="right";this.Canvas.textBaseline="top";textLeft=x-testWidth;}else{this.Canvas.textAlign="center";this.Canvas.textBaseline="top";textLeft=x-testWidth/2;}}if(textRightPrev==null||textLeft>textRightPrev){var yText=bottom;if(item.LineType==3){var lineLength=this.ShortXLineLength*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2*pixelRatio;}if(bottomLineExtend){if(bottomLineExtend.Mode===1){if(item.Value>1){if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,bottom);this.Canvas.lineTo(xFixed,border.ChartHeight);this.Canvas.stroke();x+=1;}}else if(bottomLineExtend.Mode===2){if(bottomLineExtend.Width>=1){var lineLength=bottomLineExtend.Width;if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2;}}}//item.TextBGColor="rgb(0,255,0)";
|
|
2143
2143
|
if(item.TextBGColor)//文字背景色
|
|
2144
2144
|
{var rtText={Left:textLeft,Top:yText+this.XBottomOffset,Width:testWidth,Height:textHeight};this.Canvas.fillStyle=item.TextBGColor;this.Canvas.fillRect(rtText.Left-1,rtText.Top,rtText.Width+2,rtText.Height);}this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);textRightPrev=textLeft+testWidth;}}xPrev=x;}};//Y坐标转y轴数值
|
|
2145
2145
|
this.GetYData=function(y,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromData){return this.GetYLogarithmicData(y);}if(this.CoordinateType==1)//反转坐标
|
|
@@ -2216,7 +2216,8 @@ var top=ToFixedPoint(border.Top);var bottom=ToFixedPoint(border.Bottom);this.Can
|
|
|
2216
2216
|
{var left=ToFixedPoint(border.Left);var right=ToFixedPoint(this.ChartBorder.GetLeft());var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);this.DrawCallAuctionVertical(this.BeforeOpenVerticalInfo,this.YSplitOperator.BeforeOpenData,border,true);}if(this.ChartBorder.RightExtendWidth>10)//盘后
|
|
2217
2217
|
{this.Canvas.fillStyle=this.AfterBGColor;var left=ToFixedPoint(this.ChartBorder.GetRight());var right=ToFixedPoint(border.Right);var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);}};//选中的画图工具X轴坐标信息
|
|
2218
2218
|
this.DrawPictureXCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var left=border.Left;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();if(range.X){var xRange=range.X;var xLeft=xRange.Min.X;var xRight=xRange.Max.X;if(xLeft<left)xLeft=left;if(xRight>right)xRight=right;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(xLeft,border.Bottom,xRight-xLeft,fontHeight);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.X<left||item.X>right)continue;var index=parseInt(this.GetXData(item.X));var kItem=this.GetKItem(index,option);if(kItem){//var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);
|
|
2219
|
-
var text=IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");var textWidth=this.Canvas.measureText(text).width+2;var textLeft=item.X-textWidth/2;if(textLeft<left)textLeft=left;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(textLeft,border.Bottom,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yCenter=border.Bottom+fontHeight;this.Canvas.fillText(text,textLeft+1,yCenter);}}};this.GetKItem=function(currentIndex,option){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;if(currentIndex<this.Data.Data.length){return this.Data.Data[currentIndex];}else{var kItem=this.Data.Data[this.Data.Data.length-1];var xDatetime=g_MinuteTimeStringData.GetTimeData(option.Symbol);var index=currentIndex%xDatetime.length;var timeItem=xDatetime[index];return{Date:kItem.Date,Time:timeItem};}}
|
|
2219
|
+
var text=IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");var textWidth=this.Canvas.measureText(text).width+2;var textLeft=item.X-textWidth/2;if(textLeft<left)textLeft=left;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(textLeft,border.Bottom,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yCenter=border.Bottom+fontHeight;this.Canvas.fillText(text,textLeft+1,yCenter);}}};this.GetKItem=function(currentIndex,option){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;if(currentIndex<this.Data.Data.length){return this.Data.Data[currentIndex];}else{var kItem=this.Data.Data[this.Data.Data.length-1];var xDatetime=g_MinuteTimeStringData.GetTimeData(option.Symbol);var index=currentIndex%xDatetime.length;var timeItem=xDatetime[index];return{Date:kItem.Date,Time:timeItem};}};this.DrawDayVertical=function(dayItem,x,border){if(!dayItem.BG)return;var bgItem=dayItem.BG;var xStart=this.GetXFromIndex(bgItem.Index.Start);var xEnd=this.GetXFromIndex(bgItem.Index.End);var maxWidth=xEnd-xStart;var bgHeight=this.ChartBorder.Bottom;if(IFrameSplitOperator.IsNumber(bgItem.Height))bgHeight=bgItem.Height;if(bgItem.Color){this.Canvas.fillStyle=bgItem.Color;var rtBG={Left:xStart,Width:maxWidth,Top:border.Bottom,Height:bgHeight};this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText))//[ [{Text:, Color:},], []]
|
|
2220
|
+
{this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var yText=border.Bottom+2;var lineHeight=this.Canvas.measureText("擎").width+2;for(var i=0,j=0;i<dayItem.AryText.length;++i){var aryText=dayItem.AryText[i];var itemWidth=0;var aryOut=[];for(j=0;j<aryText.length;++j){var item=aryText[j];var textWidth=this.Canvas.measureText(item.Text).width;if(itemWidth+textWidth>maxWidth)break;var newItem={Text:item.Text,Width:textWidth,Color:item.Color,Space:item.Space};itemWidth+=textWidth;item.Width=textWidth;if(item.Space>=1)itemWidth+=item.Space;aryOut.push(newItem);}var xText=xStart+(maxWidth-itemWidth)/2;for(var j=0;j<aryOut.length;++j){var item=aryOut[j];if(!IFrameSplitOperator.IsNumber(item.Width))break;if(item.Color)this.Canvas.fillStyle=item.Color;else if(dayItem.TextColor)this.Canvas.fillStyle=dayItem.TextColor;this.Canvas.fillText(item.Text,xText,yText);xText+=item.Width;if(item.Space>=1)xText+=item.Space;}yText+=lineHeight;}}};//分割x,y轴坐标信息
|
|
2220
2221
|
this.SplitXYCoordinate=function(){if(this.XYSplit==false)return;if(this.XSplitOperator!=null)this.XSplitOperator.Operator();if(this.YSplitOperator!=null)this.YSplitOperator.Operator();};this.GetMultiDayXFromIndex=function(index,border){var dayBorder=border.DayBorder;var minuteIndex=index%this.MinuteCount;var dayIndex=parseInt(index/this.MinuteCount);if(dayIndex>=dayBorder.length)dayIndex=dayBorder.length-1;var client=dayBorder[dayIndex];var count=this.MinuteCount-1;if(minuteIndex>=count){return client.RightEx;}else{var width=client.RightEx-client.LeftEx;var offset=client.LeftEx+width*minuteIndex/count;return offset;}};this.GetXFromIndex=function(index){var count=this.XPointCount-1;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetMultiDayXFromIndex(index,border);if(count==1){if(index==0)return border.LeftEx;else return border.RightEx;}else if(count<=0){return border.LeftEx;}else if(index>=count){return border.RightEx;}else{var width=border.RightEx-border.LeftEx;var offset=border.LeftEx+width*index/count;return offset;}};this.GetMultiDayXData=function(x,border){var dayBorder=border.DayBorder;for(var i=0;i<dayBorder.length;++i){var client=dayBorder[i];if(x>=client.Left&&x<=client.Right){var count=this.MinuteCount-1;var dayMinuteCount=this.MinuteCount*i;if(x<=client.LeftEx)return 0+dayMinuteCount;if(x>=client.RightEx)return count+dayMinuteCount;var width=client.RightEx-client.LeftEx;return(x-client.LeftEx)*(count*1.0/width)+dayMinuteCount;}}};//X坐标转x轴数值
|
|
2221
2222
|
this.GetXData=function(x){var count=this.XPointCount-1;if(count<0)count=0;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetMultiDayXData(x,border);if(x<=border.LeftEx)return 0;if(x>=border.RightEx)return count;var width=border.RightEx-border.LeftEx;return(x-border.LeftEx)*(count*1.0/width);};this.DrawCustomHorizontal=function()//Y轴刻度定制显示
|
|
2222
2223
|
{if(this.IsMinSize)return;for(var i in this.CustomHorizontalInfo){var item=this.CustomHorizontalInfo[i];switch(item.Type){case 0:case 1:this.DrawCustomItem(item);//自定义刻度
|
|
@@ -12696,7 +12697,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
12696
12697
|
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);};}/********************************************************************************
|
|
12697
12698
|
* 版本信息输出
|
|
12698
12699
|
*
|
|
12699
|
-
*/var HQCHART_VERSION="1.1.
|
|
12700
|
+
*/var HQCHART_VERSION="1.1.13069";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
12700
12701
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
12701
12702
|
// BaseIndex:BaseIndex,
|
|
12702
12703
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -3253,6 +3253,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
3255
|
|
|
3256
|
+
var bRedraw=false;
|
|
3256
3257
|
if (this.GlobalOption.SelectedXBorder && this.GlobalOption.SelectedXBorder.Mode>=1)
|
|
3257
3258
|
{
|
|
3258
3259
|
if (this.PtInMulitDayMinute)
|
|
@@ -3262,7 +3263,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3262
3263
|
if (item.Date!=selectedDate)
|
|
3263
3264
|
{
|
|
3264
3265
|
item.Date=selectedDate
|
|
3265
|
-
|
|
3266
|
+
bRedraw=true;
|
|
3266
3267
|
}
|
|
3267
3268
|
}
|
|
3268
3269
|
}
|
|
@@ -3536,6 +3537,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
3536
3537
|
else
|
|
3537
3538
|
this.DrawDynamicInfo();
|
|
3538
3539
|
}
|
|
3540
|
+
else if (bRedraw)
|
|
3541
|
+
{
|
|
3542
|
+
this.Draw();
|
|
3543
|
+
}
|
|
3539
3544
|
else if (bDrawDynamicInfo)
|
|
3540
3545
|
{
|
|
3541
3546
|
this.DrawDynamicInfo();
|
|
@@ -10883,16 +10888,9 @@ function AverageWidthFrame()
|
|
|
10883
10888
|
}
|
|
10884
10889
|
}
|
|
10885
10890
|
|
|
10886
|
-
if (item.BG &&
|
|
10887
|
-
{
|
|
10888
|
-
|
|
10889
|
-
this.Canvas.fillStyle=bgItem.Color;
|
|
10890
|
-
var xStart=this.GetXFromIndex(bgItem.Index.Start);
|
|
10891
|
-
var xEnd=this.GetXFromIndex(bgItem.Index.End);
|
|
10892
|
-
var bgHeight=this.ChartBorder.Bottom;
|
|
10893
|
-
if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
|
|
10894
|
-
var rtBG={Left:xStart, Width:xEnd-xStart, Top:border.Bottom, Height: bgHeight };
|
|
10895
|
-
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
10891
|
+
if (item.BG && this.DrawDayVertical)
|
|
10892
|
+
{
|
|
10893
|
+
this.DrawDayVertical(item, x, border);
|
|
10896
10894
|
}
|
|
10897
10895
|
|
|
10898
10896
|
if (this.VerticalInfo[i].Message[0]!=null)
|
|
@@ -12445,6 +12443,67 @@ function MinuteFrame()
|
|
|
12445
12443
|
}
|
|
12446
12444
|
}
|
|
12447
12445
|
|
|
12446
|
+
this.DrawDayVertical=function(dayItem, x, border)
|
|
12447
|
+
{
|
|
12448
|
+
if (!dayItem.BG) return;
|
|
12449
|
+
|
|
12450
|
+
var bgItem=dayItem.BG;
|
|
12451
|
+
var xStart=this.GetXFromIndex(bgItem.Index.Start);
|
|
12452
|
+
var xEnd=this.GetXFromIndex(bgItem.Index.End);
|
|
12453
|
+
var maxWidth=xEnd-xStart;
|
|
12454
|
+
var bgHeight=this.ChartBorder.Bottom;
|
|
12455
|
+
if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
|
|
12456
|
+
|
|
12457
|
+
if (bgItem.Color)
|
|
12458
|
+
{
|
|
12459
|
+
this.Canvas.fillStyle=bgItem.Color;
|
|
12460
|
+
var rtBG={Left:xStart, Width:maxWidth, Top:border.Bottom, Height: bgHeight };
|
|
12461
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
12462
|
+
}
|
|
12463
|
+
|
|
12464
|
+
if (IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText)) //[ [{Text:, Color:},], []]
|
|
12465
|
+
{
|
|
12466
|
+
this.Canvas.textAlign="left";
|
|
12467
|
+
this.Canvas.textBaseline="top";
|
|
12468
|
+
var yText=border.Bottom+2;
|
|
12469
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
12470
|
+
for(var i=0,j=0;i<dayItem.AryText.length;++i)
|
|
12471
|
+
{
|
|
12472
|
+
var aryText=dayItem.AryText[i];
|
|
12473
|
+
var itemWidth=0;
|
|
12474
|
+
var aryOut=[];
|
|
12475
|
+
for(j=0;j<aryText.length;++j)
|
|
12476
|
+
{
|
|
12477
|
+
var item=aryText[j];
|
|
12478
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
12479
|
+
if (itemWidth+textWidth>maxWidth) break;
|
|
12480
|
+
|
|
12481
|
+
var newItem={ Text:item.Text, Width:textWidth, Color:item.Color, Space:item.Space };
|
|
12482
|
+
itemWidth+=textWidth;
|
|
12483
|
+
item.Width=textWidth;
|
|
12484
|
+
if (item.Space>=1) itemWidth+=item.Space;
|
|
12485
|
+
aryOut.push(newItem);
|
|
12486
|
+
}
|
|
12487
|
+
|
|
12488
|
+
var xText=xStart+(maxWidth-itemWidth)/2;
|
|
12489
|
+
for(var j=0;j<aryOut.length;++j)
|
|
12490
|
+
{
|
|
12491
|
+
var item=aryOut[j];
|
|
12492
|
+
if (!IFrameSplitOperator.IsNumber(item.Width)) break;
|
|
12493
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
12494
|
+
else if (dayItem.TextColor) this.Canvas.fillStyle=dayItem.TextColor;
|
|
12495
|
+
|
|
12496
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
12497
|
+
xText+=item.Width;
|
|
12498
|
+
if (item.Space>=1) xText+=item.Space;
|
|
12499
|
+
}
|
|
12500
|
+
|
|
12501
|
+
yText+=lineHeight;
|
|
12502
|
+
}
|
|
12503
|
+
}
|
|
12504
|
+
|
|
12505
|
+
}
|
|
12506
|
+
|
|
12448
12507
|
//分割x,y轴坐标信息
|
|
12449
12508
|
this.SplitXYCoordinate=function()
|
|
12450
12509
|
{
|
|
@@ -7145,6 +7145,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7145
7145
|
}
|
|
7146
7146
|
}
|
|
7147
7147
|
|
|
7148
|
+
var bRedraw=false;
|
|
7148
7149
|
if (this.GlobalOption.SelectedXBorder && this.GlobalOption.SelectedXBorder.Mode>=1)
|
|
7149
7150
|
{
|
|
7150
7151
|
if (this.PtInMulitDayMinute)
|
|
@@ -7154,7 +7155,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7154
7155
|
if (item.Date!=selectedDate)
|
|
7155
7156
|
{
|
|
7156
7157
|
item.Date=selectedDate
|
|
7157
|
-
|
|
7158
|
+
bRedraw=true;
|
|
7158
7159
|
}
|
|
7159
7160
|
}
|
|
7160
7161
|
}
|
|
@@ -7428,6 +7429,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7428
7429
|
else
|
|
7429
7430
|
this.DrawDynamicInfo();
|
|
7430
7431
|
}
|
|
7432
|
+
else if (bRedraw)
|
|
7433
|
+
{
|
|
7434
|
+
this.Draw();
|
|
7435
|
+
}
|
|
7431
7436
|
else if (bDrawDynamicInfo)
|
|
7432
7437
|
{
|
|
7433
7438
|
this.DrawDynamicInfo();
|
|
@@ -14775,16 +14780,9 @@ function AverageWidthFrame()
|
|
|
14775
14780
|
}
|
|
14776
14781
|
}
|
|
14777
14782
|
|
|
14778
|
-
if (item.BG &&
|
|
14779
|
-
{
|
|
14780
|
-
|
|
14781
|
-
this.Canvas.fillStyle=bgItem.Color;
|
|
14782
|
-
var xStart=this.GetXFromIndex(bgItem.Index.Start);
|
|
14783
|
-
var xEnd=this.GetXFromIndex(bgItem.Index.End);
|
|
14784
|
-
var bgHeight=this.ChartBorder.Bottom;
|
|
14785
|
-
if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
|
|
14786
|
-
var rtBG={Left:xStart, Width:xEnd-xStart, Top:border.Bottom, Height: bgHeight };
|
|
14787
|
-
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
14783
|
+
if (item.BG && this.DrawDayVertical)
|
|
14784
|
+
{
|
|
14785
|
+
this.DrawDayVertical(item, x, border);
|
|
14788
14786
|
}
|
|
14789
14787
|
|
|
14790
14788
|
if (this.VerticalInfo[i].Message[0]!=null)
|
|
@@ -16337,6 +16335,67 @@ function MinuteFrame()
|
|
|
16337
16335
|
}
|
|
16338
16336
|
}
|
|
16339
16337
|
|
|
16338
|
+
this.DrawDayVertical=function(dayItem, x, border)
|
|
16339
|
+
{
|
|
16340
|
+
if (!dayItem.BG) return;
|
|
16341
|
+
|
|
16342
|
+
var bgItem=dayItem.BG;
|
|
16343
|
+
var xStart=this.GetXFromIndex(bgItem.Index.Start);
|
|
16344
|
+
var xEnd=this.GetXFromIndex(bgItem.Index.End);
|
|
16345
|
+
var maxWidth=xEnd-xStart;
|
|
16346
|
+
var bgHeight=this.ChartBorder.Bottom;
|
|
16347
|
+
if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
|
|
16348
|
+
|
|
16349
|
+
if (bgItem.Color)
|
|
16350
|
+
{
|
|
16351
|
+
this.Canvas.fillStyle=bgItem.Color;
|
|
16352
|
+
var rtBG={Left:xStart, Width:maxWidth, Top:border.Bottom, Height: bgHeight };
|
|
16353
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
16354
|
+
}
|
|
16355
|
+
|
|
16356
|
+
if (IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText)) //[ [{Text:, Color:},], []]
|
|
16357
|
+
{
|
|
16358
|
+
this.Canvas.textAlign="left";
|
|
16359
|
+
this.Canvas.textBaseline="top";
|
|
16360
|
+
var yText=border.Bottom+2;
|
|
16361
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
16362
|
+
for(var i=0,j=0;i<dayItem.AryText.length;++i)
|
|
16363
|
+
{
|
|
16364
|
+
var aryText=dayItem.AryText[i];
|
|
16365
|
+
var itemWidth=0;
|
|
16366
|
+
var aryOut=[];
|
|
16367
|
+
for(j=0;j<aryText.length;++j)
|
|
16368
|
+
{
|
|
16369
|
+
var item=aryText[j];
|
|
16370
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
16371
|
+
if (itemWidth+textWidth>maxWidth) break;
|
|
16372
|
+
|
|
16373
|
+
var newItem={ Text:item.Text, Width:textWidth, Color:item.Color, Space:item.Space };
|
|
16374
|
+
itemWidth+=textWidth;
|
|
16375
|
+
item.Width=textWidth;
|
|
16376
|
+
if (item.Space>=1) itemWidth+=item.Space;
|
|
16377
|
+
aryOut.push(newItem);
|
|
16378
|
+
}
|
|
16379
|
+
|
|
16380
|
+
var xText=xStart+(maxWidth-itemWidth)/2;
|
|
16381
|
+
for(var j=0;j<aryOut.length;++j)
|
|
16382
|
+
{
|
|
16383
|
+
var item=aryOut[j];
|
|
16384
|
+
if (!IFrameSplitOperator.IsNumber(item.Width)) break;
|
|
16385
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
16386
|
+
else if (dayItem.TextColor) this.Canvas.fillStyle=dayItem.TextColor;
|
|
16387
|
+
|
|
16388
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
16389
|
+
xText+=item.Width;
|
|
16390
|
+
if (item.Space>=1) xText+=item.Space;
|
|
16391
|
+
}
|
|
16392
|
+
|
|
16393
|
+
yText+=lineHeight;
|
|
16394
|
+
}
|
|
16395
|
+
}
|
|
16396
|
+
|
|
16397
|
+
}
|
|
16398
|
+
|
|
16340
16399
|
//分割x,y轴坐标信息
|
|
16341
16400
|
this.SplitXYCoordinate=function()
|
|
16342
16401
|
{
|
|
@@ -130673,7 +130732,7 @@ function ScrollBarBGChart()
|
|
|
130673
130732
|
|
|
130674
130733
|
|
|
130675
130734
|
|
|
130676
|
-
var HQCHART_VERSION="1.1.
|
|
130735
|
+
var HQCHART_VERSION="1.1.13069";
|
|
130677
130736
|
|
|
130678
130737
|
function PrintHQChartVersion()
|
|
130679
130738
|
{
|
|
@@ -7189,6 +7189,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7189
7189
|
}
|
|
7190
7190
|
}
|
|
7191
7191
|
|
|
7192
|
+
var bRedraw=false;
|
|
7192
7193
|
if (this.GlobalOption.SelectedXBorder && this.GlobalOption.SelectedXBorder.Mode>=1)
|
|
7193
7194
|
{
|
|
7194
7195
|
if (this.PtInMulitDayMinute)
|
|
@@ -7198,7 +7199,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7198
7199
|
if (item.Date!=selectedDate)
|
|
7199
7200
|
{
|
|
7200
7201
|
item.Date=selectedDate
|
|
7201
|
-
|
|
7202
|
+
bRedraw=true;
|
|
7202
7203
|
}
|
|
7203
7204
|
}
|
|
7204
7205
|
}
|
|
@@ -7472,6 +7473,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7472
7473
|
else
|
|
7473
7474
|
this.DrawDynamicInfo();
|
|
7474
7475
|
}
|
|
7476
|
+
else if (bRedraw)
|
|
7477
|
+
{
|
|
7478
|
+
this.Draw();
|
|
7479
|
+
}
|
|
7475
7480
|
else if (bDrawDynamicInfo)
|
|
7476
7481
|
{
|
|
7477
7482
|
this.DrawDynamicInfo();
|
|
@@ -14819,16 +14824,9 @@ function AverageWidthFrame()
|
|
|
14819
14824
|
}
|
|
14820
14825
|
}
|
|
14821
14826
|
|
|
14822
|
-
if (item.BG &&
|
|
14823
|
-
{
|
|
14824
|
-
|
|
14825
|
-
this.Canvas.fillStyle=bgItem.Color;
|
|
14826
|
-
var xStart=this.GetXFromIndex(bgItem.Index.Start);
|
|
14827
|
-
var xEnd=this.GetXFromIndex(bgItem.Index.End);
|
|
14828
|
-
var bgHeight=this.ChartBorder.Bottom;
|
|
14829
|
-
if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
|
|
14830
|
-
var rtBG={Left:xStart, Width:xEnd-xStart, Top:border.Bottom, Height: bgHeight };
|
|
14831
|
-
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
14827
|
+
if (item.BG && this.DrawDayVertical)
|
|
14828
|
+
{
|
|
14829
|
+
this.DrawDayVertical(item, x, border);
|
|
14832
14830
|
}
|
|
14833
14831
|
|
|
14834
14832
|
if (this.VerticalInfo[i].Message[0]!=null)
|
|
@@ -16381,6 +16379,67 @@ function MinuteFrame()
|
|
|
16381
16379
|
}
|
|
16382
16380
|
}
|
|
16383
16381
|
|
|
16382
|
+
this.DrawDayVertical=function(dayItem, x, border)
|
|
16383
|
+
{
|
|
16384
|
+
if (!dayItem.BG) return;
|
|
16385
|
+
|
|
16386
|
+
var bgItem=dayItem.BG;
|
|
16387
|
+
var xStart=this.GetXFromIndex(bgItem.Index.Start);
|
|
16388
|
+
var xEnd=this.GetXFromIndex(bgItem.Index.End);
|
|
16389
|
+
var maxWidth=xEnd-xStart;
|
|
16390
|
+
var bgHeight=this.ChartBorder.Bottom;
|
|
16391
|
+
if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
|
|
16392
|
+
|
|
16393
|
+
if (bgItem.Color)
|
|
16394
|
+
{
|
|
16395
|
+
this.Canvas.fillStyle=bgItem.Color;
|
|
16396
|
+
var rtBG={Left:xStart, Width:maxWidth, Top:border.Bottom, Height: bgHeight };
|
|
16397
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
16398
|
+
}
|
|
16399
|
+
|
|
16400
|
+
if (IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText)) //[ [{Text:, Color:},], []]
|
|
16401
|
+
{
|
|
16402
|
+
this.Canvas.textAlign="left";
|
|
16403
|
+
this.Canvas.textBaseline="top";
|
|
16404
|
+
var yText=border.Bottom+2;
|
|
16405
|
+
var lineHeight=this.Canvas.measureText("擎").width+2;
|
|
16406
|
+
for(var i=0,j=0;i<dayItem.AryText.length;++i)
|
|
16407
|
+
{
|
|
16408
|
+
var aryText=dayItem.AryText[i];
|
|
16409
|
+
var itemWidth=0;
|
|
16410
|
+
var aryOut=[];
|
|
16411
|
+
for(j=0;j<aryText.length;++j)
|
|
16412
|
+
{
|
|
16413
|
+
var item=aryText[j];
|
|
16414
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
16415
|
+
if (itemWidth+textWidth>maxWidth) break;
|
|
16416
|
+
|
|
16417
|
+
var newItem={ Text:item.Text, Width:textWidth, Color:item.Color, Space:item.Space };
|
|
16418
|
+
itemWidth+=textWidth;
|
|
16419
|
+
item.Width=textWidth;
|
|
16420
|
+
if (item.Space>=1) itemWidth+=item.Space;
|
|
16421
|
+
aryOut.push(newItem);
|
|
16422
|
+
}
|
|
16423
|
+
|
|
16424
|
+
var xText=xStart+(maxWidth-itemWidth)/2;
|
|
16425
|
+
for(var j=0;j<aryOut.length;++j)
|
|
16426
|
+
{
|
|
16427
|
+
var item=aryOut[j];
|
|
16428
|
+
if (!IFrameSplitOperator.IsNumber(item.Width)) break;
|
|
16429
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
16430
|
+
else if (dayItem.TextColor) this.Canvas.fillStyle=dayItem.TextColor;
|
|
16431
|
+
|
|
16432
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
16433
|
+
xText+=item.Width;
|
|
16434
|
+
if (item.Space>=1) xText+=item.Space;
|
|
16435
|
+
}
|
|
16436
|
+
|
|
16437
|
+
yText+=lineHeight;
|
|
16438
|
+
}
|
|
16439
|
+
}
|
|
16440
|
+
|
|
16441
|
+
}
|
|
16442
|
+
|
|
16384
16443
|
//分割x,y轴坐标信息
|
|
16385
16444
|
this.SplitXYCoordinate=function()
|
|
16386
16445
|
{
|
|
@@ -130831,7 +130890,7 @@ function HQChartScriptWorker()
|
|
|
130831
130890
|
|
|
130832
130891
|
|
|
130833
130892
|
|
|
130834
|
-
var HQCHART_VERSION="1.1.
|
|
130893
|
+
var HQCHART_VERSION="1.1.13069";
|
|
130835
130894
|
|
|
130836
130895
|
function PrintHQChartVersion()
|
|
130837
130896
|
{
|