window.Chart=function(e){function t(e,t,a){var n=t.steps*t.stepValue,l=e-t.graphMin,o=c(l/n,1,0);return a*t.steps*o}function a(e,t,a,n){function l(){var l=e.animation?c(s(r),null,0):1;g(n),e.scaleOverlay?(a(l),t()):(t(),a(l))}function o(){r+=i,l(),r<=1?w(o):"function"==typeof e.onAnimationComplete&&e.onAnimationComplete()}var i=e.animation?1/c(e.animationSteps,Number.MAX_VALUE,1):1,s=S[e.animationEasing],r=e.animation?0:1;"function"!=typeof t&&(t=function(){}),w(o)}function n(e,t,a,n,o,i){function s(e){return Math.floor(Math.log(e)/Math.LN10)}var r,c,u,d,h,f,S;for(f=n-o,S=s(f),r=Math.floor(o/(1*Math.pow(10,S)))*Math.pow(10,S),c=Math.ceil(n/(1*Math.pow(10,S)))*Math.pow(10,S),u=c-r,d=Math.pow(10,S),h=Math.round(u/d);ht;)ht?t:r(a)&&e)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):P[e]=P[e]||h(document.getElementById(e).innerHTML);return t?a(t):a}var f=this,S={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-1*e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return 1*((e=e/1-1)*e*e+1)},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-1*((e=e/1-1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return 1*(e/=1)*e*e*e*e},easeOutQuint:function(e){return 1*((e=e/1-1)*e*e*e*e+1)},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return-1*Math.cos(e/1*(Math.PI/2))+1},easeOutSine:function(e){return 1*Math.sin(e/1*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e/1)-1)},easeInExpo:function(e){return 0==e?1:1*Math.pow(2,10*(e/1-1))},easeOutExpo:function(e){return 1==e?1:1*(-Math.pow(2,-10*e/1)+1)},easeInOutExpo:function(e){return 0==e?0:1==e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(-Math.pow(2,-10*--e)+2)},easeInCirc:function(e){return e>=1?e:-1*(Math.sqrt(1-(e/=1)*e)-1)},easeOutCirc:function(e){return 1*Math.sqrt(1-(e=e/1-1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,a=0,n=1;if(0==e)return 0;if(1==(e/=1))return 1;if(a||(a=.3),n",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null};var n=a?d(f.PolarArea.defaults,a):f.PolarArea.defaults;return new v(t,n,e)},this.Radar=function(t,a){f.Radar.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!1,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,angleShowLineOut:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:12,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var n=a?d(f.Radar.defaults,a):f.Radar.defaults;return new b(t,n,e)},this.Pie=function(t,a){f.Pie.defaults={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null};var n=a?d(f.Pie.defaults,a):f.Pie.defaults;return new M(t,n,e)},this.Doughnut=function(t,a){f.Doughnut.defaults={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animation:!0,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null};var n=a?d(f.Doughnut.defaults,a):f.Doughnut.defaults;return new k(t,n,e)},this.Line=function(t,a){f.Line.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:2,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var n=a?d(f.Line.defaults,a):f.Line.defaults;return new L(t,n,e)},this.Bar=function(t,a){f.Bar.defaults={scaleOverlay:!1,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null};var n=a?d(f.Bar.defaults,a):f.Bar.defaults;return new F(t,n,e)};var g=function(e){e.clearRect(0,0,p,m)},v=function(e,r,c){function u(){S=i([p,m])/2,S-=o([.5*r.scaleFontSize,.5*r.scaleLineWidth]),b=2*r.scaleFontSize,r.scaleShowLabelBackdrop&&(b+=2*r.scaleBackdropPaddingY,S-=1.5*r.scaleBackdropPaddingY),M=S,b=s(b,5)}function d(){for(var e=0;et&&(t=e[n].value),e[n].valueMath.PI?u.textAlign="right":u.textAlign="left",u.textBaseline="middle",u.fillText(e.labels[i],s,-c)}u.restore()}function f(){g=i([p,m])/2,M=2*r.scaleFontSize;for(var t=0,a=0;at&&(t=n)}g-=o([t,r.pointLabelFontSize/2*1.5]),g-=r.pointLabelFontSize,g=c(g,null,0),k=g,M=s(M,5)}function S(){for(var t=Number.MIN_VALUE,a=Number.MAX_VALUE,n=0;nt&&(t=e.datasets[n].data[l]),e.datasets[n].data[l]0?(i.save(),i.textAlign="right"):i.textAlign="center",i.fillStyle=o.scaleFontColor;for(var t=0;t0?(i.translate(w+t*k,P+o.scaleFontSize),i.rotate(-(y*(Math.PI/180))),i.fillText(e.labels[t],0,0),i.restore()):i.fillText(e.labels[t],w+t*k,P+o.scaleFontSize+3),i.beginPath(),i.moveTo(w+t*k,P+3),o.scaleShowGridLines&&t>0?(i.lineWidth=o.scaleGridLineWidth,i.strokeStyle=o.scaleGridLineColor,i.lineTo(w+t*k,5)):i.lineTo(w+t*k,P+3),i.stroke();i.lineWidth=o.scaleLineWidth,i.strokeStyle=o.scaleLineColor,i.beginPath(),i.moveTo(w,P+5),i.lineTo(w,5),i.stroke(),i.textAlign="right",i.textBaseline="middle";for(var a=0;at?n:t}t+=10}F=p-t-L,k=Math.floor(F/(e.labels.length-1)),w=p-L/2-F,P=v+o.scaleFontSize/2}function u(){h=m,i.font=o.scaleFontStyle+" "+o.scaleFontSize+"px "+o.scaleFontFamily,L=1;for(var t=0;tL?a:L}p/e.labels.lengtht&&(t=e.datasets[n].data[l]),e.datasets[n].data[l]0?(i.save(),i.textAlign="right"):i.textAlign="center",i.fillStyle=o.scaleFontColor;for(var t=0;t0?(i.translate(w+t*k,P+o.scaleFontSize),i.rotate(-(W*(Math.PI/180))),i.fillText(e.labels[t],0,0),i.restore()):i.fillText(e.labels[t],w+t*k+k/2,P+o.scaleFontSize+3),i.beginPath(),i.moveTo(w+(t+1)*k,P+3),i.lineWidth=o.scaleGridLineWidth,i.strokeStyle=o.scaleGridLineColor,i.lineTo(w+(t+1)*k,5),i.stroke();i.lineWidth=o.scaleLineWidth,i.strokeStyle=o.scaleLineColor,i.beginPath(),i.moveTo(w,P+5),i.lineTo(w,5),i.stroke(),i.textAlign="right",i.textBaseline="middle";for(var a=0;at?n:t}t+=10}F=p-t-L,k=Math.floor(F/e.labels.length),y=(k-2*o.scaleGridLineWidth-2*o.barValueSpacing-(o.barDatasetSpacing*e.datasets.length-1)-(o.barStrokeWidth/2*e.datasets.length-1))/e.datasets.length,w=p-L/2-F,P=v+o.scaleFontSize/2}function u(){h=m,i.font=o.scaleFontStyle+" "+o.scaleFontSize+"px "+o.scaleFontFamily,L=1;for(var t=0;tL?a:L}p/e.labels.lengtht&&(t=e.datasets[n].data[l]),e.datasets[n].data[l]