hqchart 1.1.12416 → 1.1.12420

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.
@@ -1309,7 +1309,8 @@ Complier:{Log:console.log,Warn:console.warn//编译器日志
1309
1309
  }};}function JSChart(divElement,bOffscreen,bCacheCanvas){this.DivElement=divElement;this.DivToolElement=null;//工具条
1310
1310
  this.JSChartContainer;//画图控件
1311
1311
  //h5 canvas
1312
- this.CanvasElement=document.createElement("canvas");this.CanvasElement.className='jschart-drawing';this.CanvasElement.id=Guid();this.CanvasElement.setAttribute("tabindex",0);if(this.CanvasElement.style){this.CanvasElement.style.outline='none';this.CanvasElement.style.position="absolute";}if(divElement.hasChildNodes()){JSConsole.Chart.Log("[JSChart::JSChart] divElement hasChildNodes",divElement.childNodes);}divElement.appendChild(this.CanvasElement);//离屏
1312
+ this.CanvasElement=document.createElement("canvas");this.CanvasElement.className='jschart-drawing';this.CanvasElement.id=Guid();this.CanvasElement.setAttribute("tabindex",0);if(this.CanvasElement.style){this.CanvasElement.style.outline='none';//this.CanvasElement.style.position="absolute"; //外部自己设置
1313
+ }if(divElement.hasChildNodes()){JSConsole.Chart.Log("[JSChart::JSChart] divElement hasChildNodes",divElement.childNodes);}divElement.appendChild(this.CanvasElement);//离屏
1313
1314
  this.OffscreenCanvasElement;if(bOffscreen==true)this.OffscreenCanvasElement=document.createElement("canvas");//图形缓存
1314
1315
  this.CacheCanvasElement=null;if(bCacheCanvas)this.CacheCanvasElement=document.createElement("canvas");//改参数div
1315
1316
  this.ModifyIndexDialog=new ModifyIndexDialog(divElement);this.ChangeIndexDialog=new ChangeIndexDialog(divElement);this.MinuteDialog=new MinuteDialog(divElement);//额外的画布
@@ -1594,7 +1595,8 @@ ON_CREATE_FRAME:105,ON_DELETE_FRAME:106,ON_SIZE_FRAME:107,ON_TOUCH_SCROLL_UP_DOW
1594
1595
  ON_RECV_REALTIME_DATA:109,//实时数据
1595
1596
  ON_CUSTOM_OVERLAY_TOOLBAR:110,//自定义叠加指标按钮
1596
1597
  //绘图之前的事件
1597
- ON_BEFORE_DRAW:111,ON_BEFORE_DRAW_DYNAMIC_INFO:112};var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
1598
+ ON_BEFORE_DRAW:111,ON_BEFORE_DRAW_DYNAMIC_INFO:112,//自定义图形拖拽
1599
+ ON_CUSTOM_DRAG_MOUSE_DOWN:113,ON_CUSTOM_DRAG_DOC_MOUSE_MOVE:114,ON_CUSTOM_DRAG_DOC_MOUSE_UP:115};var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
1598
1600
  OP_SCROLL_RIGHT:2,//往右移动
1599
1601
  OP_ZOOM_OUT:3,//缩小
1600
1602
  OP_ZOOM_IN:4,//放大
@@ -1698,7 +1700,8 @@ this.EnableIndexChartDrag=false;this.GlobalOption={IsValueFullRange:false,IsDisp
1698
1700
  this.VerticalDrag;//通过X轴左右拖动数据(手势才有)
1699
1701
  this.EnableVerticalDrag=false;//十字光标长留(手势才有)
1700
1702
  this.ClickModel={IsShowCorssCursor:false};this.EnableClickModel=false;//标题栏显示最新数据
1701
- this.DisplayLatestOption={Timer:null,Enable:false,DelayTime:60*1000*3,LastPoint:null};this.DrawDynamicInfoOption={Timer:null,Enable:false,DelayTime:10};//obj={ Element:, Canvas: }
1703
+ this.DisplayLatestOption={Timer:null,Enable:false,DelayTime:60*1000*3,LastPoint:null};this.DrawDynamicInfoOption={Timer:null,Enable:false,DelayTime:10};this.CustomChartDrag;//自定义图形的拖拽操作 { Type:, Data: }
1704
+ //obj={ Element:, Canvas: }
1702
1705
  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 _this2=this;this.StopDisplayLatest();if(!this.DisplayLatestOption.Enable)return;this.DisplayLatestOption.Timer=setTimeout(function(){if(_this2.DisplayLatest){JSConsole.Chart.Log('[JSChartContainer:StartStopDisplayLatest] call this.DisplayLatest()');_this2.DisplayLatest();}},this.DisplayLatestOption.DelayTime);};this.StopDrawDynamicInfo=function(){if(this.DrawDynamicInfoOption.Timer){clearTimeout(this.DrawDynamicInfoOption.Timer);this.DrawDynamicInfoOption.Timer=null;}};this.ChartDestroy=function()//销毁
1703
1706
  {this.IsDestroy=true;this.StopAutoUpdate();if(this.GetLatestVersionTimer!=null){clearTimeout(this.GetLatestVersionTimer);this.GetLatestVersionTimer=null;}};this.ChartDestory=this.ChartDestroy;//老版本写错了,需要兼容下
1704
1707
  this.GetLatestVersionTimer=null;//获取最新版本
@@ -1727,15 +1730,15 @@ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);var titleChart=t
1727
1730
  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);//右键菜单事件
1728
1731
  return false;};this.UIOnDblClick=function(e){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轴上
1729
1732
  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||dragY.IsOverlay==true)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;};//是否可以上下拖拽
1730
- 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.UIOnMouseDown=function(e){var _this5=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;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;}if(this.TryClickCrossCursor(x,y,e)){return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
1733
+ 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.UIOnMouseDown=function(e){var _this5=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;}if(this.TryClickCrossCursor(x,y,e)){return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
1731
1734
  {return;}if(this.TryClickLock){//JSConsole.Chart.Log('[uielement.onmousedown] left, top ',e.clientX, e.clientY, this.getBoundingClientRect().left,this.getBoundingClientRect().top);
1732
1735
  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";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";this.RectSelectDrag={Index:item.PointIndex,Type:item.Type};JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag rect select ",item);}}}if(!this.RectSelectDrag&&this.ClearRectSelect(false))this.Draw();if(this.EnableBorderDrag&&this.Frame){var dragBorder=this.Frame.PtInFrameBorder(x,y);if(dragBorder&&dragBorder.Index>=0){this.UIElement.style.cursor="n-resize";this.BorderDrag={Index:dragBorder.Index};JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] DragBorder ",dragBorder);}}//拖拽Y轴缩放
1733
- if(!this.BorderDrag){var dragY=this.TryYDrag(x,y);if(dragY){this.UIElement.style.cursor=dragY.Position==0?"n-resize":"row-resize";this.YDrag=dragY;JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragY ",dragY);}else{var dragUpDown=this.TryUpDownDrag(x,y);if(dragUpDown){this.UIElement.style.cursor="pointer";this.UpDownDrag=dragUpDown;JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragUpDown ",dragUpDown);}}}if(this.DragMode==0)return;var drag={"Click":{},"LastMove":{},//最后移动的位置
1736
+ if(!this.BorderDrag){var dragY=this.TryYDrag(x,y);if(dragY){this.UIElement.style.cursor=dragY.Position==0?"n-resize":"row-resize";this.YDrag=dragY;JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragY ",dragY);}else{var dragUpDown=this.TryUpDownDrag(x,y);if(dragUpDown){this.UIElement.style.cursor="pointer";this.UpDownDrag=dragUpDown;JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragUpDown ",dragUpDown);}}}var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(event&&event.Callback){var sendData={ChartDrag:null,X:x,Y:y,Cusrsor:null};event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;if(sendData.Cusrsor)this.UIElement.style.cursor=sendData.Cusrsor;}if(this.DragMode==0)return;var drag={"Click":{},"LastMove":{},//最后移动的位置
1734
1737
  CurrentMove:{}//当前的移动
1735
1738
  };drag.Click.X=e.clientX;drag.Click.Y=e.clientY;drag.Click.IsInFrameBottom=this.Frame.PtInFrameBottom(x,y);//是否点击在X轴上
1736
1739
  drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;this.MouseDrag=drag;var drawPictureActive=this.GetActiveDrawPicture();//上一次选中的
1737
1740
  var selectedChart={Chart:this.SelectedChart.Selected.Chart,Identify:this.SelectedChart.Selected.Identify};//上一次选中的图形
1738
- this.SelectChartDrawPicture=null;if(this.BorderDrag){}else if(this.YDrag||this.RectSelectDrag){}else if(this.CurrentChartDrawPicture)//画图工具模式
1741
+ this.SelectChartDrawPicture=null;if(this.BorderDrag){}else if(this.YDrag||this.RectSelectDrag||this.CustomChartDrag){}else if(this.CurrentChartDrawPicture)//画图工具模式
1739
1742
  {this.UpDownDrag=null;//画图优先
1740
1743
  var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==2)this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y);else{this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y);//只有1个点 直接完成
1741
1744
  if(this.FinishChartDrawPicturePoint()){if(drawPicture.IsDrawMain)this.Draw();else this.DrawDynamicInfo();}}if(drawPictureActive.Select.Guid&&(!this.CurrentChartDrawPicture||drawPictureActive.Select.Guid!=this.CurrentChartDrawPicture.Guid)){if(drawPictureActive.Select.Chart.IsDrawMain)this.Draw();}}else//是否在画图工具上
@@ -4098,7 +4101,7 @@ this.ArrawAngle=35;//三角斜边一直线夹角
4098
4101
  this.ArrawLength=10;//三角斜边长度
4099
4102
  this.ArrawLineWidth=5;//箭头粗细
4100
4103
  this.Arrow={Start:false,End:false};//Start=是否绘制开始箭头 <- End=是否绘制结束箭头 ->
4101
- this.IsFullRangeMaxMin=false;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(!this.Data||this.Data.length<=0)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Lines))return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var offset=this.Data.DataOffset;var drawLines=[];var arrowLines=[];for(var i=0;i<this.Lines.length;++i){var line=this.Lines[i];var drawPoints={Point:[],Color:line.Color,AryCircle:null};var drawArrowPoints={Start:[],End:[]};if(line.BGColor)drawPoints.BGColor=line.BGColor;if(IFrameSplitOperator.IsNonEmptyArray(line.Circle))drawPoints.AryCircle=line.Circle;var isExtendLine=false;if(IFrameSplitOperator.IsBool(line.IsExtendLine))isExtendLine=line.IsExtendLine;if(isExtendLine)//左右延申
4104
+ this.IsFullRangeMaxMin=false;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(!this.Data||this.Data.length<=0)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Lines))return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var offset=this.Data.DataOffset;var drawLines=[];var arrowLines=[];for(var i=0;i<this.Lines.length;++i){var line=this.Lines[i];var drawPoints={Point:[],Color:line.Color,AryCircle:null};var drawArrowPoints={Start:[],End:[]};if(line.BGColor)drawPoints.BGColor=line.BGColor;if(IFrameSplitOperator.IsNonEmptyArray(line.Circle))drawPoints.AryCircle=line.Circle;var isExtendLine=false;if(IFrameSplitOperator.IsBool(line.IsExtendLine))isExtendLine=line.IsExtendLine;if(isExtendLine)//左右延申
4102
4105
  {var prePoint=null;var bFirstPoint=true;for(var j=0;j<line.Point.length;++j){var point=line.Point[j];if(!IFrameSplitOperator.IsNumber(point.Index))continue;var index=point.Index-offset;if(index>0&&index<xPointCount){if(bFirstPoint){if(prePoint){var preIndex=prePoint.Index-offset;var x=this.ChartFrame.GetXFromIndex(preIndex,false);var y=this.ChartFrame.GetYFromData(prePoint.Value,false);var pointItem={X:x,Y:y,End:false};drawPoints.Point.push(pointItem);}bFirstPoint=false;}var x=this.ChartFrame.GetXFromIndex(index,false);var y=this.ChartFrame.GetYFromData(point.Value,false);var pointItem={X:x,Y:y,End:false};drawPoints.Point.push(pointItem);}else{if(drawPoints.Point.length>0){var x=this.ChartFrame.GetXFromIndex(index,false);var y=this.ChartFrame.GetYFromData(point.Value,false);var pointItem={X:x,Y:y,End:true};drawPoints.Point.push(pointItem);bFirstPoint=true;prePoint=null;}}prePoint=point;}if(drawPoints.Point.length>=2){drawLines.push(drawPoints);arrowLines.push(drawArrowPoints);}}else{for(var j=0;j<line.Point.length;++j){var point=line.Point[j];if(!IFrameSplitOperator.IsNumber(point.Index))continue;var index=point.Index-offset;if(index>=0&&index<xPointCount){var x=this.ChartFrame.GetXFromIndex(index);var y=this.ChartFrame.GetYFromData(point.Value,false);var pointItem={X:x,Y:y,End:false};drawPoints.Point.push(pointItem);if(j==0||j==1)drawArrowPoints.Start.push(pointItem);//起始点
4103
4106
  if(j==line.Point.length-1||j==line.Point.length-2)drawArrowPoints.End.push(pointItem);//结束点
4104
4107
  }else{if(drawPoints.Point.length>0)drawPoints.Point[drawPoints.Point.length-1].End=true;//点断开
@@ -11156,7 +11159,7 @@ if(IFrameSplitOperator.IsNumber(varItem.YOffset))svgYOffset=varItem.YOffset;if(v
11156
11159
  this.CreateChannel=function(hqChart,windowIndex,varItem,id){var chart=new ChartChannel();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;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;
11157
11160
  chart.Data.Data=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreatePartLine=function(hqChart,windowIndex,varItem,i){var chart=new ChartPartLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))chart.LineWidth=width;}chart.Data.Data=varItem.Draw.DrawData;this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateMultiLine=function(hqChart,windowIndex,varItem,i){var chart=new ChartMultiLine();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11158
11161
  chart.Lines=varItem.Draw.DrawData;if(varItem.Draw.Name)chart.Name=varItem.Draw.Name;if(varItem.Draw.LineDash)chart.LineDash=varItem.Draw.LineDash;if(IFrameSplitOperator.IsNumber(varItem.Draw.LineWidth))chart.LineWidth=varItem.Draw.LineWidth;if(IFrameSplitOperator.IsBool(varItem.Draw.IsFullRangeMaxMin))chart.IsFullRangeMaxMin=varItem.Draw.IsFullRangeMaxMin;if(varItem.Draw.Arrow)//箭头配置
11159
- {var item=varItem.Draw.Arrow;if(item.Start==true)chart.Arrow.Start=true;if(item.End==true)chart.Arrow.End=true;if(IFrameSplitOperator.IsNumber(item.Angle))chart.ArrawAngle=item.Angle;if(IFrameSplitOperator.IsNumber(item.Length))chart.ArrawLength=item.Length;if(IFrameSplitOperator.IsNumber(item.LineWidth))chart.ArrawLineWidth=item.LineWidth;}hqChart.ChartPaint.push(chart);var titleIndex=windowIndex+1;var titleData=new DynamicTitleData(chart.Data,chart.Name,null);titleData.DataType="ChartMultiLine";titleData.Lines=chart.Lines;hqChart.TitlePaint[titleIndex].Data[i]=titleData;};this.CreateMultiPoint=function(hqChart,windowIndex,varItem,i){var chart=new ChartMultiPoint();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11162
+ {var item=varItem.Draw.Arrow;if(item.Start==true)chart.Arrow.Start=true;if(item.End==true)chart.Arrow.End=true;if(IFrameSplitOperator.IsNumber(item.Angle))chart.ArrawAngle=item.Angle;if(IFrameSplitOperator.IsNumber(item.Length))chart.ArrawLength=item.Length;if(IFrameSplitOperator.IsNumber(item.LineWidth))chart.ArrawLineWidth=item.LineWidth;}this.ReloadChartResource(hqChart,windowIndex,chart);hqChart.ChartPaint.push(chart);var titleIndex=windowIndex+1;var titleData=new DynamicTitleData(chart.Data,chart.Name,null);titleData.DataType="ChartMultiLine";titleData.Lines=chart.Lines;hqChart.TitlePaint[titleIndex].Data[i]=titleData;};this.CreateMultiPoint=function(hqChart,windowIndex,varItem,i){var chart=new ChartMultiPoint();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11160
11163
  chart.PointGroup=varItem.Draw.DrawData;if(varItem.Draw.Name)chart.Name=varItem.Draw.Name;hqChart.ChartPaint.push(chart);var titleIndex=windowIndex+1;var titleData=new DynamicTitleData(chart.Data,chart.Name,null);titleData.DataType="ChartMultiPoint";titleData.PointGroup=chart.PointGroup;hqChart.TitlePaint[titleIndex].Data[i]=titleData;};this.CreateMultiBar=function(hqChart,windowIndex,varItem,id){var chart=new ChartMultiBar();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11161
11164
  chart.Bars=varItem.Draw.DrawData;var titleIndex=windowIndex+1;var titleData=new DynamicTitleData({KData:chart.Data,BarData:chart.Bars},varItem.Name,null);titleData.IsShow=false;titleData.DataType="MULTI_BAR";hqChart.TitlePaint[titleIndex].Data[id]=titleData;hqChart.ChartPaint.push(chart);};this.CreateMultiText=function(hqChart,windowIndex,varItem,i){var chart=new ChartMultiText();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
11162
11165
  chart.Texts=varItem.Draw.DrawData;hqChart.ChartPaint.push(chart);};this.CreateMultiSVGIcon=function(hqChart,windowIndex,varItem,i){var chart=new ChartMultiSVGIcon();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Data=hqChart.ChartPaint[0].Data;//绑定K线
@@ -11275,7 +11278,7 @@ this.CreateChannel=function(hqChart,windowIndex,varItem,id){var overlayIndex=thi
11275
11278
  chart.Data.Data=varItem.Draw.DrawData;frame.ChartPaint.push(chart);};//
11276
11279
  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;}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线
11277
11280
  chart.Lines=varItem.Draw.DrawData;if(varItem.Draw.LineDash)chart.LineDash=varItem.Draw.LineDash;if(IFrameSplitOperator.IsNumber(varItem.Draw.LineWidth))chart.LineWidth=varItem.Draw.LineWidth;if(IFrameSplitOperator.IsBool(varItem.Draw.IsFullRangeMaxMin))chart.IsFullRangeMaxMin=varItem.Draw.IsFullRangeMaxMin;if(varItem.Draw.Arrow)//箭头配置
11278
- {var item=varItem.Draw.Arrow;if(item.Start==true)chart.Arrow.Start=true;if(item.End==true)chart.Arrow.End=true;if(IFrameSplitOperator.IsNumber(item.Angle))chart.ArrawAngle=item.Angle;if(IFrameSplitOperator.IsNumber(item.Length))chart.ArrawLength=item.Length;if(IFrameSplitOperator.IsNumber(item.LineWidth))chart.ArrawLineWidth=item.LineWidth;}frame.ChartPaint.push(chart);};this.CreateMultiPoint=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMultiPoint();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线
11281
+ {var item=varItem.Draw.Arrow;if(item.Start==true)chart.Arrow.Start=true;if(item.End==true)chart.Arrow.End=true;if(IFrameSplitOperator.IsNumber(item.Angle))chart.ArrawAngle=item.Angle;if(IFrameSplitOperator.IsNumber(item.Length))chart.ArrawLength=item.Length;if(IFrameSplitOperator.IsNumber(item.LineWidth))chart.ArrawLineWidth=item.LineWidth;}this.ReloadChartResource(hqChart,windowIndex,chart);frame.ChartPaint.push(chart);};this.CreateMultiPoint=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMultiPoint();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线
11279
11282
  chart.PointGroup=varItem.Draw.DrawData;frame.ChartPaint.push(chart);};this.CreateBackgroud=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartBackground();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=frame.Frame.ChartBorder;chart.ChartFrame=frame.Frame;chart.Identify=overlayIndex.Identify;if(varItem.Draw&&varItem.Draw.DrawData){var drawData=varItem.Draw.DrawData;chart.Color=drawData.Color;chart.ColorAngle=drawData.Angle;if(drawData.Data)chart.Data.Data=drawData.Data;}frame.ChartPaint.push(chart);};this.CreateMultiBar=function(hqChart,windowIndex,varItem,id){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMultiBar();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线
11280
11283
  chart.Bars=varItem.Draw.DrawData;var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];var titleData=new DynamicTitleData({KData:chart.Data,BarData:chart.Bars},varItem.Name,null);titleData.IsShow=false;titleData.DataType="MULTI_BAR";titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;frame.ChartPaint.push(chart);};this.CreateMultiText=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMultiText();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线
11281
11284
  chart.Texts=varItem.Draw.DrawData;frame.ChartPaint.push(chart);};this.CreateMultiSVGIcon=function(hqChart,windowIndex,varItem,i){var overlayIndex=this.OverlayIndex;var frame=overlayIndex.Frame;var chart=new ChartMultiSVGIcon();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线
@@ -12463,7 +12466,7 @@ this.AreaColor=g_JSChartResource.ScrollBar.BGChart.AreaColor;//面积图颜色
12463
12466
  };this.Draw=function(){if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.Canvas.save();if(this.LineWidth>0)this.Canvas.lineWidth=this.LineWidth*GetDevicePixelRatio();var bottom=this.ChartBorder.GetBottom();this.Canvas.strokeStyle=this.Color;var bFirstPoint=true;var drawCount=0,x,y;var firstPoint={};for(var i=0;i<this.Data.Data.length;++i){var item=this.Data.Data[i];var value=item.Close;if(!IFrameSplitOperator.IsNumber(value))continue;x=this.ChartFrame.GetXFromIndex(i);y=this.ChartFrame.GetYFromData(value);if(bFirstPoint){this.Canvas.beginPath();this.Canvas.moveTo(x,y);bFirstPoint=false;firstPoint={X:x,Y:y};}else{this.Canvas.lineTo(x,y);}++drawCount;}if(drawCount>0){this.Canvas.stroke();this.Canvas.lineTo(x,bottom);this.Canvas.lineTo(firstPoint.X,bottom);this.Canvas.closePath();this.Canvas.fillStyle=this.AreaColor;this.Canvas.fill();}this.Canvas.restore();};this.GetMaxMin=function(){var range={Max:null,Min:null};if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return range;for(var i=0;i<this.Data.Data.length;++i){var item=this.Data.Data[i];var value=item.Close;if(!IFrameSplitOperator.IsNumber(value))continue;if(range.Max==null||range.Max<value)range.Max=value;if(range.Min==null||range.Min>value)range.Min=value;}return range;};}/********************************************************************************
12464
12467
  * 版本信息输出
12465
12468
  *
12466
- */var HQCHART_VERSION="1.1.12415";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();//把给外界调用的方法暴露出来
12469
+ */var HQCHART_VERSION="1.1.12419";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();//把给外界调用的方法暴露出来
12467
12470
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
12468
12471
  // BaseIndex:BaseIndex,
12469
12472
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "hqchart",
3
3
  "description": "stock chart",
4
4
  "author": "jones2000",
5
- "version": "1.1.12416",
5
+ "version": "1.1.12420",
6
6
  "main": "lib/main.js",
7
7
  "private": false,
8
8
  "license": "Apache License 2.0",
@@ -20276,6 +20276,9 @@ function ScriptIndex(name,script,args,option)
20276
20276
  if (IFrameSplitOperator.IsNumber(item.Length)) chart.ArrawLength=item.Length;
20277
20277
  if (IFrameSplitOperator.IsNumber(item.LineWidth)) chart.ArrawLineWidth=item.LineWidth;
20278
20278
  }
20279
+
20280
+ this.ReloadChartResource(hqChart, windowIndex, chart);
20281
+
20279
20282
  hqChart.ChartPaint.push(chart);
20280
20283
 
20281
20284
  var titleIndex=windowIndex+1;
@@ -21795,6 +21798,9 @@ function OverlayScriptIndex(name,script,args,option)
21795
21798
  if (IFrameSplitOperator.IsNumber(item.Length)) chart.ArrawLength=item.Length;
21796
21799
  if (IFrameSplitOperator.IsNumber(item.LineWidth)) chart.ArrawLineWidth=item.LineWidth;
21797
21800
  }
21801
+
21802
+ this.ReloadChartResource(hqChart, windowIndex, chart);
21803
+
21798
21804
  frame.ChartPaint.push(chart);
21799
21805
  }
21800
21806
 
@@ -36,7 +36,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
36
36
  if (this.CanvasElement.style)
37
37
  {
38
38
  this.CanvasElement.style.outline='none';
39
- this.CanvasElement.style.position="absolute";
39
+ //this.CanvasElement.style.position="absolute"; //外部自己设置
40
40
  }
41
41
  if(divElement.hasChildNodes())
42
42
  {
@@ -2484,6 +2484,11 @@ var JSCHART_EVENT_ID=
2484
2484
  //绘图之前的事件
2485
2485
  ON_BEFORE_DRAW:111,
2486
2486
  ON_BEFORE_DRAW_DYNAMIC_INFO:112,
2487
+
2488
+ //自定义图形拖拽
2489
+ ON_CUSTOM_DRAG_MOUSE_DOWN:113,
2490
+ ON_CUSTOM_DRAG_DOC_MOUSE_MOVE:114,
2491
+ ON_CUSTOM_DRAG_DOC_MOUSE_UP:115,
2487
2492
  }
2488
2493
 
2489
2494
  var JSCHART_OPERATOR_ID=
@@ -2802,6 +2807,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
2802
2807
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
2803
2808
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
2804
2809
 
2810
+ this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
2805
2811
 
2806
2812
  //obj={ Element:, Canvas: }
2807
2813
  this.SetCorssCursorElement=function(obj)
@@ -3150,6 +3156,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3150
3156
  this.UpDownDrag=null;
3151
3157
  this.RectSelectDrag=null;
3152
3158
  this.IndexChartDrag=null;
3159
+ this.CustomChartDrag=null;
3153
3160
 
3154
3161
  var pixelTatio = GetDevicePixelRatio();
3155
3162
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
@@ -3240,6 +3247,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3240
3247
  }
3241
3248
  }
3242
3249
 
3250
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);
3251
+ if (event && event.Callback)
3252
+ {
3253
+ var sendData={ ChartDrag:null, X:x, Y:y, Cusrsor:null };
3254
+ event.Callback(event, sendData, this);
3255
+ this.CustomChartDrag=sendData.ChartDrag;
3256
+
3257
+ if (sendData.Cusrsor) this.UIElement.style.cursor=sendData.Cusrsor;
3258
+ }
3259
+
3243
3260
  if(this.DragMode==0) return;
3244
3261
 
3245
3262
  var drag=
@@ -3264,7 +3281,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3264
3281
  {
3265
3282
 
3266
3283
  }
3267
- else if (this.YDrag || this.RectSelectDrag)
3284
+ else if (this.YDrag || this.RectSelectDrag || this.CustomChartDrag)
3268
3285
  {
3269
3286
 
3270
3287
  }
@@ -34063,7 +34080,7 @@ function ChartMultiLine()
34063
34080
 
34064
34081
  this.Draw=function()
34065
34082
  {
34066
- if (!this.IsShow || this.ChartFrame.IsMinSize) return;
34083
+ if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
34067
34084
  if (!this.Data || this.Data.length<=0) return;
34068
34085
  if (!IFrameSplitOperator.IsNonEmptyArray(this.Lines)) return;
34069
34086
 
@@ -4116,7 +4116,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4116
4116
  if (this.CanvasElement.style)
4117
4117
  {
4118
4118
  this.CanvasElement.style.outline='none';
4119
- this.CanvasElement.style.position="absolute";
4119
+ //this.CanvasElement.style.position="absolute"; //外部自己设置
4120
4120
  }
4121
4121
  if(divElement.hasChildNodes())
4122
4122
  {
@@ -6564,6 +6564,11 @@ var JSCHART_EVENT_ID=
6564
6564
  //绘图之前的事件
6565
6565
  ON_BEFORE_DRAW:111,
6566
6566
  ON_BEFORE_DRAW_DYNAMIC_INFO:112,
6567
+
6568
+ //自定义图形拖拽
6569
+ ON_CUSTOM_DRAG_MOUSE_DOWN:113,
6570
+ ON_CUSTOM_DRAG_DOC_MOUSE_MOVE:114,
6571
+ ON_CUSTOM_DRAG_DOC_MOUSE_UP:115,
6567
6572
  }
6568
6573
 
6569
6574
  var JSCHART_OPERATOR_ID=
@@ -6882,6 +6887,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6882
6887
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
6883
6888
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
6884
6889
 
6890
+ this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
6885
6891
 
6886
6892
  //obj={ Element:, Canvas: }
6887
6893
  this.SetCorssCursorElement=function(obj)
@@ -7230,6 +7236,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7230
7236
  this.UpDownDrag=null;
7231
7237
  this.RectSelectDrag=null;
7232
7238
  this.IndexChartDrag=null;
7239
+ this.CustomChartDrag=null;
7233
7240
 
7234
7241
  var pixelTatio = GetDevicePixelRatio();
7235
7242
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
@@ -7320,6 +7327,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7320
7327
  }
7321
7328
  }
7322
7329
 
7330
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);
7331
+ if (event && event.Callback)
7332
+ {
7333
+ var sendData={ ChartDrag:null, X:x, Y:y, Cusrsor:null };
7334
+ event.Callback(event, sendData, this);
7335
+ this.CustomChartDrag=sendData.ChartDrag;
7336
+
7337
+ if (sendData.Cusrsor) this.UIElement.style.cursor=sendData.Cusrsor;
7338
+ }
7339
+
7323
7340
  if(this.DragMode==0) return;
7324
7341
 
7325
7342
  var drag=
@@ -7344,7 +7361,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7344
7361
  {
7345
7362
 
7346
7363
  }
7347
- else if (this.YDrag || this.RectSelectDrag)
7364
+ else if (this.YDrag || this.RectSelectDrag || this.CustomChartDrag)
7348
7365
  {
7349
7366
 
7350
7367
  }
@@ -38143,7 +38160,7 @@ function ChartMultiLine()
38143
38160
 
38144
38161
  this.Draw=function()
38145
38162
  {
38146
- if (!this.IsShow || this.ChartFrame.IsMinSize) return;
38163
+ if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
38147
38164
  if (!this.Data || this.Data.length<=0) return;
38148
38165
  if (!IFrameSplitOperator.IsNonEmptyArray(this.Lines)) return;
38149
38166
 
@@ -112273,6 +112290,9 @@ function ScriptIndex(name,script,args,option)
112273
112290
  if (IFrameSplitOperator.IsNumber(item.Length)) chart.ArrawLength=item.Length;
112274
112291
  if (IFrameSplitOperator.IsNumber(item.LineWidth)) chart.ArrawLineWidth=item.LineWidth;
112275
112292
  }
112293
+
112294
+ this.ReloadChartResource(hqChart, windowIndex, chart);
112295
+
112276
112296
  hqChart.ChartPaint.push(chart);
112277
112297
 
112278
112298
  var titleIndex=windowIndex+1;
@@ -113792,6 +113812,9 @@ function OverlayScriptIndex(name,script,args,option)
113792
113812
  if (IFrameSplitOperator.IsNumber(item.Length)) chart.ArrawLength=item.Length;
113793
113813
  if (IFrameSplitOperator.IsNumber(item.LineWidth)) chart.ArrawLineWidth=item.LineWidth;
113794
113814
  }
113815
+
113816
+ this.ReloadChartResource(hqChart, windowIndex, chart);
113817
+
113795
113818
  frame.ChartPaint.push(chart);
113796
113819
  }
113797
113820
 
@@ -127513,7 +127536,7 @@ function ScrollBarBGChart()
127513
127536
 
127514
127537
 
127515
127538
 
127516
- var HQCHART_VERSION="1.1.12415";
127539
+ var HQCHART_VERSION="1.1.12419";
127517
127540
 
127518
127541
  function PrintHQChartVersion()
127519
127542
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12415";
8
+ var HQCHART_VERSION="1.1.12419";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -4160,7 +4160,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4160
4160
  if (this.CanvasElement.style)
4161
4161
  {
4162
4162
  this.CanvasElement.style.outline='none';
4163
- this.CanvasElement.style.position="absolute";
4163
+ //this.CanvasElement.style.position="absolute"; //外部自己设置
4164
4164
  }
4165
4165
  if(divElement.hasChildNodes())
4166
4166
  {
@@ -6608,6 +6608,11 @@ var JSCHART_EVENT_ID=
6608
6608
  //绘图之前的事件
6609
6609
  ON_BEFORE_DRAW:111,
6610
6610
  ON_BEFORE_DRAW_DYNAMIC_INFO:112,
6611
+
6612
+ //自定义图形拖拽
6613
+ ON_CUSTOM_DRAG_MOUSE_DOWN:113,
6614
+ ON_CUSTOM_DRAG_DOC_MOUSE_MOVE:114,
6615
+ ON_CUSTOM_DRAG_DOC_MOUSE_UP:115,
6611
6616
  }
6612
6617
 
6613
6618
  var JSCHART_OPERATOR_ID=
@@ -6926,6 +6931,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6926
6931
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
6927
6932
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
6928
6933
 
6934
+ this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
6929
6935
 
6930
6936
  //obj={ Element:, Canvas: }
6931
6937
  this.SetCorssCursorElement=function(obj)
@@ -7274,6 +7280,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7274
7280
  this.UpDownDrag=null;
7275
7281
  this.RectSelectDrag=null;
7276
7282
  this.IndexChartDrag=null;
7283
+ this.CustomChartDrag=null;
7277
7284
 
7278
7285
  var pixelTatio = GetDevicePixelRatio();
7279
7286
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
@@ -7364,6 +7371,16 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7364
7371
  }
7365
7372
  }
7366
7373
 
7374
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);
7375
+ if (event && event.Callback)
7376
+ {
7377
+ var sendData={ ChartDrag:null, X:x, Y:y, Cusrsor:null };
7378
+ event.Callback(event, sendData, this);
7379
+ this.CustomChartDrag=sendData.ChartDrag;
7380
+
7381
+ if (sendData.Cusrsor) this.UIElement.style.cursor=sendData.Cusrsor;
7382
+ }
7383
+
7367
7384
  if(this.DragMode==0) return;
7368
7385
 
7369
7386
  var drag=
@@ -7388,7 +7405,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7388
7405
  {
7389
7406
 
7390
7407
  }
7391
- else if (this.YDrag || this.RectSelectDrag)
7408
+ else if (this.YDrag || this.RectSelectDrag || this.CustomChartDrag)
7392
7409
  {
7393
7410
 
7394
7411
  }
@@ -38187,7 +38204,7 @@ function ChartMultiLine()
38187
38204
 
38188
38205
  this.Draw=function()
38189
38206
  {
38190
- if (!this.IsShow || this.ChartFrame.IsMinSize) return;
38207
+ if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
38191
38208
  if (!this.Data || this.Data.length<=0) return;
38192
38209
  if (!IFrameSplitOperator.IsNonEmptyArray(this.Lines)) return;
38193
38210
 
@@ -112317,6 +112334,9 @@ function ScriptIndex(name,script,args,option)
112317
112334
  if (IFrameSplitOperator.IsNumber(item.Length)) chart.ArrawLength=item.Length;
112318
112335
  if (IFrameSplitOperator.IsNumber(item.LineWidth)) chart.ArrawLineWidth=item.LineWidth;
112319
112336
  }
112337
+
112338
+ this.ReloadChartResource(hqChart, windowIndex, chart);
112339
+
112320
112340
  hqChart.ChartPaint.push(chart);
112321
112341
 
112322
112342
  var titleIndex=windowIndex+1;
@@ -113836,6 +113856,9 @@ function OverlayScriptIndex(name,script,args,option)
113836
113856
  if (IFrameSplitOperator.IsNumber(item.Length)) chart.ArrawLength=item.Length;
113837
113857
  if (IFrameSplitOperator.IsNumber(item.LineWidth)) chart.ArrawLineWidth=item.LineWidth;
113838
113858
  }
113859
+
113860
+ this.ReloadChartResource(hqChart, windowIndex, chart);
113861
+
113839
113862
  frame.ChartPaint.push(chart);
113840
113863
  }
113841
113864
 
@@ -127557,7 +127580,7 @@ function ScrollBarBGChart()
127557
127580
 
127558
127581
 
127559
127582
 
127560
- var HQCHART_VERSION="1.1.12415";
127583
+ var HQCHART_VERSION="1.1.12419";
127561
127584
 
127562
127585
  function PrintHQChartVersion()
127563
127586
  {