(function(){var l=this,d=l.Chart,c=function(a){this.canvas=a.canvas;this.ctx=a;var g=function(a,g){return a["offset"+g]?a["offset"+g]:document.defaultView.getComputedStyle(a).getPropertyValue(g)};this.width=g(a.canvas,"Width")||a.canvas.width;this.height=g(a.canvas,"Height")||a.canvas.height;return this.aspectRatio=this.width/this.height,b.retinaScale(this),this};c.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null, scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"\x3c%\x3dvalue%\x3e",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipTitleTemplate:"\x3c%\x3d label%\x3e",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"\x3c%if (label){%\x3e\x3c%\x3dlabel%\x3e: \x3c%}%\x3e\x3c%\x3d value %\x3e",multiTooltipTemplate:"\x3c%\x3d datasetLabel %\x3e: \x3c%\x3d value %\x3e", multiTooltipKeyBackground:"#fff",segmentColorDefault:"#A6CEE3 #1F78B4 #B2DF8A #33A02C #FB9A99 #E31A1C #FDBF6F #FF7F00 #CAB2D6 #6A3D9A #B4B482 #B15928".split(" "),segmentHighlightColorDefaults:"#CEF6FF #47A0DC #DAFFB2 #5BC854 #FFC2C1 #FF4244 #FFE797 #FFA728 #F2DAFE #9265C2 #DCDCAA #D98150".split(" "),onAnimationProgress:function(){},onAnimationComplete:function(){}}};c.types={};var b=c.helpers={},e=b.each=function(a,g,f){var b=Array.prototype.slice.call(arguments,3);if(a)if(a.length===+a.length){var e; for(e=0;eg)return g}else if(q(f)&&f>a)return f;return a},b.getDecimalPlaces=function(a){if(0!==a%1&&q(a)){a=a.toString();if(0>a.indexOf("e-"))return a.split(".")[1].length;if(0>a.indexOf("."))return parseInt(a.split("e-")[1]);a=a.split(".")[1].split("e-");return a[0].length+parseInt(a[1])}return 0}),z=b.radians=function(a){return Math.PI/180*a},D=(b.getAngleFromPoint=function(a,g){var f=g.x-a.x,b=g.y-a.y,e=Math.sqrt(f*f+b*b),c=2*Math.PI+Math.atan2(b,f);return 0>f&&0>b&&(c+=2*Math.PI),{angle:c, distance:e}},b.aliasPixel=function(a){return 0===a%2?0:.5}),K=(b.splineCurve=function(a,g,f,b){var e=Math.sqrt(Math.pow(g.x-a.x,2)+Math.pow(g.y-a.y,2)),c=Math.sqrt(Math.pow(f.x-g.x,2)+Math.pow(f.y-g.y,2)),d=b*e/(e+c);b=b*c/(e+c);return{inner:{x:g.x-d*(f.x-a.x),y:g.y-d*(f.y-a.y)},outer:{x:g.x+b*(f.x-a.x),y:g.y+b*(f.y-a.y)}}},b.calculateOrderOfMagnitude=function(a){return Math.floor(Math.log(a)/Math.LN10)}),r=(b.calculateScaleRange=function(a,g,f,b,c){g=Math.floor(g/(1.5*f));f=2>=g;var d=[];e(a,function(a){null== a||d.push(a)});var h=v(d),k=x(d);k===h&&(k+=.5,.5<=h&&!b?h-=.5:k+=.5);a=Math.abs(k-h);a=K(a);k=Math.ceil(k/(1*Math.pow(10,a)))*Math.pow(10,a);b=b?0:Math.floor(h/(1*Math.pow(10,a)))*Math.pow(10,a);for(var h=k-b,k=Math.pow(10,a),p=Math.round(h/k);(p>g||g>2*p)&&!f;)if(p>g)k*=2,p=Math.round(h/k),0!==p%1&&(f=!0);else{if(c&&0<=a&&0!==k/2%1)break;k/=2;p=Math.round(h/k)}return f&&(p=2,k=h/p),{steps:p,stepValue:k,min:b,max:b+p*k}},b.template=function(a,g){if(a instanceof Function)return a(g);var f={},f=/\W/.test(a)? new Function("obj","var p\x3d[],print\x3dfunction(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g," ").split("\x3c%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%\x3e").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):f[a]=f[a];return g?f(g):f}),w=(b.generateLabels=function(a,g,f,b){var c=Array(g);return a&&e(c,function(g,e){c[e]=r(a,{value:f+b*(e+1)})}),c},b.easingEffects={linear:function(a){return a}, easeInQuad:function(a){return a*a},easeOutQuad:function(a){return-1*a*(a-2)},easeInOutQuad:function(a){return 1>(a/=.5)?.5*a*a:-.5*(--a*(a-2)-1)},easeInCubic:function(a){return a*a*a},easeOutCubic:function(a){return 1*((a=a/1-1)*a*a+1)},easeInOutCubic:function(a){return 1>(a/=.5)?.5*a*a*a:.5*((a-=2)*a*a+2)},easeInQuart:function(a){return a*a*a*a},easeOutQuart:function(a){return-1*((a=a/1-1)*a*a*a-1)},easeInOutQuart:function(a){return 1>(a/=.5)?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)},easeInQuint:function(a){return 1* (a/=1)*a*a*a*a},easeOutQuint:function(a){return 1*((a=a/1-1)*a*a*a*a+1)},easeInOutQuint:function(a){return 1>(a/=.5)?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)},easeInSine:function(a){return-1*Math.cos(a/1*(Math.PI/2))+1},easeOutSine:function(a){return 1*Math.sin(a/1*(Math.PI/2))},easeInOutSine:function(a){return-.5*(Math.cos(Math.PI*a/1)-1)},easeInExpo:function(a){return 0===a?1:1*Math.pow(2,10*(a/1-1))},easeOutExpo:function(a){return 1===a?1:1*(-Math.pow(2,-10*a/1)+1)},easeInOutExpo:function(a){return 0=== a?0:1===a?1:1>(a/=.5)?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return 1<=a?a:-1*(Math.sqrt(1-(a/=1)*a)-1)},easeOutCirc:function(a){return 1*Math.sqrt(1-(a=a/1-1)*a)},easeInOutCirc:function(a){return 1>(a/=.5)?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeInElastic:function(a){var g=1.70158,f=0,b=1;return 0===a?0:1==(a/=1)?1:(f||(f=.3),ba?-.5*e*Math.pow(2,10*--a)*Math.sin(2*(1*a-g)*Math.PI/b):e*Math.pow(2,-10*--a)*Math.sin(2*(1*a-g)*Math.PI/b)*.5+1)},easeInBack:function(a){return 1*(a/=1)*a*(2.70158*a-1.70158)},easeOutBack:function(a){return 1* ((a=a/1-1)*a*(2.70158*a+1.70158)+1)},easeInOutBack:function(a){var g=1.70158;return 1>(a/=.5)?.5*a*a*(((g*=1.525)+1)*a-g):.5*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)},easeInBounce:function(a){return 1-w.easeOutBounce(1-a)},easeOutBounce:function(a){return(a/=1)<1/2.75?7.5625*a*a:2/2.75>a?1*(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?1*(7.5625*(a-=2.25/2.75)*a+.9375):1*(7.5625*(a-=2.625/2.75)*a+.984375)},easeInOutBounce:function(a){return.5>a?.5*w.easeInBounce(2*a):.5*w.easeOutBounce(2*a-1)+.5}}),E=b.requestAnimFrame= function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return window.setTimeout(a,1E3/60)}}(),L=(b.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(a){return window.clearTimeout(a,1E3/60)}}(),b.animationLoop=function(a, g,b,e,c,d){var h=0,k=w[b]||w.linear,p=function(){h++;var b=h/g,f=k(b);a.call(d,f,b,h);e.call(d,f,b);g>h?d.animationFrame=E(p):c.apply(d)};E(p)},b.getRelativePosition=function(a){var b,f,e=a.originalEvent||a;a=(a.currentTarget||a.srcElement).getBoundingClientRect();return e.touches?(b=e.touches[0].clientX-a.left,f=e.touches[0].clientY-a.top):(b=e.clientX-a.left,f=e.clientY-a.top),{x:b,y:f}},b.addEvent=function(a,b,f){a.addEventListener?a.addEventListener(b,f):a.attachEvent?a.attachEvent("on"+b,f): a["on"+b]=f}),M=b.removeEvent=function(a,b,f){a.removeEventListener?a.removeEventListener(b,f,!1):a.detachEvent?a.detachEvent("on"+b,f):a["on"+b]=m},N=(b.bindEvents=function(a,b,f){a.events||(a.events={});e(b,function(b){a.events[b]=function(){f.apply(a,arguments)};L(a.chart.canvas,b,a.events[b])})},b.unbindEvents=function(a,b){e(b,function(b,g){M(a.chart.canvas,g,b)})}),O=b.getMaximumWidth=function(a){a=a.parentNode;var b=parseInt(y(a,"padding-left"))+parseInt(y(a,"padding-right"));return a?a.clientWidth- b:0},P=b.getMaximumHeight=function(a){a=a.parentNode;var b=parseInt(y(a,"padding-bottom"))+parseInt(y(a,"padding-top"));return a?a.clientHeight-b:0},y=b.getStyle=function(a,b){return a.currentStyle?a.currentStyle[b]:document.defaultView.getComputedStyle(a,null).getPropertyValue(b)},Q=(b.getMaximumSize=b.getMaximumWidth,b.retinaScale=function(a){var b=a.ctx,f=a.canvas.width;a=a.canvas.height;window.devicePixelRatio&&(b.canvas.style.width=f+"px",b.canvas.style.height=a+"px",b.canvas.height=a*window.devicePixelRatio, b.canvas.width=f*window.devicePixelRatio,b.scale(window.devicePixelRatio,window.devicePixelRatio))}),R=b.clear=function(a){a.ctx.clearRect(0,0,a.width,a.height)},t=b.fontString=function(a,b,f){return b+" "+a+"px "+f},A=b.longestText=function(a,b,f){a.font=b;var c=0;return e(f,function(b){b=a.measureText(b).width;c=b>c?b:c}),c},F=b.drawRoundedRectangle=function(a,b,f,e,c,d){a.beginPath();a.moveTo(b+d,f);a.lineTo(b+e-d,f);a.quadraticCurveTo(b+e,f,b+e,f+d);a.lineTo(b+e,f+c-d);a.quadraticCurveTo(b+e, f+c,b+e-d,f+c);a.lineTo(b+d,f+c);a.quadraticCurveTo(b,f+c,b,f+c-d);a.lineTo(b,f+d);a.quadraticCurveTo(b,f,b+d,f);a.closePath()};c.instances={};c.Type=function(a,b,f){this.options=b;this.chart=f;this.id=H();c.instances[this.id]=this;b.responsive&&this.resize();this.initialize.call(this,a)};k(c.Type.prototype,{initialize:function(){return this},clear:function(){return R(this.chart),this},stop:function(){return c.animationService.cancelAnimation(this),this},resize:function(a){this.stop();var b=this.chart.canvas, f=O(this.chart.canvas),e=this.options.maintainAspectRatio?f/this.chart.aspectRatio:P(this.chart.canvas);return b.width=this.chart.width=f,b.height=this.chart.height=e,Q(this.chart),"function"==typeof a&&a.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:m,render:function(a){(a&&this.reflow(),this.options.animation&&!a)?(a=new c.Animation,a.numSteps=this.options.animationSteps,a.easing=this.options.animationEasing,a.render=function(a,f){var e=f.currentStep/f.numSteps,c=(0,b.easingEffects[f.easing])(e); a.draw(c,e,f.currentStep)},a.onAnimationProgress=this.options.onAnimationProgress,a.onAnimationComplete=this.options.onAnimationComplete,c.animationService.addAnimation(this,a)):(this.draw(),this.options.onAnimationComplete.call(this));return this},generateLegend:function(){return b.template(this.options.legendTemplate,this)},destroy:function(){this.stop();this.clear();N(this,this.events);var a=this.chart.canvas;a.width=this.chart.width;a.height=this.chart.height;a.style.removeProperty?(a.style.removeProperty("width"), a.style.removeProperty("height")):(a.style.removeAttribute("width"),a.style.removeAttribute("height"));delete c.instances[this.id]},showTooltip:function(a,g){"undefined"==typeof this.activeElements&&(this.activeElements=[]);if(function(a){var b=!1;return a.length!==this.activeElements.length?b=!0:(e(a,function(a,f){a!==this.activeElements[f]&&(b=!0)},this),b)}.call(this,a)||g){if(this.activeElements=a,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),0this.chart.width/2?c:e,y:(h+g)/2}}.call(this,d);(new c.MultiTooltip({x:f.x,y:f.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily, titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:k,legendColors:m,legendColorBackground:this.options.multiTooltipKeyBackground,title:r(this.options.tooltipTitleTemplate,a[0]),chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips})).draw()}else e(a,function(a){var b=a.tooltipPosition();(new c.Tooltip({x:Math.round(b.x),y:Math.round(b.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding, fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:r(this.options.tooltipTemplate,a),chart:this.chart,custom:this.options.customTooltips})).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}); c.Type.extend=function(a){var b=this,f=function(){return b.apply(this,arguments)};if(f.prototype=h(b.prototype),k(f.prototype,a),f.extend=c.Type.extend,a.name||b.prototype.name){var e=a.name||b.prototype.name,d=c.defaults[b.prototype.name]?h(c.defaults[b.prototype.name]):{};c.defaults[e]=k(d,a.defaults);c.types[e]=f;c.prototype[e]=function(a,b){var g=u(c.defaults.global,c.defaults[e],b||{});return new f(a,g,this)}}else I("Name not provided for this chart, so it hasn't been registered");return b}; c.Element=function(a){k(this,a);this.initialize.apply(this,arguments);this.save()};k(c.Element.prototype,{initialize:function(){},restore:function(a){return a?e(a,function(a){this[a]=this._saved[a]},this):k(this,this._saved),this},save:function(){return this._saved=h(this),delete this._saved._saved,this},update:function(a){return e(a,function(a,b){this._saved[b]=this[b];this[b]=a},this),this},transition:function(a,b){return e(a,function(a,e){this[e]=(a-this._saved[e])*b+this._saved[e]},this),this}, tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return q(this.value)}});c.Element.extend=n;c.Point=c.Element.extend({display:!0,inRange:function(a,b){var e=this.hitDetectionRadius+this.radius;return Math.pow(a-this.x,2)+Math.pow(b-this.y,2)=this.innerRadius&&f.distance<=this.outerRadius;return(d>h?h>=c||c>=d:c>=d&&h>=c)&&f},tooltipPosition:function(){var a=this.startAngle+(this.endAngle-this.startAngle)/2,b=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(a)*b,y:this.y+Math.sin(a)*b}},draw:function(a){a= this.ctx;a.beginPath();a.arc(this.x,this.y,0>this.outerRadius?0:this.outerRadius,this.startAngle,this.endAngle);a.arc(this.x,this.y,0>this.innerRadius?0:this.innerRadius,this.endAngle,this.startAngle,!0);a.closePath();a.strokeStyle=this.strokeColor;a.lineWidth=this.strokeWidth;a.fillStyle=this.fillColor;a.fill();a.lineJoin="bevel";this.showStroke&&a.stroke()}});c.Rectangle=c.Element.extend({draw:function(){var a=this.ctx,b=this.width/2,e=this.x-b,b=this.x+b,c=this.base-(this.base-this.y),d=this.strokeWidth/ 2;this.showStroke&&(e+=d,b-=d,c+=d);a.beginPath();a.fillStyle=this.fillColor;a.strokeStyle=this.strokeColor;a.lineWidth=this.strokeWidth;a.moveTo(e,this.base);a.lineTo(e,c);a.lineTo(b,c);a.lineTo(b,this.base);a.fill();this.showStroke&&a.stroke()},height:function(){return this.base-this.y},inRange:function(a,b){return a>=this.x-this.width/2&&a<=this.x+this.width/2&&b>=this.y&&b<=this.base}});c.Animation=c.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}); c.Tooltip=c.Element.extend({draw:function(){var a=this.chart.ctx;a.font=t(this.fontSize,this.fontStyle,this.fontFamily);this.xAlign="center";this.yAlign="above";var b=this.caretPadding=2,e=a.measureText(this.text).width+2*this.xPadding,c=this.fontSize+2*this.yPadding,d=c+this.caretHeight+b;this.x+e/2>this.chart.width?this.xAlign="left":0>this.x-e/2&&(this.xAlign="right");0>this.y-d&&(this.yAlign="below");var h=this.x-e/2,d=this.y-d;if(a.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case "above":a.beginPath(); a.moveTo(this.x,this.y-b);a.lineTo(this.x+this.caretHeight,this.y-(b+this.caretHeight));a.lineTo(this.x-this.caretHeight,this.y-(b+this.caretHeight));a.closePath();a.fill();break;case "below":d=this.y+b+this.caretHeight,a.beginPath(),a.moveTo(this.x,this.y+b),a.lineTo(this.x+this.caretHeight,this.y+b+this.caretHeight),a.lineTo(this.x-this.caretHeight,this.y+b+this.caretHeight),a.closePath(),a.fill()}switch(this.xAlign){case "left":h=this.x-e+(this.cornerRadius+this.caretHeight);break;case "right":h= this.x-(this.cornerRadius+this.caretHeight)}F(a,h,d,e,c,this.cornerRadius);a.fill();a.fillStyle=this.textColor;a.textAlign="center";a.textBaseline="middle";a.fillText(this.text,h+e/2,d+c/2)}}});c.MultiTooltip=c.Element.extend({initialize:function(){this.font=t(this.fontSize,this.fontStyle,this.fontFamily);this.titleFont=t(this.titleFontSize,this.titleFontStyle,this.titleFontFamily);this.titleHeight=this.title?1.5*this.titleFontSize:0;this.height=this.labels.length*this.fontSize+this.fontSize/2*(this.labels.length- 1)+2*this.yPadding+this.titleHeight;this.ctx.font=this.titleFont;var a=this.ctx.measureText(this.title).width,b=A(this.ctx,this.font,this.labels)+this.fontSize+3;this.width=x([b,a])+2*this.xPadding;a=this.height/2;0>this.y-a?this.y=a:this.y+a>this.chart.height&&(this.y=this.chart.height-a);this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(a){var b=this.y-this.height/2+this.yPadding;return 0===a?b+this.titleHeight/3:b+(1.5*this.fontSize*(a-1)+this.fontSize/ 2)+this.titleHeight},draw:function(){if(this.custom)this.custom(this);else{F(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var a=this.ctx;a.fillStyle=this.fillColor;a.fill();a.closePath();a.textAlign="left";a.textBaseline="middle";a.fillStyle=this.titleTextColor;a.font=this.titleFont;a.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0));a.font=this.font;b.each(this.labels,function(b,e){a.fillStyle=this.textColor;a.fillText(b,this.x+this.xPadding+this.fontSize+ 3,this.getLineHeight(e+1));a.fillStyle=this.legendColorBackground;a.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize);a.fillStyle=this.legendColors[e].fill;a.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}});c.Scale=c.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var a=C(this.stepValue),b=0;b<=this.steps;b++)this.yLabels.push(r(this.templateString, {value:(this.min+b*this.stepValue).toFixed(a)}));this.yLabelWidth=this.display&&this.showLabels?A(this.ctx,this.font,this.yLabels)+10:0},addXLabel:function(a){this.xLabels.push(a);this.valuesCount++;this.fit()},removeXLabel:function(){this.xLabels.shift();this.valuesCount--;this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0;this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height;this.startPoint+=this.padding;this.endPoint-=this.padding;var a,b=this.endPoint,e=this.endPoint- this.startPoint;this.calculateYRange(e);this.buildYLabels();for(this.calculateXLabelRotation();e>this.endPoint-this.startPoint;)e=this.endPoint-this.startPoint,a=this.yLabelWidth,this.calculateYRange(e),this.buildYLabels(),athis.yLabelWidth?b/2:this.yLabelWidth,this.xLabelRotation=0,this.display){var e,c=A(this.ctx,this.font,this.xLabels);this.xLabelWidth=c;for(var d=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>d&&0===this.xLabelRotation||this.xLabelWidth>d&&90>=this.xLabelRotation&&0this.yLabelWidth&&(this.xScalePaddingLeft=a+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth= e*c;0k&&(k=a.x+c,d=b),a.x-ck&&(k=a.x+e,d=b):b>this.valuesCount/2&&a.x-eb||b>h-m;h=b===m||b===h-m;0===b?a.textAlign="center":b===c?a.textAlign="center":c>b?a.textAlign="left":a.textAlign="right";h?a.textBaseline="middle":k?a.textBaseline= "bottom":a.textBaseline="top";a.fillText(this.labels[b],d.x,d.y)}}}}});c.animationService={frameDuration:17,animations:[],dropFrames:0,addAnimation:function(a,e){for(var c=0;cthis.animations[c].animationObject.numSteps&& (this.animations[c].animationObject.currentStep=this.animations[c].animationObject.numSteps),this.animations[c].animationObject.render(this.animations[c].chartInstance,this.animations[c].animationObject),this.animations[c].animationObject.currentStep==this.animations[c].animationObject.numSteps&&(this.animations[c].animationObject.onAnimationComplete.call(this.animations[c].chartInstance),this.animations.splice(c,1),c--);a=(Date.now()-a-this.frameDuration)/this.frameDuration;1this.scale.endPoint?b.controlPoints.outer.y=this.scale.endPoint:b.controlPoints.outer.y< this.scale.startPoint&&(b.controlPoints.outer.y=this.scale.startPoint);b.controlPoints.inner.y>this.scale.endPoint?b.controlPoints.inner.y=this.scale.endPoint:b.controlPoints.inner.y=this.scale.valuesCount||0>b)&&(b=0),c.distance<=this.scale.drawingArea&&d.each(this.datasets,function(c){e.push(c.points[b])}),e},buildScale:function(c){this.scale=new l.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop, backdropColor:this.options.scaleBackdropColor,backgroundColors:this.options.scaleBackgroundColors,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,angleLineInterval:this.options.angleLineInterval?this.options.angleLineInterval: 1,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:c.labels,valuesCount:c.datasets[0].data.length});this.scale.setScaleSize();this.updateScaleRange(c.datasets);this.scale.buildYLabels()}, updateScaleRange:function(c){var b=function(){var b=[];return d.each(c,function(c){c.data?b=b.concat(c.data):d.each(c.points,function(c){b.push(c.value)})}),b}(),b=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:d.calculateScaleRange(b,d.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero, this.options.scaleIntegersOnly);d.extend(this.scale,b)},addData:function(c,b){this.scale.valuesCount++;d.each(c,function(c,d){var k=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(c));this.datasets[d].points.push(new this.PointClass({value:c,label:b,datasetLabel:this.datasets[d].label,x:k.x,y:k.y,strokeColor:this.datasets[d].pointStrokeColor,fillColor:this.datasets[d].pointColor}))},this);this.scale.labels.push(b);this.reflow();this.update()},removeData:function(){this.scale.valuesCount--; this.scale.labels.shift();d.each(this.datasets,function(c){c.points.shift()},this);this.reflow();this.update()},update:function(){this.eachPoints(function(c){c.save()});this.reflow();this.render()},reflow:function(){d.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:d.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2});this.updateScaleRange(this.datasets);this.scale.setScaleSize();this.scale.buildYLabels()},draw:function(c){var b= c||1,e=this.chart.ctx;this.clear();this.scale.draw();d.each(this.datasets,function(c){d.each(c.points,function(c,d){c.hasValue()&&c.transition(this.scale.getPointPosition(d,this.scale.calculateCenterOffset(c.value)),b)},this);e.lineWidth=this.options.datasetStrokeWidth;e.strokeStyle=c.strokeColor;e.beginPath();d.each(c.points,function(b,c){0===c?e.moveTo(b.x,b.y):e.lineTo(b.x,b.y)},this);e.closePath();e.stroke();e.fillStyle=c.fillColor;this.options.datasetFill&&e.fill();d.each(c.points,function(b){b.hasValue()&& b.draw()})},this)}})}).call(this);