hqchart 1.1.13825 → 1.1.13831

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.
@@ -1504,7 +1504,8 @@ ON_FORMAT_CALL_AUCTION_INDEX_TITLE:153,//集合竞价指标窗口标题内容
1504
1504
  ON_FORMAT_KLINE_HIGH_LOW_TITLE:154,//K线最高最低价格式化内容
1505
1505
  ON_CUSTOM_CORSSCURSOR_POSITION:155,//自定义十字光标X轴的输出的位置
1506
1506
  ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156,//日盘夜盘的分界线
1507
- ON_CUSTOM_MINUTE_BG:157//自定义分时图背景颜色
1507
+ ON_CUSTOM_MINUTE_BG:157,//自定义分时图背景颜色
1508
+ ON_CLICK_HORIZONTAL_LABEL:158//点击Y轴刻度标签
1508
1509
  };var JSCHART_OPERATOR_ID={OP_SCROLL_LEFT:1,//往左移动
1509
1510
  OP_SCROLL_RIGHT:2,//往右移动
1510
1511
  OP_ZOOM_OUT:3,//缩小
@@ -1693,7 +1694,7 @@ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MOUSE_MOVE);var titleChart=t
1693
1694
  if(titleChart)titleChart.OnMouseMoveEvent=null;this.StartStopDisplayLatest();};this.IsMouseOnClient=function(x,y){var rect={Left:this.Frame.ChartBorder.GetLeft(),Top:this.Frame.ChartBorder.GetTop(),Width:this.Frame.ChartBorder.GetWidth(),Height:this.Frame.ChartBorder.GetHeight()};rect.Right=rect.Left+rect.Width;rect.Bottom=rect.Top+rect.Height;if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom)return true;return false;};this.UIOnContextMenu=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;if(!this.IsShowRightMenu)return;var x=e.clientX-this.UIElement.getBoundingClientRect().left;var y=e.clientY-this.UIElement.getBoundingClientRect().top;if(typeof this.OnRightMenu=='function')this.OnRightMenu(x,y,e);//右键菜单事件
1694
1695
  return false;};this.UIOnDblClick=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash)return;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;this.OnDoubleClick(x,y,e);};//是否在拖拽Y轴上
1695
1696
  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;};//是否可以上下拖拽
1696
- this.TryUpDownDrag=function(x,y){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;var item=this.Frame.SubFrame[windowIndex];if(!item||!item.Frame)return null;var frame=item.Frame;if(!frame.YSplitOperator||!frame.YSplitOperator.FixedYMaxMin)return null;return{Index:windowIndex,X:x,Y:y};};this.TryRectSelectDrag=function(x,y){var paint=this.GetRectSelectPaint();if(!paint)return null;if(paint.GetPointCount()<=0)return null;var item=paint.PtInPaint(x,y);return{Item:item,X:x,Y:y};};this.TryClickCrossCursor=function(x,y,e){if(!this.ChartCorssCursor)return;var button=this.ChartCorssCursor.PtInButton(x,y);if(!button)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);if(event&&event.Callback){var sendData={Button:button,e:e};event.Callback(event,sendData,this);}return true;};this.TryClickButton=function(x,y,e){var button=this.Frame.PtInButtons(x,y);if(button&&this.ClickFrameButton){this.ClickFrameButton(button,e);return true;}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}button=this.PtInDrawPictureButtons(x,y);if(button&&this.ClickDrawPictureButton){this.ClickDrawPictureButton(button,e);return true;}button=this.PtInTitleButtons(x,y);if(button&&this.ClickTitleButton){this.ClickTitleButton(button,e);return true;}return false;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this7=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){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))//预留给外部点击图标什么用的
1697
+ this.TryUpDownDrag=function(x,y){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;var item=this.Frame.SubFrame[windowIndex];if(!item||!item.Frame)return null;var frame=item.Frame;if(!frame.YSplitOperator||!frame.YSplitOperator.FixedYMaxMin)return null;return{Index:windowIndex,X:x,Y:y};};this.TryRectSelectDrag=function(x,y){var paint=this.GetRectSelectPaint();if(!paint)return null;if(paint.GetPointCount()<=0)return null;var item=paint.PtInPaint(x,y);return{Item:item,X:x,Y:y};};this.TryClickCrossCursor=function(x,y,e){if(!this.ChartCorssCursor)return;var button=this.ChartCorssCursor.PtInButton(x,y);if(!button)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_CROSSCURSOR_RIGHT);if(event&&event.Callback){var sendData={Button:button,e:e};event.Callback(event,sendData,this);}return true;};this.TryClickButton=function(x,y,e){var button=this.Frame.PtInButtons(x,y);if(button&&this.ClickFrameButton){this.ClickFrameButton(button,e);return true;}button=this.PtInExtendChartButtons(x,y);if(button&&this.ClickExtendChartButton){this.ClickExtendChartButton(button,e);return true;}button=this.PtInDrawPictureButtons(x,y);if(button&&this.ClickDrawPictureButton){this.ClickDrawPictureButton(button,e);return true;}button=this.PtInTitleButtons(x,y);if(button&&this.ClickTitleButton){this.ClickTitleButton(button,e);return true;}var label=this.Frame.PtInHorizontalLabel(x,y);if(label&&this.ClickHorizontalLabel){this.ClickHorizontalLabel(label,e);return true;}return false;};this.TryMouseMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_MOVE);if(!event||!event.Callback)return false;return event.Callback(event,sendData,this);};this.TryClick_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_MOUSE_DOWN);if(!event||!event.Callback)return false;sendData.ChartDrag=null;sendData.Cusrsor=null;event.Callback(event,sendData,this);this.CustomChartDrag=sendData.ChartDrag;this.SetCursor(sendData);};this.TryDragMove_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_MOVE);if(!event||!event.Callback)return;var e=sendData.e;var drag=sendData.Drag;if(Math.abs(drag.LastMove.Y-e.clientY)<2&&Math.abs(drag.LastMove.X-e.clientX)<2)return;if(event.Callback(event,sendData,this)){drag.LastMove.X=e.clientX;drag.LastMove.Y=e.clientY;}};this.TryMouseUp_CustomChartDrag=function(sendData){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_DRAG_DOC_MOUSE_UP);if(!event||!event.Callback)return;event.Callback(event,sendData,this);};this.UIOnMouseDown=function(e){var _this7=this;this.MoveOnChartDrawPicture=null;if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;this.ClickDownPoint={X:e.clientX,Y:e.clientY};this.IsOnTouch=true;this.BorderDrag=null;this.YDrag=null;this.UpDownDrag=null;this.RectSelectDrag=null;this.IndexChartDrag=null;this.CustomChartDrag=null;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;if(this.TryClickButton(x,y,e)){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))//预留给外部点击图标什么用的
1697
1698
  {this.IsOnTouch=false;return;}if(this.TryClickLock){//JSConsole.Chart.Log('[uielement.onmousedown] left, top ',e.clientX, e.clientY, this.getBoundingClientRect().left,this.getBoundingClientRect().top);
1698
1699
  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";
1699
1700
  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";
@@ -1752,7 +1753,8 @@ return this.MoveIndex({WindowIndex:startFrameID,IndexID:info.IndexID},{WindowInd
1752
1753
  this.GetSelectedChartInfo=function(selectedChart){if(!selectedChart)return null;var result={Type:0};var id=selectedChart.Identify;if(id=="Main-KLine"){result.Name=this.Name;result.Symbol=this.Symbol;result.Type=JSCHART_DRAGCHART_TYPE_ID.MAIN_KLINE;}else if(id.indexOf("Overlay-KLine-")==0){result.Name=selectedChart.Chart.Title;result.Symbol=selectedChart.Chart.Symbol;result.Type=JSCHART_DRAGCHART_TYPE_ID.OVERLAY_KLINE;}else if(id.indexOf("Overlay-Minute-")==0){result.Name=selectedChart.Chart.Title;result.Symbol=selectedChart.Chart.Symbol;result.Type=JSCHART_DRAGCHART_TYPE_ID.OVERLAY_MINUTE;}else if(id=="Minute-Line"){result.Name=this.Name;result.Symbol=this.Symbol;result.Type=JSCHART_DRAGCHART_TYPE_ID.MAIN_MINUTE;}else if(id=="Minute-Average-Line"){result.Name=this.Name;result.Symbol=this.Symbol;result.Type=JSCHART_DRAGCHART_TYPE_ID.MAIN_AVERAGE_MINUTE;}else if(id=="Minute-Vol-Bar"){result.Name=this.Name;result.Symbol=this.Symbol;result.Type=JSCHART_DRAGCHART_TYPE_ID.MAIN_MINUTE_VOL;}else if(id.indexOf("guid")==0){for(var i=0;i<this.TitlePaint.length;++i){var titleItem=this.TitlePaint[i];if(titleItem.ClassName!="DynamicChartTitlePainting")continue;if(titleItem.Identify==id){result.IndexName=titleItem.Title;result.IndexID=id;result.Type=JSCHART_DRAGCHART_TYPE_ID.MAIN_INDEX;break;}var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=(0,_getIterator3.default)(titleItem.OverlayIndex),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var item=_step2.value;if(item[0]==id){result.IndexName=item[1].Title;result.IndexID=id;result.Type=JSCHART_DRAGCHART_TYPE_ID.OVERLAY_INDEX;break;}}}catch(err){_didIteratorError2=true;_iteratorError2=err;}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return();}}finally{if(_didIteratorError2){throw _iteratorError2;}}}if(result.Type>0)break;}}return result;};//点击事件
1753
1754
  this.ClickEvent=function(e){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK);if(!event||!event.Callback)return false;if(this.ClickDownPoint.X!=e.clientX||this.ClickDownPoint.Y!=e.clientY)return false;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-uielement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-uielement.getBoundingClientRect().top)*pixelTatio;var data={X:e.clientX,Y:e.clientY,FrameID:-1};var isInClient=false;this.Canvas.beginPath();this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());isInClient=this.Canvas.isPointInPath(x,y);if(isInClient){var yValueExtend={};var yValue=this.Frame.GetYData(y,yValueExtend);if(IFrameSplitOperator.IsNumber(yValueExtend.FrameID)&&yValueExtend.FrameID>=0){var xValue=this.Frame.GetXData(x);data.FrameID=yValueExtend.FrameID;data.Data={X:xValue,Y:yValue};}}event.Callback(event,data,this);return true;};//双击事件
1754
1755
  this.DBClickEvent=function(dbClickInfo,e){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DBCLICK);if(!event||!event.Callback)return false;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-uielement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-uielement.getBoundingClientRect().top)*pixelTatio;var data={X:e.clientX,Y:e.clientY,FrameID:-1,ClientPos:-1};var clientPos=this.PtInClient(x,y);data.ClientPos=clientPos;if(clientPos>0){var yValueExtend={};var yValue=this.Frame.GetYData(y,yValueExtend);if(IFrameSplitOperator.IsNumber(yValueExtend.FrameID)&&yValueExtend.FrameID>=0){var xValue=this.Frame.GetXData(x);data.FrameID=yValueExtend.FrameID;data.Data={X:xValue,Y:yValue};if(this.GetDataItem)data.Data.Item=this.GetDataItem({ClientPos:clientPos,Index:xValue,Point:{X:x,Y:y}});}}//选中图形
1755
- if(dbClickInfo&&dbClickInfo.SelectedChart){data.SelectedChart=this.GetSelectedChartInfo(dbClickInfo.SelectedChart);}event.Callback(event,data,this);return true;};this.PtInChartPaintTooltip=function(x,y,toolTip){for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.GetTooltipData(x,y,toolTip))return item;}return null;};this.PtInOverlayChartPaintTooltip=function(x,y,toolTip){for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(item.GetTooltipData(x,y,toolTip))return item;}return null;};//扩展图形支持tooltip外部接口
1756
+ if(dbClickInfo&&dbClickInfo.SelectedChart){data.SelectedChart=this.GetSelectedChartInfo(dbClickInfo.SelectedChart);}event.Callback(event,data,this);return true;};this.PtInChartPaintTooltip=function(x,y,toolTip){for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.GetTooltipData(x,y,toolTip))return item;}return null;};//叠加指标提示信息
1757
+ this.PtInOverlayIndexTooltip=function(x,y,tooltip){var windowIndex=this.Frame.PtInFrame(x,y);if(windowIndex<0)return null;if(!this.Frame.SubFrame[windowIndex])return null;var aryOverlay=this.Frame.SubFrame[windowIndex].OverlayIndex;if(!IFrameSplitOperator.IsNonEmptyArray(aryOverlay))return null;for(var i=0;i<aryOverlay.length;++i){var overlayItem=aryOverlay[i];if(!IFrameSplitOperator.IsNonEmptyArray(overlayItem.ChartPaint))continue;for(var j=0;j<overlayItem.ChartPaint.length;++j){var item=overlayItem.ChartPaint[j];if(!item.IsShow)continue;if(item.IsHideScriptIndex())continue;if(item.GetTooltipData(x,y,tooltip)){tooltip.OverlayIndex={WindowIndex:windowIndex,Identify:overlayItem.Identify};if(overlayItem.Script){tooltip.OverlayIndex.IndexName=overlayItem.Script.Name;tooltip.OverlayIndex.IndexID=overlayItem.Script.ID;}return item;}}}return null;};this.PtInOverlayChartPaintTooltip=function(x,y,toolTip){for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];if(item.GetTooltipData(x,y,toolTip))return item;}return null;};//扩展图形支持tooltip外部接口
1756
1758
  this.PtInExtendChartPaintTooltip=function(x,y,tooltip){return null;};this.TryClickPaintEvent=function(eventID,ptClick,e){var event=this.GetEventCallback(eventID);if(event&&event.Callback){if(ptClick.X==e.clientX&&ptClick.Y==e.clientY){var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-uielement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-uielement.getBoundingClientRect().top)*pixelTatio;var toolTip=new TooltipData();var stock=null;//主数据
1757
1759
  var paint=this.PtInChartPaintTooltip(x,y,toolTip);if(paint)stock={Symbol:this.Symbol,Name:this.Name};if(!paint)//叠加数据
1758
1760
  {paint=this.PtInOverlayChartPaintTooltip(x,y,toolTip);if(paint)stock={Symbol:toolTip.ChartPaint.Symbol,Name:toolTip.ChartPaint.Title};}if(toolTip.Data){var data={X:e.clientX,Y:e.clientY,Stock:stock,Tooltip:toolTip};event.Callback(event,data,this);return true;}}}return false;};//判断是单个手指
@@ -1856,7 +1858,7 @@ event.Callback(event,data,this);if(data.PreventDefault)return;}if(button.ID==JSC
1856
1858
  }else if(button.ID==JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING){}};this.PtInTitleButtons=function(x,y){for(var i=0;i<this.TitlePaint.length;++i){var item=this.TitlePaint[i];if(!item.PtInButtons)continue;var button=item.PtInButtons(x,y);if(button){button.Chart=item;return button;}}return null;};this.OnMouseMove=function(x,y,e,isPhone){var _this9=this;this.StopDrawDynamicInfo();this.LastPoint.X=x;this.LastPoint.Y=y;var mouseStatus=null;//鼠标状态
1857
1859
  var button=null;//当前鼠标所在按钮
1858
1860
  var frameID=this.Frame.PtInFrame(x,y);if(IFrameSplitOperator.IsNumber(frameID)&&frameID>=0)//在K线内部移动,调整K线索引
1859
- this.CursorIndex=this.Frame.GetXData(x);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){button=this.PtInButton(x,y);if(button){mouseStatus={Cursor:"pointer",Name:button.Name};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame 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;}//区间选择
1861
+ this.CursorIndex=this.Frame.GetXData(x);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){button=this.PtInButton(x,y);if(button){mouseStatus={Cursor:"pointer",Name:button.Name};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame 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.Frame.PtInHorizontalLabel&&this.Frame.PtInHorizontalLabel(x,y)){mouseStatus={Cursor:"pointer",Name:"HorizontalLabel"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame Horizontal Label ");}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;}//区间选择
1860
1862
  var paint=this.GetRectSelectPaint();if(paint&&paint.GetPointCount()>0){var item=paint.PtInPaint(x,y);if(item){if(item.Type==4)mouseStatus={Cursor:"pointer",Name:"DragRectSelect"};//子区域选中
1861
1863
  else mouseStatus={Cursor:"ew-resize",Name:"DragRectSelect"};JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] drag rect select ",item);}}var sendData={MouseStatus:null,X:x,Y:y,FrameID:frameID,e:e};if(this.TryMouseMove_CustomChartDrag(sendData)){if(sendData.MouseStatus)mouseStatus=sendData.MouseStatus;}var bDrawPicture=false;//是否正在画图
1862
1864
  if(this.CurrentChartDrawPicture){var index=this.Frame.PtInChartFrame(x,y);if(this.CurrentChartDrawPicture.Status!=20){var bDrawValid=false;//是否在有效绘图区域里面
@@ -2125,7 +2127,8 @@ var bindData=this.ChartPaint[0].Data;this.BindIndexData(windowIndex,bindData);//
2125
2127
  for(var i=0;i<aryOverlayIndex.length;++i)//请求叠加指标
2126
2128
  {var item=aryOverlayIndex[i];this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);}this.UpdataDataoffset();//更新数据偏移
2127
2129
  this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
2128
- this.Draw();};}function GetDevicePixelRatio(){if(typeof window=='undefined')return 1;return window.devicePixelRatio||1;}function GetFontHeight(context,font,word){if(!context)return null;if(font)context.font=font;var text='擎';if(IFrameSplitOperator.IsString(word))text=word;var fontInfo=context.measureText(text);var textHeight=fontInfo.fontBoundingBoxAscent+fontInfo.fontBoundingBoxDescent;if(!IFrameSplitOperator.IsNumber(textHeight))textHeight=fontInfo.width+2*GetDevicePixelRatio();return textHeight;}function IsPhoneWeb(){var userAgentInfo=navigator.userAgent;var Agents=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod");for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0)return true;}return false;}function OnKeyDown(e)//键盘事件
2130
+ this.Draw();};this.ClickHorizontalLabel=function(lable,e){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_HORIZONTAL_LABEL);if(event&&event.Callback){var data={Info:lable,PreventDefault:false};//PreventDefault 是否阻止内置的点击处理
2131
+ event.Callback(event,data,this);if(data.PreventDefault)return;}};}function GetDevicePixelRatio(){if(typeof window=='undefined')return 1;return window.devicePixelRatio||1;}function GetFontHeight(context,font,word){if(!context)return null;if(font)context.font=font;var text='擎';if(IFrameSplitOperator.IsString(word))text=word;var fontInfo=context.measureText(text);var textHeight=fontInfo.fontBoundingBoxAscent+fontInfo.fontBoundingBoxDescent;if(!IFrameSplitOperator.IsNumber(textHeight))textHeight=fontInfo.width+2*GetDevicePixelRatio();return textHeight;}function IsPhoneWeb(){var userAgentInfo=navigator.userAgent;var Agents=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod");for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0)return true;}return false;}function OnKeyDown(e)//键盘事件
2129
2132
  {if(this.JSChartContainer&&this.JSChartContainer.OnKeyDown)this.JSChartContainer.OnKeyDown(e);}function OnWheel(e)//上下滚动事件
2130
2133
  {if(this.JSChartContainer&&this.JSChartContainer.OnWheel)this.JSChartContainer.OnWheel(e);}function ToFixed(number,precision){var b=1;if(isNaN(number))return number;if(number<0)b=-1;var multiplier=Math.pow(10,precision);var value=Math.round(Math.abs(number)*multiplier)/multiplier*b;if(/^(\d+(?:\.\d+)?)(e)([\-]?\d+)$/.test(value))var s=value.toFixed2(precision);else var s=value.toString();var rs=s.indexOf('.');if(rs<0&&precision>0){rs=s.length;s+='.';}while(s.length<=rs+precision){s+='0';}return s;}Number.prototype.toFixed2=Number.prototype.toFixed;//备份下老的
2131
2134
  Number.prototype.toFixed=function(precision){return ToFixed(this,precision);};function Guid(){function S4(){return((1+Math.random())*0x10000|0).toString(16).substring(1);}return"guid"+(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());}function GetScrollPosition(){var scrollPos={};var scrollTop=0;var scrollLeft=0;if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollLeft)){scrollTop=document.documentElement.scrollTop;scrollLeft=document.documentElement.scrollLeft;}else if(document.body){scrollTop=document.body.scrollTop;scrollLeft=document.body.scrollLeft;}scrollPos.Top=scrollTop;scrollPos.Left=scrollLeft;return scrollPos;}//修正线段有毛刺
@@ -2137,7 +2140,7 @@ return fixValue;}function ToFixedRect(value){// With a bitwise or.
2137
2140
  //rounded = ~~ (0.5 + somenum);
2138
2141
  // Finally, a left bitwise shift.
2139
2142
  //value*=GetDevicePixelRatio();
2140
- var rounded;return rounded=0.5+value<<0;}//深拷贝
2143
+ var rounded;return rounded=0.5+value<<0;}function PtInRect(x,y,rect){if(x>=rect.Left&&x<=rect.Right&&y>=rect.Top&&y<=rect.Bottom)return true;return false;}//深拷贝
2141
2144
  function CloneData(data){if(!data)return null;var strData=(0,_stringify2.default)(data);var item=JSON.parse(strData);return item;}function IsRecvOverlap(rect1,rect2){return Math.max(rect1.Left,rect2.Left)<Math.min(rect1.Right,rect2.Right)&&Math.max(rect1.Top,rect2.Top)<Math.min(rect1.Bottom,rect2.Bottom);}function CopyMarginConfig(dest,src){if(!src||!dest)return;if(IFrameSplitOperator.IsNumber(src.Left))dest.Left=src.Left;if(IFrameSplitOperator.IsNumber(src.Top))dest.Top=src.Top;if(IFrameSplitOperator.IsNumber(src.Right))dest.Right=src.Right;if(IFrameSplitOperator.IsNumber(src.Bottom))dest.Bottom=src.Bottom;}//兼容老版本
2142
2145
  function CopyMerginConfig(dest,src){CopyMarginConfig(dest,src);}//数值比较
2143
2146
  function NumberCompare(){}//<
@@ -2232,8 +2235,10 @@ this.IsMinSize=false;//窗口是否最小化
2232
2235
  this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSChartResource.FrameLogo.Font;this.LogoBGColor=g_JSChartResource.FrameLogo.BGColor;this.GlobalOption;//this.IsDrawLeftBorder;
2233
2236
  this.IsDrawRightBorder=false;//是否绘制右侧刻度空白的边框
2234
2237
  this.IsDrawLeftBorder=false;//是否绘制右侧刻度空白的边框
2238
+ this.HorizontalLabel;//Y轴刻度标签页 (支持点击的才会有)[ { ID:, Args:[], }]
2235
2239
  this.PtInButtons=function(x,y)//坐标是否在按钮上
2236
- {for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2240
+ {for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};//Y轴标签文字
2241
+ this.PtInHorizontalLabel=function(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalLabel))return null;for(var i=0;i<this.HorizontalLabel.length;++i){var item=this.HorizontalLabel[i];var rect=item.Rect;if(PtInRect(x,y,rect)){return{ID:item.ID,Rect:rect,Item:item.Item,LineID:item.LineID};}}return;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.HorizontalLabel=[];this.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2237
2242
  };this.DrawFrame=function(){};this.DrawClientBG=function(){if(!this.ClientBGColor)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
2238
2243
  var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.ClientBGColor;this.Canvas.fillRect(left,top,width,height);};this.ClearCoordinateText=function(option){if(IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo)){for(var i=0;i<this.HorizontalInfo.length;++i){var item=this.HorizontalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}if(IFrameSplitOperator.IsNonEmptyArray(this.VerticalInfo)){for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}};//画边框
2239
2244
  this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
@@ -2378,16 +2383,18 @@ this.Canvas.strokeStyle=outRange.Border.Color;this.Canvas.strokeRect(ToFixedPoin
2378
2383
  if(item.BGColor)bgColor=item.BGColor;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=top;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){}else{if(position==2)left=border.LeftEx-textInfo.MaxWidth;var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=left+1*pixelTatio;if(item.ExtendLine&&item.ExtendLine[0]&&position==2)//左侧延长线
2379
2384
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2380
2385
  if(i==0){var yLine=border.LeftEx-exLine.Width;this.DrawLine(yLine,yLine+exLine.Width,y,item.LineColor,lineType,item);}textLeft-=exLine.Width;//rectLeft-=exLine.Width
2381
- }}this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0){if(position==2)this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);}yText+=textHeight+1*pixelTatio;}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){if(i==0)var bgTop=top-itemText.Width;else var bgTop=top-textWidth;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var rectLeft=left-itemText.Width;var textLeft=left;}else{var rectLeft=left-textWidth;var textLeft=left-(textWidth-itemText.Width);}if(item.ExtendLine&&item.ExtendLine[0])//右侧延长线
2386
+ }}this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0){if(position==2)this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);}if(item.ClickData)this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);yText+=textHeight+1*pixelTatio;}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){if(i==0)var bgTop=top-itemText.Width;else var bgTop=top-textWidth;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var rectLeft=left-itemText.Width;var textLeft=left;}else{var rectLeft=left-textWidth;var textLeft=left-(textWidth-itemText.Width);}if(item.ExtendLine&&item.ExtendLine[0])//右侧延长线
2382
2387
  {var exLine=item.ExtendLine[0];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2383
- if(i==0)this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);textLeft-=exLine.Width;rectLeft-=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
2388
+ if(i==0)this.DrawLine(left,left-exLine.Width,y,item.LineColor,lineType,item);textLeft-=exLine.Width;rectLeft-=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);if(item.ClickData)//点击事件
2389
+ this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
2384
2390
  {if(borderRight<10||position==1){if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2385
2391
  var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom-itemText.Width;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Right:right,Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:true};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=right-itemText.Width;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);//文本背景区域
2386
2392
  if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0)this.DrawLine(left,textLeft,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}if(item.Type==3||item.Type==4){if(item.Title){var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-itemText.Width-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-textWidth-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var preTextRect=null;if(mapTextRect&&mapTextRect.has(3))preTextRect=mapTextRect.get(3);var yText=y;var rtText={};for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom;//bgTop+=(textWidth-itemText.Width);
2387
2393
  var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Left:right,Right:this.ChartBorder.GetChartWidth(),Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:false};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0&&textInfo.Text.length==0){var textLeft=right;rtText.Left=textLeft;if(preTextRect&&bgTop<preTextRect.Rect.Bottom){yText=preTextRect.Rect.Bottom;bgTop=yText-textHeight/2-1*pixelTatio;}}else{var textLeft=right+textWidth-itemText.Width;}if(item.ExtendLine&&item.ExtendLine[1])//右侧延长线
2388
2394
  {var exLine=item.ExtendLine[1];if(IFrameSplitOperator.IsNumber(exLine.Width)){var lineType=item.LineType;if(IFrameSplitOperator.IsNumber(exLine.Type))lineType=exLine.Type;//外部设置延长线样式
2389
- if(i==0)this.DrawLine(right,textLeft+exLine.Width,y,item.LineColor,lineType,item);textLeft+=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(textLeft),ToFixedPoint(bgTop),ToFixedRect(itemText.Width+1),ToFixedRect(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft+2*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,y,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;rtText.Bottom=yText;}}}if(mapTextRect&&IFrameSplitOperator.IsNumber(rtText.Left)&&IFrameSplitOperator.IsNumber(rtText.Bottom)){mapTextRect.set(3,{Rect:rtText,Item:item});}if(item.Type==3||item.Type==4){if(item.Title){var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2390
- var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.DrawCustomAreaItem=function(item)//自定义Y轴区域
2395
+ if(i==0)this.DrawLine(right,textLeft+exLine.Width,y,item.LineColor,lineType,item);textLeft+=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(textLeft),ToFixedPoint(bgTop),ToFixedRect(itemText.Width+1),ToFixedRect(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft+2*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,y,item.LineColor,item.LineType,item);if(item.ClickData)//点击事件
2396
+ this.AddHorizontalLabel(textLeft,bgTop,itemText.Width,textHeight,item,i);yText+=textHeight+1*pixelTatio;rtText.Bottom=yText;}}}if(mapTextRect&&IFrameSplitOperator.IsNumber(rtText.Left)&&IFrameSplitOperator.IsNumber(rtText.Bottom)){mapTextRect.set(3,{Rect:rtText,Item:item});}if(item.Type==3||item.Type==4){if(item.Title){var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2397
+ var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.AddHorizontalLabel=function(left,top,width,height,item,lineID){var rtLabel={Left:left,Top:top,Width:width,Height:height};rtLabel.Right=rtLabel.Left+rtLabel.Width;rtLabel.Bottom=rtLabel.Top+rtLabel.Height;var lableItem={Rect:rtLabel,Item:item,ID:item.ClickData.ID,Args:item.ClickData.Args,LineID:lineID};this.HorizontalLabel.push(lableItem);};this.DrawCustomAreaItem=function(item)//自定义Y轴区域
2391
2398
  {if(!item.AreaData)return;if(this.IsHScreen)return;//暂时不支持横屏
2392
2399
  //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
2393
2400
  if(!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value)||item.AreaData.Value.length!=2)return;var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);var min=Math.min(item.AreaData.Value[0],item.AreaData.Value[1]);if(min>=this.HorizontalMax)return;if(max<=this.HorizontalMin)return;if(max>this.HorizontalMax)max=this.HorizontalMax;if(min<this.HorizontalMin)min=this.HorizontalMin;var border=this.GetBorder();var left=border.Left;var right=border.Right;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var yTop=this.GetYFromData(max);var yBottom=this.GetYFromData(min);if(item.AreaData.Position.includes(0)&&borderLeft>10)//左
@@ -2959,7 +2966,8 @@ var yValue=frame.GetYData(y);if(frame.YSplitOperator.CoordinateType==1)//百分
2959
2966
  }}var bottom=this.ChartBorder.GetBottom();var chartHeight=this.ChartBorder.GetChartHeight();var left=this.ChartBorder.GetLeft();var right=this.ChartBorder.GetRight();//底部
2960
2967
  if(x>=left&&x<=right&&y>bottom&&y<chartHeight)return-3;return-1;};this.PtInChartFrame=function(x,y)//鼠标在图形区域, 取出上下空白
2961
2968
  {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;//转成整形
2962
- }}return-1;};this.PtInButtons=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Height<=0)continue;var button=item.Frame.PtInButtons(x,y);if(button){button.Frame=item.Frame;button.FrameID=i;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轴坐标上
2969
+ }}return-1;};//Y轴刻度标签
2970
+ this.PtInHorizontalLabel=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Height<=0)continue;var label=item.Frame.PtInHorizontalLabel(x,y);if(label){label.Frame=item.Frame;label.FrameID=i;return label;}}return null;};this.PtInButtons=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Height<=0)continue;var button=item.Frame.PtInButtons(x,y);if(button){button.Frame=item.Frame;button.FrameID=i;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轴坐标上
2963
2971
  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.PtInFrameVertical=function(x,y){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Height<=0)continue;if(!item.Frame.PtInVertical)continue;if(item.Frame.PtInVertical(x,y)){return{Frame:item.Frame};}}return null;};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,option){var result=this.SubFrame[0].Frame.ZoomDown(cursorIndex,option);this.UpdateAllFrame();return result;};this.SetXShowCount=function(showCount){var result=this.SubFrame[0].Frame.SetXShowCount(showCount);this.UpdateAllFrame();return result;};this.GetXShowCount=function(){var xPointcount=-1;if(!IFrameSplitOperator.IsNonEmptyArray(this.SubFrame))return xPointcount;var subFrame=this.SubFrame[0];if(!subFrame.Frame)return xPointcount;xPointcount=subFrame.Frame.XPointCount;return xPointcount;};this.XCoordinateZoom=function(step,isMoveLeft){var result=this.SubFrame[0].Frame.XCoordinateZoom(step,isMoveLeft);this.UpdateAllFrame();return result;};//设置重新计算刻度坐标
2964
2972
  this.ResetXYSplit=function(){for(var _i in this.SubFrame){this.SubFrame[_i].Frame.XYSplit=true;}};this.ResetXSplit=function(){for(var _i2 in this.SubFrame){this.SubFrame[_i2].Frame.XSplit=true;}};this.ResetYCustomSplit=function(windowIndex){if(!IFrameSplitOperator.IsNonEmptyArray(this.SubFrame))return;if(IFrameSplitOperator.IsNumber(windowIndex)&&windowIndex>=0){var item=this.SubFrame[windowIndex];if(item.Frame)item.Frame.YCustomSplit=true;}else{for(var i=0;i<this.SubFrame.length;++i){this.SubFrame[i].Frame.YCustomSplit=true;}}};//清空Y轴坐标的最大最小值
2965
2973
  this.ClearYCoordinateMaxMin=function(windowIndex){if(IFrameSplitOperator.IsNumber(windowIndex)){var subItem=this.SubFrame[windowIndex];if(!subItem||!subItem.Frame)return;var frame=subItem.Frame;if(frame.YMaxMin){frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;}}else{for(var i=0;i<this.SubFrame.length;++i){var subItem=this.SubFrame[i];var frame=subItem.Frame;if(frame.YMaxMin){frame.YMaxMin.Max=null;frame.YMaxMin.Min=null;}}}};this.SetLanguage=function(languageID){for(var _i3 in this.SubFrame){var item=this.SubFrame[_i3];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()//获取当前页显示的数据个数
@@ -7708,7 +7716,7 @@ this.Draw();};this.GetOverlayIndexByIdentify=function(identify){for(var i=0;i<th
7708
7716
  this.UpdateOverlayIndex=function(identify){var overlayIndex=this.GetOverlayIndexByIdentify(identify);if(overlayIndex==null){console.warn('[KLineChartContainer::UpdateOverlayIndex] can\'t find overlay index. [identify='+identify+']');return;}if(!this.ChartPaint[0])return;var kData=this.ChartPaint[0].Data;if(!kData)return;this.BindOverlayIndexData(overlayIndex.OverlayItem,overlayIndex.WindowIndex,kData);};//修改参数指标
7709
7717
  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){this.CancelZoomUpDownFrameY(dragY);}}var selectedChart;//图形选中
7710
7718
  if(this.SelectedChart.EnableSelected){selectedChart=this.PtInChart(x,y);}var dbClickInfo={SelectedChart:selectedChart};this.DBClickEvent(dbClickInfo,e);if(!selectedChart&&this.EnableZoomIndexWindow)//双击放大缩小
7711
- {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 tooltip=new TooltipData();if(!this.PtInChartPaintTooltip(x,y,tooltip))return;if(!tooltip.Data)return;var event=null;if(this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE))event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);if(event){if(this.ClickChartTimer!=null)//清空单击定时器
7719
+ {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 tooltip=new TooltipData();if(!this.PtInChartPaintTooltip(x,y,tooltip)){if(!this.PtInOverlayIndexTooltip(x,y,tooltip))return;}if(!tooltip.Data)return;var event=null;if(this.mapEvent.has(JSCHART_EVENT_ID.DBCLICK_KLINE))event=this.mapEvent.get(JSCHART_EVENT_ID.DBCLICK_KLINE);if(event){if(this.ClickChartTimer!=null)//清空单击定时器
7712
7720
  {clearTimeout(this.ClickChartTimer);this.ClickChartTimer=null;}var data={Tooltip:tooltip,Stock:{Symbol:this.Symbol,Name:this.Name},X:e.clientX,Y:e.clientY,PreventDefault:false};event.Callback(event,data,this);if(data.PreventDefault)return;}//内置弹分时图
7713
7721
  if(!this.PopMinuteChart)return;this.ShowMinuteChartDialog({Chart:this,Tooltip:tooltip,e:e},x,y);};this.CancelAutoUpdate=function()//关闭停止更新
7714
7722
  {if(typeof this.AutoUpdateTimer=='number'){clearTimeout(this.AutoUpdateTimer);this.AutoUpdateTimer=undefined;}};//数据自动更新
@@ -13741,7 +13749,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13741
13749
  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);};}/********************************************************************************
13742
13750
  * 版本信息输出
13743
13751
  *
13744
- */var HQCHART_VERSION="1.1.13824";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();//把给外界调用的方法暴露出来
13752
+ */var HQCHART_VERSION="1.1.13830";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();//把给外界调用的方法暴露出来
13745
13753
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13746
13754
  // BaseIndex:BaseIndex,
13747
13755
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13825",
3
+ "version": "1.1.13831",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -2621,6 +2621,7 @@ var JSCHART_EVENT_ID=
2621
2621
 
2622
2622
  ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156, //日盘夜盘的分界线
2623
2623
  ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
2624
+ ON_CLICK_HORIZONTAL_LABEL:158, //点击Y轴刻度标签
2624
2625
  }
2625
2626
 
2626
2627
  var JSCHART_OPERATOR_ID=
@@ -3390,6 +3391,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3390
3391
  return true;
3391
3392
  }
3392
3393
 
3394
+ var label=this.Frame.PtInHorizontalLabel(x,y);
3395
+ if (label && this.ClickHorizontalLabel)
3396
+ {
3397
+ this.ClickHorizontalLabel(label, e);
3398
+ return true;
3399
+ }
3400
+
3393
3401
  return false;
3394
3402
  }
3395
3403
 
@@ -4396,6 +4404,44 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
4396
4404
  return null;
4397
4405
  }
4398
4406
 
4407
+ //叠加指标提示信息
4408
+ this.PtInOverlayIndexTooltip=function(x, y, tooltip)
4409
+ {
4410
+ var windowIndex=this.Frame.PtInFrame(x,y);
4411
+ if (windowIndex<0) return null;
4412
+ if (!this.Frame.SubFrame[windowIndex]) return null;
4413
+ var aryOverlay=this.Frame.SubFrame[windowIndex].OverlayIndex;
4414
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryOverlay)) return null;
4415
+
4416
+ for(var i=0; i<aryOverlay.length; ++i)
4417
+ {
4418
+ var overlayItem=aryOverlay[i];
4419
+ if (!IFrameSplitOperator.IsNonEmptyArray(overlayItem.ChartPaint)) continue;
4420
+
4421
+ for(var j=0;j<overlayItem.ChartPaint.length;++j)
4422
+ {
4423
+ var item=overlayItem.ChartPaint[j];
4424
+ if (!item.IsShow) continue;
4425
+ if (item.IsHideScriptIndex()) continue;
4426
+
4427
+ if (item.GetTooltipData(x,y,tooltip))
4428
+ {
4429
+ tooltip.OverlayIndex={ WindowIndex:windowIndex , Identify:overlayItem.Identify };
4430
+ if (overlayItem.Script)
4431
+ {
4432
+ tooltip.OverlayIndex.IndexName=overlayItem.Script.Name;
4433
+ tooltip.OverlayIndex.IndexID=overlayItem.Script.ID;
4434
+ }
4435
+
4436
+ return item;
4437
+ }
4438
+
4439
+ }
4440
+ }
4441
+
4442
+ return null;
4443
+ }
4444
+
4399
4445
  this.PtInOverlayChartPaintTooltip=function(x,y,toolTip)
4400
4446
  {
4401
4447
  for(var i=0;i<this.OverlayChartPaint.length;++i)
@@ -6198,6 +6244,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6198
6244
  JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame bottom ");
6199
6245
  }
6200
6246
 
6247
+ if (this.Frame.PtInHorizontalLabel && this.Frame.PtInHorizontalLabel(x,y))
6248
+ {
6249
+ mouseStatus={ Cursor:"pointer", Name:"HorizontalLabel"};
6250
+ JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame Horizontal Label ");
6251
+ }
6252
+
6201
6253
  if (this.SelectedChart.EnableMoveOn && this.PtInChart && !this.CurrentChartDrawPicture)
6202
6254
  {
6203
6255
  var chartInfo=this.PtInChart(x,y);
@@ -9900,6 +9952,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9900
9952
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
9901
9953
  this.Draw();
9902
9954
  }
9955
+
9956
+ this.ClickHorizontalLabel=function(lable, e)
9957
+ {
9958
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_HORIZONTAL_LABEL);
9959
+ if (event && event.Callback)
9960
+ {
9961
+ var data={ Info:lable, PreventDefault:false }; //PreventDefault 是否阻止内置的点击处理
9962
+ event.Callback(event,data,this);
9963
+ if (data.PreventDefault) return;
9964
+ }
9965
+ }
9903
9966
  }
9904
9967
 
9905
9968
  function GetDevicePixelRatio()
@@ -10038,6 +10101,13 @@ function ToFixedRect(value)
10038
10101
  return rounded = (0.5 + value) << 0;
10039
10102
  }
10040
10103
 
10104
+ function PtInRect(x,y, rect)
10105
+ {
10106
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
10107
+
10108
+ return false;
10109
+ }
10110
+
10041
10111
  //深拷贝
10042
10112
  function CloneData(data)
10043
10113
  {
@@ -10505,6 +10575,8 @@ function IChartFramePainting()
10505
10575
  this.IsDrawRightBorder=false; //是否绘制右侧刻度空白的边框
10506
10576
  this.IsDrawLeftBorder=false; //是否绘制右侧刻度空白的边框
10507
10577
 
10578
+ this.HorizontalLabel; //Y轴刻度标签页 (支持点击的才会有)[ { ID:, Args:[], }]
10579
+
10508
10580
  this.PtInButtons=function(x,y) //坐标是否在按钮上
10509
10581
  {
10510
10582
  for(var i=0;i<this.Buttons.length;++i)
@@ -10525,6 +10597,24 @@ function IChartFramePainting()
10525
10597
  return null;
10526
10598
  }
10527
10599
 
10600
+ //Y轴标签文字
10601
+ this.PtInHorizontalLabel=function(x,y)
10602
+ {
10603
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalLabel)) return null;
10604
+
10605
+ for(var i=0;i<this.HorizontalLabel.length;++i)
10606
+ {
10607
+ var item=this.HorizontalLabel[i];
10608
+ var rect=item.Rect;
10609
+ if (PtInRect(x,y, rect))
10610
+ {
10611
+ return { ID:item.ID, Rect:rect, Item:item.Item, LineID:item.LineID };
10612
+ }
10613
+ }
10614
+
10615
+ return;
10616
+ }
10617
+
10528
10618
  this.GetBorder=function()
10529
10619
  {
10530
10620
  if (this.IsHScreen) return this.ChartBorder.GetHScreenBorder();
@@ -10534,6 +10624,7 @@ function IChartFramePainting()
10534
10624
  this.Draw=function()
10535
10625
  {
10536
10626
  this.Buttons=[];
10627
+ this.HorizontalLabel=[];
10537
10628
  this.DrawClientBG();
10538
10629
  this.DrawFrame();
10539
10630
  this.DrawBorder();
@@ -12608,7 +12699,10 @@ function AverageWidthFrame()
12608
12699
  if (position==2) this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);
12609
12700
  else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
12610
12701
  }
12611
-
12702
+
12703
+ if (item.ClickData)
12704
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
12705
+
12612
12706
  yText+=textHeight+1*pixelTatio;
12613
12707
  }
12614
12708
  }
@@ -12687,7 +12781,10 @@ function AverageWidthFrame()
12687
12781
  }
12688
12782
 
12689
12783
  if (i==0) this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);
12690
-
12784
+
12785
+ if (item.ClickData) //点击事件
12786
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
12787
+
12691
12788
  yText+=textHeight+1*pixelTatio;
12692
12789
  }
12693
12790
  }
@@ -12878,6 +12975,9 @@ function AverageWidthFrame()
12878
12975
  }
12879
12976
 
12880
12977
  if (i==0) this.DrawLine(left,right,y,item.LineColor,item.LineType,item);
12978
+
12979
+ if (item.ClickData) //点击事件
12980
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
12881
12981
 
12882
12982
  yText+=textHeight+1*pixelTatio;
12883
12983
 
@@ -12922,6 +13022,15 @@ function AverageWidthFrame()
12922
13022
  }
12923
13023
  }
12924
13024
 
13025
+ this.AddHorizontalLabel=function(left, top, width, height, item, lineID)
13026
+ {
13027
+ var rtLabel={ Left:left, Top:top, Width:width, Height:height };
13028
+ rtLabel.Right=rtLabel.Left+rtLabel.Width;
13029
+ rtLabel.Bottom=rtLabel.Top+rtLabel.Height;
13030
+ var lableItem={ Rect:rtLabel, Item:item, ID:item.ClickData.ID, Args:item.ClickData.Args, LineID:lineID };
13031
+ this.HorizontalLabel.push(lableItem);
13032
+ }
13033
+
12925
13034
  this.DrawCustomAreaItem=function(item) //自定义Y轴区域
12926
13035
  {
12927
13036
  if (!item.AreaData) return;
@@ -19754,6 +19863,25 @@ function HQTradeFrame()
19754
19863
  return -1;
19755
19864
  }
19756
19865
 
19866
+ //Y轴刻度标签
19867
+ this.PtInHorizontalLabel=function(x,y)
19868
+ {
19869
+ for(var i=0; i<this.SubFrame.length; ++i)
19870
+ {
19871
+ var item=this.SubFrame[i];
19872
+ if (item.Height<=0) continue;
19873
+ var label=item.Frame.PtInHorizontalLabel(x,y);
19874
+ if (label)
19875
+ {
19876
+ label.Frame=item.Frame;
19877
+ label.FrameID=i;
19878
+ return label;
19879
+ }
19880
+ }
19881
+
19882
+ return null;
19883
+ }
19884
+
19757
19885
  this.PtInButtons=function(x,y)
19758
19886
  {
19759
19887
  for(var i=0; i<this.SubFrame.length; ++i)
@@ -77825,7 +77953,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
77825
77953
  }
77826
77954
 
77827
77955
  var tooltip=new TooltipData();
77828
- if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
77956
+ if (!this.PtInChartPaintTooltip(x,y,tooltip))
77957
+ {
77958
+ if (!this.PtInOverlayIndexTooltip(x, y,tooltip)) return;
77959
+ }
77960
+
77829
77961
  if (!tooltip.Data) return;
77830
77962
 
77831
77963
  var event=null;
@@ -6546,6 +6546,7 @@ var JSCHART_EVENT_ID=
6546
6546
 
6547
6547
  ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156, //日盘夜盘的分界线
6548
6548
  ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
6549
+ ON_CLICK_HORIZONTAL_LABEL:158, //点击Y轴刻度标签
6549
6550
  }
6550
6551
 
6551
6552
  var JSCHART_OPERATOR_ID=
@@ -7315,6 +7316,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7315
7316
  return true;
7316
7317
  }
7317
7318
 
7319
+ var label=this.Frame.PtInHorizontalLabel(x,y);
7320
+ if (label && this.ClickHorizontalLabel)
7321
+ {
7322
+ this.ClickHorizontalLabel(label, e);
7323
+ return true;
7324
+ }
7325
+
7318
7326
  return false;
7319
7327
  }
7320
7328
 
@@ -8321,6 +8329,44 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8321
8329
  return null;
8322
8330
  }
8323
8331
 
8332
+ //叠加指标提示信息
8333
+ this.PtInOverlayIndexTooltip=function(x, y, tooltip)
8334
+ {
8335
+ var windowIndex=this.Frame.PtInFrame(x,y);
8336
+ if (windowIndex<0) return null;
8337
+ if (!this.Frame.SubFrame[windowIndex]) return null;
8338
+ var aryOverlay=this.Frame.SubFrame[windowIndex].OverlayIndex;
8339
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryOverlay)) return null;
8340
+
8341
+ for(var i=0; i<aryOverlay.length; ++i)
8342
+ {
8343
+ var overlayItem=aryOverlay[i];
8344
+ if (!IFrameSplitOperator.IsNonEmptyArray(overlayItem.ChartPaint)) continue;
8345
+
8346
+ for(var j=0;j<overlayItem.ChartPaint.length;++j)
8347
+ {
8348
+ var item=overlayItem.ChartPaint[j];
8349
+ if (!item.IsShow) continue;
8350
+ if (item.IsHideScriptIndex()) continue;
8351
+
8352
+ if (item.GetTooltipData(x,y,tooltip))
8353
+ {
8354
+ tooltip.OverlayIndex={ WindowIndex:windowIndex , Identify:overlayItem.Identify };
8355
+ if (overlayItem.Script)
8356
+ {
8357
+ tooltip.OverlayIndex.IndexName=overlayItem.Script.Name;
8358
+ tooltip.OverlayIndex.IndexID=overlayItem.Script.ID;
8359
+ }
8360
+
8361
+ return item;
8362
+ }
8363
+
8364
+ }
8365
+ }
8366
+
8367
+ return null;
8368
+ }
8369
+
8324
8370
  this.PtInOverlayChartPaintTooltip=function(x,y,toolTip)
8325
8371
  {
8326
8372
  for(var i=0;i<this.OverlayChartPaint.length;++i)
@@ -10123,6 +10169,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10123
10169
  JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame bottom ");
10124
10170
  }
10125
10171
 
10172
+ if (this.Frame.PtInHorizontalLabel && this.Frame.PtInHorizontalLabel(x,y))
10173
+ {
10174
+ mouseStatus={ Cursor:"pointer", Name:"HorizontalLabel"};
10175
+ JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame Horizontal Label ");
10176
+ }
10177
+
10126
10178
  if (this.SelectedChart.EnableMoveOn && this.PtInChart && !this.CurrentChartDrawPicture)
10127
10179
  {
10128
10180
  var chartInfo=this.PtInChart(x,y);
@@ -13825,6 +13877,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13825
13877
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
13826
13878
  this.Draw();
13827
13879
  }
13880
+
13881
+ this.ClickHorizontalLabel=function(lable, e)
13882
+ {
13883
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_HORIZONTAL_LABEL);
13884
+ if (event && event.Callback)
13885
+ {
13886
+ var data={ Info:lable, PreventDefault:false }; //PreventDefault 是否阻止内置的点击处理
13887
+ event.Callback(event,data,this);
13888
+ if (data.PreventDefault) return;
13889
+ }
13890
+ }
13828
13891
  }
13829
13892
 
13830
13893
  function GetDevicePixelRatio()
@@ -13963,6 +14026,13 @@ function ToFixedRect(value)
13963
14026
  return rounded = (0.5 + value) << 0;
13964
14027
  }
13965
14028
 
14029
+ function PtInRect(x,y, rect)
14030
+ {
14031
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
14032
+
14033
+ return false;
14034
+ }
14035
+
13966
14036
  //深拷贝
13967
14037
  function CloneData(data)
13968
14038
  {
@@ -14430,6 +14500,8 @@ function IChartFramePainting()
14430
14500
  this.IsDrawRightBorder=false; //是否绘制右侧刻度空白的边框
14431
14501
  this.IsDrawLeftBorder=false; //是否绘制右侧刻度空白的边框
14432
14502
 
14503
+ this.HorizontalLabel; //Y轴刻度标签页 (支持点击的才会有)[ { ID:, Args:[], }]
14504
+
14433
14505
  this.PtInButtons=function(x,y) //坐标是否在按钮上
14434
14506
  {
14435
14507
  for(var i=0;i<this.Buttons.length;++i)
@@ -14450,6 +14522,24 @@ function IChartFramePainting()
14450
14522
  return null;
14451
14523
  }
14452
14524
 
14525
+ //Y轴标签文字
14526
+ this.PtInHorizontalLabel=function(x,y)
14527
+ {
14528
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalLabel)) return null;
14529
+
14530
+ for(var i=0;i<this.HorizontalLabel.length;++i)
14531
+ {
14532
+ var item=this.HorizontalLabel[i];
14533
+ var rect=item.Rect;
14534
+ if (PtInRect(x,y, rect))
14535
+ {
14536
+ return { ID:item.ID, Rect:rect, Item:item.Item, LineID:item.LineID };
14537
+ }
14538
+ }
14539
+
14540
+ return;
14541
+ }
14542
+
14453
14543
  this.GetBorder=function()
14454
14544
  {
14455
14545
  if (this.IsHScreen) return this.ChartBorder.GetHScreenBorder();
@@ -14459,6 +14549,7 @@ function IChartFramePainting()
14459
14549
  this.Draw=function()
14460
14550
  {
14461
14551
  this.Buttons=[];
14552
+ this.HorizontalLabel=[];
14462
14553
  this.DrawClientBG();
14463
14554
  this.DrawFrame();
14464
14555
  this.DrawBorder();
@@ -16533,7 +16624,10 @@ function AverageWidthFrame()
16533
16624
  if (position==2) this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);
16534
16625
  else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
16535
16626
  }
16536
-
16627
+
16628
+ if (item.ClickData)
16629
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
16630
+
16537
16631
  yText+=textHeight+1*pixelTatio;
16538
16632
  }
16539
16633
  }
@@ -16612,7 +16706,10 @@ function AverageWidthFrame()
16612
16706
  }
16613
16707
 
16614
16708
  if (i==0) this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);
16615
-
16709
+
16710
+ if (item.ClickData) //点击事件
16711
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
16712
+
16616
16713
  yText+=textHeight+1*pixelTatio;
16617
16714
  }
16618
16715
  }
@@ -16803,6 +16900,9 @@ function AverageWidthFrame()
16803
16900
  }
16804
16901
 
16805
16902
  if (i==0) this.DrawLine(left,right,y,item.LineColor,item.LineType,item);
16903
+
16904
+ if (item.ClickData) //点击事件
16905
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
16806
16906
 
16807
16907
  yText+=textHeight+1*pixelTatio;
16808
16908
 
@@ -16847,6 +16947,15 @@ function AverageWidthFrame()
16847
16947
  }
16848
16948
  }
16849
16949
 
16950
+ this.AddHorizontalLabel=function(left, top, width, height, item, lineID)
16951
+ {
16952
+ var rtLabel={ Left:left, Top:top, Width:width, Height:height };
16953
+ rtLabel.Right=rtLabel.Left+rtLabel.Width;
16954
+ rtLabel.Bottom=rtLabel.Top+rtLabel.Height;
16955
+ var lableItem={ Rect:rtLabel, Item:item, ID:item.ClickData.ID, Args:item.ClickData.Args, LineID:lineID };
16956
+ this.HorizontalLabel.push(lableItem);
16957
+ }
16958
+
16850
16959
  this.DrawCustomAreaItem=function(item) //自定义Y轴区域
16851
16960
  {
16852
16961
  if (!item.AreaData) return;
@@ -23679,6 +23788,25 @@ function HQTradeFrame()
23679
23788
  return -1;
23680
23789
  }
23681
23790
 
23791
+ //Y轴刻度标签
23792
+ this.PtInHorizontalLabel=function(x,y)
23793
+ {
23794
+ for(var i=0; i<this.SubFrame.length; ++i)
23795
+ {
23796
+ var item=this.SubFrame[i];
23797
+ if (item.Height<=0) continue;
23798
+ var label=item.Frame.PtInHorizontalLabel(x,y);
23799
+ if (label)
23800
+ {
23801
+ label.Frame=item.Frame;
23802
+ label.FrameID=i;
23803
+ return label;
23804
+ }
23805
+ }
23806
+
23807
+ return null;
23808
+ }
23809
+
23682
23810
  this.PtInButtons=function(x,y)
23683
23811
  {
23684
23812
  for(var i=0; i<this.SubFrame.length; ++i)
@@ -81750,7 +81878,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81750
81878
  }
81751
81879
 
81752
81880
  var tooltip=new TooltipData();
81753
- if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
81881
+ if (!this.PtInChartPaintTooltip(x,y,tooltip))
81882
+ {
81883
+ if (!this.PtInOverlayIndexTooltip(x, y,tooltip)) return;
81884
+ }
81885
+
81754
81886
  if (!tooltip.Data) return;
81755
81887
 
81756
81888
  var event=null;
@@ -138284,7 +138416,7 @@ function ScrollBarBGChart()
138284
138416
 
138285
138417
 
138286
138418
 
138287
- var HQCHART_VERSION="1.1.13824";
138419
+ var HQCHART_VERSION="1.1.13830";
138288
138420
 
138289
138421
  function PrintHQChartVersion()
138290
138422
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13824";
8
+ var HQCHART_VERSION="1.1.13830";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -6590,6 +6590,7 @@ var JSCHART_EVENT_ID=
6590
6590
 
6591
6591
  ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156, //日盘夜盘的分界线
6592
6592
  ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
6593
+ ON_CLICK_HORIZONTAL_LABEL:158, //点击Y轴刻度标签
6593
6594
  }
6594
6595
 
6595
6596
  var JSCHART_OPERATOR_ID=
@@ -7359,6 +7360,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7359
7360
  return true;
7360
7361
  }
7361
7362
 
7363
+ var label=this.Frame.PtInHorizontalLabel(x,y);
7364
+ if (label && this.ClickHorizontalLabel)
7365
+ {
7366
+ this.ClickHorizontalLabel(label, e);
7367
+ return true;
7368
+ }
7369
+
7362
7370
  return false;
7363
7371
  }
7364
7372
 
@@ -8365,6 +8373,44 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8365
8373
  return null;
8366
8374
  }
8367
8375
 
8376
+ //叠加指标提示信息
8377
+ this.PtInOverlayIndexTooltip=function(x, y, tooltip)
8378
+ {
8379
+ var windowIndex=this.Frame.PtInFrame(x,y);
8380
+ if (windowIndex<0) return null;
8381
+ if (!this.Frame.SubFrame[windowIndex]) return null;
8382
+ var aryOverlay=this.Frame.SubFrame[windowIndex].OverlayIndex;
8383
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryOverlay)) return null;
8384
+
8385
+ for(var i=0; i<aryOverlay.length; ++i)
8386
+ {
8387
+ var overlayItem=aryOverlay[i];
8388
+ if (!IFrameSplitOperator.IsNonEmptyArray(overlayItem.ChartPaint)) continue;
8389
+
8390
+ for(var j=0;j<overlayItem.ChartPaint.length;++j)
8391
+ {
8392
+ var item=overlayItem.ChartPaint[j];
8393
+ if (!item.IsShow) continue;
8394
+ if (item.IsHideScriptIndex()) continue;
8395
+
8396
+ if (item.GetTooltipData(x,y,tooltip))
8397
+ {
8398
+ tooltip.OverlayIndex={ WindowIndex:windowIndex , Identify:overlayItem.Identify };
8399
+ if (overlayItem.Script)
8400
+ {
8401
+ tooltip.OverlayIndex.IndexName=overlayItem.Script.Name;
8402
+ tooltip.OverlayIndex.IndexID=overlayItem.Script.ID;
8403
+ }
8404
+
8405
+ return item;
8406
+ }
8407
+
8408
+ }
8409
+ }
8410
+
8411
+ return null;
8412
+ }
8413
+
8368
8414
  this.PtInOverlayChartPaintTooltip=function(x,y,toolTip)
8369
8415
  {
8370
8416
  for(var i=0;i<this.OverlayChartPaint.length;++i)
@@ -10167,6 +10213,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10167
10213
  JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame bottom ");
10168
10214
  }
10169
10215
 
10216
+ if (this.Frame.PtInHorizontalLabel && this.Frame.PtInHorizontalLabel(x,y))
10217
+ {
10218
+ mouseStatus={ Cursor:"pointer", Name:"HorizontalLabel"};
10219
+ JSConsole.Chart.Log("[JSChartContainer::OnMouseMove] frame Horizontal Label ");
10220
+ }
10221
+
10170
10222
  if (this.SelectedChart.EnableMoveOn && this.PtInChart && !this.CurrentChartDrawPicture)
10171
10223
  {
10172
10224
  var chartInfo=this.PtInChart(x,y);
@@ -13869,6 +13921,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13869
13921
  this.UpdateFrameMaxMin(); //调整坐标最大 最小值
13870
13922
  this.Draw();
13871
13923
  }
13924
+
13925
+ this.ClickHorizontalLabel=function(lable, e)
13926
+ {
13927
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_HORIZONTAL_LABEL);
13928
+ if (event && event.Callback)
13929
+ {
13930
+ var data={ Info:lable, PreventDefault:false }; //PreventDefault 是否阻止内置的点击处理
13931
+ event.Callback(event,data,this);
13932
+ if (data.PreventDefault) return;
13933
+ }
13934
+ }
13872
13935
  }
13873
13936
 
13874
13937
  function GetDevicePixelRatio()
@@ -14007,6 +14070,13 @@ function ToFixedRect(value)
14007
14070
  return rounded = (0.5 + value) << 0;
14008
14071
  }
14009
14072
 
14073
+ function PtInRect(x,y, rect)
14074
+ {
14075
+ if (x>=rect.Left && x<=rect.Right && y>=rect.Top && y<=rect.Bottom) return true;
14076
+
14077
+ return false;
14078
+ }
14079
+
14010
14080
  //深拷贝
14011
14081
  function CloneData(data)
14012
14082
  {
@@ -14474,6 +14544,8 @@ function IChartFramePainting()
14474
14544
  this.IsDrawRightBorder=false; //是否绘制右侧刻度空白的边框
14475
14545
  this.IsDrawLeftBorder=false; //是否绘制右侧刻度空白的边框
14476
14546
 
14547
+ this.HorizontalLabel; //Y轴刻度标签页 (支持点击的才会有)[ { ID:, Args:[], }]
14548
+
14477
14549
  this.PtInButtons=function(x,y) //坐标是否在按钮上
14478
14550
  {
14479
14551
  for(var i=0;i<this.Buttons.length;++i)
@@ -14494,6 +14566,24 @@ function IChartFramePainting()
14494
14566
  return null;
14495
14567
  }
14496
14568
 
14569
+ //Y轴标签文字
14570
+ this.PtInHorizontalLabel=function(x,y)
14571
+ {
14572
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalLabel)) return null;
14573
+
14574
+ for(var i=0;i<this.HorizontalLabel.length;++i)
14575
+ {
14576
+ var item=this.HorizontalLabel[i];
14577
+ var rect=item.Rect;
14578
+ if (PtInRect(x,y, rect))
14579
+ {
14580
+ return { ID:item.ID, Rect:rect, Item:item.Item, LineID:item.LineID };
14581
+ }
14582
+ }
14583
+
14584
+ return;
14585
+ }
14586
+
14497
14587
  this.GetBorder=function()
14498
14588
  {
14499
14589
  if (this.IsHScreen) return this.ChartBorder.GetHScreenBorder();
@@ -14503,6 +14593,7 @@ function IChartFramePainting()
14503
14593
  this.Draw=function()
14504
14594
  {
14505
14595
  this.Buttons=[];
14596
+ this.HorizontalLabel=[];
14506
14597
  this.DrawClientBG();
14507
14598
  this.DrawFrame();
14508
14599
  this.DrawBorder();
@@ -16577,7 +16668,10 @@ function AverageWidthFrame()
16577
16668
  if (position==2) this.DrawLine(border.LeftEx,right,yText,item.LineColor,item.LineType,item);
16578
16669
  else this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);
16579
16670
  }
16580
-
16671
+
16672
+ if (item.ClickData)
16673
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
16674
+
16581
16675
  yText+=textHeight+1*pixelTatio;
16582
16676
  }
16583
16677
  }
@@ -16656,7 +16750,10 @@ function AverageWidthFrame()
16656
16750
  }
16657
16751
 
16658
16752
  if (i==0) this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);
16659
-
16753
+
16754
+ if (item.ClickData) //点击事件
16755
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
16756
+
16660
16757
  yText+=textHeight+1*pixelTatio;
16661
16758
  }
16662
16759
  }
@@ -16847,6 +16944,9 @@ function AverageWidthFrame()
16847
16944
  }
16848
16945
 
16849
16946
  if (i==0) this.DrawLine(left,right,y,item.LineColor,item.LineType,item);
16947
+
16948
+ if (item.ClickData) //点击事件
16949
+ this.AddHorizontalLabel(textLeft, bgTop, itemText.Width,textHeight, item, i);
16850
16950
 
16851
16951
  yText+=textHeight+1*pixelTatio;
16852
16952
 
@@ -16891,6 +16991,15 @@ function AverageWidthFrame()
16891
16991
  }
16892
16992
  }
16893
16993
 
16994
+ this.AddHorizontalLabel=function(left, top, width, height, item, lineID)
16995
+ {
16996
+ var rtLabel={ Left:left, Top:top, Width:width, Height:height };
16997
+ rtLabel.Right=rtLabel.Left+rtLabel.Width;
16998
+ rtLabel.Bottom=rtLabel.Top+rtLabel.Height;
16999
+ var lableItem={ Rect:rtLabel, Item:item, ID:item.ClickData.ID, Args:item.ClickData.Args, LineID:lineID };
17000
+ this.HorizontalLabel.push(lableItem);
17001
+ }
17002
+
16894
17003
  this.DrawCustomAreaItem=function(item) //自定义Y轴区域
16895
17004
  {
16896
17005
  if (!item.AreaData) return;
@@ -23723,6 +23832,25 @@ function HQTradeFrame()
23723
23832
  return -1;
23724
23833
  }
23725
23834
 
23835
+ //Y轴刻度标签
23836
+ this.PtInHorizontalLabel=function(x,y)
23837
+ {
23838
+ for(var i=0; i<this.SubFrame.length; ++i)
23839
+ {
23840
+ var item=this.SubFrame[i];
23841
+ if (item.Height<=0) continue;
23842
+ var label=item.Frame.PtInHorizontalLabel(x,y);
23843
+ if (label)
23844
+ {
23845
+ label.Frame=item.Frame;
23846
+ label.FrameID=i;
23847
+ return label;
23848
+ }
23849
+ }
23850
+
23851
+ return null;
23852
+ }
23853
+
23726
23854
  this.PtInButtons=function(x,y)
23727
23855
  {
23728
23856
  for(var i=0; i<this.SubFrame.length; ++i)
@@ -81794,7 +81922,11 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81794
81922
  }
81795
81923
 
81796
81924
  var tooltip=new TooltipData();
81797
- if (!this.PtInChartPaintTooltip(x,y,tooltip)) return;
81925
+ if (!this.PtInChartPaintTooltip(x,y,tooltip))
81926
+ {
81927
+ if (!this.PtInOverlayIndexTooltip(x, y,tooltip)) return;
81928
+ }
81929
+
81798
81930
  if (!tooltip.Data) return;
81799
81931
 
81800
81932
  var event=null;
@@ -142840,7 +142972,7 @@ function HQChartScriptWorker()
142840
142972
 
142841
142973
 
142842
142974
 
142843
- var HQCHART_VERSION="1.1.13824";
142975
+ var HQCHART_VERSION="1.1.13830";
142844
142976
 
142845
142977
  function PrintHQChartVersion()
142846
142978
  {