hqchart 1.1.11285 → 1.1.11291

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.
@@ -1656,10 +1656,12 @@ if(!this.BorderDrag){var dragY=this.TryYDrag(x,y);if(dragY){this.UIElement.style
1656
1656
  };drag.Click.X=e.clientX;drag.Click.Y=e.clientY;drag.Click.IsInFrameBottom=this.Frame.PtInFrameBottom(x,y);//是否点击在X轴上
1657
1657
  drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;this.MouseDrag=drag;var drawPictureActive=this.GetActiveDrawPicture();//上一次选中的
1658
1658
  var selectedChart={Chart:this.SelectedChart.Selected.Chart,Identify:this.SelectedChart.Selected.Identify};//上一次选中的图形
1659
- this.SelectChartDrawPicture=null;if(this.BorderDrag){}else if(this.YDrag||this.UpDownDrag||this.RectSelectDrag){}else if(this.CurrentChartDrawPicture)//画图工具模式
1660
- {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个点 直接完成
1659
+ this.SelectChartDrawPicture=null;if(this.BorderDrag){}else if(this.YDrag||this.RectSelectDrag){}else if(this.CurrentChartDrawPicture)//画图工具模式
1660
+ {this.UpDownDrag=null;//画图优先
1661
+ 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个点 直接完成
1661
1662
  if(this.FinishChartDrawPicturePoint())this.DrawDynamicInfo();}if(drawPictureActive.Select.Guid&&(!this.CurrentChartDrawPicture||drawPictureActive.Select.Guid!=this.CurrentChartDrawPicture.Guid)){if(drawPictureActive.Select.Chart.IsDrawMain)this.Draw();}}else//是否在画图工具上
1662
- {var drawPictrueData={};drawPictrueData.X=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;drawPictrueData.Y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.GetChartDrawPictureByPoint(drawPictrueData)){if(drawPictrueData.ChartDrawPicture.EnableMove==true){this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;//当前已有选中的,需要刷下
1663
+ {var drawPictrueData={};drawPictrueData.X=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;drawPictrueData.Y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.GetChartDrawPictureByPoint(drawPictrueData)){if(drawPictrueData.ChartDrawPicture.EnableMove==true){this.UpDownDrag=null;//画图优先
1664
+ this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;//当前已有选中的,需要刷下
1663
1665
  var bDraw=false;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)bDraw=true;else if(drawPictrueData.ChartDrawPicture.IsDrawMain)bDraw=true;if(bDraw)this.Draw();drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;//this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
1664
1666
  //this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
1665
1667
  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);//选中画图工具事件
@@ -1755,7 +1757,8 @@ if(option&&option.ParentFunction=='OnMouseMove'&&option.Point){ptPosition=this.F
1755
1757
  var barrageData=null;for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.ClassName==='BarragePaint'){bCreated=true;barrageData=item.BarrageList;break;}}if(!bCreated){var chart=new BarragePaint();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ExtendChartPaint.push(chart);barrageData=chart.BarrageList;}this.EnableAnimation=true;var self=this;window.requestAnimationFrame(function(){self.DrawAnimation();});return barrageData;};this.StopAnimation=function(){this.EnableAnimation=false;this.DrawDynamicInfo();};this.GetChartTooltipData=function(x,y,option){var toolTip=new TooltipData();if(this.ChartInfoPaint){if(this.ChartInfoPaint.GetTooltipData(x,y,toolTip))return toolTip;}if(this.PtInChartPaintTooltip(x,y,toolTip))return toolTip;if(IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)){for(var i=0;i<this.Frame.SubFrame.length;++i){var subFrame=this.Frame.SubFrame[i];for(var j=0;j<subFrame.OverlayIndex.length;++j){var overlayItem=subFrame.OverlayIndex[j];for(var k=0;k<overlayItem.ChartPaint.length;++k){var item=overlayItem.ChartPaint[k];if(item.GetTooltipData(x,y,toolTip))return toolTip;}}}}if(this.PtInOverlayChartPaintTooltip(x,y,toolTip))return toolTip;return null;};this.PtInExtendChartButtons=function(x,y){for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.PtInButtons){var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}}return null;};this.OnMouseMove=function(x,y,e,isPhone){this.LastPoint.X=x;this.LastPoint.Y=y;var mouseStatus=null;//鼠标状态
1756
1758
  var frameID=this.Frame.PtInFrame(x,y);if(IFrameSplitOperator.IsNumber(frameID)&&frameID>=0)//在K线内部移动,调整K线索引
1757
1759
  this.CursorIndex=this.Frame.GetXData(x);var paint=this.GetRectSelectPaint();if(paint&&paint.GetPointCount()>0){var item=paint.PtInPaint(x,y);if(item){mouseStatus={Cursor:"ew-resize",Name:"DragRectSelect"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] drag rect select ",item);}}if(this.EnableBorderDrag&&this.Frame&&!this.CurrentChartDrawPicture){var dragBorder=this.Frame.PtInFrameBorder(x,y);if(dragBorder&&dragBorder.Index>=0){mouseStatus={Cursor:"n-resize",Name:"DragBorder"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] drag border ",dragBorder);}}if(this.EnableYDrag&&this.Frame&&!this.CurrentChartDrawPicture){var dragY=this.TryYDrag(x,y);if(dragY){mouseStatus={Cursor:dragY.Position==0?"n-resize":"row-resize",Name:"DragY"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] drag y ",dragY);}}if(!this.CurrentChartDrawPicture){var button=this.Frame.PtInButtons(x,y);if(button){mouseStatus={Cursor:"pointer",Name:"FrameButton"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame button ",button);}else{button=this.PtInExtendChartButtons(x,y);if(button){mouseStatus={Cursor:"pointer",Name:"ExtendChartButton"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] extend chart button ",button);}}}if(this.ChartCorssCursor){var crossButton=this.ChartCorssCursor.PtInButton(x,y);if(crossButton){mouseStatus={Cursor:"pointer",Name:"CorssCursorButton"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] cross cursor button ",crossButton);}}if(this.ClassName=="KLineChartContainer"&&this.Frame.PtInFrameBottom(x,y)){mouseStatus={Cursor:"ew-resize",Name:"FrameButtom"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame bottom ");}if(this.SelectedChart.EnableMoveOn&&this.PtInChart&&!this.CurrentChartDrawPicture){var chartInfo=this.PtInChart(x,y);if(chartInfo&&chartInfo.Identify){mouseStatus={Cursor:"pointer",Name:"PtInChart"};this.SelectedChart.MoveOn.Identify=chartInfo.Identify;this.SelectedChart.MoveOn.Identify=null;JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] Point in chart ",chartInfo);}else{this.SelectedChart.MoveOn.Identify=null;}}else{this.SelectedChart.MoveOn.Identify=null;}var bDrawPicture=false;//是否正在画图
1758
- if(this.CurrentChartDrawPicture){if(this.CurrentChartDrawPicture.Status!=20)mouseStatus={Cursor:"crosshair",Name:"CurrentChartDrawPicture"};if(this.CurrentChartDrawPicture.SetLastPoint)this.CurrentChartDrawPicture.SetLastPoint({X:x,Y:y});bDrawPicture=true;}else{var drawPictrueData={};drawPictrueData.X=x;drawPictrueData.Y=y;if(this.GetChartDrawPictureByPoint(drawPictrueData)&&drawPictrueData.ChartDrawPicture&&drawPictrueData.ChartDrawPicture.EnableMove==true){if(drawPictrueData.PointIndex===100)this.UIElement.style.cursor="move";else this.UIElement.style.cursor="pointer";bDrawPicture=true;this.MoveOnChartDrawPicture=drawPictrueData.ChartDrawPicture;}else{if(!this.MouseDrag)this.UIElement.style.cursor="default";}}var clientPos=this.PtInClient(x,y);var option={ParentFunction:'OnMouseMove',Point:{X:x,Y:y},IsPhone:isPhone===true,ClientPos:clientPos};if(e&&(e.type=="mouseout"||e.type=="mouseleave")||button)option.Corss=false;//鼠标移开,在按钮上,不显示十字光标
1760
+ if(this.CurrentChartDrawPicture){var index=this.Frame.PtInChartFrame(x,y);if(this.CurrentChartDrawPicture.Status!=20){if(index>=0)mouseStatus={Cursor:"crosshair",Name:"CurrentChartDrawPicture"};else mouseStatus={Cursor:"not-allowed",Name:"CurrentChartDrawPicture"};//不在画图区域
1761
+ }if(this.CurrentChartDrawPicture.SetLastPoint)this.CurrentChartDrawPicture.SetLastPoint({X:x,Y:y});bDrawPicture=true;}else{var drawPictrueData={};drawPictrueData.X=x;drawPictrueData.Y=y;if(this.GetChartDrawPictureByPoint(drawPictrueData)&&drawPictrueData.ChartDrawPicture&&drawPictrueData.ChartDrawPicture.EnableMove==true){if(drawPictrueData.PointIndex===100)this.UIElement.style.cursor="move";else this.UIElement.style.cursor="pointer";bDrawPicture=true;this.MoveOnChartDrawPicture=drawPictrueData.ChartDrawPicture;}else{if(!this.MouseDrag)this.UIElement.style.cursor="default";}}var clientPos=this.PtInClient(x,y);var option={ParentFunction:'OnMouseMove',Point:{X:x,Y:y},IsPhone:isPhone===true,ClientPos:clientPos};if(e&&(e.type=="mouseout"||e.type=="mouseleave")||button)option.Corss=false;//鼠标移开,在按钮上,不显示十字光标
1759
1762
  if(this.SetCorssCursorIndex)this.SetCorssCursorIndex(option);this.DrawDynamicInfo(option);if(mouseStatus)this.UIElement.style.cursor=mouseStatus.Cursor;if(this.IsShowTooltip&&bDrawPicture==false){var toolTip=this.GetChartTooltipData(x,y);if(toolTip&&toolTip.Data){if(isPhone===true){var touche=e.touches[0];var xTooltip=touche.clientX-this.UIElement.getBoundingClientRect().left;var yTooltip=touche.clientY-this.UIElement.getBoundingClientRect().top;}else{var xTooltip=e.clientX-this.UIElement.getBoundingClientRect().left;var yTooltip=e.clientY-this.UIElement.getBoundingClientRect().top;}this.ShowTooltip(xTooltip,yTooltip,toolTip);}else{this.HideTooltip();}}};this.OnKeyDown=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var keyID=e.keyCode?e.keyCode:e.which;switch(keyID){case 37://left
1760
1763
  if(e.ctrlKey&&this.OnCustomKeyDown){if(this.OnCustomKeyDown(keyID,e))break;}if(this.CursorIndex<=0.99999){if(!this.DataMoveLeft()){//左移数据到头了 触发下载新数据
1761
1764
  if(this.DragDownloadData)this.DragDownloadData();break;}this.UpdataDataoffset();this.UpdatePointByCursorIndex();this.UpdateFrameMaxMin();this.Draw();this.ShowTooltipByKeyDown();this.OnKLinePageChange("keydown");}else{--this.CursorIndex;this.UpdatePointByCursorIndex();this.DrawDynamicInfo();this.ShowTooltipByKeyDown();}break;case 39://right
@@ -2567,7 +2570,9 @@ var yValue=frame.GetYData(y);if(frame.YSplitOperator.CoordinateType==1)//百分
2567
2570
  {var firstOpenPrice=frame.YSplitOperator.GetFirstOpenPrice();outObject.RightYValue=((yValue-firstOpenPrice)/firstOpenPrice*100).toFixed(2)+'%';}return yValue;}};this.PtInFrame=function(x,y)//鼠标哪个指标窗口
2568
2571
  {for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];var left=item.Frame.ChartBorder.GetLeft();var top=item.Frame.ChartBorder.GetTop();var width=item.Frame.ChartBorder.GetWidth();var height=item.Frame.ChartBorder.GetHeight();item.Frame.Canvas.beginPath();item.Frame.Canvas.rect(left,top,width,height);if(item.Frame.Canvas.isPointInPath(x,y)){return i;//转成整形
2569
2572
  }}var bottom=this.ChartBorder.GetBottom();var chartHeight=this.ChartBorder.GetChartHeight();var left=this.ChartBorder.GetLeft();var right=this.ChartBorder.GetRight();//底部
2570
- if(x>=left&&x<=right&&y>bottom&&y<chartHeight)return-3;return-1;};this.PtInButtons=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];var button=item.Frame.PtInButtons(x,y);if(button){button.Frame=item.Frame;return button;}for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];var overlayFrame=overlayItem.Frame;if(!overlayFrame||!overlayFrame.PtInButtons)continue;var button=overlayFrame.PtInButtons(x,y);if(button){button.IndexID=overlayItem.Identify;button.FrameID=i;button.OverlayFrame=overlayFrame;button.Frame=item.Frame;return button;}}}return null;};//是否在X轴坐标上
2573
+ if(x>=left&&x<=right&&y>bottom&&y<chartHeight)return-3;return-1;};this.PtInChartFrame=function(x,y)//鼠标在图形区域, 取出上下空白
2574
+ {for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];var left=item.Frame.ChartBorder.GetLeft();var top=item.Frame.ChartBorder.GetTopEx();var width=item.Frame.ChartBorder.GetWidth();var height=item.Frame.ChartBorder.GetHeightEx();item.Frame.Canvas.beginPath();item.Frame.Canvas.rect(left,top,width,height);if(item.Frame.Canvas.isPointInPath(x,y)){return i;//转成整形
2575
+ }}return-1;};this.PtInButtons=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];var button=item.Frame.PtInButtons(x,y);if(button){button.Frame=item.Frame;return button;}for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];var overlayFrame=overlayItem.Frame;if(!overlayFrame||!overlayFrame.PtInButtons)continue;var button=overlayFrame.PtInButtons(x,y);if(button){button.IndexID=overlayItem.Identify;button.FrameID=i;button.OverlayFrame=overlayFrame;button.Frame=item.Frame;return button;}}}return null;};//是否在X轴坐标上
2571
2576
  this.PtInFrameBottom=function(x,y){var left=this.ChartBorder.GetLeft();var top=this.ChartBorder.GetBottom();var width=this.ChartBorder.GetWidth();var height=this.ChartBorder.Bottom;this.Canvas.beginPath();this.Canvas.rect(left,top,width,height);if(this.Canvas.isPointInPath(x,y))return true;return false;};this.GetXFromIndex=function(index){return this.SubFrame[0].Frame.GetXFromIndex(index);};this.GetYFromData=function(value){return this.SubFrame[0].Frame.GetYFromData(value);};this.ZoomUp=function(cursorIndex){var result=this.SubFrame[0].Frame.ZoomUp(cursorIndex);this.UpdateAllFrame();return result;};this.ZoomDown=function(cursorIndex){var result=this.SubFrame[0].Frame.ZoomDown(cursorIndex);this.UpdateAllFrame();return result;};this.XCoordinateZoom=function(step,isMoveLeft){var result=this.SubFrame[0].Frame.XCoordinateZoom(step,isMoveLeft);this.UpdateAllFrame();return result;};//设置重新计算刻度坐标
2572
2577
  this.ResetXYSplit=function(){for(var _i in this.SubFrame){this.SubFrame[_i].Frame.XYSplit=true;}};this.SetLanguage=function(languageID){for(var _i2 in this.SubFrame){var item=this.SubFrame[_i2];if(item&&item.Frame){if(item.Frame.YSplitOperator)item.Frame.YSplitOperator.LanguageID=languageID;if(item.Frame.XSplitOperator)item.Frame.XSplitOperator.LanguageID=languageID;}}};this.GetCurrentPageSize=function()//获取当前页显示的数据个数
2573
2578
  {if(this.SubFrame.length<=0)return null;var item=this.SubFrame[0];if(!item||!item.Frame)return null;return item.Frame.XPointCount;};this.OnSize=function(){var obj={};this.SubFrame[0].Frame.OnSize(obj);this.UpdateAllFrame();return obj;};this.SetDataWidth=function(dataWidth){var obj=this.SubFrame[0].Frame.SetDataWidth(dataWidth);this.UpdateAllFrame();return obj;};this.UpdateAllFrame=function(){var mainFrame=this.SubFrame[0].Frame;for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(i>0)//第1个窗口主坐标已经算好了
@@ -5705,7 +5710,7 @@ this.UpdateOverlayIndex=function(identify){var overlayIndex=this.GetOverlayIndex
5705
5710
  this.ChangeWindowIndexParam=function(index){this.WindowIndex[index].Index[0].Param+=1;this.WindowIndex[index].Index[1].Param+=1;this.UpdateWindowIndex(index);};this.OnDoubleClick=function(x,y,e){if(this.EnableYDrag&&(this.EnableYDrag.Left||this.EnableYDrag.Right)&&this.Frame&&this.Frame.PtInFrameY){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var dragY=this.Frame.PtInFrameY(x,y);if(dragY&&dragY.Index>=0&&dragY.IsOverlay==false){this.CancelZoomUpDownFrameY(dragY);}}var selectedChart;//图形选中
5706
5711
  if(this.SelectedChart.EnableSelected){selectedChart=this.PtInChart(x,y);}var dbClickInfo={SelectedChart:selectedChart};this.DBClickEvent(dbClickInfo,e);if(!selectedChart&&this.EnableZoomIndexWindow)//双击放大缩小
5707
5712
  {var frameId=this.Frame.PtInFrame(x,y);JSConsole.Chart.Log("[KLineChartContainer::OnDoubleClick] frameId",frameId);if(frameId>=this.Frame.ZoomStartWindowIndex){if(this.ZoomIndexWindow(frameId,{X:x,Y:y})){this.Frame.SetSizeChage(true);this.Draw();return true;}}}var event=null;if(this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE))event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);if(!this.MinuteDialog&&!event)return;var tooltip=new TooltipData();if(!this.PtInChartPaintTooltip(x,y,tooltip))return;if(!tooltip.Data)return;if(event){if(this.ClickChartTimer!=null)//清空单击定时器
5708
- {clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var data={Tooltip:tooltip,Stock:{Symbol:this.Symbol,Name:this.Name}};event.Callback(event,data,this);}if(this.MinuteDialog){e.data={Chart:this,Tooltip:tooltip};this.MinuteDialog.DoModal(e);}};this.CancelAutoUpdate=function()//关闭停止更新
5713
+ {clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var data={Tooltip:tooltip,Stock:{Symbol:this.Symbol,Name:this.Name},X:e.clientX,Y:e.clientY};event.Callback(event,data,this);}if(this.MinuteDialog){e.data={Chart:this,Tooltip:tooltip};this.MinuteDialog.DoModal(e);}};this.CancelAutoUpdate=function()//关闭停止更新
5709
5714
  {if(typeof this.AutoUpdateTimer=='number'){clearTimeout(this.AutoUpdateTimer);this.AutoUpdateTimer=undefined;}};//数据自动更新
5710
5715
  this.AutoUpdate=function(waitTime)//waitTime 更新时间
5711
5716
  {this.CancelAutoUpdate();if(!this.IsAutoUpdate)return;if(!this.Symbol)return;var self=this;var marketStatus=MARKET_SUFFIX_NAME.GetMarketStatus(this.Symbol);if(marketStatus==0||marketStatus==3)return;//闭市,盘后
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.11285",
5
+ "version": "1.1.11291",
6
6
  "main": "lib/main.js",
7
7
  "private": false,
8
8
  "license": "Apache License 2.0",
@@ -6789,12 +6789,13 @@ function JSChartContainer(uielement, OffscreenElement)
6789
6789
  {
6790
6790
 
6791
6791
  }
6792
- else if (this.YDrag || this.UpDownDrag || this.RectSelectDrag)
6792
+ else if (this.YDrag || this.RectSelectDrag)
6793
6793
  {
6794
6794
 
6795
6795
  }
6796
6796
  else if (this.CurrentChartDrawPicture) //画图工具模式
6797
6797
  {
6798
+ this.UpDownDrag=null; //画图优先
6798
6799
  var drawPicture=this.CurrentChartDrawPicture;
6799
6800
  if (drawPicture.Status==2)
6800
6801
  this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y);
@@ -6819,6 +6820,7 @@ function JSChartContainer(uielement, OffscreenElement)
6819
6820
  {
6820
6821
  if (drawPictrueData.ChartDrawPicture.EnableMove==true)
6821
6822
  {
6823
+ this.UpDownDrag=null; //画图优先
6822
6824
  this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
6823
6825
  this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
6824
6826
 
@@ -8841,7 +8843,15 @@ function JSChartContainer(uielement, OffscreenElement)
8841
8843
  var bDrawPicture=false; //是否正在画图
8842
8844
  if (this.CurrentChartDrawPicture)
8843
8845
  {
8844
- if (this.CurrentChartDrawPicture.Status!=20) mouseStatus={ Cursor:"crosshair", Name:"CurrentChartDrawPicture"};
8846
+ var index=this.Frame.PtInChartFrame(x,y);
8847
+ if (this.CurrentChartDrawPicture.Status!=20)
8848
+ {
8849
+ if (index>=0)
8850
+ mouseStatus={ Cursor:"crosshair", Name:"CurrentChartDrawPicture"};
8851
+ else
8852
+ mouseStatus={ Cursor:"not-allowed", Name:"CurrentChartDrawPicture"}; //不在画图区域
8853
+ }
8854
+
8845
8855
  if (this.CurrentChartDrawPicture.SetLastPoint) this.CurrentChartDrawPicture.SetLastPoint({X:x,Y:y});
8846
8856
  bDrawPicture=true;
8847
8857
  }
@@ -18055,6 +18065,27 @@ function HQTradeFrame()
18055
18065
  return -1;
18056
18066
  }
18057
18067
 
18068
+ this.PtInChartFrame=function(x,y) //鼠标在图形区域, 取出上下空白
18069
+ {
18070
+ for(var i=0; i<this.SubFrame.length; ++i)
18071
+ {
18072
+ var item=this.SubFrame[i];
18073
+ var left=item.Frame.ChartBorder.GetLeft();
18074
+ var top=item.Frame.ChartBorder.GetTopEx();
18075
+ var width=item.Frame.ChartBorder.GetWidth();
18076
+ var height=item.Frame.ChartBorder.GetHeightEx();
18077
+
18078
+ item.Frame.Canvas.beginPath();
18079
+ item.Frame.Canvas.rect(left,top,width,height);
18080
+ if (item.Frame.Canvas.isPointInPath(x,y))
18081
+ {
18082
+ return i; //转成整形
18083
+ }
18084
+ }
18085
+
18086
+ return -1;
18087
+ }
18088
+
18058
18089
  this.PtInButtons=function(x,y)
18059
18090
  {
18060
18091
  for(var i=0; i<this.SubFrame.length; ++i)
@@ -58915,7 +58946,7 @@ function KLineChartContainer(uielement,OffscreenElement)
58915
58946
  this.ClickChartTimer=null;
58916
58947
  }
58917
58948
 
58918
- var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name } }
58949
+ var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY };
58919
58950
  event.Callback(event,data,this);
58920
58951
  }
58921
58952
 
@@ -6833,12 +6833,13 @@ function JSChartContainer(uielement, OffscreenElement)
6833
6833
  {
6834
6834
 
6835
6835
  }
6836
- else if (this.YDrag || this.UpDownDrag || this.RectSelectDrag)
6836
+ else if (this.YDrag || this.RectSelectDrag)
6837
6837
  {
6838
6838
 
6839
6839
  }
6840
6840
  else if (this.CurrentChartDrawPicture) //画图工具模式
6841
6841
  {
6842
+ this.UpDownDrag=null; //画图优先
6842
6843
  var drawPicture=this.CurrentChartDrawPicture;
6843
6844
  if (drawPicture.Status==2)
6844
6845
  this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y);
@@ -6863,6 +6864,7 @@ function JSChartContainer(uielement, OffscreenElement)
6863
6864
  {
6864
6865
  if (drawPictrueData.ChartDrawPicture.EnableMove==true)
6865
6866
  {
6867
+ this.UpDownDrag=null; //画图优先
6866
6868
  this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
6867
6869
  this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
6868
6870
 
@@ -8885,7 +8887,15 @@ function JSChartContainer(uielement, OffscreenElement)
8885
8887
  var bDrawPicture=false; //是否正在画图
8886
8888
  if (this.CurrentChartDrawPicture)
8887
8889
  {
8888
- if (this.CurrentChartDrawPicture.Status!=20) mouseStatus={ Cursor:"crosshair", Name:"CurrentChartDrawPicture"};
8890
+ var index=this.Frame.PtInChartFrame(x,y);
8891
+ if (this.CurrentChartDrawPicture.Status!=20)
8892
+ {
8893
+ if (index>=0)
8894
+ mouseStatus={ Cursor:"crosshair", Name:"CurrentChartDrawPicture"};
8895
+ else
8896
+ mouseStatus={ Cursor:"not-allowed", Name:"CurrentChartDrawPicture"}; //不在画图区域
8897
+ }
8898
+
8889
8899
  if (this.CurrentChartDrawPicture.SetLastPoint) this.CurrentChartDrawPicture.SetLastPoint({X:x,Y:y});
8890
8900
  bDrawPicture=true;
8891
8901
  }
@@ -18099,6 +18109,27 @@ function HQTradeFrame()
18099
18109
  return -1;
18100
18110
  }
18101
18111
 
18112
+ this.PtInChartFrame=function(x,y) //鼠标在图形区域, 取出上下空白
18113
+ {
18114
+ for(var i=0; i<this.SubFrame.length; ++i)
18115
+ {
18116
+ var item=this.SubFrame[i];
18117
+ var left=item.Frame.ChartBorder.GetLeft();
18118
+ var top=item.Frame.ChartBorder.GetTopEx();
18119
+ var width=item.Frame.ChartBorder.GetWidth();
18120
+ var height=item.Frame.ChartBorder.GetHeightEx();
18121
+
18122
+ item.Frame.Canvas.beginPath();
18123
+ item.Frame.Canvas.rect(left,top,width,height);
18124
+ if (item.Frame.Canvas.isPointInPath(x,y))
18125
+ {
18126
+ return i; //转成整形
18127
+ }
18128
+ }
18129
+
18130
+ return -1;
18131
+ }
18132
+
18102
18133
  this.PtInButtons=function(x,y)
18103
18134
  {
18104
18135
  for(var i=0; i<this.SubFrame.length; ++i)
@@ -58959,7 +58990,7 @@ function KLineChartContainer(uielement,OffscreenElement)
58959
58990
  this.ClickChartTimer=null;
58960
58991
  }
58961
58992
 
58962
- var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name } }
58993
+ var data={ Tooltip:tooltip, Stock:{Symbol:this.Symbol, Name:this.Name }, X:e.clientX, Y:e.clientY };
58963
58994
  event.Callback(event,data,this);
58964
58995
  }
58965
58996