h&&!m)m=!0;else if(b>h&&m)continue;t.dataPoints[B].label&&(a.axisX.labels[b]=t.dataPoints[B].label);bc.viewPortMax&&(c.viewPortMax=b);null===e?c.viewPortMin=== b&&nd.viewPortMax&&"number"===typeof e&&(d.viewPortMax=e))}}t.axisX.valueType=t.xValueType=f?"dateTime":"number"}};l.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,p=[],t=[],B=Infinity,k=-Infinity,m=0;m c.max&&(c.max=b);if(0 x&&(x=1/x);c.minDiff>x&&1!==x&&(c.minDiff= x)}else x=b-n.dataPoints[q-1].x,0>x&&(x*=-1),c.minDiff>x&&0!==x&&(c.minDiff=x);null!==e&&null!==n.dataPoints[q-1].y&&(a.axisY.logarithmic?0x&&(x=1/x),d.minDiff>x&&1!==x&&(d.minDiff=x)):(x=e-n.dataPoints[q-1].y,0>x&&(x*=-1),d.minDiff>x&&0!==x&&(d.minDiff=x)))}if(b u&&!r)r=!0;else if(b>u&&r)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&&gd.max&&(d.max=a),q c.viewPortMax||(a d.viewPortMax&&(d.viewPortMax=a)));for(q in t)t.hasOwnProperty(q)&&!isNaN(q)&&(a=t[q],a d.max&&(d.max=Math.max(a,k)),q c.viewPortMax||(a d.viewPortMax&&(d.viewPortMax=Math.max(a,k))))}};l.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,p=!1,t=!1,B=[],k=0;k c.max&&(c.max=b);if(0 u&&(u=1/u);c.minDiff>u&&1!==u&&(c.minDiff=u)}else u=b-m.dataPoints[n-1].x,0>u&&(u*=-1),c.minDiff>u&&0!==u&&(c.minDiff=u);s(e)||null===m.dataPoints[n-1].y|| (a.axisY.logarithmic?0 u&&(u=1/u),d.minDiff>u&&1!==u&&(d.minDiff=u)):(u=e-m.dataPoints[n-1].y,0>u&&(u*=-1),d.minDiff>u&&0!==u&&(d.minDiff=u)))}if(b l&&!h)h=!0;else if(b>l&&h)continue;m.dataPoints[n].label&&(a.axisX.labels[b]=m.dataPoints[n].label);b c.viewPortMax&&(c.viewPortMax=b);null===e?c.viewPortMin===b&&re&&(t=!0),B[b]=B[b]?B[b]+Math.abs(e):Math.abs(e))}}m.axisX.valueType=m.xValueType=f?"dateTime":"number"}a.axisY.logarithmic?(d.max=s(d.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(d.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),d.min=s(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):p&&!t?(d.max=s(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=s(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):p&& t?(d.max=s(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=s(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99)):!p&&t&&(d.max=s(d.viewPortMax)?-1:Math.max(d.viewPortMax,-1),d.min=s(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99));d.viewPortMin=d.min;d.viewPortMax=d.max;a.dataPointYSums=B}};l.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d=a.axisY.dataInfo,c=a.axisX.dataInfo,b,e,f,p,t=!1,B=0;B c.max&&(c.max=b);f d.max&&(d.max=p);0 r&&(r=1/r),c.minDiff>r&&1!==r&&(c.minDiff=r)):(r=b-k.dataPoints[m-1].x,0>r&&(r*=-1),c.minDiff>r&&0!==r&&(c.minDiff=r)),e&&(null!==e[0]&&k.dataPoints[m-1].y&&null!==k.dataPoints[m-1].y[0])&&(a.axisY.logarithmic?(r=e[0]/k.dataPoints[m-1].y[0],1>r&&(r=1/r),d.minDiff>r&&1!==r&&(d.minDiff=r)):(r=e[0]-k.dataPoints[m-1].y[0], 0>r&&(r*=-1),d.minDiff>r&&0!==r&&(d.minDiff=r))));if(!(b u&&!q)q=!0;else if(b>u&&q)continue;k.dataPoints[m].label&&(a.axisX.labels[b]=k.dataPoints[m].label);b c.viewPortMax&&(c.viewPortMax=b);if(c.viewPortMin===b&&e)for(x=0;x d.viewPortMax&&(d.viewPortMax=p))}}k.axisX.valueType= k.xValueType=t?"dateTime":"number"}};l.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,p=0;p c.max&&(c.max=b),t.dataPointEOs[B].cumulativeSum d.max&&(d.max=t.dataPointEOs[B].cumulativeSum),0n&&(n=1/n),c.minDiff>n&&1!==n&&(c.minDiff=n)):(n=b-t.dataPoints[B-1].x,0>n&&(n*=-1),c.minDiff>n&&0!==n&&(c.minDiff=n)),null!==e&&null!==t.dataPoints[B-1].y&&(a.axisY.logarithmic?(e=t.dataPointEOs[B].cumulativeSum/t.dataPointEOs[B-1].cumulativeSum,1>e&& (e=1/e),d.minDiff>e&&1!==e&&(d.minDiff=e)):(e=t.dataPointEOs[B].cumulativeSum-t.dataPointEOs[B-1].cumulativeSum,0>e&&(e*=-1),d.minDiff>e&&0!==e&&(d.minDiff=e)))),!(b h&&!m)m=!0;else if(b>h&&m)continue;t.dataPoints[B].label&&(a.axisX.labels[b]=t.dataPoints[B].label);bc.viewPortMax&&(c.viewPortMax=b);0d.viewPortMax&&(d.viewPortMax=t.dataPointEOs[B-1].cumulativeSum));t.dataPointEOs[B].cumulativeSum d.viewPortMax&&(d.viewPortMax=t.dataPointEOs[B].cumulativeSum)}t.axisX.valueType=t.xValueType=f?"dateTime":"number"}};l.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,h,k=f.min,p=f.max,m=d.min,n=d.max,f=f._dataRanges, d=d._dataRanges,q,t=0,B=0;B g.dataPoints.length))for(t=0;t f[q].max&&(f[q].max=h)),c){var l=(n+1-m)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((h="waterfall"=== a.type?g.dataPointEOs[t].cumulativeSum:g.dataPoints[t].y)&&h.length)for(var w=0;w d[q].max&&(d[q].max=h[w]);else s(h)||(q=Math.floor((h-m)/l),h d[q].max&&(d[q].max=h))}}}}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, h,k=0,p=0;p m.dataPoints.length))for(k=0;k f[h].max&&(f[h].max=b)}}for(var b,e=this,f=!1,p=0;p m[h].max&&(m[h].max=n)}delete this._axes[p].dataInfo.dataPointYPositiveSums}if(this._axes[p].dataInfo.dataPointYNegativeSums){q=this._axes[p].dataInfo.dataPointYNegativeSums;m=k;for(t in q)q.hasOwnProperty(t)&&!isNaN(t)&&(n=-1*q[t],s(n)||(h=Math.floor((n-B)/b),n m[h].max&&(m[h].max=n)));delete this._axes[p].dataInfo.dataPointYNegativeSums}for(t=0;t b&&f.push({diff:n,start:m,end:B});break}else t++;if(this._axes[p].scaleBreaks.customBreaks)for(t=0;t =e.x1&&(a<=e.x2&&d>=e.y1&&d<=e.y2)&&(b=e.id)}return b};l.prototype.getAutoFontSize=lb;l.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)}; l.prototype.clearCanvas=kb;l.prototype.attachEvent=function(a){this._events.push(a)};l.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(t){}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?(l.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){this.toolTip&&this.toolTip.enabled?(this.toolTip.hide(),this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip)):this.resetOverlayedCanvas();for(f=0;f c.maximum&&(f=c.viewportMaximum/c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum/f,c.sessionVariables.newViewportMaximum=c.viewportMaximum/f,p=!0):c.viewportMinimum c.maximum&&(f=c.viewportMaximum-c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum- f,c.sessionVariables.newViewportMaximum=c.viewportMaximum-f,p=!0);else if((!e||2 Math.abs(c)&&(this.panEnabled|| this.zoomEnabled)){this.toolTip.hide();this.toolTip&&this.toolTip.enabled&&this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip);for(var t=0;t h)var r=h,h=q,q=r;if(n.scaleBreaks)for(r=0;!f&&r =h;if(isFinite(n.dataInfo.minDiff))if(r= n.getApparentDifference(q,h,null,!0),!(f||!(this.panEnabled&&n.scaleBreaks&&n.scaleBreaks._appliedBreaks.length)&&(n.logarithmic&&r n.maximum))B.push(n),m.push({val1:q,val2:h}),t=!0;else if(!e){t=!1;break}}return{isValid:t,axesWithValidRange:B,axesRanges:m}};l.prototype.preparePlotArea=function(){var a=this.plotArea;!w&&(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;w||(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||m.point.y c.y2+1)continue}else if("rangearea"===n||"rangesplinearea"===n){if(m.dataPoint.x e.viewportMaximum||Math.max.apply(null,m.dataPoint.y) f.viewportMaximum)continue}else if(0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("bubble")||0<=n.indexOf("scatter")){if(m.dataPoint.x e.viewportMaximum||m.dataPoint.y f.viewportMaximum)continue}else if(0<=n.indexOf("column")||"waterfall"===n||"error"===n&&!m.axisSwapped){if(m.dataPoint.x e.viewportMaximum||m.bounds.y1>c.y2||m.bounds.y2 e.viewportMaximum||m.bounds.x1>c.x2||m.bounds.x2 e.viewportMaximum||Math.max.apply(null,m.dataPoint.y) f.viewportMaximum)continue}else if(m.dataPoint.x e.viewportMaximum)continue;p=t=2;"horizontal"===C?(B=g.width,k=g.height):(k=g.width,B=g.height);if("normal"===this.plotInfo.axisPlacement){if(0<=n.indexOf("line")||0<=n.indexOf("area"))A="auto",t=4;else if(0<=n.indexOf("stacked"))"auto"===A&&(A="inside");else if("bubble"===n||"scatter"===n)A="inside";q=m.point.x-("horizontal"===C?B/2:B/2-r/2);"inside"!==A?(e=c.y1,f=c.y2,0 m.point.y)):(h=m.point.y+ r/2+t+b,h>f-k&&(h="auto"===A?Math.min(m.point.y,f)+r/2-k-t:f+r/2-k,y=h f-k-t&&("bubble"===n||"scatter"=== n)&&(h=Math.min(m.point.y+t,c.y2-k-t))),h=Math.min(h,f))}else 0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("scatter")?(A="auto",p=4):0<=n.indexOf("stacked")?"auto"===A&&(A="inside"):"bubble"===n&&(A="inside"),h=m.point.y+r/2-k/2+t,"inside"!==A?(e=c.x1,f=c.x2,0>v?(q=m.point.x-("horizontal"===C?B:B-r/2)-p-b,q m.point.x)):(q=m.point.x+("horizontal"===C?0:r/2)+p+b,q>f-B-p-b&&(q="auto"===A?Math.min(m.point.x,f)-("horizontal"===C?B:B/2)-p:f- B-p,y=q v?Math.max(m.bounds.x1,c.x1)+r/2+p:Math.min(m.bounds.x2,c.x2)-B/2-p+("horizontal"===C?0:r/2):(Math.max(m.bounds.x1,c.x1)+Math.min(m.bounds.x2,c.x2))/2+("horizontal"===C?0:r/2),q=0>v?Math.max(m.point.x,b)-("horizontal"===C?B/2:0):Math.min(m.point.x,b)-B/2,q=Math.max(q,e));"vertical"===C&&(h+=k-r/2);g.x=q;g.y=h;g.render(!0);x&&("inside"!==A&&(0>n.indexOf("bar")&&("error"!==n||!m.axisSwapped)&& m.point.x>c.x1&&m.point.x n.indexOf("column")&&("error"!==n||m.axisSwapped)&&m.point.y>c.y1&&m.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=[],p,t=0;t a.axisX.dataInfo.viewPortMax&&(!k.connectNullData|| !C)))if("number"!==typeof m[u].y)0m[u].y===a.axisY.reversed?1:-1,color:r})}c.stroke();w&&b.stroke()}}V.drawMarkers(f);w&& (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:K.xClipAnimation, easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?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=[],p,t=0;t a.axisX.dataInfo.viewPortMax&& (!k.connectNullData||!C)))if("number"!==typeof m[u].y)0 m[u].y===a.axisY.reversed?1:-1,color:r})}c.stroke();w&&b.stroke()}}V.drawMarkers(f);w&&(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:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};l.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 p=[],t=0;t a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!x)))if("number"!==typeof m[l].y)0 m[l].y===a.axisY.reversed?1:-1,color:r});x=!1}d(s)}V.drawMarkers(p); w&&(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:K.xClipAnimation, easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=0,p,t,B,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=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,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>m&&(f=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&& m m&&(n=m);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(m=0;m a.axisX.dataInfo.viewPortMax)&&"number"===typeof r[f].y){p=a.axisX.convertValueToPixel(B);t=a.axisY.convertValueToPixel(r[f].y);p=a.axisX.reversed?p+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+m)*n<<0:p-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+m)*n<<0;var l=a.axisX.reversed?p-n<<0:p+n<<0,u;0<=r[f].y?u=k:(u=t,t=k);t>u&&(b=t,t=u,u=b);b=r[f].color?r[f].color:h._colorSet[f%h._colorSet.length]; ca(c,p,t,l,u,b,0,null,g&&0<=r[f].y,0>r[f].y&&g,!1,!1,h.fillOpacity);b=h.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:f,x1:p,y1:t,x2:l,y2:u};b=P(b);w&&ca(this._eventManager.ghostCtx,p,t,l,u,b,0,null,!1,!1,!1,!1);(r[f].indexLabel||h.indexLabel||r[f].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:r[f],dataSeries:h,point:{x:p+(l-p)/2,y:0>r[f].y===a.axisY.reversed?t:u},direction:0>r[f].y=== a.axisY.reversed?1:-1,bounds:{x1:p,y1:Math.min(t,u),x2:l,y2:Math.max(t,u)},color:b})}}w&&(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:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:k a.axisY.bounds.y2?a.axisY.bounds.y2:k}}};l.prototype.renderStackedColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],p=[],t=[],B=[],k=0,m,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k= this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;m=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;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.plotUnits.length)<<0;this.dataPointMaxWidth&& k>m&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m m&&(h=m);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var r=0;r a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){m=a.axisX.convertValueToPixel(b);var s=m-a.plotType.plotUnits.length*h/2+a.index*h<<0,C=s+h<<0,D;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =u[k].y)B[b]=u[k].y+(B[b]?B[b]:0),D=a.axisY.convertValueToPixel(B[b]),n="undefined"!==typeof p[b]?p[b]:q,p[b]=D;else if(n=a.axisY.convertValueToPixel(u[k].y),0<=u[k].y){var z="undefined"!==typeof f[b]?f[b]:0;n-=z;D=q-z;f[b]=z+(D-n)}else z=p[b]?p[b]:0,D=n+z,n=q+z,p[b]=z+(D-n);b=u[k].color?u[k].color:l._colorSet[k%l._colorSet.length]; ca(c,s,n,C,D,b,0,null,x&&0<=u[k].y,0>u[k].y&&x,!1,!1,l.fillOpacity);b=l.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:k,x1:s,y1:n,x2:C,y2:D};b=P(b);w&&ca(this._eventManager.ghostCtx,s,n,C,D,b,0,null,!1,!1,!1,!1);(u[k].indexLabel||l.indexLabel||u[k].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:u[k],dataSeries:l,point:{x:m,y:0<=u[k].y?n:D},direction:0>u[k].y===a.axisY.reversed? 1:-1,bounds:{x1:s,y1:Math.min(n,D),x2:C,y2:Math.max(n,D)},color:b})}}}w&&(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:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};l.prototype.renderStackedColumn100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],p=[],t=[],B=[],k=0,m,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0), k=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;m=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;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.plotUnits.length)<<0;this.dataPointMaxWidth&& k>m&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m m&&(h=m);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var r=0;r a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){m=a.axisX.convertValueToPixel(b);n=0!==a.dataPointYSums[b]?100*(u[k].y/a.dataPointYSums[b]):0;var s=m-a.plotType.plotUnits.length*h/2+a.index*h<<0,C=s+h<<0,D;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =t[b])continue;n=a.axisY.convertValueToPixel(t[b]);D=f[b]?f[b]:q;f[b]=n}else if(a.axisY.scaleBreaks&&0 =u[k].y)B[b]=n+("undefined"!==typeof B[b]?B[b]:0),D=a.axisY.convertValueToPixel(B[b]),n=p[b]?p[b]:q,p[b]=D;else if(n=a.axisY.convertValueToPixel(n),0<=u[k].y){var z="undefined"!==typeof f[b]?f[b]:0;n-=z;D=q-z;a.dataSeriesIndexes.length-1===r&&1>=Math.abs(e.y1-n)&&(n=e.y1);f[b]=z+(D-n)}else z="undefined"!== typeof p[b]?p[b]:0,D=n+z,n=q+z,a.dataSeriesIndexes.length-1===r&&1>=Math.abs(e.y2-D)&&(D=e.y2),p[b]=z+(D-n);b=u[k].color?u[k].color:l._colorSet[k%l._colorSet.length];ca(c,s,n,C,D,b,0,null,x&&0<=u[k].y,0>u[k].y&&x,!1,!1,l.fillOpacity);b=l.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:k,x1:s,y1:n,x2:C,y2:D};b=P(b);w&&ca(this._eventManager.ghostCtx,s,n,C,D,b,0,null,!1,!1,!1,!1);(u[k].indexLabel||l.indexLabel||u[k].indexLabelFormatter||l.indexLabelFormatter)&& this._indexLabels.push({chartType:"stackedColumn100",dataPoint:u[k],dataSeries:l,point:{x:m,y:0<=u[k].y?n:D},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:s,y1:Math.min(n,D),x2:C,y2:Math.max(n,D)},color:b})}}w&&(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:K.yScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};l.prototype.renderBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b= null,e=this.plotArea,f=0,p,t,B,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=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.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>m&&(f=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m m&&(n=m);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height); c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(m=0;m a.axisX.dataInfo.viewPortMax)&&"number"===typeof r[f].y){t=a.axisX.convertValueToPixel(B); p=a.axisY.convertValueToPixel(r[f].y);t=a.axisX.reversed?t+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+m)*n<<0:t-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+m)*n<<0;var l=a.axisX.reversed?t-n<<0:t+n<<0,u;0<=r[f].y?u=k:(u=p,p=k);b=r[f].color?r[f].color:h._colorSet[f%h._colorSet.length];ca(c,u,t,p,l,b,0,null,g,!1,!1,!1,h.fillOpacity);b=h.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:f,x1:u,y1:t,x2:p,y2:l};b= P(b);w&&ca(this._eventManager.ghostCtx,u,t,p,l,b,0,null,!1,!1,!1,!1);(r[f].indexLabel||h.indexLabel||r[f].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:r[f],dataSeries:h,point:{x:0<=r[f].y?p:u,y:t+(l-t)/2},direction:0>r[f].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,p),y1:t,x2:Math.max(u,p),y2:l},color:b})}}}w&&(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:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:k a.axisY.bounds.x2?a.axisY.bounds.x2: k}}};l.prototype.renderStackedBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],p=[],t=[],B=[],k=0,m,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=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 h=a.axisX.dataInfo.minDiff;isFinite(h)||(h=0.3*Math.abs(a.axisX.range));h=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(h)/Math.log(a.axisX.range):Math.abs(h)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>n&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n n&&(h=n);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var r=0;r a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){n=a.axisX.convertValueToPixel(b);var s=n-a.plotType.plotUnits.length*h/2+a.index*h<<0,C=s+h<<0,D;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =u[k].y)B[b]=u[k].y+(B[b]?B[b]:0),m=p[b]? p[b]:q,p[b]=D=a.axisY.convertValueToPixel(B[b]);else if(m=a.axisY.convertValueToPixel(u[k].y),0<=u[k].y){var z=f[b]?f[b]:0;D=q+z;m+=z;f[b]=z+(m-D)}else z=p[b]?p[b]:0,D=m-z,m=q-z,p[b]=z+(m-D);b=u[k].color?u[k].color:l._colorSet[k%l._colorSet.length];ca(c,D,s,m,C,b,0,null,x,!1,!1,!1,l.fillOpacity);b=l.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:k,x1:D,y1:s,x2:m,y2:C};b=P(b);w&&ca(this._eventManager.ghostCtx,D,s,m,C,b,0,null,!1,!1,!1, !1);(u[k].indexLabel||l.indexLabel||u[k].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:u[k],dataSeries:l,point:{x:0<=u[k].y?m:D,y:n},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(D,m),y1:s,x2:Math.max(D,m),y2:C},color:b})}}}w&&(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:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};l.prototype.renderStackedBar100=function(a){var d= a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=[],p=[],t=[],B=[],k=0,m,n,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=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 h=a.axisX.dataInfo.minDiff;isFinite(h)|| (h=0.3*Math.abs(a.axisX.range));h=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(h)/Math.log(a.axisX.range):Math.abs(h)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>n&&(k=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n n&&(h=n);c.save();w&&this._eventManager.ghostCtx.save(); c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var r=0;r a.axisX.dataInfo.viewPortMax)&& "number"===typeof u[k].y){n=a.axisX.convertValueToPixel(b);var A;A=0!==a.dataPointYSums[b]?100*(u[k].y/a.dataPointYSums[b]):0;var C=n-a.plotType.plotUnits.length*h/2+a.index*h<<0,D=C+h<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =t[b])continue;A=f[b]?f[b]:q;f[b]=m=a.axisY.convertValueToPixel(t[b])}else if(a.axisY.scaleBreaks&&0 =u[k].y)B[b]=A+(B[b]?B[b]:0),m=p[b]?p[b]: q,p[b]=A=a.axisY.convertValueToPixel(B[b]);else if(m=a.axisY.convertValueToPixel(A),0<=u[k].y){var z=f[b]?f[b]:0;A=q+z;m+=z;a.dataSeriesIndexes.length-1===r&&1>=Math.abs(e.x2-m)&&(m=e.x2);f[b]=z+(m-A)}else z=p[b]?p[b]:0,A=m-z,m=q-z,a.dataSeriesIndexes.length-1===r&&1>=Math.abs(e.x1-A)&&(A=e.x1),p[b]=z+(m-A);b=u[k].color?u[k].color:l._colorSet[k%l._colorSet.length];ca(c,A,C,m,D,b,0,null,s,!1,!1,!1,l.fillOpacity);b=l.dataPointIds[k];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:g, dataPointIndex:k,x1:A,y1:C,x2:m,y2:D};b=P(b);w&&ca(this._eventManager.ghostCtx,A,C,m,D,b,0,null,!1,!1,!1,!1);(u[k].indexLabel||l.indexLabel||u[k].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:u[k],dataSeries:l,point:{x:0<=u[k].y?m:A,y:n},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(A,m),y1:C,x2:Math.max(A,m),y2:D},color:b})}}}w&&(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:K.xScaleAnimation,easingFunction:K.easing.easeOutQuart,animationBase:q a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};l.prototype.renderArea=function(a){var d,c;function b(){D&&(0 =a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?C=A:0>a.axisY.viewportMaximum?C=t.y1:0 =a.dataSeriesIndexes.length)){var p=this._eventManager.ghostCtx,t=a.axisY.lineCoordinates,B=[],k=this.plotArea,m;f.save();w&&p.save();f.beginPath();f.rect(k.x1,k.y1,k.width,k.height);f.clip();w&&(p.beginPath(),p.rect(k.x1,k.y1,k.width,k.height),p.clip());for(var n=0;n a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!ja)))if("number"!==typeof r[g].y)h.connectNullData||(ja||d)||b(),ja=!0;else{l=a.axisX.convertValueToPixel(s);u=a.axisY.convertValueToPixel(r[g].y);d||ja?(!d&&h.connectNullData?(f.setLineDash&&(h.options.nullDataLineDashType||c===h.lineDashType&&h.lineDashType!==h.nullDataLineDashType)&&(d=l,c=u,l=m.x,u=m.y,b(),f.moveTo(m.x,m.y),l=d,u=c,D=m,c=h.nullDataLineDashType,f.setLineDash(Q)),f.lineTo(l,u),w&&p.lineTo(l,u)): (f.beginPath(),f.moveTo(l,u),w&&(p.beginPath(),p.moveTo(l,u)),D={x:l,y:u}),ja=d=!1):(f.lineTo(l,u),w&&p.lineTo(l,u),0==g%250&&b());m={x:l,y:u};g r[g].y===a.axisY.reversed?1:-1,color:z})}b();V.drawMarkers(B)}}w&&(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(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());f.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear, animationBase:0}}};l.prototype.renderSplineArea=function(a){function d(){var c=v(s,2);if(0 =a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum? l=g:0>a.axisY.viewportMaximum?l=f.y1:0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,f=a.axisY.lineCoordinates,p=[],t=this.plotArea;b.save();w&&e.save();b.beginPath();b.rect(t.x1, t.y1,t.width,t.height);b.clip();w&&(e.beginPath(),e.rect(t.x1,t.y1,t.width,t.height),e.clip());for(var B=0;B a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!r)))if("number"!==typeof n[q].y)0 n[q].y===a.axisY.reversed?1:-1,color:A});r=!1}d();V.drawMarkers(p)}}w&&(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(t.x1,t.y1,t.width,t.height),this._eventManager.ghostCtx.restore()); b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderStepArea=function(a){var d,c;function b(){D&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?C=A:0>a.axisY.viewportMaximum?C=t.y1:0 =a.dataSeriesIndexes.length)){var p=this._eventManager.ghostCtx,t=a.axisY.lineCoordinates,B=[],k=this.plotArea,m;f.save();w&&p.save();f.beginPath();f.rect(k.x1,k.y1,k.width,k.height);f.clip();w&&(p.beginPath(),p.rect(k.x1,k.y1,k.width,k.height),p.clip());for(var n=0;n a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!c))){var Y=u;"number"!==typeof r[g].y?(h.connectNullData||(c||d)||b(),c=!0):(l=a.axisX.convertValueToPixel(s),u=a.axisY.convertValueToPixel(r[g].y),d||c?(!d&&h.connectNullData?(f.setLineDash&&(h.options.nullDataLineDashType||Q===h.lineDashType&&h.lineDashType!==h.nullDataLineDashType)&&(d=l,c=u,l=m.x,u=m.y,b(), f.moveTo(m.x,m.y),l=d,u=c,D=m,Q=h.nullDataLineDashType,f.setLineDash(aa)),f.lineTo(l,Y),f.lineTo(l,u),w&&(p.lineTo(l,Y),p.lineTo(l,u))):(f.beginPath(),f.moveTo(l,u),w&&(p.beginPath(),p.moveTo(l,u)),D={x:l,y:u}),c=d=!1):(f.lineTo(l,Y),w&&p.lineTo(l,Y),f.lineTo(l,u),w&&p.lineTo(l,u),0==g%250&&b()),m={x:l,y:u},g r[g].y===a.axisY.reversed?1:-1,color:z}))}b();V.drawMarkers(B)}}w&&(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(k.x1, k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());f.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderStackedArea=function(a){function d(){if(!(1>k.length)){for(0 =a.dataSeriesIndexes.length)){var e=null,f=null,p=[],t=this.plotArea,g=[],k=[],m=[],n=[],q=0,h,r,l=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),s=this._eventManager.ghostCtx,u,x,A;w&&s.beginPath();b.save();w&&s.save();b.beginPath();b.rect(t.x1,t.y1,t.width,t.height);b.clip();w&&(s.beginPath(),s.rect(t.x1,t.y1,t.width,t.height),s.clip());for(var e=[],C=0;C a.axisX.dataInfo.viewPortMax&&(!z.connectNullData||!Y)))if("number"!==typeof fa.y)z.connectNullData||(Y||x)||d(),Y=!0;else{h=a.axisX.convertValueToPixel(f);var ma=g[f]?g[f]:0;if(a.axisY.logarithmic|| a.axisY.scaleBreaks&&0 =n[f]&&a.axisY.logarithmic)continue;r=a.axisY.convertValueToPixel(n[f])}else r=a.axisY.convertValueToPixel(fa.y),r-=ma;k.push({x:h,y:l-ma});g[f]=l-r;x||Y?(!x&&z.connectNullData?(b.setLineDash&&(z.options.nullDataLineDashType||A===z.lineDashType&&z.lineDashType!==z.nullDataLineDashType)&&(x=k.pop(),A=k[k.length-1],d(),b.moveTo(u.x,u.y),k.push(A),k.push(x),A=z.nullDataLineDashType,b.setLineDash(aa)),b.lineTo(h, r),w&&s.lineTo(h,r)):(b.beginPath(),b.moveTo(h,r),w&&(s.beginPath(),s.moveTo(h,r))),Y=x=!1):(b.lineTo(h,r),w&&s.lineTo(h,r),0==q%250&&(d(),b.moveTo(h,r),w&&s.moveTo(h,r),k.push({x:h,y:l-ma})));u={x:h,y:r};q v[q].y===a.axisY.reversed?1:-1,color:e})}}d();b.moveTo(h,r);w&&s.moveTo(h,r)}delete z.dataPointIndexes}V.drawMarkers(p);w&&(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(t.x1,t.y1,t.width,t.height),s.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderStackedArea100=function(a){function d(){for(0 =a.dataSeriesIndexes.length)){var e=null,f=null,p=this.plotArea,t=[],g=[],k=[],m=[],n=[],q=0,h,r,l,s,u,x=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),A=this._eventManager.ghostCtx;b.save();w&&A.save();b.beginPath();b.rect(p.x1,p.y1,p.width,p.height);b.clip();w&&(A.beginPath(),A.rect(p.x1,p.y1,p.width,p.height),A.clip()); for(var e=[],C=0;C a.axisX.dataInfo.viewPortMax&&(!z.connectNullData||!Y)))if("number"!==typeof fa.y)z.connectNullData|| (Y||s)||d(),Y=!0;else{var ma;ma=0!==a.dataPointYSums[f]?100*(fa.y/a.dataPointYSums[f]):0;h=a.axisX.convertValueToPixel(f);var ba=g[f]?g[f]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0 =n[f]&&a.axisY.logarithmic)continue;r=a.axisY.convertValueToPixel(n[f])}else r=a.axisY.convertValueToPixel(ma),r-=ba;k.push({x:h,y:x-ba});g[f]=x-r;s||Y?(!s&&z.connectNullData?(b.setLineDash&&(z.options.nullDataLineDashType||u===z.lineDashType&& z.lineDashType!==z.nullDataLineDashType)&&(s=k.pop(),u=k[k.length-1],d(),b.moveTo(l.x,l.y),k.push(u),k.push(s),u=z.nullDataLineDashType,b.setLineDash(aa)),b.lineTo(h,r),w&&A.lineTo(h,r)):(b.beginPath(),b.moveTo(h,r),w&&(A.beginPath(),A.moveTo(h,r))),Y=s=!1):(b.lineTo(h,r),w&&A.lineTo(h,r),0==q%250&&(d(),b.moveTo(h,r),w&&A.moveTo(h,r),k.push({x:h,y:x-ba})));l={x:h,y:r};q y[q].y===a.axisY.reversed?1:-1,color:e})}}d();b.moveTo(h,r);w&&A.moveTo(h,r)}delete z.dataPointIndexes}V.drawMarkers(t);w&&(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(p.x1,p.y1,p.width,p.height),A.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderBubble=function(a){var d= a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,e=0,f,p;c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var t=-Infinity,g=Infinity,k=0;k a.axisX.dataInfo.viewPortMax||"undefined"===typeof q[e].z||(h=q[e].z,h>t&&(t=h),h a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[e].y){f=a.axisX.convertValueToPixel(f);p=a.axisY.convertValueToPixel(q[e].y);var h=q[e].z,s=2*Math.max(Math.sqrt((t===g?l/2:r+(l-r)/(t-g)*(h-g))/Math.PI)<<0,1),h=n.getMarkerProperties(e,c);h.size=s;c.globalAlpha=n.fillOpacity;V.drawMarker(f,p,c,h.type,h.size,h.color,h.borderColor,h.borderThickness);c.globalAlpha=1;var u=n.dataPointIds[e];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:e,x1:f,y1:p,size:s}; s=P(u);w&&V.drawMarker(f,p,this._eventManager.ghostCtx,h.type,h.size,s,s,h.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:p},direction:1,bounds:{x1:f-h.size/2,y1:p-h.size/2,x2:f+h.size/2,y2:p+h.size/2},color:null})}w&&(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:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};l.prototype.renderScatter=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx, c=w?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,e=0,f,p;c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var t=0;t a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[e].y){f=a.axisX.convertValueToPixel(f);p=a.axisY.convertValueToPixel(m[e].y);var h=k.getMarkerProperties(e,f,p,c);c.globalAlpha=k.fillOpacity;V.drawMarker(h.x,h.y,h.ctx,h.type,h.size,h.color,h.borderColor,h.borderThickness);c.globalAlpha=1;Math.sqrt((n-f)*(n-f)+(q-p)*(q-p)) Math.min(this.plotArea.width, this.plotArea.height)||(n=k.dataPointIds[e],this._eventManager.objectMap[n]={id:n,objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:e,x1:f,y1:p},n=P(n),w&&V.drawMarker(h.x,h.y,this._eventManager.ghostCtx,h.type,h.size,n,n,h.borderThickness),(m[e].indexLabel||k.indexLabel||m[e].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:m[e],dataSeries:k,point:{x:f,y:p},direction:1,bounds:{x1:f-h.size/2,y1:p-h.size/2,x2:f+h.size/2,y2:p+h.size/2},color:null}), n=f,q=p)}}}w&&(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:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};l.prototype.renderCandlestick=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,f=null,p=this.plotArea,t=0,g,k,m,n,q,h,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,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.7*p.width*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/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&&(r=f);c.save();w&&b.save();c.beginPath();c.rect(p.x1,p.y1,p.width,p.height);c.clip();w&&(b.beginPath(),b.rect(p.x1,p.y1,p.width,p.height),b.clip());for(var l=0;l a.axisX.dataInfo.viewPortMax)&&!s(x[t].y)&&x[t].y.length&&"number"===typeof x[t].y[0]&& "number"===typeof x[t].y[1]&&"number"===typeof x[t].y[2]&&"number"===typeof x[t].y[3]){g=a.axisX.convertValueToPixel(h);k=a.axisY.convertValueToPixel(x[t].y[0]);m=a.axisY.convertValueToPixel(x[t].y[1]);n=a.axisY.convertValueToPixel(x[t].y[2]);q=a.axisY.convertValueToPixel(x[t].y[3]);var C=g-r/2<<0,D=C+r<<0,f=u.options.fallingColor?u.fallingColor:u._colorSet[0],e=x[t].color?x[t].color:u._colorSet[0],z=Math.round(Math.max(1,0.15*r)),y=0===z%2?0:0.5,E=u.dataPointIds[t];this._eventManager.objectMap[E]= {id:E,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:t,x1:C,y1:k,x2:D,y2:m,x3:g,y3:n,x4:g,y4:q,borderThickness:z,color:e};c.strokeStyle=e;c.beginPath();c.lineWidth=z;b.lineWidth=Math.max(z,4);"candlestick"===u.type?(c.moveTo(g-y,m),c.lineTo(g-y,Math.min(k,q)),c.stroke(),c.moveTo(g-y,Math.max(k,q)),c.lineTo(g-y,n),c.stroke(),ca(c,C,Math.min(k,q),D,Math.max(k,q),x[t].y[0]<=x[t].y[3]?u.risingColor:f,z,e,A,A,!1,!1,u.fillOpacity),w&&(e=P(E),b.strokeStyle=e,b.moveTo(g-y,m),b.lineTo(g-y,Math.min(k, q)),b.stroke(),b.moveTo(g-y,Math.max(k,q)),b.lineTo(g-y,n),b.stroke(),ca(b,C,Math.min(k,q),D,Math.max(k,q),e,0,null,!1,!1,!1,!1))):"ohlc"===u.type&&(c.moveTo(g-y,m),c.lineTo(g-y,n),c.stroke(),c.beginPath(),c.moveTo(g,k),c.lineTo(C,k),c.stroke(),c.beginPath(),c.moveTo(g,q),c.lineTo(D,q),c.stroke(),w&&(e=P(E),b.strokeStyle=e,b.moveTo(g-y,m),b.lineTo(g-y,n),b.stroke(),b.beginPath(),b.moveTo(g,k),b.lineTo(C,k),b.stroke(),b.beginPath(),b.moveTo(g,q),b.lineTo(D,q),b.stroke()));(x[t].indexLabel||u.indexLabel|| x[t].indexLabelFormatter||u.indexLabelFormatter)&&this._indexLabels.push({chartType:u.type,dataPoint:x[t],dataSeries:u,point:{x:C+(D-C)/2,y:a.axisY.reversed?n:m},direction:1,bounds:{x1:C,y1:Math.min(m,n),x2:D,y2:Math.max(m,n)},color:e})}}w&&(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(p.x1,p.y1,p.width,p.height),b.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};l.prototype.renderBoxAndWhisker=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx:d,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,f=this.plotArea, p=0,t,g,k,m,n,q,h,e=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,p=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.7*f.width*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e> p&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&p p&&(r=p);c.save();w&&b.save();c.beginPath();c.rect(f.x1,f.y1,f.width,f.height);c.clip();w&&(b.beginPath(),b.rect(f.x1,f.y1,f.width,f.height),b.clip());for(var l=!1,l=!!a.axisY.reversed,v=0;v a.axisX.dataInfo.viewPortMax)&&!s(A[p].y)&&A[p].y.length&&"number"===typeof A[p].y[0]&&"number"===typeof A[p].y[1]&&"number"===typeof A[p].y[2]&&"number"===typeof A[p].y[3]&&"number"===typeof A[p].y[4]&&5===A[p].y.length){t=a.axisX.convertValueToPixel(h);g=a.axisY.convertValueToPixel(A[p].y[0]);k=a.axisY.convertValueToPixel(A[p].y[1]);m=a.axisY.convertValueToPixel(A[p].y[2]); n=a.axisY.convertValueToPixel(A[p].y[3]);q=a.axisY.convertValueToPixel(A[p].y[4]);var D=t-r/2<<0,z=t+r/2<<0,e=A[p].color?A[p].color:x._colorSet[0],y=Math.round(Math.max(1,0.15*r)),E=0===y%2?0:0.5,Q=A[p].whiskerColor?A[p].whiskerColor:A[p].color?x.whiskerColor?x.whiskerColor:A[p].color:x.whiskerColor?x.whiskerColor:e,aa="number"===typeof A[p].whiskerThickness?A[p].whiskerThickness:"number"===typeof x.options.whiskerThickness?x.whiskerThickness:y,F=A[p].whiskerDashType?A[p].whiskerDashType:x.whiskerDashType, Y=s(A[p].whiskerLength)?s(x.options.whiskerLength)?r:x.whiskerLength:A[p].whiskerLength,Y="number"===typeof Y?0>=Y?0:Y>=r?r:Y:"string"===typeof Y?parseInt(Y)*r/100>r?r:parseInt(Y)*r/100:r,fa=1===Math.round(aa)%2?0.5:0,ma=A[p].stemColor?A[p].stemColor:A[p].color?x.stemColor?x.stemColor:A[p].color:x.stemColor?x.stemColor:e,ba="number"===typeof A[p].stemThickness?A[p].stemThickness:"number"===typeof x.options.stemThickness?x.stemThickness:y,G=1===Math.round(ba)%2?0.5:0,J=A[p].stemDashType?A[p].stemDashType: x.stemDashType,H=A[p].lineColor?A[p].lineColor:A[p].color?x.lineColor?x.lineColor:A[p].color:x.lineColor?x.lineColor:e,M="number"===typeof A[p].lineThickness?A[p].lineThickness:"number"===typeof x.options.lineThickness?x.lineThickness:y,S=A[p].lineDashType?A[p].lineDashType:x.lineDashType,L=1===Math.round(M)%2?0.5:0,R=x.upperBoxColor,xa=x.lowerBoxColor,sa=s(x.options.fillOpacity)?1:x.fillOpacity,O=x.dataPointIds[p];this._eventManager.objectMap[O]={id:O,objectType:"dataPoint",dataSeriesIndex:u,dataPointIndex:p, x1:D,y1:g,x2:z,y2:k,x3:t,y3:m,x4:t,y4:n,y5:q,borderThickness:y,color:e,stemThickness:ba,stemColor:ma,whiskerThickness:aa,whiskerLength:Y,whiskerColor:Q,lineThickness:M,lineColor:H};c.save();0 =a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=0,p,t,g,f=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth: 1;p=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.03*this.width;var k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range):Math.abs(k)/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&&(k=p);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var m=0;m a.axisX.dataInfo.viewPortMax)&&!s(h[f].y)&&h[f].y.length&&"number"===typeof h[f].y[0]&&"number"===typeof h[f].y[1]){b=a.axisX.convertValueToPixel(g);p=a.axisY.convertValueToPixel(h[f].y[0]);t=a.axisY.convertValueToPixel(h[f].y[1]);var l=a.axisX.reversed?b+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+m)*k<<0:b-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+ m)*k<<0,v=a.axisX.reversed?l-k<<0:l+k<<0,b=h[f].color?h[f].color:q._colorSet[f%q._colorSet.length];if(p>t){var u=p;p=t;t=u}u=q.dataPointIds[f];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:l,y1:p,x2:v,y2:t};ca(c,l,p,v,t,b,0,b,r,r,!1,!1,q.fillOpacity);b=P(u);w&&ca(this._eventManager.ghostCtx,l,p,v,t,b,0,null,!1,!1,!1,!1);if(h[f].indexLabel||q.indexLabel||h[f].indexLabelFormatter||q.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn", dataPoint:h[f],dataSeries:q,indexKeyword:0,point:{x:l+(v-l)/2,y:h[f].y[1]>=h[f].y[0]?t:p},direction:h[f].y[1]>=h[f].y[0]?-1:1,bounds:{x1:l,y1:Math.min(p,t),x2:v,y2:Math.max(p,t)},color:b}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:h[f],dataSeries:q,indexKeyword:1,point:{x:l+(v-l)/2,y:h[f].y[1]>=h[f].y[0]?p:t},direction:h[f].y[1]>=h[f].y[0]?1:-1,bounds:{x1:l,y1:Math.min(p,t),x2:v,y2:Math.max(p,t)},color:b})}}w&&(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:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};l.prototype.renderError= function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?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,p=this.plotArea,t=0,g,k,m,n,q,h,r,l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(p.x1,p.y1,p.width,p.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(p.x1, p.y1,p.width,p.height),this._eventManager.ghostCtx.clip());for(var v=0,u=0;u t&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,t));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&t t&&(u=t);if(0 =Q.length?0:Q.length>=u?u:Q.length:"string"===typeof Q.length?parseInt(Q.length)*u/100>u?u:parseInt(Q.length)*u/100>u:u;Q.thickness="number"===typeof Q.thickness?0>Q.thickness?0:Math.round(Q.thickness):2;var aa={color:D[t].stemColor?D[t].stemColor:D[t].color?C.stemColor?C.stemColor:D[t].color:C.stemColor?C.stemColor:e,thickness:D[t].stemThickness?D[t].stemThickness:C.stemThickness,dashType:D[t].stemDashType? D[t].stemDashType:C.stemDashType};aa.thickness="number"===typeof aa.thickness?0>aa.thickness?0:Math.round(aa.thickness):2;D[t].getTime?r=D[t].x.getTime():r=D[t].x;if(!(r a.axisX.dataInfo.viewPortMax)&&!s(D[t].y)&&D[t].y.length&&"number"===typeof D[t].y[0]&&"number"===typeof D[t].y[1]){var ja=a.axisX.convertValueToPixel(r);b?k=ja:g=ja;ja=a.axisY.convertValueToPixel(D[t].y[0]);b?m=ja:q=ja;ja=a.axisY.convertValueToPixel(D[t].y[1]);b?n=ja:h=ja;b?(q=a.axisX.reversed?k+(z? v:1)*u/2-(z?E-1:0)*u<<0:k-(z?v:1)*u/2+(z?E-1:0)*u<<0,h=a.axisX.reversed?q-u<<0:q+u<<0):(m=a.axisX.reversed?g+(z?v:1)*u/2-(z?E-1:0)*u<<0:g-(z?v:1)*u/2+(z?E-1:0)*u<<0,n=a.axisX.reversed?m-u<<0:m+u<<0);!b&&q>h&&(ja=q,q=h,h=ja);b&&m>n&&(ja=m,m=n,n=ja);ja=C.dataPointIds[t];this._eventManager.objectMap[ja]={id:ja,objectType:"dataPoint",dataSeriesIndex:A,dataPointIndex:t,x1:Math.min(m,n),y1:Math.min(q,h),x2:Math.max(n,m),y2:Math.max(h,q),isXYSwapped:b,stemProperties:aa,whiskerProperties:Q};y(c,Math.min(m, n),Math.min(q,h),Math.max(n,m),Math.max(h,q),e,Q,aa,b);w&&y(this._eventManager.ghostCtx,m,q,n,h,e,Q,aa,b);if(D[t].indexLabel||C.indexLabel||D[t].indexLabelFormatter||C.indexLabelFormatter)this._indexLabels.push({chartType:"error",dataPoint:D[t],dataSeries:C,indexKeyword:0,point:{x:b?D[t].y[1]>=D[t].y[0]?m:n:m+(n-m)/2,y:b?q+(h-q)/2:D[t].y[1]>=D[t].y[0]?h:q},direction:D[t].y[1]>=D[t].y[0]?-1:1,bounds:{x1:b?Math.min(m,n):m,y1:b?q:Math.min(q,h),x2:b?Math.max(m,n):n,y2:b?h:Math.max(q,h)},color:e,axisSwapped:b}), this._indexLabels.push({chartType:"error",dataPoint:D[t],dataSeries:C,indexKeyword:1,point:{x:b?D[t].y[1]>=D[t].y[0]?n:m:m+(n-m)/2,y:b?q+(h-q)/2:D[t].y[1]>=D[t].y[0]?q:h},direction:D[t].y[1]>=D[t].y[0]?1:-1,bounds:{x1:b?Math.min(m,n):m,y1:b?q:Math.min(q,h),x2:b?Math.max(m,n):n,y2:b?h:Math.max(q,h)},color:e,axisSwapped:b})}}}w&&(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(p.x1,p.y1,p.width,p.height),this._eventManager.ghostCtx.restore());c.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};l.prototype.renderRangeBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=w?this._preRenderCtx: d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,f=0,p,t,g,k,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;var m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.options.dataPointWidth?this.dataPointWidth:0.9* (e.height*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/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&&(m=p);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();w&&(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)&&!s(r[f].y)&&r[f].y.length&&"number"===typeof r[f].y[0]&&"number"===typeof r[f].y[1]){p=a.axisY.convertValueToPixel(r[f].y[0]); t=a.axisY.convertValueToPixel(r[f].y[1]);g=a.axisX.convertValueToPixel(k);g=a.axisX.reversed?g+a.plotType.totalDataSeries*m/2-(a.previousDataSeriesCount+n)*m<<0:g-a.plotType.totalDataSeries*m/2+(a.previousDataSeriesCount+n)*m<<0;var v=a.axisX.reversed?g-m<<0:g+m<<0;p>t&&(b=p,p=t,t=b);b=r[f].color?r[f].color:h._colorSet[f%h._colorSet.length];ca(c,p,g,t,v,b,0,null,l,!1,!1,!1,h.fillOpacity);b=h.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:f, x1:p,y1:g,x2:t,y2:v};b=P(b);w&&ca(this._eventManager.ghostCtx,p,g,t,v,b,0,null,!1,!1,!1,!1);if(r[f].indexLabel||h.indexLabel||r[f].indexLabelFormatter||h.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:r[f],dataSeries:h,indexKeyword:0,point:{x:r[f].y[1]>=r[f].y[0]?p:t,y:g+(v-g)/2},direction:r[f].y[1]>=r[f].y[0]?-1:1,bounds:{x1:Math.min(p,t),y1:g,x2:Math.max(p,t),y2:v},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:r[f],dataSeries:h,indexKeyword:1,point:{x:r[f].y[1]>= r[f].y[0]?t:p,y:g+(v-g)/2},direction:r[f].y[1]>=r[f].y[0]?1:-1,bounds:{x1:Math.min(p,t),y1:g,x2:Math.max(p,t),y2:v},color:b})}}}w&&(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:K.fadeInAnimation,easingFunction:K.easing.easeInQuad,animationBase:0}}};l.prototype.renderRangeArea=function(a){function d(){if(x){for(var a=null,c=g.length-1;0<=c;c--)a=g[c],b.lineTo(a.x,a.y2),e.lineTo(a.x,a.y2);b.closePath();b.globalAlpha=m.fillOpacity;b.fill();b.globalAlpha=1;e.fill();if(0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,f=[],p=this.plotArea;b.save();w&&e.save();b.beginPath();b.rect(p.x1,p.y1,p.width,p.height);b.clip();w&&(e.beginPath(),e.rect(p.x1,p.y1,p.width,p.height),e.clip()); for(var t=0;t a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!Q)))if(null!==n[h].y&&n[h].y.length&&"number"===typeof n[h].y[0]&&"number"===typeof n[h].y[1]){r=a.axisX.convertValueToPixel(u);l=a.axisY.convertValueToPixel(n[h].y[0]);s=a.axisY.convertValueToPixel(n[h].y[1]);q||Q?(m.connectNullData&&!q?(b.setLineDash&&(m.options.nullDataLineDashType||z===m.lineDashType&& m.lineDashType!==m.nullDataLineDashType)&&(g[g.length-1].newLineDashArray=E,z=m.nullDataLineDashType,b.setLineDash(y)),b.lineTo(r,l),w&&e.lineTo(r,l),g.push({x:r,y1:l,y2:s})):(b.beginPath(),b.moveTo(r,l),x={x:r,y:l},g=[],g.push({x:r,y1:l,y2:s}),w&&(e.beginPath(),e.moveTo(r,l))),Q=q=!1):(b.lineTo(r,l),g.push({x:r,y1:l,y2:s}),w&&e.lineTo(r,l),0==h%250&&d());u=m.dataPointIds[h];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:h,x1:r,y1:l,y2:s};h n[h].y[1]===a.axisY.reversed?-1:1,color:v}), this._indexLabels.push({chartType:"rangeArea",dataPoint:n[h],dataSeries:m,indexKeyword:1,point:{x:r,y:s},direction:n[h].y[0]>n[h].y[1]===a.axisY.reversed?1:-1,color:v})}else Q||q||d(),Q=!0;d();V.drawMarkers(f)}}w&&(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(p.x1,p.y1,p.width,p.height),this._eventManager.ghostCtx.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:K.xClipAnimation,easingFunction:K.easing.linear,animationBase:0}}};l.prototype.renderRangeSplineArea=function(a){function d(a,c){var d=v(l,2);if(0 =a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,f=[],p=this.plotArea;b.save();w&&e.save();b.beginPath();b.rect(p.x1,p.y1,p.width,p.height);b.clip();w&&(e.beginPath(),e.rect(p.x1,p.y1,p.width,p.height),e.clip());for(var t=0;t a.axisX.dataInfo.viewPortMax&&(!k.connectNullData|| !h)))if(null!==m[n].y&&m[n].y.length&&"number"===typeof m[n].y[0]&&"number"===typeof m[n].y[1]){q=a.axisX.convertValueToPixel(q);h=a.axisY.convertValueToPixel(m[n].y[0]);r=a.axisY.convertValueToPixel(m[n].y[1]);var y=k.dataPointIds[n];this._eventManager.objectMap[y]={id:y,objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:n,x1:q,y1:h,y2:r};l[l.length]={x:q,y:h};s[s.length]={x:q,y:r};n =a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx,e=null,f=this.plotArea,p=0,t,g,k,m,n=a.axisY.convertValueToPixel(a.axisY.logarithmic? a.axisY.viewportMinimum:0),p=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;g=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&&p>g&&(p=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&g g&&(q=g);c.save();w&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(f.x1,f.y1,f.width,f.height);c.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(f.x1, f.y1,f.width,f.height),this._eventManager.ghostCtx.clip());for(var h=0;h
k&&(e=g,g=k,k=e);a.axisY.reversed&&(e=g,g=k,k=e);e=s.dataPointIds[p];this._eventManager.objectMap[e]={id:e,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:p,x1:t,y1:g,x2:E,y2:k};var Q=v[p].color?v[p].color:0 v[p].y===a.axisY.reversed?1:-1,bounds:{x1:t,y1:Math.min(g,k),x2:E,y2:Math.max(g,k)},color:e})}}w&&(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:K.fadeInAnimation,easingFunction:K.easing.easeInQuad, animationBase:0}}};var W=function(a,d,c,b,e,f,p,g,l){if(!(0>c)){"undefined"===typeof g&&(g=1);if(!w){var k=Number((p%(2*Math.PI)).toFixed(8));Number((f%(2*Math.PI)).toFixed(8))===k&&(p-=1E-4)}a.save();a.globalAlpha=g;"pie"===e?(a.beginPath(),a.moveTo(d.x,d.y),a.arc(d.x,d.y,c,f,p,!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,p,!1),0<=l&&a.arc(d.x,d.y,l*c,p,f,!0),a.closePath(),a.fillStyle=b,a.strokeStyle="white",a.lineWidth= 2,a.fill());a.globalAlpha=1;a.restore()}};l.prototype.renderPie=function(a){function d(){if(k&&m){for(var a=0,b=0,c=0,d=0,e=0;e Math.PI/2-u&&g.midAngle g.midAngle)c=e;a++}else if(g.midAngle> 3*Math.PI/2-u&&g.midAngle<3*Math.PI/2+u){if(0===b||h[d].midAngle>g.midAngle)d=e;b++}g.hemisphere=f>Math.PI/2&&f<=3*Math.PI/2?"left":"right";g.indexLabelTextBlock=new ia(l.plotArea.ctx,{fontSize:g.indexLabelFontSize,fontFamily:g.indexLabelFontFamily,fontColor:g.indexLabelFontColor,fontStyle:g.indexLabelFontStyle,fontWeight:g.indexLabelFontWeight,textAlign:g.indexLabelTextAlign,backgroundColor:g.indexLabelBackgroundColor,maxWidth:g.indexLabelMaxWidth,maxHeight:g.indexLabelWrap?5*g.indexLabelFontSize: 1.5*g.indexLabelFontSize,text:g.indexLabelText,padding:0,textBaseline:"top"});g.indexLabelTextBlock.measureText()}p=f=0;n=!1;for(e=0;e Math.PI/2-u&&g.midAngle 3*Math.PI/2-u&&g.midAngle<3*Math.PI/2+u)&&(p<=b/2&&!n?(g.hemisphere="left",p++):(g.hemisphere="right",n=!0))}}function c(a){var b=l.plotArea.ctx;b.clearRect(q.x1, q.y1,q.width,q.height);b.fillStyle=l.backgroundColor;b.fillRect(q.x1,q.y1,q.width,q.height);for(b=0;b c){var e=0.07*z*Math.cos(h[b].midAngle),f=0.07*z*Math.sin(h[b].midAngle),p=!1;if(m[b].exploded){if(1E-9 a.indexLabelTextBlock.y?e-d:c-f}function e(a){for(var c=null,d=1;d b(h[c],h[a])||("right"===h[a].hemisphere?h[c].indexLabelTextBlock.y>=h[a].indexLabelTextBlock.y:h[c].indexLabelTextBlock.y<=h[a].indexLabelTextBlock.y)))break;else c=null;return c}function f(a,c,d){d=(d||0)+1;if(1E3 c&&n.indexLabelTextBlock.y g)return 0;var q=0,t=0,t=q=q=0;0>c?n.indexLabelTextBlock.y-n.indexLabelTextBlock.height/2>p&&n.indexLabelTextBlock.y-n.indexLabelTextBlock.height/2+c
g&&(c=n.indexLabelTextBlock.y+n.indexLabelTextBlock.height/ 2+c-g);c=n.indexLabelTextBlock.y+c;p=0;p="right"===n.hemisphere?A.x+Math.sqrt(Math.pow(w,2)-Math.pow(c-A.y,2)):A.x-Math.sqrt(Math.pow(w,2)-Math.pow(c-A.y,2));t=A.x+z*Math.cos(n.midAngle);q=A.y+z*Math.sin(n.midAngle);q=Math.sqrt(Math.pow(p-t,2)+Math.pow(c-q,2));t=Math.acos(z/w);q=Math.acos((w*w+z*z-q*q)/(2*z*w));c=q
b(h[p],h[a])||("right"===h[a].hemisphere?h[p].indexLabelTextBlock.y<=h[a].indexLabelTextBlock.y:h[p].indexLabelTextBlock.y>=h[a].indexLabelTextBlock.y)))break;else p=null;t=p;q=e(a);g=p=0;0>c?(g="right"===n.hemisphere?t:q,k=c,null!==g&&(t=-c,c=n.indexLabelTextBlock.y-n.indexLabelTextBlock.height/2-(h[g].indexLabelTextBlock.y+h[g].indexLabelTextBlock.height/2),c-t +p.toFixed(x)&&(k=c>r?-(c-r):-(t-(g-p)))))):0 r?c-r:t-(p-g)))));k&&(d=n.indexLabelTextBlock.y+k,c=0,c="right"===n.hemisphere?A.x+Math.sqrt(Math.pow(w,2)-Math.pow(d-A.y,2)):A.x-Math.sqrt(Math.pow(w,2)-Math.pow(d-A.y,2)),n.midAngle>Math.PI/2-u&&n.midAngle p.indexLabelTextBlock.x?c=p.indexLabelTextBlock.x-15:"right"===n.hemisphere&&("left"===a.hemisphere&&c 3*Math.PI/2-u&&n.midAngle<3*Math.PI/2+u&&(p=(a-1+h.length)%h.length,p=h[p],a=h[(a+1+h.length)%h.length],"right"===n.hemisphere&&"left"===p.hemisphere&&c a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x- 15)),n.indexLabelTextBlock.y=d,n.indexLabelTextBlock.x=c,n.indexLabelAngle=Math.atan2(n.indexLabelTextBlock.y-A.y,n.indexLabelTextBlock.x-A.x))}return k}function p(){var a=l.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var c=a=0,d=0,p=!0,c=0;10>c&&(1>c||0 C){for(var D=u=0,F=0;F u?g.indexLabelText="":g.indexLabelTextBlock.maxWidth=0.85*u,0.3*g.indexLabelTextBlock.maxWidthd&&(d=s)),s=s=0,0 d&&(d=s)));var H=function(a, b,c){for(var d=[],e=0;d.push(h[b]),b!==c;b=(b+1+m.length)%m.length);d.sort(function(a,b){return a.y-b.y});for(b=0;b C){q=t.indexLabelTextBlock.x;var l=t.indexLabelTextBlock.y-t.indexLabelTextBlock.height/ 2,r=t.indexLabelTextBlock.y+t.indexLabelTextBlock.height/2,s=g.indexLabelTextBlock.y-g.indexLabelTextBlock.height/2,u=g.indexLabelTextBlock.x+g.indexLabelTextBlock.width,B=g.indexLabelTextBlock.y+g.indexLabelTextBlock.height/2;q=t.indexLabelTextBlock.x+t.indexLabelTextBlock.width u+n||l>B+n||r a&&(a=k),p!==a&&(c=p,d+=-C),0===k%Math.max(m.length/10,3)&&(f=!0)):f=!0;f&&(0 =a.dataSeriesIndexes.length)){var k= this.data[a.dataSeriesIndexes[0]],m=k.dataPoints,n=10,q=this.plotArea,h=k.dataPointEOs,r=2,w,v=1.3,u=20/180*Math.PI,x=6,A={x:(q.x2+q.x1)/2,y:(q.y2+q.y1)/2},C=0;a=!1;for(var D=0;D b&&(e=b,f=!0);var p=m[c].color?m[c].color:k._colorSet[c%k._colorSet.length];e>d&&W(l.plotArea.ctx,h[c].center,h[c].radius,p,k.type,d,e,k.fillOpacity,h[c].percentInnerRadius);if(f)break}g();l.dispatchEvent("dataAnimationIterationEnd",{chart:l});1<=a&&l.dispatchEvent("dataAnimationEnd",{chart:l})},function(){l.disableToolTip=!1;l._animator.animate(0,l.animatedRender?500:0,function(a){c(a);g();l.dispatchEvent("dataAnimationIterationEnd",{chart:l})});l.dispatchEvent("dataAnimationEnd",{chart:l})})}}}; var pa=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())};l.prototype.renderFunnel= function(a){function d(){for(var a=0,b=[],c=0;c n?(n=c,p=(b+n)*(e-g)/2,a-=p,m=e-g,g+=e-g,m+=0==n?0:a/n,g+=a/n,p=!0):(m=(Math.abs($)*b-Math.sqrt(n))/2,n=b-2*m/Math.abs($),g+=m,g>e&&(g-=m,n=c,p=(b+n)*(e-g)/2,a-=p,m=e-g,g+=e-g,m+=a/n,g+=a/n,p=!0),b=n)),d.push(m);return d}function b(){if(u&&x){for(var a,b,c,d,e,f,k,p,g,m,n,q,t,l,r,B=[],v=[],A={percent:null,total:null},C=null,z=0;z B[z]&&(B[z]=z!==ca?u.reversed?O[z].x3-O[z].x4:O[z].x2-O[z].x1:O[z].x2-O[z].x1,B[z]/=2));t=b.indexLabelMaxWidth?b.indexLabelMaxWidth: u.options.indexLabelMaxWidth?u.indexLabelMaxWidth:B[z];if(t>B[z]||0>t)t=B[z];v[z]="inside"===u.indexLabelPlacement?O[z].height:!1;A=y.getPercentAndTotal(u,b);if(u.indexLabelFormatter||b.indexLabelFormatter)C={chart:y.options,dataSeries:u,dataPoint:b,total:A.total,percent:A.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(C):b.indexLabel?y.replaceKeywordsWithValue(b.indexLabel,b,u,z):u.indexLabelFormatter?u.indexLabelFormatter(C):u.indexLabel?y.replaceKeywordsWithValue(u.indexLabel,b,u,z):b.label? b.label:"";0>=m&&(m=0);1E3>t&&1E3-t k?k:u.indexLabelMaxWidth:k,p=I.length-1;0<=p;p--){h=x[I[p].id];c=I[p];d=c.textBlock;b=(a=q(p) b.y&&(e=!0);c=h.indexLabelMaxWidth||k;if(c>k||0>c)c=k;f.push(c)}if(e)for(p=I.length-1;0<=p;p--)a=O[p],I[p].textBlock.maxWidth=f[f.length-(p+1)],I[p].textBlock.measureText(),I[p].textBlock.x=M-k,c=I[p].textBlock.heightna+C&&(I[p].textBlock.y=na+C-I[p].height),I[p].textBlock.y sa+C&&(I[p].textBlock.y=sa+C-I[p].height))}function f(){var a, b,c,d;if("inside"!==u.indexLabelPlacement)for(var e=0;e xa?h(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c na+C&&(I[e].textBlock.y=na+C-I[e].height),I[e].textBlock.y sa+C&&(I[e].textBlock.y=sa+C-I[e].height)));else for(e=0;e =c?(b=e!=ca?(a.x4+a.x3)/2-d/2:(a.x5+a.x4)/2-d/2,c=e!=ca?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,I[e].textBlock.x=b,I[e].textBlock.y=c):I[e].isDirty=!0)}function p(){function a(b,c){var d;if(0>b||b>=I.length)return 0;var e,f=I[b].textBlock;if(0>c){c*=-1;e= n(b);d=g(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0 =c)return f.y+=c,c;if(b==O.length-1)return 0 e)&&(p=q(t),!(p>=I.length-1)&&I[t].textBlock.y+I[t].height+da>I[p].textBlock.y&&(I[t].textBlock.y=I[t].textBlock.y+ I[t].height-e>e-I[t].textBlock.y?e+1:e-I[t].height-1))}for(p=O.length-1;0 e&&(e=0,I[e].isDirty))break;if(I[p].textBlock.y=f){f=0;k+=I[f].height;break}e=n(f);if(0>e){f=0;k+=I[f].height;break}}if(f!=p){h=I[f].textBlock.y;a-=h;a=k-a;h=c(a,d,f);break}}}return h}function c(a,b,d){var e=[],f=0,h=0;for(a=Math.abs(a);d<= b;d++)e.push(O[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d
+p.y.toFixed(6))&&(d=h.y+d+da-p.y, e=a(r,-d),e a?u.reversed?sa-C:na-C:I[a].textBlock.y+I[a].height+da)}function l(a,b,c){var d,e,h,p=[],g=C,n=[];-1!==b&&(0<=W.indexOf(b)?(e=W.indexOf(b),W.splice(e,1)):(W.push(b),W=W.sort(function(a,b){return a-b})));if(0===W.length)p=ga;else{e=C*(1!=W.length||0!=W[0]&&W[0]!=O.length-1?2:1)/k();for(var t=0;t 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;ha=!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);q.changeSection(c,b);var e={};e.dataSeries=u;e.dataPoint=u.reversed?u.dataPoints[x.length-1-b]:u.dataPoints[b];e.index=u.reversed?x.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;e a){b=O[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 r(a){for(var b=0;b =a.dataSeriesIndexes.length)){for(var u=this.data[a.dataSeriesIndexes[0]],x=u.dataPoints,A=this.plotArea,C=0.025*A.width,D=0.01*A.width,z=0,E=A.height-2*C,F=Math.min(A.width-2*D,2.8*A.height),J=!1,H=0;H E?ba=E:0>=ba&&(ba=0),G>a?G=a-0.5:0>=G&&(G=0)):"pyramid"===u.type&&(G=ba=0,u.reversed=u.reversed?!1:!0);var D=H+a/2,X=H,Z=H+a,na=u.reversed?P:Y,L=D-G/2,V=D+G/2,xa=u.reversed?Y+ba:P-ba,sa=u.reversed?Y:P;a=[];var D=[],O=[],F=[],T=Y,ca,$=(xa-na)/(L-X),ea=-$,H="area"===(u.valueRepresents?u.valueRepresents:"height")?c():d();if(-1!==H){if(u.reversed)for(F.push(T), G=H.length-1;0 a&&(z=a));for(G=0;G ');b.document.close();setTimeout(function(){b.focus(); b.print();setTimeout(function(){c._canvasJSContainer.removeChild(d)},1E3)},500)};l.prototype.getPercentAndTotal=function(a,d){var c=null,b=null,e=c=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],c=a.plotUnit.yAbsTotals[c],e=isNaN(d.y)?0:0===c?0:100*(d.y/c));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()}}};l.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=p||"undefined"===typeof p||0>=v||"undefined"===typeof v)){if("horizontal"===this.orientation){q.textBlock=new ia(this.ctx,{x:0,y:0,maxWidth:v,maxHeight:this.itemWrap?p: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-(w+g+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!n||n.width+Math.round(q.textBlock.width+w+g+(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},k.push(n),this.height+=h,h=0;h=Math.max(h,q.textBlock.height)}else q.textBlock= new ia(this.ctx,{x:0,y:0,maxWidth:A,maxHeight:!0===this.itemWrap?p: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-(w+g+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height >0,0),this.dataPoints.length):0):(m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,m=0 >0,0),this.dataPoints.length):0));for(;;){f= 0 a?b.x/a:a/b.x:Math.abs(b.x-a);n
m-e&&m+e>=this.dataPoints.length)break;-1===p?(e++,p=1):p=-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};H.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,p=1,g=!1,l=Infinity,k=0,m=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:h,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))}),g=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var s=la("markerSize",h,this)||4,w=c?20:s,r=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-d,2));r<=w&&b.push({dataPoint:h,dataPointIndex:f,dataSeries:this,distance:r});q= Math.abs(q.x1-a);q<=l?l=q:0
w&&(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)),w=Number(((180*(q.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===w&&1
=w&&0!==h.y&&(w+=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:h,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))}),g=!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:h,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))}),g=!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:h,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))}),g=!0}if(g||1E3 n-e&&n+e>=this.dataPoints.length)break;-1===p?(e++,p=1):p=-1}a=null;for(d=0;d n[h].endValue;h++);a=h =n[h].startValue&&c<=n[h].endValue;m=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:m,label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:ea(m,this.valueFormatString,this.chart._cultureInfo),a=new ia(this.ctx,{x:0,y:0,maxWidth:f,maxHeight:p,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:m,textBlock:a,effectiveHeight:null}))}h=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(;h n[h].endValue;h++);a=h =n[h].startValue&&c<=n[h].endValue;m=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:m,label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:ea(m,this.valueFormatString,this.chart._cultureInfo),a=new ia(this.ctx,{x:0, y:0,maxWidth:f,maxHeight:p,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:m,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),h=q,c=this.intervalStartPosition;c n[h].endValue;h++);m=a;a=h =n[h].startValue&&a<=n[h].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(m),label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]? this.labels[m]:Aa(m,this.valueFormatString,this.chart._cultureInfo),a=new ia(this.ctx,{x:0,y:0,maxWidth:f,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:p,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:m,textBlock:a,effectiveHeight:null,breaksLabelType:void 0}))}if("bottom"===this._position||"top"===this._position)g=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))*R[this.intervalType+"Duration"]*this.interval,f="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(p="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)g=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))*R[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(f="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),p="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*g>>0,q=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=f;this.sessionVariables.labelMaxHeight=p;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c q&&(v=c,q=m.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):s(this.options.labelMaxWidth)? (this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelMaxWidth=f,d&&r.width+d.width>>0>2*f&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>f?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelWrap=this.labelWrap);else{if(s(this.options.labelWrap))if(!s(this.options.labelMaxWidth))this.options.labelMaxWidth< f?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=p);else if(!s(d))if(b=r.width+d.width>>0,h=this.labelFontSize,q n&&(n=b-2*f,b>=2*f&&b<2.2*f?(this.sessionVariables.labelMaxWidth=f,s(this.options.labelFontSize)&&12 =2.2*f&&b<2.8*f?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelFontSize=h):b>=2.8*f&&b<3.2*f?(this.sessionVariables.labelMaxWidth=Math.max(f,q),this.sessionVariables.labelWrap=!0,s(this.options.labelFontSize)&&12 =3.2*f&&b<3.6*f?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelFontSize=this.labelFontSize):b>3.6*f&&b<5*f?(s(this.options.labelFontSize)&&12 5*f&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=f,this.sessionVariables.labelFontSize=h,this.sessionVariables.labelMaxHeight=p,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=s(this.options.labelFontSize)?h:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m;else if(0===n)for(this.sessionVariables.labelFontSize=s(this.options.labelFontSize)?h: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?p:Math.min((b-f*Math.cos(Math.PI/ 180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),m=0!=this.labelAngle?(k-(l+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=this.labelWrap?(k-m*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,s(this.options.labelWrap))?s(this.options.labelWrap)&&(this.labelWrap&&!s(this.options.labelMaxWidth)? (this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m,this.sessionVariables.labelMaxHeight=p):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelMaxHeight=b<0.9*g?0.9*g:b,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth? this.options.labelMaxWidth:m):(s(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=p)}for(b=0;b >0:this.options.labelMaxWidth,p="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=p;this.sessionVariables.labelAngle=s(this.sessionVariables.labelAngle)? 0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c >0,g-2*p>q&&(q=g-2*p,g>=2*p&&g<2.4*p?(s(this.options.labelFontSize)&&12 =2.4*p&&g<2.8*p?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):g>=2.8*p&&g<3.2*p?(this.sessionVariables.labelMaxHeight=p,this.sessionVariables.labelWrap=!0,s(this.options.labelFontSize)&&12 =3.2*p&&g<3.6*p?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):g>3.6*p&&g<10*p?(s(this.options.labelFontSize)&&12 10*p&&g<50*p&&(s(this.options.labelFontSize)&&12