b.max&&(b.max=c);if(0v&&(v=1/v);b.minDiff>v&&1!==v&&(b.minDiff=v)}else v=c-r.dataPoints[p-1].x,0>v&&(v*=-1),b.minDiff>v&&0!==v&&(b.minDiff=v);x(d)||null===r.dataPoints[p-1].y||(a.axisY.logarithmic?0v&&(v=1/v),f.minDiff>v&&1!==v&&(f.minDiff=v)):(v=d-r.dataPoints[p-1].y,0>v&&(v*=-1),f.minDiff>v&&0!==v&&(f.minDiff=v)))}if(cC&&!e)e=!0;else if(c>
C&&e)continue;r.dataPoints[p].label&&(a.axisX.labels[c]=r.dataPoints[p].label);cb.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&td&&(l=!0),n[c]=n[c]?n[c]+Math.abs(d):Math.abs(d))}}this.plotInfo.axisXValueType=r.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(f.max=x(f.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(f.viewPortMax,99*Math.pow(a.axisY.logarithmBase,
-0.05)),f.min=x(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&!l?(f.max=x(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=x(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&l?(f.max=x(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=x(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99)):!k&&l&&(f.max=x(f.viewPortMax)?-1:Math.max(f.viewPortMax,-1),f.min=x(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99));f.viewPortMin=f.min;f.viewPortMax=f.max;a.dataPointYSums=n}};u.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&
!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g,k,l=!1,n=0;nb.max&&(b.max=c);gf.max&&(f.max=k);0t&&(t=1/t),b.minDiff>t&&1!==t&&(b.minDiff=t)):(t=c-h.dataPoints[r-1].x,0>t&&(t*=-1),b.minDiff>t&&0!==t&&(b.minDiff=t)),d&&(null!==d[0]&&h.dataPoints[r-1].y&&null!==
h.dataPoints[r-1].y[0])&&(a.axisY.logarithmic?(t=d[0]/h.dataPoints[r-1].y[0],1>t&&(t=1/t),f.minDiff>t&&1!==t&&(f.minDiff=t)):(t=d[0]-h.dataPoints[r-1].y[0],0>t&&(t*=-1),f.minDiff>t&&0!==t&&(f.minDiff=t))));if(!(cv&&!m)m=!0;else if(c>v&&m)continue;h.dataPoints[r].label&&(a.axisX.labels[c]=h.dataPoints[r].label);cb.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&d)for(E=0;Ef.viewPortMax&&(f.viewPortMax=k))}}this.plotInfo.axisXValueType=h.xValueType=l?"dateTime":"number"}};u.prototype._processSpecificPlotUnit=function(a){if("waterfall"===a.type&&a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=0;kb.max&&(b.max=c),l.dataPointEOs[n].cumulativeSumf.max&&(f.max=l.dataPointEOs[n].cumulativeSum),0p&&(p=1/p),b.minDiff>p&&1!==p&&(b.minDiff=p)):(p=c-l.dataPoints[n-1].x,0>p&&
(p*=-1),b.minDiff>p&&0!==p&&(b.minDiff=p)),null!==d&&null!==l.dataPoints[n-1].y&&(a.axisY.logarithmic?(d=l.dataPointEOs[n].cumulativeSum/l.dataPointEOs[n-1].cumulativeSum,1>d&&(d=1/d),f.minDiff>d&&1!==d&&(f.minDiff=d)):(d=l.dataPointEOs[n].cumulativeSum-l.dataPointEOs[n-1].cumulativeSum,0>d&&(d*=-1),f.minDiff>d&&0!==d&&(f.minDiff=d)))),!(ce&&!r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);cb.viewPortMax&&(b.viewPortMax=c);0f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n-1].cumulativeSum));l.dataPointEOs[n].cumulativeSumf.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n].cumulativeSum)}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":
"number"}};u.prototype.calculateAutoBreaks=function(){function a(a,c){var b=c-a,d=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),f=Math.pow(10,Math.floor(Math.log(Math.abs(a||b))/Math.LN10)),g,h;fh&&(h=Math.pow(0.1,Number((Math.log(d)/Math.LN10+1).toFixed(2))>>1),0.01>h?(g=Math.ceil(a*(1+(00.01*b){var l=B.getNiceNumber(m);h+=Math.floor(0.99*m/l)*l}k>0.01*b&&(b=Math.min(B.getNiceNumber(k),Math.ceil(d/10),Math.ceil(f/10)))&&(g-=Math.floor(0.99*k/b)*b);return{startValue:g,endValue:h}}function f(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){var c=a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks,b=a.axisY.scaleBreaks&&a.axisY.scaleBreaks.autoCalculate&&
1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks;if(c||b)for(var f=a.axisY.dataInfo,g=a.axisX.dataInfo,h,k=g.min,m=g.max,l=f.min,n=f.max,g=g._dataRanges,f=f._dataRanges,p,r=0,q=0;qw.dataPoints.length))for(r=0;rg[p].max&&(g[p].max=h)),b){var u=(n+1-l)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((h="waterfall"===a.type?w.dataPointEOs[r].cumulativeSum:w.dataPoints[r].y)&&h.length)for(var s=0;sf[p].max&&(f[p].max=h[s]);else x(h)||(p=Math.floor((h-l)/u),hf[p].max&&(f[p].max=h))}}}}function b(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)&&a.axisX.scaleBreaks&&
a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks)for(var c=a.axisX.dataInfo,b=c.min,f=c.max,g=c._dataRanges,h,k=0,m=0;ml.dataPoints.length))for(k=0;kg[h].max&&(g[h].max=
c)}}for(var c,d=this,g=!1,k=0;kr[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYPositiveSums}if(this._axes[k].dataInfo.dataPointYNegativeSums){m=
this._axes[k].dataInfo.dataPointYNegativeSums;r=h;for(l in m)m.hasOwnProperty(l)&&!isNaN(l)&&(p=-1*m[l],x(p)||(index=Math.floor((p-n)/c),pr[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYNegativeSums}for(l=0;lc&&g.push({diff:p,start:r,end:n});break}else l++;if(this._axes[k].scaleBreaks.customBreaks)for(l=0;l=d.x1&&(a<=d.x2&&f>=d.y1&&f<=d.y2)&&(c=d.id)}return c};u.prototype.getAutoFontSize=
function(a,f,b){f=Math.min(this.width,this.height);return Math.max("theme4"===this.theme?0:300<=f?12:10,Math.round(f*(a/400)))};u.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};u.prototype.clearCanvas=function(){this.ctx.clearRect(0,0,this.width,this.height);this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.width,this.height))};u.prototype.attachEvent=function(a){this._events.push(a)};u.prototype._touchEventHandler=
function(a){if(a.changedTouches&&this.interactivityEnabled){var f=[],b=a.changedTouches,c=b?b[0]:a,d=null;switch(a.type){case "touchstart":case "MSPointerDown":f=["mousemove","mousedown"];this._lastTouchData=Ma(c);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":f=["mousemove"];break;case "touchend":case "MSPointerUp":f="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType?["mouseup","click"]:["mouseup"];break;default:return}if(!(b&&1=d.x1&&f.x<=d.x2&&f.y>=d.y1&&f.y<=d.y2){c[b].call(c.context,f.x,f.y);"mousedown"===b&&!0===c.capture?(u.capturedEventParam=c,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(c.chart.overlaidCanvas.releaseCapture?c.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",
this._mouseEventHandler,!1));break}else c=null;a.target.style.cursor=c&&c.cursor?c.cursor:this._defaultCursor}b=this.plotArea;if(f.xb.x2||f.yb.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};u.prototype._plotAreaMouseDown=function(a,f){this.isDrag=!0;this.dragStartPoint={x:a,y:f}};u.prototype._plotAreaMouseUp=function(a,f){if(("normal"===this.plotInfo.axisPlacement||
"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var b=f-this.dragStartPoint.y,c=a-this.dragStartPoint.x,d=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),k=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=d,d=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(d=g=0;db.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,k=!0):b.viewportMinimumb.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum=
b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,k=!0);else if((!d||2Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,f);if((!d||2e)var t=e,e=m,m=t;if(p.scaleBreaks)for(t=0;!g&&t=
e;if(isFinite(p.dataInfo.minDiff))if(t=p.getAppearentDifferceReplacingBreaksToSize(m,e,null,!0),!(g||!(this.panEnabled&&p.scaleBreaks&&p.scaleBreaks._appliedBreaks.length)&&(p.logarithmic&&tp.maximum))n.push(p),r.push({val1:m,val2:e}),l=!0;else if(!d){l=!1;break}}return{isValid:l,axesWithValidRange:n,axesRanges:r}};u.prototype.preparePlotArea=function(){var a=this.plotArea;!w&&(0b.lineCoordinates.x2?f.x2:b.lineCoordinates.x2;a.y2=f.y2>f.y1?f.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0b.lineCoordinates.x2?f.x2:b.lineCoordinates.x2,a.y2=f.y2>f.y1?f.y2:b.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else f=this.layoutManager.getFreeSpace(),a.x1=f.x1,a.x2=f.x2,a.y1=f.y1,a.y2=f.y2,a.width=f.width,a.height=f.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",(0b.x2||h.point.yb.y2+1)continue}else if("rangearea"===r||"rangesplinearea"===r){if(h.dataPoint.xs.viewportMaximum||
Math.max.apply(null,h.dataPoint.y)A.viewportMaximum)continue}else if(0<=r.indexOf("line")||0<=r.indexOf("area")||0<=r.indexOf("bubble")||0<=r.indexOf("scatter")){if(h.dataPoint.xs.viewportMaximum||h.dataPoint.yA.viewportMaximum)continue}else if(0<=r.indexOf("column")||"waterfall"===r||"error"===r&&!h.axisSwapped){if(h.dataPoint.xs.viewportMaximum||
h.bounds.y1>b.y2||h.bounds.y2s.viewportMaximum||h.bounds.x1>b.x2||h.bounds.x2s.viewportMaximum||Math.max.apply(null,h.dataPoint.y)A.viewportMaximum)continue}else if(h.dataPoint.xs.viewportMaximum)continue;
d=k=2;"horizontal"===E?(l=e.width,n=e.height):(n=e.width,l=e.height);if("normal"===this.plotInfo.axisPlacement){if(0<=r.indexOf("line")||0<=r.indexOf("area"))v="auto",k=4;else if(0<=r.indexOf("stacked"))"auto"===v&&(v="inside");else if("bubble"===r||"scatter"===r)v="inside";p=h.point.x-l/2;"inside"!==v?(d=b.y1,g=b.y2,0h.point.y)):(m=h.point.y+k+c,m>g-n-k-c&&(m="auto"===v?Math.min(h.point.y,g)-n-k-c:g-n-k-c,oa=mg-n-k&&("bubble"===r||"scatter"===r)&&(m=Math.min(h.point.y+k,b.y2-n-k))),m=Math.min(m,g-n))}else 0<=r.indexOf("line")||0<=r.indexOf("area")||
0<=r.indexOf("scatter")?(v="auto",d=4):0<=r.indexOf("stacked")?"auto"===v&&(v="inside"):"bubble"===r&&(v="inside"),m=h.point.y-n/2,"inside"!==v?(k=b.x1,g=b.x2,0>u?(p=h.point.x-l-d-c,ph.point.x)):(p=h.point.x+d+c,p>g-l-d-c&&(p="auto"===v?Math.min(h.point.x,g)-l-d-c:g-l-d-c,oa=pu?Math.max(h.bounds.x1,b.x1)+l/2+d:Math.min(h.bounds.x2,b.x2)-
l/2-d:(Math.max(h.bounds.x1,b.x1)+Math.min(h.bounds.x2,b.x2))/2,p=0>u?Math.max(h.point.x,c)-l/2:Math.min(h.point.x,c)-l/2,p=Math.max(p,k));"vertical"===E&&(m+=n);e.x=p;e.y=m;e.render(!0);C&&("inside"!==v&&(0>r.indexOf("bar")&&("error"!==r||!h.axisSwapped)&&h.point.x>b.x1&&h.point.xr.indexOf("column")&&("error"!==r||h.axisSwapped)&&h.point.y>b.y1&&h.point.y=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var d=this.plotArea;b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();for(var g=[],k,l=0;la.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!u)))if("number"!==typeof r[v].y)0r[v].y===a.axisY.reversed?1:-1,color:t})}b.stroke();w&&c.stroke()}}aa.drawMarkers(g);w&&(f.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(d.x1,
d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStepLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var d=this.plotArea;b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();for(var g=[],k,l=0;la.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!u)))if("number"!==typeof r[v].y)0r[v].y===a.axisY.reversed?1:-1,color:t})}b.stroke();w&&c.stroke()}}aa.drawMarkers(g);w&&(f.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(d.x1,d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderSpline=function(a){function f(a){a=y(a,2);if(0=a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var k=[],l=0;la.axisX.dataInfo.viewPortMax&&
(!h.connectNullData||!E)))if("number"!==typeof r[C].y)0r[C].y===a.axisY.reversed?1:-1,color:t});E=!1}f(G)}aa.drawMarkers(k);w&&(b.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(g.x1,g.y1,g.width,g.height),d.beginPath());c.restore();c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};var Y=function(a,f,b,c,d,g,k,l,n,h,r,p,m){"undefined"===typeof m&&(m=1);k=k||0;l=l||"black";var e=15=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),g=this.dataPointMinWidth=this.dataPointMinWidth?
this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,r=this.dataPointMaxWidth=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(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&&g>r&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(p=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(r=0;ra.axisX.dataInfo.viewPortMax)&&"number"===typeof t[g].y){k=a.axisX.convertValueToPixel(n);l=a.axisY.convertValueToPixel(t[g].y);k=a.axisX.reversed?k+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:k-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+r)*p<<0;var C=a.axisX.reversed?
k-p<<0:k+p<<0,v;0<=t[g].y?v=h:(v=l,l=h);l>v&&(c=l,l=v,v=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,k,l,C,v,c,0,null,q&&0<=t[g].y,0>t[g].y&&q,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:k,y1:l,x2:C,y2:v};c=W(c);w&&Y(this._eventManager.ghostCtx,k,l,C,v,c,0,null,!1,!1,!1,!1);(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",
dataPoint:t[g],dataSeries:e,point:{x:k+(C-k)/2,y:0>t[g].y===a.axisY.reversed?l:v},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:k,y1:Math.min(l,v),x2:C,y2:Math.max(l,v)},color:c})}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ha.axisY.bounds.y2?a.axisY.bounds.y2:h}}};u.prototype.renderStackedColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,
g=[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/
Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(e=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),
this._eventManager.ghostCtx.clip());for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){r=a.axisX.convertValueToPixel(c);var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,u=G+e<<0,s;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&
0=v[h].y)n[c]=v[h].y+(n[c]?n[c]:0),s=a.axisY.convertValueToPixel(n[c]),p="undefined"!==typeof k[c]?k[c]:m,k[c]=s;else if(p=a.axisY.convertValueToPixel(v[h].y),0<=v[h].y){var x="undefined"!==typeof g[c]?g[c]:0;p-=x;s=m-x;g[c]=x+(s-p)}else x=k[c]?k[c]:0,s=p+x,
p=m+x,k[c]=x+(s-p);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,G,p,u,s,c,0,null,E&&0<=v[h].y,0>v[h].y&&E,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:G,y1:p,x2:u,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,G,p,u,s,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:v[h],dataSeries:C,
point:{x:r,y:0<=v[h].y?p:s},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,s),x2:u,y2:Math.max(p,s)},color:c})}}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ma.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderStackedColumn100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=[],k=[],l=[],n=[],h=0,
r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/Math.abs(a.axisX.range))/
a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(e=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());
for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){r=a.axisX.convertValueToPixel(c);p=0!==a.dataPointYSums[c]?100*(v[h].y/a.dataPointYSums[c]):0;var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=G+e<<0,u;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&
0=l[c])continue;p=a.axisY.convertValueToPixel(l[c]);u=g[c]?g[c]:m;g[c]=p}else if(a.axisY.scaleBreaks&&0=v[h].y)n[c]=p+("undefined"!==typeof n[c]?n[c]:0),u=a.axisY.convertValueToPixel(n[c]),p=k[c]?k[c]:m,k[c]=u;else if(p=a.axisY.convertValueToPixel(p),0<=v[h].y){var x="undefined"!==typeof g[c]?g[c]:0;p-=x;u=m-x;g[c]=x+(u-p)}else x="undefined"!==typeof k[c]?
k[c]:0,u=p+x,p=m+x,k[c]=x+(u-p);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,G,p,s,u,c,0,null,E&&0<=v[h].y,0>v[h].y&&E,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:G,y1:p,x2:s,y2:u};c=W(c);w&&Y(this._eventManager.ghostCtx,G,p,s,u,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:v[h],
dataSeries:C,point:{x:r,y:0<=v[h].y?p:u},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,u),x2:s,y2:Math.max(p,u)},color:c})}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ma.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h=a.axisY.convertValueToPixel(a.axisY.logarithmic?
a.axisY.viewportMinimum:0),g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(d.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&&g>r&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(p=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());
for(r=0;ra.axisX.dataInfo.viewPortMax)&&"number"===typeof t[g].y){l=a.axisX.convertValueToPixel(n);k=a.axisY.convertValueToPixel(t[g].y);l=a.axisX.reversed?l+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:l-a.plotType.totalDataSeries*
p/2+(a.previousDataSeriesCount+r)*p<<0;var C=a.axisX.reversed?l-p<<0:l+p<<0,v;0<=t[g].y?v=h:(v=k,k=h);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,v,l,k,C,c,0,null,q,!1,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:v,y1:l,x2:k,y2:C};c=W(c);w&&Y(this._eventManager.ghostCtx,v,l,k,C,c,0,null,!1,!1,!1,!1);(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",
dataPoint:t[g],dataSeries:e,point:{x:0<=t[g].y?k:v,y:l+(C-l)/2},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v,k),y1:l,x2:Math.max(v,k),y2:C},color:c})}}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ha.axisY.bounds.x2?a.axisY.bounds.x2:h}}};u.prototype.renderStackedBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=
[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/
Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&pp&&(e=p);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),
this._eventManager.ghostCtx.clip());for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){p=a.axisX.convertValueToPixel(c);var u=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=u+e<<0,x;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&
0=v[h].y)n[c]=v[h].y+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=x=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(v[h].y),0<=v[h].y){var A=g[c]?g[c]:0;x=m+A;r+=A;g[c]=A+(r-x)}else A=k[c]?k[c]:0,x=r-A,r=m-A,k[c]=A+(r-x);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];
Y(b,x,u,r,s,c,0,null,E,!1,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:x,y1:u,x2:r,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,x,u,r,s,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:v[h],dataSeries:C,point:{x:0<=v[h].y?r:x,y:p},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(x,
r),y1:u,x2:Math.max(x,r),y2:s},color:c})}}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();
return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ma.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderStackedBar100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?
this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:
Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&pp&&(e=p);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){p=a.axisX.convertValueToPixel(c);var u;u=0!==a.dataPointYSums[c]?100*(v[h].y/a.dataPointYSums[c]):0;var s=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,x=s+e<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=l[c])continue;u=g[c]?g[c]:m;g[c]=r=a.axisY.convertValueToPixel(l[c])}else if(a.axisY.scaleBreaks&&0=v[h].y)n[c]=u+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=u=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(u),0<=v[h].y){var A=g[c]?g[c]:0;u=m+A;r+=A;g[c]=A+(r-u)}else A=k[c]?k[c]:0,u=r-A,r=m-A,k[c]=A+(r-u);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,u,s,r,x,c,0,null,E,!1,!1,!1,C.fillOpacity);c=C.dataPointIds[h];
this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:u,y1:s,x2:r,y2:x};c=W(c);w&&Y(this._eventManager.ghostCtx,u,s,r,x,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:v[h],dataSeries:C,point:{x:0<=v[h].y?r:u,y:p},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,r),y1:s,x2:Math.max(u,r),y2:x},color:c})}}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,
animationBase:ma.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderArea=function(a){var f,b;function c(){A&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?x=s:0>a.axisY.viewportMaximum?x=n.y1:0=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();w&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();w&&(k.beginPath(),k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!Z)))if("number"!==typeof q[C].y)t.connectNullData||(Z||f)||c(),Z=!0;else{v=a.axisX.convertValueToPixel(u);E=a.axisY.convertValueToPixel(q[C].y);f||Z?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType||b===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=v,b=E,v=p.x,E=p.y,c(),g.moveTo(p.x,p.y),
v=f,E=b,A=p,b=t.nullDataLineDashType,g.setLineDash(U)),g.lineTo(v,E),w&&k.lineTo(v,E)):(g.beginPath(),g.moveTo(v,E),w&&(k.beginPath(),k.moveTo(v,E)),A={x:v,y:E}),Z=f=!1):(g.lineTo(v,E),w&&k.lineTo(v,E),0==C%250&&c());p={x:v,y:E};C
q[C].y===a.axisY.reversed?1:-1,color:y})}c();aa.drawMarkers(h)}}w&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&g.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&g.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());
g.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderSplineArea=function(a){function f(){var b=y(s,2);if(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=C:0>a.axisY.viewportMaximum?v=k.y1:0=a.dataSeriesIndexes.length)){var d=
this._eventManager.ghostCtx,g=a.axisX.lineCoordinates,k=a.axisY.lineCoordinates,l=[],n=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(n.x1,n.y1,n.width,n.height);c.clip();w&&(d.beginPath(),d.rect(n.x1,n.y1,n.width,n.height),d.clip());for(var h=0;ha.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!q)))if("number"!==
typeof m[e].y)0m[e].y===a.axisY.reversed?1:-1,color:x});q=!1}f();aa.drawMarkers(l)}}w&&(b.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(n.x1,n.y1,n.width,n.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStepArea=function(a){var f,b;function c(){A&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?D=x:0>a.axisY.viewportMaximum?D=n.y1:0=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();w&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();w&&(k.beginPath(),
k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!b))){var O=u;"number"!==typeof q[C].y?(t.connectNullData||(b||f)||c(),b=!0):(v=a.axisX.convertValueToPixel(s),u=a.axisY.convertValueToPixel(q[C].y),f||b?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType||
U===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=v,b=u,v=p.x,u=p.y,c(),g.moveTo(p.x,p.y),v=f,u=b,A=p,U=t.nullDataLineDashType,g.setLineDash(ba)),g.lineTo(v,O),g.lineTo(v,u),w&&(k.lineTo(v,O),k.lineTo(v,u))):(g.beginPath(),g.moveTo(v,u),w&&(k.beginPath(),k.moveTo(v,u)),A={x:v,y:u}),b=f=!1):(g.lineTo(v,O),w&&k.lineTo(v,O),g.lineTo(v,u),w&&k.lineTo(v,u),0==C%250&&c()),p={x:v,y:u},Cq[C].y===a.axisY.reversed?1:-1,color:y}))}c();aa.drawMarkers(h)}}w&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&g.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&g.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&
this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());g.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStackedArea=function(a){function f(){if(!(1>n.length)){for(0=a.dataSeriesIndexes.length)){var d=null,g=[],k=this.plotArea,l=[],n=[],h=[],r=[],p=0,m,e,t,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),C=this._eventManager.ghostCtx,v,u,s;w&&C.beginPath();c.save();w&&C.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(C.beginPath(),C.rect(k.x1,k.y1,k.width,
k.height),C.clip());for(var d=[],x=0;xa.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!Z)))if("number"!==typeof O.y)A.connectNullData||
(Z||u)||f(),Z=!0;else{m=a.axisX.convertValueToPixel(t);var I=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(O.y),e-=I;n.push({x:m,y:q-I});l[t]=q-e;u||Z?(!u&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||s===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(u=n.pop(),s=n[n.length-1],
f(),c.moveTo(v.x,v.y),n.push(s),n.push(u),s=A.nullDataLineDashType,c.setLineDash(U)),c.lineTo(m,e),w&&C.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),w&&(C.beginPath(),C.moveTo(m,e))),Z=u=!1):(c.lineTo(m,e),w&&C.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),w&&C.moveTo(m,e),n.push({x:m,y:q-I})));v={x:m,y:e};py[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);w&&C.moveTo(m,e)}delete A.dataPointIndexes}aa.drawMarkers(g);w&&(b.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(k.x1,k.y1,k.width,k.height),C.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStackedArea100=function(a){function f(){for(0=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=[],l=[],n=[],h=[],r=[],p=0,m,e,t,q,u,v,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),x=this._eventManager.ghostCtx;c.save();w&&x.save();
c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();w&&(x.beginPath(),x.rect(g.x1,g.y1,g.width,g.height),x.clip());for(var d=[],y=0;ya.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!Z)))if("number"!==typeof O.y)A.connectNullData||(Z||u)||f(),Z=!0;else{var I;I=0!==a.dataPointYSums[t]?100*(O.y/a.dataPointYSums[t]):0;m=a.axisX.convertValueToPixel(t);var ma=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(I),e-=ma;n.push({x:m,y:s-ma});l[t]=s-e;
u||Z?(!u&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||v===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(u=n.pop(),v=n[n.length-1],f(),c.moveTo(q.x,q.y),n.push(v),n.push(u),v=A.nullDataLineDashType,c.setLineDash(U)),c.lineTo(m,e),w&&x.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),w&&(x.beginPath(),x.moveTo(m,e))),Z=u=!1):(c.lineTo(m,e),w&&x.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),w&&x.moveTo(m,e),n.push({x:m,y:s-ma})));q={x:m,y:e};pz[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);w&&x.moveTo(m,e)}delete A.dataPointIndexes}aa.drawMarkers(k);
w&&(b.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(g.x1,g.y1,g.width,g.height),x.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,
easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderBubble=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=-Infinity,n=Infinity,h=0;h<
a.dataSeriesIndexes.length;h++)for(var r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,e=0,d=0;da.axisX.dataInfo.viewPortMax||"undefined"===typeof m[d].z||(e=m[d].z,e>l&&(l=e),ea.axisX.dataInfo.viewPortMax)&&"number"===typeof m[d].y){g=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(m[d].y);var e=m[d].z,u=2*Math.max(Math.sqrt((l===n?q/2:t+(q-t)/(l-n)*(e-n))/Math.PI)<<0,1),e=p.getMarkerProperties(d,b);e.size=u;b.globalAlpha=p.fillOpacity;aa.drawMarker(g,k,b,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;var v=p.dataPointIds[d];this._eventManager.objectMap[v]=
{id:v,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:d,x1:g,y1:k,size:u};u=W(v);w&&aa.drawMarker(g,k,this._eventManager.ghostCtx,e.type,e.size,u,u,e.borderThickness);(m[d].indexLabel||p.indexLabel||m[d].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:m[d],dataSeries:p,point:{x:g,y:k},direction:1,bounds:{x1:g-e.size/2,y1:k-e.size/2,x2:g+e.size/2,y2:k+e.size/2},color:null})}w&&(f.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(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderScatter=
function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=0;la.axisX.dataInfo.viewPortMax)&&"number"===typeof r[d].y){g=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(r[d].y);var e=h.getMarkerProperties(d,g,k,b);b.globalAlpha=h.fillOpacity;aa.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;Math.sqrt((p-
g)*(p-g)+(m-k)*(m-k))Math.min(this.plotArea.width,this.plotArea.height)||(p=h.dataPointIds[d],this._eventManager.objectMap[p]={id:p,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:d,x1:g,y1:k},p=W(p),w&&aa.drawMarker(e.x,e.y,this._eventManager.ghostCtx,e.type,e.size,p,p,e.borderThickness),(r[d].indexLabel||h.indexLabel||r[d].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:r[d],dataSeries:h,point:{x:g,y:k},direction:1,
bounds:{x1:g-e.size/2,y1:k-e.size/2,x2:g+e.size/2,y2:k+e.size/2},color:null}),p=g,m=k)}}}w&&(f.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(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.restore());
b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderCandlestick=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=null,k=this.plotArea,l=0,n,h,r,p,m,e,d=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,g=this.dataPointMaxWidth?this.dataPointMaxWidth:
this.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.dataPointWidth?this.dataPointWidth:0.7*k.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&d>g&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(t=g);b.save();w&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();w&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(var q=0;qa.axisX.dataInfo.viewPortMax)&&!x(s[l].y)&&s[l].y.length&&"number"===typeof s[l].y[0]&&"number"===
typeof s[l].y[1]&&"number"===typeof s[l].y[2]&&"number"===typeof s[l].y[3]){n=a.axisX.convertValueToPixel(e);h=a.axisY.convertValueToPixel(s[l].y[0]);r=a.axisY.convertValueToPixel(s[l].y[1]);p=a.axisY.convertValueToPixel(s[l].y[2]);m=a.axisY.convertValueToPixel(s[l].y[3]);var y=n-t/2<<0,D=y+t<<0,g=v.options.fallingColor?v.fallingColor:v._colorSet[0],d=s[l].color?s[l].color:v._colorSet[0],A=Math.round(Math.max(1,0.15*t)),z=0===A%2?0:0.5,B=v.dataPointIds[l];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",
dataSeriesIndex:u,dataPointIndex:l,x1:y,y1:h,x2:D,y2:r,x3:n,y3:p,x4:n,y4:m,borderThickness:A,color:d};b.strokeStyle=d;b.beginPath();b.lineWidth=A;c.lineWidth=Math.max(A,4);"candlestick"===v.type?(b.moveTo(n-z,r),b.lineTo(n-z,Math.min(h,m)),b.stroke(),b.moveTo(n-z,Math.max(h,m)),b.lineTo(n-z,p),b.stroke(),Y(b,y,Math.min(h,m),D,Math.max(h,m),s[l].y[0]<=s[l].y[3]?v.risingColor:g,A,d,G,G,!1,!1,v.fillOpacity),w&&(d=W(B),c.strokeStyle=d,c.moveTo(n-z,r),c.lineTo(n-z,Math.min(h,m)),c.stroke(),c.moveTo(n-
z,Math.max(h,m)),c.lineTo(n-z,p),c.stroke(),Y(c,y,Math.min(h,m),D,Math.max(h,m),d,0,null,!1,!1,!1,!1))):"ohlc"===v.type&&(b.moveTo(n-z,r),b.lineTo(n-z,p),b.stroke(),b.beginPath(),b.moveTo(n,h),b.lineTo(y,h),b.stroke(),b.beginPath(),b.moveTo(n,m),b.lineTo(D,m),b.stroke(),w&&(d=W(B),c.strokeStyle=d,c.moveTo(n-z,r),c.lineTo(n-z,p),c.stroke(),c.beginPath(),c.moveTo(n,h),c.lineTo(y,h),c.stroke(),c.beginPath(),c.moveTo(n,m),c.lineTo(D,m),c.stroke()));(s[l].indexLabel||v.indexLabel||s[l].indexLabelFormatter||
v.indexLabelFormatter)&&this._indexLabels.push({chartType:v.type,dataPoint:s[l],dataSeries:v,point:{x:y+(D-y)/2,y:a.axisY.reversed?p:r},direction:1,bounds:{x1:y,y1:Math.min(r,p),x2:D,y2:Math.max(r,p)},color:d})}}w&&(f.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(k.x1,k.y1,k.width,k.height),c.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderBoxAndWhisker=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=0,l,n,h,r,p,m,e,d=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?
this.dataPointWidth:1,k=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.dataPointWidth?this.dataPointWidth:0.7*g.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&d>k&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&kk&&(t=k);b.save();w&&c.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();w&&(c.beginPath(),c.rect(g.x1,g.y1,g.width,g.height),c.clip());for(var q=!1,q=!!a.axisY.reversed,u=0;ua.axisX.dataInfo.viewPortMax)&&!x(G[k].y)&&G[k].y.length&&"number"===typeof G[k].y[0]&&"number"===typeof G[k].y[1]&&"number"===typeof G[k].y[2]&&"number"===typeof G[k].y[3]&&"number"===typeof G[k].y[4]&&5===G[k].y.length){l=a.axisX.convertValueToPixel(e);n=a.axisY.convertValueToPixel(G[k].y[0]);h=a.axisY.convertValueToPixel(G[k].y[1]);r=a.axisY.convertValueToPixel(G[k].y[2]);p=a.axisY.convertValueToPixel(G[k].y[3]);m=a.axisY.convertValueToPixel(G[k].y[4]);var D=l-t/2<<0,A=l+t/2<<0,d=G[k].color?
G[k].color:s._colorSet[0],z=Math.round(Math.max(1,0.15*t)),B=0===z%2?0:0.5,N=G[k].whiskerColor?G[k].whiskerColor:G[k].color?s.whiskerColor?s.whiskerColor:G[k].color:s.whiskerColor?s.whiskerColor:d,U="number"===typeof G[k].whiskerThickness?G[k].whiskerThickness:"number"===typeof s.options.whiskerThickness?s.whiskerThickness:z,ba=G[k].whiskerDashType?G[k].whiskerDashType:s.whiskerDashType,Z=x(G[k].whiskerLength)?x(s.options.whiskerLength)?t:s.whiskerLength:G[k].whiskerLength,Z="number"===typeof Z?0>=
Z?0:Z>=t?t:Z:"string"===typeof Z?parseInt(Z)*t/100>t?t:parseInt(Z)*t/100:t,O=1===Math.round(U)%2?0.5:0,I=G[k].stemColor?G[k].stemColor:G[k].color?s.stemColor?s.stemColor:G[k].color:s.stemColor?s.stemColor:d,ma="number"===typeof G[k].stemThickness?G[k].stemThickness:"number"===typeof s.options.stemThickness?s.stemThickness:z,sa=1===Math.round(ma)%2?0.5:0,P=G[k].stemDashType?G[k].stemDashType:s.stemDashType,M=G[k].lineColor?G[k].lineColor:G[k].color?s.lineColor?s.lineColor:G[k].color:s.lineColor?s.lineColor:
d,J="number"===typeof G[k].lineThickness?G[k].lineThickness:"number"===typeof s.options.lineThickness?s.lineThickness:z,V=G[k].lineDashType?G[k].lineDashType:s.lineDashType,K=1===Math.round(J)%2?0.5:0,R=s.upperBoxColor,cb=s.lowerBoxColor,L=x(s.options.fillOpacity)?1:s.fillOpacity,ha=s.dataPointIds[k];this._eventManager.objectMap[ha]={id:ha,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:D,y1:n,x2:A,y2:h,x3:l,y3:r,x4:l,y4:p,y5:m,borderThickness:z,color:d,stemThickness:ma,stemColor:I,whiskerThickness:U,
whiskerLength:Z,whiskerColor:N,lineThickness:J,lineColor:M};b.save();0=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;k=this.dataPointMaxWidth?this.dataPointMaxWidth:this.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.dataPointWidth?this.dataPointWidth:0.9*(d.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&&g>k&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k
k&&(h=k);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var r=0;ra.axisX.dataInfo.viewPortMax)&&!x(e[g].y)&&e[g].y.length&&"number"===typeof e[g].y[0]&&"number"===typeof e[g].y[1]){c=a.axisX.convertValueToPixel(n);k=a.axisY.convertValueToPixel(e[g].y[0]);l=a.axisY.convertValueToPixel(e[g].y[1]);var q=a.axisX.reversed?c+a.plotType.totalDataSeries*h/2-(a.previousDataSeriesCount+r)*h<<0:c-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+r)*h<<0,s=a.axisX.reversed?q-h<<0:q+h<<0,c=e[g].color?e[g].color:m._colorSet[g%m._colorSet.length];if(k>l){var v=k;k=
l;l=v}v=m.dataPointIds[g];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:g,x1:q,y1:k,x2:s,y2:l};Y(b,q,k,s,l,c,0,c,t,t,!1,!1,m.fillOpacity);c=W(v);w&&Y(this._eventManager.ghostCtx,q,k,s,l,c,0,null,!1,!1,!1,!1);if(e[g].indexLabel||m.indexLabel||e[g].indexLabelFormatter||m.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:e[g],dataSeries:m,indexKeyword:0,point:{x:q+(s-q)/2,y:e[g].y[1]>=e[g].y[0]?l:k},direction:e[g].y[1]>=e[g].y[0]?
-1:1,bounds:{x1:q,y1:Math.min(k,l),x2:s,y2:Math.max(k,l)},color:c}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:e[g],dataSeries:m,indexKeyword:1,point:{x:q+(s-q)/2,y:e[g].y[1]>=e[g].y[0]?k:l},direction:e[g].y[1]>=e[g].y[0]?1:-1,bounds:{x1:q,y1:Math.min(k,l),x2:s,y2:Math.max(k,l)},color:c})}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderError=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=a.axisY._position?
"left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=!1,k=this.plotArea,l=0,n,h,r,p,m,e,t,q=a.axisX.dataInfo.minDiff;isFinite(q)||(q=0.3*Math.abs(a.axisX.range));b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.clip());for(var s=0,v=0;vl&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&ll&&(v=l);if(0=N.length?0:N.length>=v?v:N.length:"string"===typeof N.length?parseInt(N.length)*v/100>v?v:
parseInt(N.length)*v/100>v:v;N.thickness="number"===typeof N.thickness?0>N.thickness?0:Math.round(N.thickness):2;var U={color:D[l].stemColor?D[l].stemColor:D[l].color?y.stemColor?y.stemColor:D[l].color:y.stemColor?y.stemColor:d,thickness:D[l].stemThickness?D[l].stemThickness:y.stemThickness,dashType:D[l].stemDashType?D[l].stemDashType:y.stemDashType};U.thickness="number"===typeof U.thickness?0>U.thickness?0:Math.round(U.thickness):2;D[l].getTime?t=D[l].x.getTime():t=D[l].x;if(!(ta.axisX.dataInfo.viewPortMax)&&!x(D[l].y)&&D[l].y.length&&"number"===typeof D[l].y[0]&&"number"===typeof D[l].y[1]){var ba=a.axisX.convertValueToPixel(t);c?h=ba:n=ba;ba=a.axisY.convertValueToPixel(D[l].y[0]);c?r=ba:m=ba;ba=a.axisY.convertValueToPixel(D[l].y[1]);c?p=ba:e=ba;c?(m=a.axisX.reversed?h+(A?s:1)*v/2-(A?B-1:0)*v<<0:h-(A?s:1)*v/2+(A?B-1:0)*v<<0,e=a.axisX.reversed?m-v<<0:m+v<<0):(r=a.axisX.reversed?n+(A?s:1)*v/2-(A?B-1:0)*v<<0:n-(A?s:1)*v/2+(A?B-1:0)*v<<0,p=a.axisX.reversed?r-v<<0:r+v<<0);
!c&&m>e&&(ba=m,m=e,e=ba);c&&r>p&&(ba=r,r=p,p=ba);ba=y.dataPointIds[l];this._eventManager.objectMap[ba]={id:ba,objectType:"dataPoint",dataSeriesIndex:G,dataPointIndex:l,x1:Math.min(r,p),y1:Math.min(m,e),x2:Math.max(p,r),y2:Math.max(e,m),isXYSwapped:c,stemProperties:U,whiskerProperties:N};z(b,Math.min(r,p),Math.min(m,e),Math.max(p,r),Math.max(e,m),d,N,U,c);w&&z(this._eventManager.ghostCtx,r,m,p,e,d,N,U,c);if(D[l].indexLabel||y.indexLabel||D[l].indexLabelFormatter||y.indexLabelFormatter)this._indexLabels.push({chartType:"error",
dataPoint:D[l],dataSeries:y,indexKeyword:0,point:{x:c?D[l].y[1]>=D[l].y[0]?r:p:r+(p-r)/2,y:c?m+(e-m)/2:D[l].y[1]>=D[l].y[0]?e:m},direction:D[l].y[1]>=D[l].y[0]?-1:1,bounds:{x1:c?Math.min(r,p):r,y1:c?m:Math.min(m,e),x2:c?Math.max(r,p):p,y2:c?e:Math.max(m,e)},color:d,axisSwapped:c}),this._indexLabels.push({chartType:"error",dataPoint:D[l],dataSeries:y,indexKeyword:1,point:{x:c?D[l].y[1]>=D[l].y[0]?p:r:r+(p-r)/2,y:c?m+(e-m)/2:D[l].y[1]>=D[l].y[0]?m:e},direction:D[l].y[1]>=D[l].y[0]?1:-1,bounds:{x1:c?
Math.min(r,p):r,y1:c?m:Math.min(m,e),x2:c?Math.max(r,p):p,y2:c?e:Math.max(m,e)},color:d,axisSwapped:c})}}}w&&(f.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(k.x1,k.y1,k.width,
k.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;k=this.dataPointMaxWidth?this.dataPointMaxWidth:
this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>k&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&
kk&&(r=k);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var p=0;pa.axisX.dataInfo.viewPortMax)&&!x(t[g].y)&&t[g].y.length&&"number"===typeof t[g].y[0]&&"number"===typeof t[g].y[1]){k=a.axisY.convertValueToPixel(t[g].y[0]);l=a.axisY.convertValueToPixel(t[g].y[1]);n=a.axisX.convertValueToPixel(h);n=a.axisX.reversed?n+a.plotType.totalDataSeries*r/2-(a.previousDataSeriesCount+p)*r<<0:n-a.plotType.totalDataSeries*r/2+(a.previousDataSeriesCount+p)*r<<0;var s=
a.axisX.reversed?n-r<<0:n+r<<0;k>l&&(c=k,k=l,l=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,k,n,l,s,c,0,null,q,!1,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:k,y1:n,x2:l,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,k,n,l,s,c,0,null,!1,!1,!1,!1);if(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:t[g],
dataSeries:e,indexKeyword:0,point:{x:t[g].y[1]>=t[g].y[0]?k:l,y:n+(s-n)/2},direction:t[g].y[1]>=t[g].y[0]?-1:1,bounds:{x1:Math.min(k,l),y1:n,x2:Math.max(k,l),y2:s},color:c}),this._indexLabels.push({chartType:"rangeBar",dataPoint:t[g],dataSeries:e,indexKeyword:1,point:{x:t[g].y[1]>=t[g].y[0]?l:k,y:n+(s-n)/2},direction:t[g].y[1]>=t[g].y[0]?1:-1,bounds:{x1:Math.min(k,l),y1:n,x2:Math.max(k,l),y2:s},color:c})}}}w&&(f.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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeArea=
function(a){function f(){if(u){var a=null;0=
a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;la.axisX.dataInfo.viewPortMax&&(!r.connectNullData||!N)))if(null!==p[e].y&&p[e].y.length&&"number"===typeof p[e].y[0]&&"number"===typeof p[e].y[1]){t=
a.axisX.convertValueToPixel(v);q=a.axisY.convertValueToPixel(p[e].y[0]);s=a.axisY.convertValueToPixel(p[e].y[1]);m||N?(r.connectNullData&&!m?(c.setLineDash&&(r.options.nullDataLineDashType||A===r.lineDashType&&r.lineDashType!==r.nullDataLineDashType)&&(n[n.length-1].newLineDashArray=J,A=r.nullDataLineDashType,c.setLineDash(B)),c.lineTo(t,q),w&&d.lineTo(t,q),n.push({x:t,y:s})):(c.beginPath(),c.moveTo(t,q),u={x:t,y:q},n=[],n.push({x:t,y:s}),w&&(d.beginPath(),d.moveTo(t,q))),N=m=!1):(c.lineTo(t,q),n.push({x:t,
y:s}),w&&d.lineTo(t,q),0==e%250&&f());v=r.dataPointIds[e];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:e,x1:t,y1:q,y2:s};ep[e].y[1]===a.axisY.reversed?-1:1,color:x}),this._indexLabels.push({chartType:"rangeArea",dataPoint:p[e],dataSeries:r,indexKeyword:1,point:{x:t,y:s},direction:p[e].y[0]>p[e].y[1]===a.axisY.reversed?1:-1,color:x})}else N||m||f(),N=!0;f();aa.drawMarkers(g)}}w&&(b.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(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderRangeSplineArea=function(a){function f(a,b){var e=y(q,2);if(0=a.dataSeriesIndexes.length)){var d=
this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;la.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!e)))if(null!==r[p].y&&r[p].y.length&&"number"===typeof r[p].y[0]&&"number"===typeof r[p].y[1]){m=a.axisX.convertValueToPixel(m);e=a.axisY.convertValueToPixel(r[p].y[0]);t=a.axisY.convertValueToPixel(r[p].y[1]);
var B=h.dataPointIds[p];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:p,x1:m,y1:e,y2:t};q[q.length]={x:m,y:e};s[s.length]={x:m,y:t};p=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,d=null,g=this.plotArea,k=0,l,n,h,r,p=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*
this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.dataPointWidth?this.dataPointWidth:0.6*(g.width*(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&&k>n&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(m=n);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var e=0;eh&&(d=n,n=h,h=d);a.axisY.reversed&&(d=n,n=h,h=d);d=q.dataPointIds[k];this._eventManager.objectMap[d]={id:d,objectType:"dataPoint",
dataSeriesIndex:t,dataPointIndex:k,x1:l,y1:n,x2:J,y2:h};var N=s[k].color?s[k].color:-1s[k].y===a.axisY.reversed?1:-1,bounds:{x1:l,y1:Math.min(n,h),x2:J,y2:Math.max(n,h)},color:d})}}w&&(f.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(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};var qa=function(a,f,b,c,d,g,k,l,n){if(!(0>b)){"undefined"===typeof l&&(l=1);if(!w){var h=Number((k%(2*Math.PI)).toFixed(8));Number((g%(2*Math.PI)).toFixed(8))===h&&(k-=1E-4)}a.save();a.globalAlpha=l;"pie"===d?(a.beginPath(),a.moveTo(f.x,f.y),a.arc(f.x,f.y,
b,g,k,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===d&&(a.beginPath(),a.arc(f.x,f.y,b,g,k,!1),0<=n&&a.arc(f.x,f.y,n*b,k,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};u.prototype.renderPie=function(a){function f(){if(h&&r){for(var a=0,b=0,c=0,d=0,f=0;fMath.PI/2-v&&l.midAnglel.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v){if(0===b||e[d].midAngle>l.midAngle)d=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new ka(n.plotArea.ctx,{fontSize:l.indexLabelFontSize,fontFamily:l.indexLabelFontFamily,fontColor:l.indexLabelFontColor,fontStyle:l.indexLabelFontStyle,fontWeight:l.indexLabelFontWeight,horizontalAlign:"left",backgroundColor:l.indexLabelBackgroundColor,
maxWidth:l.indexLabelMaxWidth,maxHeight:l.indexLabelWrap?5*l.indexLabelFontSize:1.5*l.indexLabelFontSize,text:l.indexLabelText,padding:0,textBaseline:"top"});l.indexLabelTextBlock.measureText()}k=g=0;p=!1;for(f=0;fMath.PI/2-v&&l.midAngle3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v)&&(k<=b/2&&!p?(l.hemisphere=
"left",k++):(l.hemisphere="right",p=!0))}}function b(a){var b=n.plotArea.ctx;b.clearRect(m.x1,m.y1,m.width,m.height);b.fillStyle=n.backgroundColor;b.fillRect(m.x1,m.y1,m.width,m.height);for(b=0;bc){var f=0.07*A*Math.cos(e[b].midAngle),g=0.07*A*Math.sin(e[b].midAngle),k=!1;if(r[b].exploded){if(1E-9a.indexLabelTextBlock.y?e-d:c-f}function d(a){for(var b=null,d=1;dc(e[b],e[a])||("right"===e[a].hemisphere?e[b].indexLabelTextBlock.y>=e[a].indexLabelTextBlock.y:e[b].indexLabelTextBlock.y<=e[a].indexLabelTextBlock.y)))break;
else b=null;return b}function g(a,b,f){f=(f||0)+1;if(1E3b&&l.indexLabelTextBlock.ym)return 0;var n=0,p=0,p=n=n=0;0>b?l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2>k&&l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2+bm&&(b=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+b-m);b=l.indexLabelTextBlock.y+b;k=0;k="right"===l.hemisphere?w.x+Math.sqrt(Math.pow(q,2)-Math.pow(b-w.y,2)):w.x-Math.sqrt(Math.pow(q,2)-Math.pow(b-w.y,2));p=w.x+A*Math.cos(l.midAngle);n=w.y+A*Math.sin(l.midAngle);n=Math.sqrt(Math.pow(k-p,2)+Math.pow(b-n,2));p=Math.acos(A/q);n=Math.acos((q*q+A*A-n*n)/(2*A*q));b=nc(e[k],e[a])||("right"===e[a].hemisphere?e[k].indexLabelTextBlock.y<=e[a].indexLabelTextBlock.y:e[k].indexLabelTextBlock.y>=e[a].indexLabelTextBlock.y)))break;else k=null;p=k;n=d(a);m=k=0;0>b?(m="right"===l.hemisphere?p:n,h=b,null!==m&&(p=-b,b=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2-(e[m].indexLabelTextBlock.y+e[m].indexLabelTextBlock.height/2),b-p
+k.toFixed(u)&&(h=b>t?-(b-t):-(p-(m-k)))))):0t?b-t:p-(k-m)))));h&&(f=l.indexLabelTextBlock.y+h,b=0,b="right"===l.hemisphere?w.x+Math.sqrt(Math.pow(q,2)-Math.pow(f-w.y,2)):w.x-Math.sqrt(Math.pow(q,2)-Math.pow(f-w.y,2)),l.midAngle>Math.PI/2-v&&l.midAnglek.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===l.hemisphere&&("left"===a.hemisphere&&b3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v&&(k=(a-1+e.length)%e.length,k=e[k],a=e[(a+1+e.length)%e.length],"right"===l.hemisphere&&"left"===k.hemisphere&&ba.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),l.indexLabelTextBlock.y=f,l.indexLabelTextBlock.x=b,l.indexLabelAngle=Math.atan2(l.indexLabelTextBlock.y-w.y,l.indexLabelTextBlock.x-w.x))}return h}function k(){var a=n.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,f=0,k=!0,b=0;10>b&&(1>b||0z){for(var D=x=0,F=0;Fx?l.indexLabelText="":l.indexLabelTextBlock.maxWidth=0.85*x,0.3*l.indexLabelTextBlock.maxWidthf&&(f=y)),y=y=0,0f&&(f=y)));var K=function(a,b,c){for(var d=[],f=0;d.push(e[b]),b!==c;b=(b+1+r.length)%r.length);d.sort(function(a,b){return a.y-b.y});for(b=0;bz){m=v.indexLabelTextBlock.x;var n=v.indexLabelTextBlock.y-v.indexLabelTextBlock.height/2,t=v.indexLabelTextBlock.y+v.indexLabelTextBlock.height/2,q=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2,s=l.indexLabelTextBlock.x+l.indexLabelTextBlock.width,u=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2;m=v.indexLabelTextBlock.x+v.indexLabelTextBlock.widths+p||n>u+p||ta&&(a=k),h!==a&&(b=h,f+=-z),0===k%Math.max(r.length/
10,3)&&(g=!0)):g=!0;g&&(0=a.dataSeriesIndexes.length)){var h=this.data[a.dataSeriesIndexes[0]],r=h.dataPoints,p=10,m=this.plotArea,e=h.dataPointEOs,t=2,q,s=1.3,v=20/180*Math.PI,u=6,w={x:(m.x2+m.x1)/2,y:(m.y2+m.y1)/2},y=0;a=!1;for(var z=0;za&&(d=a,f=!0);var g=r[b].color?r[b].color:h._colorSet[b%h._colorSet.length];d>c&&qa(n.plotArea.ctx,e[b].center,e[b].radius,g,h.type,c,d,h.fillOpacity,e[b].percentInnerRadius);if(f)break}l()},function(){n.disableToolTip=!1;n._animator.animate(0,n.animatedRender?500:0,function(a){b(a);l()})})}}};var wa=function(a,f,b,c){"undefined"===typeof b&&(b=1);0>=Math.round(f.y4-f.y1)||(a.save(),a.globalAlpha=b,a.beginPath(),a.moveTo(Math.round(f.x1),Math.round(f.y1)),a.lineTo(Math.round(f.x2),
Math.round(f.y2)),a.lineTo(Math.round(f.x3),Math.round(f.y3)),a.lineTo(Math.round(f.x4),Math.round(f.y4)),"undefined"!==f.x5&&(a.lineTo(Math.round(f.x5),Math.round(f.y5)),a.lineTo(Math.round(f.x6),Math.round(f.y6))),a.closePath(),a.fillStyle=c?c:f.color,a.fill(),a.globalAplha=1,a.restore())};u.prototype.renderFunnel=function(a){function f(){for(var a=0,b=[],c=0;csqrt?(m=c,h=(b+m)*(e-l)/2,a-=h,h=e-l,l+=e-l,h+=0==m?0:a/m,l+=a/m,n=!0):(h=(Math.abs(da)*b-Math.sqrt(sqrt))/2,m=b-2*h/Math.abs(da),l+=h,l>e&&(l-=h,m=c,h=(b+m)*(e-l)/2,a-=h,h=e-l,l+=e-l,h+=a/m,l+=a/m,n=!0),b=m)),d.push(h);return d}function c(){if(v&&u){for(var a,b,c,d,f,g,h,k,l,m,n,p,r,t,q=[],x=[],y={percent:null,total:null},A=null,z=0;zq[z]&&(q[z]=z!==ea?v.reversed?L[z].x3-L[z].x4:L[z].x2-L[z].x1:L[z].x2-L[z].x1,q[z]/=2));r=b.indexLabelMaxWidth||v.indexLabelMaxWidth||q[z];if(r>q[z]||0>r)r=q[z];x[z]="inside"===v.indexLabelPlacement?L[z].height:!1;y=s.getPercentAndTotal(v,b);if(v.indexLabelFormatter||b.indexLabelFormatter)A={chart:s.options,dataSeries:v,dataPoint:b,
total:y.total,percent:y.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(A):b.indexLabel?s.replaceKeywordsWithValue(b.indexLabel,b,v,z):v.indexLabelFormatter?v.indexLabelFormatter(A):v.indexLabel?s.replaceKeywordsWithValue(v.indexLabel,b,v,z):b.label?b.label:"";0>=m&&(m=0);1E3>r&&1E3-rg?g:v.indexLabelMaxWidth:g,h=H.length-1;0<=h;h--){dataPoint=u[H[h].id];c=H[h];d=c.textBlock;b=(a=m(h)b.y&&(e=!0);c=dataPoint.indexLabelMaxWidth||
g;if(c>g||0>c)c=g;f.push(c)}if(e)for(h=H.length-1;0<=h;h--)a=L[h],H[h].textBlock.maxWidth=f[f.length-(h+1)],H[h].textBlock.measureText(),H[h].textBlock.x=J-g,c=H[h].textBlock.height
T+z&&(H[h].textBlock.y=T+z-H[h].height),H[h].textBlock.yX+z&&(H[h].textBlock.y=X+z-H[h].height))}function g(){var a,b,c,d;if("inside"!==v.indexLabelPlacement)for(var f=0;f$?e(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?
c<$?e(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,H[f].textBlock.x=b+M,H[f].textBlock.y=c-H[f].height/2,v.reversed?(H[f].textBlock.y+H[f].height>T+z&&(H[f].textBlock.y=T+z-H[f].height),H[f].textBlock.yX+z&&(H[f].textBlock.y=X+z-H[f].height)));else for(f=0;f=c?(b=f!=ea?(a.x4+a.x3)/2-d/2:(a.x5+
a.x4)/2-d/2,c=f!=ea?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,H[f].textBlock.x=b,H[f].textBlock.y=c):H[f].isDirty=!0)}function k(){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=p(b);d=l(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0=c)return f.y+=c,c;if(b==L.length-1)return 0e)&&(k=m(r),!(k>=H.length-1)&&H[r].textBlock.y+H[r].height+fa>H[k].textBlock.y&&(H[r].textBlock.y=H[r].textBlock.y+H[r].height-e>e-H[r].textBlock.y?e+1:e-H[r].height-1))}for(k=L.length-1;0e&&(e=0,H[e].isDirty))break;if(H[k].textBlock.y=f){f=0;h+=H[f].height;break}e=p(f);if(0>e){f=0;h+=H[f].height;break}}if(f!=k){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(L[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d+k.y.toFixed(6))&&(d=g.y+d+fa-k.y,e=a(t,-d),ea?v.reversed?X-z:T-z:H[a].textBlock.y+H[a].height+fa)}function n(a,
b,c){function d(b,c,f,h){ia=!0;var k=((new Date).getTime()-f.startTime)/f.duration,k=f.easingFunction(f.startTime,k,0,f.duration/1E3);1<=k&&(k=1);e(c);f.changeSection(k,b);var l={};l.dataSeries=v;l.dataPoint=v.reversed?v.dataPoints[u.length-1-b]:v.dataPoints[b];l.index=v.reversed?u.length-1-b:b;a.toolTip.highlightObjects([l]);for(l=0;ls&&(s*=-1),c.y1+=newY-s[d],c.y2+=newY-s[d],c.y3+=newY-s[d],c.y4+=newY-s[d],c.y5&&(c.y5+=newY-s[d],c.y6+=newY-s[d]),s[d]=newY}};d(b,
a.ctx,c,a)}function h(){for(var a=0,b=0;ba){b=L[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 t(a){for(var b=0;b=a.dataSeriesIndexes.length)){for(var v=this.data[a.dataSeriesIndexes[0]],u=v.dataPoints,y=this.plotArea,z=0.025*y.width,D=0.01*y.width,A=!1,B=0;BP?O=P:0>=O&&(O=!0),I>D?I=D-0.5:0>=I&&(I=!0)):"pyramid"===v.type&&(I=O=!0,v.reversed=v.reversed?!1:!0);O=O?"number"===typeof O?O:0:0.35*P;I=I?"number"===typeof I?I:0:0.25*D;var R=B+D/2,W=B,S=B+D,T=v.reversed?U:N,Y=R-I/2,K=R+I/2,$=v.reversed?N+O:U-O,X=v.reversed?N:U,D=[],R=[],L=[],ha=[],ca=N,ea,da=($-T)/(Y-W),ga=-da,B="area"===(v.valueRepresents?v.valueRepresents:"height")?b():f();if(-1!==B){if(v.reversed)for(ha.push(ca),I=B.length-1;0\n');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(f)},1E3)},500)};u.prototype.getPercentAndTotal=function(a,f){var b=null,c=null,d=null;if(0<=a.type.indexOf("stacked"))c=0,b=f.x.getTime?f.x.getTime():f.x,b in a.plotUnit.yTotals&&(c=a.plotUnit.yTotals[b],d=isNaN(f.y)?0:100*(f.y/c));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(i=c=0;i=k||"undefined"===typeof k||0>=y||"undefined"===typeof y)){if("horizontal"===this.orientation){e.textBlock=new ka(this.ctx,{x:0,y:0,maxWidth:y,maxHeight:this.itemWrap?k:this.lineHeight,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,
fontStyle:this.fontStyle,textBaseline:"middle"});e.textBlock.measureText();null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0)));if(!m||m.width+Math.round(e.textBlock.width+s+l+(0===m.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)m={items:[],width:0},h.push(m),this.height+=w,w=0;w=Math.max(w,e.textBlock.height)}else e.textBlock=
new ka(this.ctx,{x:0,y:0,maxWidth:y,maxHeight:!0===this.itemWrap?k:1.5*this.fontSize,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),e.textBlock.measureText(),null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))),this.height>0,0),this.dataPoints.length):0):(r=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,r=0>0,0),this.dataPoints.length):0));for(;;){g=0a?c.x/a:a/c.x:Math.abs(c.x-a);pr-d&&r+d>=this.dataPoints.length)break;-1===k?(d++,k=1):k=-1}return f||b.dataPoint.x!==a?f&&null!==b.dataPoint?b:null:b};R.prototype.getDataPointAtXY=function(a,f,b){if(!this.dataPoints||0===this.dataPoints.length||athis.chart.plotArea.x2||fthis.chart.plotArea.y2)return null;b=b||!1;var c=[],d=0,g=0,k=1,l=!1,n=Infinity,h=0,r=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=
(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:f}),this.axisX.logarithmic)var m=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1>0,0),this.dataPoints.length):0;else m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0>0,0),this.dataPoints.length):0;for(;;){g=0<
k?p+d:p-d;if(0<=g&&g=m.x1&&(a<=m.x2&&f>=m.y1&&f<=m.y2)&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y1-f),Math.abs(m.y2-
f))}),l=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var q=ja("markerSize",e,this)||4,s=b?20:q,t=Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y1-f,2));t<=s&&c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t});m=Math.abs(m.x1-a);m<=n?n=m:0s&&(t=Math.atan2(f-q.y,a-q.x),0>t&&(t+=2*Math.PI),t=Number(((180*(t/Math.PI)%360+360)%360).toFixed(12)),q=Number(((180*(m.startAngle/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(m.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===s&&1=s&&0!==e.y&&(s+=360,tq&&tt.y1&&ft.y6?(g=t.x6+(t.x5-t.x6)/
(t.y5-t.y6)*(f-t.y6),t=t.x3+(t.x4-t.x3)/(t.y4-t.y3)*(f-t.y3)):(g=t.x1+(t.x6-t.x1)/(t.y6-t.y1)*(f-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(f-t.y2)):(g=t.x1+(t.x4-t.x1)/(t.y4-t.y1)*(f-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(f-t.y2)),a>g&&a=m.x1-m.borderThickness/2&&a<=m.x2+m.borderThickness/2&&f>=m.y4-m.borderThickness/2&&f<=m.y1+m.borderThickness/2||Math.abs(m.x2-a+m.x1-a)=m.y1&&f<=m.y4)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-f))}),l=!0;break;case "candlestick":if(a>=m.x1-m.borderThickness/2&&a<=m.x2+m.borderThickness/2&&f>=m.y2-m.borderThickness/2&&f<=m.y3+m.borderThickness/2||Math.abs(m.x2-a+m.x1-a)=m.y1&&f<=m.y4)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-
f))}),l=!0;break;case "ohlc":if(Math.abs(m.x2-a+m.x1-a)=m.y2&&f<=m.y3||a>=m.x1&&a<=(m.x2+m.x1)/2&&f>=m.y1-m.borderThickness/2&&f<=m.y1+m.borderThickness/2||a>=(m.x1+m.x2)/2&&a<=m.x2&&f>=m.y4-m.borderThickness/2&&f<=m.y4+m.borderThickness/2)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-f))}),l=!0}if(l||1E3p-d&&p+d>=this.dataPoints.length)break;-1===k?(d++,k=1):
k=-1}a=null;for(f=0;fm[t].endValue;t++);p=a;a=t=m[t].startValue&&a<=m[t].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]:za(p,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,{x:0,y:0,maxWidth:g,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:k,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",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}))}}else{d=this.viewportMaximum;if(this.labels){a=Math.ceil(l);c=Math.ceil(this.intervalStartPosition);t=!1;for(b=c;bm[t].endValue;t++);a=t=m[t].startValue&&b<=m[t].endValue;p=b;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]:ea(p,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,
{x:0,y:0,maxWidth:g,maxHeight:k,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,horizontalAlign:"left",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}))}t=
e;for(b=this.intervalStartPosition;b<=d;b=parseFloat((this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,this.interval):b+this.interval).toFixed(12))){for(;tm[t].endValue;t++);a=t=m[t].startValue&&b<=m[t].endValue;p=b;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]:ea(p,this.valueFormatString,this.chart._cultureInfo),
a=new ka(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:k,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",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}))}}if("bottom"===
this._position||"top"===this._position)n=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))*M[this.intervalType+"Duration"]*this.interval,
g="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(k="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)n=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))*M[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),k="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(c=0;cthis.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*n>>0,e=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;
this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=k;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;be&&(q=b,e=l.width)}b=0;for(b=this.intervalStartPosition>0>2*g&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle):x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelMaxWidth=g,p.width+f.width>>
0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth))this.options.labelMaxWidth>0,t=this.labelFontSize,ed&&(d=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth=g,x(this.options.labelFontSize)&&12=2.2*g&&c<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=t):c>=2.8*g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,e),this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*g&&c<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=this.labelFontSize):c>3.6*g&&c<5*g?(x(this.options.labelFontSize)&&125*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=t,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelAngle=this.labelAngle));else if(q===b&&(0===q&&e+this._labels[q+1].textBlock.measureText().width-2*g>d||q===this._labels.length-1&&e+this._labels[q-1].textBlock.measureText().width-2*g>d||0d&&e+this._labels[q-1].textBlock.measureText().width-
2*g>d))d=0===q?e+this._labels[q+1].textBlock.measureText().width-2*g:e+this._labels[q-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l;else if(0===d)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,c=0;c>0>2*g&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?k:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/
Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),l=0!=this.labelAngle?(r-(h+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):g,this.sessionVariables.labelMaxHeight=k=this.labelWrap?(r-l*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,x(this.options.labelWrap))?x(this.options.labelWrap)&&(this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=
this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelMaxHeight=k):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelMaxHeight=c<0.9*n?0.9*n:c,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l):
(x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=k)}for(c=0;c>0:this.options.labelMaxWidth,k="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=
g;this.sessionVariables.labelMaxHeight=k;this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b