hqchart 1.1.14713 → 1.1.14722

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.
@@ -1543,7 +1543,8 @@ SEARCH_DIALOG_ON_CLICK_INDEX:163,//切换指标-指标对话框
1543
1543
  ON_CALCULATE_CHIP_DATA:164,//计算筹码数据 (筹码图用)
1544
1544
  ON_CLICK_DEAL_ROW:165,ON_RCLICK_DEAL_ROW:166,ON_DBCLICK_DEAL_ROW:167,ON_FORMAT_OVERLAY_INDEX_OUT_TEXT:168,//格式化叠指标标题
1545
1545
  ON_TOUCH_FAST_SLIDE:169,//快速滑动
1546
- ON_CLICK_CROSSCURSOR_BOTTOM:170//十字光标底部文字点击
1546
+ ON_CLICK_CROSSCURSOR_BOTTOM:170,//十字光标底部文字点击
1547
+ ON_CLICK_CHART_CELL:171//点击图形单元
1547
1548
  };var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
1548
1549
  OP_SCROLL_RIGHT:2,//往右移动
1549
1550
  OP_ZOOM_OUT:3,//缩小
@@ -1728,7 +1729,7 @@ LockCorssCursor:{X:{Enable:false}},//图形中的单元选中状态
1728
1729
  MapIndexChartCache:new _map2.default()//key 指标GUID
1729
1730
  };this.VerticalDrag;//通过X轴左右拖动数据(手势才有)
1730
1731
  this.EnableVerticalDrag=false;//十字光标长留(手势才有)
1731
- this.ClickModel={IsShowCorssCursor:false,PreventHide:false};//PreventHide 阻止隐藏十字光标
1732
+ this.ClickModel={IsShowCorssCursor:false,PreventHide:false,IsClickButton:false};//PreventHide 阻止隐藏十字光标
1732
1733
  this.EnableClickModel=false;//标题栏显示最新数据
1733
1734
  this.DisplayLatestOption={Timer:null,Enable:false,DelayTime:60*1000*3,LastPoint:null};this.DrawDynamicInfoOption={Timer:null,Enable:false,DelayTime:10};this.CustomChartDrag;//自定义图形的拖拽操作 { Type:, Data: }
1734
1735
  this.StockCache={Data:null};//扩展数据缓存数据
@@ -1765,7 +1766,7 @@ uielement.onmousemove=function(e){_this6.UIOnMouseMove(e);};uielement.oncontextm
1765
1766
  var pixelTatio=GetDevicePixelRatio();//鼠标移动坐标是原始坐标 需要乘以放大倍速
1766
1767
  var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;this.StopDisplayLatest();//加载数据中,禁用鼠标事件
1767
1768
  this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;if(this.DisableMouse==true)return;if(this.BorderDrag)return;if(this.YDrag)return;if(this.IndexChartDrag)return;if(this.CustomChartDrag)return;//if (this.RectSelectDrag) return;
1768
- /*
1769
+ if(this.EnableClickModel&&this.ClickModel.IsClickButton)return;/*
1769
1770
  if (this.CurrentChartDrawPicture)
1770
1771
  {
1771
1772
  var drawPicture=this.CurrentChartDrawPicture;
@@ -1781,7 +1782,7 @@ return;}var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clie
1781
1782
  };this.UIOnDblClick=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;this.OnDoubleClick(x,y,e);};//是否在拖拽Y轴上
1782
1783
  this.TryYDrag=function(x,y){if(!this.EnableYDrag)return null;if(!this.EnableYDrag.Left&&!this.EnableYDrag.Right)return null;if(!this.Frame||!this.Frame.PtInFrameY)return null;var dragY=this.Frame.PtInFrameY(x,y);if(!dragY||dragY.Index<0)return null;if(dragY.IsOverlay===true){if(!dragY.Right||!this.EnableYDrag.Right)return null;if(this.Frame.IsEnableOverlayDragY(dragY.Index,dragY.OverlayIndex))return dragY;return null;}if(dragY.Left&&this.EnableYDrag.Left&&this.Frame.IsEnableDragY(dragY.Index)){return dragY;}if(dragY.Right&&this.EnableYDrag.Right&&this.Frame.IsEnableDragY(dragY.Index)){return dragY;}return null;};//是否可以上下拖拽
1783
1784
  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;if(button.Type==1){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);}}else if(button.Type==2){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_BOTTOM);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;}var label=this.Frame.PtInHorizontalLabel(x,y);if(label&&this.ClickHorizontalLabel){this.ClickHorizontalLabel(label,e);return true;}return false;};//点击图新内部元素
1784
- this.TryClickChartCell=function(x,y,e){var result=null;for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.ClickCell)continue;if(item.IsHideScriptIndex())continue;result=item.ClickCell(x,y,e);if(result)return result;}for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(!item.ClickCell)continue;result=item.ClickCell(x,y,e);if(result)return result;}for(var i=0,j=0,k=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];if(!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex))continue;for(j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];if(!IFrameSplitOperator.IsNonEmptyArray(overlayItem.ChartPaint))continue;for(var k=0;k<overlayItem.ChartPaint.length;++k){var chart=overlayItem.ChartPaint[k];if(!chart.IsShow)continue;if(chart.IsHideScriptIndex())continue;if(chart.ClickCell){result=chart.ClickCell(x,y,e);if(result)return result;}}}}return null;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this7=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){this.IsOnTouch=false;return;}var bDrawDynamicInfo=false;if(this.GlobalOption.SelectedBorder&&this.GlobalOption.SelectedBorder.Mode>=1){var item=this.GlobalOption.SelectedBorder;var frameId=this.Frame.PtInFrame(x,y);if(frameId>=0&&frameId!=item.SelFrame){item.SelFrame=frameId;bDrawDynamicInfo=true;}}var bRedraw=false;if(this.GlobalOption.SelectedXBorder&&this.GlobalOption.SelectedXBorder.Mode>=1){if(this.PtInMulitDayMinute){var item=this.GlobalOption.SelectedXBorder;var selectedDate=this.PtInMulitDayMinute(x,y);if(item.Date!=selectedDate){item.Date=selectedDate;bRedraw=true;}}}if(this.TryClickCrossCursor(x,y,e)){this.IsOnTouch=false;return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
1785
+ this.TryClickChartCell=function(x,y,e){var result=null;for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.ClickCell)continue;if(item.IsHideScriptIndex())continue;result=item.ClickCell(x,y,e);if(result){result.Chart=item;return result;}}for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(!item.ClickCell)continue;result=item.ClickCell(x,y,e);if(result){result.Chart=item;result.IsOverlayChart=true;return result;}}for(var i=0,j=0,k=0;i<this.Frame.SubFrame.length;++i){var item=this.Frame.SubFrame[i];if(!IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex))continue;for(j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];if(!IFrameSplitOperator.IsNonEmptyArray(overlayItem.ChartPaint))continue;for(var k=0;k<overlayItem.ChartPaint.length;++k){var chart=overlayItem.ChartPaint[k];if(!chart.IsShow)continue;if(chart.IsHideScriptIndex())continue;if(chart.ClickCell){result=chart.ClickCell(x,y,e);if(result){result.Chart=chart;result.IsOverlayIndex=true;return result;}}}}}return null;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this7=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){this.IsOnTouch=false;return;}var bDrawDynamicInfo=false;if(this.GlobalOption.SelectedBorder&&this.GlobalOption.SelectedBorder.Mode>=1){var item=this.GlobalOption.SelectedBorder;var frameId=this.Frame.PtInFrame(x,y);if(frameId>=0&&frameId!=item.SelFrame){item.SelFrame=frameId;bDrawDynamicInfo=true;}}var bRedraw=false;if(this.GlobalOption.SelectedXBorder&&this.GlobalOption.SelectedXBorder.Mode>=1){if(this.PtInMulitDayMinute){var item=this.GlobalOption.SelectedXBorder;var selectedDate=this.PtInMulitDayMinute(x,y);if(item.Date!=selectedDate){item.Date=selectedDate;bRedraw=true;}}}if(this.TryClickCrossCursor(x,y,e)){this.IsOnTouch=false;return;}if(this.TryClickChartTooltipData&&this.TryClickChartTooltipData(x,y,e))//预留给外部点击图标什么用的
1785
1786
  {this.IsOnTouch=false;return;}if(this.TryClickLock){//JSConsole.Chart.Log('[uielement.onmousedown] left, top ',e.clientX, e.clientY, this.getBoundingClientRect().left,this.getBoundingClientRect().top);
1786
1787
  if(this.TryClickLock(x,y))return;}this.HideSelectRect();this.ClearDragSelectRect();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";
1787
1788
  this.SetCursor({Cursor:"pointer"});var obj={X:e.clientX};if(this.GetXDataIndex(obj)){this.RectSelectDrag={DataIndex:obj.DataIndex,Type:item.Type,X:e.clientX};JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag sub rect select ",obj);}}else{//this.UIElement.style.cursor="ew-resize";
@@ -1807,7 +1808,8 @@ var bDraw=false;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart
1807
1808
  this.SelectChartDrawPicture.DragInfo={Click:{X:e.clientX,Y:e.clientY}};}var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
1808
1809
  if(event&&event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};event.Callback(event,sendData,this);}else{this.OnSelectChartPicture(drawPictrueData.ChartDrawPicture);//选中画图工具事件
1809
1810
  }}else{if(this.ClickChartTimer!=null){clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var self=this;var ptClick={X:this.ClickDownPoint.X,Y:this.ClickDownPoint.Y};this.ClickChartTimer=setTimeout(function(){self.TryClickPaintEvent(JSCHART_EVENT_ID.ON_CLICK_CHART_PAINT,ptClick,e);},250);var bSelectedChartChanged=false;var clickCellData=this.TryClickChartCell(x,y,e);//点击图形子元素
1810
- if(clickCellData){if(clickCellData.Redraw===true)bRedraw=true;}else{if(this.SelectedChart.EnableSelected)//整体图形选中
1811
+ if(clickCellData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CHART_CELL);//点击图形单个元素
1812
+ if(event&&event.Callback){var data={Event:e,CellData:clickCellData};event.Callback(event,data,this);}if(clickCellData.Redraw===true)bRedraw=true;}else{if(this.SelectedChart.EnableSelected)//整体图形选中
1811
1813
  {var selectChart=this.PtInChart(x,y);if(selectChart){if(this.SelectedChart.Selected.Identify!=selectChart.Identify){this.SelectedChart.Selected.Identify=selectChart.Identify;this.SelectedChart.Selected.Chart=selectChart.Chart;bSelectedChartChanged=true;}if(this.EnableIndexChartDrag){this.IndexChartDrag={SelectedChart:selectChart,LastMove:{X:x,Y:y},Click:{X:x,Y:y}};this.IndexChartDrag.Info=this.GetSelectedChartInfo(selectChart);if(this.IndexChartDrag.Info)this.IndexChartDrag.Info.FrameID=this.Frame.PtInFrame(x,y);}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;this.SelectedChart.Selected.Chart=null;bSelectedChartChanged=true;}}}else{if(this.SelectedChart.Selected.Identify){this.SelectedChart.Selected.Identify=null;bSelectedChartChanged=true;}}}if(drawPictureActive.Select.Guid!=null&&this.SelectChartDrawPicture==null||bSelectedChartChanged){var drawType=0;if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)drawType=1;if(bSelectedChartChanged){var chart=selectedChart.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(0);drawType=1;}chart=this.SelectedChart.Selected.Chart;if(chart&&chart.SetSelectedStatus){chart.SetSelectedStatus(1);drawType=1;}}if(drawType==1)this.Draw();else this.DrawDynamicInfo();}else if(bRedraw){this.Draw();}else if(bDrawDynamicInfo){this.DrawDynamicInfo();}}}if(!this.SelectChartDrawPicture)this.CloseModifyDrawDialog();//当前没有选中画图 隐藏画图修改框
1812
1814
  document.onmousemove=function(e){_this7.DocOnMouseMove(e);};document.onmouseup=function(e){_this7.DocOnMouseUp(e);};document.oncontextmenu=function(e){_this7.DocContextMenu(e);};};this.IsShfitDragKLine=function(e){if(this.DragMode!=1)return false;if(!this.KLineDragConfig)return false;if(!this.KLineDragConfig.EnableShfit)return false;if(!e.shiftKey)return false;return true;};this.DocOnMouseMove=function(e){//加载数据中,禁用鼠标事件
1813
1815
  if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var bRButtonSelectRect=this.IsEnableRSelectRect(e,"DocOnMouseMove");//右键区间选择
@@ -1860,7 +1862,8 @@ IsLButton:selectData.IsLButton,IsRButton:selectData.IsRButton,PreventDefault:fal
1860
1862
  event.Callback(event,sendData,this);if(sendData.PreventDefault==true)return;//已被上层替换,不调用默认的网络请求
1861
1863
  aryMenu=sendData.AryMenu;command=sendData.Command;}if(aryMenu)//弹菜单
1862
1864
  {this.PopupSelectRectMenuV3(aryMenu,data,e);return;}if(command)//执行命令
1863
- {this.ExecuteMenuCommand(command.ID,command.Args);return;}this.HideSelectRect();this.UpdateSelectRect(selectData.Start,selectData.End);};this.PopupSelectRectMenuV3=function(aryMenu,data,e){var _this9=this;if(!aryMenu)return;var menuData={Menu:aryMenu,Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID};menuData.ClickCallback=function(data){_this9.OnClickRightMenu(data);};var x=data.X,y=data.Y;this.PopupMenuByRClick(menuData,x,y);};this.DocContextMenu=function(e){if(this.PreventRightMenu.Enable)e.preventDefault();};this.UIOnMounseOut=function(e){JSConsole.Chart.Log('[KLineChartContainer::UIOnMounseOut]',e);if(!this.IsLockCorssCursor())this.UIOnMouseMove(e);//锁十字光标时, 始终显示十字光标
1865
+ {this.ExecuteMenuCommand(command.ID,command.Args);return;}this.HideSelectRect();this.UpdateSelectRect(selectData.Start,selectData.End);};this.PopupSelectRectMenuV3=function(aryMenu,data,e){var _this9=this;if(!aryMenu)return;var menuData={Menu:aryMenu,Position:JSPopMenu.POSITION_ID.RIGHT_MENU_ID};menuData.ClickCallback=function(data){_this9.OnClickRightMenu(data);};var x=data.X,y=data.Y;this.PopupMenuByRClick(menuData,x,y);};this.DocContextMenu=function(e){if(this.PreventRightMenu.Enable)e.preventDefault();};this.UIOnMounseOut=function(e){JSConsole.Chart.Log('[KLineChartContainer::UIOnMounseOut]',e);if(this.EnableClickModel&&this.ClickModel.IsShowCorssCursor==true)return;//点击模式 十字光标显示下 不需要处理
1866
+ if(!this.IsLockCorssCursor())this.UIOnMouseMove(e);//锁十字光标时, 始终显示十字光标
1864
1867
  };this.UIOnMouseleave=function(e){JSConsole.Chart.Log('[KLineChartContainer::UIOnMouseleave]',e);//this.UIOnMouseMove(e);
1865
1868
  };this.OnDragChart=function(drag){if(!drag)return false;var info=drag.Info;var lastMove=drag.LastMove;var startFrameID=info.FrameID;var endFrameID=this.Frame.PtInFrame(lastMove.X,lastMove.Y);if(endFrameID<0){if(endFrameID==-3)//底部 移动到新的窗口
1866
1869
  return this.MoveIndexToNewWindow({WindowIndex:startFrameID,IndexID:info.IndexID},{Operator:0});return false;}if(startFrameID==endFrameID)return false;//移动指标
@@ -1880,9 +1883,9 @@ for(var i=0;i<e.touches.length;++i){var item=e.touches[i];if(isForceLandscape){t
1880
1883
  {var touchCount=e.touches.length;return touchCount==1;};this.StopDragTimer=function(){if(IFrameSplitOperator.IsNumber(this.DragTimer)){clearTimeout(this.DragTimer);this.DragTimer=null;this.IsPress=false;}};this.GetMoveAngle=function(pt,pt2)//计算角度
1881
1884
  {var xMove=Math.abs(pt.X-pt2.X);var yMove=Math.abs(pt.Y-pt2.Y);var angle=Math.atan(xMove/yMove)*180/Math.PI;return angle;};//手机拖拽
1882
1885
  uielement.ontouchstart=function(e){_this6.OnTouchStart(e);};uielement.ontouchmove=function(e){_this6.OnTouchMove(e);};uielement.ontouchend=function(e){_this6.OnTouchEnd(e);};this.AddPhoneDBClickInfo=function(x,y,time){var item={X:x,Y:y,Time:time};this.PhoneDBClickInfo.Start.push(item);};this.ClearPhoneDBClickInfo=function(){this.PhoneDBClickInfo.Start=[];};this.IsShortPhoneClick=function(x,y,time){};this.TryPhoneClickButton=function(x,y,e){if(this.TryClickLock||this.TryClickIndexTitle)//指标枷锁区域 , 指标标题点击
1883
- {if(this.TryClickLock&&this.TryClickLock(x,y))return true;if(this.TryClickIndexTitle&&this.TryClickIndexTitle(x,y))return true;}if(this.ClickFrameButton){var button=this.Frame.PtInButtons(x,y);if(button){this.ClickFrameButton(button,e);return true;}}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}if(this.TryClickCrossCursor(x,y)){return true;}return false;};this.OnTouchStart=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.IsPress=false;this.IsOnTouch=true;this.TouchDrawCount=0;this.PhonePinch=null;this.TouchDrag=null;if(this.ClickModel)this.ClickModel.PreventHide=false;this.StopDragTimer();var isSingleTouch=this.IsSingleTouch(e);if(this.EnableScrollUpDown==false||!isSingleTouch||//多点触屏
1886
+ {if(this.TryClickLock&&this.TryClickLock(x,y))return true;if(this.TryClickIndexTitle&&this.TryClickIndexTitle(x,y))return true;}if(this.ClickFrameButton){var button=this.Frame.PtInButtons(x,y);if(button){this.ClickFrameButton(button,e);return true;}}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}if(this.TryClickCrossCursor(x,y)){return true;}return false;};this.OnTouchStart=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.IsPress=false;this.IsOnTouch=true;this.TouchDrawCount=0;this.PhonePinch=null;this.TouchDrag=null;this.ClickModel.IsClickButton=false;this.ClickModel.PreventHide=false;this.StopDragTimer();var isSingleTouch=this.IsSingleTouch(e);if(this.EnableScrollUpDown==false||!isSingleTouch||//多点触屏
1884
1887
  this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID&&this.TouchStatus.CorssCursorShow==true)//十字光标显示,不能滚动页面
1885
- {if(e.cancelable)e.preventDefault();}if(this.IsPhoneDragging(e)){var touches=this.GetToucheData(e,this.IsForceLandscape);var pt=this.PointAbsoluteToRelative(touches[0].clientX,touches[0].clientY,true);if(this.TryPhoneClickButton(pt.X,pt.Y,e))return;if(this.EnableVerticalDrag){this.VerticalDrag={IsDrag:false};if(this.Frame.PtInFrameVertical(pt.X,pt.Y))this.VerticalDrag.IsDrag=true;}var bStartTimer=true;if(this.ChartDrawOption.IsLockScreen){bStartTimer=false;}else if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){if(this.TouchStatus.CorssCursorShow==true)bStartTimer=false;}else if(this.DragMode==JSCHART_DRAG_ID.DISABLE_DRAG_ID){bStartTimer=false;}else{if(!isSingleTouch)bStartTimer=false;}if(this.VerticalDrag)bStartTimer=false;if(this.EnableClickModel&&this.ClickModel.IsShowCorssCursor==true)bStartTimer=false;var drag={Click:{},LastMove:{},StartTime:Date.now()};//LastMove 最后移动的位置
1888
+ {if(e.cancelable)e.preventDefault();}if(this.IsPhoneDragging(e)){var touches=this.GetToucheData(e,this.IsForceLandscape);var pt=this.PointAbsoluteToRelative(touches[0].clientX,touches[0].clientY,true);if(this.TryPhoneClickButton(pt.X,pt.Y,e)){this.ClickModel.IsClickButton=true;return;}if(this.EnableVerticalDrag){this.VerticalDrag={IsDrag:false};if(this.Frame.PtInFrameVertical(pt.X,pt.Y))this.VerticalDrag.IsDrag=true;}var bStartTimer=true;if(this.ChartDrawOption.IsLockScreen){bStartTimer=false;}else if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){if(this.TouchStatus.CorssCursorShow==true)bStartTimer=false;}else if(this.DragMode==JSCHART_DRAG_ID.DISABLE_DRAG_ID){bStartTimer=false;}else{if(!isSingleTouch)bStartTimer=false;}if(this.VerticalDrag)bStartTimer=false;if(this.EnableClickModel&&this.ClickModel.IsShowCorssCursor==true)bStartTimer=false;var drag={Click:{},LastMove:{},StartTime:Date.now()};//LastMove 最后移动的位置
1886
1889
  var touchDrag={Click:{},LastMove:{},StartTime:Date.now()};//var touches=this.GetToucheData(e,this.IsForceLandscape);
1887
1890
  drag.Click.X=touches[0].clientX;drag.Click.Y=touches[0].clientY;drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;this.MouseDrag=drag;touchDrag.Click.X=touches[0].clientX;touchDrag.Click.Y=touches[0].clientY;touchDrag.LastMove.X=touches[0].clientX;touchDrag.LastMove.Y=touches[0].clientY;this.TouchDrag=touchDrag;var drawPictureActive=this.GetActiveDrawPicture();//上一次选中的
1888
1891
  var selectedChart={Chart:this.SelectedChart.Selected.Chart,Identify:this.SelectedChart.Selected.Identify};//上一次选中的图形
@@ -1896,7 +1899,7 @@ var self=this;this.DragTimer=setTimeout(function(){self.IsPress=true;if(drag.Cli
1896
1899
  if(self.EnableClickModel===true)self.ClickModel.IsShowCorssCursor=true;self.MoveCorssCursor(drag.Click,e);//移动十字光标
1897
1900
  }},self.PressTime);}if(this.EnableZoomIndexWindow){this.PhoneDBClick.AddTouchStart(touches[0].clientX,touches[0].clientY,Date.now());JSConsole.Chart.Log("[JSChartContainer::OnTouchStart] PhoneDBClick ",this.PhoneDBClick);}if(this.ChartDrawOption.IsLockScreen){this.MouseDrag=null;}else if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){}else if(this.DragMode==JSCHART_DRAG_ID.DISABLE_DRAG_ID){this.MouseDrag=null;this.MoveCorssCursor(drag.Click,e);}else if(this.EnableClickModel){//if (this.ClickModel.IsShowCorssCursor===true) this.MoveCorssCursor(drag.Click,e)
1898
1901
  }else if(this.VerticalDrag){if(!this.VerticalDrag.IsDrag)this.MoveCorssCursor(drag.Click,e);//没有点击X轴, 就显示十字光标
1899
- }else if(this.IsClickShowCorssCursor){this.MoveCorssCursor(drag.Click,e);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);var drawType=0;if(drawPictureActive.Select.Guid!=null){if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart)drawType=1;}if(drawType==1)this.Draw();}else if(this.IsPhonePinching(e)){var phonePinch={Start:{},Last:{},StartTime:Date.now()};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};phonePinch.Last={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){if(this.IsForceLandscape)y=uielement.getBoundingClientRect().width-touches[0].clientY;//强制横屏Y计算
1902
+ }else if(this.IsClickShowCorssCursor){this.MoveCorssCursor(drag.Click,e);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);var drawType=0;if(drawPictureActive.Select.Guid!=null){if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart)drawType=1;}if(drawType==1)this.Draw();}else if(this.IsPhonePinching(e)){var phonePinch={Start:{},Last:{},StartTime:Date.now()};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};phonePinch.Last={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);this.ClickModel.IsClickButton=false;if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){if(this.IsForceLandscape)y=uielement.getBoundingClientRect().width-touches[0].clientY;//强制横屏Y计算
1900
1903
  if(!this.ChartDrawOption.IsLockScreen)this.MoveCorssCursor({X:touches[0].clientX,Y:touches[0].clientY},e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);var isMoveCorssCursor=this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID&&this.TouchStatus.CorssCursorShow==true;//是否移动十字光标
1901
1904
  if(this.VerticalDrag){if(this.VerticalDrag.IsDrag===true)isMoveCorssCursor=false;else isMoveCorssCursor=true;}if(this.EnableClickModel){if(this.ClickModel.IsShowCorssCursor===true)isMoveCorssCursor=true;else isMoveCorssCursor=false;}//JSConsole.Chart.Log(`[JSChartContainer::OnTouchMove] moveAngle=${moveAngle} , moveUpDown=${moveUpDown}, moveSetp=${moveSetp}`);
1902
1905
  if(this.CurrentChartDrawPicture&&this.CurrentChartDrawPicture.EnableMove===true){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
@@ -5685,9 +5688,12 @@ this.IsShow=true;this.IsShowClose=false;//Y轴始终显示收盘价
5685
5688
  this.ClientPos=-1;this.CallAcutionXOperator;this.EnableKeyboard=false;//是否支持键盘隐藏显示
5686
5689
  this.EnableDBClick=false;//是否允许双击显示|隐藏十字光标
5687
5690
  this.OnChangeStatusCallback;//状态切换以后回调
5688
- this.RightButton={Enable:false,Rect:null,BGColor:g_JSChartResource.CorssCursor.RightButton.BGColor,PenColor:g_JSChartResource.CorssCursor.RightButton.PenColor,Icon:g_JSChartResource.CorssCursor.RightButton.Icon};//底部按钮
5689
- this.BottomButton={Enable:false,Rect:null};this.RightMargin=CloneData(g_JSChartResource.CorssCursor.RightMargin);this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText);//底部输出配置
5690
- this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);//内部使用
5691
+ this.RightButton={Enable:false,Rect:null,BGColor:g_JSChartResource.CorssCursor.RightButton.BGColor,PenColor:g_JSChartResource.CorssCursor.RightButton.PenColor,Icon:CloneData(g_JSChartResource.CorssCursor.RightButton.Icon)};//底部按钮
5692
+ this.BottomButton={Enable:false,Rect:null};this.BottomConfig=CloneData(g_JSChartResource.CorssCursor.BottomText);//底部输出配置
5693
+ this.LeftConfig=CloneData(g_JSChartResource.CorssCursor.LeftText);//左侧输出配置
5694
+ this.RightConfig=CloneData(g_JSChartResource.CorssCursor.RightText);//右侧输出配置
5695
+ this.RightOverlayConfig=CloneData(g_JSChartResource.CorssCursor.RightOverlayText);//右侧叠加指标输出配置
5696
+ //内部使用
5691
5697
  this.Close=null;//收盘价格
5692
5698
  this.Status=0;//当前状态 0=隐藏 1=显示
5693
5699
  this.ReloadResource=function(resource){this.Font=g_JSChartResource.CorssCursorTextFont;//字体
@@ -5697,7 +5703,7 @@ this.TextColor=g_JSChartResource.CorssCursorTextColor;//文本颜色
5697
5703
  this.TextBGColor=g_JSChartResource.CorssCursorBGColor;//文本背景色
5698
5704
  this.BorderColor=g_JSChartResource.CorssCursorBorderColor;//边框颜色
5699
5705
  this.XRangeBGColor=g_JSChartResource.CorssCursorXRangeBGColor;this.LineDash=g_JSChartResource.CorssCursorLineDash.slice();//虚线
5700
- this.CorssPointConfig.Center=CloneData(g_JSChartResource.CorssCursor.CorssPoint.Center);this.CorssPointConfig.Border=CloneData(g_JSChartResource.CorssCursor.CorssPoint.Border);};this.GetCloseYPoint=function(index){if(!this.StringFormatX.Data)return null;var data=this.StringFormatX.Data;if(!data.Data||data.Data.length<=0)return null;var dataIndex=data.DataOffset+index;if(dataIndex>=data.Data.length)dataIndex=data.Data.length-1;if(dataIndex<0)return null;var klineData=data.Data[dataIndex];if(!klineData)return null;this.Close=klineData.Close;var yPoint=this.Frame.GetYFromData(this.Close);return yPoint;};this.GetMinuteCloseYPoint=function(index){if(this.EnableNewIndex&&this.CorssCursorIndex){if(!this.StringFormatX||!this.StringFormatX.GetMinuteCloseYPoint)return null;var closeData=this.StringFormatX.GetMinuteCloseYPoint(this.CorssCursorIndex);if(!closeData)return null;this.Close=closeData.Price;return closeData.Y;}else{if(!IFrameSplitOperator.IsNumber(index))return null;index=parseInt(index.toFixed(0));//index=parseInt(index);
5706
+ this.RightButton.BGColor=g_JSChartResource.CorssCursor.RightButton.BGColor;this.RightButton.PenColor=g_JSChartResource.CorssCursor.RightButton.PenColor;this.RightButton.Icon=CloneData(g_JSChartResource.CorssCursor.RightButton.Icon);this.RightOverlayConfig=CloneData(g_JSChartResource.CorssCursor.RightOverlayText);this.CorssPointConfig.Center=CloneData(g_JSChartResource.CorssCursor.CorssPoint.Center);this.CorssPointConfig.Border=CloneData(g_JSChartResource.CorssCursor.CorssPoint.Border);};this.GetCloseYPoint=function(index){if(!this.StringFormatX.Data)return null;var data=this.StringFormatX.Data;if(!data.Data||data.Data.length<=0)return null;var dataIndex=data.DataOffset+index;if(dataIndex>=data.Data.length)dataIndex=data.Data.length-1;if(dataIndex<0)return null;var klineData=data.Data[dataIndex];if(!klineData)return null;this.Close=klineData.Close;var yPoint=this.Frame.GetYFromData(this.Close);return yPoint;};this.GetMinuteCloseYPoint=function(index){if(this.EnableNewIndex&&this.CorssCursorIndex){if(!this.StringFormatX||!this.StringFormatX.GetMinuteCloseYPoint)return null;var closeData=this.StringFormatX.GetMinuteCloseYPoint(this.CorssCursorIndex);if(!closeData)return null;this.Close=closeData.Price;return closeData.Y;}else{if(!IFrameSplitOperator.IsNumber(index))return null;index=parseInt(index.toFixed(0));//index=parseInt(index);
5701
5707
  if(!this.StringFormatX.Data)return null;var data=this.StringFormatX.Data;if(!data.Data||data.Data.length<=0)return null;var dataIndex=data.DataOffset+index;if(dataIndex>=data.Data.length)dataIndex=data.Data.length-1;if(dataIndex<0)return null;var close=data.Data[dataIndex];if(!IFrameSplitOperator.IsNumber(index))return null;this.Close=close;var yPoint=this.Frame.GetYFromData(this.Close);return yPoint;}};this.GetDateTimeRange=function(index,option){if(!IFrameSplitOperator.IsNumber(index))return null;index=parseInt(index);var data=this.StringFormatX.Data;if(!data.Data||data.Data.length<=0)return null;var dataIndex=data.DataOffset+index;if(dataIndex>=data.Data.length||dataIndex<0)return null;if(!this.Frame||!this.Frame.SubFrame[0]||!this.Frame.SubFrame[0].Frame)return null;var frame=this.Frame.SubFrame[0].Frame;var dataWidth=frame.DataWidth;var distanceWidth=frame.DistanceWidth;var xPointCount=frame.XPointCount;var kItem=data.Data[dataIndex];if(!kItem)return null;var date=kItem.Date*1000000;var time=parseInt(kItem.Time/100)*100;var startTime=date+time;var endTime=date+time+59;var endIndex=dataIndex;for(var i=dataIndex;i<data.Data.length;++i){var item=data.Data[i];var dateTime=item.Date*1000000+item.Time;if(dateTime>endTime)break;if(i-data.DataOffset>=xPointCount)break;endIndex=i;}var startIndex=dataIndex;for(var i=dataIndex;i>=0&&i>=data.DataOffset;--i){var item=data.Data[i];var dateTime=item.Date*1000000+item.Time;if(dateTime<startTime)break;startIndex=i;}var range={StartIndex:startIndex,EndIndex:endIndex};range.XStart=this.Frame.GetXFromIndex(startIndex-data.DataOffset);range.XEnd=this.Frame.GetXFromIndex(endIndex-data.DataOffset);range.XStart-=(distanceWidth+dataWidth)/2;range.XEnd+=(distanceWidth+dataWidth)/2;return range;};this.FixMinuteLastTimeXPoint=function(index){if(!IFrameSplitOperator.IsNumber(index))return null;index=parseInt(index);if(!this.StringFormatX.Data)return null;var data=this.StringFormatX.Data;if(!data.Data||data.Data.length<=0)return null;var dataIndex=data.DataOffset+index;if(dataIndex<data.Data.length)return null;dataIndex=data.Data.length-1;dataIndex-=data.DataOffset;var xPoint=this.Frame.GetXFromIndex(dataIndex);return{X:xPoint,Index:dataIndex};};//返回 -1=不在客户区 1=在主区域 2=左边扩展 3=右边扩展
5702
5708
  this.PtInClient=function(x,y){this.Canvas.beginPath();if(this.Frame.IsHScreen===true){var border=this.Frame.ChartBorder.GetHScreenBorder();this.Canvas.rect(border.Left,border.TopEx,border.Right-border.Left,border.BottomEx-border.TopEx);}else{var border=this.Frame.ChartBorder.GetBorder();this.Canvas.rect(border.LeftEx,border.Top,border.RightEx-border.LeftEx,border.Bottom-border.Top);}if(this.Canvas.isPointInPath(x,y))return 1;if(this.Frame.ChartBorder.LeftExtendWidth>10){this.Canvas.beginPath();if(this.Frame.IsHScreen===true){this.Canvas.rect(border.Left,border.Top,border.Right-border.Left,border.TopEx-border.Top);}else{this.Canvas.rect(border.Left,border.Top,border.LeftEx-border.Left,border.Bottom-border.Top);}if(this.Canvas.isPointInPath(x,y))return 2;}if(this.Frame.ChartBorder.RightExtendWidth>10){this.Canvas.beginPath();if(this.Frame.IsHScreen===true){this.Canvas.rect(border.Left,border.BottomEx,border.Right-border.Left,border.Bottom-border.BottomEx);}else{this.Canvas.rect(border.RightEx,border.Top,border.Right-border.RightEx,border.Bottom-border.Top);}if(this.Canvas.isPointInPath(x,y))return 3;}return-1;};this.GetFontHeight=function(font){return GetFontHeight(this.Canvas,font,"擎");};this.Draw=function(){this.Status=0;this.RightButton.Rect=null;this.BottomButton.Rect=null;this.LastValue=null;if(!this.LastPoint)return;this.Close=null;var x=this.LastPoint.X;var y=this.LastPoint.Y;var clientPos=this.PtInClient(x,y);this.PointY=null;this.PointY==null;this.ClientPos=clientPos;if(clientPos<=0)return;if(this.Frame.IsHScreen===true){this.HScreenDraw();return;}var border=this.Frame.ChartBorder.GetBorder();var left=border.Left;var right=border.Right;var top=border.TopTitle;var bottom=border.Bottom;var rightWidth=this.Frame.ChartBorder.Right;var chartRight=border.ChartWidth;if(this.IsOnlyDrawKLine)//手机端 十字只能画在K线上
5703
5709
  {x=this.Frame.GetXFromIndex(this.CursorIndex);if(this.IsShowClose){var yPoint=this.GetCloseYPoint(this.CursorIndex);if(yPoint!=null)y=yPoint;}}else if(this.IsOnlyDrawMinute){var yPoint=this.GetMinuteCloseYPoint(this.CursorIndex);if(yPoint!=null)y=yPoint;}if(this.CallAcutionXOperator){this.CallAcutionXOperator.Value=x;this.CallAcutionXOperator.Point={X:x,Y:y};this.CallAcutionXOperator.ClientPos=clientPos;if(this.CallAcutionXOperator.Operator()){x=this.CallAcutionXOperator.X;}}if(this.IsFixXLastTime){var value=this.FixMinuteLastTimeXPoint(this.CursorIndex);if(value){x=value.X;this.CursorIndex=value.Index;}}this.PointY=[[left,y],[right,y]];this.PointX=[[x,top],[x,bottom]];//十字线
@@ -5714,66 +5720,36 @@ if((this.ShowTextMode.Left==1&&this.Frame.ChartBorder.Left>=30||this.ShowTextMod
5714
5720
  var textSize={Width:textWidth+4,Height:this.TextHeight,Text:[]};var buttonData={Y:y,YValue:yValue,FrameID:yValueExtend.FrameID};var margin=this.LeftConfig.Margin;var textOffset=this.LeftConfig.TextOffset;var rtBG=null;if(this.Frame.ChartBorder.Left>=30&&this.ShowTextMode.Left==1)//左边
5715
5721
  {var rtBG={Right:left,Width:textWidth+margin.Left+margin.Right,YCenter:y,Height:textHeight+margin.Top+margin.Bottom};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;if(rtBG.Left<0){rtBG.Left=0;rtBG.Right=rtBG.Left+rtBG.Width;}}else if(this.ShowTextMode.Left==2)//在框架内显示
5716
5722
  {var rtBG={Left:left,Width:textWidth+margin.Left+margin.Right,YCenter:y,Height:textHeight+margin.Top+margin.Bottom};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;}if(rtBG){this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y);}var complexText={ShowType:0,//0=单行(默认) 1=多行
5717
- Font:this.Font,Color:this.TextColor,Text:[{Text:text,Margin:this.RightMargin}]};var yTop=y-this.TextHeight/2;if(this.StringFormatY.PercentageText){if(this.TextFormat.Right==0){text=this.StringFormatY.PercentageText+'%';complexText.Text[0].Text=text;}}if(this.StringFormatY.RText){text=this.StringFormatY.RText;complexText.Text[0].Text=text;}if(this.StringFormatY.RComplexText&&IFrameSplitOperator.IsNonEmptyArray(this.StringFormatY.RComplexText.Text)){complexText=this.StringFormatY.RComplexText;if(!complexText.Font)complexText.Font=this.Font;if(!complexText.Color)complexText.Color=this.TextColor;}this.CalculateComplexTextSize(complexText,textSize);if(this.Frame.ChartBorder.Right>=30&&this.ShowTextMode.Right==1){var isOverlayIndex=false;//是否有叠加子坐标
5723
+ Font:this.Font,Color:this.TextColor,Text:[{Text:text,Margin:this.RightConfig.Margin,TextOffset:this.RightConfig.TextOffset}]};var yTop=y-this.TextHeight/2;if(this.StringFormatY.PercentageText){if(this.TextFormat.Right==0){text=this.StringFormatY.PercentageText+'%';complexText.Text[0].Text=text;}}if(this.StringFormatY.RText){text=this.StringFormatY.RText;complexText.Text[0].Text=text;}if(this.StringFormatY.RComplexText&&IFrameSplitOperator.IsNonEmptyArray(this.StringFormatY.RComplexText.Text)){complexText=this.StringFormatY.RComplexText;if(!complexText.Font)complexText.Font=this.Font;if(!complexText.Color)complexText.Color=this.TextColor;}this.CalculateComplexTextSize(complexText,textSize);if(this.Frame.ChartBorder.Right>=30&&this.ShowTextMode.Right==1){var isOverlayIndex=false;//是否有叠加子坐标
5718
5724
  var overlayIndexInterval=null;//子坐标间距
5719
5725
  if(yValueExtend.FrameID>=0){var frame=this.Frame.SubFrame[yValueExtend.FrameID];isOverlayIndex=frame.OverlayIndex.length>0;overlayIndexInterval=null;if(isOverlayIndex){for(var i=0;i<=frame.OverlayIndex.length;++i){var item=frame.OverlayIndex[i];if(!item||!item.Frame)continue;if(item.Frame.IsShow===false)continue;if(!item.Frame.GetXHorizontal)continue;var overlayLeft=item.Frame.GetXHorizontal();overlayIndexInterval=overlayLeft-right;break;}}}//叠加坐标
5720
5726
  if(isOverlayIndex&&textSize.Width>overlayIndexInterval&&overlayIndexInterval>0)//大于子坐标宽度
5721
- {var drawRight=right+overlayIndexInterval;if(drawRight>chartRight)drawRight=chartRight;var itemLeft=drawRight-2-textSize.Width;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,itemLeft,this.TextHeight,this.TextHeight,buttonData);}else if(rightWidth<textSize.Width)//右边空白显示不下,
5722
- {var itemLeft=chartRight-2-textSize.Width;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,chartRight-2-textSize.Width,this.TextHeight,this.TextHeight,buttonData);}else{var itemLeft=right+2;this.DrawTextBGRect(itemLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(itemLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,right+2,this.TextHeight,this.TextHeight,buttonData);}/*
5723
- if (this.StringFormatY.RExtendText && this.StringFormatY.RExtendText.length>0)
5724
- {
5725
- var yOffset=0;
5726
- for(var i in this.StringFormatY.RExtendText)
5727
- {
5728
- var item=this.StringFormatY.RExtendText[i];
5729
- var rText='--.--'
5730
- if (item.YText) rText=item.YText;
5731
- else if (IFrameSplitOperator.IsNumber(item.Y)) rText=item.Y.toFixed(0);
5732
- var rTextWidth=this.Canvas.measureText(rText).width+4; //前后各空2个像素
5733
-
5734
- if (rightWidth<rTextWidth)
5735
- {
5736
- this.DrawTextBGRect(chartRight-2-rTextWidth,y+yOffset+this.TextHeight/2,rTextWidth,this.TextHeight);
5737
- this.Canvas.textAlign="right";
5738
- this.Canvas.textBaseline="middle";
5739
- this.Canvas.fillStyle=item.TextColor;
5740
- this.Canvas.fillText(rText,chartRight-4,y+yOffset+this.TextHeight,rTextWidth);
5741
- }
5742
- else
5743
- {
5744
- this.DrawTextBGRect(right+2,y+yOffset+this.TextHeight/2,rTextWidth,this.TextHeight);
5745
- this.Canvas.textAlign="left";
5746
- this.Canvas.textBaseline="middle";
5747
- this.Canvas.fillStyle=item.TextColor;
5748
- this.Canvas.fillText(rText,right+4,y+yOffset+this.TextHeight,rTextWidth);
5749
- }
5750
-
5751
- yOffset+=this.TextHeight;
5752
- }
5753
- }
5754
- */}else if(this.ShowTextMode.Right==2){this.Canvas.fillStyle=this.TextBGColor;var showLeft=right-textSize.Width;this.DrawTextBGRect(showLeft,yTop,textSize.Width,textSize.Height);this.DrawComplexTextV2(showLeft,yTop,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButton(yTop,showLeft,this.TextHeight,this.TextHeight,buttonData);}}//X轴 Bottom==8 自定义
5727
+ {var rtBG={Right:right+overlayIndexInterval,Width:textSize.Width,YCenter:y,Height:textSize.Height};rtBG.Left=rtBG.Right-rtBG.Width;if(complexText.ShowType==1){rtBG.Top=rtBG.YCenter-this.TextHeight/2;rtBG.Bottom=rtBG.Top+rtBG.Height;}else{rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;}if(rtBG.Right>chartRight){rtBG.Right=chartRight;rtBG.Left=rtBG.Right-rtBG.Width;}var drawRight=right+overlayIndexInterval;if(drawRight>chartRight)drawRight=chartRight;this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawComplexRightText(rtBG,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButtonV2(rtBG,complexText,textSize,buttonData);}else{var rtBG={Left:right+1,Width:textSize.Width,YCenter:y,Height:textSize.Height};rtBG.Right=rtBG.Left+rtBG.Width;if(complexText.ShowType==1){rtBG.Top=rtBG.YCenter-this.TextHeight/2;rtBG.Bottom=rtBG.Top+rtBG.Height;}else{rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;}if(rtBG.Right>chartRight){rtBG.Right=chartRight;rtBG.Left=rtBG.Right-rtBG.Width;}this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawComplexRightText(rtBG,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButtonV2(rtBG,complexText,textSize,buttonData);}}else if(this.ShowTextMode.Right==2)//框架内侧显示
5728
+ {var rtBG={Right:right,Width:textSize.Width,YCenter:y,Height:textSize.Height};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.TextBGColor;var showLeft=right-textSize.Width;this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.DrawComplexRightText(rtBG,complexText,textSize);if(this.RightButton.Enable)this.DrawRightButtonV2(rtBG,complexText,textSize,buttonData);}}//X轴 Bottom==8 自定义
5755
5729
  if((this.ShowTextMode.Bottom==1||this.ShowTextMode.Bottom==2||this.ShowTextMode.Bottom==8)&&this.StringFormatX.Operator()){var text=this.StringFormatX.Text;this.Canvas.font=this.Font;this.Canvas.fillStyle=this.TextBGColor;var textWidth=this.Canvas.measureText(text).width;//前后各空2个像素
5756
5730
  var margin=this.BottomConfig.Margin;var textOffset=this.BottomConfig.TextOffset;var rtBG={Top:bottom,Height:margin.Top+margin.Bottom+textHeight,XCenter:x,Width:textWidth+margin.Left+margin.Right};rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Left=rtBG.XCenter-rtBG.Width/2;rtBG.Right=rtBG.Left+rtBG.Width;if(rtBG.Left<=0){rtBG.Left=0;rtBG.Right=rtBG.Left+rtBG.Width;}else if(rtBG.Right>=right){rtBG.Right=right;rtBG.Left=rtBG.Right-rtBG.Width;}var bShowText=true;if(this.ShowTextMode.Bottom==2){rtBG.Bottom=bottom;rtBG.Top=rtBG.Bottom-rtBG.Height;}else if(this.ShowTextMode.Bottom==8){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_CORSSCURSOR_POSITION);if(event&&event.Callback){var sendData={RectText:rtBG,IsShowText:bShowText,X:x,Y:y};event.Callback(event,sendData,this);bShowText=sendData.IsShowText;}}//JSConsole.Chart.Log('[ChartCorssCursor::Draw] ',yCenter);
5757
5731
  if(bShowText){this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);var buttonData={X:x,Y:y,XValue:xValue,FrameID:yValueExtend.FrameID};if(this.StringFormatX.KItem)buttonData.KItem=this.StringFormatX.KItem;this.BottomButton.Rect=rtBG;this.BottomButton.Data=buttonData;}}//子坐标Y轴
5758
5732
  if(yValueExtend.FrameID>=0){var frame=this.Frame.SubFrame[yValueExtend.FrameID];var overlayLeft=right;this.Canvas.font=this.Font;for(var i=0;i<frame.OverlayIndex.length;++i){var item=frame.OverlayIndex[i];if(item.Frame.IsShow===false)continue;if(!item.Frame.GetXHorizontal)continue;overlayLeft=item.Frame.GetXHorizontal();//if (overlayLeft+30>chartRight) break;
5759
- var yValue=item.Frame.GetYData(y);var text=IFrameSplitOperator.FormatValueString(yValue,2);var textWidth=this.Canvas.measureText(text).width+4;//前后各空2个像素
5760
- /*
5733
+ var yValue=item.Frame.GetYData(y);var text=IFrameSplitOperator.FormatValueString(yValue,2);var textWidth=this.Canvas.measureText(text).width;//前后各空2个像素
5734
+ var margin=this.RightOverlayConfig.Margin;var textOffset=this.RightOverlayConfig.TextOffset;var rtBG={Left:overlayLeft+1,Width:textWidth+margin.Left+margin.Right,YCenter:y,Height:textHeight+margin.Top+margin.Bottom};rtBG.Right=rtBG.Left-rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);/*
5761
5735
  for(var j=2;j>=0;--j)
5762
5736
  {
5763
5737
  var text=IFrameSplitOperator.FormatValueString(yValue,j);
5764
5738
  var textWidth=this.Canvas.measureText(text).width+4; //前后各空2个像素
5765
5739
  if (textWidth<frame.Interval) break;
5766
5740
  }
5767
- */this.Canvas.fillStyle=this.TextBGColor;this.Canvas.fillRect(overlayLeft+1,y-this.TextHeight/2,textWidth,this.TextHeight);this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,overlayLeft+4,y,textWidth);}}this.Status=1;};this.DrawComplexTextV2=function(left,yTop,complexText,size){this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var showType=0;if(complexText.ShowType==1)showType=complexText.ShowType;if(showType==1)//多行
5768
- {var xLeft=left;var yText=yTop;//顶
5769
- for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemSize=size.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=complexText.Color;var y=yText+itemSize.Height;var x=xLeft;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Bottom))y-=margin.Bottom;if(IFrameSplitOperator.IsNumber(margin.Left))x+=margin.Left;}this.Canvas.fillText(item.Text,x,y,itemSize.Width);yText+=itemSize.Height;}}else//水平 单行
5770
- {var xText=left;var yBottom=yTop+size.Height;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemSize=size.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=complexText.Color;var y=yBottom;var x=xText;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Bottom))y-=margin.Bottom;if(IFrameSplitOperator.IsNumber(margin.Left))x+=margin.Left;}this.Canvas.fillText(item.Text,x,y,itemSize.Width);xText+=itemSize.Width;}}};this.CalculateComplexTextSize=function(complexText,size){if(!complexText||!IFrameSplitOperator.IsNonEmptyArray(complexText.Text))return;var showType=0;if(complexText.ShowType==1)showType=complexText.ShowType;if(showType==1)//多行
5741
+ */this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y);}}this.Status=1;};this.DrawComplexRightText=function(rtBG,complexText,size){this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var showType=0;if(complexText.ShowType==1)showType=complexText.ShowType;if(showType==1)//多行
5742
+ {var xLeft=rtBG.Left;var yTop=rtBG.Top;//顶
5743
+ for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemSize=size.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=complexText.Color;var y=yTop+itemSize.Height;var x=xLeft;if(item.TextOffset){var textOffset=item.TextOffset;if(IFrameSplitOperator.IsNumber(textOffset.X))x+=textOffset.X;if(IFrameSplitOperator.IsNumber(textOffset.Y))y+=textOffset.Y;}this.Canvas.fillText(item.Text,x,y,itemSize.Width);yTop+=itemSize.Height;}}else//水平 单行
5744
+ {var xText=rtBG.Left;var yBottom=rtBG.Bottom;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];var itemSize=size.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=complexText.Color;var x=xText;var y=yBottom;if(item.TextOffset){var textOffset=item.TextOffset;if(IFrameSplitOperator.IsNumber(textOffset.X))x+=textOffset.X;if(IFrameSplitOperator.IsNumber(textOffset.Y))y+=textOffset.Y;}this.Canvas.fillText(item.Text,x,y,itemSize.Width);xText+=itemSize.Width;}}};this.CalculateComplexTextSize=function(complexText,size){if(!complexText||!IFrameSplitOperator.IsNonEmptyArray(complexText.Text))return;var showType=0;if(complexText.ShowType==1)showType=complexText.ShowType;if(showType==1)//多行
5771
5745
  {var textWidth=0,textHeight=0;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;var itemWidth=this.Canvas.measureText(item.Text).width;//前后各空2个像素
5772
- var itemHeight=this.Canvas.measureText("擎").width;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))itemWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))itemWidth+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))itemHeight+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))itemHeight+=margin.Bottom;}size.Text[i]={Width:itemWidth,Height:itemHeight};//保存所有文字的大小信息
5746
+ var itemHeight=this.GetFontHeight();if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))itemWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))itemWidth+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))itemHeight+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))itemHeight+=margin.Bottom;}size.Text[i]={Width:itemWidth,Height:itemHeight};//保存所有文字的大小信息
5773
5747
  if(textWidth<itemWidth)textWidth=itemWidth;textHeight+=itemHeight;}size.Width=textWidth;size.Height=textHeight;}else//水平 单行
5774
- {var textWidth=0,textHeight=0;for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;var itemWidth=this.Canvas.measureText(item.Text).width;//前后各空2个像素
5748
+ {var textWidth=0,textHeight=this.GetFontHeight();for(var i=0;i<complexText.Text.length;++i){var item=complexText.Text[i];if(item.Font)this.Canvas.font=item.Font;else this.Canvas.font=complexText.Font;var itemWidth=this.Canvas.measureText(item.Text).width;//前后各空2个像素
5775
5749
  var itemHeight=this.Canvas.measureText("擎").width;if(item.Margin){var margin=item.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))itemWidth+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))itemWidth+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))itemHeight+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))itemHeight+=margin.Bottom;}size.Text[i]={Width:itemWidth,Height:itemHeight};//保存所有文字的大小信息
5776
- textWidth+=itemWidth;if(textHeight<itemHeight)textHeight=itemHeight;}size.Width=textWidth;size.Height=textHeight;}};this.DrawRightButton=function(drawTop,drawRight,drawWidth,drawHeight,data){this.Canvas.fillStyle=this.RightButton.BGColor;var rtButton={Left:drawRight-drawWidth,Top:drawTop,Width:drawWidth,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;this.RightButton.Rect=rtButton;this.RightButton.Data=data;this.Canvas.fillRect(ToFixedPoint(rtButton.Left+1),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height));var pixelRatio=GetDevicePixelRatio();var spaceWidth=3;var yCenter=rtButton.Top+spaceWidth+(rtButton.Height-spaceWidth*2)/2;var xCenter=rtButton.Left+spaceWidth+(rtButton.Width-spaceWidth*2)/2;if(this.RightButton.Icon){var icon=this.RightButton.Icon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText('\uE6A3',xCenter,yCenter);}else{//画加号
5750
+ textWidth+=itemWidth;if(textHeight<itemHeight)textHeight=itemHeight;}size.Width=textWidth;size.Height=textHeight;}};this.DrawRightButtonV2=function(rtTextBG,complexText,textSize,data){this.Canvas.fillStyle=this.RightButton.BGColor;var drawHeight=rtTextBG.Height;var drawWidth=rtTextBG.Height;if(complexText.ShowType==1)//多行 取第1行高度
5751
+ {var itemSize=textSize.Text[0];drawHeight=itemSize.Height;drawWidth=itemSize.Height;}var rtButton={Left:rtTextBG.Left-drawHeight,Top:rtTextBG.Top,Width:drawWidth,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;this.RightButton.Rect=rtButton;this.RightButton.Data=data;this.Canvas.fillRect(ToFixedPoint(rtButton.Left+1),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height));var pixelRatio=GetDevicePixelRatio();var spaceWidth=3;var yCenter=rtButton.Top+spaceWidth+(rtButton.Height-spaceWidth*2)/2;var xCenter=rtButton.Left+spaceWidth+(rtButton.Width-spaceWidth*2)/2;if(this.RightButton.Icon){var icon=this.RightButton.Icon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText('\uE6A3',xCenter,yCenter);}else{//画加号
5752
+ this.Canvas.strokeStyle=this.RightButton.PenColor;var x=rtButtom.Left+spaceWidth;var y=rtButtom.Top+spaceWidth;this.Canvas.save();this.Canvas.linewidth=1*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yCenter));this.Canvas.lineTo(ToFixedPoint(x+rtButton.Width-spaceWidth*2),ToFixedPoint(yCenter));this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(y+rtButton.Height-spaceWidth*2));this.Canvas.stroke();this.Canvas.restore();}};this.DrawRightButton=function(drawTop,drawRight,drawWidth,drawHeight,data){this.Canvas.fillStyle=this.RightButton.BGColor;var rtButton={Left:drawRight-drawWidth,Top:drawTop,Width:drawWidth,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;this.RightButton.Rect=rtButton;this.RightButton.Data=data;this.Canvas.fillRect(ToFixedPoint(rtButton.Left+1),ToFixedPoint(rtButton.Top),ToFixedRect(rtButton.Width),ToFixedRect(rtButton.Height));var pixelRatio=GetDevicePixelRatio();var spaceWidth=3;var yCenter=rtButton.Top+spaceWidth+(rtButton.Height-spaceWidth*2)/2;var xCenter=rtButton.Left+spaceWidth+(rtButton.Width-spaceWidth*2)/2;if(this.RightButton.Icon){var icon=this.RightButton.Icon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText('\uE6A3',xCenter,yCenter);}else{//画加号
5777
5753
  this.Canvas.strokeStyle=this.RightButton.PenColor;var x=rtButtom.Left+spaceWidth;var y=rtButtom.Top+spaceWidth;this.Canvas.save();this.Canvas.linewidth=1*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yCenter));this.Canvas.lineTo(ToFixedPoint(x+rtButton.Width-spaceWidth*2),ToFixedPoint(yCenter));this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(y+rtButton.Height-spaceWidth*2));this.Canvas.stroke();this.Canvas.restore();}};this.PtInButton=function(x,y){var item=this.PtInRightButton(x,y);if(item)return item;item=this.PtInButtomButton(x,y);if(item)return item;return null;};this.PtInRightButton=function(x,y){if(!this.RightButton.Enable)return null;if(!this.RightButton.Rect)return null;var rect=this.RightButton.Rect;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom){return{Data:this.RightButton.Data,Rect:rect,Type:1};//Type:1=右侧 2=底部
5778
5754
  }return null;};this.PtInButtomButton=function(x,y){if(!this.BottomButton.Enable)return null;if(!this.BottomButton.Rect)return null;var rect=this.BottomButton.Rect;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom){return{Data:this.BottomButton.Data,Rect:rect,Type:2};//Type:1=右侧 2=底部
5779
5755
  }return null;};this.DrawTextBGRect=function(x,y,height,width){this.Canvas.fillStyle=this.TextBGColor;this.Canvas.fillRect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(height),ToFixedRect(width));if(this.BorderColor){this.Canvas.strokeStyle=this.BorderColor;this.Canvas.strokeRect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(height),ToFixedRect(width));}};this.HScreenDraw=function(){var x=this.LastPoint.X;var y=this.LastPoint.Y;if(this.IsOnlyDrawKLine)//手机端 十字只能画在K线上
@@ -6993,7 +6969,8 @@ this.CorssCursorTextFont=14*GetDevicePixelRatio()+"px 微软雅黑";this.CorssCu
6993
6969
  this.CorssCursorVPenColor="rgb(130,130,130)";//十字光标线段颜色(垂直)
6994
6970
  this.CorssCursorXRangeBGColor="rgba(100,149,237,0.3)";//十字光标X轴访问背景色
6995
6971
  this.CorssCursorLineDash=[3*GetDevicePixelRatio(),2*GetDevicePixelRatio()];//十字光标虚线
6996
- this.CorssCursor={RightButton:{BGColor:'rgb(43,54,69)',PenColor:'rgb(255,255,255)',Icon:{Text:'\uE6A3',Color:'rgb(255,255,255)',Family:"iconfont",Size:18}},RightMargin:{Left:2,Right:2,Top:5,Bottom:3},BottomText:{Margin:{Left:4,Right:4,Top:0,Bottom:0},TextOffset:{X:4,Y:-1}},LeftText:{Margin:{Left:4,Right:4,Top:0,Bottom:0},TextOffset:{X:4,Y:-1}},CorssPoint:{Center:{Radius:5*GetDevicePixelRatio(),Color:"rgb(50,171,205)"},Border:{Color:'rgb(255,255,255)',Width:1*GetDevicePixelRatio()}}};//指标锁
6972
+ this.CorssCursor={RightButton:{BGColor:'rgb(43,54,69)',PenColor:'rgb(255,255,255)',Icon:{Text:'\uE6A3',Color:'rgb(255,255,255)',Family:"iconfont",Size:14}},BottomText:{Margin:{Left:4,Right:4,Top:0,Bottom:0},TextOffset:{X:4,Y:-1}},LeftText:{Margin:{Left:4,Right:4,Top:0,Bottom:0},TextOffset:{X:4,Y:-1}},RightText:{Margin:{Left:4,Right:4,Top:0,Bottom:0},TextOffset:{X:4,Y:-1}},RightOverlayText:{Margin:{Left:2,Right:2,Top:0,Bottom:0},TextOffset:{X:2,Y:-1}},//右侧叠加坐标
6973
+ CorssPoint:{Center:{Radius:5*GetDevicePixelRatio(),Color:"rgb(50,171,205)"},Border:{Color:'rgb(255,255,255)',Width:1*GetDevicePixelRatio()}}};//指标锁
6997
6974
  this.IndexLock={BGColor:"rgb(220, 220, 220)",TextColor:"rgb(210, 34, 34)",Font:14*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',Title:'🔒开通权限'};this.Domain="http://127.0.0.1:8080";//API域名
6998
6975
  this.CacheDomain="http://127.0.0.1:8087";//缓存域名
6999
6976
  this.PyIndexDomain='http://127.0.0.1:8088';//py指标计算域名
@@ -12555,7 +12532,7 @@ UnchagneBarColor:"rgb(190,190,190)",//平盘
12555
12532
  BGAlpha:0.6,EmptyBGColor:"rgb(0,0,0)"},CorssCursorBGColor:"rgb(43,54,69)",//十字光标背景
12556
12533
  CorssCursorTextColor:"rgb(255,255,255)",CorssCursorTextFont:12*GetDevicePixelRatio()+"px 微软雅黑",CorssCursorHPenColor:"rgb(130,130,130)",//十字光标线段颜色
12557
12534
  CorssCursorVPenColor:"rgb(130,130,130)",//十字光标线段颜色
12558
- CorssCursor:{RightButton:{BGColor:'rgb(43,54,69)',PenColor:'rgb(255,255,255)',Icon:{Text:'\uE6A3',Color:'rgb(255,255,255)',Family:"iconfont",Size:18}},CorssPoint:{Center:{Color:"rgb(50,171,205)"},Border:{Color:'rgba(0,0,0,0.8)',Width:1*GetDevicePixelRatio()}}},//订单流配置
12535
+ CorssCursor:{RightButton:{BGColor:'rgb(43,54,69)',PenColor:'rgb(255,255,255)',Icon:{Text:'\uE6A3',Color:'rgb(255,255,255)',Family:"iconfont",Size:12}},CorssPoint:{Center:{Color:"rgb(50,171,205)"},Border:{Color:'rgba(0,0,0,0.8)',Width:1*GetDevicePixelRatio()}}},//订单流配置
12559
12536
  OrderFlow:{UpColor:{BG:'rgb(223,191,180)',Border:"rgb(196,84,86)"},//阳线
12560
12537
  DownColor:{BG:"rgb(176,212,184)",Border:'rgb(66,94,74)'},//阴线
12561
12538
  UnchagneColor:{BG:"rgb(216,221,177)",Border:"rgb(209,172,129)"},//平盘
@@ -14789,7 +14766,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
14789
14766
  this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
14790
14767
  * 版本信息输出
14791
14768
  *
14792
- */var HQCHART_VERSION="1.1.14712";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
14769
+ */var HQCHART_VERSION="1.1.14721";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
14793
14770
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
14794
14771
  // BaseIndex:BaseIndex,
14795
14772
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14713",
3
+ "version": "1.1.14722",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {