cv-online/js/ChartNew.js

1 line
116 KiB
JavaScript

function roundToWithThousands(e,t,n){var r=1*unFormat(e,t);if(typeof r=="number"&&n!="none"){if(n<=0){var i=-n;r=+(Math.round(r+"e+"+i)+"e-"+i)}else{var i=n;var s="1e+"+i;value=+Math.round(r/s)*s}}r=fmtChartJS(e,r,"none");return r}function unFormat(e,t){if((e.decimalSeparator!="."||e.thousandSeparator!="")&&typeof t=="string"){var n=""+t;if(e.thousandSeparator!=""){while(n.indexOf(e.thousandSeparator)>=0)n=""+n.replace(e.thousandSeparator,"")}if(e.decimalSeparator!=".")n=""+n.replace(e.decimalSeparator,".");return 1*n}else{return t}}function fmtChartJSPerso(e,t,n){switch(n){case"SampleJS_Format":if(typeof t=="number")return_value="My Format : "+t.toString()+" $";else return_value=t+"XX";break;case"Change_Month":if(typeof t=="string")return_value=t.toString()+" 2014";else return_value=t.toString()+"YY";break;default:return_value=t;break}return return_value}function fmtChartJS(e,t,n){var r;if(n=="notformatted"){r=t}else if(n=="none"&&typeof t=="number"){if(e.roundNumber!="none"){if(e.roundNumber<=0){var i=-e.roundNumber;t=+(Math.round(t+"e+"+i)+"e-"+i)}else{var i=e.roundNumber;var s="1e+"+i;t=+Math.round(t/s)*s}}if(e.decimalSeparator!="."||e.thousandSeparator!=""){r=t.toString().replace(/\./g,e.decimalSeparator);if(e.thousandSeparator!=""){var o=r;var u="";var a=o.indexOf(e.decimalSeparator);if(a>=0){u=o.substring(a+1,o.length);u=u.split("").reverse().join("");o=o.substring(0,a)}o=o.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e.thousandSeparator);u=u.split("").reverse().join("");r=o;if(u!="")r=r+e.decimalSeparator+u}}else r=t}else if(n!="none"&&n!="notformatted"){r=fmtChartJSPerso(e,t,n)}else{r=t}return r}function tmplbis(e,t){var n=!/\W/.test(e)?cachebis[e]=cachebis[e]||tmplbis(document.getElementById(e).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};"+"with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return t?n(t):n}function createCursorDiv(){if(cursorDivCreated==false){var e=document.createElement("divCursor");e.id="divCursor";e.style.position="absolute";document.body.appendChild(e);cursorDivCreated=true}}function checkBrowser(){this.ver=navigator.appVersion;this.dom=document.getElementById?1:0;this.ie5=this.ver.indexOf("MSIE 5")>-1&&this.dom?1:0;this.ie4=document.all&&!this.dom?1:0;this.ns5=this.dom&&parseInt(this.ver)>=5?1:0;this.ns4=document.layers&&!this.dom?1:0;this.bw=this.ie5||this.ie4||this.ns4||this.ns5;return this}function cursorInit(){scrolled=bw.ns4||bw.ns5?"window.pageYOffset":"document.body.scrollTop";if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)}function makeCursorObj(obj,nest){createCursorDiv();nest=!nest?"":"document."+nest+".";this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers."+obj):0;this.moveIt=b_moveIt;cursorInit();return this}function b_moveIt(e,t){this.x=e;this.y=t;this.css.left=this.x+"px";this.css.top=this.y+"px"}function isIE(){var e=navigator.userAgent.toLowerCase();return e.indexOf("msie")!=-1?parseInt(e.split("msie")[1]):false}function mergeChartConfig(e,t){var n={};for(var r in e){n[r]=e[r]}for(var r in t){n[r]=t[r]}return n}function sleep(e){var t=new Date;t.setTime(t.getTime()+e);while((new Date).getTime()<t.getTime()){}}function saveCanvas(e,t,n,r){cvSave=e.getImageData(0,0,e.canvas.width,e.canvas.height);var i={savePng:false,annotateDisplay:false,animation:false,dynamicDisplay:false};var s=mergeChartConfig(n,i);s.clearRect=false;switch(r){case"Bar":(new Chart(e.canvas.getContext("2d"))).Bar(t,s);break;case"Pie":(new Chart(e.canvas.getContext("2d"))).Pie(t,s);break;case"Doughnut":(new Chart(e.canvas.getContext("2d"))).Doughnut(t,s);break;case"Radar":(new Chart(e.canvas.getContext("2d"))).Radar(t,s);break;case"PolarArea":(new Chart(e.canvas.getContext("2d"))).PolarArea(t,s);break;case"HorizontalBar":(new Chart(e.canvas.getContext("2d"))).HorizontalBar(t,s);break;case"StackedBar":(new Chart(e.canvas.getContext("2d"))).StackedBar(t,s);break;case"HorizontalStackedBar":(new Chart(e.canvas.getContext("2d"))).HorizontalStackedBar(t,s);break;case"Line":(new Chart(e.canvas.getContext("2d"))).Line(t,s);break}if(n.savePngOuput=="NewWindow"){var o=e.canvas.toDataURL();e.putImageData(cvSave,0,0);window.open(o,"_blank")}if(n.savePngOuput=="CurrentWindow"){var o=e.canvas.toDataURL();e.putImageData(cvSave,0,0);window.location.href=o}if(n.savePngOuput=="Save"){document.location.href=e.canvas.toDataURL("image/png").replace("image/png","image/octet-stream");e.putImageData(cvSave,0,0)}}function dynamicFunction(e,t,n,r){if(t.dynamicDisplay){if(n.canvas.id==""){var i=new Date;var s=i.getTime();n.canvas.id="Canvas_"+s}if(typeof dynamicDisplay[n.canvas.id]=="undefined"){dynamicDisplayList[dynamicDisplayList["length"]]=n.canvas.id;dynamicDisplay[n.canvas.id]=[n.canvas,false,false,e,t,n.canvas,r];dynamicDisplay[n.canvas.id][1]=isScrolledIntoView(n.canvas);window.onscroll=scrollFunction}if(dynamicDisplay[n.canvas.id][1]==false||dynamicDisplay[n.canvas.id][2]==true)return false;dynamicDisplay[n.canvas.id][2]=true}return true}function isScrolledIntoView(e){var t=0;var n=0;elem=e;while(elem){t+=elem.offsetLeft-elem.scrollLeft+elem.clientLeft;n+=elem.offsetTop-elem.scrollTop+elem.clientTop;elem=elem.offsetParent}if(t+e.width/2>=window.pageXOffset&&t+e.width/2<=window.pageXOffset+window.innerWidth&&n+e.height/2>=window.pageYOffset&&n+e.height/2<=window.pageYOffset+window.innerHeight)return true;else return false}function scrollFunction(){for(var e=0;e<dynamicDisplayList["length"];e++){if(isScrolledIntoView(dynamicDisplay[dynamicDisplayList[e]][5])&&dynamicDisplay[dynamicDisplayList[e]][2]==false){dynamicDisplay[dynamicDisplayList[e]][1]=true;switch(dynamicDisplay[dynamicDisplayList[e]][6]){case"Bar":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).Bar(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"Pie":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).Pie(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"Doughnut":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).Doughnut(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"Radar":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).Radar(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"PolarArea":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).PolarArea(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"HorizontalBar":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).HorizontalBar(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"StackedBar":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).StackedBar(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"HorizontalStackedBar":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).HorizontalStackedBar(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break;case"Line":(new Chart(document.getElementById(dynamicDisplayList[e]).getContext("2d"))).Line(dynamicDisplay[dynamicDisplayList[e]][3],dynamicDisplay[dynamicDisplayList[e]][4]);break}}}}function getMousePos(e,t){var n=e.getBoundingClientRect();return{x:t.clientX-n.left,y:t.clientY-n.top}}function doMouseMove(ctx,config,event){var annotateDIV=document.getElementById("divCursor");show=false;annotateDIV.className=config.annotateClassName?config.annotateClassName:"";annotateDIV.style.border=config.annotateClassName?"":config.annotateBorder;annotateDIV.style.padding=config.annotateClassName?"":config.annotatePadding;annotateDIV.style.borderRadius=config.annotateClassName?"":config.annotateBorderRadius;annotateDIV.style.backgroundColor=config.annotateClassName?"":config.annotateBackgroundColor;annotateDIV.style.color=config.annotateClassName?"":config.annotateFontColor;annotateDIV.style.fontFamily=config.annotateClassName?"":config.annotateFontFamily;annotateDIV.style.fontSize=config.annotateClassName?"":config.annotateFontSize+"pt";annotateDIV.style.fontStyle=config.annotateClassName?"":config.annotateFontStyle;canvas_pos=getMousePos(ctx.canvas,event);for(i=0;i<jsGraphAnnotate[ctx.ChartNewId]["length"];i++){if(jsGraphAnnotate[ctx.ChartNewId][i][0]=="ARC"){distance=Math.sqrt((canvas_pos.x-jsGraphAnnotate[ctx.ChartNewId][i][1])*(canvas_pos.x-jsGraphAnnotate[ctx.ChartNewId][i][1])+(canvas_pos.y-jsGraphAnnotate[ctx.ChartNewId][i][2])*(canvas_pos.y-jsGraphAnnotate[ctx.ChartNewId][i][2]));if(distance>jsGraphAnnotate[ctx.ChartNewId][i][3]&&distance<jsGraphAnnotate[ctx.ChartNewId][i][4]){angle=Math.acos((canvas_pos.x-jsGraphAnnotate[ctx.ChartNewId][i][1])/distance);if(canvas_pos.y<jsGraphAnnotate[ctx.ChartNewId][i][2])angle=-angle;while(angle<0){angle+=2*Math.PI}while(angle>2*Math.PI){angle-=2*Math.PI}if(angle<config.startAngle*(Math.PI/360))angle+=2*Math.PI;if(angle>jsGraphAnnotate[ctx.ChartNewId][i][5]&&angle<jsGraphAnnotate[ctx.ChartNewId][i][6]||angle>jsGraphAnnotate[ctx.ChartNewId][i][5]-2*Math.PI&&angle<jsGraphAnnotate[ctx.ChartNewId][i][6]-2*Math.PI||angle>jsGraphAnnotate[ctx.ChartNewId][i][5]+2*Math.PI&&angle<jsGraphAnnotate[ctx.ChartNewId][i][6]+2*Math.PI){v1=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][7],config.fmtV1);v2=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][8],config.fmtV2);v3=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][9],config.fmtV3);v4=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][10],config.fmtV4);v5=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][11],config.fmtV5);v6=fmtChartJS(config,100*jsGraphAnnotate[ctx.ChartNewId][i][8]/jsGraphAnnotate[ctx.ChartNewId][i][10],config.fmtV6);v6=roundToWithThousands(config,v6,config.roundPct);v7=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][1],config.fmtV7);v8=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][2],config.fmtV8);v9=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][3],config.fmtV9);v10=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][4],config.fmtV10);v11=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][5],config.fmtV11);v12=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][6],config.fmtV12);v13=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][12],config.fmtV13);graphPosX=canvas_pos.x;graphPosY=canvas_pos.y;dispString=tmplbis(config.annotateLabel,{config:config,v1:v1,v2:v2,v3:v3,v4:v4,v5:v5,v6:v6,v7:v7,v8:v8,v9:v9,v10:v10,v11:v11,v12:v12,v13:v13,graphPosX:graphPosX,graphPosY:graphPosY});annotateDIV.innerHTML=dispString;show=true;x=bw.ns4||bw.ns5?event.pageX:event.x;y=bw.ns4||bw.ns5?event.pageY:event.y;if(bw.ie4||bw.ie5)y=y+eval(scrolled);oCursor.moveIt(x+fromLeft,y+fromTop)}}}else if(jsGraphAnnotate[ctx.ChartNewId][i][0]=="RECT"){if(canvas_pos.x>jsGraphAnnotate[ctx.ChartNewId][i][1]&&canvas_pos.x<jsGraphAnnotate[ctx.ChartNewId][i][3]&&canvas_pos.y<jsGraphAnnotate[ctx.ChartNewId][i][2]&&canvas_pos.y>jsGraphAnnotate[ctx.ChartNewId][i][4]){v1=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][5],config.fmtV1);v2=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][6],config.fmtV2);v3=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][7],config.fmtV3);v4=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][8],config.fmtV4);v5=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][9],config.fmtV5);v6=fmtChartJS(config,100*jsGraphAnnotate[ctx.ChartNewId][i][7]/jsGraphAnnotate[ctx.ChartNewId][i][9],config.fmtV6);v6=roundToWithThousands(config,v6,config.roundPct);v7=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][1],config.fmtV7);v8=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][2],config.fmtV8);v9=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][3],config.fmtV9);v10=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][4],config.fmtV10);v11=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][10],config.fmtV11);v12=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][11],config.fmtV12);graphPosX=canvas_pos.x;graphPosY=canvas_pos.y;dispString=tmplbis(config.annotateLabel,{config:config,v1:v1,v2:v2,v3:v3,v4:v4,v5:v5,v6:v6,v7:v7,v8:v8,v9:v9,v10:v10,v11:v11,v12:v12,graphPosX:graphPosX,graphPosY:graphPosY});annotateDIV.innerHTML=dispString;show=true;x=bw.ns4||bw.ns5?event.pageX:event.x;y=bw.ns4||bw.ns5?event.pageY:event.y;if(bw.ie4||bw.ie5)y=y+eval(scrolled);oCursor.moveIt(x+fromLeft,y+fromTop)}}else if(jsGraphAnnotate[ctx.ChartNewId][i][0]=="POINT"){distance=Math.sqrt((canvas_pos.x-jsGraphAnnotate[ctx.ChartNewId][i][1])*(canvas_pos.x-jsGraphAnnotate[ctx.ChartNewId][i][1])+(canvas_pos.y-jsGraphAnnotate[ctx.ChartNewId][i][2])*(canvas_pos.y-jsGraphAnnotate[ctx.ChartNewId][i][2]));if(distance<10){v1=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][3],config.fmtV1);v2=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][4],config.fmtV2);v3=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][5],config.fmtV3);v4=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][6],config.fmtV4);v5=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][7],config.fmtV5);v6=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][8],config.fmtV6);v7=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][9],config.fmtV7);v8=fmtChartJS(config,100*jsGraphAnnotate[ctx.ChartNewId][i][5]/jsGraphAnnotate[ctx.ChartNewId][i][9],config.fmtV8);v8=roundToWithThousands(config,v8,config.roundPct);v9=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][1],config.fmtV9);v10=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][2],config.fmtV10);v11=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][10],config.fmtV11);v12=fmtChartJS(config,jsGraphAnnotate[ctx.ChartNewId][i][11],config.fmtV12);graphPosX=canvas_pos.x;graphPosY=canvas_pos.y;dispString=tmplbis(config.annotateLabel,{config:config,v1:v1,v2:v2,v3:v3,v4:v4,v5:v5,v6:v6,v7:v7,v8:v8,v9:v9,v10:v10,v11:v11,v12:v12,graphPosX:graphPosX,graphPosY:graphPosY});annotateDIV.innerHTML=dispString;show=true;x=bw.ns4||bw.ns5?event.pageX:event.x;y=bw.ns4||bw.ns5?event.pageY:event.y;if(bw.ie4||bw.ie5)y=y+eval(scrolled);oCursor.moveIt(x+fromLeft,y+fromTop)}}annotateDIV.style.display=show?"":"none"}}var charJSPersonnalDefaultOptions={};var charJSPersonnalDefaultOptionsLine={};var charJSPersonnalDefaultOptionsRadar={};var charJSPersonnalDefaultOptionsPolarArea={};var charJSPersonnalDefaultOptionsPie={};var charJSPersonnalDefaultOptionsDoughnut={};var charJSPersonnalDefaultOptionsBar={};var charJSPersonnalDefaultOptionsStackedBar={};var charJSPersonnalDefaultOptionsHorizontalBar={};var charJSPersonnalDefaultOptionsHorizontalStackedBar={};var cachebis={};cursorDivCreated=false;bw=new checkBrowser;fromLeft=10;fromTop=10;if(typeof String.prototype.trim!=="function"){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}var dynamicDisplay=new Array;var dynamicDisplayList=new Array;var jsGraphAnnotate=new Array;window.Chart=function(e){function v(e,t,n,r){if(!e.logarithmic){var i=n.steps*n.stepValue;var s=t-n.graphMin;var o=N(s/i,1,0);return r*n.steps*o}else{return N(_(t)*r-b(n.graphMin)*r,undefined,0)}}function m(e,t,r,i,s,o,u,a,f,l,c,h,p){function x(){var n=e.animation?N(b(w),null,0):1;if(1*d>=1*N(e.animationSteps,Number.MAX_VALUE,1)||e.animation==false)n=1;else if(n>=1)n=.9999;if(!(isIE()<9&&isIE()!=false)&&e.clearRect)i.clearRect(s,o,u,a);O(i,e,f,l,c,h,false,p,n,d);if(e.scaleOverlay){r(n);t()}else{t();r(n)}O(i,e,f,l,c,h,true,p,n,d)}function T(){d+=m;w+=m*y;if(d==e.animationSteps||e.animation==false)w=1;else if(w>=1)w=.999;x();if(m==-1&&d<=E){if(typeof e.onAnimationComplete=="function")e.onAnimationComplete(i,e,p,0,v);m=1;g(T)}else if(w<e.animationStopValue){g(T)}else{if(typeof e.onAnimationComplete=="function")e.onAnimationComplete(i,e,p,1,v);if(v<e.animationCount||e.animationCount==0){if(e.animationCount!=0)v++;if(e.animationBackward&&m==1){w-=y;m=-1}else{m=1;d=E-1;w=S-y}window.setTimeout(T,2e3)}}}var d=0;var v=1;var m=1;if(e.animationStartValue<0||e.animationStartValue>1)e.animation.StartValue=0;if(e.animationStopValue<0||e.animationStopValue>1)e.animation.StopValue=1;if(e.animationStopValue<e.animationStartValue)e.animationStopValue=e.animationStartValue;if(isIE()<9&&isIE()!=false)e.animation=false;var y=e.animation?1/N(e.animationSteps,Number.MAX_VALUE,1):1,b=n[e.animationEasing],w=e.animation?0:1;if(e.animation&&e.animationStartValue>0&&e.animationStartValue<=1){while(w<e.animationStartValue){d++;w+=y}}var E=d;var S=w;if(typeof t!=="function")t=function(){};if(e.clearRect)g(T);else T();}function y(e,t,n,r,i,s){var o,u,a,f,l,c,h,p;if(!e.logarithmic){c=r-i;h=b(c);o=Math.floor(i/(1*Math.pow(10,h)))*Math.pow(10,h);u=Math.ceil(r/(1*Math.pow(10,h)))*Math.pow(10,h)}else{o=Math.pow(10,b(i));u=Math.pow(10,b(r)+1);h=b(u)-b(o)}a=u-o;f=Math.pow(10,h);l=Math.round(a/f);if(!e.logarithmic){while(l<n||l>t){if(l<n){f/=2;l=Math.round(a/f)}else{f*=2;l=Math.round(a/f)}}}else{l=h}var d=[];w(e,s,d,l,o,u,f);return{steps:l,stepValue:f,graphMin:o,labels:d,maxValue:r}}function b(e){return Math.floor(Math.log(e)/Math.LN10)}function w(e,t,n,r,i,s,o){if(t){if(!e.logarithmic){for(var u=0;u<r+1;u++){n.push(A(t,{value:fmtChartJS(e,1*(i+o*u).toFixed(C(o)),e.fmtYLabel)}))}}else{var a=i;while(a<s){n.push(A(t,{value:fmtChartJS(e,1*a.toFixed(C(o)),e.fmtYLabel)}));a*=10}}}}function E(e){return Math.max.apply(Math,e)}function S(e){return Math.min.apply(Math,e)}function x(e,t){if(!e){return t}else{return e}}function T(e){return!isNaN(parseFloat(e))&&isFinite(e)}function N(e,t,n){if(T(t)){if(e>t){return t}}if(T(n)){if(e<n){return n}}return e}function C(e){var t;if(e%1!=0){return e.toString().split(".")[1].length}else{return 0}}function k(e,t){var n={};for(var r in e){n[r]=e[r]}for(var r in t){n[r]=t[r]}return n}function A(e,t){var n=!/\W/.test(e)?L[e]=L[e]||A(document.getElementById(e).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};"+"with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return t?n(t):n}function O(t,n,r,i,s,o,u,a,f,l){var c,h,p,d,v,m;for(c=0;c<n.crossText.length;c++){if(n.crossText[c]!=""&&n.crossTextOverlay[S([c,n.crossTextOverlay.length-1])]==u&&(l==1&&n.crossTextIter[S([c,n.crossTextIter.length-1])]=="first"||n.crossTextIter[S([c,n.crossTextIter.length-1])]==l||n.crossTextIter[S([c,n.crossTextIter.length-1])]=="all"||f==1&&n.crossTextIter[S([c,n.crossTextIter.length-1])]=="last")){t.save();t.beginPath();t.font=n.crossTextFontStyle[S([c,n.crossTextFontStyle.length-1])]+" "+n.crossTextFontSize[S([c,n.crossTextFontSize.length-1])]+"px "+n.crossTextFontFamily[S([c,n.crossTextFontFamily.length-1])];t.fillStyle=n.crossTextFontColor[S([c,n.crossTextFontColor.length-1])];textAlign=n.crossTextAlign[S([c,n.crossTextAlign.length-1])];textBaseline=n.crossTextBaseline[S([c,n.crossTextBaseline.length-1])];p=1*n.crossTextPosX[S([c,n.crossTextPosX.length-1])];d=1*n.crossTextPosY[S([c,n.crossTextPosY.length-1])];switch(1*n.crossTextRelativePosX[S([c,n.crossTextRelativePosX.length-1])]){case 0:if(textAlign=="default")textAlign="left";break;case 1:p+=s;if(textAlign=="default")textAlign="right";break;case 2:p+=r;if(textAlign=="default")textAlign="center";break;case-2:p+=e.canvas.width/2;if(textAlign=="default")textAlign="center";break;case 3:p+=p+2*r-s;if(textAlign=="default")textAlign="left";break;case 4:p+=e.canvas.width;if(textAlign=="default")textAlign="right";break;default:p+=r;if(textAlign=="default")textAlign="center";break}switch(1*n.crossTextRelativePosY[S([c,n.crossTextRelativePosY.length-1])]){case 0:if(textBaseline=="default")textBaseline="top";break;case 3:d+=o;if(textBaseline=="default")textBaseline="top";break;case 2:d+=i;if(textBaseline=="default")textBaseline="middle";break;case-2:d+=e.canvas.height/2;if(textBaseline=="default")textBaseline="middle";break;case 1:d+=d+2*i-o;if(textBaseline=="default")textBaseline="bottom";break;case 4:d+=e.canvas.height;if(textBaseline=="default")textBaseline="bottom";break;default:d+=i;if(textBaseline=="default")textBaseline="middle";break}t.textAlign=textAlign;t.textBaseline=textBaseline;t.translate(1*p,1*d);t.rotate(n.crossTextAngle[S([c,n.crossTextAngle.length-1])]);if(n.crossText[c].substring(0,1)=="%"){if(typeof n.crossTextFunction=="function")h=n.crossTextFunction(c,n.crossText[c],t,n,r,i,s,o,u,a,f)}else h=n.crossText[c];t.fillText(h,0,0);t.stroke();t.restore()}}}function M(e,t,n,r,i,s,o,u,a,f,l){if(t.canvasBackgroundColor!="none")n.canvas.style.background=t.canvasBackgroundColor;var c=0;var h=0;var p=0;var d=0;var v=0;var m=0;var g=0;var y=0;var b=0;var w=0;var S=0;var x=0;var T=0;var N=0;var C=0;var k=0;var L=0;var A=0;var O=0;var M=0;var h=0;var p=0;var _=0;var D=0;var P=1;var H=0;var B=0;var j=0;var F=0;if(t.canvasBorders)c=t.canvasBordersWidth;if(a){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;for(var I=0;I<e.labels.length;I++){var q=n.measureText(fmtChartJS(t,e.labels[I],t.fmtXLabel)).width;P=q>P?q:P}}widestYLabel=1;if(a){if(s!=null){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;for(var I=s.length-1;I>=0;I--){if(typeof s[I]=="string"){if(s[I].trim()!=""){var q=n.measureText(fmtChartJS(t,s[I],t.fmtYLabel)).width;widestYLabel=q>widestYLabel?q:widestYLabel}}}}}H=c+t.spaceLeft;B=c+t.spaceRight;if(a){if(typeof t.yAxisLabel!="undefined"){if(t.yAxisLabel.trim()!=""){h=t.yAxisFontSize+t.yAxisLabelSpaceLeft+t.yAxisLabelSpaceRight;yAxisLabelPosLeft=c+t.spaceLeft+t.yAxisLabelSpaceLeft+t.yAxisFontSize;yAxisLabelPosRight=i-c-t.spaceRight-t.yAxisLabelSpaceLeft-t.yAxisFontSize}}if(t.yAxisLeft){if(u==false)H=c+t.spaceLeft+h+widestYLabel+t.yAxisSpaceLeft+t.yAxisSpaceRight;else H=c+t.spaceLeft+h+P+t.yAxisSpaceLeft+t.yAxisSpaceRight}if(t.yAxisRight){if(u==false)B=c+t.spaceRight+h+widestYLabel+t.yAxisSpaceLeft+t.yAxisSpaceRight;else B=c+t.spaceRight+h+P+t.yAxisSpaceLeft+t.yAxisSpaceRight}}availableWidth=i-H-B;if(t.graphTitle.trim()!=""){d=t.graphTitleFontSize+t.graphTitleSpaceBefore+t.graphTitleSpaceAfter;v=c+t.spaceTop+d-t.graphTitleSpaceAfter}if(t.graphSubTitle.trim()!=""){m=t.graphSubTitleFontSize+t.graphSubTitleSpaceBefore+t.graphSubTitleSpaceAfter;g=c+t.spaceTop+d+m-t.graphSubTitleSpaceAfter}if(a){if(typeof t.yAxisUnit!="undefined"){if(t.yAxisUnit.trim()!=""){w=t.yAxisUnitFontSize+t.yAxisUnitSpaceBefore+t.yAxisUnitSpaceAfter;S=c+t.spaceTop+d+m+w-t.yAxisUnitSpaceAfter}}}topNotUsableSize=c+t.spaceTop+d+m+w+t.graphSpaceBefore;if(typeof t.footNote!="undefined"){if(t.footNote.trim()!=""){y=t.footNoteFontSize+t.footNoteSpaceBefore+t.footNoteSpaceAfter;b=r-t.spaceBottom-c-t.footNoteSpaceAfter}}if(typeof t.legend!="undefined"){if(t.legend==true){n.font=t.legendFontStyle+" "+t.legendFontSize+"px "+t.legendFontFamily;if(f){for(var I=e.datasets.length-1;I>=0;I--){if(typeof e.datasets[I].title=="string"){if(e.datasets[I].title.trim()!=""){T++;var q=n.measureText(fmtChartJS(t,e.datasets[I].title,t.fmtLegend)).width;x=q>x?q:x}}}}else{for(var I=e.length-1;I>=0;I--){if(typeof e[I].title=="string"){if(e[I].title.trim()!=""){T++;var q=n.measureText(fmtChartJS(t,e[I].title,t.fmtLegend)).width;x=q>x?q:x}}}}if(T>1){x+=t.legendBlockSize+t.legendSpaceBetweenBoxAndText;availableLegendWidth=i-t.spaceLeft-t.spaceRight-2*c-t.legendSpaceLeftText-t.legendSpaceRightText;if(t.legendBorders==true)availableLegendWidth-=2*t.legendBordersWidth-t.legendBordersSpaceLeft-t.legendBordersSpaceRight;maxLegendOnLine=Math.floor((availableLegendWidth+t.legendSpaceBetweenTextHorizontal)/(x+t.legendSpaceBetweenTextHorizontal));N=Math.ceil(T/maxLegendOnLine);C=Math.ceil(T/N);k=N*(t.legendFontSize+t.legendSpaceBetweenTextVertical)-t.legendSpaceBetweenTextVertical+t.legendSpaceBeforeText+t.legendSpaceAfterText;A=r-c-t.spaceBottom-y-k+t.legendSpaceBeforeText+t.legendFontSize;L=t.spaceLeft+(i-t.spaceLeft-t.spaceRight-C*(x+t.legendSpaceBetweenTextHorizontal)+t.legendSpaceBetweenTextHorizontal)/2;if(t.legendBorders==true){k+=2*t.legendBordersWidth+t.legendBordersSpaceBefore+t.legendBordersSpaceAfter;A-=t.legendBordersWidth+t.legendBordersSpaceAfter;M=Math.floor(r-c-t.spaceBottom-y-k+t.legendBordersWidth/2+t.legendBordersSpaceBefore);O=Math.floor(L-t.legendSpaceLeftText-t.legendBordersWidth/2);legendBorderHeight=Math.ceil(k-t.legendBordersWidth)-t.legendBordersSpaceBefore-t.legendBordersSpaceAfter;legendBorderWidth=Math.ceil(C*(x+t.legendSpaceBetweenTextHorizontal))-t.legendSpaceBetweenTextHorizontal+t.legendBordersWidth+t.legendSpaceRightText+t.legendSpaceLeftText}}}}if(a){if(typeof t.xAxisLabel!="undefined"){if(t.xAxisLabel.trim()!=""){_=t.xAxisFontSize+t.xAxisLabelSpaceBefore+t.xAxisLabelSpaceAfter;xAxisLabelPos=r-c-t.spaceBottom-y-k-t.xAxisLabelSpaceAfter}}}xLabelWidth=0;if(a&&(t.xAxisBottom||t.xAxisTop)){if(u==false){widestLabel=P;nblab=e.labels.length}else{widestLabel=widestYLabel;nblab=s.length}if(t.rotateLabels=="smart"){j=0;if((availableWidth+t.xAxisSpaceBetweenLabels)/nblab<widestLabel+t.xAxisSpaceBetweenLabels){j=45;if(availableWidth/nblab<Math.abs(Math.cos(j*Math.PI/180)*widestLabel)){j=90}}}else{j=t.rotateLabels;if(j<0)j=0;if(j>180)j=180}if(j>90)j+=180;D=Math.abs(Math.sin(j*Math.PI/180)*widestLabel)+Math.abs(Math.sin((j+90)*Math.PI/180)*t.scaleFontSize)+t.xAxisSpaceBefore+t.xAxisSpaceAfter;F=r-c-t.spaceBottom-y-k-_-(D-t.xAxisSpaceBefore)-t.graphSpaceAfter;xLabelWidth=Math.abs(Math.cos(j*Math.PI/180)*widestLabel)+Math.abs(Math.cos((j+90)*Math.PI/180)*t.scaleFontSize);H=E([H,c+t.spaceLeft+xLabelWidth/2]);B=E([B,c+t.spaceRight+xLabelWidth/2]);availableWidth=i-H-B}if(t.xAxisBottom){bottomNotUsableHeightWithoutXLabels=c+t.spaceBottom+y+k+_;bottomNotUsableHeightWithXLabels=bottomNotUsableHeightWithoutXLabels+D+t.graphSpaceAfter;availableHeight=r-topNotUsableSize-bottomNotUsableHeightWithXLabels}else{bottomNotUsableHeightWithoutXLabels=c+t.spaceBottom+y+k+_;bottomNotUsableHeightWithXLabels=bottomNotUsableHeightWithoutXLabels+t.graphSpaceAfter;availableHeight=r-topNotUsableSize-bottomNotUsableHeightWithXLabels}if(c>0){n.save();n.beginPath();n.lineWidth=2*c;n.strokeStyle=t.canvasBordersColor;n.moveTo(0,0);n.lineTo(0,r);n.lineTo(i,r);n.lineTo(i,0);n.lineTo(0,0);n.stroke();n.restore()}if(d>0){n.save();n.beginPath();n.font=t.graphTitleFontStyle+" "+t.graphTitleFontSize+"px "+t.graphTitleFontFamily;n.fillStyle=t.graphTitleFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(t.spaceLeft+(i-t.spaceLeft-t.spaceRight)/2,v);n.fillText(t.graphTitle,0,0);n.stroke();n.restore()}if(m>0){n.save();n.beginPath();n.font=t.graphSubTitleFontStyle+" "+t.graphSubTitleFontSize+"px "+t.graphSubTitleFontFamily;n.fillStyle=t.graphSubTitleFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(t.spaceLeft+(i-t.spaceLeft-t.spaceRight)/2,g);n.fillText(t.graphSubTitle,0,0);n.stroke();n.restore()}if(w>0){if(t.yAxisLeft){n.save();n.beginPath();n.font=t.yAxisUnitFontStyle+" "+t.yAxisUnitFontSize+"px "+t.yAxisUnitFontFamily;n.fillStyle=t.yAxisUnitFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(H,S);n.fillText(t.yAxisUnit,0,0);n.stroke();n.restore()}if(t.yAxisRight){n.save();n.beginPath();n.font=t.yAxisUnitFontStyle+" "+t.yAxisUnitFontSize+"px "+t.yAxisUnitFontFamily;n.fillStyle=t.yAxisUnitFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(i-B,S);n.fillText(t.yAxisUnit,0,0);n.stroke();n.restore()}}if(h>0){if(t.yAxisLeft){n.save();n.beginPath();n.font=t.yAxisFontStyle+" "+t.yAxisFontSize+"px "+t.yAxisFontFamily;n.fillStyle=t.yAxisFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(yAxisLabelPosLeft,topNotUsableSize+availableHeight/2);n.rotate(-(90*(Math.PI/180)));n.fillText(t.yAxisLabel,0,0);n.stroke();n.restore()}if(t.yAxisRight){n.save();n.beginPath();n.font=t.yAxisFontStyle+" "+t.yAxisFontSize+"px "+t.yAxisFontFamily;n.fillStyle=t.yAxisFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(yAxisLabelPosRight,topNotUsableSize+availableHeight/2);n.rotate(+(90*(Math.PI/180)));n.fillText(t.yAxisLabel,0,0);n.stroke();n.restore()}}if(_>0){if(t.xAxisBottom){n.save();n.beginPath();n.font=t.xAxisFontStyle+" "+t.xAxisFontSize+"px "+t.xAxisFontFamily;n.fillStyle=t.xAxisFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(H+availableWidth/2,xAxisLabelPos);n.fillText(t.xAxisLabel,0,0);n.stroke();n.restore()}}if(T>1){if(t.legendBorders==true){n.save();n.beginPath();n.lineWidth=t.legendBordersWidth;n.strokeStyle=t.legendBordersColors;n.moveTo(O,M);n.lineTo(O,M+legendBorderHeight);n.lineTo(O+legendBorderWidth,M+legendBorderHeight);n.lineTo(O+legendBorderWidth,M);n.lineTo(O,M);n.lineTo(O+legendBorderWidth,M);n.lineTo(O,M);n.lineTo(O,M+legendBorderHeight);n.stroke();n.restore()}nbcols=C-1;ypos=A-(t.legendFontSize+t.legendSpaceBetweenTextVertical);xpos=0;if(f)fromi=e.datasets.length;else fromi=e.length;for(var I=fromi-1;I>=0;I--){orderi=I;if(o){if(f)orderi=e.datasets.length-I-1;else orderi=e.length-I-1}if(f)tpof=typeof e.datasets[orderi].title;else tpof=typeof e[orderi].title;if(tpof=="string"){if(f)lgtxt=fmtChartJS(t,e.datasets[orderi].title,t.fmtLegend).trim();else lgtxt=fmtChartJS(t,e[orderi].title,t.fmtLegend).trim();if(lgtxt!=""){nbcols++;if(nbcols==C){nbcols=0;xpos=L;ypos+=t.legendFontSize+t.legendSpaceBetweenTextVertical}else{xpos+=x+t.legendSpaceBetweenTextHorizontal}n.save();n.beginPath();if(f){if(typeof e.datasets[orderi].strokeColor=="string")n.strokeStyle=e.datasets[orderi].strokeColor;else n.strokeStyle=t.defaultStrokeColor}else{if(typeof e[orderi].color=="string")n.strokeStyle=e[orderi].color;else n.strokeStyle=t.defaultStrokeColor}if(l){n.lineWidth=1;n.moveTo(xpos,ypos);n.lineTo(xpos+t.legendBlockSize,ypos);n.lineTo(xpos+t.legendBlockSize,ypos-t.legendFontSize);n.lineTo(xpos,ypos-t.legendFontSize);n.lineTo(xpos,ypos);n.closePath();if(f){if(typeof e.datasets[orderi].fillColor=="string")n.fillStyle=e.datasets[orderi].fillColor;else n.fillStyle=t.defaultFillColor}else{if(typeof e[orderi].color=="string")n.fillStyle=e[orderi].color;else n.fillStyle=t.defaultFillColor}n.fill()}else{n.lineWidth=t.datasetStrokeWidth;n.moveTo(xpos+2,ypos-t.legendFontSize/2);n.lineTo(xpos+2+t.legendBlockSize,ypos-t.legendFontSize/2)}n.stroke();n.restore();n.save();n.beginPath();n.font=t.legendFontStyle+" "+t.legendFontSize+"px "+t.legendFontFamily;n.fillStyle=t.legendFontColor;n.textAlign="left";n.textBaseline="bottom";n.translate(xpos+t.legendBlockSize+t.legendSpaceBetweenBoxAndText,ypos);n.fillText(lgtxt,0,0);n.stroke();n.restore()}}}}if(t.footNote.trim()!=""){n.save();n.font=t.footNoteFontStyle+" "+t.footNoteFontSize+"px "+t.footNoteFontFamily;n.fillStyle=t.footNoteFontColor;n.textAlign="center";n.textBaseline="bottom";n.translate(H+availableWidth/2,b);n.fillText(t.footNote,0,0);n.stroke();n.restore()}clrx=H;clrwidth=availableWidth;clry=topNotUsableSize;clrheight=availableHeight;return{leftNotUsableSize:H,rightNotUsableSize:B,availableWidth:availableWidth,topNotUsableSize:topNotUsableSize,bottomNotUsableHeightWithoutXLabels:bottomNotUsableHeightWithoutXLabels,bottomNotUsableHeightWithXLabels:bottomNotUsableHeightWithXLabels,availableHeight:availableHeight,widestXLabel:P,rotateLabels:j,xLabelPos:F,clrx:clrx,clry:clry,clrwidth:clrwidth,clrheight:clrheight}}function _(e){return Math.log(e)/Math.LN10}function D(e,t){if(t.clearRect){s(e);e.clearRect(0,0,r,i)}else{s(e);e.clearRect(0,0,r,i);e.fillStyle=t.savePngBackgroundColor;e.strokeStyle=t.savePngBackgroundColor;e.beginPath();e.moveTo(0,0);e.lineTo(0,e.canvas.height);e.lineTo(e.canvas.width,e.canvas.height);e.lineTo(e.canvas.width,0);e.lineTo(0,0);e.stroke();e.fill()}}function P(e,t,n,r){if(n.annotateDisplay==true){if(cursorDivCreated==false)oCursor=new makeCursorObj("divCursor");if(isIE()<9&&isIE()!=false)e.canvas.attachEvent("on"+n.annotateFunction.split(" ")[0],function(t){if(n.annotateFunction.split(" ")[1]=="left"&&t.which==1||n.annotateFunction.split(" ")[1]=="middle"&&t.which==2||n.annotateFunction.split(" ")[1]=="right"&&t.which==3||typeof n.annotateFunction.split(" ")[1]!="string")doMouseMove(e,n,t)});else e.canvas.addEventListener(n.annotateFunction.split(" ")[0],function(t){if(n.annotateFunction.split(" ")[1]=="left"&&t.which==1||n.annotateFunction.split(" ")[1]=="middle"&&t.which==2||n.annotateFunction.split(" ")[1]=="right"&&t.which==3||typeof n.annotateFunction.split(" ")[1]!="string")doMouseMove(e,n,t)},false)}if(n.savePng){if(isIE()<9&&isIE()!=false)e.canvas.attachEvent("on"+n.savePngFunction.split(" ")[0],function(i){if(n.savePngFunction.split(" ")[1]=="left"&&i.which==1||n.savePngFunction.split(" ")[1]=="middle"&&i.which==2||n.savePngFunction.split(" ")[1]=="right"&&i.which==3||typeof n.savePngFunction.split(" ")[1]!="string")saveCanvas(e,t,n,r)});else e.canvas.addEventListener(n.savePngFunction.split(" ")[0],function(i){if(n.savePngFunction.split(" ")[1]=="left"&&i.which==1||n.savePngFunction.split(" ")[1]=="middle"&&i.which==2||n.savePngFunction.split(" ")[1]=="right"&&i.which==3||typeof n.savePngFunction.split(" ")[1]!="string")saveCanvas(e,t,n,r)},false)}}var t=this;var n={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-1*e*(e-2)},easeInOutQuad:function(e){if((e/=1/2)<1)return 1/2*e*e;return-1/2*(--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){if((e/=1/2)<1)return 1/2*e*e*e;return 1/2*((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){if((e/=1/2)<1)return 1/2*e*e*e*e;return-1/2*((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){if((e/=1/2)<1)return 1/2*e*e*e*e*e;return 1/2*((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-1/2*(Math.cos(Math.PI*e/1)-1)},easeInExpo:function(e){return e==0?1:1*Math.pow(2,10*(e/1-1))},easeOutExpo:function(e){return e==1?1:1*(-Math.pow(2,-10*e/1)+1)},easeInOutExpo:function(e){if(e==0)return 0;if(e==1)return 1;if((e/=1/2)<1)return 1/2*Math.pow(2,10*(e-1));return 1/2*(-Math.pow(2,-10*--e)+2)},easeInCirc:function(e){if(e>=1)return e;return-1*(Math.sqrt(1-(e/=1)*e)-1)},easeOutCirc:function(e){return 1*Math.sqrt(1-(e=e/1-1)*e)},easeInOutCirc:function(e){if((e/=1/2)<1)return-1/2*(Math.sqrt(1-e*e)-1);return 1/2*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158;var n=0;var r=1;if(e==0)return 0;if((e/=1)==1)return 1;if(!n)n=1*.3;if(r<Math.abs(1)){r=1;var t=n/4}else var t=n/(2*Math.PI)*Math.asin(1/r);return-(r*Math.pow(2,10*(e-=1))*Math.sin((e*1-t)*2*Math.PI/n))},easeOutElastic:function(e){var t=1.70158;var n=0;var r=1;if(e==0)return 0;if((e/=1)==1)return 1;if(!n)n=1*.3;if(r<Math.abs(1)){r=1;var t=n/4}else var t=n/(2*Math.PI)*Math.asin(1/r);return r*Math.pow(2,-10*e)*Math.sin((e*1-t)*2*Math.PI/n)+1},easeInOutElastic:function(e){var t=1.70158;var n=0;var r=1;if(e==0)return 0;if((e/=1/2)==2)return 1;if(!n)n=1*.3*1.5;if(r<Math.abs(1)){r=1;var t=n/4}else var t=n/(2*Math.PI)*Math.asin(1/r);if(e<1)return-.5*r*Math.pow(2,10*(e-=1))*Math.sin((e*1-t)*2*Math.PI/n);return r*Math.pow(2,-10*(e-=1))*Math.sin((e*1-t)*2*Math.PI/n)*.5+1},easeInBack:function(e){var t=1.70158;return 1*(e/=1)*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return 1*((e=e/1-1)*e*((t+1)*e+t)+1)},easeInOutBack:function(e){var t=1.70158;if((e/=1/2)<1)return 1/2*e*e*(((t*=1.525)+1)*e-t);return 1/2*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:function(e){return 1-n.easeOutBounce(1-e)},easeOutBounce:function(e){if((e/=1)<1/2.75){return 1*7.5625*e*e}else if(e<2/2.75){return 1*(7.5625*(e-=1.5/2.75)*e+.75)}else if(e<2.5/2.75){return 1*(7.5625*(e-=2.25/2.75)*e+.9375)}else{return 1*(7.5625*(e-=2.625/2.75)*e+.984375)}},easeInOutBounce:function(e){if(e<1/2)return n.easeInBounce(e*2)*.5;return n.easeOutBounce(e*2-1)*.5+1*.5}};var r=e.canvas.width;var i=e.canvas.height;if(window.devicePixelRatio){e.canvas.style.width=r+"px";e.canvas.style.height=i+"px";e.canvas.height=i*window.devicePixelRatio;e.canvas.width=r*window.devicePixelRatio;e.scale(window.devicePixelRatio,window.devicePixelRatio)}this.PolarArea=function(n,r){t.PolarArea.defaults={inGraphDataShow:false,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,scaleOverlay:true,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:true,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:true,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:true,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,segmentShowStroke:true,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:true,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:true,animateScale:false,onAnimationComplete:null,annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",startAngle:90};t.PolarArea.defaults=k(t.defaults.commonOptions,t.PolarArea.defaults);t.PolarArea.defaults=k(t.PolarArea.defaults,charJSPersonnalDefaultOptions);t.PolarArea.defaults=k(t.PolarArea.defaults,charJSPersonnalDefaultOptionsPolarArea);var i=r?k(t.PolarArea.defaults,r):t.PolarArea.defaults;return new o(n,i,e)};this.Radar=function(n,r){t.Radar.defaults={inGraphDataShow:false,inGraphDataPaddingRadius:5,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,scaleOverlay:false,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:true,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:false,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:true,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,angleShowLineOut:true,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:12,pointLabelFontColor:"#666",pointDot:true,pointDotRadius:3,pointDotStrokeWidth:1,datasetFill:true,datasetStrokeWidth:2,animation:true,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3%>",startAngle:90,graphMaximized:false};t.Radar.defaults=k(t.defaults.commonOptions,t.Radar.defaults);t.Radar.defaults=k(t.Radar.defaults,charJSPersonnalDefaultOptions);t.Radar.defaults=k(t.Radar.defaults,charJSPersonnalDefaultOptionsRadar);var i=r?k(t.Radar.defaults,r):t.Radar.defaults;return new u(n,i,e)};this.Pie=function(n,r){t.Pie.defaults={inGraphDataShow:false,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,segmentShowStroke:true,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animation:true,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:true,animateScale:false,onAnimationComplete:null,annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",startAngle:90,radiusScale:1};t.Pie.defaults=k(t.defaults.commonOptions,t.Pie.defaults);t.Pie.defaults=k(t.Pie.defaults,charJSPersonnalDefaultOptions);t.Pie.defaults=k(t.Pie.defaults,charJSPersonnalDefaultOptionsPie);var i=r?k(t.Pie.defaults,r):t.Pie.defaults;return new a(n,i,e)};this.Doughnut=function(n,r){t.Doughnut.defaults={inGraphDataShow:false,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,segmentShowStroke:true,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animation:true,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:true,animateScale:false,onAnimationComplete:null,annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",startAngle:90,radiusScale:1};t.Doughnut.defaults=k(t.defaults.commonOptions,t.Doughnut.defaults);t.Doughnut.defaults=k(t.Doughnut.defaults,charJSPersonnalDefaultOptions);t.Doughnut.defaults=k(t.Doughnut.defaults,charJSPersonnalDefaultOptionsDoughnut);var i=r?k(t.Doughnut.defaults,r):t.Doughnut.defaults;return new f(n,i,e)};this.Line=function(n,r){t.Line.defaults={inGraphDataShow:false,inGraphDataPaddingX:3,inGraphDataPaddingY:3,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"left",inGraphDataVAlign:"bottom",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",scaleOverlay:false,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:true,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:true,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,showYAxisMin:true,rotateLabels:"smart",logarithmic:false,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,bezierCurve:true,pointDot:true,pointDotRadius:4,pointDotStrokeWidth:2,datasetStrokeWidth:2,datasetFill:true,animation:true,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3%>"};t.Line.defaults=k(t.defaults.commonOptions,t.Line.defaults);t.Line.defaults=k(t.defaults.xyAxisCommonOptions,t.Line.defaults);t.Line.defaults=k(t.Line.defaults,charJSPersonnalDefaultOptions);t.Line.defaults=k(t.Line.defaults,charJSPersonnalDefaultOptionsLine);var i=r?k(t.Line.defaults,r):t.Line.defaults;return new l(n,i,e)};this.StackedBar=function(n,r){t.StackedBar.defaults={inGraphDataShow:false,inGraphDataPaddingX:0,inGraphDataPaddingY:-3,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"center",inGraphDataVAlign:"top",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataXPosition:2,inGraphDataYPosition:3,scaleOverlay:false,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:true,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:true,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,showYAxisMin:true,rotateLabels:"smart",scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,barShowStroke:true,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,animation:true,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>"};t.StackedBar.defaults=k(t.defaults.commonOptions,t.StackedBar.defaults);t.StackedBar.defaults=k(t.defaults.xyAxisCommonOptions,t.StackedBar.defaults);t.StackedBar.defaults=k(t.StackedBar.defaults,charJSPersonnalDefaultOptions);t.StackedBar.defaults=k(t.StackedBar.defaults,charJSPersonnalDefaultOptionsStackedBar);var i=r?k(t.StackedBar.defaults,r):t.StackedBar.defaults;return new c(n,i,e)};this.HorizontalStackedBar=function(n,r){t.HorizontalStackedBar.defaults={inGraphDataShow:false,inGraphDataPaddingX:-3,inGraphDataPaddingY:0,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"right",inGraphDataVAlign:"middle",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataXPosition:3,inGraphDataYPosition:2,scaleOverlay:false,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:true,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:true,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,showYAxisMin:true,rotateLabels:"smart",barShowStroke:true,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,animation:true,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>"};t.HorizontalStackedBar.defaults=k(t.defaults.commonOptions,t.HorizontalStackedBar.defaults);t.HorizontalStackedBar.defaults=k(t.defaults.xyAxisCommonOptions,t.HorizontalStackedBar.defaults);t.HorizontalStackedBar.defaults=k(t.HorizontalStackedBar.defaults,charJSPersonnalDefaultOptions);t.HorizontalStackedBar.defaults=k(t.HorizontalStackedBar.defaults,charJSPersonnalDefaultOptionsHorizontalStackedBar);var i=r?k(t.HorizontalStackedBar.defaults,r):t.HorizontalStackedBar.defaults;return new h(n,i,e)};this.Bar=function(n,r){t.Bar.defaults={inGraphDataShow:false,inGraphDataPaddingX:0,inGraphDataPaddingY:3,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"center",inGraphDataVAlign:"bottom",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataXPosition:2,inGraphDataYPosition:3,scaleOverlay:false,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:true,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:true,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,showYAxisMin:true,rotateLabels:"smart",logarithmic:false,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,barShowStroke:true,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,barBorderRadius:0,animation:true,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>"};t.Bar.defaults=k(t.defaults.commonOptions,t.Bar.defaults);t.Bar.defaults=k(t.defaults.xyAxisCommonOptions,t.Bar.defaults);t.Bar.defaults=k(t.Bar.defaults,charJSPersonnalDefaultOptions);t.Bar.defaults=k(t.Bar.defaults,charJSPersonnalDefaultOptionsBar);var i=r?k(t.Bar.defaults,r):t.Bar.defaults;return new p(n,i,e)};this.HorizontalBar=function(n,r){t.HorizontalBar.defaults={inGraphDataShow:false,inGraphDataPaddingX:3,inGraphDataPaddingY:0,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"left",inGraphDataVAlign:"middle",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataXPosition:3,inGraphDataYPosition:2,scaleOverlay:false,scaleOverride:false,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:true,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:true,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,showYAxisMin:true,rotateLabels:"smart",barShowStroke:true,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,barBorderRadius:0,animation:true,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>"};t.HorizontalBar.defaults=k(t.defaults.commonOptions,t.HorizontalBar.defaults);t.HorizontalBar.defaults=k(t.defaults.xyAxisCommonOptions,t.HorizontalBar.defaults);t.HorizontalBar.defaults=k(t.HorizontalBar.defaults,charJSPersonnalDefaultOptions);t.HorizontalBar.defaults=k(t.HorizontalBar.defaults,charJSPersonnalDefaultOptionsHorizontalBar);var i=r?k(t.HorizontalBar.defaults,r):t.HorizontalBar.defaults;return new d(n,i,e)};t.defaults={};t.defaults.commonOptions={clearRect:true,dynamicDisplay:false,graphSpaceBefore:5,graphSpaceAfter:5,canvasBorders:false,canvasBackgroundColor:"none",canvasBordersWidth:3,canvasBordersColor:"black",graphTitle:"",graphTitleFontFamily:"'Arial'",graphTitleFontSize:24,graphTitleFontStyle:"bold",graphTitleFontColor:"#666",graphTitleSpaceBefore:5,graphTitleSpaceAfter:5,graphSubTitle:"",graphSubTitleFontFamily:"'Arial'",graphSubTitleFontSize:18,graphSubTitleFontStyle:"normal",graphSubTitleFontColor:"#666",graphSubTitleSpaceBefore:5,graphSubTitleSpaceAfter:5,footNote:"",footNoteFontFamily:"'Arial'",footNoteFontSize:8,footNoteFontStyle:"bold",footNoteFontColor:"#666",footNoteSpaceBefore:5,footNoteSpaceAfter:5,legend:false,legendFontFamily:"'Arial'",legendFontSize:12,legendFontStyle:"normal",legendFontColor:"#666",legendBlockSize:15,legendBorders:true,legendBordersWidth:1,legendBordersColors:"#666",legendBordersSpaceBefore:5,legendBordersSpaceAfter:5,legendBordersSpaceLeft:5,legendBordersSpaceRight:5,legendSpaceBeforeText:5,legendSpaceAfterText:5,legendSpaceLeftText:5,legendSpaceRightText:5,legendSpaceBetweenTextVertical:5,legendSpaceBetweenTextHorizontal:5,legendSpaceBetweenBoxAndText:5,annotateDisplay:false,savePng:false,savePngOuput:"NewWindow",savePngFunction:"mousedown right",savePngBackgroundColor:"WHITE",annotateFunction:"mousemove",annotateFontFamily:"'Arial'",annotateBorder:"none",annotateBorderRadius:"2px",annotateBackgroundColor:"rgba(0,0,0,0.8)",annotateFontSize:12,annotateFontColor:"white",annotateFontStyle:"normal",annotatePadding:"3px",annotateClassName:"",crossText:[""],crossTextIter:["all"],crossTextOverlay:[true],crossTextFontFamily:["'Arial'"],crossTextFontSize:[12],crossTextFontStyle:["normal"],crossTextFontColor:["rgba(220,220,220,1)"],crossTextRelativePosX:[2],crossTextRelativePosY:[2],crossTextBaseline:["middle"],crossTextAlign:["center"],crossTextPosX:[0],crossTextPosY:[0],crossTextAngle:[0],crossTextFunction:null,spaceTop:0,spaceBottom:0,spaceRight:0,spaceLeft:0,decimalSeparator:".",thousandSeparator:"",roundNumber:"none",roundPct:-1,fmtV1:"none",fmtV2:"none",fmtV3:"none",fmtV4:"none",fmtV5:"none",fmtV6:"none",fmtV7:"none",fmtV8:"none",fmtV9:"none",fmtV10:"none",fmtV11:"none",fmtV12:"none",fmtV13:"none",fmtXLabel:"none",fmtYLabel:"none",fmtLegend:"none",animationStartValue:0,animationStopValue:1,animationCount:1,animationPauseTime:5,animationBackward:false,defaultStrokeColor:"rgba(220,220,220,1)",defaultFillColor:"rgba(220,220,220,0.5)"};t.defaults.xyAxisCommonOptions={yAxisLeft:true,yAxisRight:false,xAxisBottom:true,xAxisTop:false,xAxisSpaceBetweenLabels:5,yAxisLabel:"",yAxisFontFamily:"'Arial'",yAxisFontSize:16,yAxisFontStyle:"normal",yAxisFontColor:"#666",yAxisLabelSpaceRight:5,yAxisLabelSpaceLeft:5,yAxisSpaceRight:5,yAxisSpaceLeft:5,xAxisLabel:"",xAxisFontFamily:"'Arial'",xAxisFontSize:16,xAxisFontStyle:"normal",xAxisFontColor:"#666",xAxisLabelSpaceBefore:5,xAxisLabelSpaceAfter:5,xAxisSpaceBefore:5,xAxisSpaceAfter:5,yAxisUnit:"",yAxisUnitFontFamily:"'Arial'",yAxisUnitFontSize:8,yAxisUnitFontStyle:"normal",yAxisUnitFontColor:"#666",yAxisUnitSpaceBefore:5,yAxisUnitSpaceAfter:5};var s=function(e){e.clearRect(0,0,r,i)};var o=function(e,t,n){function N(r){var i=-t.startAngle*(Math.PI/180)+2*Math.PI,s=0,a=0,f=1,l=1;a=0;for(var c=0;c<e.length;c++)if(!(typeof e[c].value=="undefined"))a++;a=Math.PI*2/a;while(i<0){i+=2*Math.PI}while(i>2*Math.PI){i-=2*Math.PI}if(t.animation){if(t.animateScale){f=r}if(t.animateRotate){l=r}}if(r>=1){totvalue=0;for(var c=0;c<e.length;c++)if(!(typeof e[c].value=="undefined"))totvalue+=1*e[c].value}for(var c=0;c<e.length;c++){if(!(typeof e[c].value=="undefined")){n.beginPath();n.arc(p,d,f*v(t,1*e[c].value,u,o),i,i+l*a,false);n.lineTo(p,d);n.closePath();n.fillStyle=e[c].color;n.fill();i+=a;if(t.segmentShowStroke){n.strokeStyle=t.segmentStrokeColor;n.lineWidth=t.segmentStrokeWidth;n.stroke()}}}if(r>=1){i=-t.startAngle*(Math.PI/180)+2*Math.PI;for(var c=0;c<e.length;c++){if(!(typeof e[c].value=="undefined")){s+=1*e[c].value;i+=a;if(typeof e[c].title=="string")lgtxt=e[c].title.trim();else lgtxt="";jsGraphAnnotate[n.ChartNewId][T++]=["ARC",p,d,0,v(t,1*e[c].value,u,o),i-a,i,lgtxt,1*e[c].value,s,totvalue,a,c];if(t.inGraphDataShow){if(t.inGraphDataAnglePosition==1)posAngle=x+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==2)posAngle=x-a/2+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==3)posAngle=x-a+t.inGraphDataPaddingAngle*(Math.PI/180);if(t.inGraphDataRadiusPosition==1)labelRadius=0+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==2)labelRadius=v(t,1*e[c].value,u,o)/2+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==3)labelRadius=v(t,1*e[c].value,u,o)+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==4)labelRadius=o*u.steps+t.inGraphDataPaddingRadius;n.save();if(t.inGraphDataAlign=="off-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="left";else n.textAlign="right"}else if(t.inGraphDataAlign=="to-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="right";else n.textAlign="left"}else n.textAlign=t.inGraphDataAlign;if(t.inGraphDataVAlign=="off-center"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="top";else n.textBaseline="bottom"}else if(t.inGraphDataVAlign=="to-center"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="bottom";else n.textBaseline="top"}else n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var h=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,1*e[c].value,t.fmtV2),v3:fmtChartJS(t,s,t.fmtV3),v4:fmtChartJS(t,totvalue,t.fmtV4),v5:fmtChartJS(t,a,t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e[c].value/totvalue,t.fmtV6),t.roundPct),v7:fmtChartJS(t,p,t.fmtV7),v8:fmtChartJS(t,d,t.fmtV8),v9:fmtChartJS(t,0,t.fmtV9),v10:fmtChartJS(t,v(t,1*e[c].value,u,o),t.fmtV10),v11:fmtChartJS(t,i-a,t.fmtV11),v12:fmtChartJS(t,a,t.fmtV12),v13:fmtChartJS(t,c,t.fmtV13)});n.translate(p+labelRadius*Math.cos(posAngle),d-labelRadius*Math.sin(posAngle));if(t.inGraphDataRotate=="inRadiusAxis")n.rotate(2*Math.PI-posAngle);else if(t.inGraphDataRotate=="inRadiusAxisRotateLabels"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(posAngle+2*Math.PI)%(2*Math.PI)<3*Math.PI/2)n.rotate(3*Math.PI-posAngle);else n.rotate(2*Math.PI-posAngle)}else n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(h,0,0);n.restore();x-=a}}}}}function C(){for(var e=0;e<u.steps;e++){if(t.scaleShowLine){n.beginPath();n.arc(p,d,o*(e+1),0,Math.PI*2,true);n.strokeStyle=t.scaleLineColor;n.lineWidth=t.scaleLineWidth;n.stroke()}if(t.scaleShowLabels){n.textAlign="center";n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;var r=u.labels[e+1];if(t.scaleShowLabelBackdrop){var i=n.measureText(r).width;n.fillStyle=t.scaleBackdropColor;n.beginPath();n.rect(Math.round(p-i/2-t.scaleBackdropPaddingX),Math.round(d-o*(e+1)-t.scaleFontSize*.5-t.scaleBackdropPaddingY),Math.round(i+t.scaleBackdropPaddingX*2),Math.round(t.scaleFontSize+t.scaleBackdropPaddingY*2));n.fill()}n.textBaseline="middle";n.fillStyle=t.scaleFontColor;n.fillText(r,p,d-o*(e+1))}}}function k(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;for(var i=0;i<e.length;i++){if(1*e[i].value>n){n=1*e[i].value}if(1*e[i].value<r){r=1*e[i].value}}if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;var s=Math.floor(f/(a*.66));var o=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:s,minSteps:o}}var s,o,u,a,f,l,c,h,p,d;if(typeof n.ChartNewId==undefined){var g=new Date;var b=g.getTime();n.ChartNewId="PolarArea_"+b}if(!dynamicFunction(e,t,n,"PolarArea"))return;var x=t.startAngle*(Math.PI/180)+2*Math.PI;while(t.startAngle<0){t.startAngle+=360}while(t.startAngle>360){t.startAngle-=360}while(x<0){x+=2*Math.PI}while(x>2*Math.PI){x-=2*Math.PI}t.logarithmic=false;var T=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"PolarArea");D(n,t);l=k();c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);h=M(e,t,n,i,r,u.labels,true,false,false,false,true)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,graphMax:t.scaleStartValue+t.scaleSteps*t.scaleStepWidth,labels:[]};w(t,c,u.labels,u.steps,t.scaleStartValue,u.graphMax,t.scaleStepWidth);h=M(e,t,n,i,r,u.labels,true,false,false,false,true)}p=h.leftNotUsableSize+h.availableWidth/2;d=h.topNotUsableSize+h.availableHeight/2;o=Math.floor((S([h.availableHeight,h.availableWidth])/2-5)/u.steps);m(t,C,N,n,h.clrx,h.clry,h.clrwidth,h.clrheight,p,d,p-(S([h.availableHeight,h.availableWidth])/2-5),d+(S([h.availableHeight,h.availableWidth])/2-5),e);};var u=function(e,t,n){function T(r){var i=new Array;var s=new Array;for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++){i[f]=0;s[f]=-999999999}}for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++){if(!(typeof e.datasets[a].data[f]=="undefined")){i[f]+=1*e.datasets[a].data[f];s[f]=E([s[f],1*e.datasets[a].data[f]])}}}var l=2*Math.PI/e.datasets[0].data.length;n.save();for(var a=0;a<e.datasets.length;a++){if(r>=1){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt=""}var c=-1;for(var f=0;f<e.datasets[a].data.length;f++){if(!(typeof e.datasets[a].data[f]=="undefined")){if(c==-1){n.beginPath();n.moveTo(p+r*Math.cos(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o),d-r*Math.sin(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o));c=f}else{n.lineTo(p+r*Math.cos(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o),d-r*Math.sin(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o))}if(r>=1){if(a==0)divprev=0;else divprev=e.datasets[a].data[f]-e.datasets[a-1].data[f];if(a==e.datasets.length-1)divnext=0;else divnext=e.datasets[a+1].data[f]-e.datasets[a].data[f];if(typeof e.labels[f]=="string")lgtxt2=e.labels[f].trim();else lgtxt2="";jsGraphAnnotate[n.ChartNewId][S++]=["POINT",p+Math.cos(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o),d-Math.sin(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o),lgtxt,lgtxt2,1*e.datasets[a].data[f],divprev,divnext,s[f],i[f],a,f]}}}n.closePath();if(t.datasetFill){if(typeof e.datasets[a].fillColor=="string")n.fillStyle=e.datasets[a].fillColor;else n.fillStyle=t.defaultFillColor}else n.fillStyle="rgba(0,0,0,0)";if(typeof e.datasets[a].strokeColor=="string")n.strokeStyle=e.datasets[a].strokeColor;else n.strokeStyle=t.defaultStrokeColor;n.lineWidth=t.datasetStrokeWidth;n.fill();n.stroke();if(t.pointDot){n.beginPath();n.fillStyle=e.datasets[a].pointColor;n.strokeStyle=e.datasets[a].pointStrokeColor;n.lineWidth=t.pointDotStrokeWidth;for(var h=0;h<e.datasets[a].data.length;h++){if(!(typeof e.datasets[a].data[h]=="undefined")){n.beginPath();n.arc(p+r*Math.cos(t.startAngle*Math.PI/180-h*l)*v(t,e.datasets[a].data[h],u,o),d-r*Math.sin(t.startAngle*Math.PI/180-h*l)*v(t,e.datasets[a].data[h],u,o),t.pointDotRadius,2*Math.PI,false);n.fill();n.stroke()}}}}n.restore();if(r>=1&&t.inGraphDataShow){for(var a=0;a<e.datasets.length;a++){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt="";for(var f=0;f<e.datasets[a].data.length;f++){if(!(typeof e.datasets[a].data[f]=="undefined")){if(a==0)divprev=0;else divprev=e.datasets[a].data[f]-e.datasets[a-1].data[f];if(a==e.datasets.length-1)divnext=0;else divnext=e.datasets[a+1].data[f]-e.datasets[a].data[f];if(typeof e.labels[f]=="string")lgtxt2=e.labels[f].trim();else lgtxt2="";n.save();n.textAlign=t.inGraphDataAlign;n.textBaseline=t.inGraphDataVAlign;if(t.inGraphDataAlign=="off-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(f*l+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(f*l+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="left";else n.textAlign="right"}else if(t.inGraphDataAlign=="to-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(f*l+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(f*l+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="right";else n.textAlign="left"}else n.textAlign=t.inGraphDataAlign;if(t.inGraphDataVAlign=="off-center"){if((f*l+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="bottom";else n.textBaseline="top"}else if(t.inGraphDataVAlign=="to-center"){if((f*l+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="top";else n.textBaseline="bottom"}else n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var m;if(t.inGraphDataRadiusPosition==1)m=0+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==2)m=v(t,e.datasets[a].data[f],u,o)/2+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==3)m=v(t,e.datasets[a].data[f],u,o)+t.inGraphDataPaddingRadius;n.translate(p+Math.cos(t.startAngle*Math.PI/180-f*l)*m,d-Math.sin(t.startAngle*Math.PI/180-f*l)*m);if(t.inGraphDataRotate=="inRadiusAxis")n.rotate(f*l);else if(t.inGraphDataRotate=="inRadiusAxisRotateLabels"){if((f*l+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(f*l+2*Math.PI)%(2*Math.PI)<3*Math.PI/2)n.rotate(3*Math.PI+f*l);else n.rotate(2*Math.PI+f*l)}else n.rotate(t.inGraphDataRotate*(Math.PI/180));var g=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,lgtxt2,t.fmtV2),v3:fmtChartJS(t,1*e.datasets[a].data[f],t.fmtV3),v4:fmtChartJS(t,divprev,t.fmtV4),v5:fmtChartJS(t,divnext,t.fmtV5),v6:fmtChartJS(t,s[f],t.fmtV6),v7:fmtChartJS(t,i[f],t.fmtV7),v8:roundToWithThousands(t,fmtChartJS(t,100*e.datasets[a].data[f]/i[f],t.fmtV8),t.roundPct),v9:fmtChartJS(t,p+Math.cos(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o),t.fmtV9),v10:fmtChartJS(t,d-Math.sin(t.startAngle*Math.PI/180-f*l)*v(t,e.datasets[a].data[f],u,o),t.fmtV10),v11:fmtChartJS(t,a,t.fmtV11),v12:fmtChartJS(t,f,t.fmtV12)});n.fillText(g,0,0);n.restore()}}}}}function N(){var r=2*Math.PI/e.datasets[0].data.length;n.save();n.translate(p,d);n.rotate((90-t.startAngle)*Math.PI/180);if(t.angleShowLineOut){n.strokeStyle=t.angleLineColor;n.lineWidth=t.angleLineWidth;for(var i=0;i<e.datasets[0].data.length;i++){n.rotate(r);n.beginPath();n.moveTo(0,0);n.lineTo(0,-s);n.stroke()}}for(var a=0;a<u.steps;a++){n.beginPath();if(t.scaleShowLine){n.strokeStyle=t.scaleLineColor;n.lineWidth=t.scaleLineWidth;n.moveTo(0,-o*(a+1));for(var f=0;f<e.datasets[0].data.length;f++){n.rotate(r);n.lineTo(0,-o*(a+1))}n.closePath();n.stroke()}}n.rotate(-(90-t.startAngle)*Math.PI/180);if(t.scaleShowLabels){for(var a=0;a<u.steps;a++){n.textAlign="center";n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;n.textBaseline="middle";if(t.scaleShowLabelBackdrop){var l=n.measureText(u.labels[a+1]).width;n.fillStyle=t.scaleBackdropColor;n.beginPath();n.rect(Math.round(Math.cos(t.startAngle*Math.PI/180)*o*(a+1)-l/2-t.scaleBackdropPaddingX),Math.round(-Math.sin(t.startAngle*Math.PI/180)*o*(a+1)-t.scaleFontSize*.5-t.scaleBackdropPaddingY),Math.round(l+t.scaleBackdropPaddingX*2),Math.round(t.scaleFontSize+t.scaleBackdropPaddingY*2));n.fill()}n.fillStyle=t.scaleFontColor;n.fillText(u.labels[a+1],Math.cos(t.startAngle*Math.PI/180)*o*(a+1),-Math.sin(t.startAngle*Math.PI/180)*o*(a+1))}}for(var c=0;c<e.labels.length;c++){n.font=t.pointLabelFontStyle+" "+t.pointLabelFontSize+"px "+t.pointLabelFontFamily;n.fillStyle=t.pointLabelFontColor;var h=Math.sin((90-t.startAngle)*Math.PI/180+r*c)*(s+t.pointLabelFontSize);var v=Math.cos((90-t.startAngle)*Math.PI/180+r*c)*(s+t.pointLabelFontSize);var m=(90-t.startAngle)*Math.PI/180+r*c;while(m<0)m=m+2*Math.PI;while(m>2*Math.PI)m=m-2*Math.PI;if(m==Math.PI||m==0){n.textAlign="center"}else if(m>Math.PI){n.textAlign="right"}else{n.textAlign="left"}n.textBaseline="middle";n.fillText(e.labels[c],h,-v)}n.restore()}function C(){var r,i,o,u,f,l,c,d;var v=2*Math.PI/e.datasets[0].data.length;var m=t.startAngle*Math.PI/180;n.font=t.pointLabelFontStyle+" "+t.pointLabelFontSize+"px "+t.pointLabelFontFamily;if(!t.graphMaximized){u=h.availableWidth/2;o=h.availableWidth/2;l=1}else{u=h.availableWidth/2;o=h.availableWidth/2;l=40;for(var g=0;g<e.labels.length;g++){var y=n.measureText(e.labels[g]).width+t.scaleFontSize;i=(h.availableWidth-y)/(1+Math.abs(Math.cos(m)));if(m<Math.PI/2&&m>-Math.PI/2||m>3*Math.PI/2){if(i<u)u=i}else if(Math.cos(m)!=0){if(i<o)o=i}m-=v}}c=0;d=0;for(r=u,f=0;f<l;++f,r+=(h.availableWidth-o-u)/l){s=E([r,h.availableWidth-r]);var m=t.startAngle*Math.PI/180;i=h.available;for(var g=0;g<e.labels.length;g++){var y=n.measureText(e.labels[g]).width+t.scaleFontSize;if(m<Math.PI/2&&m>-Math.PI/2||m>3*Math.PI/2){i=(h.availableWidth-r-y)/Math.abs(Math.cos(m))}else if(Math.cos(m!=0)){i=(r-y)/Math.abs(Math.cos(m))}if(i<s)s=i;if(Math.sin(m)*h.availableHeight/2>h.availableHeight/2-t.scaleFontSize*2){i=Math.sin(m)*h.availableHeight/2-1.5*t.scaleFontSize;if(i<s)s=i}m-=v}if(s>c){c=s;p=r}}s=c-t.scaleFontSize/2;a=x(a,5)}function k(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;for(var i=0;i<e.datasets.length;i++){for(var s=0;s<e.datasets[i].data.length;s++){if(1*e.datasets[i].data[s]>n){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]<r){r=1*e.datasets[i].data[s]}}}if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;var o=Math.floor(f/(a*.66));var u=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:o,minSteps:u}}var s,o,u,a,f,l,c,h,p,d;if(typeof n.ChartNewId=="undefined"){var g=new Date;var b=g.getTime();n.ChartNewId="Radar_"+b}if(!dynamicFunction(e,t,n,"Radar"))return;while(t.startAngle<0){t.startAngle+=360}while(t.startAngle>360){t.startAngle-=360}t.logarithmic=false;var S=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"Radar");if(!e.labels)e.labels=[];D(n,t);l=k();c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);h=M(e,t,n,i,r,u.labels,true,false,false,true,t.datasetFill)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,graphMax:t.scaleStartValue+t.scaleSteps*t.scaleStepWidth,labels:[]};w(t,c,u.labels,u.steps,t.scaleStartValue,u.graphMax,t.scaleStepWidth);h=M(e,t,n,i,r,u.labels,true,false,false,true,t.datasetFill)}C();d=h.topNotUsableSize+h.availableHeight/2;o=s/u.steps;m(t,N,T,n,h.clrx,h.clry,h.clrwidth,h.clrheight,p,d,p-s,d+s,e);};var a=function(e,t,n){function d(r){var i=-t.startAngle*(Math.PI/180)+2*Math.PI,o=0,l=1,c=1;var p=t.startAngle*(Math.PI/180)+2*Math.PI;while(i<0){i+=2*Math.PI}while(i>2*Math.PI){i-=2*Math.PI}while(p<0){p+=2*Math.PI}while(p>2*Math.PI){p-=2*Math.PI}if(t.animation){if(t.animateScale){l=r}if(t.animateRotate){c=r}}if(r>=1){totvalue=0;for(var d=0;d<e.length;d++)if(!(typeof e[d].value=="undefined"))totvalue+=1*e[d].value}for(var d=0;d<e.length;d++){if(!(typeof e[d].value=="undefined")){var v=c*1*e[d].value/s*Math.PI*2;if(v>=Math.PI*2)v=Math.PI*2-.001;n.beginPath();n.arc(u,a,l*f,i,i+v);n.lineTo(u,a);n.closePath();n.fillStyle=e[d].color;n.fill();i+=v;o+=1*e[d].value;if(t.segmentShowStroke){n.lineWidth=t.segmentStrokeWidth;n.strokeStyle=t.segmentStrokeColor;n.stroke()}if(r>=1){if(typeof e[d].title=="string")lgtxt=e[d].title.trim();else lgtxt="";jsGraphAnnotate[n.ChartNewId][h++]=["ARC",u,a,0,f,i-v,i,lgtxt,1*e[d].value,o,totvalue,v,d];if(t.inGraphDataShow){if(t.inGraphDataAnglePosition==1)posAngle=p+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==2)posAngle=p-v/2+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==3)posAngle=p-v+t.inGraphDataPaddingAngle*(Math.PI/180);if(t.inGraphDataRadiusPosition==1)labelRadius=0+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==2)labelRadius=f/2+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==3)labelRadius=f+t.inGraphDataPaddingRadius;p-=v;n.save();if(t.inGraphDataAlign=="off-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="left";else n.textAlign="right"}else if(t.inGraphDataAlign=="to-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="right";else n.textAlign="left"}else n.textAlign=t.inGraphDataAlign;if(t.inGraphDataVAlign=="off-center"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="top";else n.textBaseline="bottom"}else if(t.inGraphDataVAlign=="to-center"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="bottom";else n.textBaseline="top"}else n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var m=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,1*e[d].value,t.fmtV2),v3:fmtChartJS(t,o,t.fmtV3),v4:fmtChartJS(t,totvalue,t.fmtV4),v5:fmtChartJS(t,v,t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e[d].value/totvalue,t.fmtV6),t.roundPct),v7:fmtChartJS(t,u,t.fmtV7),v8:fmtChartJS(t,a,t.fmtV8),v9:fmtChartJS(t,0,t.fmtV9),v10:fmtChartJS(t,f,t.fmtV10),v11:fmtChartJS(t,i-v,t.fmtV11),v12:fmtChartJS(t,i,t.fmtV12),v13:fmtChartJS(t,d,t.fmtV13)});n.translate(u+labelRadius*Math.cos(posAngle),a-labelRadius*Math.sin(posAngle));if(t.inGraphDataRotate=="inRadiusAxis")n.rotate(2*Math.PI-posAngle);else if(t.inGraphDataRotate=="inRadiusAxisRotateLabels"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(posAngle+2*Math.PI)%(2*Math.PI)<3*Math.PI/2)n.rotate(3*Math.PI-posAngle);else n.rotate(2*Math.PI-posAngle)}else n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(m,0,0);n.restore()}}}}}function v(){var r;var i=-t.startAngle*(Math.PI/180)+2*Math.PI,l=0;while(i<0){i+=2*Math.PI}while(i>2*Math.PI){i-=2*Math.PI}u=o.leftNotUsableSize+o.availableWidth/2;a=o.topNotUsableSize+o.availableHeight/2;f=S([o.availableHeight/2,o.availableWidth/2])-5;if(t.inGraphDataShow&&t.inGraphDataRadiusPosition==3&&t.inGraphDataAlign=="off-center"&&t.inGraphDataRotate==0){f=S([o.availableHeight/2,o.availableWidth/2])-t.inGraphDataFontSize-t.inGraphDataPaddingRadius-5;var c=t.startAngle*(Math.PI/180)+2*Math.PI;while(c<0){c+=2*Math.PI}while(c>2*Math.PI){c-=2*Math.PI}var h=0;for(var p=0;p<e.length;p++)if(!(typeof e[p].value=="undefined"))h+=1*e[p].value;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;var l=0;var d;for(var p=0;p<e.length;p++){if(!(typeof e[p].value=="undefined")){l+=1*e[p].value;var v=1*e[p].value/s*Math.PI*2;i+=v;if(t.inGraphDataAnglePosition==1)d=c+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==2)d=c-v/2+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==3)d=c-v+t.inGraphDataPaddingAngle*(Math.PI/180);c-=v;if(typeof e[p].title=="string")r=e[p].title.trim();else r="";var m=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,r,t.fmtV1),v2:fmtChartJS(t,1*e[p].value,t.fmtV2),v3:fmtChartJS(t,l,t.fmtV3),v4:fmtChartJS(t,h,t.fmtV4),v5:fmtChartJS(t,v,t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e[p].value/h,t.fmtV6),t.roundPct),v7:fmtChartJS(t,u,t.fmtV7),v8:fmtChartJS(t,a,t.fmtV8),v9:fmtChartJS(t,0,t.fmtV9),v10:fmtChartJS(t,f,t.fmtV10),v11:fmtChartJS(t,i-v,t.fmtV11),v12:fmtChartJS(t,i,t.fmtV12),v13:fmtChartJS(t,p,t.fmtV13)});var g=n.measureText(m).width;var y=Math.abs((o.availableWidth/2-g)/Math.cos(d))-t.inGraphDataPaddingRadius-5;if(y<f)f=y}}}f=f*t.radiusScale}var s=0;var o,u,a,f;if(typeof n.ChartNewId=="undefined"){var l=new Date;var c=l.getTime();n.ChartNewId="Pie_"+c}if(!dynamicFunction(e,t,n,"Pie"))return;while(t.startAngle<0){t.startAngle+=360}while(t.startAngle>360){t.startAngle-=360}t.logarithmic=false;var h=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"Pie");D(n,t);o=M(e,t,n,i,r,null,true,false,false,false,true);for(var p=0;p<e.length;p++){if(!(typeof e[p].value=="undefined"))s+=1*e[p].value}v();m(t,null,d,n,o.clrx,o.clry,o.clrwidth,o.clrheight,u,a,u-f,a+f,e);};var f=function(e,t,n){function g(r){var i=-t.startAngle*(Math.PI/180)+2*Math.PI,o=0,l=1,c=1;while(i<0){i+=2*Math.PI}while(i>2*Math.PI){i-=2*Math.PI}if(t.animation){if(t.animateScale){l=r}if(t.animateRotate){c=r}}if(r>=1){totvalue=0;for(var v=0;v<e.length;v++)if(!(typeof e[v].value=="undefined"))totvalue+=1*e[v].value}for(var v=0;v<e.length;v++){if(!(typeof e[v].value=="undefined")){var m=c*1*e[v].value/s*Math.PI*2;if(m>=Math.PI*2)m=Math.PI*2-.001;n.beginPath();n.arc(u,a,l*f,i,i+m,false);n.arc(u,a,l*d,i+m,i,true);n.closePath();n.fillStyle=e[v].color;n.fill();i+=m;o+=1*e[v].value;if(t.segmentShowStroke){n.lineWidth=t.segmentStrokeWidth;n.strokeStyle=t.segmentStrokeColor;n.stroke()}if(r>=1){if(typeof e[v].title=="string")lgtxt=e[v].title.trim();else lgtxt="";jsGraphAnnotate[n.ChartNewId][p++]=["ARC",u,a,d,f,i-m,i,lgtxt,1*e[v].value,o,totvalue,m,v];if(t.inGraphDataShow){if(t.inGraphDataAnglePosition==1)posAngle=h+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==2)posAngle=h-m/2+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==3)posAngle=h-m+t.inGraphDataPaddingAngle*(Math.PI/180);if(t.inGraphDataRadiusPosition==1)labelRadius=d+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==2)labelRadius=d+(f-d)/2+t.inGraphDataPaddingRadius;else if(t.inGraphDataRadiusPosition==3)labelRadius=f+t.inGraphDataPaddingRadius;h-=m;n.save();if(t.inGraphDataAlign=="off-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="left";else n.textAlign="right"}else if(t.inGraphDataAlign=="to-center"){if(t.inGraphDataRotate=="inRadiusAxis"||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<Math.PI/2)n.textAlign="right";else n.textAlign="left"}else n.textAlign=t.inGraphDataAlign;if(t.inGraphDataVAlign=="off-center"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="top";else n.textBaseline="bottom"}else if(t.inGraphDataVAlign=="to-center"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI)n.textBaseline="bottom";else n.textBaseline="top"}else n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var g=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,1*e[v].value,t.fmtV2),v3:fmtChartJS(t,o,t.fmtV3),v4:fmtChartJS(t,totvalue,t.fmtV4),v5:fmtChartJS(t,m,t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e[v].value/totvalue,t.fmtV6),t.roundPct),v7:fmtChartJS(t,u,t.fmtV7),v8:fmtChartJS(t,a,t.fmtV8),v9:fmtChartJS(t,d,t.fmtV9),v10:fmtChartJS(t,f,t.fmtV10),v11:fmtChartJS(t,i-m,t.fmtV11),v12:fmtChartJS(t,i,t.fmtV12),v13:fmtChartJS(t,v,t.fmtV13)});n.translate(u+labelRadius*Math.cos(posAngle),a-labelRadius*Math.sin(posAngle));if(t.inGraphDataRotate=="inRadiusAxis")n.rotate(2*Math.PI-posAngle);else if(t.inGraphDataRotate=="inRadiusAxisRotateLabels"){if((posAngle+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(posAngle+2*Math.PI)%(2*Math.PI)<3*Math.PI/2)n.rotate(3*Math.PI-posAngle);else n.rotate(2*Math.PI-posAngle)}else n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(g,0,0);n.restore()}}}}}function y(){var r;var i=-t.startAngle*(Math.PI/180)+2*Math.PI,l=0;while(i<0){i+=2*Math.PI}while(i>2*Math.PI){i-=2*Math.PI}u=o.leftNotUsableSize+o.availableWidth/2;a=o.topNotUsableSize+o.availableHeight/2;f=S([o.availableHeight/2,o.availableWidth/2])-5;if(t.inGraphDataShow&&t.inGraphDataRadiusPosition==3&&t.inGraphDataAlign=="off-center"&&t.inGraphDataRotate==0){f=S([o.availableHeight/2,o.availableWidth/2])-t.inGraphDataFontSize-t.inGraphDataPaddingRadius-5;var c=t.startAngle*(Math.PI/180)+2*Math.PI;while(c<0){c+=2*Math.PI}while(c>2*Math.PI){c-=2*Math.PI}var h=0;for(var p=0;p<e.length;p++)if(!(typeof e[p].value=="undefined"))h+=1*e[p].value;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;var v;var i=0;for(var p=0;p<e.length;p++){if(!(typeof e[p].value=="undefined")){l+=1*e[p].value;var m=1*e[p].value/s*Math.PI*2;i+=m;if(t.inGraphDataAnglePosition==1)v=c+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==2)v=c-m/2+t.inGraphDataPaddingAngle*(Math.PI/180);else if(t.inGraphDataAnglePosition==3)v=c-m+t.inGraphDataPaddingAngle*(Math.PI/180);c-=m;if(typeof e[p].title=="string")r=e[p].title.trim();else r="";var g=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,r,t.fmtV1),v2:fmtChartJS(t,1*e[p].value,t.fmtV2),v3:fmtChartJS(t,l,t.fmtV3),v4:fmtChartJS(t,h,t.fmtV4),v5:fmtChartJS(t,m,t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e[p].value/h,t.fmtV6),t.roundPct),v7:fmtChartJS(t,u,t.fmtV7),v8:fmtChartJS(t,a,t.fmtV8),v9:fmtChartJS(t,d,t.fmtV9),v10:fmtChartJS(t,f,t.fmtV10),v11:fmtChartJS(t,i-m,t.fmtV11),v12:fmtChartJS(t,i,t.fmtV12),v13:fmtChartJS(t,p,t.fmtV13)});var y=n.measureText(g).width;var b=Math.abs((o.availableWidth/2-y)/Math.cos(v))-t.inGraphDataPaddingRadius-5;if(b<f)f=b}}}f=f*t.radiusScale}var s=0;var o,u,a,f;if(typeof n.ChartNewId=="undefined"){var l=new Date;var c=l.getTime();n.ChartNewId="Doughnut_"+c}if(!dynamicFunction(e,t,n,"Doughnut"))return;var h=t.startAngle*(Math.PI/180)+2*Math.PI;while(t.startAngle<0){t.startAngle+=360}while(t.startAngle>360){t.startAngle-=360}while(h<0){h+=2*Math.PI}while(h>2*Math.PI){h-=2*Math.PI}t.logarithmic=false;var p=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"Doughnut");D(n,t);o=M(e,t,n,i,r,null,true,false,false,false,true);y();var d=f*(t.percentageInnerCutout/100);for(var v=0;v<e.length;v++){if(!(typeof e[v].value=="undefined"))s+=1*e[v].value}m(t,null,g,n,o.clrx,o.clry,o.clrwidth,o.clrheight,u,a,u-f,a+f,e);};var l=function(e,t,n){function H(r){function x(n,i){return S-r*v(t,e.datasets[n].data[i],u,o)}function T(e){return g+h*e}var i=new Array;var s=new Array;for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++){i[f]=0;s[f]=-999999999}}for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++){i[f]+=e.datasets[a].data[f];s[f]=E([s[f],e.datasets[a].data[f]])}}for(var a=0;a<e.datasets.length;a++){var l=-1;var c=-1;if(r>=1){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt=""}if(typeof e.datasets[a].strokeColor=="string")n.strokeStyle=e.datasets[a].strokeColor;else n.strokeStyle=t.defaultStrokeColor;n.lineWidth=t.datasetStrokeWidth;n.beginPath();for(var f=0;f<e.datasets[a].data.length;f++){if(!(typeof e.datasets[a].data[f]=="undefined")){if(l==-1){n.moveTo(T(f),x(a,f));c=f}else{if(t.bezierCurve){n.bezierCurveTo(T(f-(f-l)/2),x(a,l),T(f-(f-l)/2),x(a,f),T(f),x(a,f))}else{n.lineTo(T(f),x(a,f))}}l=f;if(r>=1){if(a==0)divprev=e.datasets[a].data[f];else divprev=e.datasets[a].data[f]-e.datasets[a-1].data[f];if(a==e.datasets.length-1)divnext=e.datasets[a].data[f];else divnext=e.datasets[a].data[f]-e.datasets[a+1].data[f];if(typeof e.labels[f]=="string")lgtxt2=e.labels[f].trim();else lgtxt2="";jsGraphAnnotate[n.ChartNewId][N++]=["POINT",T(f),x(a,f),lgtxt,lgtxt2,1*e.datasets[a].data[f],divprev,divnext,s[f],i[f],a,f];if(t.inGraphDataShow){n.save();n.textAlign=t.inGraphDataAlign;n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var p=g+h*w,d=S-r*v(t,e.datasets[a].data[f],u,o),m=t.inGraphDataPaddingX,y=t.inGraphDataPaddingY;var b=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,lgtxt2,t.fmtV2),v3:fmtChartJS(t,1*e.datasets[a].data[f],t.fmtV3),v4:fmtChartJS(t,divprev,t.fmtV4),v5:fmtChartJS(t,divnext,t.fmtV5),v6:fmtChartJS(t,s[f],t.fmtV6),v7:fmtChartJS(t,i[f],t.fmtV7),v8:roundToWithThousands(t,fmtChartJS(t,100*e.datasets[a].data[f]/i[f],t.fmtV8),t.roundPct),v9:fmtChartJS(t,g,t.fmtV9),v10:fmtChartJS(t,S-v(t,e.datasets[a].data[f],u,o),t.fmtV10),v11:fmtChartJS(t,a,t.fmtV11),v12:fmtChartJS(t,f,t.fmtV12)});n.translate(T(f)+m,x(a,f)-y);n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(b,0,0);n.restore()}}}}n.stroke();if(t.datasetFill){n.lineTo(g+h*(e.datasets[a].data.length-1),S-_);n.lineTo(T(c),S-_);n.lineTo(T(c),x(a,c));n.closePath();if(typeof e.datasets[a].fillColor=="string")n.fillStyle=e.datasets[a].fillColor;else n.fillStyle=t.defaultFillColor;n.fill()}else{n.closePath()}if(t.pointDot){n.fillStyle=e.datasets[a].pointColor;n.strokeStyle=e.datasets[a].pointStrokeColor;n.lineWidth=t.pointDotStrokeWidth;for(var w=0;w<e.datasets[a].data.length;w++){if(!(typeof e.datasets[a].data[w]=="undefined")){n.beginPath();n.arc(g+h*w,S-r*v(t,e.datasets[a].data[w],u,o),t.pointDotRadius,0,Math.PI*2,true);n.fill();n.stroke()}}}}}function B(){n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,S);n.lineTo(g+T.availableWidth+t.scaleTickSizeRight,S);n.stroke();for(var r=0;r<e.labels.length;r++){n.beginPath();n.moveTo(g+r*h,S+t.scaleTickSizeBottom);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&r>0&&r%t.scaleXGridLinesStep==0){n.lineTo(g+r*h,S-T.availableHeight-t.scaleTickSizeTop)}else{n.lineTo(g+r*h,S)}n.stroke()}n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g,S+t.scaleTickSizeBottom);n.lineTo(g,S-T.availableHeight-t.scaleTickSizeTop);n.stroke();for(var i=0;i<u.steps;i++){n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,S-(i+1)*o);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&i%t.scaleYGridLinesStep==0){n.lineTo(g+T.availableWidth+t.scaleTickSizeRight,S-(i+1)*o)}else{n.lineTo(g,S-(i+1)*o)}n.stroke()}}function j(){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;if(t.xAxisTop||t.xAxisBottom){n.textBaseline="top";if(T.rotateLabels>90){n.save();n.textAlign="left"}else if(T.rotateLabels>0){n.save();n.textAlign="right"}else{n.textAlign="center"}n.fillStyle=t.scaleFontColor;if(t.xAxisBottom){for(var r=0;r<e.labels.length;r++){n.save();if(T.rotateLabels>0){n.translate(g+r*h-t.scaleFontSize/2,T.xLabelPos);n.rotate(-(T.rotateLabels*(Math.PI/180)));n.fillText(fmtChartJS(t,e.labels[r],t.fmtXLabel),0,0)}else{n.fillText(fmtChartJS(t,e.labels[r],t.fmtXLabel),g+r*h,T.xLabelPos)}n.restore()}}}n.textAlign="right";n.textBaseline="middle";for(var i=t.showYAxisMin?-1:0;i<u.steps;i++){if(t.scaleShowLabels){if(t.yAxisLeft){n.textAlign="right";n.fillText(u.labels[i+1],g-(t.scaleTickSizeLeft+t.yAxisSpaceRight),S-(i+1)*o)}if(t.yAxisRight){n.textAlign="left";n.fillText(u.labels[i+1],g+T.availableWidth+(t.scaleTickSizeRight+t.yAxisSpaceRight),S-(i+1)*o)}}}}function F(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;for(var i=0;i<e.datasets.length;i++){for(var s=0;s<e.datasets[i].data.length;s++){if(1*e.datasets[i].data[s]>n){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]<r){r=1*e.datasets[i].data[s]}}}if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;a=t.scaleFontSize;f=T.availableHeight;var o=Math.floor(f/(a*.66));var u=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:o,minSteps:u}}var s,o,u,a,f,l,c,h,p,d,g,S,x=0,T;var N=0;if(typeof n.ChartNewId=="undefined"){var C=new Date;var k=C.getTime();n.ChartNewId="Line_"+k}var L=0;for(var A=0;A<e.datasets.length;A++)L=E([L,e.datasets[A].data.length]);if(L==1){if(typeof e.labels[0]=="string")e.labels=["",e.labels[0],""];for(var A=0;A<e.datasets.length;A++){if(typeof (e.datasets[A].data[0]!="undefined"))e.datasets[A].data=[undefined,e.datasets[A].data[0],undefined]}}if(!dynamicFunction(e,t,n,"Line"))return;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"Line");D(n,t);T=M(e,t,n,i,r,[""],false,false,true,true,t.datasetFill);l=F();if(t.logarithmic!==false){if(l.minValue<=0){t.logarithmic=false}}var O=b(Math.pow(10,b(l.maxValue)+1))-b(Math.pow(10,b(l.minValue)));if(t.logarithmic=="fuzzy"&&O<4||t.scaleOverride){t.logarithmic=false}c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);T=M(e,t,n,i,r,u.labels,false,false,true,true,t.datasetFill)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,graphMax:t.scaleStartValue+t.scaleSteps*t.scaleStepWidth,labels:[]};w(t,c,u.labels,u.steps,t.scaleStartValue,u.graphMax,t.scaleStepWidth);T=M(e,t,n,i,r,u.labels,false,false,true,true,t.datasetFill)}T.availableHeight=T.availableHeight-t.scaleTickSizeBottom-t.scaleTickSizeTop;T.availableWidth=T.availableWidth-t.scaleTickSizeLeft-t.scaleTickSizeRight;o=Math.floor(T.availableHeight/u.steps);h=Math.floor(T.availableWidth/(e.labels.length-1));if(h==0)h=T.availableWidth/(e.labels.length-1);T.clrwidth=T.clrwidth-(T.availableWidth-(e.labels.length-1)*h);T.availableWidth=(e.labels.length-1)*h;T.availableHeight=u.steps*o;g=T.leftNotUsableSize+t.scaleTickSizeLeft;S=T.topNotUsableSize+T.availableHeight+t.scaleTickSizeTop;j();var _=0;if(l.minValue<0){var _=v(t,0,u,o)}m(t,B,H,n,T.clrx,T.clry,T.clrwidth,T.clrheight,g+T.availableWidth/2,S-T.availableHeight/2,g,S,e);};var c=function(e,t,n){function _(r){n.lineWidth=t.barStrokeWidth;var i=new Array(e.datasets.length);var s=new Array(e.datasets.length);var a=new Array;var f=new Array;for(var l=0;l<e.datasets.length;l++){for(var c=0;c<e.datasets[l].data.length;c++){a[c]=0;f[c]=0}}for(var l=0;l<e.datasets.length;l++){for(var c=0;c<e.datasets[l].data.length;c++)if(!(typeof e.datasets[l].data[c]=="undefined")){f[c]+=1*e.datasets[l].data[c]}}for(var l=0;l<e.datasets.length;l++){if(r>=1){if(typeof e.datasets[l].title=="string")lgtxt=e.datasets[l].title.trim();else lgtxt=""}for(var c=0;c<e.datasets[l].data.length;c++){n.fillStyle=t.defaultFillColor;if(typeof e.datasets[l].fillColor=="string"){n.fillStyle=e.datasets[l].fillColor}else if(typeof e.datasets[l].fillColor=="object"){if(typeof e.datasets[l].fillColor[0]=="string"){n.fillStyle=e.datasets[l].fillColor[S([e.datasets[l].fillColor.length-1,c])]}}n.strokeStyle=t.defaultStrokeColor;if(typeof e.datasets[l].strokeColor=="string"){n.strokeStyle=e.datasets[l].strokeColor}else if(typeof e.datasets[l].strokeColor=="object"){if(typeof e.datasets[l].strokeColor[0]=="string"){n.strokeStyle=e.datasets[l].strokeColor[S([e.datasets[l].strokeColor.length-1,c])]}}if(l==0){i[c]=0;s[c]=-1}if(!(typeof e.datasets[l].data[c]=="undefined")){var p=g+t.barValueSpacing+h*c;n.beginPath();n.moveTo(p,b-i[c]+1);n.lineTo(p,b-r*v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)+t.barStrokeWidth/2-i[c]);n.lineTo(p+w,b-r*v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)+t.barStrokeWidth/2-i[c]);n.lineTo(p+w,b-i[c]+1);if(t.barShowStroke)n.stroke();n.closePath();n.fill();a[c]+=1*e.datasets[l].data[c];if(r>=1){if(typeof e.labels[c]=="string")lgtxt2=e.labels[c].trim();else lgtxt2="";jsGraphAnnotate[n.ChartNewId][L++]=["RECT",p,b-i[c]+1,p+w,b-v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)+t.barStrokeWidth/2-i[c],lgtxt,lgtxt2,1*e.datasets[l].data[c],a[c],f[c],l,c]}i[c]+=r*v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)-t.barStrokeWidth/2;if(s[c]==-1)s[c]=l}}}if(r>=1&&t.inGraphDataShow){var d=0,m=0;for(var l=0;l<e.datasets.length;l++){for(var c=0;c<e.datasets[l].data.length;c++){a[c]=0}}for(var l=0;l<e.datasets.length;l++){if(typeof e.datasets[l].title=="string")lgtxt=e.datasets[l].title.trim();else lgtxt="";for(var c=0;c<e.datasets[l].data.length;c++){if(l==0){i[c]=0;s[c]=-1}if(!(typeof e.datasets[l].data[c]=="undefined")){n.save();n.textAlign=t.inGraphDataAlign;n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;if(typeof e.labels[c]=="string")lgtxt2=e.labels[c].trim();else lgtxt2="";var y=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,lgtxt2,t.fmtV2),v3:fmtChartJS(t,1*e.datasets[l].data[c],t.fmtV3),v4:fmtChartJS(t,a[c],t.fmtV4),v5:fmtChartJS(t,f[c],t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e.datasets[l].data[c]/f[c],t.fmtV6),t.roundPct),v7:fmtChartJS(t,p,t.fmtV7),v8:fmtChartJS(t,b,t.fmtV8),v9:fmtChartJS(t,p+w,t.fmtV9),v10:fmtChartJS(t,b-v(t,e.datasets[l].data[c],u,o)+t.barStrokeWidth/2,t.fmtV10),v11:fmtChartJS(t,l,t.fmtV11),v12:fmtChartJS(t,c,t.fmtV12)});var p=g+t.barValueSpacing+h*c;n.beginPath();n.beginPath();d=0;m=0;if(t.inGraphDataXPosition==1){m=p+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==2){m=p+w/2+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==3){m=p+w+t.inGraphDataPaddingX}if(t.inGraphDataYPosition==1){d=b-i[c]-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==2){d=b-(v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)+t.barStrokeWidth/2)/2-i[c]-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==3){d=b-v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)+t.barStrokeWidth/2-i[c]-t.inGraphDataPaddingY}n.translate(m,d);n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(y,0,0);n.restore();a[c]+=1+e.datasets[l].data[c];i[c]+=r*v(t,(s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,o)-t.barStrokeWidth/2;if(s[c]==-1)s[c]=l}}}}}function H(){n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,b);n.lineTo(g+T.availableWidth+t.scaleTickSizeRight,b);n.stroke();for(var r=0;r<e.labels.length;r++){n.beginPath();n.moveTo(g+r*h,b+t.scaleTickSizeBottom);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&r>0&&r%t.scaleXGridLinesStep==0){n.lineTo(g+r*h,b-T.availableHeight-t.scaleTickSizeTop)}else{n.lineTo(g+r*h,b)}n.stroke()}n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g,b+t.scaleTickSizeBottom);n.lineTo(g,b-T.availableHeight-t.scaleTickSizeTop);n.stroke();for(var i=t.showYAxisMin?-1:0;i<u.steps;i++){n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,b-(i+1)*o);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&i%t.scaleYGridLinesStep==0){n.lineTo(g+T.availableWidth+t.scaleTickSizeRight,b-(i+1)*o)}else{n.lineTo(g,b-(i+1)*o)}n.stroke()}}function B(){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;if(t.xAxisTop||t.xAxisBottom){n.textBaseline="top";if(T.rotateLabels>90){n.save();n.textAlign="left"}else if(T.rotateLabels>0){n.save();n.textAlign="right"}else{n.textAlign="center"}n.fillStyle=t.scaleFontColor;if(t.xAxisBottom){for(var r=0;r<e.labels.length;r++){n.save();if(T.rotateLabels>0){n.translate(g+r*h+w/2-t.scaleFontSize/2,T.xLabelPos);n.rotate(-(T.rotateLabels*(Math.PI/180)));n.fillText(fmtChartJS(t,e.labels[r],t.fmtXLabel),0,0)}else{n.fillText(fmtChartJS(t,e.labels[r],t.fmtXLabel),g+r*h+w/2,T.xLabelPos)}n.restore()}}}n.textAlign="right";n.textBaseline="middle";for(var i=t.showYAxisMin?-1:0;i<u.steps;i++){if(t.scaleShowLabels){if(t.yAxisLeft){n.textAlign="right";n.fillText(u.labels[i+1],g-(t.scaleTickSizeLeft+t.yAxisSpaceRight),b-(i+1)*o)}if(t.yAxisRight){n.textAlign="left";n.fillText(u.labels[i+1],g+T.availableWidth+(t.scaleTickSizeRight+t.yAxisSpaceRight),b-(i+1)*o)}}}}function j(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;var i=new Array(e.datasets.length);var s=new Array(e.datasets.length);for(var o=0;o<e.datasets.length;o++){for(var u=0;u<e.datasets[o].data.length;u++){var l=o;var c=0;if(!(typeof e.datasets[0].data[u]=="undefined")){c+=1*e.datasets[0].data[u];if(c>n){n=c}if(c<r){r=c}}while(l>0){if(!(typeof e.datasets[l].data[u]=="undefined")){c+=1*e.datasets[l].data[u];if(c>n){n=c}if(c<r){r=c}}l--}}}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}a=t.scaleFontSize;f=T.availableHeight;var h=Math.floor(f/(a*.66));var p=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:h,minSteps:p}}var s,o,u,a,f,l,c,h,p,d,g,b,w,x=0,T;if(typeof n.ChartNewId=="undefined"){var N=new Date;var k=N.getTime();n.ChartNewId="StackedBar_"+k}if(!dynamicFunction(e,t,n,"StackedBar"))return;t.logarithmic=false;var L=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"StackedBar");D(n,t);T=M(e,t,n,i,r,[""],true,false,true,true,true);l=j();c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);T=M(e,t,n,i,r,u.labels,true,false,true,true,true)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,labels:[]};for(var O=0;O<u.steps;O++){if(c){u.labels.push(A(c,{value:fmtChartJS(t,1*(t.scaleStartValue+t.scaleStepWidth*(O+1)).toFixed(C(t.scaleStepWidth)),t.fmtYLabel)}))}}T=M(e,t,n,i,r,u.labels,true,false,true,true,true)}T.availableHeight=T.availableHeight-t.scaleTickSizeBottom-t.scaleTickSizeTop;T.availableWidth=T.availableWidth-t.scaleTickSizeLeft-t.scaleTickSizeRight;o=Math.floor(T.availableHeight/u.steps);h=Math.floor(T.availableWidth/e.labels.length);if(h==0)h=T.availableWidth/(e.labels.length-1);T.clrwidth=T.clrwidth-(T.availableWidth-e.labels.length*h);T.availableWidth=e.labels.length*h;T.availableHeight=u.steps*o;g=T.leftNotUsableSize+t.scaleTickSizeLeft;b=T.topNotUsableSize+T.availableHeight+t.scaleTickSizeTop;w=h-t.scaleGridLineWidth*2-t.barValueSpacing*2-(t.barDatasetSpacing*e.datasets.length-1)-t.barStrokeWidth/2-1;B();m(t,H,_,n,T.clrx,T.clry,T.clrwidth,T.clrheight,g+T.availableWidth/2,b-T.availableHeight/2,g,b,e);};var h=function(e,t,n){function _(e,t,n){var r=t.steps*t.stepValue;var i=e-t.graphMin;var s=N(i/r,1,0);return n*t.steps*s}function H(r){n.lineWidth=t.barStrokeWidth;var i=new Array(e.datasets.length);var s=new Array(e.datasets.length);var a=new Array;var f=new Array;for(var l=0;l<e.datasets.length;l++){for(var c=0;c<e.datasets[l].data.length;c++){a[c]=0;f[c]=0}}for(var l=0;l<e.datasets.length;l++){for(var c=0;c<e.datasets[l].data.length;c++)if(!(typeof e.datasets[l].data[c]=="undefined")){f[c]+=1*e.datasets[l].data[c]}}for(var l=0;l<e.datasets.length;l++){if(r>=1){if(typeof e.datasets[l].title=="string")lgtxt=e.datasets[l].title.trim();else lgtxt=""}for(var c=0;c<e.datasets[l].data.length;c++){n.fillStyle=t.defaultFillColor;if(typeof e.datasets[l].fillColor=="string"){n.fillStyle=e.datasets[l].fillColor}else if(typeof e.datasets[l].fillColor=="object"){if(typeof e.datasets[l].fillColor[0]=="string"){n.fillStyle=e.datasets[l].fillColor[S([e.datasets[l].fillColor.length-1,c])]}}n.strokeStyle=t.defaultStrokeColor;if(typeof e.datasets[l].strokeColor=="string"){n.strokeStyle=e.datasets[l].strokeColor}else if(typeof e.datasets[l].strokeColor=="object"){if(typeof e.datasets[l].strokeColor[0]=="string"){n.strokeStyle=e.datasets[l].strokeColor[S([e.datasets[l].strokeColor.length-1,c])]}}if(l==0){i[c]=0;s[c]=-1}if(!(typeof e.datasets[l].data[c]=="undefined")){var p=g+t.barValueSpacing-o*(c+1);n.beginPath();n.moveTo(v+i[c]+1,p);n.lineTo(v+i[c]+r*_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2,p);n.lineTo(v+i[c]+r*_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2,p+b);n.lineTo(v+i[c]+1,p+b);n.lineTo(v+i[c]+1,p);if(t.barShowStroke)n.stroke();n.closePath();n.fill();a[c]+=1*e.datasets[l].data[c];if(r>=1){if(typeof e.labels[c]=="string")lgtxt2=e.labels[c].trim();else lgtxt2="";jsGraphAnnotate[n.ChartNewId][L++]=["RECT",v+i[c]+1,p+b,v+i[c]+_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2,p,lgtxt,lgtxt2,1*e.datasets[l].data[c],a[c],f[c],l,c]}i[c]+=r*_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2;if(s[c]==-1)s[c]=l}}}if(r>=1&&t.inGraphDataShow){var d=0,m=0;for(var l=0;l<e.datasets.length;l++){for(var c=0;c<e.datasets[l].data.length;c++){a[c]=0}}for(var l=0;l<e.datasets.length;l++){if(typeof e.datasets[l].title=="string")lgtxt=e.datasets[l].title.trim();else lgtxt="";for(var c=0;c<e.datasets[l].data.length;c++){if(l==0){i[c]=0;s[c]=-1}if(!(typeof e.datasets[l].data[c]=="undefined")){n.save();n.textAlign=t.inGraphDataAlign;n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;if(typeof e.labels[c]=="string")lgtxt2=e.labels[c].trim();else lgtxt2="";var p=g+t.barValueSpacing-o*(c+1);var y=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,lgtxt2,t.fmtV2),v3:fmtChartJS(t,1*e.datasets[l].data[c],t.fmtV3),v4:fmtChartJS(t,a[c],t.fmtV4),v5:fmtChartJS(t,f[c],t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e.datasets[l].data[c]/f[c],t.fmtV6),t.roundPct),v7:fmtChartJS(t,v,t.fmtV7),v8:fmtChartJS(t,p+b,t.fmtV8),v9:fmtChartJS(t,v+_(e.datasets[l].data[c],u,h)+t.barStrokeWidth/2,t.fmtV9),v10:fmtChartJS(t,p,t.fmtV10),v11:fmtChartJS(t,l,t.fmtV11),v12:fmtChartJS(t,c,t.fmtV12)});n.beginPath();d=0;m=0;if(t.inGraphDataXPosition==1){m=v+i[c]+1+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==2){m=v+i[c]+(_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2)/2+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==3){m=v+i[c]+_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2+t.inGraphDataPaddingX}if(t.inGraphDataYPosition==1){d=p+b-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==2){d=p+b/2-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==3){d=p-t.inGraphDataPaddingY}n.translate(m,d);n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(y,0,0);n.restore();a[c]+=e.datasets[l].data[c];i[c]+=r*_((s[c]>=0)*u.graphMin+1*e.datasets[l].data[c],u,h)+t.barStrokeWidth/2;if(s[c]==-1)s[c]=l}}}}}function B(){n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(v-t.scaleTickSizeLeft,g);n.lineTo(v+x.availableWidth,g);n.stroke();for(var r=t.showYAxisMin?-1:0;r<u.steps;r++){if(r>=0){n.beginPath();n.moveTo(v+r*h,g+t.scaleTickSizeBottom);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&r>0&&r%t.scaleXGridLinesStep==0){n.lineTo(v+r*h,g-x.availableHeight-t.scaleTickSizeTop)}else{n.lineTo(v+r*h,g)}n.stroke()}}n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(v,g+t.scaleTickSizeBottom);n.lineTo(v,g-x.availableHeight-t.scaleTickSizeTop);n.stroke();for(var i=0;i<e.labels.length;i++){n.beginPath();n.moveTo(v-t.scaleTickSizeLeft,g-(i+1)*o);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&i%t.scaleYGridLinesStep==0){n.lineTo(v+x.availableWidth,g-(i+1)*o)}else{n.lineTo(v,g-(i+1)*o)}n.stroke()}}function j(){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;if(t.xAxisTop||t.xAxisBottom){n.textBaseline="top";if(x.rotateLabels>90){n.save();n.textAlign="left"}else if(x.rotateLabels>0){n.save();n.textAlign="right"}else{n.textAlign="center"}n.fillStyle=t.scaleFontColor;if(t.xAxisBottom){for(var r=t.showYAxisMin?-1:0;r<u.steps;r++){n.save();if(x.rotateLabels>0){n.translate(v+(r+1)*h-t.scaleFontSize/2,x.xLabelPos);n.rotate(-(x.rotateLabels*(Math.PI/180)));n.fillText(u.labels[r+1],0,0)}else{n.fillText(u.labels[r+1],v+(r+1)*h,x.xLabelPos)}n.restore()}}}n.textAlign="right";n.textBaseline="middle";for(var i=0;i<e.labels.length;i++){if(t.scaleShowLabels){if(t.yAxisLeft){n.textAlign="right";n.fillText(fmtChartJS(t,e.labels[i],t.fmtXLabel),v-(t.scaleTickSizeLeft+t.yAxisSpaceRight),g-(i+1)*o+b/2)}if(t.yAxisRight){n.textAlign="left";n.fillText(fmtChartJS(t,e.labels[i],t.fmtXLabel),v+x.availableWidth+(t.scaleTickSizeRight+t.yAxisSpaceRight),g-(i+1)*o+b/2)}}}}function F(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;var i=new Array(e.datasets.length);var s=new Array(e.datasets.length);for(var o=0;o<e.datasets.length;o++){for(var u=0;u<e.datasets[o].data.length;u++){var l=o;var c=0;if(!(typeof e.datasets[0].data[u]=="undefined")){c+=1*e.datasets[0].data[u];if(c>n){n=c}if(c<r){r=c}}while(l>0){if(!(typeof e.datasets[l].data[u]=="undefined")){c+=1*e.datasets[l].data[u];if(c>n){n=c}if(c<r){r=c}}l--}}}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}var h=Math.floor(f/(a*.66));var p=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:h,minSteps:p}}var s,o,u,a,f,l,c,h,p,d,v,g,b,w=0,x;if(typeof n.ChartNewId=="undefined"){var T=new Date;var k=T.getTime();n.ChartNewId="HorizontalStackedBar_"+k}if(!dynamicFunction(e,t,n,"HorizontalStackedBar"))return;t.logarithmic=false;var L=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"HorizontalStackedBar");D(n,t);l=F();c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);x=M(e,t,n,i,r,u.labels,true,true,true,true,true)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,labels:[]};for(var O=0;O<u.steps;O++){if(c){u.labels.push(A(c,{value:fmtChartJS(t,1*(t.scaleStartValue+t.scaleStepWidth*(O+1)).toFixed(C(t.scaleStepWidth)),t.fmtYLabel)}))}}x=M(e,t,n,i,r,u.labels,true,true,true,true,true)}x.availableHeight=x.availableHeight-t.scaleTickSizeBottom-t.scaleTickSizeTop;x.availableWidth=x.availableWidth-t.scaleTickSizeLeft-t.scaleTickSizeRight;o=Math.floor(x.availableHeight/e.labels.length);h=Math.floor(x.availableWidth/u.steps);if(h==0)h=x.availableWidth/(e.labels.length-1);x.clrwidth=x.clrwidth-(x.availableWidth-u.steps*h);x.availableWidth=u.steps*h;x.availableHeight=e.labels.length*o;v=x.leftNotUsableSize+t.scaleTickSizeLeft;g=x.topNotUsableSize+x.availableHeight+t.scaleTickSizeTop;b=o-t.scaleGridLineWidth*2-t.barValueSpacing*2-(t.barDatasetSpacing*e.datasets.length-1)-t.barStrokeWidth/2-1;j();m(t,B,H,n,x.clrx,x.clry,x.clrwidth,x.clrheight,v+x.availableWidth/2,g-x.availableHeight/2,v,g,e);};var p=function(e,t,n){function H(r){var i,s,a;var f=new Array;var l=new Array;for(var c=0;c<e.datasets.length;c++){for(var p=0;p<e.datasets[c].data.length;p++){f[p]=0;l[p]=0}}for(var c=0;c<e.datasets.length;c++){for(var p=0;p<e.datasets[c].data.length;p++)if(!(typeof e.datasets[c].data[p]=="undefined"))l[p]+=1*e.datasets[c].data[p]}n.lineWidth=t.barStrokeWidth;for(var c=0;c<e.datasets.length;c++){if(r>=1){if(typeof e.datasets[c].title=="string")lgtxt=e.datasets[c].title.trim();else lgtxt=""}for(var p=0;p<e.datasets[c].data.length;p++){n.fillStyle=t.defaultFillColor;if(typeof e.datasets[c].fillColor=="string"){n.fillStyle=e.datasets[c].fillColor}else if(typeof e.datasets[c].fillColor=="object"){if(typeof e.datasets[c].fillColor[0]=="string"){n.fillStyle=e.datasets[c].fillColor[S([e.datasets[c].fillColor.length-1,p])]}}n.strokeStyle=t.defaultStrokeColor;if(typeof e.datasets[c].strokeColor=="string"){n.strokeStyle=e.datasets[c].strokeColor}else if(typeof e.datasets[c].strokeColor=="object"){if(typeof e.datasets[c].strokeColor[0]=="string"){n.strokeStyle=e.datasets[c].strokeColor[S([e.datasets[c].strokeColor.length-1,p])]}}if(!(typeof e.datasets[c].data[p]=="undefined")){var d=g+t.barValueSpacing+h*p+T*c+t.barDatasetSpacing*c+t.barStrokeWidth*c;var m=r*v(t,1*e.datasets[c].data[p],u,o)+t.barStrokeWidth/2;B(n,d,x,T,m,t.barShowStroke,t.barBorderRadius,_);f[p]+=1*e.datasets[c].data[p];if(r>=1){if(typeof e.labels[p]=="string")lgtxt2=e.labels[p].trim();else lgtxt2="";i=x-_;s=x-v(t,1*e.datasets[c].data[p],u,o)+t.barStrokeWidth/2;if(i<s){a=i;i=s;s=a}jsGraphAnnotate[n.ChartNewId][k++]=["RECT",d,i,d+T,s,lgtxt,lgtxt2,1*e.datasets[c].data[p],f[p],l[p],c,p]}}}}if(r>=1&&t.inGraphDataShow){for(var c=0;c<e.datasets.length;c++){for(var p=0;p<e.datasets[c].data.length;p++){f[p]=0}}for(var c=0;c<e.datasets.length;c++){if(typeof e.datasets[c].title=="string")lgtxt=e.datasets[c].title.trim();else lgtxt="";for(var p=0;p<e.datasets[c].data.length;p++){if(!(typeof e.datasets[c].data[p]=="undefined")){if(typeof e.labels[p]=="string")lgtxt2=e.labels[p].trim();n.save();n.textAlign=t.inGraphDataAlign;n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var d=g+t.barValueSpacing+h*p+T*c+t.barDatasetSpacing*c+t.barStrokeWidth*c;i=x-_;s=x-v(t,1*e.datasets[c].data[p],u,o)+t.barStrokeWidth/2;n.beginPath();var y=0,b=0;if(t.inGraphDataXPosition==1){b=d+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==2){b=d+T/2+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==3){b=d+T+t.inGraphDataPaddingX}if(t.inGraphDataYPosition==1){y=x-_-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==2){y=x-(v(t,1*e.datasets[c].data[p],u,o)+t.barStrokeWidth/2)/2-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==3){y=x-v(t,1*e.datasets[c].data[p],u,o)+t.barStrokeWidth/2-t.inGraphDataPaddingY}n.translate(b,y);var w=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,lgtxt2,t.fmtV2),v3:fmtChartJS(t,1*e.datasets[c].data[p],t.fmtV3),v4:fmtChartJS(t,f[p],t.fmtV4),v5:fmtChartJS(t,l[p],t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e.datasets[c].data[p]/l[p],t.fmtV6),t.roundPct),v7:fmtChartJS(t,d,t.fmtV7),v8:fmtChartJS(t,i,t.fmtV8),v9:fmtChartJS(t,d+T,t.fmtV9),v10:fmtChartJS(t,s,t.fmtV10),v11:fmtChartJS(t,c,t.fmtV11),v12:fmtChartJS(t,p,t.fmtV12)});n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(w,0,0);n.restore();f[p]+=1*e.datasets[c].data[p]}}}}}function B(e,t,n,r,i,s,o,u){e.beginPath();e.moveTo(t+o,n-u);e.lineTo(t+r-o,n-u);e.quadraticCurveTo(t+r,n-u,t+r,n-u);e.lineTo(t+r,n-i+o);e.quadraticCurveTo(t+r,n-i,t+r-o,n-i);e.lineTo(t+o,n-i);e.quadraticCurveTo(t,n-i,t,n-i+o);e.lineTo(t,n-u);e.quadraticCurveTo(t,n-u,t+o,n-u);if(s)e.stroke();e.closePath();e.fill()}function j(){n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,x);n.lineTo(g+C.availableWidth+t.scaleTickSizeRight,x);n.stroke();for(var r=0;r<e.labels.length;r++){n.beginPath();n.moveTo(g+r*h,x+t.scaleTickSizeBottom);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&r>0&&r%t.scaleXGridLinesStep==0){n.lineTo(g+r*h,x-C.availableHeight-t.scaleTickSizeTop)}else{n.lineTo(g+r*h,x)}n.stroke()}n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g,x+t.scaleTickSizeBottom);n.lineTo(g,x-C.availableHeight-t.scaleTickSizeTop);n.stroke();for(var i=0;i<u.steps;i++){n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,x-(i+1)*o);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&i%t.scaleYGridLinesStep==0){n.lineTo(g+C.availableWidth+t.scaleTickSizeRight,x-(i+1)*o)}else{n.lineTo(g,x-(i+1)*o)}n.stroke()}}function F(){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;if(t.xAxisTop||t.xAxisBottom){n.textBaseline="top";if(C.rotateLabels>90){n.save();n.textAlign="left"}else if(C.rotateLabels>0){n.save();n.textAlign="right"}else{n.textAlign="center"}n.fillStyle=t.scaleFontColor;if(t.xAxisBottom){for(var r=0;r<e.labels.length;r++){n.save();if(C.rotateLabels>0){n.translate(g+r*h+h/2-t.scaleFontSize/2,C.xLabelPos);n.rotate(-(C.rotateLabels*(Math.PI/180)));n.fillText(fmtChartJS(t,e.labels[r],t.fmtXLabel),0,0)}else{n.fillText(fmtChartJS(t,e.labels[r],t.fmtXLabel),g+r*h+h/2,C.xLabelPos)}n.restore()}}}n.textAlign="right";n.textBaseline="middle";for(var i=t.showYAxisMin?-1:0;i<u.steps;i++){if(t.scaleShowLabels){if(t.yAxisLeft){n.textAlign="right";n.fillText(u.labels[i+1],g-(t.scaleTickSizeLeft+t.yAxisSpaceRight),x-(i+1)*o)}if(t.yAxisRight){n.textAlign="left";n.fillText(u.labels[i+1],g+C.availableWidth+(t.scaleTickSizeRight+t.yAxisSpaceRight),x-(i+1)*o)}}}}function I(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;for(var i=0;i<e.datasets.length;i++){for(var s=0;s<e.datasets[i].data.length;s++){if(1*e.datasets[i].data[s]>n){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]<r){r=1*e.datasets[i].data[s]}}}if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;a=t.scaleFontSize;f=C.availableHeight;var o=Math.floor(f/(a*.66));var u=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:o,minSteps:u}}var s,o,u,a,f,l,c,h,p,d,g,x,T,N=0,C;var k=0;if(typeof n.ChartNewId=="undefined"){var L=new Date;var A=L.getTime();n.ChartNewId="Bar_"+A}if(!dynamicFunction(e,t,n,"Bar"))return;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"Bar");D(n,t);C=M(e,t,n,i,r,[""],true,false,true,true,true);l=I();if(t.logarithmic!==false){if(l.minValue<=0){t.logarithmic=false}}var O=b(Math.pow(10,b(l.maxValue)+1))-b(Math.pow(10,b(l.minValue)));if(t.logarithmic=="fuzzy"&&O<4||t.scaleOverride){t.logarithmic=false}c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);C=M(e,t,n,i,r,u.labels,true,false,true,true,true)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,graphMax:t.scaleStartValue+t.scaleSteps*t.scaleStepWidth,labels:[]};w(t,c,u.labels,u.steps,t.scaleStartValue,u.graphMax,t.scaleStepWidth);C=M(e,t,n,i,r,u.labels,true,false,true,true,true)}C.availableHeight=C.availableHeight-t.scaleTickSizeBottom-t.scaleTickSizeTop;C.availableWidth=C.availableWidth-t.scaleTickSizeLeft-t.scaleTickSizeRight;o=Math.floor(C.availableHeight/u.steps);h=Math.floor(C.availableWidth/e.labels.length);if(h==0)h=C.availableWidth/(e.labels.length-1);C.clrwidth=C.clrwidth-(C.availableWidth-e.labels.length*h);C.availableWidth=e.labels.length*h;C.availableHeight=u.steps*o;g=C.leftNotUsableSize+t.scaleTickSizeLeft;x=C.topNotUsableSize+C.availableHeight+t.scaleTickSizeTop;T=(h-t.scaleGridLineWidth*2-t.barValueSpacing*2-(t.barDatasetSpacing*e.datasets.length-1)-(t.barStrokeWidth/2*e.datasets.length-1))/e.datasets.length;var _=0;if(l.minValue<0){var _=v(t,0,u,o)}F();m(t,j,H,n,C.clrx,C.clry,C.clrwidth,C.clrheight,g+C.availableWidth/2,x-C.availableHeight/2,g,x,e);};var d=function(e,t,n){function O(r){var i=new Array;var s=new Array;for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++){i[f]=0;s[f]=0}}for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++)if(!(typeof e.datasets[a].data[f]=="undefined"))s[f]+=1*e.datasets[a].data[f]}n.lineWidth=t.barStrokeWidth;for(var a=0;a<e.datasets.length;a++){if(r>=1){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt=""}for(var f=0;f<e.datasets[a].data.length;f++){n.fillStyle=t.defaultFillColor;if(typeof e.datasets[a].fillColor=="string"){n.fillStyle=e.datasets[a].fillColor}else if(typeof e.datasets[a].fillColor=="object"){if(typeof e.datasets[a].fillColor[0]=="string"){n.fillStyle=e.datasets[a].fillColor[S([e.datasets[a].fillColor.length-1,f])]}}n.strokeStyle=t.defaultStrokeColor;if(typeof e.datasets[a].strokeColor=="string"){n.strokeStyle=e.datasets[a].strokeColor}else if(typeof e.datasets[a].strokeColor=="object"){if(typeof e.datasets[a].strokeColor[0]=="string"){n.strokeStyle=e.datasets[a].strokeColor[S([e.datasets[a].strokeColor.length-1,f])]}}if(!(typeof e.datasets[a].data[f]=="undefined")){var l=b+t.barValueSpacing-o*(f+1)+x*a+t.barDatasetSpacing*a+t.barStrokeWidth*a;var c=r*v(t,1*e.datasets[a].data[f],u,h)+t.barStrokeWidth/2;_(n,l,g,x,c,t.barShowStroke,t.barBorderRadius,A);i[f]+=1*e.datasets[a].data[f];if(r>=1){if(typeof e.labels[f]=="string")lgtxt2=e.labels[f].trim();else lgtxt2="";t1=g+A;t2=g+v(t,1*e.datasets[a].data[f],u,h)+t.barStrokeWidth/2;if(t1>t2){t3=t1;t1=t2;t2=t3}jsGraphAnnotate[n.ChartNewId][L++]=["RECT",t1,l+x,t2,l,lgtxt,lgtxt2,1*e.datasets[a].data[f],i[f],s[f],a,f]}}}}if(r>=1&&t.inGraphDataShow){for(var a=0;a<e.datasets.length;a++){for(var f=0;f<e.datasets[a].data.length;f++){i[f]=0}}for(var a=0;a<e.datasets.length;a++){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt="";for(var f=0;f<e.datasets[a].data.length;f++){if(!(typeof e.datasets[a].data[f]=="undefined")){if(typeof e.labels[f]=="string")lgtxt2=e.labels[f].trim();n.save();n.textAlign=t.inGraphDataAlign;n.textBaseline=t.inGraphDataVAlign;n.font=t.inGraphDataFontStyle+" "+t.inGraphDataFontSize+"px "+t.inGraphDataFontFamily;n.fillStyle=t.inGraphDataFontColor;var l=b+t.barValueSpacing-o*(f+1)+x*a+t.barDatasetSpacing*a+t.barStrokeWidth*a;t1=g+A;t2=g+v(t,1*e.datasets[a].data[f],u,h)+t.barStrokeWidth/2;if(t1>t2){t3=t1;t1=t2;t2=t3}n.beginPath();var p=0,d=0;if(t.inGraphDataYPosition==1){p=l-t.inGraphDataPaddingY+x}else if(t.inGraphDataYPosition==2){p=l+x/2-t.inGraphDataPaddingY}else if(t.inGraphDataYPosition==3){p=l-t.inGraphDataPaddingY}if(t.inGraphDataXPosition==1){d=g+A+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==2){d=g+(v(t,1*e.datasets[a].data[f],u,h)+t.barStrokeWidth/2)/2+t.inGraphDataPaddingX}else if(t.inGraphDataXPosition==3){d=g+v(t,1*e.datasets[a].data[f],u,h)+t.barStrokeWidth/2+t.inGraphDataPaddingX}n.translate(d,p);var m=tmplbis(t.inGraphDataTmpl,{config:t,v1:fmtChartJS(t,lgtxt,t.fmtV1),v2:fmtChartJS(t,lgtxt2,t.fmtV2),v3:fmtChartJS(t,1*e.datasets[a].data[f],t.fmtV3),v4:fmtChartJS(t,i[f],t.fmtV4),v5:fmtChartJS(t,s[f],t.fmtV5),v6:roundToWithThousands(t,fmtChartJS(t,100*e.datasets[a].data[f]/s[f],t.fmtV6),t.roundPct),v7:fmtChartJS(t,t1,t.fmtV7),v8:fmtChartJS(t,l+x,t.fmtV8),v9:fmtChartJS(t,t2,t.fmtV9),v10:fmtChartJS(t,l,t.fmtV10),v11:fmtChartJS(t,a,t.fmtV11),v12:fmtChartJS(t,f,t.fmtV12)});n.rotate(t.inGraphDataRotate*(Math.PI/180));n.fillText(m,0,0);n.restore();i[f]+=1*e.datasets[a].data[f]}}}}}function _(e,t,n,r,i,s,o,u){e.beginPath();e.moveTo(n+u,t+o);e.lineTo(n+u,t+r-o);e.quadraticCurveTo(n+u,t+r,n+u,t+r);e.lineTo(n+i-o,t+r);e.quadraticCurveTo(n+i,t+r,n+i,t+r-o);e.lineTo(n+i,t+o);e.quadraticCurveTo(n+i,t,n+i-o,t);e.lineTo(n+u,t);e.quadraticCurveTo(n+u,t,n+u,t+o);if(s)e.stroke();e.closePath();e.fill()}function H(){n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,b);n.lineTo(g+N.availableWidth+t.scaleTickSizeRight,b);n.stroke();for(var r=t.showYAxisMin?-1:0;r<u.steps;r++){if(r>=0){n.beginPath();n.moveTo(g+r*h,b+t.scaleTickSizeBottom);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&r>0&&r%t.scaleXGridLinesStep==0){n.lineTo(g+r*h,b-N.availableHeight-t.scaleTickSizeTop)}else{n.lineTo(g+r*h,b)}n.stroke()}}n.lineWidth=t.scaleLineWidth;n.strokeStyle=t.scaleLineColor;n.beginPath();n.moveTo(g,b+t.scaleTickSizeBottom);n.lineTo(g,b-N.availableHeight-t.scaleTickSizeTop);n.stroke();for(var i=0;i<e.labels.length;i++){n.beginPath();n.moveTo(g-t.scaleTickSizeLeft,b-(i+1)*o);n.lineWidth=t.scaleGridLineWidth;n.strokeStyle=t.scaleGridLineColor;if(t.scaleShowGridLines&&i%t.scaleYGridLinesStep==0){n.lineTo(g+N.availableWidth+t.scaleTickSizeRight,b-(i+1)*o)}else{n.lineTo(g,b-(i+1)*o)}n.stroke()}}function B(){n.font=t.scaleFontStyle+" "+t.scaleFontSize+"px "+t.scaleFontFamily;if(t.xAxisTop||t.xAxisBottom){n.textBaseline="top";if(N.rotateLabels>90){n.save();n.textAlign="left"}else if(N.rotateLabels>0){n.save();n.textAlign="right"}else{n.textAlign="center"}n.fillStyle=t.scaleFontColor;if(t.xAxisBottom){for(var r=t.showYAxisMin?-1:0;r<u.steps;r++){n.save();if(N.rotateLabels>0){n.translate(g+(r+1)*h-t.scaleFontSize/2,N.xLabelPos);n.rotate(-(N.rotateLabels*(Math.PI/180)));n.fillText(u.labels[r+1],0,0)}else{n.fillText(u.labels[r+1],g+(r+1)*h,N.xLabelPos)}n.restore()}}}n.textAlign="right";n.textBaseline="middle";for(var i=0;i<e.labels.length;i++){if(t.scaleShowLabels){if(t.yAxisLeft){n.textAlign="right";n.fillText(fmtChartJS(t,e.labels[i],t.fmtXLabel),g-(t.scaleTickSizeLeft+t.yAxisSpaceRight),b-i*o-o/2)}if(t.yAxisRight){n.textAlign="left";n.fillText(fmtChartJS(t,e.labels[i],t.fmtXLabel),g+N.availableWidth+(t.scaleTickSizeRight+t.yAxisSpaceRight),b-i*o-o/2)}}}}function j(){var n=Number.MIN_VALUE;var r=Number.MAX_VALUE;for(var i=0;i<e.datasets.length;i++){for(var s=0;s<e.datasets[i].data.length;s++){if(1*e.datasets[i].data[s]>n){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]<r){r=1*e.datasets[i].data[s]}}}if(Math.abs(n-r)<1e-8){n=E([n*2,1]);r=0}if(!isNaN(t.graphMin))r=t.graphMin;if(!isNaN(t.graphMax))n=t.graphMax;var o=Math.floor(f/(a*.66));var u=Math.floor(f/a*.5);return{maxValue:n,minValue:r,maxSteps:o,minSteps:u}}var s,o,u,a,f,l,c,h,p,d,g,b,x,T=0,N;if(typeof n.ChartNewId=="undefined"){var C=new Date;var k=C.getTime();n.ChartNewId="HorizontalBar_"+k}if(!dynamicFunction(e,t,n,"HorizontalBar"))return;var L=0;jsGraphAnnotate[n.ChartNewId]=new Array;P(n,e,t,"HorizontalBar");D(n,t);l=j();c=t.scaleShowLabels?t.scaleLabel:"";if(!t.scaleOverride){u=y(t,l.maxSteps,l.minSteps,l.maxValue,l.minValue,c);N=M(e,t,n,i,r,u.labels,true,true,true,true,true)}else{u={steps:t.scaleSteps,stepValue:t.scaleStepWidth,graphMin:t.scaleStartValue,graphMax:t.scaleStartValue+t.scaleSteps*t.scaleStepWidth,labels:[]};w(t,c,u.labels,u.steps,t.scaleStartValue,u.graphMax,t.scaleStepWidth);N=M(e,t,n,i,r,u.labels,true,true,true,true,true)}N.availableHeight=N.availableHeight-t.scaleTickSizeBottom-t.scaleTickSizeTop;N.availableWidth=N.availableWidth-t.scaleTickSizeLeft-t.scaleTickSizeRight;o=Math.floor(N.availableHeight/e.labels.length);h=Math.floor(N.availableWidth/u.steps);if(h==0)h=N.availableWidth/(e.labels.length-1);N.clrwidth=N.clrwidth-(N.availableWidth-u.steps*h);N.availableWidth=u.steps*h;N.availableHeight=e.labels.length*o;g=N.leftNotUsableSize+t.scaleTickSizeLeft;b=N.topNotUsableSize+N.availableHeight+t.scaleTickSizeTop;x=(o-t.scaleGridLineWidth*2-t.barValueSpacing*2-(t.barDatasetSpacing*e.datasets.length-1)-(t.barStrokeWidth/2*e.datasets.length-1))/e.datasets.length;var A=0;if(l.minValue<0){var A=v(t,0,u,h)}B();m(t,H,O,n,N.clrx,N.clry,N.clrwidth,N.clrheight,g+N.availableWidth/2,b-N.availableHeight/2,g,b,e);};var g=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();var L={};}