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()=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;ejsGraphAnnotate[ctx.ChartNewId][i][3]&&distance2*Math.PI){angle-=2*Math.PI}if(anglejsGraphAnnotate[ctx.ChartNewId][i][5]&&anglejsGraphAnnotate[ctx.ChartNewId][i][5]-2*Math.PI&&anglejsGraphAnnotate[ctx.ChartNewId][i][5]+2*Math.PI&&anglejsGraphAnnotate[ctx.ChartNewId][i][1]&&canvas_pos.xjsGraphAnnotate[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(w1)e.animation.StartValue=0;if(e.animationStopValue<0||e.animationStopValue>1)e.animation.StopValue=1;if(e.animationStopValue0&&e.animationStartValue<=1){while(wt){if(lt){return t}}if(T(n)){if(e)[^\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;cP?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)/nblab180)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",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;c2*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=1){i=-t.startAngle*(Math.PI/180)+2*Math.PI;for(var c=0;c3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)3*Math.PI/2||(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;en){n=1*e[i].value}if(1*e[i].value360){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=1){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt=""}var c=-1;for(var f=0;f=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=1&&t.inGraphDataShow){for(var a=0;a3*Math.PI/2||(f*l+2*Math.PI)%(2*Math.PI)3*Math.PI/2||(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;i2*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-Math.PI/2||m>3*Math.PI/2){if(i-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(ih.availableHeight/2-t.scaleFontSize*2){i=Math.sin(m)*h.availableHeight/2-1.5*t.scaleFontSize;if(ic){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;in){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]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=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)3*Math.PI/2||(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;p360){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;p2*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=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)3*Math.PI/2||(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;p360){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=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=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;w0&&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;i90){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;r0){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;in){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]=1){if(typeof e.datasets[l].title=="string")lgtxt=e.datasets[l].title.trim();else lgtxt=""}for(var c=0;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=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;r0&&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;i90){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;r0){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;in){n=c}if(c0){if(!(typeof e.datasets[l].data[u]=="undefined")){c+=1*e.datasets[l].data[u];if(c>n){n=c}if(c=1){if(typeof e.datasets[l].title=="string")lgtxt=e.datasets[l].title.trim();else lgtxt=""}for(var c=0;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=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=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;i90){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;r0){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;in){n=c}if(c0){if(!(typeof e.datasets[l].data[u]=="undefined")){c+=1*e.datasets[l].data[u];if(c>n){n=c}if(c=1){if(typeof e.datasets[c].title=="string")lgtxt=e.datasets[c].title.trim();else lgtxt=""}for(var p=0;p=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=1&&t.inGraphDataShow){for(var c=0;c0&&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;i90){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;r0){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;in){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]=1){if(typeof e.datasets[a].title=="string")lgtxt=e.datasets[a].title.trim();else lgtxt=""}for(var f=0;f=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;at2){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=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;i90){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;r0){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;in){n=1*e.datasets[i].data[s]}if(1*e.datasets[i].data[s]