g&&!p)p=!0;else if(b>g&&p)continue;u.dataPoints[z].label&&(a.axisX.labels[b]=u.dataPoints[z].label); bc.viewPortMax&&(c.viewPortMax=b);null===e?c.viewPortMin===b&&nd.viewPortMax&&"number"===typeof e&&(d.viewPortMax=e))}}u.axisX.valueType=u.xValueType=f?"dateTime":"number"}};m.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,f=!1,l=[],u=[],z=Infinity,h=-Infinity,p=0;p c.max&&(c.max=b);if(0 m&&(m=1/m);c.minDiff>m&&1!==m&&(c.minDiff=m)}else m=b-n.dataPoints[q-1].x,0>m&&(m*=-1),c.minDiff>m&&0!==m&&(c.minDiff=m);null!==e&&null!==n.dataPoints[q-1].y&&(a.axisY.logarithmic?0m&&(m=1/m),d.minDiff>m&&1!==m&&(d.minDiff=m)):(m=e-n.dataPoints[q-1].y,0>m&&(m*=-1),d.minDiff>m&&0!==m&&(d.minDiff=m)))}if(b t&&!B)B=!0;else if(b>t&&B)continue;n.dataPoints[q].label&&(a.axisX.labels[b]= n.dataPoints[q].label);b c.viewPortMax&&(c.viewPortMax=b);null===n.dataPoints[q].y?c.viewPortMin===b&&kd.max&&(d.max=a),q c.viewPortMax||(a d.viewPortMax&&(d.viewPortMax=a)));for(q in u)u.hasOwnProperty(q)&&!isNaN(q)&&(a=u[q],a d.max&&(d.max=Math.max(a,h)),q c.viewPortMax||(a d.viewPortMax&&(d.viewPortMax=Math.max(a,h))))}};m.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,f=!1,l=!1,u=!1,z=[],h=0;h c.max&&(c.max=b);if(0 t&&(t=1/t);c.minDiff>t&&1!==t&&(c.minDiff=t)}else t=b-p.dataPoints[n-1].x,0>t&&(t*=-1),c.minDiff>t&&0!==t&&(c.minDiff=t);r(e)||null===p.dataPoints[n-1].y|| (a.axisY.logarithmic?0 t&&(t=1/t),d.minDiff>t&&1!==t&&(d.minDiff=t)):(t=e-p.dataPoints[n-1].y,0>t&&(t*=-1),d.minDiff>t&&0!==t&&(d.minDiff=t)))}if(b m&&!g)g=!0;else if(b>m&&g)continue;p.dataPoints[n].label&&(a.axisX.labels[b]=p.dataPoints[n].label);b c.viewPortMax&&(c.viewPortMax=b);null===e?c.viewPortMin===b&&Be&&(u=!0),z[b]=z[b]?z[b]+Math.abs(e):Math.abs(e))}}p.axisX.valueType=p.xValueType=f?"dateTime":"number"}a.axisY.logarithmic?(d.max=r(d.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(d.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),d.min=r(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):l&&!u?(d.max=r(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=r(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):l&&u?(d.max=r(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=r(d.viewPortMin)? -99:Math.min(d.viewPortMin,-99)):!l&&u&&(d.max=r(d.viewPortMax)?-1:Math.max(d.viewPortMax,-1),d.min=r(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99));d.viewPortMin=d.min;d.viewPortMax=d.max;a.dataPointYSums=z}};m.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,f,l,u=!1,z=0;z c.max&&(c.max=b);f d.max&&(d.max=l);0 B&&(B=1/B),c.minDiff>B&&1!==B&&(c.minDiff=B)):(B=b-h.dataPoints[p-1].x,0>B&&(B*=-1),c.minDiff>B&&0!==B&&(c.minDiff=B)),e&&(null!==e[0]&&h.dataPoints[p-1].y&&null!==h.dataPoints[p-1].y[0])&&(a.axisY.logarithmic?(B=e[0]/h.dataPoints[p-1].y[0],1>B&&(B=1/B),d.minDiff>B&&1!==B&&(d.minDiff=B)):(B=e[0]-h.dataPoints[p-1].y[0],0>B&&(B*=-1),d.minDiff>B&&0!==B&&(d.minDiff=B)))); if(!(b
t&&!q)q=!0;else if(b>t&&q)continue;h.dataPoints[p].label&&(a.axisX.labels[b]=h.dataPoints[p].label);b c.viewPortMax&&(c.viewPortMax=b);if(c.viewPortMin===b&&e)for(x=0;x d.viewPortMax&&(d.viewPortMax=l))}}h.axisX.valueType=h.xValueType=u?"dateTime":"number"}};m.prototype._processSpecificPlotUnit= function(a){if("waterfall"===a.type&&a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,f=!1,l=0;l c.max&&(c.max=b),u.dataPointEOs[z].cumulativeSum< d.min&&(d.min=u.dataPointEOs[z].cumulativeSum),u.dataPointEOs[z].cumulativeSum>d.max&&(d.max=u.dataPointEOs[z].cumulativeSum),0 n&&(n=1/n),c.minDiff>n&&1!==n&&(c.minDiff=n)):(n=b-u.dataPoints[z-1].x,0>n&&(n*=-1),c.minDiff>n&&0!==n&&(c.minDiff=n)),null!==e&&null!==u.dataPoints[z-1].y&&(a.axisY.logarithmic?(e=u.dataPointEOs[z].cumulativeSum/u.dataPointEOs[z-1].cumulativeSum,1>e&&(e=1/e),d.minDiff>e&&1!==e&&(d.minDiff=e)):(e=u.dataPointEOs[z].cumulativeSum- u.dataPointEOs[z-1].cumulativeSum,0>e&&(e*=-1),d.minDiff>e&&0!==e&&(d.minDiff=e)))),!(b g&&!p)p=!0;else if(b>g&&p)continue;u.dataPoints[z].label&&(a.axisX.labels[b]=u.dataPoints[z].label);bc.viewPortMax&&(c.viewPortMax=b);0 d.viewPortMax&&(d.viewPortMax=u.dataPointEOs[z-1].cumulativeSum)); u.dataPointEOs[z].cumulativeSum d.viewPortMax&&(d.viewPortMax=u.dataPointEOs[z].cumulativeSum)}u.axisX.valueType=u.xValueType=f?"dateTime":"number"}};m.prototype.calculateAutoBreaks=function(){function a(a,b,c,e){if(e)return c=Math.pow(Math.min(c*a/b,b/a),0.2),1>=c&&(c=Math.pow(1>a?1/a:Math.min(b/a,a),0.25)),{startValue:a*c,endValue:b/c};c=0.2*Math.min(c-b+a,b-a);0>=c&&(c=0.25*Math.min(b-a,Math.abs(a))); return{startValue:a+c,endValue:b-c}}function d(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){var b=a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks,c=a.axisY.scaleBreaks&&a.axisY.scaleBreaks.autoCalculate&&1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks;if(b||c)for(var d=a.axisY.dataInfo,f=a.axisX.dataInfo,g,h=f.min,l=f.max,p=d.min,q=d.max,f=f._dataRanges,d=d._dataRanges,n,u=0,z=0;z k.dataPoints.length))for(u=0;u f[n].max&&(f[n].max=g)),c){var m=(q+1-p)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((g="waterfall"===a.type?k.dataPointEOs[u].cumulativeSum:k.dataPoints[u].y)&&g.length)for(var s=0;s d[n].max&&(d[n].max=g[s]);else r(g)||(n=Math.floor((g-p)/m),g d[n].max&&(d[n].max=g))}}}}function c(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)&&a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks)for(var b=a.axisX.dataInfo,c=b.min,d=b.max,f=b._dataRanges,g,h=0,l=0;l p.dataPoints.length))for(h= 0;h f[g].max&&(f[g].max=b)}}for(var b,e=this,f=!1,l=0;l p[g].max&&(p[g].max=n)}delete this._axes[l].dataInfo.dataPointYPositiveSums}if(this._axes[l].dataInfo.dataPointYNegativeSums){q=this._axes[l].dataInfo.dataPointYNegativeSums;p=h;for(u in q)q.hasOwnProperty(u)&&!isNaN(u)&&(n=-1*q[u],r(n)||(g=Math.floor((n-z)/b),n p[g].max&&(p[g].max=n)));delete this._axes[l].dataInfo.dataPointYNegativeSums}for(u=0;u
b&&f.push({diff:n,start:p,end:z});break}else u++;if(this._axes[l].scaleBreaks.customBreaks)for(u=0;u =e.x1&&(a<=e.x2&&d>=e.y1&&d<=e.y2)&&(b=e.id)}return b};m.prototype.getAutoFontSize=lb;m.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};m.prototype.clearCanvas=kb;m.prototype.attachEvent=function(a){this._events.push(a)};m.prototype._touchEventHandler=function(a){if(a.changedTouches&& this.interactivityEnabled){var d=[],c=a.changedTouches,b=c?c[0]:a,e=null;switch(a.type){case "touchstart":case "MSPointerDown":d=["mousemove","mousedown"];this._lastTouchData=Na(b);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":d=["mousemove"];break;case "touchend":case "MSPointerUp":var f=this._lastTouchData&&this._lastTouchData.time?new Date-this._lastTouchData.time:0,d="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType||300>f?["mouseup", "click"]:["mouseup"];break;default:return}if(!(c&&1 f)this._lastTouchData.scroll=!0}catch(u){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(c=0;c =e.x1&&d.x<=e.x2&&d.y>=e.y1&&d.y<=e.y2){b[c].call(b.context,d.x,d.y);"mousedown"===c&&!0===b.capture?(m.capturedEventParam=b,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===c&&(b.chart.overlaidCanvas.releaseCapture?b.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",this._mouseEventHandler,!1));break}else b=null;a.target.style.cursor= b&&b.cursor?b.cursor:this._defaultCursor}c=this.plotArea;if(d.x c.x2||d.y c.y2)if(this.toolTip&&this.toolTip.enabled){this.toolTip.hide();this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip);for(f=0;f c.maximum&&(f=c.viewportMaximum/c.maximum,c.sessionVariables.newViewportMinimum= c.viewportMinimum/f,c.sessionVariables.newViewportMaximum=c.viewportMaximum/f,l=!0):c.viewportMinimum c.maximum&&(f=c.viewportMaximum-c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum-f,c.sessionVariables.newViewportMaximum=c.viewportMaximum-f,l=!0);else if((!e||2 Math.abs(c)&&(this.panEnabled||this.zoomEnabled)?(this.toolTip.hide(),this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip)):this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,d);if((!e||2 g)var B=g,g=q,q=B;if(n.scaleBreaks)for(B=0;!f&&B =g;if(isFinite(n.dataInfo.minDiff))if(B=n.getApparentDifference(q,g,null,!0),!(f||!(this.panEnabled&&n.scaleBreaks&&n.scaleBreaks._appliedBreaks.length)&&(n.logarithmic&&B n.maximum))z.push(n),p.push({val1:q,val2:g}),u=!0;else if(!e){u=!1;break}}return{isValid:u,axesWithValidRange:z,axesRanges:p}};m.prototype.preparePlotArea=function(){var a=this.plotArea;!s&&(0 c.lineCoordinates.x2?d.x2:c.lineCoordinates.x2;a.y2=d.y2>d.y1?d.y2:c.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0 c.lineCoordinates.x2?d.x2:c.lineCoordinates.x2,a.y2=d.y2>d.y1?d.y2:c.lineCoordinates.y2, a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else d=this.layoutManager.getFreeSpace(),a.x1=d.x1,a.x2=d.x2,a.y1=d.y1,a.y2=d.y2,a.width=d.width,a.height=d.height;s||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0 c.x2||h.point.y c.y2+1)continue}else if("rangearea"===p||"rangesplinearea"===p){if(h.dataPoint.x C.viewportMaximum||Math.max.apply(null,h.dataPoint.y) y.viewportMaximum)continue}else if(0<=p.indexOf("line")||0<=p.indexOf("area")||0<=p.indexOf("bubble")||0<=p.indexOf("scatter")){if(h.dataPoint.x C.viewportMaximum|| h.dataPoint.y y.viewportMaximum)continue}else if(0<=p.indexOf("column")||"waterfall"===p||"error"===p&&!h.axisSwapped){if(h.dataPoint.x C.viewportMaximum||h.bounds.y1>c.y2||h.bounds.y2 C.viewportMaximum||h.bounds.x1>c.x2||h.bounds.x2 C.viewportMaximum||Math.max.apply(null,h.dataPoint.y) y.viewportMaximum)continue}else if(h.dataPoint.x C.viewportMaximum)continue;e=l=2;"horizontal"===x?(u=g.width,z=g.height):(z=g.width,u=g.height);if("normal"===this.plotInfo.axisPlacement){if(0<=p.indexOf("line")||0<=p.indexOf("area"))t="auto",l=4;else if(0<=p.indexOf("stacked"))"auto"===t&&(t="inside");else if("bubble"===p||"scatter"===p)t="inside";n=h.point.x- u/2;"inside"!==t?(e=c.y1,f=c.y2,0 h.point.y)):(q=h.point.y+l+b,q>f-z-l-b&&(q="auto"===t?Math.min(h.point.y,f)-z-l-b:f-z-l-b,v=q f-z-l&&("bubble"===p||"scatter"===p)&&(q=Math.min(h.point.y+l,c.y2-z-l))),q=Math.min(q,f-z))}else 0<=p.indexOf("line")||0<=p.indexOf("area")||0<=p.indexOf("scatter")?(t="auto",e=4):0<=p.indexOf("stacked")?"auto"===t&&(t="inside"):"bubble"===p&&(t="inside"),q=h.point.y-z/2,"inside"!==t?(l=c.x1,f=c.x2,0>J?(n=h.point.x-u-e-b,n h.point.x)):(n=h.point.x+e+b,n>f-u-e-b&&(n="auto"=== t?Math.min(h.point.x,f)-u-e-b:f-u-e-b,v=n J?Math.max(h.bounds.x1,c.x1)+u/2+e:Math.min(h.bounds.x2,c.x2)-u/2-e:(Math.max(h.bounds.x1,c.x1)+Math.min(h.bounds.x2,c.x2))/2,n=0>J?Math.max(h.point.x,b)-u/2:Math.min(h.point.x,b)-u/2,n=Math.max(n,l));"vertical"===x&&(q+=z);g.x=n;g.y=q;g.render(!0);m&&("inside"!==t&&(0>p.indexOf("bar")&&("error"!==p||!h.axisSwapped)&&h.point.x>c.x1&&h.point.x p.indexOf("column")&&("error"!==p||h.axisSwapped)&&h.point.y>c.y1&&h.point.y =a.dataSeriesIndexes.length)){var b= this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var f=[],l,u=0;u a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!J)))if("number"!==typeof p[t].y)0 p[t].y===a.axisY.reversed?1:-1,color:B})}c.stroke();s&&b.stroke()}}Y.drawMarkers(f);s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&& c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx|| this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var f=[],l,u=0;u a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!J)))if("number"!==typeof p[t].y)0 p[t].y===a.axisY.reversed?1:-1,color:B})}c.stroke();s&&b.stroke()}}Y.drawMarkers(f);s&& (d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation, easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderSpline=function(a){function d(a){a=v(a,2);if(0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx;b.save();var f=this.plotArea;b.beginPath(); b.rect(f.x1,f.y1,f.width,f.height);b.clip();for(var l=[],u=0;u a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!x)))if("number"!==typeof p[m].y)0 p[m].y===a.axisY.reversed?1:-1,color:B});x=!1}d(r)}Y.drawMarkers(l);s&&(c.drawImage(this._preRenderCanvas,0,0,this.width, this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(f.x1,f.y1,f.width,f.height),e.beginPath());b.restore();b.beginPath();return{source:c,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear, animationBase:0}}};m.prototype.renderColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=0,l,u,z,h=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,p=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width, 0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>p&&(f=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p p&&(n=p);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(p=0;p a.axisX.dataInfo.viewPortMax)&&"number"===typeof B[f].y){l=a.axisX.convertValueToPixel(z);u=a.axisY.convertValueToPixel(B[f].y);l=a.axisX.reversed?l+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+p)*n<<0:l-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+p)*n<<0;var m=a.axisX.reversed?l-n<<0:l+n<<0,t;0<=B[f].y?t=h:(t=u,u=h);u>t&&(b=u,u=t,t=b);b=B[f].color?B[f].color:g._colorSet[f%g._colorSet.length];da(c,l,u,m,t,b,0,null,k&&0<=B[f].y, 0>B[f].y&&k,!1,!1,g.fillOpacity);b=g.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:f,x1:l,y1:u,x2:m,y2:t};b=S(b);s&&da(this._eventManager.ghostCtx,l,u,m,t,b,0,null,!1,!1,!1,!1);(B[f].indexLabel||g.indexLabel||B[f].indexLabelFormatter||g.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:B[f],dataSeries:g,point:{x:l+(m-l)/2,y:0>B[f].y===a.axisY.reversed?u:t},direction:0>B[f].y===a.axisY.reversed?1:-1,bounds:{x1:l, y1:Math.min(u,t),x2:m,y2:Math.max(u,t)},color:b})}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore(); return{source:d,dest:this.plotArea.ctx,animationCallback:L.yScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:h a.axisY.bounds.y2?a.axisY.bounds.y2:h}}};m.prototype.renderStackedColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],l=[],u=[],z=[],h=0,p,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth? this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;p=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var g=a.axisX.dataInfo.minDiff;isFinite(g)||(g=0.3*Math.abs(a.axisX.range));g=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(g)/Math.log(a.axisX.range):Math.abs(g)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.options.dataPointWidth? this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p p&&(g=p);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var B=0;B a.axisX.dataInfo.viewPortMax)&&"number"===typeof t[h].y){p=a.axisX.convertValueToPixel(b);var A=p-a.plotType.plotUnits.length*g/2+a.index*g<<0,J=A+g<<0,C;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =t[h].y)z[b]=t[h].y+(z[b]?z[b]:0),C=a.axisY.convertValueToPixel(z[b]),n="undefined"!==typeof l[b]?l[b]:q,l[b]=C;else if(n=a.axisY.convertValueToPixel(t[h].y),0<=t[h].y){var y="undefined"!==typeof f[b]?f[b]:0;n-=y;C=q-y;f[b]=y+(C-n)}else y=l[b]?l[b]:0,C=n+y,n=q+y,l[b]=y+(C-n);b=t[h].color?t[h].color:m._colorSet[h%m._colorSet.length];da(c,A,n,J,C,b,0,null,r&&0<=t[h].y,0>t[h].y&&r,!1, !1,m.fillOpacity);b=m.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:h,x1:A,y1:n,x2:J,y2:C};b=S(b);s&&da(this._eventManager.ghostCtx,A,n,J,C,b,0,null,!1,!1,!1,!1);(t[h].indexLabel||m.indexLabel||t[h].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:t[h],dataSeries:m,point:{x:p,y:0<=t[h].y?n:C},direction:0>t[h].y===a.axisY.reversed?1:-1,bounds:{x1:A,y1:Math.min(n,C),x2:J,y2:Math.max(n, C)},color:b})}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx, animationCallback:L.yScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:q a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};m.prototype.renderStackedColumn100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],l=[],u=[],z=[],h=0,p,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth: this.options.dataPointWidth?this.dataPointWidth:1;p=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var g=a.axisX.dataInfo.minDiff;isFinite(g)||(g=0.3*Math.abs(a.axisX.range));g=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(g)/Math.log(a.axisX.range):Math.abs(g)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.options.dataPointWidth? this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p p&&(g=p);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var B=0;B a.axisX.dataInfo.viewPortMax)&&"number"===typeof t[h].y){p=a.axisX.convertValueToPixel(b);n=0!==a.dataPointYSums[b]?100*(t[h].y/a.dataPointYSums[b]):0;var A=p-a.plotType.plotUnits.length*g/2+a.index*g<<0,J=A+g<<0,C;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =u[b])continue;n=a.axisY.convertValueToPixel(u[b]);C=f[b]?f[b]:q;f[b]=n}else if(a.axisY.scaleBreaks&&0 =t[h].y)z[b]=n+("undefined"!==typeof z[b]?z[b]:0),C=a.axisY.convertValueToPixel(z[b]),n=l[b]?l[b]:q,l[b]=C;else if(n=a.axisY.convertValueToPixel(n),0<=t[h].y){var y="undefined"!==typeof f[b]?f[b]:0;n-=y;C=q-y;a.dataSeriesIndexes.length-1===B&&1>=Math.abs(e.y1-n)&&(n=e.y1);f[b]=y+(C-n)}else y="undefined"!==typeof l[b]? l[b]:0,C=n+y,n=q+y,a.dataSeriesIndexes.length-1===B&&1>=Math.abs(e.y2-C)&&(C=e.y2),l[b]=y+(C-n);b=t[h].color?t[h].color:m._colorSet[h%m._colorSet.length];da(c,A,n,J,C,b,0,null,r&&0<=t[h].y,0>t[h].y&&r,!1,!1,m.fillOpacity);b=m.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:h,x1:A,y1:n,x2:J,y2:C};b=S(b);s&&da(this._eventManager.ghostCtx,A,n,J,C,b,0,null,!1,!1,!1,!1);(t[h].indexLabel||m.indexLabel||t[h].indexLabelFormatter||m.indexLabelFormatter)&& this._indexLabels.push({chartType:"stackedColumn100",dataPoint:t[h],dataSeries:m,point:{x:p,y:0<=t[h].y?n:C},direction:0>t[h].y===a.axisY.reversed?1:-1,bounds:{x1:A,y1:Math.min(n,C),x2:J,y2:Math.max(n,C)},color:b})}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&& this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.yScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:q a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};m.prototype.renderBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b= null,e=this.plotArea,f=0,l,u,z,h=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,p=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.options.dataPointWidth? this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>p&&(f=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p p&&(n=p);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height); c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(p=0;p a.axisX.dataInfo.viewPortMax)&&"number"===typeof B[f].y){u=a.axisX.convertValueToPixel(z); l=a.axisY.convertValueToPixel(B[f].y);u=a.axisX.reversed?u+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+p)*n<<0:u-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+p)*n<<0;var m=a.axisX.reversed?u-n<<0:u+n<<0,t;0<=B[f].y?t=h:(t=l,l=h);b=B[f].color?B[f].color:g._colorSet[f%g._colorSet.length];da(c,t,u,l,m,b,0,null,k,!1,!1,!1,g.fillOpacity);b=g.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:f,x1:t,y1:u,x2:l,y2:m};b= S(b);s&&da(this._eventManager.ghostCtx,t,u,l,m,b,0,null,!1,!1,!1,!1);(B[f].indexLabel||g.indexLabel||B[f].indexLabelFormatter||g.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:B[f],dataSeries:g,point:{x:0<=B[f].y?l:t,y:u+(m-u)/2},direction:0>B[f].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(t,l),y1:u,x2:Math.max(t,l),y2:m},color:b})}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas, 0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.xScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:h a.axisY.bounds.x2?a.axisY.bounds.x2: h}}};m.prototype.renderStackedBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],l=[],u=[],z=[],h=0,p,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;n=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.height<< 0;var g=a.axisX.dataInfo.minDiff;isFinite(g)||(g=0.3*Math.abs(a.axisX.range));g=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(g)/Math.log(a.axisX.range):Math.abs(g)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>n&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n n&&(g=n);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var B=0;B a.axisX.dataInfo.viewPortMax)&&"number"===typeof t[h].y){n=a.axisX.convertValueToPixel(b);var A=n-a.plotType.plotUnits.length*g/2+a.index*g<<0,J=A+g<<0,C;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =t[h].y)z[b]=t[h].y+(z[b]?z[b]:0),p=l[b]? l[b]:q,l[b]=C=a.axisY.convertValueToPixel(z[b]);else if(p=a.axisY.convertValueToPixel(t[h].y),0<=t[h].y){var y=f[b]?f[b]:0;C=q+y;p+=y;f[b]=y+(p-C)}else y=l[b]?l[b]:0,C=p-y,p=q-y,l[b]=y+(p-C);b=t[h].color?t[h].color:m._colorSet[h%m._colorSet.length];da(c,C,A,p,J,b,0,null,r,!1,!1,!1,m.fillOpacity);b=m.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:h,x1:C,y1:A,x2:p,y2:J};b=S(b);s&&da(this._eventManager.ghostCtx,C,A,p,J,b,0,null,!1,!1,!1, !1);(t[h].indexLabel||m.indexLabel||t[h].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:t[h],dataSeries:m,point:{x:0<=t[h].y?p:C,y:n},direction:0>t[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(C,p),y1:A,x2:Math.max(C,p),y2:J},color:b})}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&& c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.xScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:q a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};m.prototype.renderStackedBar100=function(a){var d= a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],l=[],u=[],z=[],h=0,p,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;n=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var g=a.axisX.dataInfo.minDiff;isFinite(g)|| (g=0.3*Math.abs(a.axisX.range));g=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(g)/Math.log(a.axisX.range):Math.abs(g)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>n&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n n&&(g=n);c.save();s&&this._eventManager.ghostCtx.save(); c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var B=0;B a.axisX.dataInfo.viewPortMax)&& "number"===typeof t[h].y){n=a.axisX.convertValueToPixel(b);var A;A=0!==a.dataPointYSums[b]?100*(t[h].y/a.dataPointYSums[b]):0;var J=n-a.plotType.plotUnits.length*g/2+a.index*g<<0,C=J+g<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =u[b])continue;A=f[b]?f[b]:q;f[b]=p=a.axisY.convertValueToPixel(u[b])}else if(a.axisY.scaleBreaks&&0 =t[h].y)z[b]=A+(z[b]?z[b]:0),p=l[b]?l[b]: q,l[b]=A=a.axisY.convertValueToPixel(z[b]);else if(p=a.axisY.convertValueToPixel(A),0<=t[h].y){var y=f[b]?f[b]:0;A=q+y;p+=y;a.dataSeriesIndexes.length-1===B&&1>=Math.abs(e.x2-p)&&(p=e.x2);f[b]=y+(p-A)}else y=l[b]?l[b]:0,A=p-y,p=q-y,a.dataSeriesIndexes.length-1===B&&1>=Math.abs(e.x1-A)&&(A=e.x1),l[b]=y+(p-A);b=t[h].color?t[h].color:m._colorSet[h%m._colorSet.length];da(c,A,J,p,C,b,0,null,r,!1,!1,!1,m.fillOpacity);b=m.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:k, dataPointIndex:h,x1:A,y1:J,x2:p,y2:C};b=S(b);s&&da(this._eventManager.ghostCtx,A,J,p,C,b,0,null,!1,!1,!1,!1);(t[h].indexLabel||m.indexLabel||t[h].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:t[h],dataSeries:m,point:{x:0<=t[h].y?p:A,y:n},direction:0>t[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(A,p),y1:J,x2:Math.max(A,p),y2:C},color:b})}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop", a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.xScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:q a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};m.prototype.renderArea=function(a){var d,c;function b(){C&&(0 =a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?J=A:0>a.axisY.viewportMaximum?J=u.y1:0 =a.dataSeriesIndexes.length)){var l=this._eventManager.ghostCtx,u=a.axisY.lineCoordinates,z=[],h=this.plotArea,p;f.save();s&&l.save();f.beginPath();f.rect(h.x1,h.y1,h.width,h.height);f.clip();s&&(l.beginPath(),l.rect(h.x1,h.y1,h.width,h.height),l.clip());for(var n=0;n a.axisX.dataInfo.viewPortMax&&(!g.connectNullData||!ha)))if("number"!==typeof B[k].y)g.connectNullData||(ha||d)||b(),ha=!0;else{m=a.axisX.convertValueToPixel(r);t=a.axisY.convertValueToPixel(B[k].y);d||ha?(!d&&g.connectNullData?(f.setLineDash&&(g.options.nullDataLineDashType||c===g.lineDashType&&g.lineDashType!==g.nullDataLineDashType)&&(d=m,c=t,m=p.x,t=p.y,b(),f.moveTo(p.x,p.y),m=d,t=c,C=p,c=g.nullDataLineDashType,f.setLineDash(K)),f.lineTo(m,t),s&&l.lineTo(m,t)):(f.beginPath(),f.moveTo(m,t),s&& (l.beginPath(),l.moveTo(m,t)),C={x:m,y:t}),ha=d=!1):(f.lineTo(m,t),s&&l.lineTo(m,t),0==k%250&&b());p={x:m,y:t};k B[k].y===a.axisY.reversed?1:-1,color:y})}b();Y.drawMarkers(z)}}s&&(e.drawImage(this._preRenderCanvas,0,0,this.width,this.height), f.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&f.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&f.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),f.clearRect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore());f.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}}; m.prototype.renderSplineArea=function(a){function d(){var c=v(r,2);if(0 =a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?m=k:0>a.axisY.viewportMaximum? m=f.y1:0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,f=a.axisY.lineCoordinates,l=[],u=this.plotArea;b.save();s&&e.save();b.beginPath();b.rect(u.x1,u.y1,u.width,u.height); b.clip();s&&(e.beginPath(),e.rect(u.x1,u.y1,u.width,u.height),e.clip());for(var z=0;z a.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!B)))if("number"!==typeof n[q].y)0 n[q].y===a.axisY.reversed?1:-1,color:A}); B=!1}d();Y.drawMarkers(l)}}s&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(u.x1,u.y1,u.width,u.height),this._eventManager.ghostCtx.restore());b.restore();return{source:c, dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderStepArea=function(a){var d,c;function b(){C&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?J=A:0>a.axisY.viewportMaximum?J=u.y1:0 =a.dataSeriesIndexes.length)){var l=this._eventManager.ghostCtx,u=a.axisY.lineCoordinates,z=[],h=this.plotArea,p;f.save();s&&l.save();f.beginPath();f.rect(h.x1,h.y1,h.width,h.height);f.clip();s&&(l.beginPath(),l.rect(h.x1,h.y1,h.width,h.height),l.clip());for(var n=0;n a.axisX.dataInfo.viewPortMax&&(!g.connectNullData||!c))){var $=t;"number"!==typeof B[k].y?(g.connectNullData||(c||d)||b(),c=!0):(m=a.axisX.convertValueToPixel(r),t=a.axisY.convertValueToPixel(B[k].y),d||c?(!d&&g.connectNullData?(f.setLineDash&&(g.options.nullDataLineDashType||K===g.lineDashType&&g.lineDashType!==g.nullDataLineDashType)&&(d=m,c=t,m=p.x,t=p.y,b(),f.moveTo(p.x,p.y),m=d,t=c,C=p,K=g.nullDataLineDashType, f.setLineDash(P)),f.lineTo(m,$),f.lineTo(m,t),s&&(l.lineTo(m,$),l.lineTo(m,t))):(f.beginPath(),f.moveTo(m,t),s&&(l.beginPath(),l.moveTo(m,t)),C={x:m,y:t}),c=d=!1):(f.lineTo(m,$),s&&l.lineTo(m,$),f.lineTo(m,t),s&&l.lineTo(m,t),0==k%250&&b()),p={x:m,y:t},k B[k].y===a.axisY.reversed?1:-1,color:y}))}b();Y.drawMarkers(z)}}s&&(e.drawImage(this._preRenderCanvas,0,0,this.width,this.height),f.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&f.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&f.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),f.clearRect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore()); f.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderStackedArea=function(a){function d(){if(!(1>h.length)){for(0 =a.dataSeriesIndexes.length)){var e=null,f=null,l=[],u=this.plotArea,z=[],h=[],p=[],n=[],q=0,g,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),r=this._eventManager.ghostCtx,t,x,A;s&&r.beginPath();b.save();s&&r.save();b.beginPath();b.rect(u.x1,u.y1,u.width,u.height);b.clip();s&&(r.beginPath(),r.rect(u.x1,u.y1,u.width,u.height),r.clip());for(var e=[],J=0;J a.axisX.dataInfo.viewPortMax&&(!y.connectNullData||!$)))if("number"!==typeof ia.y)y.connectNullData||($||x)||d(),$=!0;else{g=a.axisX.convertValueToPixel(f);var na=z[f]?z[f]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =n[f]&&a.axisY.logarithmic)continue;k=a.axisY.convertValueToPixel(n[f])}else k=a.axisY.convertValueToPixel(ia.y),k-=na;h.push({x:g,y:m-na});z[f]=m-k;x||$?(!x&&y.connectNullData?(b.setLineDash&&(y.options.nullDataLineDashType||A===y.lineDashType&&y.lineDashType!==y.nullDataLineDashType)&&(x=h.pop(),A=h[h.length-1],d(),b.moveTo(t.x,t.y),h.push(A),h.push(x),A=y.nullDataLineDashType,b.setLineDash(P)),b.lineTo(g,k),s&&r.lineTo(g,k)):(b.beginPath(),b.moveTo(g,k),s&&(r.beginPath(), r.moveTo(g,k))),$=x=!1):(b.lineTo(g,k),s&&r.lineTo(g,k),0==q%250&&(d(),b.moveTo(g,k),s&&r.moveTo(g,k),h.push({x:g,y:m-na})));t={x:g,y:k};q v[q].y===a.axisY.reversed?1:-1,color:e})}}d();b.moveTo(g,k);s&&r.moveTo(g,k)}delete y.dataPointIndexes}Y.drawMarkers(l);s&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas, 0,0,this.width,this.height),b.clearRect(u.x1,u.y1,u.width,u.height),r.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderStackedArea100=function(a){function d(){for(0 =a.dataSeriesIndexes.length)){var e=null,f=null,l=this.plotArea,u=[],k=[],h=[],p=[],n=[],q=0,g,m,r,O,t,x=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),A=this._eventManager.ghostCtx;b.save();s&&A.save();b.beginPath();b.rect(l.x1,l.y1,l.width,l.height);b.clip();s&&(A.beginPath(),A.rect(l.x1,l.y1,l.width,l.height),A.clip());for(var e=[],v=0;v a.axisX.dataInfo.viewPortMax&&(!y.connectNullData||!$)))if("number"!==typeof ia.y)y.connectNullData||($||O)||d(),$=!0;else{var na;na=0!==a.dataPointYSums[f]?100*(ia.y/a.dataPointYSums[f]): 0;g=a.axisX.convertValueToPixel(f);var ca=k[f]?k[f]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =n[f]&&a.axisY.logarithmic)continue;m=a.axisY.convertValueToPixel(n[f])}else m=a.axisY.convertValueToPixel(na),m-=ca;h.push({x:g,y:x-ca});k[f]=x-m;O||$?(!O&&y.connectNullData?(b.setLineDash&&(y.options.nullDataLineDashType||t===y.lineDashType&&y.lineDashType!==y.nullDataLineDashType)&&(O=h.pop(),t=h[h.length-1],d(),b.moveTo(r.x, r.y),h.push(t),h.push(O),t=y.nullDataLineDashType,b.setLineDash(P)),b.lineTo(g,m),s&&A.lineTo(g,m)):(b.beginPath(),b.moveTo(g,m),s&&(A.beginPath(),A.moveTo(g,m))),$=O=!1):(b.lineTo(g,m),s&&A.lineTo(g,m),0==q%250&&(d(),b.moveTo(g,m),s&&A.moveTo(g,m),h.push({x:g,y:x-ca})));r={x:g,y:m};q w[q].y===a.axisY.reversed?1:-1,color:e})}}d();b.moveTo(g,m);s&&A.moveTo(g,m)}delete y.dataPointIndexes}Y.drawMarkers(u);s&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&& b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(l.x1,l.y1,l.width,l.height),A.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderBubble=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b= this.plotArea,e=0,f,l;c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var u=-Infinity,k=Infinity,h=0;h a.axisX.dataInfo.viewPortMax|| "undefined"===typeof q[e].z||(g=q[e].z,g>u&&(u=g),g a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[e].y){f=a.axisX.convertValueToPixel(f);l=a.axisY.convertValueToPixel(q[e].y); var g=q[e].z,O=2*Math.max(Math.sqrt((u===k?r/2:m+(r-m)/(u-k)*(g-k))/Math.PI)<<0,1),g=n.getMarkerProperties(e,c);g.size=O;c.globalAlpha=n.fillOpacity;Y.drawMarker(f,l,c,g.type,g.size,g.color,g.borderColor,g.borderThickness);c.globalAlpha=1;var t=n.dataPointIds[e];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:e,x1:f,y1:l,size:O};O=S(t);s&&Y.drawMarker(f,l,this._eventManager.ghostCtx,g.type,g.size,O,O,g.borderThickness);(q[e].indexLabel||n.indexLabel|| q[e].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:q[e],dataSeries:n,point:{x:f,y:l},direction:1,bounds:{x1:f-g.size/2,y1:l-g.size/2,x2:f+g.size/2,y2:l+g.size/2},color:null})}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&& this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};m.prototype.renderScatter=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,e=0,f,l;c.save();s&&this._eventManager.ghostCtx.save(); c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var u=0;u a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[e].y){f=a.axisX.convertValueToPixel(f);l=a.axisY.convertValueToPixel(p[e].y);var g=h.getMarkerProperties(e,f,l,c);c.globalAlpha=h.fillOpacity;Y.drawMarker(g.x,g.y,g.ctx,g.type,g.size,g.color,g.borderColor,g.borderThickness);c.globalAlpha=1;Math.sqrt((n-f)*(n-f)+(q-l)*(q-l)) Math.min(this.plotArea.width,this.plotArea.height)||(n=h.dataPointIds[e],this._eventManager.objectMap[n]={id:n,objectType:"dataPoint",dataSeriesIndex:k, dataPointIndex:e,x1:f,y1:l},n=S(n),s&&Y.drawMarker(g.x,g.y,this._eventManager.ghostCtx,g.type,g.size,n,n,g.borderThickness),(p[e].indexLabel||h.indexLabel||p[e].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:p[e],dataSeries:h,point:{x:f,y:l},direction:1,bounds:{x1:f-g.size/2,y1:l-g.size/2,x2:f+g.size/2,y2:l+g.size/2},color:null}),n=f,q=l)}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop", a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};m.prototype.renderCandlestick= function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,f=null,l=this.plotArea,u=0,k,h,p,n,q,g,e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,f=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.options.dataPointWidth? this.dataPointWidth:0.7*l.width*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e>f&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,f));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&f f&&(m=f);c.save();s&&b.save();c.beginPath();c.rect(l.x1,l.y1,l.width,l.height);c.clip();s&&(b.beginPath(),b.rect(l.x1,l.y1,l.width, l.height),b.clip());for(var ga=0;ga a.axisX.dataInfo.viewPortMax)&&!r(x[u].y)&&x[u].y.length&&"number"===typeof x[u].y[0]&&"number"===typeof x[u].y[1]&&"number"===typeof x[u].y[2]&&"number"===typeof x[u].y[3]){k=a.axisX.convertValueToPixel(g);h=a.axisY.convertValueToPixel(x[u].y[0]); p=a.axisY.convertValueToPixel(x[u].y[1]);n=a.axisY.convertValueToPixel(x[u].y[2]);q=a.axisY.convertValueToPixel(x[u].y[3]);var v=k-m/2<<0,C=v+m<<0,f=t.options.fallingColor?t.fallingColor:t._colorSet[0],e=x[u].color?x[u].color:t._colorSet[0],y=Math.round(Math.max(1,0.15*m)),w=0===y%2?0:0.5,D=t.dataPointIds[u];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSeriesIndex:O,dataPointIndex:u,x1:v,y1:h,x2:C,y2:p,x3:k,y3:n,x4:k,y4:q,borderThickness:y,color:e};c.strokeStyle=e;c.beginPath(); c.lineWidth=y;b.lineWidth=Math.max(y,4);"candlestick"===t.type?(c.moveTo(k-w,p),c.lineTo(k-w,Math.min(h,q)),c.stroke(),c.moveTo(k-w,Math.max(h,q)),c.lineTo(k-w,n),c.stroke(),da(c,v,Math.min(h,q),C,Math.max(h,q),x[u].y[0]<=x[u].y[3]?t.risingColor:f,y,e,A,A,!1,!1,t.fillOpacity),s&&(e=S(D),b.strokeStyle=e,b.moveTo(k-w,p),b.lineTo(k-w,Math.min(h,q)),b.stroke(),b.moveTo(k-w,Math.max(h,q)),b.lineTo(k-w,n),b.stroke(),da(b,v,Math.min(h,q),C,Math.max(h,q),e,0,null,!1,!1,!1,!1))):"ohlc"===t.type&&(c.moveTo(k- w,p),c.lineTo(k-w,n),c.stroke(),c.beginPath(),c.moveTo(k,h),c.lineTo(v,h),c.stroke(),c.beginPath(),c.moveTo(k,q),c.lineTo(C,q),c.stroke(),s&&(e=S(D),b.strokeStyle=e,b.moveTo(k-w,p),b.lineTo(k-w,n),b.stroke(),b.beginPath(),b.moveTo(k,h),b.lineTo(v,h),b.stroke(),b.beginPath(),b.moveTo(k,q),b.lineTo(C,q),b.stroke()));(x[u].indexLabel||t.indexLabel||x[u].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:t.type,dataPoint:x[u],dataSeries:t,point:{x:v+(C-v)/2,y:a.axisY.reversed? n:p},direction:1,bounds:{x1:v,y1:Math.min(p,n),x2:C,y2:Math.max(p,n)},color:e})}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(l.x1,l.y1,l.width,l.height),b.restore()); c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};m.prototype.renderBoxAndWhisker=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,f=this.plotArea,l=0,u,k,h,p,n,q,g,e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,l=this.options.dataPointMaxWidth? this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.options.dataPointWidth?this.dataPointWidth:0.7*f.width*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e>l&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l l&&(m=l);c.save();s&&b.save();c.beginPath();c.rect(f.x1,f.y1,f.width,f.height);c.clip();s&&(b.beginPath(),b.rect(f.x1,f.y1,f.width,f.height),b.clip());for(var ga=!1,ga=!!a.axisY.reversed,O=0;O a.axisX.dataInfo.viewPortMax)&& !r(A[l].y)&&A[l].y.length&&"number"===typeof A[l].y[0]&&"number"===typeof A[l].y[1]&&"number"===typeof A[l].y[2]&&"number"===typeof A[l].y[3]&&"number"===typeof A[l].y[4]&&5===A[l].y.length){u=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(A[l].y[0]);h=a.axisY.convertValueToPixel(A[l].y[1]);p=a.axisY.convertValueToPixel(A[l].y[2]);n=a.axisY.convertValueToPixel(A[l].y[3]);q=a.axisY.convertValueToPixel(A[l].y[4]);var C=u-m/2<<0,y=u+m/2<<0,e=A[l].color?A[l].color:x._colorSet[0],w=Math.round(Math.max(1, 0.15*m)),D=0===w%2?0:0.5,K=A[l].whiskerColor?A[l].whiskerColor:A[l].color?x.whiskerColor?x.whiskerColor:A[l].color:x.whiskerColor?x.whiskerColor:e,P="number"===typeof A[l].whiskerThickness?A[l].whiskerThickness:"number"===typeof x.options.whiskerThickness?x.whiskerThickness:w,E=A[l].whiskerDashType?A[l].whiskerDashType:x.whiskerDashType,$=r(A[l].whiskerLength)?r(x.options.whiskerLength)?m:x.whiskerLength:A[l].whiskerLength,$="number"===typeof $?0>=$?0:$>=m?m:$:"string"===typeof $?parseInt($)*m/100> m?m:parseInt($)*m/100:m,ia=1===Math.round(P)%2?0.5:0,na=A[l].stemColor?A[l].stemColor:A[l].color?x.stemColor?x.stemColor:A[l].color:x.stemColor?x.stemColor:e,ca="number"===typeof A[l].stemThickness?A[l].stemThickness:"number"===typeof x.options.stemThickness?x.stemThickness:w,F=1===Math.round(ca)%2?0.5:0,I=A[l].stemDashType?A[l].stemDashType:x.stemDashType,G=A[l].lineColor?A[l].lineColor:A[l].color?x.lineColor?x.lineColor:A[l].color:x.lineColor?x.lineColor:e,N="number"===typeof A[l].lineThickness? A[l].lineThickness:"number"===typeof x.options.lineThickness?x.lineThickness:w,T=A[l].lineDashType?A[l].lineDashType:x.lineDashType,M=1===Math.round(N)%2?0.5:0,W=x.upperBoxColor,xa=x.lowerBoxColor,sa=r(x.options.fillOpacity)?1:x.fillOpacity,R=x.dataPointIds[l];this._eventManager.objectMap[R]={id:R,objectType:"dataPoint",dataSeriesIndex:t,dataPointIndex:l,x1:C,y1:k,x2:y,y2:h,x3:u,y3:p,x4:u,y4:n,y5:q,borderThickness:w,color:e,stemThickness:ca,stemColor:na,whiskerThickness:P,whiskerLength:$,whiskerColor:K, lineThickness:N,lineColor:G};c.save();0 =a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=0,l,u,k,f=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;l=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth: 0.03*this.width;var h=a.axisX.dataInfo.minDiff;isFinite(h)||(h=0.3*Math.abs(a.axisX.range));h=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(h)/Math.log(a.axisX.range):Math.abs(h)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>l&&(f=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l l&&(h=l);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var p=0;p a.axisX.dataInfo.viewPortMax)&&!r(g[f].y)&&g[f].y.length&&"number"===typeof g[f].y[0]&&"number"===typeof g[f].y[1]){b=a.axisX.convertValueToPixel(k);l=a.axisY.convertValueToPixel(g[f].y[0]);u=a.axisY.convertValueToPixel(g[f].y[1]);var ga=a.axisX.reversed?b+a.plotType.totalDataSeries*h/2-(a.previousDataSeriesCount+p)*h<<0:b-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+p)*h<<0,O=a.axisX.reversed?ga-h<<0:ga+h<<0,b=g[f].color?g[f].color:q._colorSet[f%q._colorSet.length];if(l>u){var t=l; l=u;u=t}t=q.dataPointIds[f];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:ga,y1:l,x2:O,y2:u};da(c,ga,l,O,u,b,0,b,m,m,!1,!1,q.fillOpacity);b=S(t);s&&da(this._eventManager.ghostCtx,ga,l,O,u,b,0,null,!1,!1,!1,!1);if(g[f].indexLabel||q.indexLabel||g[f].indexLabelFormatter||q.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:g[f],dataSeries:q,indexKeyword:0,point:{x:ga+(O-ga)/2,y:g[f].y[1]>=g[f].y[0]?u:l},direction:g[f].y[1]>= g[f].y[0]?-1:1,bounds:{x1:ga,y1:Math.min(l,u),x2:O,y2:Math.max(l,u)},color:b}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:g[f],dataSeries:q,indexKeyword:1,point:{x:ga+(O-ga)/2,y:g[f].y[1]>=g[f].y[0]?l:u},direction:g[f].y[1]>=g[f].y[0]?1:-1,bounds:{x1:ga,y1:Math.min(l,u),x2:O,y2:Math.max(l,u)},color:b})}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height), a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};m.prototype.renderError=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx: d,b=a.axisY._position?"left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var e=null,f=!1,l=this.plotArea,u=0,k,h,p,n,q,g,m,ga=a.axisX.dataInfo.minDiff;isFinite(ga)||(ga=0.3*Math.abs(a.axisX.range));c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(l.x1,l.y1,l.width,l.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(l.x1,l.y1,l.width,l.height),this._eventManager.ghostCtx.clip());for(var O= 0,t=0;t u&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,u));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&u u&&(t=u);if(0 =K.length?0:K.length>=t?t:K.length:"string"===typeof K.length?parseInt(K.length)*t/100>t?t:parseInt(K.length)*t/100>t:t;K.thickness="number"===typeof K.thickness?0>K.thickness?0:Math.round(K.thickness):2;var P={color:C[u].stemColor?C[u].stemColor:C[u].color?v.stemColor?v.stemColor:C[u].color:v.stemColor?v.stemColor:e,thickness:C[u].stemThickness?C[u].stemThickness:v.stemThickness,dashType:C[u].stemDashType?C[u].stemDashType:v.stemDashType};P.thickness= "number"===typeof P.thickness?0>P.thickness?0:Math.round(P.thickness):2;C[u].getTime?m=C[u].x.getTime():m=C[u].x;if(!(m a.axisX.dataInfo.viewPortMax)&&!r(C[u].y)&&C[u].y.length&&"number"===typeof C[u].y[0]&&"number"===typeof C[u].y[1]){var ha=a.axisX.convertValueToPixel(m);b?h=ha:k=ha;ha=a.axisY.convertValueToPixel(C[u].y[0]);b?p=ha:q=ha;ha=a.axisY.convertValueToPixel(C[u].y[1]);b?n=ha:g=ha;b?(q=a.axisX.reversed?h+(y?O:1)*t/2-(y?D-1:0)*t<<0:h-(y?O:1)*t/2+(y?D-1:0)* t<<0,g=a.axisX.reversed?q-t<<0:q+t<<0):(p=a.axisX.reversed?k+(y?O:1)*t/2-(y?D-1:0)*t<<0:k-(y?O:1)*t/2+(y?D-1:0)*t<<0,n=a.axisX.reversed?p-t<<0:p+t<<0);!b&&q>g&&(ha=q,q=g,g=ha);b&&p>n&&(ha=p,p=n,n=ha);ha=v.dataPointIds[u];this._eventManager.objectMap[ha]={id:ha,objectType:"dataPoint",dataSeriesIndex:A,dataPointIndex:u,x1:Math.min(p,n),y1:Math.min(q,g),x2:Math.max(n,p),y2:Math.max(g,q),isXYSwapped:b,stemProperties:P,whiskerProperties:K};w(c,Math.min(p,n),Math.min(q,g),Math.max(n,p),Math.max(g,q),e, K,P,b);s&&w(this._eventManager.ghostCtx,p,q,n,g,e,K,P,b);if(C[u].indexLabel||v.indexLabel||C[u].indexLabelFormatter||v.indexLabelFormatter)this._indexLabels.push({chartType:"error",dataPoint:C[u],dataSeries:v,indexKeyword:0,point:{x:b?C[u].y[1]>=C[u].y[0]?p:n:p+(n-p)/2,y:b?q+(g-q)/2:C[u].y[1]>=C[u].y[0]?g:q},direction:C[u].y[1]>=C[u].y[0]?-1:1,bounds:{x1:b?Math.min(p,n):p,y1:b?q:Math.min(q,g),x2:b?Math.max(p,n):n,y2:b?g:Math.max(q,g)},color:e,axisSwapped:b}),this._indexLabels.push({chartType:"error", dataPoint:C[u],dataSeries:v,indexKeyword:1,point:{x:b?C[u].y[1]>=C[u].y[0]?n:p:p+(n-p)/2,y:b?q+(g-q)/2:C[u].y[1]>=C[u].y[0]?q:g},direction:C[u].y[1]>=C[u].y[0]?1:-1,bounds:{x1:b?Math.min(p,n):p,y1:b?q:Math.min(q,g),x2:b?Math.max(p,n):n,y2:b?g:Math.max(q,g)},color:e,axisSwapped:b})}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas, 0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(l.x1,l.y1,l.width,l.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b= null,e=this.plotArea,f=0,l,u,k,h,f=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;l=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range): Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>l&&(f=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l l&&(p=l);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1, e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var n=0;n a.axisX.dataInfo.viewPortMax)&&!r(m[f].y)&&m[f].y.length&&"number"===typeof m[f].y[0]&&"number"===typeof m[f].y[1]){l=a.axisY.convertValueToPixel(m[f].y[0]);u=a.axisY.convertValueToPixel(m[f].y[1]); k=a.axisX.convertValueToPixel(h);k=a.axisX.reversed?k+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+n)*p<<0:k-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+n)*p<<0;var v=a.axisX.reversed?k-p<<0:k+p<<0;l>u&&(b=l,l=u,u=b);b=m[f].color?m[f].color:g._colorSet[f%g._colorSet.length];da(c,l,k,u,v,b,0,null,ga,!1,!1,!1,g.fillOpacity);b=g.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:f,x1:l,y1:k,x2:u,y2:v};b=S(b);s&&da(this._eventManager.ghostCtx, l,k,u,v,b,0,null,!1,!1,!1,!1);if(m[f].indexLabel||g.indexLabel||m[f].indexLabelFormatter||g.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:m[f],dataSeries:g,indexKeyword:0,point:{x:m[f].y[1]>=m[f].y[0]?l:u,y:k+(v-k)/2},direction:m[f].y[1]>=m[f].y[0]?-1:1,bounds:{x1:Math.min(l,u),y1:k,x2:Math.max(l,u),y2:v},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:m[f],dataSeries:g,indexKeyword:1,point:{x:m[f].y[1]>=m[f].y[0]?u:l,y:k+(v-k)/2},direction:m[f].y[1]>= m[f].y[0]?1:-1,bounds:{x1:Math.min(l,u),y1:k,x2:Math.max(l,u),y2:v},color:b})}}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore()); c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};m.prototype.renderRangeArea=function(a){function d(){if(x){for(var a=null,c=k.length-1;0<=c;c--)a=k[c],b.lineTo(a.x,a.y2),e.lineTo(a.x,a.y2);b.closePath();b.globalAlpha=p.fillOpacity;b.fill();b.globalAlpha=1;e.fill();if(0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,f=[],l=this.plotArea;b.save();s&&e.save();b.beginPath();b.rect(l.x1,l.y1,l.width,l.height);b.clip();s&&(e.beginPath(),e.rect(l.x1,l.y1,l.width,l.height),e.clip());for(var u=0;u a.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!K)))if(null!==n[g].y&&n[g].y.length&&"number"===typeof n[g].y[0]&&"number"===typeof n[g].y[1]){m=a.axisX.convertValueToPixel(t);r=a.axisY.convertValueToPixel(n[g].y[0]);v=a.axisY.convertValueToPixel(n[g].y[1]);q||K?(p.connectNullData&&!q?(b.setLineDash&&(p.options.nullDataLineDashType||y===p.lineDashType&&p.lineDashType!==p.nullDataLineDashType)&&(k[k.length-1].newLineDashArray=E,y=p.nullDataLineDashType, b.setLineDash(D)),b.lineTo(m,r),s&&e.lineTo(m,r),k.push({x:m,y1:r,y2:v})):(b.beginPath(),b.moveTo(m,r),x={x:m,y:r},k=[],k.push({x:m,y1:r,y2:v}),s&&(e.beginPath(),e.moveTo(m,r))),K=q=!1):(b.lineTo(m,r),k.push({x:m,y1:r,y2:v}),s&&e.lineTo(m,r),0==g%250&&d());t=p.dataPointIds[g];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:g,x1:m,y1:r,y2:v};g n[g].y[1]===a.axisY.reversed?-1:1,color:A}),this._indexLabels.push({chartType:"rangeArea",dataPoint:n[g],dataSeries:p,indexKeyword:1,point:{x:m,y:v},direction:n[g].y[0]> n[g].y[1]===a.axisY.reversed?1:-1,color:A})}else K||q||d(),K=!0;d();Y.drawMarkers(f)}}s&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(l.x1,l.y1,l.width,l.height),this._eventManager.ghostCtx.restore()); b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};m.prototype.renderRangeSplineArea=function(a){function d(a,c){var d=v(r,2);if(0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,f=[],l=this.plotArea;b.save();s&&e.save();b.beginPath();b.rect(l.x1,l.y1,l.width,l.height);b.clip();s&&(e.beginPath(),e.rect(l.x1,l.y1,l.width,l.height),e.clip());for(var k=0;k a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!g)))if(null!==p[n].y&&p[n].y.length&&"number"===typeof p[n].y[0]&&"number"=== typeof p[n].y[1]){q=a.axisX.convertValueToPixel(q);g=a.axisY.convertValueToPixel(p[n].y[0]);B=a.axisY.convertValueToPixel(p[n].y[1]);var D=h.dataPointIds[n];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:n,x1:q,y1:g,y2:B};r[r.length]={x:q,y:g};O[O.length]={x:q,y:B};n =a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx,e=null,f=this.plotArea,l=0,k,m,h,p,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.options.dataPointMinWidth?this.dataPointMinWidth: this.options.dataPointWidth?this.dataPointWidth:1;m=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var q=a.axisX.dataInfo.minDiff;isFinite(q)||(q=0.3*Math.abs(a.axisX.range));q=this.options.dataPointWidth?this.dataPointWidth:0.6*(f.width*(a.axisX.logarithmic?Math.log(q)/Math.log(a.axisX.range):Math.abs(q)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&& l>m&&(l=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m m&&(q=m);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(f.x1,f.y1,f.width,f.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(f.x1,f.y1,f.width,f.height),this._eventManager.ghostCtx.clip());for(var g=0;g h&&(e=m,m=h,h=e);a.axisY.reversed&&(e=m,m=h,h=e);e=v.dataPointIds[l];this._eventManager.objectMap[e]={id:e,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:l,x1:k,y1:m,x2:E,y2:h};var K=O[l].color?O[l].color:0 O[l].y===a.axisY.reversed?1:-1,bounds:{x1:k,y1:Math.min(m,h),x2:E,y2:Math.max(m,h)},color:e})}}s&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas, 0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(f.x1,f.y1,f.width,f.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};var Z=function(a,d,c,b,e,f,l,k,m){if(!(0>c)){"undefined"===typeof k&& (k=1);if(!s){var h=Number((l%(2*Math.PI)).toFixed(8));Number((f%(2*Math.PI)).toFixed(8))===h&&(l-=1E-4)}a.save();a.globalAlpha=k;"pie"===e?(a.beginPath(),a.moveTo(d.x,d.y),a.arc(d.x,d.y,c,f,l,!1),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===e&&(a.beginPath(),a.arc(d.x,d.y,c,f,l,!1),0<=m&&a.arc(d.x,d.y,m*c,l,f,!0),a.closePath(),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};m.prototype.renderPie=function(a){function d(){if(h&& p){for(var a=0,b=0,c=0,d=0,e=0;e Math.PI/2-t&&n.midAngle n.midAngle)c=e;a++}else if(n.midAngle>3*Math.PI/2-t&&n.midAngle<3*Math.PI/2+t){if(0===b||g[d].midAngle>n.midAngle)d=e;b++}n.hemisphere=f>Math.PI/2&&f<=3*Math.PI/2?"left":"right";n.indexLabelTextBlock=new la(m.plotArea.ctx,{fontSize:n.indexLabelFontSize,fontFamily:n.indexLabelFontFamily, fontColor:n.indexLabelFontColor,fontStyle:n.indexLabelFontStyle,fontWeight:n.indexLabelFontWeight,horizontalAlign:"left",backgroundColor:n.indexLabelBackgroundColor,maxWidth:n.indexLabelMaxWidth,maxHeight:n.indexLabelWrap?5*n.indexLabelFontSize:1.5*n.indexLabelFontSize,text:n.indexLabelText,padding:0,textBaseline:"top"});n.indexLabelTextBlock.measureText()}l=f=0;k=!1;for(e=0;e Math.PI/2-t&&n.midAngle 3*Math.PI/2-t&&n.midAngle<3*Math.PI/2+t)&&(l<=b/2&&!k?(n.hemisphere="left",l++):(n.hemisphere="right",k=!0))}}function c(a){var b=m.plotArea.ctx;b.clearRect(q.x1,q.y1,q.width,q.height);b.fillStyle=m.backgroundColor;b.fillRect(q.x1,q.y1,q.width,q.height);for(b=0;b c){var e=0.07*y*Math.cos(g[b].midAngle),f=0.07*y*Math.sin(g[b].midAngle),l=!1;if(p[b].exploded){if(1E-9< Math.abs(g[b].center.x-(A.x+e))||1E-9 a.indexLabelTextBlock.y?e-d:c-f}function e(a){for(var c=null,d=1;d b(g[c],g[a])||("right"===g[a].hemisphere?g[c].indexLabelTextBlock.y>=g[a].indexLabelTextBlock.y:g[c].indexLabelTextBlock.y<=g[a].indexLabelTextBlock.y)))break;else c=null;return c}function f(a,c,d){d=(d||0)+1;if(1E3 c&&m.indexLabelTextBlock.y n)return 0;var k=0,q=0,q=k=k=0;0>c?m.indexLabelTextBlock.y-m.indexLabelTextBlock.height/2>l&&m.indexLabelTextBlock.y-m.indexLabelTextBlock.height/ 2+c n&&(c=m.indexLabelTextBlock.y+m.indexLabelTextBlock.height/2+c-n);c=m.indexLabelTextBlock.y+c;l=0;l="right"===m.hemisphere?A.x+Math.sqrt(Math.pow(s,2)-Math.pow(c-A.y,2)):A.x-Math.sqrt(Math.pow(s,2)-Math.pow(c-A.y,2));q=A.x+y*Math.cos(m.midAngle);k=A.y+y*Math.sin(m.midAngle);k=Math.sqrt(Math.pow(l-q,2)+Math.pow(c- k,2));q=Math.acos(y/s);k=Math.acos((s*s+y*y-k*k)/(2*y*s));c=k b(g[l],g[a])||("right"===g[a].hemisphere?g[l].indexLabelTextBlock.y<=g[a].indexLabelTextBlock.y:g[l].indexLabelTextBlock.y>=g[a].indexLabelTextBlock.y)))break;else l=null;q=l;k=e(a);n=l=0;0>c?(n="right"===m.hemisphere?q:k,h=c,null!== n&&(q=-c,c=m.indexLabelTextBlock.y-m.indexLabelTextBlock.height/2-(g[n].indexLabelTextBlock.y+g[n].indexLabelTextBlock.height/2),c-q+l.toFixed(x)&&(h=c>B?-(c-B):-(q-(n-l)))))):0B?c-B:q-(l-n)))));h&&(d=m.indexLabelTextBlock.y+h,c=0,c= "right"===m.hemisphere?A.x+Math.sqrt(Math.pow(s,2)-Math.pow(d-A.y,2)):A.x-Math.sqrt(Math.pow(s,2)-Math.pow(d-A.y,2)),m.midAngle>Math.PI/2-t&&m.midAngle l.indexLabelTextBlock.x?c=l.indexLabelTextBlock.x-15:"right"===m.hemisphere&&("left"===a.hemisphere&&c 3*Math.PI/2-t&&m.midAngle<3*Math.PI/2+t&&(l=(a-1+g.length)% g.length,l=g[l],a=g[(a+1+g.length)%g.length],"right"===m.hemisphere&&"left"===l.hemisphere&&c a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x-15)),m.indexLabelTextBlock.y=d,m.indexLabelTextBlock.x=c,m.indexLabelAngle=Math.atan2(m.indexLabelTextBlock.y-A.y,m.indexLabelTextBlock.x-A.x))}return h}function l(){var a=m.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline= "middle";for(var c=a=0,d=0,l=!0,c=0;10>c&&(1>c||0 C){for(var w=t=0,J=0;J t?k.indexLabelText= "":k.indexLabelTextBlock.maxWidth=0.85*t,0.3*k.indexLabelTextBlock.maxWidth d&&(d=r)),r=r=0,0 d&&(d=r)));var G=function(a,b,c){for(var d=[],e=0;d.push(g[b]),b!==c;b=(b+1+p.length)%p.length);d.sort(function(a,b){return a.y-b.y});for(b=0;b C){m=u.indexLabelTextBlock.x;var q=u.indexLabelTextBlock.y-u.indexLabelTextBlock.height/2,t=u.indexLabelTextBlock.y+u.indexLabelTextBlock.height/2,r=k.indexLabelTextBlock.y-k.indexLabelTextBlock.height/2,z=k.indexLabelTextBlock.x+k.indexLabelTextBlock.width,B=k.indexLabelTextBlock.y+k.indexLabelTextBlock.height/2;m=u.indexLabelTextBlock.x+ u.indexLabelTextBlock.width z+n||q>B+n||t a&&(a=h),l!==a&&(c=l,d+=-C),0===h%Math.max(p.length/10,3)&&(f=!0)):f=!0;f&&(0 =a.dataSeriesIndexes.length)){var h=this.data[a.dataSeriesIndexes[0]],p=h.dataPoints,n=10,q=this.plotArea,g=h.dataPointEOs,B=2,s,v=1.3,t=20/180*Math.PI,x=6,A={x:(q.x2+q.x1)/2,y:(q.y2+q.y1)/2},w=0;a=!1;for(var C=0;C a&&(d=a,e=!0);var f=p[b].color?p[b].color:h._colorSet[b%h._colorSet.length];d>c&&Z(m.plotArea.ctx,g[b].center,g[b].radius,f,h.type,c,d,h.fillOpacity,g[b].percentInnerRadius);if(e)break}k()},function(){m.disableToolTip=!1;m._animator.animate(0,m.animatedRender?500:0,function(a){c(a);k()})})}}};var qa=function(a,d,c,b){"undefined"=== typeof c&&(c=1);0>=Math.round(d.y4-d.y1)||(a.save(),a.globalAlpha=c,a.beginPath(),a.moveTo(Math.round(d.x1),Math.round(d.y1)),a.lineTo(Math.round(d.x2),Math.round(d.y2)),a.lineTo(Math.round(d.x3),Math.round(d.y3)),a.lineTo(Math.round(d.x4),Math.round(d.y4)),"undefined"!==d.x5&&(a.lineTo(Math.round(d.x5),Math.round(d.y5)),a.lineTo(Math.round(d.x6),Math.round(d.y6))),a.closePath(),a.fillStyle=b?b:d.color,a.fill(),a.globalAplha=1,a.restore())};m.prototype.renderFunnel=function(a){function d(){for(var a= 0,b=[],c=0;c m?(m=c,l=(b+m)*(e-k)/2,a-=l,n=e-k,k+=e-k,n+=0==m?0:a/m,k+=a/m,l=!0):(n=(Math.abs(ba)*b-Math.sqrt(m))/2,m=b-2*n/Math.abs(ba),k+=n,k>e&&(k-=n,m=c,l=(b+m)*(e-k)/2,a-=l,n=e-k,k+=e-k,n+=a/m,k+=a/m,l=!0),b=m)),d.push(n);return d}function b(){if(t&&x){for(var a,b,c,d,e,f,h,l,k,n,m,p,q,u,B=[],z=[],v={percent:null,total:null},A=null,y=0;y B[y]&&(B[y]=y!==da?t.reversed?R[y].x3-R[y].x4:R[y].x2-R[y].x1:R[y].x2-R[y].x1,B[y]/=2));q=b.indexLabelMaxWidth?b.indexLabelMaxWidth:t.options.indexLabelMaxWidth?t.indexLabelMaxWidth: B[y];if(q>B[y]||0>q)q=B[y];z[y]="inside"===t.indexLabelPlacement?R[y].height:!1;v=w.getPercentAndTotal(t,b);if(t.indexLabelFormatter||b.indexLabelFormatter)A={chart:w.options,dataSeries:t,dataPoint:b,total:v.total,percent:v.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(A):b.indexLabel?w.replaceKeywordsWithValue(b.indexLabel,b,t,y):t.indexLabelFormatter?t.indexLabelFormatter(A):t.indexLabel?w.replaceKeywordsWithValue(t.indexLabel,b,t,y):b.label?b.label:"";0>=n&&(n=0);1E3>q&&1E3-qh?h:t.indexLabelMaxWidth:h,l=H.length-1;0<=l;l--){g=x[H[l].id];c=H[l];d=c.textBlock;b=(a=q(l) b.y&&(e=!0);c=g.indexLabelMaxWidth||h;if(c>h||0>c)c=h;f.push(c)}if(e)for(l=H.length-1;0<=l;l--)a=R[l],H[l].textBlock.maxWidth=f[f.length-(l+1)],H[l].textBlock.measureText(),H[l].textBlock.x=N-h,c=H[l].textBlock.height U+D&&(H[l].textBlock.y=U+D-H[l].height),H[l].textBlock.y sa+D&&(H[l].textBlock.y=sa+D-H[l].height))}function f(){var a,b,c,d;if("inside"!==t.indexLabelPlacement)for(var e=0;e xa?g(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c U+D&&(H[e].textBlock.y=U+D-H[e].height),H[e].textBlock.y sa+D&& (H[e].textBlock.y=sa+D-H[e].height)));else for(e=0;e =c?(b=e!=da?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=da?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,H[e].textBlock.x=b,H[e].textBlock.y=c):H[e].isDirty=!0)}function l(){function a(b,c){var d;if(0>b||b>=H.length)return 0;var e,f=H[b].textBlock;if(0>c){c*=-1;e=n(b);d=k(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0 =c)return f.y+=c,c;if(b==R.length-1)return 0 e)&&(l=q(p),!(l>=H.length-1)&&H[p].textBlock.y+H[p].height+ea>H[l].textBlock.y&&(H[p].textBlock.y=H[p].textBlock.y+H[p].height-e>e-H[p].textBlock.y?e+1:e-H[p].height-1))}for(l=R.length-1;0 e&&(e=0,H[e].isDirty))break;if(H[l].textBlock.y =f){f=0;h+=H[f].height;break}e=n(f);if(0>e){f=0;h+=H[f].height;break}}if(f!=l){g=H[f].textBlock.y;a-=g;a=h-a;g=c(a,d,f);break}}}return g}function c(a,b,d){var e=[],f=0,g=0;for(a=Math.abs(a);d<=b;d++)e.push(R[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d +l.y.toFixed(6))&&(d=g.y+d+ea-l.y,e=a(t,-d),e a?t.reversed?sa-D:U-D:H[a].textBlock.y+H[a].height+ea)}function m(a,b,c){var d,e,g,l=[],k=D,n=[];-1!==b&&(0<=Z.indexOf(b)?(e=Z.indexOf(b),Z.splice(e,1)):(Z.push(b),Z=Z.sort(function(a,b){return a-b})));if(0===Z.length)l=ja;else{e=D*(1!=Z.length||0!=Z[0]&&Z[0]!=R.length-1?2:1)/h();for(var q=0;q n&&(n*=-1),c.y1+=b-n[d],c.y2+=b-n[d],c.y3+=b-n[d],c.y4+=b-n[d],c.y5&&(c.y5+=b-n[d],c.y6+=b-n[d]),n[d]=b}};a._animator.animate(0,c,function(c){var d=a.plotArea.ctx||a.ctx;ka=!0;d.clearRect(A.x1,A.y1,A.x2-A.x1, A.y2-A.y1);d.fillStyle=a.backgroundColor;d.fillRect(A.x1,A.y1,A.width,A.height);u.changeSection(c,b);var e={};e.dataSeries=t;e.dataPoint=t.reversed?t.dataPoints[x.length-1-b]:t.dataPoints[b];e.index=t.reversed?x.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;e a){b=R[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function B(a){for(var b=0;b =a.dataSeriesIndexes.length)){for(var t=this.data[a.dataSeriesIndexes[0]], x=t.dataPoints,A=this.plotArea,D=0.025*A.width,C=0.01*A.width,y=0,E=A.height-2*D,G=Math.min(A.width-2*C,2.8*A.height),K=!1,P=0;P E?ca=E:0>=ca&&(ca=0),F>a?F=a-0.5:0>=F&&(F=0)):"pyramid"===t.type&&(F=ca=0,t.reversed=t.reversed?!1:!0);var C=P+a/2,X=P,aa=P+a,U=t.reversed?T:$,M=C-F/2,Y=C+F/2,xa=t.reversed?$+ca:T-ca,sa=t.reversed?$:T;a=[];var C=[],R=[],G=[],V=$,da,ba=(xa-U)/(M-X),fa=-ba,P="area"===(t.valueRepresents?t.valueRepresents:"height")?c():d();if(-1!==P){if(t.reversed)for(G.push(V),F=P.length-1;0 a&&(y=a));for(F=0;F ');b.document.close();setTimeout(function(){b.focus();b.print();setTimeout(function(){c._canvasJSContainer.removeChild(d)},1E3)},500)};m.prototype.getPercentAndTotal=function(a,d){var c=null,b=null, e=null;if(0<=a.type.indexOf("stacked"))b=0,c=d.x.getTime?d.x.getTime():d.x,c in a.plotUnit.yTotals&&(b=a.plotUnit.yTotals[c],e=isNaN(d.y)?0:100*(d.y/b));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(c=b=0;c Please right click on the image and save it to your device"),d.document.close()}}};m.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),d=document.createElement("iframe");d.setAttribute("class","canvasjs-chart-print-frame");d.setAttribute("style","position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;"); d.style.height=this.height+"px";this._canvasJSContainer.appendChild(d);var c=this,b=d.contentWindow||d.contentDocument.document||d.contentDocument;b.document.open();b.document.write('\n=l||"undefined"=== typeof l||0>=v||"undefined"===typeof v)){if("horizontal"===this.orientation){q.textBlock=new la(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:this.itemWrap?l:this.lineHeight,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(s+k+("line"===q.chartType||"spline"===q.chartType||"stepLine"=== q.chartType?2*0.1*this.lineHeight:0)));if(!n||n.width+Math.round(q.textBlock.width+s+k+(0===n.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>f)n={items:[],width:0},h.push(n),this.height+=g,g=0;g=Math.max(g,q.textBlock.height)}else q.textBlock=new la(this.ctx,{x:0,y:0,maxWidth:A,maxHeight:!0===this.itemWrap?l:1.5*this.fontSize,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily, fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(s+k+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height >0,0),this.dataPoints.length):0):(p=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0 >0,0),this.dataPoints.length):0));for(;;){f=0
a?b.x/a:a/b.x: Math.abs(b.x-a);n p-e&&p+e>=this.dataPoints.length)break;-1===l?(e++,l=1):l=-1}return d||(c.dataPoint.x.getTime?c.dataPoint.x.getTime():c.dataPoint.x)!==(a.getTime?a.getTime():a)?d&&null!==c.dataPoint?c:null:c};G.prototype.getDataPointAtXY=function(a,d,c){if(!this.dataPoints||0===this.dataPoints.length||a this.chart.plotArea.x2||d this.chart.plotArea.y2)return null; c=c||!1;var b=[],e=0,f=0,l=1,k=!1,m=Infinity,h=0,p=0,n=0;if("none"!==this.chart.plotInfo.axisPlacement)if(n=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:d}),this.axisX.logarithmic)var q=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),n=1 >0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0>0,0),this.dataPoints.length):0;for(;;){f=0=q.x1&&(a<=q.x2&&d>=q.y1&&d<=q.y2)&&(b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:Math.min(Math.abs(q.x1- a),Math.abs(q.x2-a),Math.abs(q.y1-d),Math.abs(q.y2-d))}),k=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var s=ma("markerSize",g,this)||4,v=c?20:s,r=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2));r<=v&&b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:r});q=Math.abs(q.x1-a);q<=m?m=q:0 v&&(r=Math.atan2(d-s.y,a-s.x),0>r&&(r+=2*Math.PI),r=Number(((180*(r/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(q.startAngle/Math.PI)%360+360)%360).toFixed(12)),v=Number(((180*(q.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===v&&1 =v&&0!==g.y&&(v+=360,r s&&rr.y1&&d r.y6?(f=r.x6+(r.x5-r.x6)/(r.y5-r.y6)*(d-r.y6),r=r.x3+(r.x4-r.x3)/(r.y4-r.y3)*(d-r.y3)):(f=r.x1+(r.x6-r.x1)/(r.y6-r.y1)*(d-r.y1),r=r.x2+(r.x3-r.x2)/(r.y3-r.y2)*(d-r.y2)):(f=r.x1+(r.x4-r.x1)/(r.y4-r.y1)*(d-r.y1),r=r.x2+(r.x3-r.x2)/(r.y3-r.y2)*(d-r.y2)),a>f&&a =q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&d>=q.y4-q.borderThickness/2&&d<=q.y1+q.borderThickness/ 2||Math.abs(q.x2-a+q.x1-a) =q.y1&&d<=q.y4)b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),k=!0;break;case "candlestick":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&d>=q.y2-q.borderThickness/2&&d<=q.y3+q.borderThickness/2||Math.abs(q.x2-a+q.x1-a) =q.y1&&d<=q.y4)b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:Math.min(Math.abs(q.x1-a), Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),k=!0;break;case "ohlc":if(Math.abs(q.x2-a+q.x1-a) =q.y2&&d<=q.y3||a>=q.x1&&a<=(q.x2+q.x1)/2&&d>=q.y1-q.borderThickness/2&&d<=q.y1+q.borderThickness/2||a>=(q.x1+q.x2)/2&&a<=q.x2&&d>=q.y4-q.borderThickness/2&&d<=q.y4+q.borderThickness/2)b.push({dataPoint:g,dataPointIndex:f,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-d),Math.abs(q.y3-d))}),k=!0}if(k||1E3 n-e&&n+e>= this.dataPoints.length)break;-1===l?(e++,l=1):l=-1}a=null;for(d=0;d n[g].endValue;g++);a=g =n[g].startValue&&c<=n[g].endValue;p=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:p,label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:fa(p,this.valueFormatString,this.chart._cultureInfo),a=new la(this.ctx,{x:0,y:0,maxWidth:f,maxHeight:l,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,cornerRadius:this.labelCornerRadius,textAlign:this.labelTextAlign, fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:p,textBlock:a,effectiveHeight:null}))}g=q;for(c=this.intervalStartPosition;c<=e;c=parseFloat(1E-12>this.interval?this.logarithmic&&this.equidistantInterval?c*Math.pow(this.logarithmBase,this.interval):c+this.interval:(this.logarithmic&&this.equidistantInterval?c*Math.pow(this.logarithmBase, this.interval):c+this.interval).toFixed(12))){for(;g n[g].endValue;g++);a=g =n[g].startValue&&c<=n[g].endValue;p=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:p,label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:fa(p,this.valueFormatString,this.chart._cultureInfo),a=new la(this.ctx,{x:0,y:0,maxWidth:f,maxHeight:l,angle:this.labelAngle,text:this.prefix+a+this.suffix,textAlign:this.labelTextAlign, backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:p,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType, this.interval),e=Va(new Date(this.viewportMaximum),this.interval,this.intervalType),g=q,c=this.intervalStartPosition;c n[g].endValue;g++);p=a;a=g =n[g].startValue&&a<=n[g].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(p),label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:Aa(p,this.valueFormatString,this.chart._cultureInfo), a=new la(this.ctx,{x:0,y:0,maxWidth:f,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:l,angle:this.labelAngle,text:this.prefix+a+this.suffix,textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:p,textBlock:a, effectiveHeight:null,breaksLabelType:void 0}))}if("bottom"===this._position||"top"===this._position)k=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.width*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))* T[this.intervalType+"Duration"]*this.interval,f="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(l="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);else if("left"===this._position||"right"===this._position)k=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.height*Math.log(Math.min(this._labels[this._labels.length-1].position/ this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.height/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*T[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(f="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),l="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>> 0:1.5*this.labelFontSize;for(b=0;b this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(f=0.9*k>>0,q=0,!this.chart.panEnabled&&1<= this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=f;this.sessionVariables.labelMaxHeight=l;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c q&&(v=c,q=p.width)}c=0;for(c=this.intervalStartPosition >0>2*f&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>f?-25:this.sessionVariables.labelAngle):r(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight= l,this.sessionVariables.labelMaxWidth=f,d&&B.width+d.width>>0>2*f&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=p)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>f?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=l,this.sessionVariables.labelWrap=this.labelWrap);else{if(r(this.options.labelWrap))if(!r(this.options.labelMaxWidth))this.options.labelMaxWidth >0,g=this.labelFontSize,q n&&(n=b-2*f,b>=2*f&&b<2.2*f?(this.sessionVariables.labelMaxWidth=f,r(this.options.labelFontSize)&&12 =2.2*f&&b<2.8*f?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=p,this.sessionVariables.labelFontSize=g):b>=2.8*f&&b<3.2*f?(this.sessionVariables.labelMaxWidth=Math.max(f,q),this.sessionVariables.labelWrap=!0,r(this.options.labelFontSize)&&12 =3.2*f&&b<3.6*f?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=p,this.sessionVariables.labelFontSize=this.labelFontSize):b>3.6*f&&b<5*f?(r(this.options.labelFontSize)&&12 5*f&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=f,this.sessionVariables.labelFontSize=g,this.sessionVariables.labelMaxHeight=l,this.sessionVariables.labelAngle=this.labelAngle));else if(v===c&&(0===v&&q+this._labels[v+1].textBlock.measureText().width-2*f>n||v===this._labels.length-1&&q+this._labels[v-1].textBlock.measureText().width-2*f>n||0 n&& q+this._labels[v-1].textBlock.measureText().width-2*f>n))n=0===v?q+this._labels[v+1].textBlock.measureText().width-2*f:q+this._labels[v-1].textBlock.measureText().width-2*f,this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?g:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=p;else if(0===n)for(this.sessionVariables.labelFontSize=r(this.options.labelFontSize)?g:this.options.labelFontSize,this.sessionVariables.labelWrap= !0,b=0;b >0>2*f&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?l:Math.min((b-f*Math.cos(Math.PI/ 180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),p=0!=this.labelAngle?(h-(m+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):f,this.sessionVariables.labelMaxHeight=l=this.labelWrap?(h-p*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,r(this.options.labelWrap))?r(this.options.labelWrap)&&(this.labelWrap&&!r(this.options.labelMaxWidth)? (this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:p,this.sessionVariables.labelMaxHeight=l):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=p,this.sessionVariables.labelMaxHeight=b<0.9*k?0.9*k:b,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth? this.options.labelMaxWidth:p):(r(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:p,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=l)}for(b=0;b >0:this.options.labelMaxWidth,l="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=f;this.sessionVariables.labelMaxHeight=l;this.sessionVariables.labelAngle=r(this.sessionVariables.labelAngle)? 0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c >0,k-2*l>q&&(q=k-2*l,k>=2*l&&k<2.4*l?(r(this.options.labelFontSize)&&12