b.max&&(b.max=c);if(0w&&(w=1/
w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-m.dataPoints[p-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);null!==f&&null!==m.dataPoints[p-1].y&&(a.axisY.logarithmic?0w&&(w=1/w),d.minDiff>w&&1!==w&&(d.minDiff=w)):(w=f-m.dataPoints[p-1].y,0>w&&(w*=-1),d.minDiff>w&&0!==w&&(d.minDiff=w)))}if(cv&&!q)q=!0;else if(c>v&&q)continue;m.dataPoints[p].label&&(a.axisX.labels[c]=m.dataPoints[p].label);
cb.viewPortMax&&(b.viewPortMax=c);null===m.dataPoints[p].y?b.viewPortMin===c&&rd.max&&(d.max=a),pb.viewPortMax||(ad.viewPortMax&&
(d.viewPortMax=a)));for(p in l)l.hasOwnProperty(p)&&!isNaN(p)&&(a=l[p],ad.max&&(d.max=a),pb.viewPortMax||(ad.viewPortMax&&(d.viewPortMax=a)))}};A.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=!1,l=!1,k=[],n=0;nb.max&&(b.max=c);if(0w&&(w=1/w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-m.dataPoints[p-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);x(f)||null===m.dataPoints[p-1].y||(a.axisY.logarithmic?0w&&(w=1/w),d.minDiff>w&&1!==w&&(d.minDiff=w)):(w=f-m.dataPoints[p-1].y,0>w&&(w*=-1),d.minDiff>w&&0!==w&&(d.minDiff=w)))}if(cv&&!q)q=!0;else if(c>v&&q)continue;m.dataPoints[p].label&&(a.axisX.labels[c]=m.dataPoints[p].label);
cb.viewPortMax&&(b.viewPortMax=c);null===f?b.viewPortMin===c&&rf&&(l=!0),k[c]=k[c]?k[c]+Math.abs(f):Math.abs(f))}}this.plotInfo.axisXValueType=m.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(d.max=x(d.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(d.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),d.min=x(d.viewPortMin)?1:Math.min(d.viewPortMin,
1)):h&&!l?(d.max=x(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=x(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):h&&l?(d.max=x(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=x(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99)):!h&&l&&(d.max=x(d.viewPortMax)?-1:Math.max(d.viewPortMax,-1),d.min=x(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99));d.viewPortMin=d.min;d.viewPortMax=d.max;a.dataPointYSums=k}};A.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d=
a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g,h,l=!1,k=0;kb.max&&(b.max=c);gd.max&&(d.max=h);0r&&(r=1/r),b.minDiff>r&&1!==r&&(b.minDiff=r)):(r=c-n.dataPoints[m-1].x,0>r&&(r*=-1),b.minDiff>r&&0!==r&&(b.minDiff=r)),f&&(null!==f[0]&&n.dataPoints[m-1].y&&null!==n.dataPoints[m-1].y[0])&&(a.axisY.logarithmic?(r=f[0]/
n.dataPoints[m-1].y[0],1>r&&(r=1/r),d.minDiff>r&&1!==r&&(d.minDiff=r)):(r=f[0]-n.dataPoints[m-1].y[0],0>r&&(r*=-1),d.minDiff>r&&0!==r&&(d.minDiff=r))));if(!(cw&&!e)e=!0;else if(c>w&&e)continue;n.dataPoints[m].label&&(a.axisX.labels[c]=n.dataPoints[m].label);cb.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&f)for(y=0;yd.viewPortMax&&(d.viewPortMax=h))}}this.plotInfo.axisXValueType=n.xValueType=l?"dateTime":"number"}};A.prototype.getDataPointAtXY=function(a,d,b){b=b||!1;for(var c=[],f=this._dataInRenderedOrder.length-1;0<=f;f--){var g=null;(g=this._dataInRenderedOrder[f].getDataPointAtXY(a,d,b))&&c.push(g)}a=null;d=!1;for(b=0;b=f.x1&&(a<=f.x2&&d>=f.y1&&d<=f.y2)&&(c=f.id)}return c};A.prototype.getAutoFontSize=function(a,d,b){a/=400;return Math.max(10,Math.round(Math.min(this.width,this.height)*a))};A.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};A.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))};A.prototype.attachEvent=
function(a){this._events.push(a)};A.prototype._touchEventHandler=function(a){if(a.changedTouches&&this.interactivityEnabled){var d=[],b=a.changedTouches,c=b?b[0]:a,f=null;switch(a.type){case "touchstart":case "MSPointerDown":d=["mousemove","mousedown"];this._lastTouchData=xa(c);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":d=["mousemove"];break;case "touchend":case "MSPointerUp":d="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType?["mouseup",
"click"]:["mouseup"];break;default:return}if(!(b&&1h)){this._lastTouchData.scroll=!0;var l=window.parent||window;l&&l.scrollBy&&l.scrollBy(0,-g)}}catch(k){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(b=0;b=f.x1&&d.x<=f.x2&&d.y>=f.y1&&d.y<=f.y2){c[b].call(c.context,d.x,d.y);"mousedown"===b&&!0===c.capture?(A.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(d.xb.x2||d.yb.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};A.prototype._plotAreaMouseDown=
function(a,d){this.isDrag=!0;this.dragStartPoint={x:a,y:d}};A.prototype._plotAreaMouseUp=function(a,d){if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var b=d-this.dragStartPoint.y,c=a-this.dragStartPoint.x,f=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),h=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=f,f=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(f=g=0;fb.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,h=!0):b.viewportMinimumb.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,h=!0);else if((!f||2Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,d);if((!f||2e)var q=e,e=p,p=q;if(isFinite(h.dataInfo.minDiff))if(!(h.logarithmic&&e/ph.maximum))k.push(h),m.push({val1:p,val2:e}),l=!0;else if(!f){l=!1;break}}return{isValid:l,axesWithValidRange:k,axesRanges:m}};A.prototype.preparePlotArea=function(){var a=this.plotArea;!u&&(0b.lineCoordinates.x2?d.x2:b.lineCoordinates.x2;a.y2=d.y2>d.y1?d.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0b.lineCoordinates.x2?d.x2:b.lineCoordinates.x2,a.y2=d.y2>d.y1?d.y2:b.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;u||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0Z.viewportMaximum||n.dataPoint.yaa.viewportMaximum)continue}else if(0<=m.indexOf("column")){if(n.dataPoint.xZ.viewportMaximum||n.bounds.y1>b.y2||n.bounds.y2Z.viewportMaximum||n.bounds.x1>
b.x2||n.bounds.x2Z.viewportMaximum)continue;f=h=2;"horizontal"===y?(l=q.width,k=q.height):(k=q.width,l=q.height);if("normal"===this.plotInfo.axisPlacement){if(0<=m.indexOf("line")||0<=m.indexOf("area"))w="auto",h=4;else if(0<=m.indexOf("stacked"))"auto"===w&&(w="inside");else if("bubble"===m||"scatter"===m)w="inside";p=n.point.x-l/2;"inside"!==w?(f=b.y1,g=b.y2,0n.point.y)):(e=n.point.y+h+c,e>g-k-h-c&&(e="auto"===w?Math.min(n.point.y,g)-k-h-c:g-k-h-c,z=eg-k-h&&("bubble"===m||"scatter"===m)&&
(e=Math.min(n.point.y+h,b.y2-k-h))),e=Math.min(e,g-k))}else 0<=m.indexOf("line")||0<=m.indexOf("area")||0<=m.indexOf("scatter")?(w="auto",f=4):0<=m.indexOf("stacked")?"auto"===w&&(w="inside"):"bubble"===m&&(w="inside"),e=n.point.y-k/2,"inside"!==w?(h=b.x1,g=b.x2,0>D?(p=n.point.x-l-f-c,pn.point.x)):(p=n.point.x+f+c,p>g-l-f-c&&(p="auto"===w?Math.min(n.point.x,g)-l-f-c:g-l-f-c,z=pD?Math.max(n.bounds.x1,b.x1)+l/2+f:Math.min(n.bounds.x2,b.x2)-l/2-f:(Math.max(n.bounds.x1,b.x1)+Math.min(n.bounds.x2,b.x2))/2,p=0>D?Math.max(n.point.x,c)-l/2:Math.min(n.point.x,c)-l/2,p=Math.max(p,h));"vertical"===y&&(e+=k);q.x=p;q.y=e;q.render(!0);v&&("inside"!==w&&(0>m.indexOf("bar")&&n.point.x>b.x1&&n.point.xm.indexOf("column")&&n.point.y>b.y1&&n.point.y=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;d.save();var c=this.plotArea;d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();for(var c=[],f=null,g=0;ga.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!y)))if("number"!==typeof k[s].y)0k[s].y===a.axisY.reversed?1:-1,color:e})}d.stroke();u&&b.stroke()}}O.drawMarkers(c);
l.markerColor=f;d.restore();d.beginPath();u&&b.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;d.save();var c=this.plotArea;d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();for(var c=[],f=null,g=0;ga.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!y)))if("number"!==typeof k[s].y)0k[s].y===a.axisY.reversed?1:-1,color:e})}d.stroke();u&&b.stroke()}}O.drawMarkers(c);l.markerColor=f;d.restore();d.beginPath();u&&b.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderSpline=function(a){function d(a){a=ua(a,2);if(0=a.dataSeriesIndexes.length)){var c=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 f=[],g=null,h=0;ha.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!w)))if("number"!==typeof n[s].y)0n[s].y===a.axisY.reversed?1:-1,color:q});w=!1}d(y)}O.drawMarkers(f);k.markerColor=g;b.restore();b.beginPath();u&&c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};var N=function(a,d,b,c,f,g,h,l,k,n,m,p,e){"undefined"===typeof e&&(e=1);h=h||0;l=l||"black";
var q=15=a.dataSeriesIndexes.length)){var b=null,
c=this.plotArea,f=0,g,h,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.dataPointMinWidth=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=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,m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.dataPointWidth=
this.dataPointWidth?this.dataPointWidth:0.9*(c.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&&f>n&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(m=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,
c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(c=0;ca.axisX.dataInfo.viewPortMax)&&"number"===typeof e[f].y){g=a.axisX.convertValueToPixel(l);h=
a.axisY.convertValueToPixel(e[f].y);g=a.axisX.reversed?g+a.plotType.totalDataSeries*m/2-(a.previousDataSeriesCount+c)*m<<0:g-a.plotType.totalDataSeries*m/2+(a.previousDataSeriesCount+c)*m<<0;var r=a.axisX.reversed?g-m<<0:g+m<<0,s;0<=e[f].y?s=k:(s=h,h=k);h>s&&(b=h,h=s,s=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,g,h,r,s,b,0,null,q&&0<=e[f].y,0>e[f].y&&q,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,
x1:g,y1:h,x2:r,y2:s};b=G(b);u&&N(this._eventManager.ghostCtx,g,h,r,s,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:e[f],dataSeries:p,point:{x:g+(r-g)/2,y:0>e[f].y===a.axisY.reversed?h:s},direction:0>e[f].y===a.axisY.reversed?1:-1,bounds:{x1:g,y1:Math.min(h,s),x2:r,y2:Math.max(h,s)},color:b})}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(k,a.axisY.bounds.y2);return{source:d,
dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth?this.dataPointMaxWidth:
this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>m&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(p=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(m=0;ma.axisX.dataInfo.viewPortMax)&&"number"===typeof r[l].y){var c=a.axisX.convertValueToPixel(b),v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic)h[b]=r[l].y+(h[b]?h[b]:0),0r[l].y&&s,!1,!1,q.fillOpacity);b=q.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:k,x2:w,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,k,w,y,b,0,null,!1,!1,!1,!1);(r[l].indexLabel||q.indexLabel||r[l].indexLabelFormatter||q.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:r[l],dataSeries:q,point:{x:c,y:0<=r[l].y?k:y},direction:0>r[l].y===a.axisY.reversed?1:
-1,bounds:{x1:v,y1:Math.min(k,y),x2:w,y2:Math.max(k,y)},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(n,a.axisY.bounds.y2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedColumn100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?
a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&
l>m&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(p=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(m=0;ma.axisX.dataInfo.viewPortMax)&&"number"===typeof r[l].y){c=a.axisX.convertValueToPixel(b);k=0!==a.dataPointYSums[b]?100*(r[l].y/a.dataPointYSums[b]):0;var v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic){h[b]=k+(h[b]?h[b]:0);if(0>=h[b])continue;k=a.axisY.convertValueToPixel(h[b]);
y=f[b]?f[b]:n;f[b]=k}else if(k=a.axisY.convertValueToPixel(k),0<=r[l].y){var t=f[b]?f[b]:0;k-=t;y=n-t;f[b]=t+(y-k)}else t=g[b]?g[b]:0,y=k+t,k=n+t,g[b]=t+(y-k);b=r[l].color?r[l].color:q._colorSet[l%q._colorSet.length];N(d,v,k,w,y,b,0,null,s&&0<=r[l].y,0>r[l].y&&s,!1,!1,q.fillOpacity);b=q.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:k,x2:w,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,k,w,y,b,0,null,!1,!1,!1,!1);(r[l].indexLabel||
q.indexLabel||r[l].indexLabelFormatter||q.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:r[l],dataSeries:q,point:{x:c,y:0<=r[l].y?k:y},direction:0>r[l].y===a.axisY.reversed?1:-1,bounds:{x1:v,y1:Math.min(k,y),x2:w,y2:Math.max(k,y)},color:b})}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(n,a.axisY.bounds.y2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderBar=
function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,m=a.axisX.dataInfo.minDiff;isFinite(m)||
(m=0.3*Math.abs(a.axisX.range));m=this.dataPointWidth?this.dataPointWidth:0.9*(c.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>n&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(m=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();
d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(c=0;ca.axisX.dataInfo.viewPortMax)&&"number"===
typeof e[f].y){h=a.axisX.convertValueToPixel(l);g=a.axisY.convertValueToPixel(e[f].y);h=a.axisX.reversed?h+a.plotType.totalDataSeries*m/2-(a.previousDataSeriesCount+c)*m<<0:h-a.plotType.totalDataSeries*m/2+(a.previousDataSeriesCount+c)*m<<0;var r=a.axisX.reversed?h-m<<0:h+m<<0,s;0<=e[f].y?s=k:(s=g,g=k);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,s,h,g,r,b,0,null,q,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:n,
dataPointIndex:f,x1:s,y1:h,x2:g,y2:r};b=G(b);u&&N(this._eventManager.ghostCtx,s,h,g,r,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:e[f],dataSeries:p,point:{x:0<=e[f].y?g:s,y:h+(r-h)/2},direction:0>e[f].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(s,g),y1:h,x2:Math.max(s,g),y2:r},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(k,a.axisX.bounds.x2);return{source:d,
dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?
this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>m&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(p=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(m=0;ma.axisX.dataInfo.viewPortMax)&&"number"===typeof r[l].y){var c=a.axisX.convertValueToPixel(b),v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic)h[b]=r[l].y+(h[b]?h[b]:0),0r[l].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(y,
k),y1:v,x2:Math.max(y,k),y2:w},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(n,a.axisX.bounds.x2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedBar100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:
0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>m&&(l=Math.min(this.dataPointWidth?
this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(p=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(m=0;ma.axisX.dataInfo.viewPortMax)&&"number"===typeof r[l].y){var c=a.axisX.convertValueToPixel(b),v;v=0!==a.dataPointYSums[b]?100*(r[l].y/a.dataPointYSums[b]):0;var w=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,y=w+p<<0;if(a.axisY.logarithmic){h[b]=v+(h[b]?h[b]:0);if(0>=h[b])continue;v=f[b]?f[b]:n;f[b]=k=a.axisY.convertValueToPixel(h[b])}else if(k=
a.axisY.convertValueToPixel(v),0<=r[l].y){var t=f[b]?f[b]:0;v=n+t;k+=t;f[b]=t+(k-v)}else t=g[b]?g[b]:0,v=k-t,k=n-t,g[b]=t+(k-v);b=r[l].color?r[l].color:q._colorSet[l%q._colorSet.length];N(d,v,w,k,y,b,0,null,s,!1,!1,!1,q.fillOpacity);b=q.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:w,x2:k,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,w,k,y,b,0,null,!1,!1,!1,!1);(r[l].indexLabel||q.indexLabel||r[l].indexLabelFormatter||q.indexLabelFormatter)&&
this._indexLabels.push({chartType:"stackedBar100",dataPoint:r[l],dataSeries:q,point:{x:0<=r[l].y?k:v,y:c},direction:0>r[l].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v,k),y1:w,x2:Math.max(v,k),y2:y},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(n,a.axisX.bounds.x2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderArea=function(a){function d(){t&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,
g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!J)))if("number"!==typeof p[q].y)m.connectNullData||
(J||e)||d(),J=!0;else{r=a.axisX.convertValueToPixel(v);s=a.axisY.convertValueToPixel(p[q].y);e||J?(!e&&m.connectNullData?(b.setLineDash&&(m.options.nullDataLineDashType||z===m.lineDashType&&m.lineDashType!==m.nullDataLineDashType)&&(b.stroke(),z=m.nullDataLineDashType,b.setLineDash(A)),b.lineTo(r,s),u&&c.lineTo(r,s)):(b.beginPath(),b.moveTo(r,s),u&&(c.beginPath(),c.moveTo(r,s)),t={x:r,y:s}),J=e=!1):(b.lineTo(r,s),u&&c.lineTo(r,s),0==q%250&&d());qp[q].y===a.axisY.reversed?1:-1,color:D})}d();O.drawMarkers(h);m.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderSplineArea=
function(a){function d(){var d=ua(y,2);if(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=s:0>a.axisY.viewportMaximum?v=
g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,
k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!r)))if("number"!==typeof p[e].y)0p[e].y===a.axisY.reversed?1:-1,
color:t});r=!1}d();O.drawMarkers(h);m.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepArea=function(a){function d(){t&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),
c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!D))){var H=s;"number"!==typeof p[q].y?(m.connectNullData||(D||e)||d(),D=!0):(r=a.axisX.convertValueToPixel(v),s=a.axisY.convertValueToPixel(p[q].y),e||D?(!e&&m.connectNullData?(b.setLineDash&&(m.options.nullDataLineDashType||B===m.lineDashType&&m.lineDashType!==
m.nullDataLineDashType)&&(b.stroke(),B=m.nullDataLineDashType,b.setLineDash(R)),b.lineTo(r,H),b.lineTo(r,s),u&&(c.lineTo(r,H),c.lineTo(r,s))):(b.beginPath(),b.moveTo(r,s),u&&(c.beginPath(),c.moveTo(r,s)),t={x:r,y:s}),D=e=!1):(b.lineTo(r,H),u&&c.lineTo(r,H),b.lineTo(r,s),u&&c.lineTo(r,s),0==q%250&&d()),qp[q].y===a.axisY.reversed?1:-1,color:x}))}d();O.drawMarkers(h);m.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea=function(a){function d(){if(!(1>k.length)){for(0=a.dataSeriesIndexes.length)){var c=null,f=[],g=null,h=this.plotArea,l=[],k=[],n=[],m=[],p=0,e,q,r,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;u&&v.beginPath();b.save();u&&v.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(v.beginPath(),v.rect(h.x1,h.y1,h.width,h.height),
v.clip());for(var w=[],h=0;ha.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!J)))if("number"!==typeof H.y)t.connectNullData||(J||w)||d(),
J=!0;else{e=a.axisX.convertValueToPixel(r);var ea=l[r]?l[r]:0;if(a.axisY.logarithmic){m[r]=H.y+(m[r]?m[r]:0);if(0>=m[r])continue;q=a.axisY.convertValueToPixel(m[r])}else q=a.axisY.convertValueToPixel(H.y),q-=ea;k.push({x:e,y:s-ea});l[r]=s-q;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||A===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(b.stroke(),A=t.nullDataLineDashType,b.setLineDash(B)),b.lineTo(e,q),u&&v.lineTo(e,q)):(b.beginPath(),b.moveTo(e,q),u&&(v.beginPath(),
v.moveTo(e,q))),J=w=!1):(b.lineTo(e,q),u&&v.lineTo(e,q),0==p%250&&(d(),b.moveTo(e,q),u&&v.moveTo(e,q),k.push({x:e,y:s-ea})));pD[p].y===a.axisY.reversed?1:-1,color:c})}}d();b.moveTo(e,q);u&&v.moveTo(e,q)}delete t.dataPointIndexes;t.markerColor=g}O.drawMarkers(f);b.restore();u&&v.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea100=function(a){function d(){for(0=a.dataSeriesIndexes.length)){var c=null,f=this.plotArea,g=[],h=null,l=[],k=[],n=[],m=[],p=0,e,q,r,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;b.save();u&&v.save();b.beginPath();b.rect(f.x1,f.y1,f.width,f.height);b.clip();u&&(v.beginPath(),v.rect(f.x1,f.y1,f.width,f.height),
v.clip());for(var w=[],f=0;fa.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!J)))if("number"!==typeof H.y)t.connectNullData||
(J||w)||d(),J=!0;else{var ea;ea=0!==a.dataPointYSums[r]?100*(H.y/a.dataPointYSums[r]):0;e=a.axisX.convertValueToPixel(r);var fa=l[r]?l[r]:0;if(a.axisY.logarithmic){m[r]=ea+(m[r]?m[r]:0);if(0>=m[r])continue;q=a.axisY.convertValueToPixel(m[r])}else q=a.axisY.convertValueToPixel(ea),q-=fa;k.push({x:e,y:s-fa});l[r]=s-q;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||B===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(b.stroke(),B=t.nullDataLineDashType,b.setLineDash(E)),
b.lineTo(e,q),u&&v.lineTo(e,q)):(b.beginPath(),b.moveTo(e,q),u&&(v.beginPath(),v.moveTo(e,q))),J=w=!1):(b.lineTo(e,q),u&&v.lineTo(e,q),0==p%250&&(d(),b.moveTo(e,q),u&&v.moveTo(e,q),k.push({x:e,y:s-fa})));px[p].y===a.axisY.reversed?1:-1,color:c})}}d();b.moveTo(e,q);u&&v.moveTo(e,q)}delete t.dataPointIndexes;t.markerColor=h}O.drawMarkers(g);b.restore();u&&v.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderBubble=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;
if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,c=0,f,g;d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var h=-Infinity,l=Infinity,k=0;ka.axisX.dataInfo.viewPortMax||"undefined"===typeof p[c].z||(e=p[c].z,e>h&&(h=e),ea.axisX.dataInfo.viewPortMax)&&"number"===typeof p[c].y){f=
a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(p[c].y);var e=p[c].z,r=2*Math.max(Math.sqrt((h===l?b/2:q+(b-q)/(h-l)*(e-l))/Math.PI)<<0,1),e=m.getMarkerProperties(c,d);e.size=r;d.globalAlpha=m.fillOpacity;O.drawMarker(f,g,d,e.type,e.size,e.color,e.borderColor,e.borderThickness);d.globalAlpha=1;var s=m.dataPointIds[c];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:c,x1:f,y1:g,size:r};r=G(s);u&&O.drawMarker(f,g,this._eventManager.ghostCtx,
e.type,e.size,r,r,e.borderThickness);(p[c].indexLabel||m.indexLabel||p[c].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:p[c],dataSeries:m,point:{x:f,y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null})}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderScatter=
function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,c=0,f,g;d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var h=0;ha.axisX.dataInfo.viewPortMax)&&"number"===typeof n[c].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(n[c].y);var e=k.getMarkerProperties(c,f,g,d);d.globalAlpha=k.fillOpacity;O.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderColor,e.borderThickness);d.globalAlpha=1;Math.sqrt((m-f)*(m-f)+(p-g)*(p-g))Math.min(this.plotArea.width,this.plotArea.height)||(m=k.dataPointIds[c],this._eventManager.objectMap[m]={id:m,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:c,x1:f,y1:g},m=G(m),u&&O.drawMarker(e.x,e.y,this._eventManager.ghostCtx,e.type,e.size,m,m,e.borderThickness),(n[c].indexLabel||k.indexLabel||n[c].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:n[c],dataSeries:k,point:{x:f,y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-e.size/
2,x2:f+e.size/2,y2:g+e.size/2},color:null}),m=f,p=g)}}}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderCandlestick=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var c=null,c=this.plotArea,f=0,g,h,l,k,n,m,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:
1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width;var p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.7*c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(p=g);d.save();u&&b.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(b.beginPath(),b.rect(c.x1,c.y1,c.width,c.height),b.clip());for(var e=0;ea.axisX.dataInfo.viewPortMax)&&null!==s[f].y&&s[f].y.length&&
"number"===typeof s[f].y[0]&&"number"===typeof s[f].y[1]&&"number"===typeof s[f].y[2]&&"number"===typeof s[f].y[3]){g=a.axisX.convertValueToPixel(m);h=a.axisY.convertValueToPixel(s[f].y[0]);l=a.axisY.convertValueToPixel(s[f].y[1]);k=a.axisY.convertValueToPixel(s[f].y[2]);n=a.axisY.convertValueToPixel(s[f].y[3]);var w=g-p/2<<0,y=w+p<<0,c=s[f].color?s[f].color:r._colorSet[0],t=Math.round(Math.max(1,0.15*p)),x=0===t%2?0:0.5,z=r.dataPointIds[f];this._eventManager.objectMap[z]={id:z,objectType:"dataPoint",
dataSeriesIndex:q,dataPointIndex:f,x1:w,y1:h,x2:y,y2:l,x3:g,y3:k,x4:g,y4:n,borderThickness:t,color:c};d.strokeStyle=c;d.beginPath();d.lineWidth=t;b.lineWidth=Math.max(t,4);"candlestick"===r.type?(d.moveTo(g-x,l),d.lineTo(g-x,Math.min(h,n)),d.stroke(),d.moveTo(g-x,Math.max(h,n)),d.lineTo(g-x,k),d.stroke(),N(d,w,Math.min(h,n),y,Math.max(h,n),s[f].y[0]<=s[f].y[3]?r.risingColor:c,t,c,v,v,!1,!1,r.fillOpacity),u&&(c=G(z),b.strokeStyle=c,b.moveTo(g-x,l),b.lineTo(g-x,Math.min(h,n)),b.stroke(),b.moveTo(g-
x,Math.max(h,n)),b.lineTo(g-x,k),b.stroke(),N(b,w,Math.min(h,n),y,Math.max(h,n),c,0,null,!1,!1,!1,!1))):"ohlc"===r.type&&(d.moveTo(g-x,l),d.lineTo(g-x,k),d.stroke(),d.beginPath(),d.moveTo(g,h),d.lineTo(w,h),d.stroke(),d.beginPath(),d.moveTo(g,n),d.lineTo(y,n),d.stroke(),u&&(c=G(z),b.strokeStyle=c,b.moveTo(g-x,l),b.lineTo(g-x,k),b.stroke(),b.beginPath(),b.moveTo(g,h),b.lineTo(w,h),b.stroke(),b.beginPath(),b.moveTo(g,n),b.lineTo(y,n),b.stroke()));(s[f].indexLabel||r.indexLabel||s[f].indexLabelFormatter||
r.indexLabelFormatter)&&this._indexLabels.push({chartType:r.type,dataPoint:s[f],dataSeries:r,point:{x:w+(y-w)/2,y:a.axisY.reversed?k:l},direction:1,bounds:{x1:w,y1:Math.min(l,k),x2:y,y2:Math.max(l,k)},color:c})}}d.restore();u&&b.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,
c=this.plotArea,f=0,g,h,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.03*this.width;var l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(l)/Math.log(a.axisX.range):Math.abs(l)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>g&&
(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(l=g);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var k=0;ka.axisX.dataInfo.viewPortMax)&&null!==p[f].y&&p[f].y.length&&"number"===typeof p[f].y[0]&&"number"===typeof p[f].y[1]){b=a.axisX.convertValueToPixel(h);c=a.axisY.convertValueToPixel(p[f].y[0]);g=a.axisY.convertValueToPixel(p[f].y[1]);var q=a.axisX.reversed?b+a.plotType.totalDataSeries*l/2-(a.previousDataSeriesCount+
k)*l<<0:b-a.plotType.totalDataSeries*l/2+(a.previousDataSeriesCount+k)*l<<0,r=a.axisX.reversed?q-l<<0:q+l<<0,b=p[f].color?p[f].color:m._colorSet[f%m._colorSet.length];if(c>g){var s=c,c=g;g=s}s=m.dataPointIds[f];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:q,y1:c,x2:r,y2:g};N(d,q,c,r,g,b,0,b,e,e,!1,!1,m.fillOpacity);b=G(s);u&&N(this._eventManager.ghostCtx,q,c,r,g,b,0,null,!1,!1,!1,!1);if(p[f].indexLabel||m.indexLabel||p[f].indexLabelFormatter||
m.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:p[f],dataSeries:m,indexKeyword:0,point:{x:q+(r-q)/2,y:p[f].y[1]>=p[f].y[0]?g:c},direction:p[f].y[1]>=p[f].y[0]?-1:1,bounds:{x1:q,y1:Math.min(c,g),x2:r,y2:Math.max(c,g)},color:b}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:p[f],dataSeries:m,indexKeyword:1,point:{x:q+(r-q)/2,y:p[f].y[1]>=p[f].y[0]?c:g},direction:p[f].y[1]>=p[f].y[0]?1:-1,bounds:{x1:q,y1:Math.min(c,g),x2:r,y2:Math.max(c,g)},color:b})}}d.restore();
u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,l,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:
Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(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>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(k=g);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var n=0;na.axisX.dataInfo.viewPortMax)&&null!==e[f].y&&e[f].y.length&&"number"===typeof e[f].y[0]&&"number"===typeof e[f].y[1]){c=a.axisY.convertValueToPixel(e[f].y[0]);g=a.axisY.convertValueToPixel(e[f].y[1]);h=a.axisX.convertValueToPixel(l);h=a.axisX.reversed?h+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+n)*k<<0:h-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+n)*k<<0;var r=a.axisX.reversed?h-k<<0:h+k<<0;c>g&&(b=c,c=
g,g=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,c,h,g,r,b,0,null,q,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:f,x1:c,y1:h,x2:g,y2:r};b=G(b);u&&N(this._eventManager.ghostCtx,c,h,g,r,b,0,null,!1,!1,!1,!1);if(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:0,point:{x:e[f].y[1]>=
e[f].y[0]?c:g,y:h+(r-h)/2},direction:e[f].y[1]>=e[f].y[0]?-1:1,bounds:{x1:Math.min(c,g),y1:h,x2:Math.max(c,g),y2:r},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:1,point:{x:e[f].y[1]>=e[f].y[0]?g:c,y:h+(r-h)/2},direction:e[f].y[1]>=e[f].y[0]?1:-1,bounds:{x1:Math.min(c,g),y1:h,x2:Math.max(c,g),y2:r},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,
animationBase:0}}};A.prototype.renderRangeArea=function(a){function d(){if(w){var a=null;0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(h=0;ha.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!E)))if(null!==m[e].y&&m[e].y.length&&"number"===typeof m[e].y[0]&&"number"===
typeof m[e].y[1]){q=a.axisX.convertValueToPixel(v);r=a.axisY.convertValueToPixel(m[e].y[0]);s=a.axisY.convertValueToPixel(m[e].y[1]);p||E?(n.connectNullData&&!p?(b.setLineDash&&(n.options.nullDataLineDashType||z===n.lineDashType&&n.lineDashType!==n.nullDataLineDashType)&&(l[l.length-1].newLineDashArray=B,z=n.nullDataLineDashType,b.setLineDash(A)),b.lineTo(q,r),u&&c.lineTo(q,r),l.push({x:q,y:s})):(b.beginPath(),b.moveTo(q,r),w={x:q,y:r},l=[],l.push({x:q,y:s}),u&&(c.beginPath(),c.moveTo(q,r))),E=p=
!1):(b.lineTo(q,r),l.push({x:q,y:s}),u&&c.lineTo(q,r),0==e%250&&d());v=n.dataPointIds[e];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:e,x1:q,y1:r,y2:s};em[e].y[1]===a.axisY.reversed?-1:1,color:y}),this._indexLabels.push({chartType:"rangeArea",dataPoint:m[e],dataSeries:n,indexKeyword:1,point:{x:q,y:s},direction:m[e].y[0]>m[e].y[1]===a.axisY.reversed?1:-1,color:y})}else E||p||d(),E=!0;d();O.drawMarkers(f);n.markerColor=g}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,
animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderRangeSplineArea=function(a){function d(a,d){var e=ua(r,2);if(0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(h=0;ha.axisX.dataInfo.viewPortMax&&(!k.connectNullData||
!e)))if(null!==n[m].y&&n[m].y.length&&"number"===typeof n[m].y[0]&&"number"===typeof n[m].y[1]){p=a.axisX.convertValueToPixel(p);e=a.axisY.convertValueToPixel(n[m].y[0]);q=a.axisY.convertValueToPixel(n[m].y[1]);var A=k.dataPointIds[m];this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:m,x1:p,y1:e,y2:q};r[r.length]={x:p,y:e};s[s.length]={x:p,y:q};mb)){"undefined"===typeof l&&(l=1);if(!u){var n=Number((h%(2*Math.PI)).toFixed(8));Number((g%
(2*Math.PI)).toFixed(8))===n&&(h-=1E-4)}a.save();a.globalAlpha=l;"pie"===f?(a.beginPath(),a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,g,h,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===f&&(a.beginPath(),a.arc(d.x,d.y,b,g,h,!1),0<=k&&a.arc(d.x,d.y,k*b,h,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};A.prototype.renderPie=function(a){function d(){if(n&&m){for(var a=0,b=0,c=0,d=0,f=0;fMath.PI/2-w&&l.midAnglel.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-w&&l.midAngle<3*Math.PI/2+w){if(0===b||q[d].midAngle>l.midAngle)d=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new W(k.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()}h=g=0;p=!1;for(f=0;fMath.PI/2-w&&l.midAngle3*Math.PI/2-w&&l.midAngle<3*Math.PI/2+w)&&(h<=b/2&&!p?(l.hemisphere="left",h++):(l.hemisphere="right",p=!0))}}function b(a){var b=k.plotArea.ctx;b.clearRect(e.x1,e.y1,e.width,e.height);b.fillStyle=k.backgroundColor;b.fillRect(e.x1,e.y1,e.width,e.height);for(b=0;bc){var f=0.07*B*Math.cos(q[b].midAngle),g=0.07*B*Math.sin(q[b].midAngle),l=!1;if(m[b].exploded){if(1E-9a.indexLabelTextBlock.y?e-d:c-f}function f(a){for(var b=null,d=1;dc(q[b],q[a])||("right"===q[a].hemisphere?q[b].indexLabelTextBlock.y>=q[a].indexLabelTextBlock.y:
q[b].indexLabelTextBlock.y<=q[a].indexLabelTextBlock.y)))break;else b=null;return b}function g(a,b,d){d=(d||0)+1;if(1E3b&&h.indexLabelTextBlock.yl)return 0;var p=0,n=0,n=p=p=0;0>b?h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2>k&&h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2+bl&&(b=h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2+b-l);b=h.indexLabelTextBlock.y+b;k=0;k="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2)):t.x-Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2));n=t.x+B*Math.cos(h.midAngle);p=t.y+B*Math.sin(h.midAngle);p=Math.sqrt(Math.pow(k-n,2)+Math.pow(b-p,2));n=Math.acos(B/s);p=Math.acos((s*s+B*B-p*p)/(2*B*s));b=pc(q[k],q[a])||("right"===q[a].hemisphere?q[k].indexLabelTextBlock.y<=q[a].indexLabelTextBlock.y:q[k].indexLabelTextBlock.y>=q[a].indexLabelTextBlock.y)))break;else k=null;n=k;p=f(a);l=k=0;0>b?(l="right"===h.hemisphere?n:p,e=b,null!==l&&(n=-b,b=h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-(q[l].indexLabelTextBlock.y+
q[l].indexLabelTextBlock.height/2),b-n+k.toFixed(y)&&(e=b>r?-(b-r):-(n-(l-k)))))):0r?b-r:n-(k-l)))));e&&(d=h.indexLabelTextBlock.y+e,b=0,b="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(d-t.y,2)):t.x-Math.sqrt(Math.pow(s,
2)-Math.pow(d-t.y,2)),h.midAngle>Math.PI/2-w&&h.midAnglek.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===h.hemisphere&&("left"===a.hemisphere&&b3*Math.PI/2-w&&h.midAngle<3*Math.PI/2+w&&(k=(a-1+q.length)%q.length,k=q[k],a=q[(a+1+q.length)%q.length],"right"===h.hemisphere&&"left"===k.hemisphere&&
ba.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),h.indexLabelTextBlock.y=d,h.indexLabelTextBlock.x=b,h.indexLabelAngle=Math.atan2(h.indexLabelTextBlock.y-t.y,h.indexLabelTextBlock.x-t.x))}return e}function h(){var a=k.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,d=0,l=!0,b=0;10>b&&(1>b||0z){for(var A=u=0,D=0;Du?h.indexLabelText="":h.indexLabelTextBlock.maxWidth=0.85*u,0.3*h.indexLabelTextBlock.maxWidth<
u&&(h.indexLabelTextBlock.x-="right"===h.hemisphere?2:-2)),Math.abs(h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-t.y)d&&(d=x)),x=x=0,0d&&(d=x)));var G=function(a,b,c){for(var d=[],e=0;d.push(q[b]),b!==c;b=(b+1+m.length)%m.length);d.sort(function(a,b){return a.y-b.y});for(b=0;bz){l=w.indexLabelTextBlock.x;var n=w.indexLabelTextBlock.y-w.indexLabelTextBlock.height/2,r=w.indexLabelTextBlock.y+w.indexLabelTextBlock.height/2,s=k.indexLabelTextBlock.y-k.indexLabelTextBlock.height/2,t=k.indexLabelTextBlock.x+k.indexLabelTextBlock.width,v=k.indexLabelTextBlock.y+k.indexLabelTextBlock.height/2;l=w.indexLabelTextBlock.x+w.indexLabelTextBlock.widtht+p||n>v+p||ra&&(a=g),h!==a&&(b=h,d+=-z),0===g%Math.max(m.length/10,3)&&(e=!0)):e=!0;e&&(0=a.dataSeriesIndexes.length)){var n=this.data[a.dataSeriesIndexes[0]],m=n.dataPoints,p=10,e=this.plotArea,q=[],r=2,s,v=1.3,w=20/180*Math.PI,y=6,t={x:(e.x2+e.x1)/2,y:(e.y2+e.y1)/2},u=0;a=!1;for(var A=0;Aa&&(d=a,f=!0);var g=m[b].color?m[b].color:n._colorSet[b%n._colorSet.length];d>c&&Ga(k.plotArea.ctx,q[b].center,q[b].radius,g,n.type,c,d,n.fillOpacity,q[b].percentInnerRadius);if(f)break}l()},function(){k.disableToolTip=!1;k._animator.animate(0,k.animatedRender?500:0,function(a){b(a);l()})})}}};A.prototype.animationRequestId=null;A.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||
window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();A.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;A.prototype.set=function(a,d,b){b="undefined"===typeof b?!0:b;"options"===a?(this.options=d,
b&&this.render()):A.base.set.call(this,a,d,b)};A.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var d=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+d);Ba(this.canvas,d,b)};A.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 b=this,c=d.contentWindow||d.contentDocument.document||d.contentDocument;c.document.open();c.document.write('\n
');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(d)},1E3)},500)};ja.prototype.registerSpace=function(a,d){"top"===a?this._topOccupied+=
d.height:"bottom"===a?this._bottomOccupied+=d.height:"left"===a?this._leftOccupied+=d.width:"right"===a&&(this._rightOccupied+=d.width)};ja.prototype.unRegisterSpace=function(a,d){"top"===a?this._topOccupied-=d.height:"bottom"===a?this._bottomOccupied-=d.height:"left"===a?this._leftOccupied-=d.width:"right"===a&&(this._rightOccupied-=d.width)};ja.prototype.getFreeSpace=function(){return{x1:this._x1+this._leftOccupied,y1:this._y1+this._topOccupied,x2:this._x2-this._rightOccupied,y2:this._y2-this._bottomOccupied,
width:this._x2-this._x1-this._rightOccupied-this._leftOccupied,height:this._y2-this._y1-this._bottomOccupied-this._topOccupied}};ja.prototype.reset=function(){this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding};U(W,M);W.prototype.render=function(a){a&&this.ctx.save();var d=this.ctx.font;this.ctx.textBaseline=this.textBaseline;var b=0;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y+b);"middle"===this.textBaseline&&(b=-this._lineHeight/
2);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var c=0,f=this.padding,g=null;(0d)f=g-1;else break}b>d&&1g&&(h=d.pop(),c-=h.height,f=l)}this._wrappedText={lines:d,width:f,height:c};this.width=f+2*this.padding;
this.height=c+2*this.padding;this.ctx.font=b};W.prototype._getFontString=function(){var a;a=""+(this.fontStyle?this.fontStyle+" ":"");a+=this.fontWeight?this.fontWeight+" ":"";a+=this.fontSize?this.fontSize+"px ":"";var d=this.fontFamily?this.fontFamily+"":"";!u&&d&&(d=d.split(",")[0],"'"!==d[0]&&'"'!==d[0]&&(d="'"+d+"'"));return a+=d};U(ma,M);ma.prototype.render=function(){if(this.text){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),b=d.x1,c=d.y1,f=
0,g=0,h=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,l,k;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=d.width-4-h*("center"===this.horizontalAlign?2:1)),g=0.5*d.height-this.margin-2,f=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=d.height-4),g=0.5*d.width-this.margin-2):"center"===this.horizontalAlign&&(null===this.maxWidth&&
(this.maxWidth=d.width-4),g=0.5*d.height-4));this.wrap||(g=Math.min(g,Math.max(1.5*this.fontSize,this.fontSize+2.5*this.padding)));var g=new W(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,fontStyle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThickness,backgroundColor:this.backgroundColor,maxWidth:this.maxWidth,maxHeight:g,cornerRadius:this.cornerRadius,
text:this.text,padding:this.padding,textBaseline:"top"}),n=g.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(c=d.y1+2,k="top"):"bottom"===this.verticalAlign&&(c=d.y2-2-n.height,k="bottom"),"left"===this.horizontalAlign?b=d.x1+2:"center"===this.horizontalAlign?b=d.x1+d.width/2-n.width/2:"right"===this.horizontalAlign&&(b=d.x2-2-n.width-h),l=this.horizontalAlign,this.width=n.width,this.height=n.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?
(b=d.x1+2,c=d.y2-2-(this.maxWidth/2-n.width/2),f=-90,k="left",this.width=n.height,this.height=n.width):"right"===this.horizontalAlign?(b=d.x2-2,c=d.y1+2+(this.maxWidth/2-n.width/2),f=90,k="right",this.width=n.height,this.height=n.width):"center"===this.horizontalAlign&&(c=a.y1+(a.height/2-n.height/2),b=a.x1+(a.width/2-n.width/2),k="center",this.width=n.width,this.height=n.height),l="center");g.x=b;g.y=c;g.angle=f;g.horizontalAlign=l;g.render(!0);a.layoutManager.registerSpace(k,{width:this.width+("left"===
k||"right"===k?this.margin+2:0),height:this.height+("top"===k||"bottom"===k?this.margin+2:0)});this.bounds={x1:b,y1:c,x2:b+this.width,y2:c+this.height};this.ctx.textBaseline="top"}};U(va,M);va.prototype.render=ma.prototype.render;U(wa,M);wa.prototype.render=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),b=null,c=0,f=0,g=0,h=0,l=this.markerMargin=this.chart.options.legend&&!x(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:
0.3*this.fontSize;this.height=0;var k=[],n=[];"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",b=this.verticalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:d.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*d.height):"center"===this.verticalAlign&&(this.orientation="vertical",b=this.horizontalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*d.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:d.height);for(var m=
0;m=h||"undefined"===typeof h||0>=q||"undefined"===typeof q)){if("horizontal"===this.orientation){e.textBlock=new W(this.ctx,{x:0,y:0,maxWidth:q,maxHeight:this.itemWrap?h: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(!p||p.width+Math.round(e.textBlock.width+s+l+(0===p.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)p=
{items:[],width:0},n.push(p),this.height+=u,u=0;u=Math.max(u,e.textBlock.height)}else e.textBlock=new W(this.ctx,{x:0,y:0,maxWidth:q,maxHeight:!0===this.itemWrap?h: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):(m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,m=0>0,0),this.dataPoints.length):0));for(;;){g=0a?c.x/a:a/c.x:Math.abs(c.x-
a);pm-f&&m+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-1}return d||b.dataPoint.x!==a?d&&null!==b.dataPoint?b:null:b};$.prototype.getDataPointAtXY=function(a,d,b){if(!this.dataPoints||0===this.dataPoints.length||athis.chart.plotArea.x2||dthis.chart.plotArea.y2)return null;b=b||!1;var c=[],f=0,g=0,h=1,l=!1,k=Infinity,n=0,m=0,p=0;"none"!==
this.chart.plotInfo.axisPlacement&&(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:d}),this.axisX.logarithmic?(g=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1>0,0),this.dataPoints.length):0):(g=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0>0,0),this.dataPoints.length):
0));for(;;){g=0=e.x1&&(a<=e.x2&&d>=e.y1&&d<=e.y2)&&(c.push({dataPoint:q,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y1-d),Math.abs(e.y2-d))}),
l=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var s=L("markerSize",q,this)||4,v=b?20:s,r=Math.sqrt(Math.pow(e.x1-a,2)+Math.pow(e.y1-d,2));r<=v&&c.push({dataPoint:q,dataPointIndex:g,dataSeries:this,distance:r});g=Math.abs(e.x1-a);g<=k?k=g:0v&&(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*(e.startAngle/Math.PI)%360+360)%360).toFixed(12)),v=Number(((180*(e.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===v&&1=v&&0!==q.y&&(v+=360,rs&&r=e.x1-e.borderThickness/2&&a<=e.x2+e.borderThickness/2&&d>=e.y2-e.borderThickness/2&&d<=
e.y3+e.borderThickness/2||Math.abs(e.x2-a+e.x1-a)=e.y1&&d<=e.y4)c.push({dataPoint:q,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-d),Math.abs(e.y3-d))}),l=!0;break;case "ohlc":if(Math.abs(e.x2-a+e.x1-a)=e.y2&&d<=e.y3||a>=e.x1&&a<=(e.x2+e.x1)/2&&d>=e.y1-e.borderThickness/2&&d<=e.y1+e.borderThickness/2||a>=(e.x1+e.x2)/2&&a<=e.x2&&d>=e.y4-e.borderThickness/2&&d<=e.y4+e.borderThickness/2)c.push({dataPoint:q,
dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-d),Math.abs(e.y3-d))}),l=!0}if(l||1E3p-f&&p+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-1}a=null;for(d=0;d>0:this.options.labelMaxWidth,this.chart.panEnabled||(h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);
else if("left"===this._position||"right"===this._position)k=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.height*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.height/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*E[this.intervalType+
"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),h="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*k>>0,p=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;bp&&(r=b,p=e.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=h,this.sessionVariables.labelMaxWidth=g,q.width+d.width>>0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=s)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=
h,this.sessionVariables.labelWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth))this.options.labelMaxWidth>0,e=this.labelFontSize,pl&&(l=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=s,this.sessionVariables.labelFontSize=e):c>=2.8*g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,p),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=s,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=e,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelAngle=this.labelAngle));else if(r===b&&(0===r&&p+this._labels[r+1].textBlock.measureText().width-2*g>l||r===this._labels.length-1&&p+this._labels[r-
1].textBlock.measureText().width-2*g>l||0l&&p+this._labels[r-1].textBlock.measureText().width-2*g>l))l=0===r?p+this._labels[r+1].textBlock.measureText().width-2*g:p+this._labels[r-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=
s;else if(0===l)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e: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?h:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),s=0!=this.labelAngle?(m-(n+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=h=this.labelWrap?(m-s*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:s,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelMaxHeight=c<0.9*k?0.9*k:c,this.sessionVariables.labelWrap=
this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s):(x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=h);for(c=0;c>0:this.options.labelMaxWidth,h="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=h;this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b>
0,k-2*h>p&&(p=k-2*h,k>=2*h&&k<2.4*h?(x(this.options.labelFontSize)&&12=2.4*h&&k<2.8*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):k>=2.8*h&&k<3.2*h?(this.sessionVariables.labelMaxHeight=
h,this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*h&&k<3.6*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=
this.labelFontSize):k>3.6*h&&k<10*h?(x(this.options.labelFontSize)&&1210*h&&k<50*h&&(x(this.options.labelFontSize)&&
12this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:g,this.sessionVariables.labelMaxHeight=
0===this.labelAngle?h:c,x(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMaxHeight=h,x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=
this.labelWrap);for(c=0;c>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)v="undefined"===typeof g.options.labelWrap?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;d=x(g.options.labelBackgroundColor)?"#EEEEEE":
g.options.labelBackgroundColor}else h="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,v="undefined"===typeof g.options.labelWrap||g.labelWrap?"bottom"===this._position||"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,d=x(g.options.labelBackgroundColor)?x(g.startValue)&&0!==g.startValue?u?"transparent":null:"#EEEEEE":g.options.labelBackgroundColor;a=new W(this.ctx,{x:0,y:0,backgroundColor:d,borderColor:g.labelBorderColor,
borderThickness:g.labelBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?g.options.labelMaxWidth:h,maxHeight:v,angle:this.labelAngle,text:g.labelFormatter?g.labelFormatter({chart:this.chart,axis:this,stripLine:g}):g.label,horizontalAlign:"left",fontSize:"outside"===g.labelPlacement?g.options.labelFontSize?g.options.labelFontSize:this.labelFontSize:g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.options.labelFontFamily:this.labelFontFamily:
g.labelFontFamily,fontWeight:"outside"===g.labelPlacement?g.options.fontWeight?g.options.fontWeight:this.fontWeight:g.fontWeight,fontColor:g.options.labelFontColor||g.color,fontStyle:"outside"===g.labelPlacement?g.options.fontStyle?g.options.fontStyle:this.fontWeight:g.fontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:g.value,textBlock:a,effectiveHeight:null,stripLine:g})}};B.prototype.createLabelsAndCalculateWidth=function(){var a=0,d=0;this._labels=[];this._stripLineLabels=
[];if("left"===this._position||"right"===this._position){this.createLabels();for(d=0;d
this.viewportMinimum&&this._stripLineLabels[d].stripLine.valueq;){var N=0,Q=0,O=0,P=0,L=f=0,C=0,S=0,X=0,V=0,U=0,T=0;if(b&&0m.width-10?m.width-10:g.x2-T-S);if(a&&0m.width-10?m.width-10:g.x2-T-S),a[e]._labels&&1k&&(l+=0a[e].labelAngle?z-rk&&(l=A+s/2-k-T),z-ra[e].labelAngle&&0m.width-10?m.width-10:g.x2-T-S),d[e].lineCoordinates.width=Math.abs(k-h),d[e]._labels&&1q;){V=X=U=P=S=C=L=f=O=K=Q=N=0;if(a&&0m.width-10?m.width-10:g.x2-V-L),b[e].labelAutoFit&&!x(v)&&(0b[e].labelAngle?Math.max(h,v):0===b[e].labelAngle?Math.max(h,v/2):h),0c[e].chart.width-10?c[e].chart.width-10:g.x2-V-L),c[e]&&c[e].labelAutoFit&&!x(u)&&(0b[e].chart.height-10?b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=l-(z[e]+b[e].margin+N),b[e].lineCoordinates.y2=l-(z[e]+b[e].margin+N),b[e].bounds={x1:h,y1:l-(z[e]+N+b[e].margin),
x2:k,y2:n-(N+b[e].margin),width:k-h,height:z[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0m.height-
Math.max(C,10)?m.height-Math.max(C,10):g.y2-P):g.y2>m.height-Math.max(C,10)?m.height-Math.max(C,10):g.y2;if(b&&0b[C].labelAngle?Math.max(k,v):0===b[C].labelAngle?Math.max(k,v/2):k,h=0>b[C].labelAngle||0===b[C].labelAngle?k-X:h);if(c&&0m.height-Math.max(C,10)?m.height-Math.max(C,10):g.y2-P):g.y2>m.height-Math.max(C,10)?m.height-Math.max(C,10):g.y2;if(b&&0b[e].labelAngle?Math.max(k,v):0===b[e].labelAngle?Math.max(k,v/2):k,h=0>b[C].labelAngle||0===b[C].labelAngle?k-V:h);if(c&&0this.viewportMaximum||!(k===this._labels.length-1||gthis.lineCoordinates.width*c&&this.labelAutoFit&&(a=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var d=[],n,h=this.viewportMaximum,l=this.lineCoordinates.height/Math.log(this.range),k=this._labels.length-1;0<=k;k--){m=this._labels[k];
if(m.positionthis.viewportMaximum||!(k===this._labels.length-1||nthis.lineCoordinates.height*c&&this.labelAutoFit&&(a=!0)}}if("bottom"===this._position){for(var m,k=0;kthis.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(m.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,
b.y<<0),this.ctx.lineTo(c,b.y+this.tickLength<<0),this.ctx.stroke()),0===m.textBlock.angle?(b.x-=m.textBlock.width/2,b.y+=this.tickLength+m.textBlock.fontSize/2):(b.x-=0>this.labelAngle?m.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,b.y+=this.tickLength+Math.abs(0>this.labelAngle?m.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:5)),m.textBlock.x=b.x,m.textBlock.y=b.y,m.textBlock.render(!0)));this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+
this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y2-this._titleTextBlock.height-3,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("top"===this._position){for(k=0;kthis.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(m.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=
this.tickColor,c=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,b.y<<0),this.ctx.lineTo(c,b.y-this.tickLength<<0),this.ctx.stroke()),0===m.textBlock.angle?(b.x-=m.textBlock.width/2,b.y-=this.tickLength+m.textBlock.height/2):(b.x+=(m.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(m.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,c),this.ctx.lineTo(b.x-this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(m.textBlock.y=b.y,m.textBlock.x=b.x-m.textBlock.width*Math.cos(Math.PI/
180*this.labelAngle)-this.tickLength-5):(m.textBlock.y=b.y-m.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),m.textBlock.x=0this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(m.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%
2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,c),this.ctx.lineTo(b.x+this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(m.textBlock.y=b.y,m.textBlock.x=b.x+this.tickLength+5):(m.textBlock.y=0>this.labelAngle?b.y:b.y-(m.textBlock.height-m.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),m.textBlock.x=0this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[f+1].position),a.fillRect(Math.min(b.x,d.x),c.y1,Math.abs(b.x-d.x),Math.abs(c.y1-c.y2)),d=!1):d=!0;else if(("left"===this._position||"right"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,f=0;fthis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[f+1].position),a.fillRect(c.x1,Math.min(b.y,d.y),Math.abs(c.x1-c.x2),Math.abs(d.y-b.y)),d=!1):d=!0;a.beginPath()};B.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0this.viewportMaximum||isNaN(this.range))||l.push(n))}for(c=0;cthis.viewportMaximum||isNaN(this.range))){a=this.getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(n&&(this.ctx.strokeStyle=n.color,"pixel"===n._thicknessType&&(this.ctx.lineWidth=n.thickness)),"bottom"===this._position){var m=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<
0;this.ctx.beginPath();this.ctx.moveTo(m,a.y<<0);this.ctx.lineTo(m,a.y+this.tickLength<<0);this.ctx.stroke();0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y+=this.tickLength+b.textBlock.fontSize/2):(a.x-=0>this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,a.y+=this.tickLength+Math.abs(0>this.labelAngle?b.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:5))}else"top"===this._position?(m=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,this.ctx.beginPath(),this.ctx.moveTo(m,
a.y<<0),this.ctx.lineTo(m,a.y-this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y-=this.tickLength+b.textBlock.height):(a.x+=(b.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.labelAngle?a.y:a.y-(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0this.chart.plotArea.x1?x(n.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(n.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/
2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y1+b.textBlock.width+3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-b.textBlock.width-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position?
(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.height-3,b.textBlock.measureText(),a.x-b.textBlock.height>this.chart.plotArea.x1?x(n.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(n.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?
this.chart.plotArea.y1+b.textBlock.width+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y2-3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y2-b.textBlock.width-3):"left"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:
this.chart.plotArea.width-3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-b.textBlock.height>this.chart.plotArea.y1?x(n.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3:a.y-b.textBlock.heightthis.chart.plotArea.y1?x(n.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize/2-3:a.y-b.textBlock.height<
this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:x(n.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize/2+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x2-b.textBlock.width-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-b.textBlock.width/2:this.chart.plotArea.x1+3);b.textBlock.x=a.x;b.textBlock.y=a.y;k.push(b)}if(!h){h=!1;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,
this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();for(c=0;cthis.viewportMaximum||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=1===a.lineWidth%2?(d.x<<0)+0.5:d.x<<0,a.moveTo(d,b.y1<<0),a.lineTo(d,b.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var c=0;cthis.viewportMaximum||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=1===a.lineWidth%2?(d.y<<0)+0.5:d.y<<0,a.moveTo(b.x1<<0,d),a.lineTo(b.x2<<0,d),a.stroke());a.restore()}};B.prototype.renderAxisLine=function(){var a=this.chart.ctx;a.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){a.lineWidth=this.lineThickness;a.strokeStyle=this.lineColor?this.lineColor:"black";a.setLineDash&&a.setLineDash(I(this.lineDashType,
this.lineThickness));var d=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;a.beginPath();a.moveTo(this.lineCoordinates.x1,d);a.lineTo(this.lineCoordinates.x2,d);a.stroke()}}else"left"!==this._position&&"right"!==this._position||!this.lineThickness||(a.lineWidth=this.lineThickness,a.strokeStyle=this.lineColor,a.setLineDash&&a.setLineDash(I(this.lineDashType,this.lineThickness)),d=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<<
0,a.beginPath(),a.moveTo(d,this.lineCoordinates.y1),a.lineTo(d,this.lineCoordinates.y2),a.stroke());a.restore()};B.prototype.getPixelCoordinatesOnAxis=function(a){var d={};if("bottom"===this._position||"top"===this._position)d.x=this.convertValueToPixel(a),d.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)d.y=this.convertValueToPixel(a),d.x=this.lineCoordinates.x2;return d};B.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var d=0,d=0,
d="number"===typeof a?a:"left"===this._position||"right"===this._position?a.y:a.x;return d=this.logarithmic?Math.pow(this.logarithmBase,(d-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit)*this.viewportMinimum:this.conversionParameters.minimum+(d-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit};B.prototype.convertValueToPixel=function(a){return this.logarithmic?this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*Math.log(a/
this.conversionParameters.minimum)/this.conversionParameters.lnLogarithmBase+0.5<<0:this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-this.conversionParameters.minimum)+0.5<<0};B.prototype.setViewPortRange=function(a,d){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,d);this.sessionVariables.newViewportMaximum=this.viewportMaximum=Math.max(a,d)};B.prototype.getXValueAt=function(a){if(!a)return null;var d=null;"left"===this._position?d=this.convertPixelToValue(a.y):
"bottom"===this._position&&(d=this.convertPixelToValue(a.x));return d};B.prototype.calculateValueToPixelConversionParameters=function(a){a={pixelPerUnit:null,minimum:null,reference:null};var d=this.lineCoordinates.width,b=this.lineCoordinates.height;a.minimum=this.viewportMinimum;if("bottom"===this._position||"top"===this._position)this.logarithmic?(a.lnLogarithmBase=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?-1:1)*d*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit=
(this.reversed?-1:1)*d/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(a.lnLogarithmBase=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?1:-1)*b*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit=(this.reversed?1:-1)*b/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;this.conversionParameters=a};B.prototype.calculateAxisParameters=
function(){if(this.logarithmic)this.calculateLogarithamicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),d=!1,b=!1;"bottom"===this._position||"top"===this._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?"xySwapped"===this.chart.plotInfo.axisPlacement?62:70:"xySwapped"===this.chart.plotInfo.axisPlacement?50:40,c=4;"axisX"===this.type&&(c=600>this.maxWidth?8:6);var a=Math.max(c,Math.floor(this.maxWidth/
a)),f,g,h,c=0;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if("axisX"===this.type){if(this.dataSeries&&0g?(c=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-c:g=f+c):(c=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=c),0!==f&&(f-=c)),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0));c=(isNaN(this.viewportMaximum)||
null===this.viewportMaximum?g:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?f:this.viewportMinimum);if("axisX"===this.type&&b){this.intervalType||(c/1<=a?(this.interval=1,this.intervalType="millisecond"):c/2<=a?(this.interval=2,this.intervalType="millisecond"):c/5<=a?(this.interval=5,this.intervalType="millisecond"):c/10<=a?(this.interval=10,this.intervalType="millisecond"):c/20<=a?(this.interval=20,this.intervalType="millisecond"):c/50<=a?(this.interval=50,this.intervalType=
"millisecond"):c/100<=a?(this.interval=100,this.intervalType="millisecond"):c/200<=a?(this.interval=200,this.intervalType="millisecond"):c/250<=a?(this.interval=250,this.intervalType="millisecond"):c/300<=a?(this.interval=300,this.intervalType="millisecond"):c/400<=a?(this.interval=400,this.intervalType="millisecond"):c/500<=a?(this.interval=500,this.intervalType="millisecond"):c/(1*E.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*E.secondDuration)<=a?(this.interval=2,this.intervalType=
"second"):c/(5*E.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*E.secondDuration)<=a?(this.interval=10,this.intervalType="second"):c/(15*E.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*E.secondDuration)<=a?(this.interval=20,this.intervalType="second"):c/(30*E.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*E.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*E.minuteDuration)<=a?(this.interval=2,this.intervalType=
"minute"):c/(5*E.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*E.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):c/(15*E.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*E.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):c/(30*E.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*E.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*E.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):
c/(3*E.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*E.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1*E.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*E.dayDuration)<=a?(this.interval=2,this.intervalType="day"):c/(4*E.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*E.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*E.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*E.weekDuration)<=a?(this.interval=
3,this.intervalType="week"):c/(1*E.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*E.monthDuration)<=a?(this.interval=2,this.intervalType="month"):c/(3*E.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*E.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=c/(1*E.yearDuration)<=a?1:c/(2*E.yearDuration)<=a?2:c/(4*E.yearDuration)<=a?4:Math.floor(B.getNiceNumber(c/(a-1),!0)/E.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||
isNaN(this.viewportMinimum))this.viewportMinimum=f-h/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=g+h/2;d?this.autoValueFormatString="MMM DD YYYY HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===this.intervalType?this.autoValueFormatString="MMM YYYY":"week"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"hour"===this.intervalType?this.autoValueFormatString=
"hh:mm TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm TT":"second"===this.intervalType?this.autoValueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.valueFormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType="number";c=B.getNiceNumber(c,!1);this.interval=this.options&&0g?(c=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-c:g=f+c):(c=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=c),0!==f&&(f-=c)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,f=0),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0)),"axisX"===this.type&&b){if(null===this.minimum||isNaN(this.minimum))this.minimum=f-h/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+h/2}else this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?f-h/2:Math.floor(f/this.interval)*this.interval,this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)),
null===this.maximum&&(this.maximum="axisX"===this.type?g+h/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimum&&(0===this.options.minimum?this.maximum+=10:0===this.options.maximum&&(this.minimum-=10));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);this.viewportMaximum=Math.min(this.viewportMaximum,
this.maximum);this.range=this.viewportMaximum-this.viewportMinimum;this.intervalStartPosition="axisX"===this.type&&b?this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval):Math.floor((this.viewportMinimum+0.2*this.interval)/this.interval)*this.interval;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.range)){d=Math.floor(Math.abs(Math.log(this.range)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;if(2this.maxWidth?7:Math.max(7,Math.floor(this.maxWidth/100)):Math.max(Math.floor(this.maxWidth/50),3),c,f,g,h;h=1;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=
this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;"axisX"===this.type?(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===f/c&&(h=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),f*=h,c/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,
0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=c&&!isFinite(f)?(f="undefined"===typeof this.options.interval?0:this.options.interval,c=1):0>=c?c=f:isFinite(f)||(f=c),1===c&&1===f?(f*=this.logarithmBase-1/this.logarithmBase,c=1):1===f/c?(h=Math.min(f*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),f*=h,c/=h):c>f?(h=Math.min(c/
f*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=f?c=f/h:f=c*h):(h=Math.min(f/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==c&&(c/=h)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&1f&&(f=1));h=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)/(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);linearRange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);this.intervalType="number";h=Math.pow(this.logarithmBase,B.getNiceNumber(Math.abs(Math.log(h)/d),!1));this.options&&0this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.minimum?this.minimum:this.dataInfo.min,f=null!==this.maximum?this.maximum:this.dataInfo.max,
isFinite(c)||isFinite(f)?1===c&&1===f?(f*=this.logarithmBase,c/=this.logarithmBase):1===f/c?(h=Math.pow(this.logarithmBase,this.interval),f*=h,c/=h):c>f?(h=Math.min(0.01*(c/f),5),1<=f?c=f/h:f=c*h):(h=Math.min(f/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==c&&(c/=h)):(f="undefined"===typeof this.options.interval?0:this.options.interval,c=1),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):
this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1f&&(f=1)),this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?c/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(c)/d/this.interval)),this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?"undefined"===typeof this.sessionVariables.newViewportMinimum?
Infinity:this.sessionVariables.newViewportMinimum:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="axisX"===this.type?f*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(f)/d/this.interval)),this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===typeof this.sessionVariables.newViewportMaximum?0:this.sessionVariables.newViewportMaximum:this.sessionVariables.viewportMaximum)),
1===this.maximum&&1===this.minimum&&(1===this.options.minimum?this.maximum*=this.logarithmBase-1/this.logarithmBase:1===this.options.maximum&&(this.minimum/=this.logarithmBase-1/this.logarithmBase));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum);this.viewportMinimum>this.viewportMaximum&&(!this.options.viewportMinimum&&!this.options.minimum||this.options.viewportMaximum||this.options.maximum?this.options.viewportMinimum||
this.options.minimum||!this.options.viewportMaximum&&!this.options.maximum||(this.viewportMinimum=this.minimum=(this.options.viewportMaximum||this.options.maximum)/Math.pow(this.logarithmBase,2*Math.ceil(this.interval))):this.viewportMaximum=this.maximum=this.options.viewportMinimum||this.options.minimum);c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(d*this.interval)+0.2)*this.interval);this.range=this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&&
this.rangethis.viewportMaximum||3>a?2:3)){for(d=Math.floor(this.viewportMinimum/b+0.5)*b;dthis.interval&&(this.interval=b,c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(d*this.interval)+0.2)*this.interval))),this.equidistantInterval=!0,this.intervalStartPosition=c;if(!this.valueFormatString&&
(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){d=Math.floor(Math.abs(Math.log(this.viewportMinimum)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;if(2b?1>=c?1:5>=c?5:10:Math.max(Math.floor(c),1);return Number((c*Math.pow(10,b)).toFixed(20))};B.getNiceNumber=function(a,d){var b=Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b);return Number(((d?
1.5>c?1:3>c?2:7>c?5:10:1>=c?1:2>=c?2:5>=c?5:10)*Math.pow(10,b)).toFixed(20))};B.prototype.getLabelStartPoint=function(){var a=E[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0 Sample Tooltip';this.container.innerHTML=a;this.contentDiv=this.container.firstChild;this.container.style.borderRadius=this.contentDiv.style.borderRadius;this.chart._canvasJSContainer.appendChild(this.container)}};S.prototype.mouseMoveHandler=function(a,d){this._lastUpdated&&40>(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this._updateToolTip(a,d))};
S.prototype._updateToolTip=function(a,d,b){b="undefined"===typeof b?!0:b;this.container||this._initialize();this.enabled||this.hide();if(!this.chart.disableToolTip){if("undefined"===typeof a||"undefined"===typeof d){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;d=this._prevY}else this._prevX=a,this._prevY=d;var c=null,f=null,g=[],h=0;if(this.shared&&this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){if("xySwapped"===this.chart.plotInfo.axisPlacement){f=[];if(this.chart.axisX)for(var l=
0;lk.dataSeries.axisY.viewportMaximum&&b++;b-k.dataPoint.y.length&&g.push(k)}else"column"===f.type||"bar"===f.type?0>k.dataPoint.y?0>k.dataSeries.axisY.viewportMinimum&&k.dataSeries.axisY.viewportMaximum>=k.dataPoint.y&&g.push(k):k.dataSeries.axisY.viewportMinimum<=
k.dataPoint.y&&0<=k.dataSeries.axisY.viewportMaximum&&g.push(k):"bubble"===f.type?(b=this.chart._eventManager.objectMap[f.dataPointIds[k.index]].size/2,k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum-b&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum+b&&g.push(k)):(0<=k.dataSeries.type.indexOf("100")||"stackedColumn"===f.type||"stackedBar"===f.type||k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum)&&g.push(k);else g.push(k)}}if(0a&&(a+=this.container.clientWidth+20);a+this.container.clientWidth>Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(this.chart.container.clientWidth,this.chart.width)-this.container.clientWidth));a+="px";d=1!==g.length||this.shared||"line"!==g[0].dataSeries.type&&
"stepLine"!==g[0].dataSeries.type&&"spline"!==g[0].dataSeries.type&&"area"!==g[0].dataSeries.type&&"stepArea"!==g[0].dataSeries.type&&"splineArea"!==g[0].dataSeries.type?"bar"===g[0].dataSeries.type||"rangeBar"===g[0].dataSeries.type||"stackedBar"===g[0].dataSeries.type||"stackedBar100"===g[0].dataSeries.type?g[0].dataSeries.axisX.convertValueToPixel(g[0].dataPoint.x):d:g[0].dataSeries.axisY.convertValueToPixel(g[0].dataPoint.y);d=-d+10;0",n=this.chart.replaceKeywordsWithValue(n,f,c,g)),null!==f.toolTipContent&&("undefined"!==typeof f.toolTipContent||null!==c.options.toolTipContent)){if("line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"column"===c.type||"bar"===c.type||"scatter"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===
c.type||"stackedBar100"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}: {y}",k=c.axisXIndex;else if("bubble"===c.type)this.chart.axisX&&
1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}: {y}, {z}";else if("rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}: {y[0]}, {y[1]}";else if("candlestick"===c.type||"ohlc"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
":
""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:
Open: {y[0]}
High: {y[1]}
Low: {y[2]}
Close: {y[3]}";null===b&&(b="");!0===this.reversed?(b=this.chart.replaceKeywordsWithValue(a,f,c,g)+b,l"+b)):(b+=this.chart.replaceKeywordsWithValue(a,
f,c,g),l"))}null!==b&&(b=n+b)}else{c=d[0].dataSeries;f=d[0].dataPoint;g=d[0].index;if(null===f.toolTipContent||"undefined"===typeof f.toolTipContent&&null===c.options.toolTipContent)return null;if("line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"column"===c.type||"bar"===c.type||"scatter"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"stackedArea"===
c.type||"stackedArea100"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+": {y}";else if("bubble"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+": {y}, {z}";else if("pie"===c.type||"doughnut"===c.type||"funnel"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.name?"{name}: ":f.label?"{label}: ":"")+"{y}";else if("rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||
"rangeSplineArea"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+" : {y[0]}, {y[1]}";else if("candlestick"===c.type||"ohlc"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+"
Open: {y[0]}
High: {y[1]}
Low: {y[2]}
Close: {y[3]}";null===b&&(b="");b+=this.chart.replaceKeywordsWithValue(a,f,c,g)}this.content=a;for(l=0;lc&&a.push(d),d.animationCallback(c),1<=c&&d.onComplete)d.onComplete();this.animations=a;0g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function P(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX=
a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function Q(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function E(a,b,c){return Math.min(c,Math.max(b,a))}function F(a,b,c){0>c&&c++;16*c?a+6*(b-a)*c:
1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function G(a){if(a in H)return H[a];var b,c=1;a=String(a);if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=Q(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=v[E(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=Q(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=E(parseFloat(e[1])/100,0,1);e=E(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=F(d,f,b+1/3);e=F(d,f,b);b=F(d,f,b-1/3)}b="#"+
v[Math.floor(255*g)]+v[Math.floor(255*e)]+v[Math.floor(255*b)];c=c[3]}else b=Z[a]||a;return H[a]={color:b,alpha:c}}function C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*q;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",
c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function R(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function S(a,b){var c=G(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("')}function T(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,k=g.x-c.x,n=g.y-c.y;if(e instanceof w){var h=0,l=g=0,u=0,m=1;if("gradient"==e.type_){h=e.x1_/f;c=e.y1_/d;var p=s(a,e.x0_/f,e.y0_/d),h=s(a,h,c),h=180*Math.atan2(h.x-p.x,h.y-p.y)/Math.PI;0>h&&(h+=360);1E-6>h&&(h=0)}else p=s(a,e.x0_,e.y0_),g=(p.x-c.x)/k,l=(p.y-c.y)/n,k/=f*q,
n/=d*q,m=x.max(k,n),u=2*e.r0_/m,m=2*e.r1_/m-u;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});d=f.length;p=f[0].color;c=f[d-1].color;k=f[0].alpha*a.globalAlpha;a=f[d-1].alpha*a.globalAlpha;for(var n=[],r=0;r')}else e instanceof
I?k&&n&&b.push("'):(e=G(a.fillStyle),b.push(''))}function s(a,b,c){a=a.m_;return{x:q*(b*a[0][0]+c*a[1][0]+a[2][0])-r,y:q*(b*a[0][1]+c*a[1][1]+a[2][1])-r}}function z(a,b,c){isFinite(b[0][0])&&(isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1]))&&(a.m_=b,c&&(a.lineScale_=aa(ba(b[0][0]*b[1][1]-b[0][1]*
b[1][0]))))}function w(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function I(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new A("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new A("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new A("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height}
function A(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var x=Math,k=x.round,J=x.sin,K=x.cos,ba=x.abs,aa=x.sqrt,q=10,r=q/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var M=Array.prototype.slice;O(document);var U={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",W(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var b=0;bd;d++)for(var B=0;16>B;B++)v[16*d+B]=d.toString(16)+B.toString(16);var Z={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",
bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",
darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",
ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",
mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",
peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},
H={},L={},$={butt:"flat",round:"round"},d=C.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo=
function(a,b,c,g,e,f){e=s(this,e,f);a=s(this,a,b);c=s(this,c,g);R(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=s(this,a,b);c=s(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};R(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){c*=q;var d=f?"at":"wa",k=a+K(g)*c-r,n=b+J(g)*c-r;g=a+K(e)*c-r;e=b+J(e)*c-r;k!=g||f||(k+=0.125);a=s(this,a,b);k=s(this,k,n);g=s(this,g,e);this.currentPath_.push({type:d,
x:a.x,y:a.y,radius:c,xStart:k.x,yStart:k.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+
c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new w("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new w("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,r,y,n,h;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var l=a.width,u=a.height;a.runtimeStyle.width=
e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],r=y=0,n=e=l,h=d=u;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],r=y=0,n=l,h=u;else if(9==arguments.length)r=arguments[1],y=arguments[2],n=arguments[3],h=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var m=s(this,c,g),p=[];p.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stroke=function(a){var b=[];b.push("d.x)d.x=f.x;if(null==c.y||f.yd.y)d.y=f.y}}b.push(' ">');a?T(this,b,c,d):S(this,b);b.push("");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a=
{};P(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=t(D(),this.m_)};d.restore=function(){this.aStack_.length&&(P(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){z(this,t([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=K(a);a=J(a);z(this,t([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(this,t([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){z(this,t([[a,
b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_;d=0;var r=1E3,t=0,n=[],h;h=this.font;if(L[h])h=L[h];else{var l=document.createElement("div").style;try{l.font=h}catch(u){}h=L[h]={style:l.fontStyle||"normal",variant:l.fontVariant||"normal",weight:l.fontWeight||"normal",size:l.fontSize||10,family:l.fontFamily||"sans-serif"}}var l=h,m=this.element_;h={};for(var p in l)h[p]=l[p];p=parseFloat(m.currentStyle.fontSize);
m=parseFloat(l.size);"number"==typeof l.size?h.size=l.size:-1!=l.size.indexOf("px")?h.size=m:-1!=l.size.indexOf("em")?h.size=p*m:-1!=l.size.indexOf("%")?h.size=p/100*m:-1!=l.size.indexOf("pt")?h.size=m/0.75:h.size=p;h.size*=0.981;p=h.style+" "+h.variant+" "+h.weight+" "+h.size+"px "+h.family;m=this.element_.currentStyle;l=this.textAlign.toLowerCase();switch(l){case "left":case "center":case "right":break;case "end":l="ltr"==m.direction?"right":"left";break;case "start":l="rtl"==m.direction?"right":
"left";break;default:l="left"}switch(this.textBaseline){case "hanging":case "top":t=h.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":t=-h.size/2.25}switch(l){case "right":d=1E3;r=0.05;break;case "center":d=r=500}b=s(this,b+0,c+t);n.push('');e?S(this,n):T(this,n,{x:-d,y:0},
{x:r,y:h.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1].toFixed(3)+",0,0";b=k(b.x/q)+","+k(b.y/q);n.push('','','');this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a,
b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd",''),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){};
d.arcTo=function(){};d.createPattern=function(a,b){return new I(a,b)};w.prototype.addColorStop=function(a,b){b=G(b);this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};d=A.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR=
13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=U;CanvasRenderingContext2D=C;CanvasGradient=w;CanvasPattern=I;DOMException=A}();