/*
 FusionCharts JavaScript Library - KDtree
 Copyright FusionCharts Technologies LLP
 License Information at <http://www.fusioncharts.com/license>

 @version 3.12.2
 FusionCharts JavaScript Library - ZoomScatter Chart
 Copyright FusionCharts Technologies LLP
 License Information at <http://www.fusioncharts.com/license>

 @version 3.12.2
*/
(function(P){"object"===typeof module&&"undefined"!==typeof module.exports?module.exports=P:P(FusionCharts)})(function(P){P.register("module",["private","modules.renderer.js-kdtree",function(){function D(f){function x(f,C,G,t){var m={},e;e=t?"y":"x";if(C===G)return m.point=f[C],m;if(1===G-C)return f[C][e]>f[G][e]?(m.point=f[C],m.left={point:f[G]}):(m.point=f[G],m.left={point:f[C]}),m;e=C+G>>1;t?v(f,e,C,G):u(f,e,C,G);m.point=f[e];m.left=x(f,C,e-1,!t);m.right=x(f,e+1,G,!t);return m}function u(f,x,e,
q){for(var m,v,A,p,I;q>e;){600<q-e&&(m=q-e+1,v=x-e+1,A=N(m),p=.5*L(2*A/3),I=.5*B(A*p*(m-p)/m)*(0>v-m/2?-1:1),A=y(e,z(x-v*p/m+I)),m=E(q,z(x+(m-v)*p/m+I)),u(f,x,A,m));m=f[x];v=e;p=q;t(f,e,x);for(f[q].x>m.x&&t(f,e,q);v<p;){t(f,v,p);v++;for(p--;f[v].x<m.x;)v++;for(;f[p].x>m.x;)p--}f[e].x===m.x?t(f,e,p):(p++,t(f,p,q));p<=x&&(e=p+1);x<=p&&(q=p-1)}}function v(f,x,e,q){for(var m,u,A,p,I;q>e;){600<q-e&&(m=q-e+1,u=x-e+1,A=N(m),p=.5*L(2*A/3),I=.5*B(A*p*(m-p)/m)*(0>u-m/2?-1:1),A=y(e,z(x-u*p/m+I)),m=E(q,z(x+(m-
u)*p/m+I)),v(f,x,A,m));m=f[x];u=e;p=q;t(f,e,x);for(f[q].y>m.y&&t(f,e,q);u<p;){t(f,u,p);u++;for(p--;f[u].y<m.y;)u++;for(;f[p].y>m.y;)p--}f[e].y===m.y?t(f,e,p):(p++,t(f,p,q));p<=x&&(e=p+1);x<=p&&(q=p-1)}}function t(f,e,x){var q=f[e];f[e]=f[x];f[x]=q}var q=f&&f[0]&&f[0].r||5,e,y=Math.max,z=Math.floor,B=Math.sqrt,E=Math.min,N=Math.log,L=Math.exp,J=Math.pow;f=f||[];for(e=f.length;e--;)f[e].r>q&&(q=f[e].r),f[e].i=e,f[e].x=+f[e].x,f[e].y=+f[e].y;return{tree:0===f.length?{}:x(f,0,f.length-1,!1),search:function(f,
e,x){function t(a,d){return"circle"===x?B(J(a-f,2)+J(d-e,2))<=z:a>=z&&a<=E&&d>=c&&d<=b}function m(b){var c=f>=b.x1&&f<=b.x2&&e>=b.y1&&e<=b.y2,K;K=b.point.y;K=B(J(f-b.point.x,2)+J(e-K,2));y?c?a?b.point.i>y.point.i&&(y=b,a=c,d=K):(y=b,a=c,d=K):!a&&K<d&&(y=b,a=c,d=K):(y=b,a=c,d=K)}function v(a){"circle"===x?z=a:(z=f-a||0,E=f+a||0,c=e-a||0,b=e+a||0)}function u(a){a&&a.point&&(v(a.point.r),t(a.point.x,a.point.y)&&m(a),z<=a.point.x&&p(a.left),E>=a.point.x&&p(a.right))}function p(a){a&&a.point&&(v(a.point.r),
t(a.point.x,a.point.y)&&m(a),c<=a.point.y&&u(a.left),b>=a.point.y&&u(a.right))}var y,z=f-q,E=f+q,c=e-q,b=e+q,a=!1,d=0;u(this.tree);return y&&y.point||y}}}function e(f){this.configure(f)}var P=this.hcLib,T=function(f,e,u,v,t){return Math.pow(u-f,2)+Math.pow(v-e,2)<=Math.pow(t,2)},X=Math.PI,aa=Math.cos,ca=Math.sin,Y=Math.max,M=Math.min,U=X/180,y=function(f,e,u,v,t,q){return u<=Y(f,t)&&u>=M(f,t)&&v<=Y(e,q)&&v>=M(e,q)?!0:!1},Q=function(f,e,u,v,t,q){e=(v-e)*(t-u);f=(u-f)*(q-v);isNaN(e)&&(e=0);isNaN(f)&&
(f=0);f=e-f;return 0===f?0:0<f?1:2};e.prototype={configure:function(f){this.validatorFn=f?this.shapeValidator():this.defaultValidator()},defaultValidator:function(){var f=this;return function(e){var u=f.mousePoint;return e&&1>=Math.pow((e.x-u.x)/f.xLimit,2)+Math.pow((e.y-u.y)/f.yLimit,2)?!0:!1}},shapeValidator:function(){var f=this;return function(e){var u=f.mousePoint,v=e&&e.shapeInfo,t=!1,q,R=u.x,u=u.y,O;switch(v&&v.type){case "circle":q=v.radius;t=T(R,u,e.x,e.y,q);break;case "arc":t=v.innerradius;
q=v.radius;t=!T(R,u,e.x,e.y,t)&&T(R,u,e.x,e.y,q);break;case "polygon":q=v.radius;O=v.startAngle;v=v.sides;a:{t=e.x;e=e.y;var z,B=0,E,N,L,J,M;z=!1;if(T(R,u,t,e,q)&&3<=v){z=void 0===O?.5*X:O%360*U;M=2*X/v;E=t+q*aa(-z);J=e+q*ca(-z);for(O=0;O<v;O++){z+=M;N=t+q*aa(-z);L=e+q*ca(-z);var C=E,G=J,D=N,m=L,P=R,A=u,p=u,I=Q(C,G,D,m,P,A),Y=Q(C,G,D,m,Infinity,p),Z=Q(P,A,Infinity,p,C,G),c=Q(P,A,Infinity,p,D,m);if(I!==Y&&Z!==c||0===I&&y(C,G,P,A,D,m)||0===Y&&y(C,G,Infinity,p,D,m)||0===Z&&y(P,A,C,G,Infinity,p)||0===
c&&y(P,A,D,m,Infinity,p)){if(0===Q(E,J,R,u,N,L)){t=y(E,J,R,u,N,L);break a}B++}E=N;J=L}z=0!==B%2}t=z}break;case "rect":t=e.x;q=e.y;e=t+(v.width||0);v=q+(v.height||0);t=R>=t&&R<=e&&u>=q&&u<=v;break;case "default":t=!1}return t}},buildKdTree:function(e){this.kdTree=D(e);this.tree=this.kdTree.tree;return this},getNeighbour:function(e,x,u){var v=this.tree,t={x1:e.x-this.xLimit,x2:e.x+this.xLimit,y1:e.y-this.yLimit,y2:e.y+this.yLimit},q=this.validatorFn;this.mousePoint=e;if(x)return this.kdTree&&this.kdTree.search(e.x,
e.y,u);if(v)return this._searchBtwnLimit(t,v,!0,q)},_compair2closest:function(e,x){return!e||e&&x&&x.i>e.i?x:e},_searchBtwnLimit:function(e,x,u,v){var t,q,y=u?e.x1:e.y1,D=u?e.x2:e.y2;t=x&&x.point&&x.point[u?"x":"y"];if(void 0!==t)return v(x.point)&&(q=x.point),t>=y&&x.left&&(q=this._compair2closest(q,this._searchBtwnLimit(e,x.left,!u,v))),t<=D&&x.right&&(q=this._compair2closest(q,this._searchBtwnLimit(e,x.right,!u,v))),q},_setSearchLimit:function(e,x){this.xLimit=e;this.yLimit=x}};e.prototype.constructor=
e;P.KdTree=e}]);P.register("module",["private","modules.renderer.js-zoomscatter",function(){var D=this,e=D.hcLib,da=e.parseTooltext,T=e.Raphael,X=D.window,aa=e.addEvent,ca=e.removeEvent,Y=X.MouseEvent,M=X.document,U=e.BLANKSTRING,y=e.pluck,Q=e.pluckNumber,f=e.getFirstValue,x=e.toRaphaelColor,u=e.hasSVG,v=e.isIE||e.isIE11,t=e.getFirstColor,q=e.hasTouch,R="rgba(192,192,192,"+(v?.002:1E-6)+")",O=Math,z=O.round,B=O.min,E=O.max,N=O.abs,L=O.cos,J=O.sin,ea=O.sqrt,C=O.pow,G=O.floor,fa=2*Math.PI,m=e.getMouseCoordinate,
ga=e.POSITION_BOTTOM,A=e.chartAPI,p=e.HUNDREDSTRING,I=function(c,b){var a=m(b.linkedItems.container,c),d=a.chartX,k=a.chartY,l=b.config,K=l.canvasLeft,e=l.canvasTop,g=l.canvasLeft+l.canvasWidth,l=l.canvasHeight+l.canvasTop;a.insideCanvas=!1;a.originalEvent=c;d>K&&d<g&&k>e&&k<l&&(a.insideCanvas=!0);return a},ha=function(c,b,a){var d;b&&c&&(a||(a={}),a.originalEvent&&(a=a.originalEvent),a.touches&&(a=a.touches[0]),b.dispatchEvent?(Y&&!v?d=new Y(c,{bubbles:!!a.bubbles,cancelable:!!a.cancelable,clientX:a.clientX||
a.pageX&&a.pageX-M.body.scrollLeft-M.documentElement.scrollLeft||0,clientY:a.clientY||a.pageY&&a.pageY-M.body.scrollTop-M.documentElement.scrollTop||0,screenX:a.screenX||0,screenY:a.screenY||0,pageX:a.pageX||0,pageY:a.pageY||0}):M.createEvent&&(d=M.createEvent("HTMLEvents"),d.initEvent(c,!!a.bubbles,!!a.cancelable),d.clientX=a.clientX||a.pageX&&a.pageX-M.body.scrollLeft-M.documentElement.scrollLeft||0,d.clientY=a.clientY||a.pageY&&a.pageY-M.body.scrollTop-M.documentElement.scrollTop||0,d.screenX=
a.screenX||0,d.screenY=a.screenY||0,d.pageX=a.pageX||0,d.pageY=a.pageY||0),d.eventName=c,d&&b.dispatchEvent(d)):M.createEventObject&&b.fireEvent&&(d=M.createEventObject(),d.eventType=c,d.eventName=c,b.fireEvent("on"+c,d)))},Z=e.KdTree;A("zoomscatter",{standaloneInit:!0,defaultDatasetType:"zoomscatter",applicableDSList:{zoomscatter:!0},highlightEnabled:!1,friendlyName:"ZoomScatter Chart",isXY:!0,defaultZeroPlaneHighlighted:!1,creditLabel:!1,configure:function(){var c,b=this.config;A.scatter.configure.apply(this,
arguments);c=this.jsonData.chart;b.stepZoom=1-Q(c.stepzoom,25)/100;b.showToolBarButtonToolText=Q(c.showtoolbarbuttontooltext,1);b.btnResetChartToolText=y(c.btnresetcharttooltext,"Reset Chart");b.btnZoomOutToolText=y(c.btnzoomouttooltext,"Zoom out to previous level");b.btnZoomInToolText=y(c.btnzoomintooltext,"<strong>Zoom in</strong><br/>Or double-click on plot to zoom-in");b.btnSelectZoomToolText=y(c.btnselectzoomtooltext,"<strong>Select a region to zoom-in</strong><br/>Click to enable pan mode.");
b.btnPanToolText=y(c.btnpantooltext,"<strong>Drag to move across chart</strong><br/>Click to enable select-zoom mode.")},_setAxisLimits:function(){var c=this.jsonData,b=this.components.xAxis,a=y(c.chart.xaxislabelmode,"categories"),c=c.categories&&c.categories[0],c=(c&&c.category||[]).slice(),d,k=Infinity,l=-Infinity,e;if("auto"===a||0===c.length){A.mscartesian._setAxisLimits.call(this);a=b[0].getLimit();b[0].setAxisConfig({hasCategory:0});b[0].resetCategoryAxisComponents();for(d=0;d<c.length;d+=
1)if(e=c[d].x)e<k&&(k=e),e>l&&(l=e);if(l>a.max||k<a.min)l=E(l,a.max),k=B(k,a.min),b[0].setDataLimit(l,k)}else b[0].resetNumericAxisComponents(),A.scatterBase._setAxisLimits.call(this)},_createAxes:function(){var c=this.components;A.scatter._createAxes.call(this,arguments);c.yAxis[0].setAxisConfig({animateAxis:!1});c.xAxis[0].setAxisConfig({animateAxis:!1})},_spaceManager:function(){var c,b,a=this.config,d=this.components,k=d.xAxis&&d.xAxis[0];b=d.yAxis&&d.yAxis||[];var l,e,n=d.legend.config.legendPos,
g=a.xDepth,h=a.yDepth,r=a.canvasBgDepth,f=a.canvasBaseDepth,ia=a.canvasBasePadding,F=d.canvas.config.canvasBorderWidth,q=a.realTimeConfig&&a.realTimeConfig.showRTValue,w=a.borderWidth,V=a.canvasMarginTop,W=a.canvasMarginBottom,H=a.canvasMarginLeft,S=a.canvasMarginRight,d=a.minCanvasHeight,m=a.minCanvasWidth;c=a.minChartWidth;var t=a.minChartHeight,v=a.height,u=a.width,p=a._initConfig||(a._initConfig={}),x=!1,y=a.origCanvasTopMargin,z=a.origCanvasBottomMargin,B,A,E=[];p.canvasLeft=a.canvasLeft;p.canvasWidth=
a.canvasWidth;p.canvasHeight=a.canvasHeight;p.canvasTop=a.canvasTop;p.availableHeight=a.availableHeight;p.availableWidth=a.availableWidth;a.canvasWidth-2*w<c&&(e=(a.canvasWidth-c)/2);a.canvasHeight-2*w<t&&(l=(a.canvasHeight-t)/2);this._allocateSpace({top:l||w,bottom:l||w,left:e||w,right:e||w});a.origCanvasWidth=a.canvasWidth;a.origCanvasLeft=a.canvasLeft;a.canvasRight=a.canvasLeft+a.canvasWidth;a.origCanvasRight=a.canvasRight;w=0;for(e=b.length;w<e;w++)l=b[w],c=.7*a.availableWidth,c=l&&l.placeAxis(c)||
{},E.push({axisIndex:w,spaceTaken:c}),l&&this._allocateSpace(c);b=.7*a.canvasHeight;this._manageActionBarSpace&&this._allocateSpace(this._manageActionBarSpace(b));this._manageLegendSpace(void 0);h&&(this._allocateSpace({bottom:h}),a.shift=g+ia+f);r&&this._allocateSpace({right:r});a.canvasWidth-2*F<m&&(A=(a.canvasWidth-m)/2);this._allocateSpace({left:A||F,right:A||F});m>u-H-S&&(h=a.canvasWidth-m,g=H+S,H=a.canvasMarginLeft=h*H/g,S=a.canvasMarginRight=h*S/g);H=H>a.canvasLeft?H-a.canvasLeft:0;this._allocateSpace({left:H,
right:S>u-a.canvasRight?S+a.canvasRight-u:0});b=n===ga?.6*a.canvasHeight:.6*a.canvasWidth;this._manageChartMenuBar(b);b=.2*a.availableHeight;this._allocateSpace(this._getSumValueSpace(b));b=.3*a.availableHeight;a.origCanvasHeight=a.canvasHeight;a.canvasBottom=a.canvasTop+a.canvasHeight;a.origCanvasBottom=a.canvasBottom;a.origCanvasTop=a.canvasTop;a.realtimeEnabled&&(q?this._allocateSpace(this._realTimeValuePositioning(b)):this._hideRealTimeValue());b=.6*a.availableHeight;a.xAxisSpaceAllocation=n=
k&&k.placeAxis(b);k&&this._allocateSpace(n);this._getDSspace&&this._allocateSpace(this._getDSspace(.4*a.canvasWidth));b=.3*a.availableHeight;this._manageScrollerPosition&&this._manageScrollerPosition(b);a.canvasHeight-2*F<d&&(B=(a.canvasHeight-d)/2);this._allocateSpace({top:B||F,bottom:B||F});this._allocateSpace({bottom:f});d>v-V-W&&(x=!0,h=a.canvasHeight-d,g=V+W,V=a.canvasMarginTop=h*V/g,W=a.canvasMarginBottom=h*W/g);k=V>a.canvasTop?V-a.canvasTop:0;f=W>v-a.canvasBottom?W+a.canvasBottom-v:0;this._allocateSpace({top:k,
bottom:f});x&&(g=y+z,x=a.canvasHeight,x>d&&(h=x-d,k=h*y/g,f=h*z/g),this._allocateSpace({top:k,bottom:f}));a.actualCanvasMarginTop=k;a.actualCanvasMarginLeft=H},_createToolBox:function(){var c,b,a,d,k,l,e,n,g,h=this,r=h.config;d=h.components;c=d.chartMenuBar;b=d.actionBar;g=r.showToolBarButtonToolText;var f=r.stepZoom;c&&c.drawn||b&&b.drawn||(A.mscartesian._createToolBox.call(h),c=d.tb,b=c.graphics||(c.graphics={}),a=c.getAPIInstances(c.ALIGNMENT_HORIZONTAL),a=a.Symbol,d=(d.chartMenuBar||d.actionBar).componentGroups[0],
k=b.zoomInButton=(new a("zoomInIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){h.zoom(f)},tooltext:g&&r.btnZoomInToolText||U}),l=b.zoomOutButton=(new a("zoomOutIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){var a=r.viewPortHistory;1<a.length&&(a=a.slice(-2,-1)[0],h.updateVisual(a.x,a.y,a.scaleX,a.scaleY))},tooltext:g&&r.btnZoomOutToolText||U}),e=b.resetButton=(new a("resetIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){var a=r.viewPortConfig,
b=h.graphics;1<r.viewPortHistory.length&&(a.isReset=!0,h.zoomSelection(0,0,r.canvasWidth,r.canvasHeight),r.viewPortHistory.splice(1),b.trackerGroup.attr({cursor:"default"}),h.updateButtonVisual(),h.updateSelectionBox(0,0,0,0));D.raiseEvent("zoomReset",{},h.chartInstance,[h.chartInstance.id])},tooltext:g&&r.btnResetChartToolText||U}),n=b.toggleZoomInButton=(new a("zoomModeIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){h.toogleDragPan(!0)},tooltext:g&&r.btnSelectZoomToolText||
U}),g=b.togglePanButton=(new a("panModeIcon",void 0,c.idCount++,c.pId)).attachEventHandlers({click:function(){h.toogleDragPan(!0)},tooltext:g&&r.btnPanToolText||U}),d.addSymbol(g,!0),d.addSymbol(n,!0),d.addSymbol(e,!0),d.addSymbol(l,!0),d.addSymbol(k,!0))},_createLayers:function(){var c=this.graphics,b=this.components.paper;A.scatter._createLayers.call(this);!c.imageContainer&&(c.imageContainer=b.group("dataset-orphan",c.datasetGroup));this.__preDraw()},_dist:function(c,b){var a=this.components,d;
d=a.xAxis[0];a=a.yAxis[0];if(c&&b)return d=(c.x-b.x)*d.getPVR(),a=(c.y-b.y)*a.getPVR(),Math.sqrt(Math.pow(d,2)+Math.pow(a,2))},__preDraw:function(){var c=this.graphics,b=c.imageContainer,a=this.config,d=a.canvasLeft,k=a.canvasTop,l=a.canvasWidth,e=a.canvasHeight,n=this.jsonData.chart,g=this.linkedItems,g=g.eventListeners||(g.eventListeners=[]),h=this.linkedItems.container,r=this.components.paper;a.updateAnimDuration=500;b.transform("t"+d+","+k);b.attr({"clip-rect":d+","+k+","+l+","+e});a.status="zoom";
a.maxZoomLimit=Q(n.maxzoomlimit,1E3);a.viewPortHistory=[{scaleX:1,scaleY:1,x:0,y:0}];!c.trackerElem&&(c.trackerElem=r.rect(d,k,l,e,0,c.trackerGroup).attr({fill:R,stroke:R}));ca(h,q?"touchstart":"mousemove",this.searchMouseMove);g.push(aa(h,"touchstart mousemove",this.searchMouseMove,this));this.zoomPanManager(b)},searchMouseMove:function(c){var b,a,d,k=c.data,l=k.config,e=l.viewPortConfig,n=k.components,g=n.xAxis[0],h=n.yAxis[0],r=n.trendlines,n=n.vTrendlines;k.linkedItems.container&&!l.isDragging&&
((b=I(c,k))&&b.insideCanvas?(a=l.canvasTop,d=g.getAxisConfig("axisDimention").x||l.canvasLeft,b=e.lastMouseCoordinate={x:Number(g.getValue(b.chartX-d)),y:Number(h.getValue(b.chartY-a))},l.lastMouseEvent=c,l.isDragging||(l=k._bestNeighbour(e.lastMouseCoordinate),r=k._getHoveredTrendLine(b,r),n=k._getHoveredTrendLine(b,n),r&&r.showontop?k._drawTooltip(c.originalEvent,r.tooltext):r||!n||l?!r||n||l?r&&n&&!l&&k._drawTooltip(c.originalEvent,n.tooltext):k._drawTooltip(c.originalEvent,r.tooltext):k._drawTooltip(c.originalEvent,
n.tooltext)),e.neighbourSearchTimer=void 0):k.highlightPoint(!1))},updateSelectionBox:function(c,b,a,d){var k=this.config,l=this.graphics,e=this.components.paper,n=k.viewPortConfig,g=k.cursor,h=l.selectionBox,r=k.canvasRight,f=k.canvasLeft,q=k.canvasTop,F=k.canvasBottom,m=c<a?c:a,w=b<d?b:d,V=c>a?c:a,W=b>d?b:d,H=a-c,S=b-d,g=g?0<H&&0<S?"ne-resize":0>H&&0<S?"nw-resize":0>H&&0>S?"sw-resize":0<H&&0>S?"se-resize":"default":"default",m=m<f?f:m>r?r:m,w=w<q?q:w>F?F:w,H=c===a&&b===d?0:(V>r?r:V<f?f:V)-m,S=c===
a&&b===d?0:(W>F?F:W<q?q:W)-w;h?h.attr({x:m,y:w,width:H,height:S,cursor:g}):l.selectionBox=e.rect(m,w,H,S).attr({"stroke-width":1,stroke:"red",fill:"#00FF00",opacity:.2,cursor:g});l.trackerGroup.attr({cursor:g});k.cursor=g;n.selectionDimensions||(n.selectionDimensions={startX:0,endX:0,startY:0,endY:0});n.selectionDimensions.startX=c;n.selectionDimensions.endX=b;n.selectionDimensions.startY=a;n.selectionDimensions.endY=d},getValue:function(c){var b=this.config,a=this.components,d=b.viewPortConfig;c=
this.getOriginalPositions(c.x,c.y,c.x,c.y);var k=a.xAxis[0].config.axisRange,a=a.yAxis[0].config.axisRange,l=k.min,e=a.max;return{x:l+(c[0]-b.canvasLeft)/(b.canvasWidth*d.scaleX/(k.max-l)),y:e-(c[1]-b.canvasTop)/(b.canvasHeight*d.scaleY/(e-a.min))}},_getTouchViewPort:function(c,b,a){var d,k;k=this.config;var l=k.canvasLeft,e=k.canvasTop;d=k.canvasWidth;k=k.canvasHeight;var n=B(c[0].chartX,c[1].chartX)-l,g=B(c[0].chartY,c[1].chartY)-e,h=Math.abs(c[1].chartX-c[0].chartX);c=Math.abs(c[1].chartY-c[0].chartY);
var l=B(b[0].chartX,b[1].chartX)-l,r=B(b[0].chartY,b[1].chartY)-e,e=Math.abs(b[1].chartX-b[0].chartX)/h*a.scaleX;b=Math.abs(b[1].chartY-b[0].chartY)/c*a.scaleY;n=a.x+n/a.scaleX-l/e;a=a.y+g/a.scaleY-r/b;n=0>n?0:n;a=0>a?0:a;b=1>b?1:b;e=1>e?1:e;d-=d/e;k-=k/b;return{x:n>d?d:n,y:a>k?k:a,scaleX:e,scaleY:b}},getOriginalPositions:function(c,b,a,d){var k=this.config,l=k.viewPortConfig,e=l.scaleX,n=l.scaleY,g=l.x,l=l.y,h=B(c,a);c=E(c,a);a=B(b,d);b=E(b,d);c=c>k.canvasWidth?k.canvasWidth:c;b=b>k.canvasHeight?
k.canvasHeight:b;h=0>h?0:h;a=0>a?0:a;return[g+h/e,l+a/n,(c-h)/e,(b-a)/n]},zoomSelection:function(c,b,a,d){var k=this.config;a&&d&&(a=Math.abs(k.canvasWidth/a),d=Math.abs(k.canvasHeight/d),this.updateVisual(c,b,a,d))},toogleDragPan:function(c){var b=this.config,a=b.status;c&&(b.status="zoom"===a?"pan":"zoom",D.raiseEvent("zoomModeChanged",{panModeActive:b.status},this.chartInstance,[this.chartInstance.id]));this.updateButtonVisual()},updateManager:function(c){var b,a=this.components.dataset,d=a.length;
for(b=0;b<d;b+=1)a[b].draw(c);c||this._drawQuadrant()},zoomPanManager:function(){var c,b=[],a=[],d=this,k=d.config,l=d.graphics,e=d.components,n=e.xAxis[0],g=e.eventListeners||(e.eventListeners=[]),h=d.viewPortConfig,r=!1,f=0,m,F={},p=function(a){var b=a.chartX,d=a.chartY,c=n.getAxisConfig("axisDimention").x||k.canvasLeft,l=k.canvasTop,e=k.canvasRight,g=k.canvasBottom;b<c&&(a.chartX=E(b,c));b>e&&(a.chartX=B(b,e));d<l&&(a.chartY=E(d,l));d>g&&(a.chartY=B(d,g))},w={start:function(a){h=k.viewPortConfig;
q=a.touches?!0:!1;b[0]=I(a,d);d.updateSelectionBox(0,0,0,0);q&&(r=!1,c=a.touches.length,2===c&&(r=!0,F.x=h.x,F.y=h.y,F.scaleX=h.scaleX,F.scaleY=h.scaleY,b[0]=I(a.touches.item(0),d),b[1]=I(a.touches.item(1),d)));k.isDragging=!1;"pan"===k.status&&(k.panStartX=h.x,k.panStartY=h.y,b[0].insideCanvas&&l.trackerGroup.attr({cursor:"move"}))},on:function(c){var g,n,f,w;f=k.panStartX;var ba=k.panStartY;g=h.scaleX;n=h.scaleY;var m=e.xAxis[0],p=e.yAxis[0];q=c.touches?!0:!1;a[0]=I(c,d);a[0].insideCanvas?"pan"===
k.status&&l.trackerGroup.attr({cursor:"move"}):l.trackerGroup.attr({cursor:"default"});q&&c&&(w=c.touches.length,2===w?(r=!0,a[0]=I(c.touches.item(0),d),a[1]=I(c.touches.item(1),d)):r=!1);!k.isDragging&&(!q||2<N(a[0].chartX-b[0].chartX)||2<N(a[0].chartY-b[0].chartY))&&(k.isDragging=!0,d.highlightPoint(!1),"zoom"===k.status&&(b[0].pointValue=d.getValue({x:b[0].chartX,y:b[0].chartY}),D.raiseEvent("selectionStart",{chartX:b[0].chartX,chartY:b[0].chartY,pageX:b[0].pageX,pageY:b[0].pageY,selectionTop:b[0].chartX+
k.canvasLeft,selectionLeft:b[0].chartY+k.canvasTop,selectionWidth:0,selectionHeight:0,startXVAlue:b[0].pointValue.x,startYVAlue:b[0].pointValue.y},d.chartInstance,[d.chartInstance.id])));if(k.isDragging)if(r){if(b[0].insideCanvas||b[1].insideCanvas)f=d._getTouchViewPort(b,a,F),d.updateVisual(f.x,f.y,f.scaleX,f.scaleY,!0)}else"zoom"===k.status?d.updateSelectionBox(b[0].chartX,b[0].chartY,a[0].chartX,a[0].chartY):"pan"!==k.status||1===g&&1===n||!b[0].insideCanvas||(c=b&&a[0].chartX-b[0].chartX,w=b&&
a[0].chartY-b[0].chartY,f-=c/g,ba-=w/n,g=k.canvasWidth*(g-1)/g,n=k.canvasHeight*(n-1)/n,h.x=f>g?g:0>f?0:f,h.y=ba>n?n:0>ba?0:ba,d.updateManager(),m.draw(),p.draw())},end:function(c){var e=I(c,d),g=n.getAxisConfig("axisDimention").x||k.canvasLeft,h=k.canvasTop,K;K=k.canvasWidth/4;var w=k.canvasHeight/4,e=isNaN(e.chartX)||isNaN(e.chartY)?a[0]||b[0]:e;if(k.isDragging){if(r){if(b[0].insideCanvas||b[1].insideCanvas)c=d._getTouchViewPort(b,a,F),d.updateVisual(c.x,c.y,c.scaleX,c.scaleY);r=!1}else"zoom"===
k.status&&(c=e,K=b[0],p(K),p(c),h=d.getOriginalPositions(K.chartX-g,K.chartY-h,c.chartX-g,c.chartY-h))&&(c.pointValue=d.getValue({x:c.chartX,y:c.chartY}),D.raiseEvent("selectionEnd",{chartX:c.chartX,chartY:c.chartY,pageX:c.pageX,pageY:c.pageY,selectionTop:c.chartX+k.canvasLeft,selectionLeft:c.chartY+k.canvasTop,selectionWidth:Math.abs(c.chartX-K.chartX),selectionHeight:Math.abs(c.chartY-K.chartY),startXVAlue:K.pointValue.x,startYVAlue:K.pointValue.y,endXValue:c.pointValue.x,endYValue:c.pointValue.y},
d.chartInstance,[d.chartInstance.id]),K.chartX!==c.chartX&&K.chartY!==c.chartY&&d.zoomSelection(h[0],h[1],h[2],h[3]),d.updateSelectionBox(0,0,0,0));k.isDragging=!1;c=a[0]||b[0];c.data=d;d.searchMouseMove(c)}else e.insideCanvas&&(f+=1,setTimeout(function(){f=0;m=void 0},500),2===f?(c&&c.touches?!0:!1)===m&&(g=e.chartX-g,h=e.chartY-h,h=d.getOriginalPositions(g-K,h-w,g+K,h+w),d.zoomSelection(h[0],h[1],h[2],h[3]),c.preventDefault()):m=c&&c.touches?!0:!1);l.trackerGroup.attr({cursor:"default"})}};g.push(aa(d.linkedItems.container,
"pointerdrag",function(a){w[a.state](a.originalEvent)}))},_drawDataset:function(){var c,b=this.components.dataset,a=b.length;for(c=0;c<a;c+=1)b[c]._deleteGridImages(),b[c].graphics._grid={};this.updateVisual()},updateVisual:function(c,b,a,d,k){var l,e,n,g,h;l=this.config;var r=this.components,f=l.viewPortConfig;h=l.canvasWidth;var m=l.canvasHeight,F=h,q=m,w=l.viewPortHistory,q=w.slice(-1)[0],p=[],p=l.status,t=l._initConfig;e=r.xAxis[0];g=r.yAxis[0];n=this.graphics;r=(r=r.quadrant)&&r.graphics.container;
F=l.maxZoomLimit;f.x=isNaN(c)?c=q.x:c;f.y=isNaN(b)?b=q.y:b;f.scaleX=a||(a=q.scaleX);f.scaleY=d||(d=q.scaleY);a>F&&(f.x=c=B(c,h-h/F),f.scaleX=a=F);d>F&&(f.y=b=B(b,m-m/F),f.scaleY=d=F);if(k)this.updateManager(k);else for(1<a||1<d?("zoom"===p&&this.toogleDragPan(!0),a>=q.scaleX||d>=q.scaleY?(w.push({scaleX:a,scaleY:d,x:c,y:b}),p=["zoomed","zoomIn"]):(w.pop(),q=w.slice(-1)[0],f.x=q.x,f.y=q.y,f.scaleX=q.scaleX,f.scaleY=q.scaleY,p=["zoomed","zoomOut"])):(1<w.length&&w.pop(),"pan"===p&&this.toogleDragPan(!0),
p=["zoomed","zoomOut"]),this.toogleDragPan(),F=l.canvasWidth,q=l.canvasHeight,c&&(c=f.x*=F/h),b&&(f.y*=q/m),l.canvasLeft=t.canvasLeft,l.canvasWidth=t.canvasWidth,l.canvasHeight=t.canvasHeight,l.canvasTop=t.canvasTop,l.availableHeight=t.availableHeight,l.availableWidth=t.availableWidth,this._spaceManager(),this._postSpaceManagement(),this.updateManager(),e.draw(),g.draw(),this._drawCanvas(),h={"clip-rect":l.canvasLeft+","+l.canvasTop+","+l.canvasWidth+","+l.canvasHeight},l.viewPortConfig&&this.graphics.imageContainer.attr({x:l.canvasLeft,
y:l.canvasRight}),n.imageContainer.attr(h).transform("T"+l.canvasLeft+","+l.canvasTop),n.tracker&&n.tracker.attr(h),r&&r.attr(h),l=e.getValue(0),e=e.getValue(F),n=g.getValue(0),g=g.getValue(q),0===arguments.length&&(p=U),h=0;h<p.length;h+=1)"zoomed"===p[h]&&D.raiseEvent("zoomed",{level:w.length,startX:l,startY:n,endX:e,endY:g},this.chartInstance,[this.chartInstance.id]),"zoomIn"===p[h]?D.raiseEvent("zoomedIn",{level:w.length,startX:l,startY:n,endX:e,endY:g},this.chartInstance,[this.chartInstance.id]):
"zoomOut"!==p[h]||f.isReset||D.raiseEvent("zoomedOut",{level:w.length,startX:l,startY:n,endX:e,endY:g},this.chartInstance,[this.chartInstance.id]);this.highlightPoint(!1);f.isReset=!1},getFillColor:function(c,b){b=parseFloat(b/100);0>b?b=0:1<b&&(b=1);c||(c="#FFFFFF");if(v&&!u)return b?c:"transparent";c=c.replace(/^#?([a-f0-9]+)/ig,"$1");c=e.graphics.HEXtoRGB(c);c[3]=b.toString();return"rgba("+c.join(",")+")"},_getHoveredTrendLine:function(c,b){var a=this.components,d=a.yAxis[0],k;k=b&&b.length;var a=
a.xAxis[0].getPixel(c.x),d=d.getPixel(c.y),l,e,n,g,h,f;if(k)for(--k;0<=k;k--)if(e=b[k],g=e.x1,h=e.y1,l=e.x2,f=e.y2,e.isTrendZone){if(a>=g&&a<=l&&d>=h&&d<=f)return e}else if(h!==f&&g!==l?(n=l=(h-f)/(g-l),g=h-l*g,n=N(n*a+-1*d+g)/ea(C(n,2)+C(-1,2))):g===l?n=N(g-a):h===f&&(n=N(h-d)),n<=e.tolerance)return e},_bestNeighbour:function(c){var b=this.components,a=this.config,d=b.xAxis[0],k=b.yAxis[0],l=this.jsonData.chart,f=a.canvasLeft,n=a.canvasTop,g,h,r,q,m,p,t,w,v,u,H,x;x=b.numberFormatter;v=b.dataset;
for(g=v.length-1;0<=g;--g)if(b=v[g],H=b.config,h=H.showHoverEffect,w=H.showTooltip,b.components.kDTree&&b.visible&&(q=b.getElement(c),b=this._dist(c,q),!m||b<p))if(r=g,m=q,p=b,t=v[r]&&H.zoomedRadius||0,p<=t)break;p<=E(t+2,5)?(c=d.getPixel(m.x)-f,n=k.getPixel(m.y)-n,f=y(m.tooltext,H.plotToolText),b=v[r],H=b.config,v=H.tooltip.toolTipSepChar,p=H.tooltip.seriesNameInToolTip,t=m.x,g=m.y,m&&(u=x.yAxis(g),x=x.xAxis(t),u=Number(w)?void 0!==f?da(f,[4,5,6,7,8,9,10,11],{yaxisName:k.getAxisConfig("axisName"),
xaxisName:d.getAxisConfig("axisName"),yDataValue:u,xDataValue:x},m,l,b.config):(p?H.seriesname?H.seriesname+v:"":"")+"x:"+x+v+"y:"+u:U),a.lastHoveredPoint!==m&&this.highlightPoint(h,c,n,m,r,u)):(e.toolTip.hide(),this.highlightPoint(!1));return m},_drawTooltip:function(c,b){var a=this.components.paper,d=e.toolTip;b&&(d.setStyle(a),d.setPosition(c),d.draw(b,a))},highlightPoint:function(c,b,a,d,k,l){var f=this,n=f.config,g=f.components,h=f.graphics,r=g.paper,m=h.tracker,q=(g=g.dataset[k])&&g.config;
k=g&&q.zoomedRadius||0;var p=g&&q.hoverCosmetics,g=p&&p.fill,q=p&&p.borderColor,p=p&&p.borderThickness,t={},t=function(a){e.plotEventHandler.call(this,f,a)},w=function(a){e.plotEventHandler.call(this,f,a,"dataplotRollover")},v=function(a){e.plotEventHandler.call(this,f,a,"dataplotRollout")},u=d&&d.link;m||(m=h.tracker=r.circle(0,0,0,h.trackerGroup).attr({"clip-rect":n.canvasLeft+","+n.canvasTop+","+n.canvasWidth+","+n.canvasHeight}).click(t).trackTooltip(!0).hover(w,v));d&&m.data("eventArgs",{x:d.x,
y:d.y,tooltip:l,link:u});n.lastHoveredPoint=d;t=Number(c)?{r:k,fill:g,stroke:q,"stroke-width":p}:{r:k,fill:R,stroke:R,"stroke-width":0};t.cursor=u?"pointer":"";m.attr(t).tooltip(l).transform("t"+(b+n.canvasLeft)+","+(a+n.canvasTop));d&&ha("mouseover",m&&m.node,n.lastMouseEvent)},zoom:function(c){var b,a,d=this.config,k=d.viewPortConfig;b=k.x;a=k.y;var e=d.canvasWidth,d=d.canvasHeight,f=e/k.scaleX,n=d/k.scaleY,k=f*c;c*=n;k=k>e?e:k;c=c>d?d:c;b=b+f/2-k/2;a=a+n/2-c/2;b=0>b?0:b;a=0>a?0:a;b=b+k>e?e-k:b;
a=a+c>d?d-c:a;this.zoomSelection(b,a,k,c)},updateButtonVisual:function(){var c,b,a,d;a=this.config;var k=this.components.tb.graphics;c=a.status;var e;1>=a.viewPortHistory.length?(a=["zoomOutButton","resetButton","togglePanButton"],d=["zoomInButton"],e="toggleZoomInButton"):(d=["resetButton","zoomOutButton","zoomInButton"],a=[],"zoom"===c?(d.push("togglePanButton"),e="toggleZoomInButton"):"pan"===c&&(d.push("toggleZoomInButton"),e="togglePanButton"));for(c=0;c<a.length;c+=1)b=a[c],k[b].node.attr({config:{hover:{fill:"#FFFFFF",
"stroke-width":1,stroke:"#E3E3E3",cursor:"default"},normal:{fill:"#FFFFFF",stroke:"#E3E3E3","stroke-width":1,cursor:"default"},disable:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3","stroke-opacity":1,cursor:"default"},pressed:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3",cursor:"default"}},fill:["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF",!0],"button-disabled":!1,stroke:"#E3E3E3","stroke-opacity":1});for(c=0;c<d.length;c+=1)b=d[c],k[b].node.attr({config:{hover:{fill:"#FFFFFF","stroke-width":1,
stroke:"#aaaaaa",cursor:"pointer"},normal:{fill:"#FFFFFF",stroke:"#C2C2C2","stroke-width":1,cursor:"pointer"},disable:{fill:"#FFFFFF","stroke-width":1,stroke:"#E3E3E3","stroke-opacity":1,cursor:"pointer"},pressed:{fill:"#EFEFEF","stroke-width":1,stroke:"#C2C2C2",cursor:"pointer"}},"button-disabled":!1,fill:["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF",!0],stroke:"#C2C2C2","stroke-opacity":1});k[e].node.attr({config:{hover:{fill:"#EFEFEF","stroke-width":1,stroke:"#EFEFEF",cursor:"default"},normal:{fill:"#EFEFEF",
stroke:"#E3E3E3","stroke-width":1,cursor:"default"},disable:{fill:"#E6E6E6","stroke-width":1,stroke:"#E3E3E3","stroke-opacity":1,cursor:"default"},pressed:{fill:"#EFEFEF","stroke-width":1,stroke:"#E3E3E3",cursor:"default"}},"button-disabled":!1,fill:["#EFEFEF","#EFEFEF","#EFEFEF","#EFEFEF",!0],stroke:"#E3E3E3","stroke-opacity":1})},_drawAxis:function(){}},A.scatterBase);P.register("component",["dataset","zoomscatter",{type:"zoomscatter",configure:function(){var c,b,a,d,k,e,f;e=this.chart;var n=e.config;
d=e.jsonData.chart;var g=e.getFillColor,h=this.JSONData;this.__base__.configure.call(this);e=this.config;b=this.components;c=y(h.anchorbordercolor,d.anchorbordercolor);e.anchorBorderThickness=y(h.anchorborderthickness,d.anchorborderthickness,c?1:0);b.kDTree=new Z;e.chunkSize=Math.floor(B((h.data||[]).length/5,5E4));c=e.staticRadius=Q(d.staticradius,0);e.radius=Q(h.radius,h.anchorradius,d.radius,d.anchorradius,c?3:.5);f=e.showHoverEffect;c=t(y(h.plotfillhovercolor,h.hovercolor,d.plotfillhovercolor,
d.hovercolor,e.anchorbgcolor));b=y(h.plotfillhoveralpha,h.hoveralpha,d.plotfillhoveralpha,d.hoveralpha,p);a=t(y(h.plotfillhovercolor,h.hovercolor,d.plotfillhovercolor,d.hovercolor,c));k=y(h.plotfillhoveralpha,h.hoveralpha,d.plotfillhoveralpha,d.hoveralpha,p);d=Q(h.borderhoverthickness,d.borderhoverthickness,1);e.hoverCosmetics={showHoverEffect:f,fill:g(c,b),borderColor:g(a,k),borderThickness:d};e.tooltip={toolTipVisible:n.showtooltip,seriesNameInToolTip:n.seriesnameintooltip,toolTipSepChar:n.tooltipsepchar};
e.lastViewPort={}},draw:function(c){var b,a,d;b=this.graphics;d=this.chart;a=d.components;var k=d.graphics.imageContainer,e=a.paper;d=d.config;var f=this.visible,n=d.viewPortConfig,g=this.config,h=g.lastViewPort||{},r=!1;b.container||(b.container={line:e.group(k),plot:e.group(k)});f&&this._conatinerHidden?this.show():f||this._conatinerHidden||this.hide();if(c)this._pixelatedDraw();else{if(h.scaleX!==n.scaleX||h.scaleY!==n.scaleY)h.scaleX=n.scaleX,h.scaleY=n.scaleY,c=a.xAxis[0],b=a.yAxis[0],a=c.getPVR(),
c=b.getPVR(),d=E(g.zoomedRadius=B(g.staticRadius?g.radius:g.radius*B(n.scaleX,n.scaleY),d.canvasWidth/2,d.canvasHeight/2),2),this.components.kDTree._setSearchLimit(d/a,d/c),this._deleteGridImages(),this.graphics._grid={},r=!0;this._gridDraw(r)}},_pixelatedDraw:function(){var c,b,a,d,k,e=this.chart.config;a=this.config;d=this.graphics;var f=a.drawLine,n=a.lastViewPort||{},g=n.scaleX,h=n.scaleY;k=e.viewPortConfig;var r=k.scaleX,m=k.scaleY,n=this.graphics._grid||(this.graphics._grid=[]),g=r/g,h=m/h,
m=e.canvasWidth*g,e=e.canvasHeight*h;a=a._batchDarwTimers;d=d.container;clearTimeout(this.timer);if(a&&a.length)for(;a.length;)clearTimeout(a.shift());d.line.transform("t"+z(-k.x*k.scaleX)+","+z(-k.y*k.scaleY));d.plot.transform("t"+z(-k.x*k.scaleX)+","+z(-k.y*k.scaleY));for(c in n)if(k=n[c])for(b in k)(d=k[b])&&d.drawState&&(a=d.image,a.attr({x:d.xPixel*g,y:d.yPixel*h,width:m,height:e}),f&&(a=d.lineImage,a.attr({x:d.xPixel*g,y:d.yPixel*h,width:m,height:e})))},_deleteGridImages:function(){var c,b,
a,d,e;b=this.config;var l=this.graphics,f=l._imagePool||(l._imagePool=[]),n=l._canvasPool||(l._canvasPool=[]),g=l._lineImagePool||(l._lineImagePool=[]),h=l._lineCanvasPool||(l._lineCanvasPool=[]),r=l._grid||[];if((b=b._batchDarwTimers)&&b.length)for(;b.length;)clearTimeout(b.shift());for(a in r)if(e=r[a])for(d in e)(b=e[d])&&b.drawState&&(c=b.image,c.attr({src:"",width:0,height:0}),f.push(c),delete b.image,c=b.canvas,n.push(c),delete b.canvas,delete b.ctx,c=b.lineImage)&&(c.attr({src:"",width:0,height:0}),
g.push(c),delete b.lineImage,c=b.lineCanvas,h.push(c),delete b.lineCanvas,delete b.lineCtx);delete l._grid},_gridDraw:function(c){var b=this,a=b.graphics,d=b.config,e=b.chart.config.viewPortConfig;clearTimeout(d.timer);a.container.line.transform("t"+z(-e.x*e.scaleX)+","+z(-e.y*e.scaleY));a.container.plot.transform("t"+z(-e.x*e.scaleX)+","+z(-e.y*e.scaleY));c?b._gridManager():d.timer=setTimeout(function(){b._gridManager()},10)},_gridManager:function(){var c,b,a,d,e,l,f,n,g,h=this,r=h.config,m=h.graphics._grid,
q=r._drawGrid||(r._drawGrid=[]),p=h.chart,t=p.config,p=p.components;e=t.viewPortConfig;l=e.scaleX;var w=e.scaleY;f=Math.ceil(w);d=Math.ceil(l);var v=p.xAxis[0],u=p.yAxis[0],p=v.getAxisConfig("axisDimention").axisLength||t.canvasWidth,t=t.canvasHeight,x=v.config,y=u.config,z=x.axisRange.min,x=x.axisRange.max,A=y.axisRange.min,y=y.axisRange.max,D=(x-z)/l,C=(y-A)/w;b=r.radius*B(e.scaleX,e.scaleY)+r.plotCosmetics.borderWidth;v=N(b/(p*e.scaleX/(v.max-v.min)));u=N(b/(t*e.scaleY/(u.max-u.min)));b=p/l;g=
t/w;c=B(1,b/10,g/10);var w={},G=[];l=e.x+c;b=e.x-c+b;n=e.y+c;c=e.y+g-c;e=h._getFocusedGrid(l,n);g=w[e.row]||(w[e.row]={});g[e.col]=!0;e=h._getFocusedGrid(b,n);g=w[e.row]||(w[e.row]={});g[e.col]=!0;e=h._getFocusedGrid(b,c);g=w[e.row]||(w[e.row]={});g[e.col]=!0;e=h._getFocusedGrid(l,c);g=w[e.row]||(w[e.row]={});g[e.col]=!0;l=h._getFocusedGrid();e=l.row;l=l.col;b=E(e-1,0);e=B(e+1,f-1);f=E(l-1,0);l=B(l+1,d-1);d=y-b*C;for(n=b;n<=e;n+=1){m[n]||(m[n]={});b=z+f*D;for(g=f;g<=l;g+=1)c=m[n][g],c||(a=E(d-C,A),
c=B(b+D,x),c=m[n][g]={xPixel:g*p,yPixel:n*t,xMinValue:b,yMinValue:a,xMaxValue:c,yMaxValue:d,drawState:0,xMinWPad:E(b-v,z),yMinWPad:E(a-u,A),xMaxWPad:B(c+v,x),yMaxWPad:B(d+u,y)}),c.drawState||(w[n]&&w[n][g]?q.push({row:n,col:g}):G.push({row:n,col:g})),b+=D;d-=C}(q.length||G.length)&&h._drawGridArr(function(){r._drawGrid=G;h._drawGridArr()})},_getFocusedGrid:function(c,b){var a=this.chart.config,d=a.viewPortConfig,e=a.canvasWidth/d.scaleX,a=a.canvasHeight/d.scaleY,l=isNaN(c)?d.x+e/2:c,d=isNaN(b)?d.y+
a/2:b;return{row:G(d/a),col:G(l/e)}},_drawGridArr:function(c){var b,a,d,e,l=this.chart;b=l.config;var f=l.components,n=b.viewPortConfig,g=this.config,h=g.drawLine,r=g._drawGrid,m=[],p=this.graphics.container,q=f.paper,f=f.xAxis[0].getAxisConfig("axisDimention").axisLength||b.canvasWidth,t=b.canvasHeight,w=this.graphics._grid,v=this.graphics._imagePool||[],u=this.graphics._canvasPool||[],x=this.graphics._lineImagePool||[],y=this.graphics._lineCanvasPool||[],z=g.plotCosmetics,n=g.radius*B(n.scaleX,
n.scaleY),l=(l.components.xAxis[0].getAxisConfig("axisDimention").x||b.canvasLeft)-b.canvasLeft;if(r.length){for(;r.length;)b=r.shift(),b=w[b.row][b.col],2!==b.drawState&&(b.drawState=2,h&&(b.lineImage=x.length?x.shift():q.image("",p.line),b.lineImage.attr({x:b.xPixel+l,y:b.yPixel,width:f,height:t}),b.lineCanvas=u.length?d=y.shift():d=X.document.createElement("canvas"),d.setAttribute("width",f),d.setAttribute("height",t),e=b.lineCtx=d.getContext("2d"),e.fillStyle=z.fillStyle,e.strokeStyle=z.lineStrokeStyle,
e.lineWidth=z.lineWidth),b.image=v.length?v.shift():q.image("",p.plot),b.image.attr({x:b.xPixel+l,y:b.yPixel,width:f,height:t}),b.canvas=u.length?a=u.shift():a=X.document.createElement("canvas"),a.setAttribute("width",f),a.setAttribute("height",t),e=b.ctx=a.getContext("2d"),1>n?(e.strokeStyle=z.fillStyle,e.lineWidth=.5):(e.fillStyle=z.fillStyle,e.strokeStyle=z.strokeStyle,e.lineWidth=z.borderWidth),m.push(b));g._batchDrawindex=this.JSONData.data&&this.JSONData.data.length-1||0;this._drawGridArrBatch(m,
c,!g.animation.enabled)}else c&&c()},_drawGridArrBatch:function(c,b,a){var d,e,f,m,n,g,h,r,p,q,t,v,w,u,x,y,B=this;g=B.config;var A=B.chart.components;y=B.config;var E=y.drawLine;r=y.plotCosmetics;m=y._batchDrawindex;f=B.components.data;n=m-y.chunkSize;var D=A.yAxis[0],C=y.zoomedRadius,A=A.xAxis[0].getPVR(),D=D.getPVR(),G=g.showRegressionLine,I=y._store||[],J=r.lineWidth||1>C;G&&(u=g.regLineColor,x=g.regressionLineThickness);for(r=0;r<c.length;r+=1)c[r].ctx.beginPath(),E&&c[r].lineCtx.beginPath();
for(n=0>=n?0:n;m>=n;--m)if((t=f[m]&&f[m].config.setValue)&&!isNaN(t.x)&&!isNaN(t.y))for(r=0;r<c.length;r+=1)(d=c[r],v=d.xMinValue,w=d.yMaxValue,t.x<d.xMinWPad||t.x>d.xMaxWPad||t.y<d.yMinWPad||t.y>d.yMaxWPad||(p=d.ctx,q=d.lineCtx,d=z((t.x-v)*A),e=z((w-t.y)*D),(h=I[d])||(h=I[d]={}),h[e]))||(h[e]=!0,E&&(h=0<=m-1&&f[m-1].config.setValue)&&(q.moveTo(z((h.x-v)*A),z((w-h.y)*D)),q.lineTo(d,e)),1>C?(p.moveTo(d,e),p.lineTo(d+1,e)):(p.moveTo(d+C,e),p.arc(d,e,C,0,fa)));for(r=0;r<c.length;r+=1)d=c[r],p=d.ctx,
p.fill(),J&&p.stroke(),p.closePath(),E&&(q=d.lineCtx,q.fill(),J&&q.stroke(),q.closePath());y._batchDrawindex=m;if(0<=m){if(!a)for(r=0;r<c.length;r+=1)p=c[r].image,f=c[r].canvas,p.attr({src:f.toDataURL("image/png")}),y.drawLine&&(u=c[r].lineImage,x=c[r].lineCanvas,u.attr({src:x.toDataURL("image/png")}));(y._batchDarwTimers||(y._batchDarwTimers=[])).push(setTimeout(function(){B.chart&&B._drawGridArrBatch(c,b,a)},0))}else{delete y._store;if(G)for(y=g.regressionData,r=0;r<c.length;r+=1)d=c[r],m=d.xMinValue,
g=d.yMaxValue,p=d.image,f=d.canvas,p=d.ctx,f=(y[0].x-m)*A,n=(g-y[0].y)*D,m=(y[1].x-m)*A,g=(g-y[1].y)*D,p.beginPath(),p.strokeStyle=u,p.lineWidth=x,p.moveTo(f,n),p.lineTo(m,g),p.stroke(),p.closePath();for(r=0;r<c.length;r+=1)d=c[r],p=d.image,f=d.canvas,d.drawState=1,p.attr({src:f.toDataURL("image/png")}),E&&(u=d.lineImage,x=d.lineCanvas,u.attr({src:x.toDataURL("image/png")}));B.tree||setTimeout(function(){B._buildKdTree()},250);b&&b()}},_buildKdTree:function(){var c=this.config;c._kdPoints=(this.JSONData.data||
[]).slice();this.components.kDTree||(this.components.kDTree=new Z);this.components.kDTree.buildKdTree(c._kdPoints);delete c._kdPoints},getElement:function(c){if(this.components.kDTree)return this.components.kDTree.getNeighbour(c)},show:function(){var c=this.graphics,c=c&&c.container;this.visible=!0;this._conatinerHidden=!1;c.line.show();c.plot.show()},hide:function(){var c=this.graphics,c=c&&c.container;this.visible=!1;this._conatinerHidden=!0;c.line.hide();c.plot.hide()},_addLegend:function(){var c=
this.chart,b=c.jsonData.chart,a=this.config,d=this.JSONData,e=c.getFillColor,l=y(d.anchorbordercolor,b.anchorbordercolor),m=t(y(l,a.plotBorderColor)),l=Q(d.anchorborderthickness,b.anchorborderthickness,l?1:0),n=t(y(d.anchorbgcolor,d.color,b.anchorbgcolor,a.plotColor)),g=y(d.anchoralpha,d.alpha,b.anchoralpha,p),b=y(d.anchorbgalpha,d.alpha,b.anchorbgalpha,p),d={color:a.lineColor,alpha:a.lineAlpha},e=a.plotCosmetics={fillStyle:e(n,g*b/100),strokeStyle:e(m,g),borderWidth:l,lineWidth:a.lineThickness,lineStrokeStyle:x(d)};
this.legendItemId=c.components.legend.addItems(this,this.legendInteractivity,{enabled:a.includeInLegend,type:this.type,fillColor:e.fillStyle,strokeColor:e.strokeStyle,anchorSide:2,strokeWidth:a.anchorBorderThickness,label:f(this.JSONData.seriesname)})},_setConfigure:function(){var c,b,a,d,f,l,m,n,g,h=-Infinity,p=Infinity,q=Infinity,t=-Infinity,u=this.components.data||(this.components.data=[]);c=this.chart;var v=e.parseUnsafeString,w=this.config,x=this.JSONData,z=c.jsonData.chart,A=x.data||[],D=A.length,
C=c.components.numberFormatter,G=v(z.yaxisname),I=v(z.xaxisname),J=w.lineDashed,M=w.lineDashStyle,L=w.parentYAxis,N=w.toolTipSepChar,O=w.seriesname;for(c=0;c<D;c+=1)d=A[c],a=u[c]||(u[c]={}),b=a.config||(a.config={}),b.setValue=f={x:C.getCleanValue(d.x),y:C.getCleanValue(d.y),index:c},t=E(t,f.x),q=B(q,f.x),h=E(h,f.y),p=B(p,f.y),w.showRegressionLine&&this.pointValueWatcher(f.x,f.y,w.regressionObj),b.setLink=y(d.link),b.anchorProps=this._parseAnchorProperties(c),b.showValue=Q(d.showvalue,w.showValues),
b.dashed=Q(d.dashed,J),b.color=y(d.color,w.lineColor),b.alpha=y(d.alpha,w.lineAlpha),b.dashStyle=b.dashed?M:"none",b.toolTipValue=l=C.dataLabels(f.y,L),b.setDisplayValue=g=v(d.displayvalue),n=b.formatedVal=y(d.toolTipValue,C.dataLabels(f.y,L)),m=C.xAxis(f.x),b.displayValue=y(g,l),b.setTooltext=e.getValidValue(v(y(d.tooltext,w.plotToolText))),w.showTooltip?void 0!==b.setTooltext?(f=[4,5,6,7,8,9,10,11],m={yaxisName:G,xaxisName:I,yDataValue:n,xDataValue:m},d=da(b.setTooltext,f,m,d,z,x)):null===n?d=!1:
(d=O?O+N:U,d+=f.x?m+N:U,d+=l):d=!1,b.toolText=d,a?a.graphics||(u[c].graphics={}):a=u[c]={graphics:{}},b.hoverEffects=this._parseHoverEffectOptions(a),b.anchorProps.isAnchorHoverRadius=b.hoverEffects.anchorRadius;w.xMax=t;w.xMin=q;w.yMin=p;w.yMax=h;w.showRegressionLine&&(w.regressionData=this.getRegressionLineSeries(w.regressionObj,w.showYOnX,D));this.ErrorValueConfigure&&this.ErrorValueConfigure()}},"Scatter"]);T.addSymbol({zoomInIcon:function(c,b,a){c-=.2*a;b-=.2*a;var d=.8*a,e=T.rad(43),f=T.rad(48),
m=c+d*L(e),e=b+d*J(e),n=c+d*L(f),f=b+d*J(f),g=T.rad(45),h=m+a*L(g),p=e+a*J(g),q=n+a*L(g)-1;a=f+a*J(g)-1;return["M",m,e,"A",d,d,0,1,0,n,f,"Z","M",m+1,e+1,"L",h,p,q,a,n+1,f+1,"Z","M",c-2,b,"L",c+2,b,"Z","M",c,b-2,"L",c,b+2,"Z"]},zoomModeIcon:function(c,b,a){var d=[];c-=.2*a;b-=.2*a;var e=.8*a,f=T.rad(43),m=T.rad(48),n=c+e*L(f),f=b+e*J(f),g=c+e*L(m),m=b+e*J(m),h=T.rad(45),p=n+a*L(h),q=f+a*J(h),t=g+a*L(h)-1;a=m+a*J(h)-1;return d=d.concat(["M",n,f,"A",e,e,0,1,0,g,m,"Z","M",n+1,f+1,"L",p,q,t,a,t+1,a-1,
t+1.5,a+1.5,t-1,a+1,t,a,g+1,m+1,"Z","M",c-2,b,"L",c+2,b,"Z","M",c,b-2,"L",c,b+2,"Z"])},panModeIcon:function(c,b,a){var d=c-11.25,d=c;a*=2.5;return[].concat(["M",d-a/16,b-a/8,"L",d+a/16,b-a/8,"L",d+a/16,b-a/3.2,"L",d+6*a/32,b-10*a/32,"L",d,b-a/2,"L",d-6*a/32,b-10*a/32,"L",d-a/16,b-a/3.2,"Z","M",d+4*a/32,b-2*a/32,"L",d+10*a/32,b-2*a/32,"L",d+10*a/32,b-6*a/32,"L",d+16*a/32,b,"L",d+10*a/32,b+6*a/32,"L",d+10*a/32,b+2*a/32,"L",d+4*a/32,b+2*a/32,"Z","M",d+2*a/32,b+5*a/32,"L",d+2*a/32,b+10*a/32,"L",d+6*a/
32,b+10*a/32,"L",d,b+16*a/32,"L",d-6*a/32,b+10*a/32,"L",d-2*a/32,b+10*a/32,"L",d-2*a/32,b+5*a/32,"Z","M",d-4*a/32,b-2*a/32,"L",d-10*a/32,b-2*a/32,"L",d-10*a/32,b-6*a/32,"L",d-16*a/32,b,"L",d-10*a/32,b+6*a/32,"L",d-10*a/32,b+2*a/32,"L",d-4*a/32,b+2*a/32,"Z"])}})}])});

//# sourceMappingURL=http://localhost:3052/3.12.2/map/licensed/fusioncharts.zoomscatter.js.map
