hqchart 1.1.12418 → 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//是否在画图工具上
@@ -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.12417";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.12418",
5
+ "version": "1.1.12420",
6
6
  "main": "lib/main.js",
7
7
  "private": false,
8
8
  "license": "Apache License 2.0",
@@ -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
  }
@@ -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
  }
@@ -127519,7 +127536,7 @@ function ScrollBarBGChart()
127519
127536
 
127520
127537
 
127521
127538
 
127522
- var HQCHART_VERSION="1.1.12417";
127539
+ var HQCHART_VERSION="1.1.12419";
127523
127540
 
127524
127541
  function PrintHQChartVersion()
127525
127542
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12417";
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
  }
@@ -127563,7 +127580,7 @@ function ScrollBarBGChart()
127563
127580
 
127564
127581
 
127565
127582
 
127566
- var HQCHART_VERSION="1.1.12417";
127583
+ var HQCHART_VERSION="1.1.12419";
127567
127584
 
127568
127585
  function PrintHQChartVersion()
127569
127586
  {