xstatic-chartnew-js/xstatic/pkg/chartnew_js/data/ChartNew.min.js

10 lines
284 KiB
JavaScript

function lineStyleFn(a){return"object"==typeof chartJSLineStyle[a]?chartJSLineStyle[a]:chartJSLineStyle.solid}function roundToWithThousands(a,e,t){var i=1*unFormat(a,e);if("number"==typeof i&&"none"!=t){var l;if(0>=t)l=-t,i=+(Math.round(i+"e+"+l)+"e-"+l);else{l=t;var n="1e+"+l;i=+Math.round(i/n)*n}}return i=fmtChartJS(a,i,"none")}function unFormat(a,e){if("."==a.decimalSeparator&&""==a.thousandSeparator||"string"!=typeof e)return e;var t=""+e;if(""!=a.thousandSeparator)for(;t.indexOf(a.thousandSeparator)>=0;)t=""+t.replace(a.thousandSeparator,"");return"."!=a.decimalSeparator&&(t=""+t.replace(a.decimalSeparator,".")),1*t}function fmtChartJSPerso(a,e,t){switch(t){case"SampleJS_Format":"number"==typeof e?return_value="My Format : "+e.toString()+" $":return_value=e+"XX";break;case"Change_Month":"string"==typeof e?return_value=e.toString()+" 2014":return_value=e.toString()+"YY";break;default:return_value=e}return return_value}function fmtChartJS(a,e,t){var i;if("notformatted"==t)i=e;else if("none"!=t&&"money"!=t||"number"!=typeof e)i="none"!=t&&"notformatted"!=t?fmtChartJSPerso(a,e,t):e;else{if("none"!=a.roundNumber){var l;if(a.roundNumber<=0)l=-a.roundNumber,e=+(Math.round(e+"e+"+l)+"e-"+l);else{l=a.roundNumber;var n="1e+"+l;e=+Math.round(e/n)*n}}if("."!=a.decimalSeparator||""!=a.thousandSeparator){if(i=e.toString().replace(/\./g,a.decimalSeparator),""!=a.thousandSeparator){var o=i,s="",r=o.indexOf(a.decimalSeparator);r>=0&&(s=o.substring(r+1,o.length),s=s.split("").reverse().join(""),o=o.substring(0,r)),o=o.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a.thousandSeparator),s=s.split("").reverse().join(""),i=o,""!=s&&(i=i+a.decimalSeparator+s)}}else i=e;"money"==t&&("before"==a.currencyPosition?i=a.currency+i:i+=a.currency)}return i}function addParameters2Function(data,fctName,fctList){var mathFunctions={mean:{data:data.data,datasetNr:data.v11},varianz:{data:data.data,datasetNr:data.v11},stddev:{data:data.data,datasetNr:data.v11},cv:{data:data.data,datasetNr:data.v11},median:{data:data.data,datasetNr:data.v11}};if(dif=!1,"Dif"==fctName.substr(-3)&&(fctName=fctName.substr(0,fctName.length-3),dif=!0),"function"==typeof eval(fctName)){var parameter=eval(fctList+"."+fctName);return dif?data.v3-window[fctName](parameter):window[fctName](parameter)}return null}function isNumber(a){return!isNaN(parseFloat(a))&&isFinite(a)}function tmplbis(a,e,t){return newstr=a,newstr.substr(0,t.templatesOpenTag.length)==t.templatesOpenTag&&(newstr="<%="+newstr.substr(t.templatesOpenTag.length,newstr.length-t.templatesOpenTag.length)),newstr.substr(newstr.length-t.templatesCloseTag.length,t.templatesCloseTag.length)==t.templatesCloseTag&&(newstr=newstr.substr(0,newstr.length-t.templatesCloseTag.length)+"%>"),tmplter(newstr,e)}function tmplter(a,e){for(var t=["mean","varianz","stddev","cv","median"],i=new RegExp("<%=((?:(?:.*?)\\W)??)((?:"+t.join("|")+")(?:Dif)?)\\(([0-9]*?)\\)(.*?)%>","g");i.test(a);)a=a.replace(i,function(a,t,i,l,n){var o;o=l?l:2;var s=addParameters2Function(e,i,"mathFunctions");return isNumber(s)?"<%="+t+Math.round(Math.pow(10,o)*s)/Math.pow(10,o)+n+"%>":"<%= %>"});var l=/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(a)?cachebis[a]=cachebis[a]||tmplter(document.getElementById(a).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\n]/g,"\\n").replace(/[\t]/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 e?l(e):l}function createCursorDiv(){if(0==cursorDivCreated){var a=document.createElement("divCursor");a.id="divCursor",a.style.position="absolute",document.body.appendChild(a),cursorDivCreated=!0}}function addResponsiveChart(a,e,t,i){0==initChartJsResize&&(window.addEventListener?window.addEventListener("resize",chartJsResize):window.attachEvent("resize",chartJsResize)),jsGraphResize[jsGraphResize.length]=[a,e.tpchart,e,t,i]}function getMaximumWidth(a){return null!=a.parentNode&&void 0!=a.parentNode&&(container=a.parentNode),container.clientWidth}function getMaximumHeight(a){return null!=a.parentNode&&void 0!=a.parentNode&&(container=a.parentNode),container.clientHeight}function resizeCtx(a,e){if(isIE()<9&&0!=isIE())return!0;if(e.responsive){"undefined"==typeof e.maintainAspectRatio&&(e.maintainAspectRatio=!0),"undefined"==typeof e.responsiveMinWidth&&(e.responsiveMinWidth=0),"undefined"==typeof e.responsiveMinHeight&&(e.responsiveMinHeight=0),"undefined"==typeof e.responsiveMaxWidth&&(e.responsiveMaxWidth=9999999),"undefined"==typeof e.responsiveMaxHeight&&(e.responsiveMaxHeight=9999999);var t=a.canvas;"undefined"==typeof a.aspectRatio&&(a.aspectRatio=t.width/t.height);var i=getMaximumWidth(t),l=e.maintainAspectRatio?i/a.aspectRatio:getMaximumHeight(t);i=Math.min(e.responsiveMaxWidth,Math.max(e.responsiveMinWidth,i)),l=Math.min(e.responsiveMaxHeight,Math.max(e.responsiveMinHeight,l)),"undefined"==typeof a.DefaultchartTextScale&&(a.DefaultchartTextScale=e.chartTextScale),"undefined"==typeof a.DefaultchartLineScale&&(a.DefaultchartLineScale=e.chartLineScale),"undefined"==typeof a.DefaultchartSpaceScale&&(a.DefaultchartSpaceScale=e.chartSpaceScale),"undefined"!=typeof a.chartTextScale&&e.responsiveScaleContent&&(a.chartTextScale=a.DefaultchartTextScale*(i/a.initialWidth),a.chartLineScale=a.DefaultchartLineScale*(i/a.initialWidth),a.chartSpaceScale=a.DefaultchartSpaceScale*(i/a.initialWidth)),window.devicePixelRatio>1&&(a.canvas.style.width=i+"px",a.canvas.style.height=l+"px"),a.canvas.height=l*Math.max(1,window.devicePixelRatio),a.canvas.width=i*Math.max(1,window.devicePixelRatio),a.scale(Math.max(1,window.devicePixelRatio),Math.max(1,window.devicePixelRatio))}else window.devicePixelRatio>1&&("undefined"==typeof a.original_width&&(a.original_width=a.canvas.width,a.original_height=a.canvas.height),a.canvas.style.width=a.original_width+"px",a.canvas.style.height=a.original_height+"px",a.canvas.height=a.original_height*window.devicePixelRatio,a.canvas.width=a.original_width*window.devicePixelRatio,a.scale(window.devicePixelRatio,window.devicePixelRatio))}function chartJsResize(){for(var a=0;a<jsGraphResize.length;a++)0==jsGraphResize[a][2].firstPass||(9==jsGraphResize[a][2].firstPass?(jsGraphResize[a][2].firstPass=2,redrawGraph(jsGraphResize[a][2],jsGraphResize[a][3],jsGraphResize[a][4])):jsGraphResize[a][2].firstPass<10&&(jsGraphResize[a][2].firstPass+=10))}function testRedraw(a,e,t){return a.firstPass>10?(a.firstPass=2,redrawGraph(a,e,t),!0):!1}function updateChart(a,e,t,i,l){if(9==a.firstPass){if(a.runanimationcompletefunction=l,i?a.firstPass=1:a.firstPass=2,t.responsive)for(var n=0;n<jsGraphResize.length;n++)jsGraphResize[n][2].ChartNewId==a.ChartNewId&&(jsGraphResize[n][3]=e,jsGraphResize[n][4]=t);redrawGraph(a,e,t)}}function redrawGraph(ctx,data,config){var myGraph=new Chart(ctx);eval("myGraph."+ctx.tpchart+"(data,config);")}function checkBrowser(){return 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,this}function cursorInit(){scrolled=bw.ns4||bw.ns5?"window.pageYOffset":"document.body.scrollTop",bw.ns4&&document.captureEvents(Event.MOUSEMOVE)}function makeCursorObj(obj,nest){return 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(),this}function b_moveIt(a,e){this.x=a,this.y=e,this.css.left=this.x+"px",this.css.top=this.y+"px"}function isIE(){var a=navigator.userAgent.toLowerCase();return-1!=a.indexOf("msie")?parseInt(a.split("msie")[1]):!1}function mergeChartConfig(a,e){var t={};for(var i in a)t[i]=a[i];for(var l in e)t[l]=e[l];return t}function sleep(a){var e=new Date;for(e.setTime(e.getTime()+a);(new Date).getTime()<e.getTime(););}function saveCanvas(a,e,t){cvSave=a.getImageData(0,0,a.canvas.width,a.canvas.height);var i={savePng:!1,annotateDisplay:!1,animation:!1,dynamicDisplay:!1};savePngConfig1=mergeChartConfig(t,i),savePngConfig1.clearRect=!1,redrawGraph(a,e,savePngConfig1);var l;if("NewWindow"==t.savePngOutput&&(l=a.canvas.toDataURL(),a.putImageData(cvSave,0,0),window.open(l,"_blank")),"CurrentWindow"==t.savePngOutput&&(l=a.canvas.toDataURL(),a.putImageData(cvSave,0,0),window.location.href=l),"Save"==t.savePngOutput){l=a.canvas.toDataURL();var n=document.createElement("a");n.href=l,n.download=t.savePngName+".png",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}function dynamicFunction(a,e,t){if(isIE()<9&&0!=isIE())return!0;if(e.dynamicDisplay&&0==t.firstPass){if(""==t.canvas.id){var i=new Date,l=i.getTime();t.canvas.id="Canvas_"+l}if("undefined"==typeof dynamicDisplay[t.canvas.id]&&(dynamicDisplayList[dynamicDisplayList.length]=t.canvas.id,dynamicDisplay[t.canvas.id]=[t,a,e],window.onscroll=scrollFunction),!isScrolledIntoView(t.canvas,e))return!1}return!0}function isScrolledIntoView(a,e){var t,i,l=0,n=0;for("undefined"==typeof a.recomputedHeight&&(window.devicePixelRatio?(a.recomputedHeight=a.height/window.devicePixelRatio,a.recomputedWidth=a.width/window.devicePixelRatio):(a.recomputedHeight=a.height,a.recomputedWidth=a.width)),t=a.recomputedWidth,i=a.recomputedHeight,elem=a;elem;)l+=elem.offsetLeft+elem.clientLeft,n+=elem.offsetTop+elem.clientTop,elem=elem.offsetParent;return l+t*e.dynamicDisplayXPartOfChart>=window.pageXOffset&&l+t*e.dynamicDisplayXPartOfChart<=window.pageXOffset+window.innerWidth&&n+i*e.dynamicDisplayYPartOfChart>=window.pageYOffset&&n+i*e.dynamicDisplayYPartOfChart<=window.pageYOffset+window.innerHeight?!0:!1}function scrollFunction(){for(var a=0;a<dynamicDisplayList.length;a++)0==dynamicDisplay[dynamicDisplayList[a]][0].firstPass&&redrawGraph(dynamicDisplay[dynamicDisplayList[a]][0],dynamicDisplay[dynamicDisplayList[a]][1],dynamicDisplay[dynamicDisplayList[a]][2])}function clearAnnotate(a){jsGraphAnnotate[a]=[],jsTextMousePos[a]=[]}function getMousePos(a,e){var t=a.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function isHighLighted(a,e,t,i,l,n,o){var s;if("object"==typeof t.special)for(s=t.special.length-1;s>=0;s--)if("highLight"==t.special[s].typespecial&&t.special[s].posi==l&&t.special[s].posj==n)return!0;return!1}function isNotHighLighted(a,e,t,i,l,n,o){return!isHighLighted(a,e,t,i,l,n,o)}function deleteHighLight(a,e){var t;if("object"==typeof e.special)for(t=e.special.length-1;t>=0;t--)"highLight"==e.special[t].typespecial&&e.special.splice(t,1)}function highLightAction(action,ctx,data,config,v1,v2){if(9==ctx.firstPass){var currentlyDisplayed=[-1,-1],redisplay=!1,i,j;if("object"==typeof data.special)for(i=0;i<data.special.length&&-1==currentlyDisplayed[0];i++)"highLight"==data.special[i].typespecial&&(currentlyDisplayed=[data.special[i].posi,data.special[i].posj]);var deleteOld=!1,addNew=!1,property,output;if("HIDE"==action&&-1!=currentlyDisplayed[0]?deleteOld=!0:"HIDE"!=action&&"group"==config.highLightFullLine&&currentlyDisplayed[1]!=v2?(-1!=currentlyDisplayed[0]&&(deleteOld=!0),addNew=!0):"HIDE"==action||0!=config.highLightFullLine||currentlyDisplayed[0]==v1&&currentlyDisplayed[1]==v2?"HIDE"!=action&&1==config.highLightFullLine&&currentlyDisplayed[0]!=v1&&(-1!=currentlyDisplayed[0]&&(deleteOld=!0),addNew=!0):(-1!=currentlyDisplayed[0]&&(deleteOld=!0),addNew=!0),deleteOld)for(redisplay=!0,i=data.special.length-1;i>=0;i--)"highLight"==data.special[i].typespecial&&data.special.splice(i,1);if(addNew)if(redisplay=!0,"undefined"==typeof data.special&&(data.special=[]),"group"==config.highLightFullLine){for(j=0;j<data.datasets.length;j++)if(0!=data.datasets[j].mouseDetection){output="";for(property in config.highLightSet)""!=output&&(output+=","),output+="string"==typeof config.highLightSet[property]?property+': "'+config.highLightSet[property]+'"':property+": "+config.highLightSet[property];eval("data.special[data.special.length]={"+output+"};"),data.special[data.special.length-1].posi=j,data.special[data.special.length-1].posj=v2,data.special[data.special.length-1].typespecial="highLight"}}else if(1==config.highLightFullLine){if(0!=data.datasets[v1].mouseDetection)for(j=0;j<data.datasets[v1].data.length;j++){output="";for(property in config.highLightSet)""!=output&&(output+=","),output+="string"==typeof config.highLightSet[property]?property+': "'+config.highLightSet[property]+'"':property+": "+config.highLightSet[property];eval("data.special[data.special.length]={"+output+"};"),data.special[data.special.length-1].posi=v1,data.special[data.special.length-1].posj=j,data.special[data.special.length-1].typespecial="highLight"}}else if(0!=data.datasets[v1].mouseDetection){output="";for(property in config.highLightSet)""!=output&&(output+=","),output+="string"==typeof config.highLightSet[property]?property+': "'+config.highLightSet[property]+'"':property+": "+config.highLightSet[property];eval("data.special[data.special.length]={"+output+"};"),data.special[data.special.length-1].posi=v1,data.special[data.special.length-1].posj=v2,data.special[data.special.length-1].typespecial="highLight"}1==redisplay&&updateChart(ctx,data,config,!1,config.highLightRerunEndFunction)}}function doMouseAction(event,ctx,action){function isAction(a,e){return a==e||"mousemove"==a&&("mousewheel"==e||"mouseout"==e)}function runFunction(a){var e;for(e=0;e<pieceOfChartFound.length;e++)a(event,ctx,config,data,pieceOfChartFound[e].myStatData);for(e=0;e<textOnChartFound.length;e++)a(event,ctx,config,data,{type:"CLICKONTEXT",values:jsTextMousePos[ctx.ChartNewId][textOnChartFound[e]]});0==pieceOfChartFound.length&&0==textOnChartFound.length&&a(event,ctx,config,data,null)}if(9==ctx.firstPass&&("mousedown"==action&&(action=action+" "+event.which),!(ctx.mouseAction.indexOf(action)<0))){var config=mouseActionData[ctx.ChartNewId].config,data=mouseActionData[ctx.ChartNewId].data,i,prevShown,prevShowSaved,inRect,P12,D12,D34,P13,D13,D24,y1,y2,y3,y4,pieceOfChartFound=[],textOnChartFound=[],distance,angle,topY,bottomY,leftX,rightX,mousewheelevt=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel",canvas_pos=getMousePos(ctx.canvas,event),realAction,annotateDIV,showDiv;for(realAction="mousedown 1"==action?"mousedown left":"mousedown 2"==action?"mousedown middle":"mousedown 3"==action?"mousedown right":action==mousewheelevt?"mousewheel":action,i=0;i<jsGraphAnnotate[ctx.ChartNewId].length;i++)if("ARC"==jsGraphAnnotate[ctx.ChartNewId][i][0])myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]],distance=Math.sqrt((canvas_pos.x-myStatData.midPosX)*(canvas_pos.x-myStatData.midPosX)+(canvas_pos.y-myStatData.midPosY)*(canvas_pos.y-myStatData.midPosY)),distance>myStatData.int_radius&&distance<myStatData.radiusOffset&&(angle=(Math.acos((canvas_pos.x-myStatData.midPosX)/distance)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),canvas_pos.y<myStatData.midPosY&&(angle=-angle),angle=((angle+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),myStatData.startAngle=((myStatData.startAngle+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),myStatData.endAngle=((myStatData.endAngle+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),myStatData.endAngle<myStatData.startAngle&&(myStatData.endAngle+=2*Math.PI),(angle>myStatData.startAngle&&angle<myStatData.endAngle||angle>myStatData.startAngle-2*Math.PI&&angle<myStatData.endAngle-2*Math.PI||angle>myStatData.startAngle+2*Math.PI&&angle<myStatData.endAngle+2*Math.PI)&&(myStatData.graphPosX=canvas_pos.x,myStatData.graphPosY=canvas_pos.y,pieceOfChartFound[pieceOfChartFound.length]={piece:i,myStatData:myStatData}));else if("MARC"==jsGraphAnnotate[ctx.ChartNewId][i][0])myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]],distance=Math.sqrt((canvas_pos.x-myStatData.midPosX)*(canvas_pos.x-myStatData.midPosX)+(canvas_pos.y-myStatData.midPosY)*(canvas_pos.y-myStatData.midPosY)),distance>myStatData.int_radius&&distance<myStatData.radiusOffset&&(angle=(Math.acos((canvas_pos.x-myStatData.midPosX)/distance)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),canvas_pos.y<myStatData.midPosY&&(angle=-angle),angle=((angle+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),myStatData.startAngle=((myStatData.startAngle+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),myStatData.endAngle=((myStatData.endAngle+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),myStatData.endAngle<myStatData.startAngle&&(myStatData.endAngle+=2*Math.PI),(angle>myStatData.startAngle&&angle<myStatData.endAngle||angle>myStatData.startAngle-2*Math.PI&&angle<myStatData.endAngle-2*Math.PI||angle>myStatData.startAngle+2*Math.PI&&angle<myStatData.endAngle+2*Math.PI)&&(myStatData.graphPosX=canvas_pos.x,myStatData.graphPosY=canvas_pos.y,pieceOfChartFound[pieceOfChartFound.length]={piece:i,myStatData:myStatData}));else if("RECT"==jsGraphAnnotate[ctx.ChartNewId][i][0])myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]],topY=Math.max(myStatData.yPosBottom,myStatData.yPosTop),bottomY=Math.min(myStatData.yPosBottom,myStatData.yPosTop),topY-bottomY<config.annotateBarMinimumDetectionHeight&&(topY=(topY+bottomY+config.annotateBarMinimumDetectionHeight)/2,bottomY=topY-config.annotateBarMinimumDetectionHeight),leftX=Math.min(myStatData.xPosLeft,myStatData.xPosRight),rightX=Math.max(myStatData.xPosLeft,myStatData.xPosRight),rightX-leftX<config.annotateBarMinimumDetectionHeight&&(rightX=(rightX+leftX+config.annotateBarMinimumDetectionHeight)/2,leftX=rightX-config.annotateBarMinimumDetectionHeight),canvas_pos.x>leftX&&canvas_pos.x<rightX&&canvas_pos.y<topY&&canvas_pos.y>bottomY&&(myStatData.graphPosX=canvas_pos.x,myStatData.graphPosY=canvas_pos.y,pieceOfChartFound[pieceOfChartFound.length]={piece:i,myStatData:myStatData});else if("POINT"==jsGraphAnnotate[ctx.ChartNewId][i][0]){if(myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]],config.detectAnnotateOnFullLine)if(canvas_pos.x<Math.min(myStatData.annotateStartPosX,myStatData.annotateEndPosX)-Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)||canvas_pos.x>Math.max(myStatData.annotateStartPosX,myStatData.annotateEndPosX)+Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)||canvas_pos.y<Math.min(myStatData.annotateStartPosY,myStatData.annotateEndPosY)-Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)||canvas_pos.y>Math.max(myStatData.annotateStartPosY,myStatData.annotateEndPosY)+Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius))distance=Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)+1;else if("undefined"==typeof myStatData.D1A)distance=Math.abs(canvas_pos.x-myStatData.posX);else if("undefined"==typeof myStatData.D2A)distance=Math.abs(canvas_pos.y-myStatData.posY);else{var D2B=-myStatData.D2A*canvas_pos.x+canvas_pos.y,g=-(myStatData.D1B-D2B)/(myStatData.D1A-myStatData.D2A),h=myStatData.D2A*g+D2B;distance=Math.sqrt((canvas_pos.x-g)*(canvas_pos.x-g)+(canvas_pos.y-h)*(canvas_pos.y-h))}else distance=Math.sqrt((canvas_pos.x-myStatData.posX)*(canvas_pos.x-myStatData.posX)+(canvas_pos.y-myStatData.posY)*(canvas_pos.y-myStatData.posY));distance<Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)&&(myStatData.graphPosX=canvas_pos.x,myStatData.graphPosY=canvas_pos.y,pieceOfChartFound[pieceOfChartFound.length]={piece:i,myStatData:myStatData})}if(config.detectMouseOnText)for(i=0;i<jsTextMousePos[ctx.ChartNewId].length;i++)inRect=!0,Math.abs(jsTextMousePos[ctx.ChartNewId][i][3].p1-jsTextMousePos[ctx.ChartNewId][i][3].p2)<config.zeroValue?(canvas_pos.x<Math.min(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p2)&&(inRect=!1),canvas_pos.x>Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p2)&&(inRect=!1),canvas_pos.y<Math.min(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3)&&(inRect=!1),canvas_pos.y>Math.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3)&&(inRect=!1)):Math.abs(jsTextMousePos[ctx.ChartNewId][i][2].p1-jsTextMousePos[ctx.ChartNewId][i][2].p2)<config.zeroValue?(canvas_pos.x<Math.min(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p3)&&(inRect=!1),canvas_pos.x>Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p3)&&(inRect=!1),canvas_pos.y<Math.min(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2)&&(inRect=!1),canvas_pos.y>Math.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2)&&(inRect=!1)):(P12=Math.tan(jsTextMousePos[ctx.ChartNewId][i][4]),D12=jsTextMousePos[ctx.ChartNewId][i][3].p1-P12*jsTextMousePos[ctx.ChartNewId][i][2].p1,D34=jsTextMousePos[ctx.ChartNewId][i][3].p3-P12*jsTextMousePos[ctx.ChartNewId][i][2].p3,P13=-1/P12,D13=jsTextMousePos[ctx.ChartNewId][i][3].p1-P13*jsTextMousePos[ctx.ChartNewId][i][2].p1,D24=jsTextMousePos[ctx.ChartNewId][i][3].p4-P13*jsTextMousePos[ctx.ChartNewId][i][2].p4,y1=P12*canvas_pos.x+D12,y2=P12*canvas_pos.x+D34,y3=P13*canvas_pos.x+D13,y4=P13*canvas_pos.x+D24,canvas_pos.y<Math.min(y1,y2)&&(inRect=!1),canvas_pos.y>Math.max(y1,y2)&&(inRect=!1),canvas_pos.y<Math.min(y3,y4)&&(inRect=!1),canvas_pos.y>Math.max(y3,y4)&&(inRect=!1)),inRect&&(textOnChartFound[textOnChartFound.length]=i);config.savePng&&isAction(config.savePngFunction,realAction)&&saveCanvas(ctx,data,config);var whoToReferAnnotate=-1,whoToReferHighLight=-1,referAnnotateIsPoint=!1,referHighLightIsPoint=!1;for(i=pieceOfChartFound.length-1;i>=0;i--)jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[i].piece][4]&&0==referAnnotateIsPoint&&(-1==whoToReferAnnotate&&(whoToReferAnnotate=i),"POINT"==jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[i].piece][0]&&(whoToReferAnnotate=i,referAnnotateIsPoint=!0)),0==referHighLightIsPoint&&(-1==whoToReferHighLight&&(whoToReferHighLight=i),"POINT"==jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[i].piece][0]&&(whoToReferHighLight=i,referHighLightIsPoint=!0));if(config.annotateDisplay&&isAction(config.annotateFunction,realAction)&&(annotateDIV=document.getElementById("divCursor"),annotateDIV.style.display="none",pieceOfChartFound.length>0)){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?"":Math.ceil(ctx.chartTextScale*config.annotateFontSize).toString()+"pt",annotateDIV.style.fontStyle=config.annotateClassName?"":config.annotateFontStyle,annotateDIV.style.zIndex=999,ctx.save(),ctx.font=annotateDIV.style.fontStyle+" "+annotateDIV.style.fontSize+" "+annotateDIV.style.fontFamily;var rect=ctx.canvas.getBoundingClientRect();if(showDiv=!1,-1!=whoToReferAnnotate&&jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][4]){if("ARC"==jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][0]?dispString=tmplbis(setOptionValue(!0,!0,1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][3],void 0,config.annotateLabel,"annotateLabel",jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][1],-1,{otherVal:!0}),pieceOfChartFound[whoToReferAnnotate].myStatData,config):dispString=tmplbis(setOptionValue(!0,!0,1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][3],void 0,config.annotateLabel,"annotateLabel",jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][1],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][2],{otherVal:!0}),pieceOfChartFound[whoToReferAnnotate].myStatData,config),textMsr=ctx.measureTextMultiLine(dispString,1*annotateDIV.style.fontSize.replace("pt","")),ctx.restore(),annotateDIV.innerHTML=dispString,x=bw.ns4||bw.ns5?event.pageX:event.x,y=bw.ns4||bw.ns5?event.pageY:event.y,(bw.ie4||bw.ie5)&&(y+=eval(scrolled)),config.annotateRelocate===!0){var relocateX,relocateY;relocateX=0,relocateY=0,x+fromLeft+textMsr.textWidth>window.innerWidth-rect.left-fromLeft&&(relocateX=-textMsr.textWidth),y+fromTop+textMsr.textHeight>1*window.innerHeight-1*rect.top+fromTop&&(relocateY-=textMsr.textHeight+2*fromTop),oCursor.moveIt(Math.max(8-rect.left,x+fromLeft+relocateX),Math.max(8-rect.top,y+fromTop+relocateY))}else oCursor.moveIt(x+fromLeft,y+fromTop);annotateDIV.style.display="",showDiv=!0}}0==inMouseAction[ctx.ChartNewId]&&mouseActionData[ctx.ChartNewId].prevShow>=0&&isAction("mousemove",realAction)&&(0==pieceOfChartFound.length||mouseActionData[ctx.ChartNewId].prevShow!=pieceOfChartFound[pieceOfChartFound.length-1].piece)&&(inMouseAction[ctx.ChartNewId]=!0,prevShow=mouseActionData[ctx.ChartNewId].prevShow,mouseActionData[ctx.ChartNewId].prevShow=-1,config.highLight&&isAction(config.highLightMouseFunction,realAction)&&0==pieceOfChartFound.length&&highLightAction("HIDE",ctx,data,config,null,null),"function"==typeof config.annotateFunctionOut&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][prevShow][0]?config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][prevShow][3],jsGraphAnnotate[ctx.ChartNewId][prevShow][1],-1,null):config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][prevShow][3],jsGraphAnnotate[ctx.ChartNewId][prevShow][1],jsGraphAnnotate[ctx.ChartNewId][prevShow][2],null)),inMouseAction[ctx.ChartNewId]=!1),pieceOfChartFound.length>0&&0==inMouseAction[ctx.ChartNewId]&&mouseActionData[ctx.ChartNewId].prevShow!=pieceOfChartFound[whoToReferHighLight].piece&&isAction("mousemove",realAction)&&(inMouseAction[ctx.ChartNewId]=!0,prevShow=mouseActionData[ctx.ChartNewId].prevShow,config.highLight&&isAction(config.highLightMouseFunction,realAction)&&-1!=whoToReferHighLight&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][0]?highLightAction("ARC",ctx,data,config,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][1],-1):highLightAction(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][0],ctx,data,config,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][1],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][2])),"function"==typeof config.annotateFunctionIn&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][0]?config.annotateFunctionIn("INANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][3],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][1],-1,null):config.annotateFunctionIn("INANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][3],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][1],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][2],null)),inMouseAction[ctx.ChartNewId]=!1,mouseActionData[ctx.ChartNewId].prevShow=pieceOfChartFound[whoToReferHighLight].piece),config.highLight&&isAction(config.highLightMouseFunction,realAction)&&0==isAction("mousemove",realAction)&&(0==pieceOfChartFound.length?highLightAction("HIDE",ctx,data,config,null,null):-1!=whoToReferHighLight&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][0]?highLightAction("ARC",ctx,data,config,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][1],-1):highLightAction(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][0],ctx,data,config,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][1],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][2]))),"function"==typeof config.mouseMove&&isAction("mousemove",realAction)&&runFunction(config.mouseMove),"function"==typeof config.mouseDownLeft&&isAction("mousedown left",realAction)&&runFunction(config.mouseDownLeft),"function"==typeof config.mouseDownRight&&isAction("mousedown right",realAction)&&runFunction(config.mouseDownRight),"function"==typeof config.mouseDownMiddle&&isAction("mousedown middle",realAction)&&runFunction(config.mouseDownMiddle),"function"==typeof config.mouseWheel&&isAction("mousewheel",realAction)&&runFunction(config.mouseWheel),"function"==typeof config.mouseOut&&isAction("mouseout",realAction)&&runFunction(config.mouseOut),"function"==typeof config.mouseDblClick&&isAction("dblclick",realAction)&&runFunction(config.mouseDblClick)}}function animationCorrection(a,e,t,i,l,n){var o=a,s=0;if(0>l)if(i<1*t.animationStartWithData-1)o=1;else switch(t.animationByDataset){case"ByArc":o=a;break;case!0:o=a;break;case!1:default:o=a}else{var r=Math.max(1,t.animationStartWithDataset),c=Math.max(1,t.animationStartWithData);if(i<1*t.animationStartWithDataset-1)o=1;else if(l<1*t.animationStartWithData-1)o=1;else{var h=0;if(t.animationLeftToRight)for(var d=0;d<e.datasets.length;d++)h=Math.max(h,e.datasets[d].data.length);switch(t.animationByDataset){case!0:switch(t.animationLeftToRight){case!0:var u=(i-(r-1))*(h-(c-1))+(l-(c-1));h=(h-(c-1))*(e.datasets.length-(r-1)),u/h>a?(o=0,n&&l+1==c&&(o=1)):(u+1)/h>a?(o=(a-u/h)*h,n&&(s=o,o=1)):o=1;break;case!1:default:o=a<(i-(r-1))/(e.datasets.length-(r-1))?.001:a<(i-(r-1)+1)/(e.datasets.length-(r-1))?(e.datasets.length-(r-1))*(a-(i-(r-1))/(e.datasets.length-(r-1))):1}break;case!1:default:switch(t.animationLeftToRight){case!0:var u=l-(c-1);h-=c-1,u/h>a?o=0:(u+1)/h>a?(o=(a-u/h)*h,n&&(s=o,o=1)):o=1;break;case!1:default:o=a}}}}return{mainVal:o,subVal:s,animVal:o+s}}function showLabels(a,e,t,i){var l=setOptionValue(!0,!0,1,"SHOWLABEL",a,e,void 0,void 0,t.showXLabels,"showXLabels",i,-1,void 0,{labelValue:fmtChartJS(t,e.labels[i],t.fmtXLabel),unformatedLabelValue:e.labels[i]});return"number"==typeof l&&(l=i>=t.firstLabelToShow-1&&(i+t.firstLabelToShow-1)%parseInt(l)==0?!0:!1),l}function showYLabels(a,e,t,i,l){var n=setOptionValue(!0,!0,1,"SHOWYLABEL",a,e,void 0,void 0,t.showYLabels,"showYLabels",-1,i,void 0,{labelValue:l});return"number"==typeof n&&(n=i>=t.firstYLabelToShow-1&&(i+t.firstYLabelToShow-1)%parseInt(n)==0?!0:!1),n}function drawLegend(a,e,t,i,l){var n;1==t.legendBorders&&(i.save(),i.setLineDash(lineStyleFn(t.legendBordersStyle)),i.beginPath(),i.lineWidth=Math.ceil(i.chartLineScale*t.legendBordersWidth),i.strokeStyle=t.legendBordersColors,i.moveTo(a.xLegendBorderPos,a.yLegendBorderPos),i.lineTo(a.xLegendBorderPos,a.yLegendBorderPos+a.legendBorderHeight),i.lineTo(a.xLegendBorderPos+a.legendBorderWidth,a.yLegendBorderPos+a.legendBorderHeight),i.lineTo(a.xLegendBorderPos+a.legendBorderWidth,a.yLegendBorderPos),i.lineTo(a.xLegendBorderPos,a.yLegendBorderPos),i.stroke(),i.closePath(),i.setLineDash([]),i.fillStyle="rgba(0,0,0,0)",i.fillStyle=t.legendFillColor,i.fill(),i.restore()),nbcols=a.nbLegendCols-1,ypos=a.yFirstLegendTextPos-(Math.ceil(i.chartTextScale*t.legendFontSize)+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenTextVertical)),xpos=0,a.drawLegendOnData?fromi=e.datasets.length:fromi=e.length;for(var o=fromi-1;o>=0;o--)if(orderi=o,a.reverseLegend&&(a.drawLegendOnData?orderi=e.datasets.length-o-1:orderi=e.length-o-1),a.drawLegendOnData?tpof=typeof e.datasets[orderi].title:tpof=typeof e[orderi].title,"string"==tpof&&(n=a.drawLegendOnData?fmtChartJS(t,e.datasets[orderi].title,t.fmtLegend).trim():fmtChartJS(t,e[orderi].title,t.fmtLegend).trim(),
""!=n)){nbcols++,nbcols==a.nbLegendCols?(nbcols=0,xpos=a.xFirstLegendTextPos,ypos+=Math.ceil(i.chartTextScale*t.legendFontSize)+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenTextVertical)):xpos+=a.widestLegend+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenTextHorizontal),i.save(),i.beginPath();var s=a.legendBox;if(("Bar"==i.tpchart||"StackedBar"==i.tpchart)&&("Line"!=e.datasets[orderi].type||t.datasetFill&&1!=setOptionValue(!0,!1,1,"LINKTYPE",i,e,void 0,e.datasets[orderi].linkType,t.linkType,"linkType",orderi,-1,{nullvalue:null})||(s=!1)),s)a.drawLegendOnData?i.lineWidth=Math.ceil(i.chartLineScale*setOptionValue(!0,!1,1,"LINEWIDTH",i,e,void 0,e.datasets[orderi].datasetStrokeWidth,t.datasetStrokeWidth,"datasetStrokeWidth",orderi,-1,{nullvalue:null})):i.lineWidth=Math.ceil(i.chartLineScale*t.datasetStrokeWidth),i.beginPath(),a.drawLegendOnData?(i.strokeStyle=setOptionValue(!0,!1,1,"LEGENDSTROKECOLOR",i,e,void 0,e.datasets[orderi].strokeColor,t.defaultFillColor,"strokeColor",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)}),i.setLineDash(lineStyleFn(setOptionValue(!0,!1,1,"LEGENDLINEDASH",i,e,void 0,e.datasets[orderi].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)})))):(i.strokeStyle=setOptionValue(!0,!1,1,"LEGENDSTROKECOLOR",i,e,void 0,e[orderi].strokeColor,t.defaultFillColor,"strokeColor",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)}),i.setLineDash(lineStyleFn(setOptionValue(!0,!1,1,"LEGENDSEGMENTTROKESTYLE",i,e,void 0,e[orderi].segmentStrokeStyle,t.segmentStrokeStyle,"segmentStrokeStyle",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)})))),i.moveTo(xpos,ypos),i.lineTo(xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),ypos),i.lineTo(xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),ypos-Math.ceil(i.chartTextScale*t.legendFontSize)),i.lineTo(xpos,ypos-Math.ceil(i.chartTextScale*t.legendFontSize)),i.lineTo(xpos,ypos),i.stroke(),i.closePath(),a.drawLegendOnData?i.fillStyle=setOptionValue(!0,!1,1,"LEGENDFILLCOLOR",i,e,void 0,e.datasets[orderi].fillColor,t.defaultFillColor,"fillColor",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)}):i.fillStyle=setOptionValue(!0,!1,1,"LEGENDFILLCOLOR",i,e,void 0,e[orderi].color,t.defaultFillColor,"color",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)}),i.fill();else{if(i.lineWidth=t.legendColorIndicatorStrokeWidth?t.legendColorIndicatorStrokeWidth:Math.ceil(i.chartLineScale*setOptionValue(!0,!1,1,"LINEWIDTH",i,e,void 0,e.datasets[orderi].datasetStrokeWidth,t.datasetStrokeWidth,"datasetStrokeWidth",orderi,-1,{nullvalue:null})),t.legendColorIndicatorStrokeWidth&&t.legendColorIndicatorStrokeWidth>Math.ceil(i.chartTextScale*t.legendFontSize)&&(i.lineWidth=Math.ceil(i.chartTextScale*t.legendFontSize)),a.drawLegendOnData?(i.strokeStyle=setOptionValue(!0,!1,1,"LEGENDSTROKECOLOR",i,e,void 0,e.datasets[orderi].strokeColor,t.defaultFillColor,"strokeColor",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)}),i.setLineDash(lineStyleFn(setOptionValue(!0,!1,1,"LEGENDLINEDASH",i,e,void 0,e.datasets[orderi].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)})))):(i.strokeStyle=setOptionValue(!0,!1,1,"LEGENDSTROKECOLOR",i,e,void 0,e[orderi].strokeColor,t.defaultFillColor,"strokeColor",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)}),i.setLineDash(lineStyleFn(setOptionValue(!0,!1,1,"LEGENDSEGMENTTROKESTYLE",i,e,void 0,e[orderi].segmentStrokeStyle,t.segmentStrokeStyle,"segmentStrokeStyle",orderi,-1,{animationValue:1,xPosLeft:xpos,yPosBottom:ypos,xPosRight:xpos+Math.ceil(i.chartTextScale*t.legendBlockSize),yPosTop:ypos-Math.ceil(i.chartTextScale*t.legendFontSize)})))),i.moveTo(xpos+2,ypos-Math.ceil(i.chartTextScale*t.legendFontSize)/2),i.lineTo(xpos+2+Math.ceil(i.chartTextScale*t.legendBlockSize),ypos-Math.ceil(i.chartTextScale*t.legendFontSize)/2),i.stroke(),i.fill(),t.pointDot){i.beginPath(),i.fillStyle=setOptionValue(!0,!1,1,"LEGENDMARKERFILLCOLOR",i,e,void 0,e.datasets[orderi].pointColor,t.defaultStrokeColor,"pointColor",orderi,-1,{nullvalue:!0}),i.strokeStyle=setOptionValue(!0,!1,1,"LEGENDMARKERSTROKESTYLE",i,e,void 0,e.datasets[orderi].pointStrokeColor,t.defaultStrokeColor,"pointStrokeColor",orderi,-1,{nullvalue:!0}),i.lineWidth=setOptionValue(!0,!1,i.chartLineScale,"LEGENDMARKERLINEWIDTH",i,e,void 0,e.datasets[orderi].pointDotStrokeWidth,t.pointDotStrokeWidth,"pointDotStrokeWidth",orderi,-1,{nullvalue:!0});var r=setOptionValue(!0,!1,1,"LEGENDMARKERSHAPE",i,e,void 0,e.datasets[orderi].markerShape,t.markerShape,"markerShape",orderi,-1,{nullvalue:!0}),c=setOptionValue(!0,!1,i.chartSpaceScale,"LEGENDMARKERRADIUS",i,e,void 0,e.datasets[orderi].pointDotRadius,t.pointDotRadius,"pointDotRadius",orderi,-1,{nullvalue:!0}),h=setOptionValue(!0,!1,1,"LEGENDMARKERSTROKESTYLE",i,e,void 0,e.datasets[orderi].pointDotStrokeStyle,t.pointDotStrokeStyle,"pointDotStrokeStyle",orderi,-1,{nullvalue:!0});drawMarker(i,xpos+2+Math.ceil(i.chartTextScale*t.legendBlockSize)/2,ypos-Math.ceil(i.chartTextScale*t.legendFontSize)/2,r,c,h)}i.fill()}i.restore(),i.save(),i.beginPath(),i.font=t.legendFontStyle+" "+Math.ceil(i.chartTextScale*t.legendFontSize).toString()+"px "+t.legendFontFamily,i.fillStyle=setOptionValue(!0,!1,1,"LEGENDFONTCOLOR",i,e,void 0,void 0,t.legendFontColor,"legendFontColor",orderi,-1,{nullvalue:!0}),i.textAlign="left",i.textBaseline="bottom",i.translate(xpos+Math.ceil(i.chartTextScale*t.legendBlockSize)+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenBoxAndText),ypos),i.fillTextMultiLine(n,0,0,i.textBaseline,Math.ceil(i.chartTextScale*t.legendFontSize),!0,t.detectMouseOnText,i,"LEGEND_TEXTMOUSE",0,xpos+Math.ceil(i.chartTextScale*t.legendBlockSize)+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenBoxAndText),ypos,orderi,-1),i.restore()}}function drawMarker(a,e,t,i,l,n){switch(a.setLineDash(lineStyleFn(n)),i){case"square":a.rect(e-l,t-l,2*l,2*l),a.stroke(),a.fill(),a.setLineDash([]);break;case"triangle":pointA_x=0,pointA_y=2/3*l,a.moveTo(e,t-pointA_y),a.lineTo(e+pointA_y*Math.sin(4/3),t+pointA_y*Math.cos(4/3)),a.lineTo(e-pointA_y*Math.sin(4/3),t+pointA_y*Math.cos(4/3)),a.lineTo(e,t-pointA_y),a.stroke(),a.fill(),a.setLineDash([]);break;case"diamond":a.moveTo(e,t+l),a.lineTo(e+l,t),a.lineTo(e,t-l),a.lineTo(e-l,t),a.lineTo(e,t+l),a.stroke(),a.fill(),a.setLineDash([]);break;case"plus":a.moveTo(e,t-l),a.lineTo(e,t+l),a.moveTo(e-l,t),a.lineTo(e+l,t),a.stroke(),a.setLineDash([]);break;case"cross":a.moveTo(e-l,t-l),a.lineTo(e+l,t+l),a.moveTo(e-l,t+l),a.lineTo(e+l,t-l),a.stroke(),a.setLineDash([]);break;case"circle":default:a.arc(e,t,l,0,2*Math.PI*1,!0),a.stroke(),a.fill(),a.setLineDash([])}}function initPassVariableData_part1(a,e,t){var i,l,n,o,s,r,c,h,d,u,p,S,g,f,A,x,m,D,P,M,T,v,y,L;switch(n=[],o=[],o[0]=[],o[1]=[],s=[],s[0]=[],s[1]=[],r=[],r[0]=[],r[1]=[],c=[],c[0]=[],c[1]=[],h=[],h[0]=[],h[1]=[],d=[],d[0]=[],d[1]=[],S=[],g=[],f=[],A=[],x=[],S[0]=[],S[1]=[],m=0,P=[],M=[],T=[],v=[],y=[],t.tpchart){case"PolarArea":var V,b;for(V=[],b=[],i=0;i<a.datasets.length;i++)for(l=0;l<a.labels.length;l++)0==i&&(V[l]=0),"undefined"!=typeof a.datasets[i].data[l]&&V[l]++;var O=0,I=0;for(l=0;l<a.labels.length;l++)b[l]=I,O=Math.max(V[l],O),V[l]>0&&I++,v[l]=0,y[l]=1;var G=1;break;case"Doughnut":case"Pie":var B,R,G=0,N=0;for(l=0;l<a.labels.length;l++)B=setOptionValue(!0,!0,1,"RADIUSSPACEWEIGHT",t,a,null,a.radiusSpaceWeight,e.radiusSpaceWeight,"radiusSpaceWeight",l,-1,{nullvalue:null}),R=setOptionValue(!0,!0,1,"RADIUSDATAWEIGHT",t,a,null,a.radiusDataWeight,e.radiusDataWeight,"radiusDataWeight",l,-1,{nullvalue:null}),0!=l&&(N+=B,G+=B),v[l]=N,G+=R,y[l]=G,N+=R}for(i=0;i<a.datasets.length;i++){if("undefined"!=typeof a.datasets[i].xPos&&"Line"==tpdraw(t,a.datasets[i]))for(l=a.datasets[i].data.length;l<a.datasets[i].xPos.length;l++)a.datasets[i].data.push(void 0);else for(l=a.datasets[i].data.length;l<a.labels.length;l++)a.datasets[i].data.push(void 0);for(L=2==a.datasets[i].axis?0:1,n[i]=[],h[0][i]=-Number.MAX_VALUE,h[1][i]=-Number.MAX_VALUE,d[0][i]=Number.MAX_VALUE,d[1][i]=Number.MAX_VALUE,g[i]=-1,f[i]=-1,l=0;l<a.datasets[i].data.length;l++){"undefined"==typeof A[l]&&(A[l]=-1,x[l]=-1,c[0][l]=0,o[0][l]=-Number.MAX_VALUE,s[0][l]=Number.MAX_VALUE,c[1][l]=0,o[1][l]=-Number.MAX_VALUE,s[1][l]=Number.MAX_VALUE);var C=!0;"Doughnut"==t.tpchart?(0==setOptionValue(!1,!0,1,"DISPLAYDATA",t,a,null,a.datasets[i].displayData,e.displayData,"displayData",i,l,{nullvalue:null})&&(C=!1),0==setOptionValue(!1,!0,1,"DISPLAYDATA",t,a,null,a.displayData,e.displayData,"displayData",-1,l,{nullvalue:null})&&(C=!1)):(0==setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,null,a.datasets[i].displayData,e.displayData,"displayData",i,l,{nullvalue:null})&&(C=!1),0==setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,null,a.displayData,e.displayData,"displayData",l,-1,{nullvalue:null})&&(C=!1)),"undefined"==typeof a.datasets[i].data[l]&&(C=!1),1==C&&(m+=1*a.datasets[i].data[l],-1==g[i]&&(g[i]=l),f[i]=l,-1==A[l]&&(A[l]=i),x[l]=i,c[L][l]+=1*a.datasets[i].data[l],o[L][l]=Math.max(o[L][l],1*a.datasets[i].data[l]),s[L][l]=Math.min(s[L][l],1*a.datasets[i].data[l]),h[L][i]=Math.max(h[L][i],1*a.datasets[i].data[l]),d[L][i]=Math.min(d[L][i],1*a.datasets[i].data[l]))}}for(i=0;i<a.datasets.length;i++){L=2==a.datasets[i].axis?0:1,u="string"==typeof a.datasets[i].title?a.datasets[i].title.trim():"";var w=-1,H=-1;for(l=0;l<a.datasets[i].data.length;l++){"undefined"==typeof r[0][l]&&(r[0][l]=0,S[0][l]=-1,r[1][l]=0,S[1][l]=-1),p="","undefined"!=typeof a.datasets[i].xPos&&"undefined"!=typeof a.datasets[i].xPos[l]&&(p=a.datasets[i].xPos[l]),""==p&&"undefined"!=typeof a.labels[l]&&(p=a.labels[l]),"string"==typeof p&&(p=p.trim());var C=!0;if("Line"==tpdraw(t,a.datasets[i])&&(0==setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,null,a.datasets[i].displayData,e.displayData,"displayData",i,l,{nullvalue:null})&&(C=!1),0==setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,null,a.displayData,e.displayData,"displayData",l,-1,{nullvalue:null})&&(C=!1)),"undefined"==typeof a.datasets[i].data[l]&&(C=!1),C){switch(r[L][l]+=1*a.datasets[i].data[l],tpdraw(t,a.datasets[i])){case"PolarArea":case"Doughnut":case"Pie":if(0==i){if(0==l){var F=((e.totalAmplitude*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);F<=e.zeroValue&&(F=2*Math.PI)}M[l]=((-e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),T[l]=((e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),"PolarArea"==t.tpchart&&(M[l]+=b[l]*(F/I),T[l]-=b[l]*(F/I)),P[l]=M[l]}D="PolarArea"==t.tpchart?V[l]>0?F/I/V[l]:0:1*a.datasets[i].data[l]/c[L][l]*F,D>=2*Math.PI&&(D=2*Math.PI-.001),n[i][l]={config:e,v1:fmtChartJS(e,u,e.fmtV1),v2:fmtChartJS(e,p,e.fmtV2),v3:fmtChartJS(e,1*a.datasets[i].data[l],e.fmtV3),v4:fmtChartJS(e,r[L][l],e.fmtV4),v5:fmtChartJS(e,c[L][l],e.fmtV5),v6:roundToWithThousands(e,fmtChartJS(e,100*a.datasets[i].data[l]/c[L][l],e.fmtV6),e.roundPct),v6T:roundToWithThousands(e,fmtChartJS(e,100*a.datasets[i].data[l]/m,e.fmtV6T),e.roundPct),v7:0,v8:0,v9:0,v10:0,v11:fmtChartJS(e,i,e.fmtV11),v12:fmtChartJS(e,l,e.fmtV12),v13:fmtChartJS(e,D,e.fmtV13),v14:fmtChartJS(e,M[l],e.fmtV14),v15:fmtChartJS(e,M[l]+D,e.fmtV15),lgtxt:u,lgtxt2:p,datavalue:1*a.datasets[i].data[l],cumvalue:r[L][l],totvalue:c[L][l],pctvalue:100*a.datasets[i].data[l]/c[L][l],pctvalueT:100*a.datasets[i].data[l]/m,maxvalue:o[L][l],minvalue:s[L][l],lmaxvalue:h[L][i],lminvalue:d[L][i],grandtotal:m,firstNotMissing:A[l],lastNotMissing:x[l],prevNotMissing:w,prevMissing:H,nextNotMissing:-1,segmentAngle:D,firstAngle:P[l],startAngle:M[l],realStartAngle:T[l],endAngle:M[l]+D,radiusOffset:0,midPosX:0,midPosY:0,int_radius:0,ext_radius:0,startRadius:v[l]/G,stopRadius:y[l]/G,totRadiusWeight:G,j:l,i:i,data:a},M[l]=M[l]+D,T[l]=T[l]-D;break;case"Bar":case"StackedBar":case"HorizontalBar":case"HorizontalStackedBar":n[i][l]={config:e,v1:fmtChartJS(e,u,e.fmtV1),v2:fmtChartJS(e,p,e.fmtV2),v3:fmtChartJS(e,1*a.datasets[i].data[l],e.fmtV3),v4:fmtChartJS(e,r[L][l],e.fmtV4),v5:fmtChartJS(e,c[L][l],e.fmtV5),v6:roundToWithThousands(e,fmtChartJS(e,100*a.datasets[i].data[l]/c[L][l],e.fmtV6),e.roundPct),v6T:roundToWithThousands(e,fmtChartJS(e,100*a.datasets[i].data[l]/m,e.fmtV6T),e.roundPct),v11:fmtChartJS(e,i,e.fmtV11),v12:fmtChartJS(e,l,e.fmtV12),lgtxt:u,lgtxt2:p,datavalue:1*a.datasets[i].data[l],cumvalue:r[L][l],totvalue:c[L][l],pctvalue:100*a.datasets[i].data[l]/c[L][l],pctvalueT:100*a.datasets[i].data[l]/m,maxvalue:o[L][l],minvalue:s[L][l],lmaxvalue:h[L][i],lminvalue:d[L][i],grandtotal:m,firstNotMissing:A[l],lastNotMissing:x[l],prevNotMissing:w,prevMissing:H,nextNotMissing:-1,j:l,i:i,data:a},1*a.datasets[i].data[l]!=0||"HorizontalStackedBar"!=tpdraw(t,a.datasets[i])&&"StackedBar"!=tpdraw(t,a.datasets[i])||(n[i][l].v3="");break;case"Line":case"Radar":n[i][l]={config:e,v1:fmtChartJS(e,u,e.fmtV1),v2:fmtChartJS(e,p,e.fmtV2),v3:fmtChartJS(e,1*a.datasets[i].data[l],e.fmtV3),v5:fmtChartJS(e,1*a.datasets[i].data[l],e.fmtV5),v6:fmtChartJS(e,o[L][l],e.fmtV6),v7:fmtChartJS(e,c[L][l],e.fmtV7),v8:roundToWithThousands(e,fmtChartJS(e,100*a.datasets[i].data[l]/c[L][l],e.fmtV8),e.roundPct),v8T:roundToWithThousands(e,fmtChartJS(e,100*a.datasets[i].data[l]/m,e.fmtV8T),e.roundPct),v11:fmtChartJS(e,i,e.fmtV11),v12:fmtChartJS(e,l,e.fmtV12),lgtxt:u,lgtxt2:p,datavalue:1*a.datasets[i].data[l],diffnext:1*a.datasets[i].data[l],pctvalue:100*a.datasets[i].data[l]/c[L][l],pctvalueT:100*a.datasets[i].data[l]/m,totvalue:c[L][l],cumvalue:r[L][l],maxvalue:o[L][l],minvalue:s[L][l],lmaxvalue:h[L][i],lminvalue:d[L][i],grandtotal:m,firstNotMissing:g[i],lastNotMissing:f[i],prevNotMissing:w,prevMissing:H,nextNotMissing:-1,j:l,i:i,data:a},S[L][l]>=0?(n[i][l].v4=fmtChartJS(e,-1!=S[L][l]?1*a.datasets[i].data[l]-n[S[L][l]][l].datavalue:1*a.datasets[i].data[l],e.fmtV4),n[i][l].diffprev=-1!=S[L][l]?1*a.datasets[i].data[l]-n[S[L][l]][l].datavalue:1*a.datasets[i].data[l],n[S[L][l]][l].diffnext=a.datasets[S[L][l]].data[l]-a.datasets[i].data[l],n[S[L][l]][l].v5=n[S[L][l]][l].diffnext):n[i][l].v4=1*a.datasets[i].data[l],S[L][l]=i}if(-1!=w)for(k=w;k<l;k++)n[i][k].nextNotMissing=l;w=l}else switch(H=l,tpdraw(t,a.datasets[i])){case"PolarArea":case"Doughnut":case"Pie":if(0==i){if(0==l){var F=((e.totalAmplitude*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);F<=e.zeroValue&&(F=2*Math.PI)}M[l]=((-e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),T[l]=((e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),"PolarArea"==t.tpchart&&(M[l]+=b[l]*(F/I),T[l]-=b[l]*(F/I)),P[l]=M[l]}case"Bar":case"StackedBar":case"HorizontalBar":case"HorizontalStackedBar":n[i][l]={v1:u,lmaxvalue:h[L][i],lminvalue:d[L][i],firstNotMissing:A[l],lastNotMissing:x[l],prevNotMissing:w,prevMissing:H,grandtotal:m};break;case"Line":case"Radar":n[i][l]={v1:u,lmaxvalue:h[L][i],lminvalue:d[L][i],firstNotMissing:g[i],lastNotMissing:f[i],prevNotMissing:w,prevMissing:H,grandtotal:m}}}}return n}function initPassVariableData_part2(a,e,t,i,l){function n(a,e,i,l,o,s){if("object"==typeof i.datasets[a].xPos&&"undefined"!=typeof i.datasets[a].xPos[Math.floor(e+t.zeroValue)]){var r=o*s,c="undefined"!=typeof i.xBegin?i.xBegin:1*i.labels[0],h="undefined"!=typeof i.xEnd?i.xEnd:1*i.labels[i.labels.length-1];if(c>=h&&(h=c+100),1*i.datasets[a].xPos[Math.floor(e+t.zeroValue)]>=c&&i.datasets[a].xPos[Math.floor(e+t.zeroValue)]<=h){var d=l+r*((1*i.datasets[a].xPos[Math.floor(e+t.zeroValue)]-c)/(h-c)),u=d;return Math.abs(e-Math.floor(e+t.zeroValue))>t.zeroValue&&(u=n(a,Math.ceil(e-t.zeroValue),i)),d+(e-Math.floor(e+t.zeroValue))*(u-d)}}return l+o*e}function o(a,e,t,i){if(a)return r(c(e)*i-c(t.graphMin)*i,void 0,0);var l=t.steps*t.stepValue,n=e-t.graphMin,o=r(n/l,1,0);return i*t.steps*o}function s(a,e,t){var i=e.steps*e.stepValue,l=a-e.graphMin,n=r(l/i,1,0);return t*e.steps*n}function r(a,e,t){return isNumber(e)&&a>e?e:isNumber(t)&&t>a?t:a}function c(a){return Math.log(a)/Math.LN10}var h,d,u=0,p=new Array(e.datasets.length),S=new Array(e.datasets.length);for(h=0;h<e.datasets.length;h++)switch(tpdraw(i,e.datasets[h])){case"PolarArea":case"Pie":case"Doughnut":for(d=0;d<e.datasets[h].data.length;d++)a[h][d].v7=fmtChartJS(t,l.midPosX,t.fmtV7),a[h][d].v8=fmtChartJS(t,l.midPosY,t.fmtV8),a[h][d].v9=fmtChartJS(t,l.int_radius+(l.ext_radius-l.int_radius)*a[h][d].startRadius,t.fmtV9),a[h][d].v10=fmtChartJS(t,l.int_radius+(l.ext_radius-l.int_radius)*a[h][d].stopRadius,t.fmtV10),"PolarArea"==i.tpchart?(a[h][d].radiusOffset=o(t.logarithmic,1*e.datasets[h].data[d],l.calculatedScale,l.scaleHop),a[h][d].v10=fmtChartJS(t,a[h].radiusOffset,t.fmtV10)):(a[h][d].v10=fmtChartJS(t,l.ext_radius,t.fmtV10),a[h][d].radiusOffset=l.int_radius+(l.ext_radius-l.int_radius)*a[h][d].stopRadius),a[h][d].outerVal=l.outerVal,a[h][d].midPosX=l.midPosX,a[h][d].midPosY=l.midPosY,a[h][d].calculatedScale=l.calculatedScale,a[h][d].scaleHop=l.scaleHop,a[h][d].int_radius=l.int_radius+(l.ext_radius-l.int_radius)*a[h][d].startRadius,a[h][d].ext_radius=l.int_radius+(l.ext_radius-l.int_radius)*a[h][d].stopRadius;break;case"Line":for(d=0;d<e.datasets[h].data.length;d++)a[h][d].xAxisPosY=l.xAxisPosY,a[h][d].yAxisPosX=l.yAxisPosX,a[h][d].valueHop=l.valueHop,a[h][d].nbValueHop=l.nbValueHop,2==e.datasets[h].axis?(a[h][d].scaleHop=l.scaleHop2,a[h][d].zeroY=l.zeroY2,a[h][d].calculatedScale=l.calculatedScale2,a[h][d].logarithmic=l.logarithmic2):(a[h][d].scaleHop=l.scaleHop,a[h][d].zeroY=l.zeroY,a[h][d].calculatedScale=l.calculatedScale,a[h][d].logarithmic=l.logarithmic),a[h][d].xPos=n(h,d,e,l.yAxisPosX,l.valueHop,l.nbValueHop),a[h][d].yAxisPos=l.xAxisPosY-a[h][d].zeroY,("Bar"==i.tpchart||"StackedBar"==i.tpchart)&&(a[h][d].xPos+=l.valueHop/2,a[h][d].yAxisPosX+=l.valueHop/2),0==d?(a[h][d].lmaxvalue_offset=o(a[h][d].logarithmic,a[h][d].lmaxvalue,a[h][d].calculatedScale,a[h][d].scaleHop)-a[h][d].zeroY,a[h][d].lminvalue_offset=o(a[h][d].logarithmic,a[h][d].lminvalue,a[h][d].calculatedScale,a[h][d].scaleHop)-a[h][d].zeroY):(a[h][d].lmaxvalue_offset=a[h][0].lmaxvalue_offset,a[h][d].lminvalue_offset=a[h][0].lminvalue_offset),"undefined"!=typeof e.datasets[h].data[d]&&(a[h][d].yPosOffset=o(a[h][d].logarithmic,e.datasets[h].data[d],a[h][d].calculatedScale,a[h][d].scaleHop)-a[h][d].zeroY,a[h][d].posY=a[h][d].yAxisPos-a[h][d].yPosOffset),"object"==typeof e.datasets[h].origin&&"undefined"!=typeof e.datasets[h].origin[d]&&(a[h][d].yPosOffsetOrigin=o(a[h][d].logarithmic,e.datasets[h].origin[d],a[h][d].calculatedScale,a[h][d].scaleHop)-a[h][d].zeroY,a[h][d].posYOrigin=a[h][d].yAxisPos-a[h][d].yPosOffsetOrigin),a[h][d].posX=a[h][d].xPos,a[h][d].v9=a[h][d].xPos,a[h][d].v10=a[h][d].posY,a[h][d].annotateStartPosX=a[h][d].xPos,a[h][d].annotateEndPosX=a[h][d].xPos,a[h][d].annotateStartPosY=l.xAxisPosY,a[h][d].annotateEndPosY=l.xAxisPosY-l.msr.availableHeight,a[h][d].D1A=void 0,a[h][d].D1B=void 0;break;case"Radar":var g=2*Math.PI/e.datasets[0].data.length;for(d=0;d<e.datasets[h].data.length;d++)a[h][d].midPosX=l.midPosX,a[h][d].midPosY=l.midPosY,a[h][d].int_radius=0,a[h][d].ext_radius=l.maxSize,a[h][d].radiusOffset=l.maxSize,a[h][d].calculatedScale=l.calculatedScale,a[h][d].scaleHop=l.scaleHop,a[h][d].calculated_offset=o(t.logarithmic,e.datasets[h].data[d],l.calculatedScale,l.scaleHop),a[h][d].offsetX=Math.cos(t.startAngle*Math.PI/180-d*g)*a[h][d].calculated_offset,a[h][d].offsetY=Math.sin(t.startAngle*Math.PI/180-d*g)*a[h][d].calculated_offset,a[h][d].v9=a[h][d].midPosX+a[h][d].offsetX,a[h][d].v10=a[h][d].midPosY-a[h][d].offsetY,a[h][d].posX=a[h][d].midPosX+a[h][d].offsetX,a[h][d].posY=a[h][d].midPosY-a[h][d].offsetY,0==d?a[h][d].calculated_offset_max=o(t.logarithmic,a[h][d].lmaxvalue,l.calculatedScale,l.scaleHop):a[h][d].calculated_offset_max=a[0][d].calculated_offset_max,a[h][d].annotateStartPosX=l.midPosX,a[h][d].annotateEndPosX=l.midPosX+Math.cos(t.startAngle*Math.PI/180-d*g)*l.maxSize,a[h][d].annotateStartPosY=l.midPosY,a[h][d].annotateEndPosY=l.midPosY-Math.sin(t.startAngle*Math.PI/180-d*g)*l.maxSize,Math.abs(a[h][d].annotateStartPosX-a[h][d].annotateEndPosX)<t.zeroValue?(a[h][d].D1A=void 0,a[h][d].D1B=void 0,a[h][d].D2A=0):(a[h][d].D1A=(a[h][d].annotateStartPosY-a[h][d].annotateEndPosY)/(a[h][d].annotateStartPosX-a[h][d].annotateEndPosX),a[h][d].D1B=-a[h][d].D1A*a[h][d].annotateStartPosX+a[h][d].annotateStartPosY,Math.abs(a[h][d].D1A)>=t.zeroValue?a[h][d].D2A=-(1/a[h][d].D1A):a[h][d].D2A=void 0);break;case"Bar":for(d=0;d<e.datasets[h].data.length;d++)a[h][d].xAxisPosY=l.xAxisPosY,a[h][d].yAxisPosX=l.yAxisPosX,a[h][d].valueHop=l.valueHop,a[h][d].barWidth=l.barWidth,a[h][d].additionalSpaceBetweenBars=l.additionalSpaceBetweenBars,a[h][d].nbValueHop=l.nbValueHop,a[h][d].calculatedScale=l.calculatedScale,a[h][d].scaleHop=l.scaleHop,a[h][d].xPosLeft=l.yAxisPosX+Math.ceil(i.chartSpaceScale*t.barValueSpacing)+l.valueHop*d+l.additionalSpaceBetweenBars+l.barWidth*u+Math.ceil(i.chartSpaceScale*t.barDatasetSpacing)*u+Math.ceil(i.chartLineScale*t.barStrokeWidth)*u,a[h][d].xPosRight=a[h][d].xPosLeft+l.barWidth,2==e.datasets[h].axis?(a[h][d].yPosBottom=l.xAxisPosY-l.zeroY2,a[h][d].barHeight=o(t.logarithmic2,1*e.datasets[h].data[d],l.calculatedScale2,l.scaleHop2)-l.zeroY2):(a[h][d].yPosBottom=l.xAxisPosY-l.zeroY,a[h][d].barHeight=o(t.logarithmic,1*e.datasets[h].data[d],l.calculatedScale,l.scaleHop)-l.zeroY),a[h][d].yPosTop=a[h][d].yPosBottom-a[h][d].barHeight+Math.ceil(i.chartLineScale*t.barStrokeWidth)/2,a[h][d].v7=a[h][d].xPosLeft,a[h][d].v8=a[h][d].yPosBottom,a[h][d].v9=a[h][d].xPosRight,a[h][d].v10=a[h][d].yPosTop;u++;break;case"StackedBar":for(d=0;d<e.datasets[h].data.length;d++)a[h][d].xAxisPosY=l.xAxisPosY,a[h][d].yAxisPosX=l.yAxisPosX,a[h][d].valueHop=l.valueHop,a[h][d].barWidth=l.barWidth,a[h][d].additionalSpaceBetweenBars=l.additionalSpaceBetweenBars,a[h][d].nbValueHop=l.nbValueHop,a[h][d].calculatedScale=l.calculatedScale,a[h][d].scaleHop=l.scaleHop,"undefined"==typeof p[d]&&(p[d]=0,S[d]=0,zeroY=o(t.logarithmic,0,l.calculatedScale,l.scaleHop)),"undefined"!=typeof e.datasets[h].data[d]&&(a[h][d].xPosLeft=l.yAxisPosX+Math.ceil(i.chartSpaceScale*t.barValueSpacing)+l.valueHop*d+l.additionalSpaceBetweenBars,1*e.datasets[h].data[d]<0?(a[h][d].botval=S[d],a[h][d].topval=S[d]+1*e.datasets[h].data[d],S[d]=S[d]+1*e.datasets[h].data[d]):(a[h][d].botval=p[d],a[h][d].topval=p[d]+1*e.datasets[h].data[d],p[d]=p[d]+1*e.datasets[h].data[d]),a[h][d].xPosRight=a[h][d].xPosLeft+l.barWidth,a[h][d].botOffset=o(t.logarithmic,a[h][d].botval,l.calculatedScale,l.scaleHop),a[h][d].topOffset=o(t.logarithmic,a[h][d].topval,l.calculatedScale,l.scaleHop),a[h][d].yPosBottom=l.xAxisPosY-a[h][d].botOffset,a[h][d].yPosTop=l.xAxisPosY-a[h][d].topOffset,Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)>0&&(1*e.datasets[h].data[d]<0?(a[h][d].yPosBottom+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),S[d]==1*e.datasets[h].data[d]&&(a[h][d].yPosBottom-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),a[h][d].yPosTop<a[h][d].yPosBottom&&(a[h][d].yPosBottom=a[h][d].yPosTop)):1*e.datasets[h].data[d]>0&&(a[h][d].yPosBottom-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),p[d]==1*e.datasets[h].data[d]&&(a[h][d].yPosBottom+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),a[h][d].yPosTop>a[h][d].yPosBottom&&(a[h][d].yPosBottom=a[h][d].yPosTop))),a[h][d].v7=a[h][d].xPosLeft,a[h][d].v8=a[h][d].yPosBottom,a[h][d].v9=a[h][d].xPosRight,a[h][d].v10=a[h][d].yPosTop);break;case"HorizontalBar":for(d=0;d<e.datasets[h].data.length;d++)a[h][d].xAxisPosY=l.xAxisPosY,a[h][d].yAxisPosX=l.yAxisPosX,a[h][d].valueHop=l.valueHop,a[h][d].barWidth=l.barWidth,a[h][d].additionalSpaceBetweenBars=l.additionalSpaceBetweenBars,a[h][d].nbValueHop=l.nbValueHop,a[h][d].calculatedScale=l.calculatedScale,a[h][d].scaleHop=l.scaleHop,a[h][d].xPosLeft=l.yAxisPosX+l.zeroY,a[h][d].yPosTop=l.xAxisPosY+Math.ceil(i.chartSpaceScale*t.barValueSpacing)-l.scaleHop*(d+1)+l.additionalSpaceBetweenBars+l.barWidth*h+Math.ceil(i.chartSpaceScale*t.barDatasetSpacing)*h+Math.ceil(i.chartLineScale*t.barStrokeWidth)*h,a[h][d].yPosBottom=a[h][d].yPosTop+l.barWidth,a[h][d].barWidth=o(t.logarithmic,1*e.datasets[h].data[d],l.calculatedScale,l.valueHop)-l.zeroY,a[h][d].xPosRight=a[h][d].xPosLeft+a[h][d].barWidth,a[h][d].v7=a[h][d].xPosLeft,a[h][d].v8=a[h][d].yPosBottom,a[h][d].v9=a[h][d].xPosRight,a[h][d].v10=a[h][d].yPosTop;break;case"HorizontalStackedBar":for(d=0;d<e.datasets[h].data.length;d++)a[h][d].xAxisPosY=l.xAxisPosY,a[h][d].yAxisPosX=l.yAxisPosX,a[h][d].valueHop=l.valueHop,a[h][d].barWidth=l.barWidth,a[h][d].additionalSpaceBetweenBars=l.additionalSpaceBetweenBars,a[h][d].nbValueHop=l.nbValueHop,a[h][d].calculatedScale=l.calculatedScale,a[h][d].scaleHop=l.scaleHop,0==h&&(p[d]=0,S[d]=0),"undefined"!=typeof e.datasets[h].data[d]&&(a[h][d].xPosLeft=l.yAxisPosX+Math.ceil(i.chartSpaceScale*t.barValueSpacing)+l.valueHop*d,1*e.datasets[h].data[d]<0?(a[h][d].leftval=S[d],a[h][d].rightval=S[d]+1*e.datasets[h].data[d],S[d]=S[d]+1*e.datasets[h].data[d]):(a[h][d].leftval=p[d],a[h][d].rightval=p[d]+1*e.datasets[h].data[d],p[d]=p[d]+1*e.datasets[h].data[d]),a[h][d].rightOffset=s(a[h][d].rightval,l.calculatedScale,l.valueHop),a[h][d].leftOffset=s(a[h][d].leftval,l.calculatedScale,l.valueHop),a[h][d].xPosRight=l.yAxisPosX+a[h][d].rightOffset,a[h][d].xPosLeft=l.yAxisPosX+a[h][d].leftOffset,a[h][d].yPosTop=l.xAxisPosY+Math.ceil(i.chartSpaceScale*t.barValueSpacing)-l.scaleHop*(d+1)+l.additionalSpaceBetweenBars,a[h][d].yPosBottom=a[h][d].yPosTop+l.barWidth,Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)>0&&(1*e.datasets[h].data[d]<0?(a[h][d].xPosLeft-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),S[d]==1*e.datasets[h].data[d]&&(a[h][d].xPosLeft+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),a[h][d].xPosLeft<a[h][d].xPosRight&&(a[h][d].xPosLeft=a[h][d].xPosRight)):1*e.datasets[h].data[d]>0&&(a[h][d].xPosLeft+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),p[d]==1*e.datasets[h].data[d]&&(a[h][d].xPosLeft-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),a[h][d].xPosLeft>a[h][d].xPosRight&&(a[h][d].xPosLeft=a[h][d].xPosRight))),a[h][d].v7=a[h][d].xPosLeft,a[h][d].v8=a[h][d].yPosBottom,a[h][d].v9=a[h][d].xPosRight,a[h][d].v10=a[h][d].yPosTop)}}function isBooleanOptionTrue(a,e){var t;if("undefined"==typeof optionvar){if("function"==typeof e)return!0;if("object"==typeof e){for(t=0;t<e.length;t++)if(e[t])return!0;return!1}return e}if("function"==typeof optionvar)return!0;if("object"==typeof optionvar){for(t=0;t<optionvar.length;t++)if(optionvar[t])return!0;return!1}return optionvar}function setOptionValue(a,e,t,i,l,n,o,s,r,c,h,d,u){var p;if(1==e&&"object"==typeof n.special)for(var S=n.special.length-1;S>=0;S--)if("undefined"!=typeof n.special[S].posi&&"undefined"!=typeof n.special[S].posj&&n.special[S].posi==h&&n.special[S].posj==d&&-1!=h&&-1!=d&&"undefined"!=typeof n.special[S][c])return n.special[S][c];return"undefined"==typeof s?"function"==typeof r?r(i,l,n,o,h,d,u):(p="object"==typeof r?a?r[Math.min(r.length-1,Math.max(0,h))]:r[Math.min(r.length-1,Math.max(0,d))]:r,1!=t&&(p=Math.ceil(p*t)),p):(p="function"==typeof s?s(i,l,n,o,h,d,u):"object"==typeof s?-1==d?s[Math.min(s.length-1,Math.max(0,h))]:s[Math.min(s.length-1,Math.max(0,d))]:s,1!=t&&(p=Math.ceil(p*t)),p)}function tpdraw(a,e){switch(a.tpchart){case"Bar":case"StackedBar":"Line"==e.type?tp="Line":tp=a.tpchart;break;default:tp=a.tpchart}return tp}function setTextBordersAndBackground(a,e,t,i,l,n,o,s,r,c,h,d,u,p){var S,g;if("string"!=typeof e){var f=e.toString();S=t*(f.split("\n").length||1),g=a.measureText(f).width}else S=t*(e.split("\n").length||1),g=a.measureText(e).width;var A,x,m;"center"==a.textAlign?(A=-g/2,x=g/2):"left"==a.textAlign?(A=0,x=g):"right"==a.textAlign&&(A=-g,x=0),"top"==a.textBaseline?(m=0,ybottom=S):"center"==a.textBaseline||"middle"==a.textBaseline?(m=-S/2,ybottom=S/2):"bottom"==a.textBaseline&&(m=-S,ybottom=0),a.save(),a.beginPath(),a.translate(i,l),"none"!=d&&(a.save(),a.fillStyle=d,a.drawRectangle({x:A-r,y:ybottom+c,width:x-A+2*r,height:m-ybottom-2*c,borderRadius:p,fill:!0,stroke:!1}),a.restore(),a.fillStyle="black"),n&&(a.save(),a.lineWidth=s,a.strokeStyle=o,a.fillStyle=o,a.setLineDash(lineStyleFn(h)),a.drawRectangle({x:A-r,y:ybottom+c,width:x-A+2*r,height:m-ybottom-2*c,borderRadius:p,fill:!1,stroke:!0}),a.setLineDash([]),a.restore()),a.restore()}function calculatePieDrawingSize(a,e,t,i,l){var n=((t.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),o=((t.totalAmplitude*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);o<=t.zeroValue&&(o=2*Math.PI);var s=(n-o+4*Math.PI)%(2*Math.PI),r=s+o,c=Math.floor((s+t.zeroValue)/(Math.PI/2)%4),h=Math.floor((r-t.zeroValue)/(Math.PI/2)%4),d=[0,0,0,0];if(h>=c)for(var u=c;h>=u;u++)d[u]=1;else{for(var u=c;4>u;u++)d[u]=1;for(var u=0;h>=u;u++)d[u]=1}0==d[0]&&0==d[1]?(midPieY=e.topNotUsableSize+5,doughnutRadius=e.availableHeight-5):0==d[2]&&0==d[3]?(midPieY=e.topNotUsableSize+e.availableHeight,doughnutRadius=e.availableHeight-5):(midPieY=e.topNotUsableSize+e.availableHeight/2,doughnutRadius=e.availableHeight/2-5);var p;0==d[0]&&0==d[3]?(midPieX=e.leftNotUsableSize+e.availableWidth-5,doughnutRadius=Math.min(doughnutRadius,e.availableWidth-5),p=e.availableWidth-5):0==d[1]&&0==d[2]?(midPieX=e.leftNotUsableSize+5,doughnutRadius=Math.min(doughnutRadius,e.availableWidth-5),p=e.availableWidth-5):(midPieX=e.leftNotUsableSize+e.availableWidth/2,doughnutRadius=Math.min(doughnutRadius,e.availableWidth/2-5),p=e.availableWidth/2-5);var S=i.labels.length-1;if(isBooleanOptionTrue(void 0,t.inGraphDataShow)&&3==setOptionValue(!1,!0,1,"INGRAPHDATARADIUSPOSITION",a,i,l,void 0,t.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",0,S,{nullValue:!0})&&"off-center"==setOptionValue(!1,!0,1,"INGRAPHDATAALIGN",a,i,l,void 0,t.inGraphDataAlign,"inGraphDataAlign",0,S,{nullValue:!0})&&0==setOptionValue(!1,!0,1,"INGRAPHDATAROTATE",a,i,l,void 0,t.inGraphDataRotate,"inGraphDataRotate",0,S,{nullValue:!0})){doughnutRadius=doughnutRadius-setOptionValue(!1,!0,a.chartTextScale,"INGRAPHDATAFONTSIZE",a,i,l,void 0,t.inGraphDataFontSize,"inGraphDataFontSize",0,S,{nullValue:!0})-setOptionValue(!1,!0,1,"INGRAPHDATAPADDINGRADIUS",a,i,l,void 0,t.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",0,S,{nullValue:!0})-5;for(var g,u=0;u<i.datasets.length;u++)if("undefined"!=typeof i.datasets[u].data[S]&&1*i.datasets[u].data[S]>=0){a.font=setOptionValue(!1,!0,1,"INGRAPHDATAFONTSTYLE",a,i,l,void 0,t.inGraphDataFontStyle,"inGraphDataFontStyle",u,S,{nullValue:!0})+" "+setOptionValue(!1,!0,a.chartTextScale,"INGRAPHDATAFONTSIZE",a,i,l,void 0,t.inGraphDataFontSize,"inGraphDataFontSize",u,S,{nullValue:!0})+"px "+setOptionValue(!1,!0,1,"INGRAPHDATAFONTFAMILY",a,i,l,void 0,t.inGraphDataFontFamily,"inGraphDataFontFamily",u,S,{nullValue:!0}),1==setOptionValue(!1,!0,1,"INGRAPHDATAANGLEPOSITION",a,i,l,void 0,t.inGraphDataAnglePosition,"inGraphDataAnglePosition",u,S,{nullValue:!0})?g=n+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINANGLE",a,i,l,void 0,t.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",u,S,{
nullValue:!0})*(Math.PI/180):2==setOptionValue(!1,!0,1,"INGRAPHDATAANGLEPOSITION",a,i,l,void 0,t.inGraphDataAnglePosition,"inGraphDataAnglePosition",u,S,{nullValue:!0})?g=n-l[u][S].segmentAngle/2+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINANGLE",a,i,l,void 0,t.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",u,S,{nullValue:!0})*(Math.PI/180):3==setOptionValue(!1,!0,1,"INGRAPHDATAANGLEPOSITION",a,i,l,void 0,t.inGraphDataAnglePosition,"inGraphDataAnglePosition",u,S,{nullValue:!0})&&(g=n-l[u][S].segmentAngle+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINANGLE",a,i,l,void 0,t.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",u,S,{nullValue:!0})*(Math.PI/180)),n-=l[u][S].segmentAngle;var f=tmplbis(setOptionValue(!1,!0,1,"INGRAPHDATATMPL",a,i,l,void 0,t.inGraphDataTmpl,"inGraphDataTmpl",u,S,{nullValue:!0}),l[u][S],t),A=a.measureTextMultiLine(f).textWidth,x=Math.abs((p-A)/Math.cos(g))-setOptionValue(!1,!0,1,"INGRAPHDATAPADDINGRADIUS",a,i,l,void 0,t.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",u,S,{nullValue:!0})-5;x<doughnutRadius&&(doughnutRadius=x)}}return doughnutRadius*=t.radiusScale,{radius:doughnutRadius,midPieX:midPieX,midPieY:midPieY}}function convertData(a,e){console.log("GENERATE:"+e),e&&console.log("var data = {"),e&&console.log(' labels : [""],'),e&&console.log(" datasets : [");for(var t={labels:[""],datasets:[]},i=0;i<a.length;i++)e&&console.log(" {"),t.datasets[i]={data:[]},"undefined"!=typeof a[i].value?(e&&console.log(" data : ["+a[i].value+"],"),t.datasets[i].data=[a[i].value]):(e&&console.log(" data : ["+a[i].value+"],"),t.datasets[i].data=[]),"undefined"!=typeof a[i].color&&(e&&console.log(' fillColor : "'+a[i].color+'",'),t.datasets[i].fillColor=a[i].color),"undefined"!=typeof a[i].title&&(e&&console.log(' title : "'+a[i].title+'",'),t.datasets[i].title=a[i].title),"undefined"!=typeof a[i].link&&(e&&console.log(' link : "'+a[i].link+'",'),t.datasets[i].link=a[i].link),"undefined"!=typeof a[i].imageLoad&&(e&&console.log(" imageLoad : <image>,"),t.datasets[i].imageLoad=a[i].imageLoad),"undefined"!=typeof a[i].imagePos&&(e&&console.log(" imagePos : "+a[i].imagePos+","),t.datasets[i].imagePos=a[i].imagePos),"undefined"!=typeof a[i].imageHeight&&(e&&console.log(" imageHeight : "+a[i].imageHeight+","),t.datasets[i].imageHeight=a[i].imageHeight),"undefined"!=typeof a[i].imageWidth&&(e&&console.log(" imageWidth : "+a[i].imageWidth+","),t.datasets[i].imageWidth=a[i].imageWidth),"undefined"!=typeof a[i].text&&(e&&console.log(' text : "'+a[i].text+'",'),t.datasets[i].text=a[i].text),"undefined"!=typeof a[i].fontStyle&&(e&&console.log(' fontStyle : "'+a[i].fontStyle+'",'),t.datasets[i].fontStyle=a[i].fontStyle),"undefined"!=typeof a[i].fontSize&&(e&&console.log(" fontSize : "+a[i].fontSize+","),t.datasets[i].fontSize=a[i].fontSize),"undefined"!=typeof a[i].expandOutRadius&&(e&&console.log(" expandOutRadius : "+a[i].expandOutRadius+","),t.datasets[i].expandOutRadius=a[i].expandOutRadius),"undefined"!=typeof a[i].expandInRadius&&(e&&console.log(" expandInRadius : "+a[i].expandInRadius+","),t.datasets[i].expandInRadius=a[i].expandInRadius),"undefined"!=typeof a[i].gradientColors&&(e&&console.log(" gradientColors : < put here the gradient Colors definitions> "+a[i].gradientColors+","),t.datasets[i].gradientColors=a[i].gradientColors),e&&(console.log(" nothing : true // line added to avoid a comma after last line"),i==a.length-1?console.log(" }"):console.log(" },"));return e&&console.log("]"),a.length>0&&("undefined"!=typeof a[0].shapesInChart&&(t.shapesInChart=a[0].shapesInChart),e&&(console.log(" ,"),console.log(" < put here the shapesInChart >"))),e&&console.log("};"),t}var chartJSLineStyle=[];chartJSLineStyle.solid=[],chartJSLineStyle.dotted=[1,4],chartJSLineStyle.shortDash=[2,1],chartJSLineStyle.dashed=[4,2],chartJSLineStyle.dashSpace=[4,6],chartJSLineStyle.longDashDot=[7,2,1,2],chartJSLineStyle.longDashShortDash=[10,4,4,4],chartJSLineStyle.gradient=[1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1],"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a){"use strict";if(null==this)throw new TypeError;var e=Object(this),t=e.length>>>0;if(0===t)return-1;var i=0;if(arguments.length>0&&(i=Number(arguments[1]),i!=i?i=0:0!=i&&i!=1/0&&i!=-(1/0)&&(i=(i>0||-1)*Math.floor(Math.abs(i)))),i>=t)return-1;for(var l=i>=0?i:Math.max(t-Math.abs(i),0);t>l;l++)if(l in e&&e[l]===a)return l;return-1});var charJSPersonalDefaultOptions={},charJSPersonalDefaultOptionsLine={},charJSPersonalDefaultOptionsRadar={},charJSPersonalDefaultOptionsPolarArea={},charJSPersonalDefaultOptionsPie={},charJSPersonalDefaultOptionsDoughnut={},charJSPersonalDefaultOptionsBar={},charJSPersonalDefaultOptionsStackedBar={},charJSPersonalDefaultOptionsHorizontalBar={},charJSPersonalDefaultOptionsHorizontalStackedBar={},cachebis={};"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.fillTextMultiLine=function(a,e,t,i,l,n,o,s,r,c,h,d,u,p){var S=(""+a).split("\n");"middle"==i?n&&(t-=(S.length-1)/2*l):"bottom"==i&&n&&(t-=(S.length-1)*l);for(var g=t-l,f=0;f<S.length;f++)this.fillText(S[f],e,t),t+=l;if(o){var A=s.measureTextMultiLine(a,l),x=[],g=[];x.p1=h+e,g.p1=d+t-l;var m=Math.PI/2+c;"left"==s.textAlign&&"top"==i?(x.p1+=l*Math.cos(m),g.p1+=l*Math.sin(m)):"left"==s.textAlign&&"middle"==i?(x.p1+=l/2*Math.cos(m),g.p1+=l/2*Math.sin(m)):"left"==s.textAlign&&"bottom"==i||("center"==s.textAlign&&"top"==i?(x.p1+=l*Math.cos(m)-A.textWidth/2*Math.cos(c),g.p1+=l*Math.sin(m)-A.textWidth/2*Math.sin(c)):"center"==s.textAlign&&"middle"==i?(x.p1+=l/2*Math.cos(m)-A.textWidth/2*Math.cos(c),g.p1+=l/2*Math.sin(m)-A.textWidth/2*Math.sin(c)):"center"==s.textAlign&&"bottom"==i?(x.p1-=A.textWidth/2*Math.cos(c),g.p1-=A.textWidth/2*Math.sin(c)):"right"==s.textAlign&&"top"==i?(x.p1+=l*Math.cos(m)-A.textWidth*Math.cos(c),g.p1+=l*Math.sin(m)-A.textWidth*Math.sin(c)):"right"==s.textAlign&&"middle"==i?(x.p1+=l/2*Math.cos(m)-A.textWidth*Math.cos(c),g.p1+=l/2*Math.sin(m)-A.textWidth*Math.sin(c)):"right"==s.textAlign&&"bottom"==i&&(x.p1-=A.textWidth*Math.cos(c),g.p1-=A.textWidth*Math.sin(c))),x.p2=x.p1+A.textWidth*Math.cos(c),g.p2=g.p1+A.textWidth*Math.sin(c),x.p3=x.p1-l*Math.cos(m),g.p3=g.p1-l*Math.sin(m),x.p4=x.p3+A.textWidth*Math.cos(c),g.p4=g.p3+A.textWidth*Math.sin(c),jsTextMousePos[s.ChartNewId][jsTextMousePos[s.ChartNewId].length]=[r,a,x,g,c,A.textWidth,A.textHeight,u,p]}},CanvasRenderingContext2D.prototype.measureTextMultiLine=function(a,e){for(var t,i=0,l=(""+a).replace(/<BR>/gi,"\n").split("\n"),n=l.length*e,o=0;o<l.length;o++)t=this.measureText(l[o]).width,t>i&&(i=t);return{textWidth:i,textHeight:1.5*n}},"function"!=typeof CanvasRenderingContext2D.prototype.setLineDash&&(CanvasRenderingContext2D.prototype.setLineDash=function(a){return 0}),CanvasRenderingContext2D.prototype.drawRectangle=function(a){return originalfillStyle=this.fillStyle,"undefined"==typeof a.x&&(a.x=0),a.width<0&&(a.x+=a.width,a.width*=-1),a.height<0&&(a.y+=a.height,a.height*=-1),"undefined"==typeof a.y&&(a.y=0),"undefined"==typeof a.y&&(a.y=0),"undefined"!=typeof a.backgroundColor&&(this.fillStyle=a.backgroundColor),"undefined"==typeof a.borderRadius&&(a.borderRadius=0),0==a.borderRadius&&1==a.fill&&this.fillRect(a.x,a.y,a.width,a.height),0==a.borderRadius&&1==a.stroke&&this.strokeRect(a.x,a.y,a.width,a.height),0!=a.borderRadius&&(rectangleRadius=parseInt(a.borderRadius),rectangleRadius>a.width/2&&(rectangleRadius=a.width/2),a.height<a.width&&rectangleRadius>a.height/2&&(rectangleRadius=a.height/2),this.beginPath(),this.moveTo(a.x+rectangleRadius,a.y),this.lineTo(a.x+a.width-rectangleRadius,a.y),this.arc(a.x+a.width-rectangleRadius,a.y+rectangleRadius,rectangleRadius,1.5*Math.PI,0),this.lineTo(a.x+a.width,a.y+a.height-rectangleRadius),this.arc(a.x+a.width-rectangleRadius,a.y+a.height-rectangleRadius,rectangleRadius,0,.5*Math.PI),this.lineTo(a.x+rectangleRadius,a.y+a.height),this.arc(a.x+rectangleRadius,a.y+a.height-rectangleRadius,rectangleRadius,.5*Math.PI,1*Math.PI),this.lineTo(a.x,a.y+rectangleRadius),this.arc(a.x+rectangleRadius,a.y+rectangleRadius,rectangleRadius,1*Math.PI,1.5*Math.PI),this.closePath(),1==a.fill&&this.fill(),1==a.stroke&&this.stroke()),this.fillStyle=originalfillStyle,this}),cursorDivCreated=!1,initChartJsResize=!1;var jsGraphResize=new Array,container;bw=new checkBrowser,fromLeft=10,fromTop=10,"function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var dynamicDisplay=new Array,dynamicDisplayList=new Array,jsGraphAnnotate=new Array,jsTextMousePos=new Array,mouseActionData=new Array,inMouseAction=new Array;window.Chart=function(context){function init_and_start(a,e,t){var i;if("undefined"==typeof a.initialWidth&&(a.initialWidth=a.canvas.width),"undefined"==typeof a.chartTextScale&&(a.chartTextScale=t.chartTextScale),"undefined"==typeof a.chartLineScale&&(a.chartLineScale=t.chartLineScale),"undefined"==typeof a.chartSpaceScale&&(a.chartSpaceScale=t.chartSpaceScale),"undefined"==typeof a.firstPass&&(a.firstPass=0,t.responsive&&!t.multiGraph&&addResponsiveChart(a.ChartNewId,a,e,t),"undefined"==typeof e.labels&&(e.labels=[]),0==e.labels.length)){var l=0;for(i=0;i<e.datasets.length;i++)l=Max([l,e.datasets[i].data.length]);for(i=0;l>i;i++)e.labels[i]=""}if("undefined"==typeof a.ChartNewId){a.runanimationcompletefunction=!0;var n=new Date,o=n.getTime();a.ChartNewId=a.tpchart+"_"+o,a._eventListeners={}}if(resizeCtx(a,t),!dynamicFunction(e,t,a))return!1;for(t.multiGraph||0==a.firstPass||clearAnnotate(a.ChartNewId),"undefined"==typeof jsGraphAnnotate[a.ChartNewId]&&(jsGraphAnnotate[a.ChartNewId]=new Array,jsTextMousePos[a.ChartNewId]=new Array),i=0;i<e.datasets.length;i++)"undefined"==typeof e.datasets[i].title&&"undefined"!=typeof e.datasets[i].label&&(e.datasets[i].title=e.datasets[i].label);return defMouse(a,e,t),0==a.firstPass&&(t.animation?a.firstPass=1:a.firstPass=2),setRect(a,t),!0}function reverseData(a){a.labels=a.labels.reverse();for(var e=0;e<a.datasets.length;e++)for(var t in a.datasets[e])Array.isArray(a.datasets[e][t])&&(a.datasets[e][t]=a.datasets[e][t].reverse());return a}function calculateOffset(a,e,t,i){if(a)return CapValue(log10(e)*i-log10(t.graphMin)*i,void 0,0);var l=t.steps*t.stepValue,n=e-t.graphMin,o=CapValue(n/l,1,0);return i*t.steps*o}function animationLoop(a,e,t,i,l,n,o,s,r,c,h,d,u,p){function S(){var S=a.animation?CapValue(D(P),null,0):1;1*f>=1*CapValue(a.animationSteps,Number.MAX_VALUE,1)||0==a.animation||i.firstPass%10!=1?S=1:S>=1&&(S=.9999),!a.animation||isIE()<9&&0!=isIE()||!a.clearRect||i.clearRect(l,n,o,s),dispCrossImage(i,a,r,c,h,d,!1,u,S,f),dispCrossText(i,a,r,c,h,d,!1,u,S,f),"function"==typeof a.beforeDrawFunction&&a.beforeDrawFunction("BEFOREDRAWFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:a,borderX:h,borderY:d,midPosX:r,midPosY:c}),a.scaleOverlay?(t(S),"function"==typeof a.endDrawDataFunction&&a.endDrawDataFunction("ENDDATAFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:a,borderX:h,borderY:d,midPosX:r,midPosY:c}),e(),"function"==typeof a.endDrawScaleFunction&&a.endDrawScaleFunction("ENDSCALEFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:a,borderX:h,borderY:d,midPosX:r,midPosY:c})):(e(),"function"==typeof a.endDrawScaleFunction&&a.endDrawScaleFunction("ENDSCALEFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:a,borderX:h,borderY:d,midPosX:r,midPosY:c}),t(S),"function"==typeof a.endDrawDataFunction&&a.endDrawDataFunction("ENDDATAFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:a,borderX:h,borderY:d,midPosX:r,midPosY:c})),dispCrossImage(i,a,r,c,h,d,!0,u,S,f),dispCrossText(i,a,r,c,h,d,!0,u,S,f)}function g(){f+=x,P+=x*m,f==a.animationSteps||0==a.animation||i.firstPass%10!=1?P=1:P>=1&&(P=.999),S(),-1==x&&M>=f?("function"==typeof a.onAnimationComplete&&1==i.runanimationcompletefunction&&a.onAnimationComplete(i,a,u,0,A+1,p),x=1,a.animationForceSetTimeOut?requestAnimFrameSetTimeOut(g):requestAnimFrame(g)):P<a.animationStopValue?a.animationForceSetTimeOut?requestAnimFrameSetTimeOut(g):requestAnimFrame(g):(A<a.animationCount||0==a.animationCount)&&i.firstPass%10==1?(A++,a.animationBackward&&1==x?(P-=m,x=-1):(x=1,f=M-1,P=T-m),window.setTimeout(g,1e3*a.animationPauseTime)):(testRedraw(i,u,a)||"function"==typeof a.onAnimationComplete&&1==i.runanimationcompletefunction&&(a.onAnimationComplete(i,a,u,1,A+1,p),i.runanimationcompletefunction=!1),i.firstPass=9)}var f=0,A=1,x=1;(a.animationStartValue<0||a.animationStartValue>1)&&(a.animation.StartValue=0),(a.animationStopValue<0||a.animationStopValue>1)&&(a.animation.StopValue=1),a.animationStopValue<a.animationStartValue&&(a.animationStopValue=a.animationStartValue),isIE()<9&&0!=isIE()&&(a.animation=!1);var m=a.animation?1/CapValue(a.animationSteps,Number.MAX_VALUE,1):1,D=animationOptions[a.animationEasing],P=a.animation?0:1;if(a.animation&&a.animationStartValue>0&&a.animationStartValue<=1)for(;P<a.animationStartValue;)f++,P+=m;var M=f,T=P;"function"!=typeof e&&(e=function(){}),a.clearRect?a.animationForceSetTimeOut?requestAnimFrameSetTimeOut(g):requestAnimFrame(g):g()}function calculateScale(a,e,t,i,l,n,o){var s,r,c,h,d,u,p,S,g;if(2==a?(S=e.logarithmic2,g=e.yAxisMinimumInterval2):(S=e.logarithmic,g=e.yAxisMinimumInterval),S){n==l&&(l+=1),0==n&&(n=.01);var f=calculateOrderOfMagnitude(n),A=calculateOrderOfMagnitude(l)+1;s=Math.pow(10,f),r=Math.pow(10,A),p=A-f}else if(u=l-n,p=calculateOrderOfMagnitude(u),s=Math.abs(n)>e.zeroValue?Math.floor(n/(1*Math.pow(10,p)))*Math.pow(10,p):0,r=Math.abs(l)>e.zeroValue?Math.ceil(l/(1*Math.pow(10,p)))*Math.pow(10,p):0,"number"==typeof g&&r>=0){for(s-=s%g;s>n;)s-=g;for(r%g>e.zeroValue&&r%g<g-e.zeroValue&&(r=roundScale(e,(1+Math.floor(r/g))*g));l>r;)r+=g}if(c=r-s,h=Math.pow(10,p),d=Math.round(c/h),S)d=p;else{for(var x=!1;!x&&(i>d||d>t);)i>d?("number"==typeof g&&g>h/2&&(x=!0,h=g,d=Math.ceil(c/h)),x||(h/=2,d=Math.round(c/h))):(h*=2,d=Math.round(c/h));if("number"==typeof g&&(g>h&&(h=g,d=Math.ceil(c/h)),h%g>e.zeroValue&&h%g<g-e.zeroValue&&(2*h%g<e.zeroValue||2*h%g>g-e.zeroValue?(h=2*h,d=Math.ceil(c/h)):(h=roundScale(e,(1+Math.floor(h/g))*g),d=Math.ceil(c/h)))),1==e.graphMaximized||"bottom"==e.graphMaximized||"undefined"!=typeof e.graphMin)for(;n>s+h&&d>=3;)s+=h,d--;if(1==e.graphMaximized||"top"==e.graphMaximized||"undefined"!=typeof e.graphMax)for(;s+(d-1)*h>=l&&d>=3;)d--}var m=[];return populateLabels(1,e,o,m,d,s,r,h),{steps:d,stepValue:h,graphMin:s,labels:m,maxValue:l}}function roundScale(a,e){var t=0,i=""+a.yAxisMinimumInterval;return i.indexOf(".")>0&&(t=i.substr(i.indexOf(".")).length),Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function calculateOrderOfMagnitude(a){return 0==a?0:Math.floor(Math.log(a)/Math.LN10)}function populateLabels(a,e,t,i,l,n,o,s){var r;if(2==a?(r=e.logarithmic2,fmtYLabel=e.fmtYLabel2):(r=e.logarithmic,fmtYLabel=e.fmtYLabel),t){var c;if(r){var h=n;for(c=0;l+1>c;c++)i.push(tmpl(t,{value:fmtChartJS(e,1*h.toFixed(getDecimalPlaces(h)),fmtYLabel)},e)),h*=10}else for(c=0;l+1>c;c++)i.push(tmpl(t,{value:fmtChartJS(e,1*(n+s*c).toFixed(getDecimalPlaces(s)),fmtYLabel)},e))}}function Max(a){return Math.max.apply(Math,a)}function Min(a){return Math.min.apply(Math,a)}function Default(a,e){return a?a:e}function CapValue(a,e,t){return isNumber(e)&&a>e?e:isNumber(t)&&t>a?t:a}function getDecimalPlaces(a){var e=(""+a).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function mergeChartConfig(a,e){var t={};for(var i in a)t[i]=a[i];for(var l in e)t[l]=e[l];return t}function tmpl(a,e,t){return newstr=a,newstr.substr(0,t.templatesOpenTag.length)==t.templatesOpenTag&&(newstr="<%="+newstr.substr(t.templatesOpenTag.length,newstr.length-t.templatesOpenTag.length)),newstr.substr(newstr.length-t.templatesCloseTag.length,t.templatesCloseTag.length)==t.templatesCloseTag&&(newstr=newstr.substr(0,newstr.length-t.templatesCloseTag.length)+"%>"),tmplpart2(newstr,e)}function tmplpart2(a,e){var t=/\W/.test(a)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.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('');"):cache[a]=cache[a]||tmplpart2(document.getElementById(a).innerHTML);return e?t(e):t}function dispCrossText(a,e,t,i,l,n,o,s,r,c){var h,d,u,p,S,g;for(h=0;h<e.crossText.length;h++)if(""!=e.crossText[h]&&e.crossTextOverlay[Min([h,e.crossTextOverlay.length-1])]==o&&(1==c&&"first"==e.crossTextIter[Min([h,e.crossTextIter.length-1])]||e.crossTextIter[Min([h,e.crossTextIter.length-1])]==c||"all"==e.crossTextIter[Min([h,e.crossTextIter.length-1])]||1==r&&"last"==e.crossTextIter[Min([h,e.crossTextIter.length-1])])){switch(a.save(),a.beginPath(),a.font=e.crossTextFontStyle[Min([h,e.crossTextFontStyle.length-1])]+" "+Math.ceil(a.chartTextScale*e.crossTextFontSize[Min([h,e.crossTextFontSize.length-1])]).toString()+"px "+e.crossTextFontFamily[Min([h,e.crossTextFontFamily.length-1])],a.fillStyle=e.crossTextFontColor[Min([h,e.crossTextFontColor.length-1])],S=e.crossTextAlign[Min([h,e.crossTextAlign.length-1])],g=e.crossTextBaseline[Min([h,e.crossTextBaseline.length-1])],u=1*Math.ceil(a.chartSpaceScale*e.crossTextPosX[Min([h,e.crossTextPosX.length-1])]),p=1*Math.ceil(a.chartSpaceScale*e.crossTextPosY[Min([h,e.crossTextPosY.length-1])]),1*e.crossTextRelativePosX[Min([h,e.crossTextRelativePosX.length-1])]){case 0:"default"==S&&(S="left");break;case 1:u+=l,"default"==S&&(S="right");break;case 2:u+=t,"default"==S&&(S="center");break;case-2:u+=context.canvas.width/2,"default"==S&&(S="center");break;case 3:u+=u+2*t-l,"default"==S&&(S="left");break;case 4:u+=context.canvas.width,"default"==S&&(S="right");break;default:u+=t,"default"==S&&(S="center")}switch(1*e.crossTextRelativePosY[Min([h,e.crossTextRelativePosY.length-1])]){case 0:"default"==g&&(g="top");break;case 3:p+=n,"default"==g&&(g="top");break;case 2:p+=i,"default"==g&&(g="middle");break;case-2:p+=context.canvas.height/2,"default"==g&&(g="middle");break;case 1:p+=p+2*i-n,"default"==g&&(g="bottom");break;case 4:p+=context.canvas.height,"default"==g&&(g="bottom");break;default:p+=i,"default"==g&&(g="middle")}a.textAlign=S,a.textBaseline=g,a.translate(1*u,1*p);var f=Math.PI*e.crossTextAngle[Min([h,e.crossTextAngle.length-1])]/180;a.rotate(f),"%"==e.crossText[h].substring(0,1)?"function"==typeof e.crossTextFunction&&(d=e.crossTextFunction(h,e.crossText[h],a,e,t,i,l,n,o,s,r)):d=e.crossText[h],setTextBordersAndBackground(a,d,Math.ceil(a.chartTextScale*e.crossTextFontSize[Min([h,e.crossTextFontSize.length-1])]),0,0,e.crossTextBorders[Min([h,e.crossTextBorders.length-1])],e.crossTextBordersColor[Min([h,e.crossTextBordersColor.length-1])],Math.ceil(a.chartLineScale*e.crossTextBordersWidth[Min([h,e.crossTextBordersWidth.length-1])]),Math.ceil(a.chartSpaceScale*e.crossTextBordersXSpace[Min([h,e.crossTextBordersXSpace.length-1])]),Math.ceil(a.chartSpaceScale*e.crossTextBordersYSpace[Min([h,e.crossTextBordersYSpace.length-1])]),e.crossTextBordersStyle[Min([h,e.crossTextBordersStyle.length-1])],e.crossTextBackgroundColor[Min([h,e.crossTextBackgroundColor.length-1])],"CROSSTEXT",e.crossTextBordersRadius),1==r&&"all"==e.crossTextIter[Min([h,e.crossTextIter.length-1])]||"last"!=e.crossTextIter[Min([h,e.crossTextIter.length-1])]?a.fillTextMultiLine(d,0,0,a.textBaseline,Math.ceil(a.chartTextScale*e.crossTextFontSize[Min([h,e.crossTextFontSize.length-1])]),!0,e.detectMouseOnText,a,"CROSSTEXT_TEXTMOUSE",f,1*u,1*p,h,-1):a.fillTextMultiLine(d,0,0,a.textBaseline,Math.ceil(a.chartTextScale*e.crossTextFontSize[Min([h,e.crossTextFontSize.length-1])]),!0,!1,a,"CROSSTEXT_TEXTMOUSE",f,1*u,1*p,h,-1),a.restore()}}function dispCrossImage(a,e,t,i,l,n,o,s,r,c){var h,d,u,p,S;for(h=0;h<e.crossImage.length;h++)if("undefined"!=typeof e.crossImage[h]&&e.crossImageOverlay[Min([h,e.crossImageOverlay.length-1])]==o&&(-1==c&&"background"==e.crossImageIter[Min([h,e.crossImageIter.length-1])]||1==c&&"first"==e.crossImageIter[Min([h,e.crossImageIter.length-1])]||e.crossImageIter[Min([h,e.crossImageIter.length-1])]==c||-1!=c&&"all"==e.crossImageIter[Min([h,e.crossImageIter.length-1])]||1==r&&"last"==e.crossImageIter[Min([h,e.crossImageIter.length-1])])){switch(a.save(),a.beginPath(),p=e.crossImageAlign[Min([h,e.crossImageAlign.length-1])],S=e.crossImageBaseline[Min([h,e.crossImageBaseline.length-1])],d=1*Math.ceil(a.chartSpaceScale*e.crossImagePosX[Min([h,e.crossImagePosX.length-1])]),u=1*Math.ceil(a.chartSpaceScale*e.crossImagePosY[Min([h,e.crossImagePosY.length-1])]),1*e.crossImageRelativePosX[Min([h,e.crossImageRelativePosX.length-1])]){case 0:"default"==p&&(p="left");break;case 1:d+=l,"default"==p&&(p="right");break;case 2:d+=t,"default"==p&&(p="center");break;case-2:d+=context.canvas.width/2,"default"==p&&(p="center");break;case 3:d+=d+2*t-l,"default"==p&&(p="left");break;case 4:d+=context.canvas.width,"default"==p&&(p="right");break;default:d+=t,"default"==p&&(p="center")}switch(1*e.crossImageRelativePosY[Min([h,e.crossImageRelativePosY.length-1])]){case 0:"default"==S&&(S="top");break;case 3:u+=n,"default"==S&&(S="top");break;case 2:u+=i,"default"==S&&(S="middle");break;case-2:u+=context.canvas.height/2,"default"==S&&(S="middle");break;case 1:u+=u+2*i-n,"default"==S&&(S="bottom");break;case 4:u+=context.canvas.height,"default"==S&&(S="bottom");break;default:u+=i,"default"==S&&(S="middle")}var g=e.crossImage[h].width;switch(p){case"left":break;case"right":d-=g;break;case"center":d-=g/2}var f=e.crossImage[h].height;switch(S){case"top":break;case"bottom":u-=f;break;case"middle":u-=f/2}a.translate(1*d,1*u),a.rotate(Math.PI*e.crossImageAngle[Min([h,e.crossImageAngle.length-1])]/180),a.drawImage(e.crossImage[h],0,0),a.restore()}}function setMeasures(a,e,t,i,l,n,o,s,r,c,h,d,u){var p=i,S=l;window.devicePixelRatio>1&&(p/=window.devicePixelRatio,S/=window.devicePixelRatio),"none"!=e.canvasBackgroundColor&&(t.canvas.style.background=e.canvasBackgroundColor);var g=0,f=0,A=0,x=0,m=0,D=0,P=0,M=0,T=0,v=0,y=0,L=0,V=0,b=0,O=0,I=0,G=0,B=0,R=0,N=0,C=0,w=0,H=0,F=0,k=1,E=1,z=0,W=1,Y=0,X=1,j=0,U=0,_=0,J=0,K=0,Z=0;t.widthAtSetMeasures=S,t.heightAtSetMeasures=p,e.canvasBorders&&(g=Math.ceil(t.chartLineScale*e.canvasBordersWidth));var q,Q;if(c){for(t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,Q=0;Q<a.labels.length;Q++)showLabels(t,a,e,Q)===!0&&(q=t.measureTextMultiLine(fmtChartJS(e,a.labels[Q],e.fmtXLabel),Math.ceil(t.chartTextScale*e.scaleFontSize)),k=q.textWidth>k?q.textWidth:k,E=q.textHeight>E?q.textHeight:E);k<Math.ceil(t.chartTextScale*e.xScaleLabelsMinimumWidth)&&(k=Math.ceil(t.chartTextScale*e.xScaleLabelsMinimumWidth))}if(c){if(z=1,null!=n&&"nihil"!=n)for(t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,Q=n.length-1;Q>=0;Q--)"string"==typeof n[Q]&&showYLabels(t,a,e,Q,n[Q])&&""!=n[Q].trim()&&(q=t.measureTextMultiLine(fmtChartJS(e,n[Q],e.fmtYLabel),Math.ceil(t.chartTextScale*e.scaleFontSize)),z=q.textWidth>z?q.textWidth:z,W=q.textHeight>W?q.textHeight:W);if(z<Math.ceil(t.chartTextScale*e.yScaleLabelsMinimumWidth)&&(z=Math.ceil(t.chartTextScale*e.yScaleLabelsMinimumWidth)),Y=1,null!=o&&e.yAxisRight)for(t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,Q=o.length-1;Q>=0;Q--)"string"==typeof o[Q]&&""!=o[Q].trim()&&(q=t.measureTextMultiLine(fmtChartJS(e,o[Q],e.fmtYLabel2),Math.ceil(t.chartTextScale*e.scaleFontSize)),Y=q.textWidth>Y?q.textWidth:Y,X=q.textHeight>X?q.textHeight:X);else Y=z;Y<Math.ceil(t.chartTextScale*e.yScaleLabelsMinimumWidth)&&(Y=Math.ceil(t.chartTextScale*e.yScaleLabelsMinimumWidth))}if(j=g+Math.ceil(t.chartSpaceScale*e.spaceLeft),U=g+Math.ceil(t.chartSpaceScale*e.spaceRight),c&&("undefined"!=typeof e.yAxisLabel&&(""!=e.yAxisLabel.trim()&&(N=Math.ceil(t.chartTextScale*e.yAxisFontSize)*(e.yAxisLabel.split("\n").length||1)+Math.ceil(t.chartSpaceScale*e.yAxisLabelSpaceLeft)+Math.ceil(t.chartSpaceScale*e.yAxisLabelSpaceRight),C=g+Math.ceil(t.chartSpaceScale*e.spaceLeft)+Math.ceil(t.chartSpaceScale*e.yAxisLabelSpaceLeft)+Math.ceil(t.chartTextScale*e.yAxisFontSize),w=S-g-Math.ceil(t.chartSpaceScale*e.spaceRight)-Math.ceil(t.chartSpaceScale*e.yAxisLabelSpaceLeft)-Math.ceil(t.chartTextScale*e.yAxisFontSize)),("none"!=e.yAxisLabelBackgroundColor||e.yAxisLabelBorders)&&(N+=2*Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersYSpace),C+=Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersYSpace),w-=Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersYSpace)),e.graphTitleBorders&&(N+=2*Math.ceil(t.chartLineScale*e.yAxisLabelBordersWidth),C+=Math.ceil(t.chartLineScale*e.yAxisLabelBordersWidth),w-=Math.ceil(t.chartLineScale*e.yAxisLabelBordersWidth))),e.yAxisLeft&&(j=0==r?g+Math.ceil(t.chartSpaceScale*e.spaceLeft)+N+z+Math.ceil(t.chartSpaceScale*e.yAxisSpaceLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight):g+Math.ceil(t.chartSpaceScale*e.spaceLeft)+N+k+Math.ceil(t.chartSpaceScale*e.yAxisSpaceLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),e.yAxisRight&&(U=0==r?g+Math.ceil(t.chartSpaceScale*e.spaceRight)+N+Y+Math.ceil(t.chartSpaceScale*e.yAxisSpaceLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight):g+Math.ceil(t.chartSpaceScale*e.spaceRight)+N+k+Math.ceil(t.chartSpaceScale*e.yAxisSpaceLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight))),availableWidth=S-j-U,""!=e.graphTitle.trim()&&(A=Math.ceil(t.chartTextScale*e.graphTitleFontSize)*(e.graphTitle.split("\n").length||1)+Math.ceil(t.chartSpaceScale*e.graphTitleSpaceBefore)+Math.ceil(t.chartSpaceScale*e.graphTitleSpaceAfter),x=g+Math.ceil(t.chartSpaceScale*e.spaceTop)+A-Math.ceil(t.chartSpaceScale*e.graphTitleSpaceAfter),("none"!=e.graphTitleBackgroundColor||e.graphTitleBorders)&&(A+=2*Math.ceil(t.chartSpaceScale*e.graphTitleBordersYSpace),x+=Math.ceil(t.chartSpaceScale*e.graphTitleBordersYSpace)),e.graphTitleBorders&&(A+=2*Math.ceil(t.chartLineScale*e.graphTitleBordersWidth),x+=Math.ceil(t.chartLineScale*e.graphTitleBordersWidth))),""!=e.graphSubTitle.trim()&&(m=Math.ceil(t.chartTextScale*e.graphSubTitleFontSize)*(e.graphSubTitle.split("\n").length||1)+Math.ceil(t.chartSpaceScale*e.graphSubTitleSpaceBefore)+Math.ceil(t.chartSpaceScale*e.graphSubTitleSpaceAfter),D=g+Math.ceil(t.chartSpaceScale*e.spaceTop)+A+m-Math.ceil(t.chartSpaceScale*e.graphSubTitleSpaceAfter),("none"!=e.graphSubTitleBackgroundColor||e.graphSubTitleBorders)&&(m+=2*Math.ceil(t.chartSpaceScale*e.graphSubTitleBordersYSpace),D+=Math.ceil(t.chartSpaceScale*e.graphSubTitleBordersYSpace)),e.graphSubTitleBorders&&(m+=2*Math.ceil(t.chartLineScale*e.graphSubTitleBordersWidth),D+=Math.ceil(t.chartLineScale*e.graphSubTitleBordersWidth))),c&&(""!=e.yAxisUnit.trim()&&(T=Math.ceil(t.chartTextScale*e.yAxisUnitFontSize)*(e.yAxisUnit.split("\n").length||1)+Math.ceil(t.chartSpaceScale*e.yAxisUnitSpaceBefore)+Math.ceil(t.chartSpaceScale*e.yAxisUnitSpaceAfter),v=g+Math.ceil(t.chartSpaceScale*e.spaceTop)+A+m+T-Math.ceil(t.chartSpaceScale*e.yAxisUnitSpaceAfter)),("none"!=e.yAxisUnitBackgroundColor||e.yAxisUnitBorders)&&(T+=2*Math.ceil(t.chartSpaceScale*e.yAxisUnitBordersYSpace),v+=Math.ceil(t.chartSpaceScale*e.yAxisUnitBordersYSpace)),e.yAxisUnitBorders&&(T+=2*Math.ceil(t.chartLineScale*e.yAxisUnitBordersWidth),v+=Math.ceil(t.chartLineScale*e.yAxisUnitBordersWidth))),topNotUsableSize=g+Math.ceil(t.chartSpaceScale*e.spaceTop)+A+m+T+Math.ceil(t.chartTextScale*e.graphSpaceBefore),"undefined"!=typeof e.footNote&&""!=e.footNote.trim()&&(P=Math.ceil(t.chartTextScale*e.footNoteFontSize)*(e.footNote.split("\n").length||1)+Math.ceil(t.chartSpaceScale*e.footNoteSpaceBefore)+Math.ceil(t.chartSpaceScale*e.footNoteSpaceAfter),M=p-Math.ceil(t.chartSpaceScale*e.spaceBottom)-g-Math.ceil(t.chartSpaceScale*e.footNoteSpaceAfter),("none"!=e.footNoteBackgroundColor||e.footNoteBorders)&&(P+=2*Math.ceil(t.chartSpaceScale*e.footNoteBordersYSpace),M-=Math.ceil(t.chartSpaceScale*e.footNoteBordersYSpace)),e.footNoteBorders&&(P+=2*Math.ceil(t.chartLineScale*e.footNoteBordersWidth),M-=Math.ceil(t.chartLineScale*e.footNoteBordersWidth))),c&&"undefined"!=typeof e.xAxisLabel&&""!=e.xAxisLabel.trim()&&(H=Math.ceil(t.chartTextScale*e.xAxisFontSize)*(e.xAxisLabel.split("\n").length||1)+Math.ceil(t.chartSpaceScale*e.xAxisLabelSpaceBefore)+Math.ceil(t.chartSpaceScale*e.xAxisLabelSpaceAfter),f=p-g-Math.ceil(t.chartSpaceScale*e.spaceBottom)-P-Math.ceil(t.chartSpaceScale*e.xAxisLabelSpaceAfter),("none"!=e.xAxisLabelBackgroundColor||e.footNoteBorders)&&(H+=2*Math.ceil(t.chartSpaceScale*e.xAxisLabelBordersYSpace),f-=Math.ceil(t.chartSpaceScale*e.xAxisLabelBordersYSpace)),e.footNoteBorders&&(H+=2*Math.ceil(t.chartLineScale*e.xAxisLabelBordersWidth),f-=Math.ceil(t.chartLineScale*e.xAxisLabelBordersWidth))),bottomNotUsableHeightWithoutXLabels=g+Math.ceil(t.chartSpaceScale*e.spaceBottom)+P+H+Math.ceil(t.chartTextScale*e.graphSpaceAfter),"undefined"!=typeof e.legend&&1==e.legend){t.font=e.legendFontStyle+" "+Math.ceil(t.chartTextScale*e.legendFontSize).toString()+"px "+e.legendFontFamily;var $;if(h)for(Q=a.datasets.length-1;Q>=0;Q--)"string"==typeof a.datasets[Q].title&&""!=a.datasets[Q].title.trim()&&(L++,$=t.measureText(fmtChartJS(e,a.datasets[Q].title,e.fmtLegend)).width,y=$>y?$:y);else for(Q=a.length-1;Q>=0;Q--)"string"==typeof a[Q].title&&""!=a[Q].title.trim()&&(L++,$=t.measureText(fmtChartJS(e,a[Q].title,e.fmtLegend)).width,y=$>y?$:y);if(L>1||1==L&&e.showSingleLegend){y+=Math.ceil(t.chartTextScale*e.legendBlockSize)+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenBoxAndText),1==e.legendPosY||2==e.legendPosY||3==e.legendPosY?availableLegendWidth=availableWidth-Math.ceil(t.chartSpaceScale*Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText))-Math.ceil(t.chartSpaceScale*e.legendSpaceRightText):availableLegendWidth=S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-2*g-Math.ceil(t.chartSpaceScale*Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText))-Math.ceil(t.chartSpaceScale*e.legendSpaceRightText),1==e.legendBorders&&(availableLegendWidth-=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceLeft)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceRight)),maxLegendOnLine=Min([Math.floor((availableLegendWidth+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))),e.maxLegendCols]),V=Math.ceil(L/maxLegendOnLine),b=Math.ceil(L/V);var aa=V*(Math.ceil(t.chartTextScale*e.legendFontSize)+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextVertical))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextVertical)+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartSpaceScale*e.legendSpaceAfterText);switch(e.legendPosY){case 0:I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,O=aa,1==e.legendBorders?(R=topNotUsableSize+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartLineScale*e.legendBordersWidth)/2,G=R+Math.ceil(t.chartLineScale*e.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*e.legendFontSize),O+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),B=Math.floor(I-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2),Z=Math.ceil(O-Math.ceil(t.chartLineScale*e.legendBordersWidth))-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),
K=Math.ceil(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)):G=topNotUsableSize+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartLineScale*e.legendBordersWidth)/2,T>0&&(v+=O,1==e.legendBorders&&(R-=T),G-=T),topNotUsableSize+=O;break;case 1:O=aa,I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,G=topNotUsableSize+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*e.legendFontSize),1==e.legendBorders&&(G+=Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartLineScale*e.legendBordersWidth),R=G-Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*e.legendFontSize)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2,O+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),B=Math.floor(I-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2),Z=Math.ceil(O-Math.ceil(t.chartLineScale*e.legendBordersWidth))-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),K=Math.ceil(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText));break;case 2:O=aa,I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,G=topNotUsableSize+(p-topNotUsableSize-bottomNotUsableHeightWithoutXLabels-O)/2+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*e.legendFontSize),1==e.legendBorders&&(G+=Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),R=G-Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*e.legendFontSize)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2,O+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),B=Math.floor(I-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2),Z=Math.ceil(O-Math.ceil(t.chartLineScale*e.legendBordersWidth))-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),K=Math.ceil(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText));break;case-2:O=aa,I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,G=(p-O)/2+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*e.legendFontSize),1==e.legendBorders&&(G+=Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),R=G-Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*e.legendFontSize)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2,O+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),B=Math.floor(I-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2),Z=Math.ceil(O-Math.ceil(t.chartLineScale*e.legendBordersWidth))-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),K=Math.ceil(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText));break;case 3:O=aa,I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,availableHeight=p-topNotUsableSize-bottomNotUsableHeightWithoutXLabels,G=topNotUsableSize+availableHeight-O+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*e.legendFontSize),1==e.legendBorders&&(G-=Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter)+Math.ceil(t.chartLineScale*e.legendBordersWidth),R=G-Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*e.legendFontSize)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2,O+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),B=Math.floor(I-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2),Z=Math.ceil(O-Math.ceil(t.chartLineScale*e.legendBordersWidth))-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),K=Math.ceil(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText));break;default:O=aa,G=p-g-Math.ceil(t.chartSpaceScale*e.spaceBottom)-P-O+Math.ceil(t.chartSpaceScale*e.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*e.legendFontSize),I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,1==e.legendBorders&&(O+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),G-=Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),R=Math.floor(p-g-Math.ceil(t.chartSpaceScale*e.spaceBottom)-P-O+Math.ceil(t.chartLineScale*e.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)),B=Math.floor(I-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2),Z=Math.ceil(O-Math.ceil(t.chartLineScale*e.legendBordersWidth))-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*e.legendBordersSpaceAfter),K=Math.ceil(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)),f-=O,bottomNotUsableHeightWithoutXLabels+=O}var ea=Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)+b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText);switch(1==e.legendBorders&&(ea+=2*Math.ceil(t.chartLineScale*e.legendBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceLeft)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceRight)),e.legendPosX){case 0:case 1:I=Math.ceil(t.chartSpaceScale*e.spaceLeft)+e.canvasBorders*Math.ceil(t.chartLineScale*e.canvasBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText),1==e.legendBorders&&(I+=Math.ceil(t.chartLineScale*e.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceLeft),B=Math.ceil(t.chartSpaceScale*e.spaceLeft)+e.canvasBorders*Math.ceil(t.chartLineScale*e.canvasBordersWidth)+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceLeft)),0==e.legendPosX&&(e.legendPosY>=1&&e.legendPosY<=3||-2==e.legendPosY)&&(j+=ea,C+=ea);break;case 2:I=j+(S-U-j)/2-(Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)-Math.ceil(t.chartSpaceScale*e.legendSpaceRightText))-(b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))-Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))/2,1==e.legendBorders&&(I-=Math.ceil(t.chartLineScale*e.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceRight),B=I-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText));break;case 3:case 4:I=S-U-Math.ceil(t.chartSpaceScale*e.legendSpaceRightText)-b*(y+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*e.legendSpaceBetweenTextHorizontal)/2,1==e.legendBorders&&(I-=Math.ceil(t.chartLineScale*e.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*e.legendBordersSpaceRight),B=I-Math.ceil(t.chartLineScale*e.legendBordersWidth)/2-Math.ceil(t.chartSpaceScale*e.legendSpaceLeftText)),4==e.legendPosX&&(e.legendPosY>=1&&e.legendPosY<=3||-2==e.legendPosY)&&(U+=ea,w-=ea)}1==e.legendBorders&&(R+=Math.ceil(t.chartSpaceScale*e.legendYPadding),B+=Math.ceil(t.chartSpaceScale*e.legendXPadding)),G+=Math.ceil(t.chartSpaceScale*e.legendYPadding),I+=Math.ceil(t.chartSpaceScale*e.legendXPadding)}}if(xLabelWidth=0,bottomNotUsableHeightWithXLabels=bottomNotUsableHeightWithoutXLabels,c&&(e.xAxisBottom||e.xAxisTop)){var ta,ia;0==r?(ta=k,ia=E,nblab=a.labels.length):(ta=z,ia=W,nblab=n.length),"smart"==e.rotateLabels?(_=0,(availableWidth+Math.ceil(t.chartTextScale*e.xAxisSpaceBetweenLabels))/nblab<ta+Math.ceil(t.chartTextScale*e.xAxisSpaceBetweenLabels)&&(_=45,availableWidth/nblab<Math.abs(Math.cos(_*Math.PI/180)*ta)&&(_=90))):(_=e.rotateLabels,0>_&&(_=0),_>180&&(_=180)),_>90&&(_+=180),F=Math.abs(Math.sin(_*Math.PI/180)*ta)+Math.abs(Math.sin((_+90)*Math.PI/180)*ia)+Math.ceil(t.chartSpaceScale*e.xAxisSpaceBefore)+Math.ceil(t.chartSpaceScale*e.xAxisSpaceAfter),J=p-g-Math.ceil(t.chartSpaceScale*e.spaceBottom)-P-H-(F-Math.ceil(t.chartSpaceScale*e.xAxisSpaceBefore))-Math.ceil(t.chartTextScale*e.graphSpaceAfter),xLabelWidth=Math.abs(Math.cos(_*Math.PI/180)*ta)+Math.abs(Math.cos((_+90)*Math.PI/180)*ia),j=Max([j,g+Math.ceil(t.chartSpaceScale*e.spaceLeft)+xLabelWidth/2]),U=Max([U,g+Math.ceil(t.chartSpaceScale*e.spaceRight)+xLabelWidth/2]),availableWidth=S-j-U,e.legend&&e.xAxisBottom&&4==e.legendPosY&&(J-=O),bottomNotUsableHeightWithXLabels=bottomNotUsableHeightWithoutXLabels+F}else availableWidth=S-j-U;if(availableHeight=p-topNotUsableSize-bottomNotUsableHeightWithXLabels,dispCrossImage(t,e,S/2,p/2,S/2,p/2,!1,a,-1,-1),"function"==typeof e.initFunction&&e.initFunction("INITFUNCTION",t,a,null,-1,-1,{animationValue:0,cntiter:0,config:e,borderX:0,borderY:0,midPosX:0,midPosY:0}),"nihil"!=n){g>0&&(t.save(),t.beginPath(),t.setLineDash(lineStyleFn(e.canvasBordersStyle)),t.strokeStyle=e.canvasBordersColor,t.lineWidth=g,t.setLineDash(lineStyleFn(e.canvasBordersStyle)),t.strokeStyle=e.canvasBordersColor,t.drawRectangle({x:0+g/2,y:0+g/2,width:S-g,height:p-g,borderRadius:e.canvasBordersRadius,fill:!1,stroke:!0}),t.setLineDash([]),t.restore()),A>0&&(t.save(),t.beginPath(),t.font=e.graphTitleFontStyle+" "+Math.ceil(t.chartTextScale*e.graphTitleFontSize).toString()+"px "+e.graphTitleFontFamily,t.fillStyle=e.graphTitleFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,e.graphTitle,Math.ceil(t.chartTextScale*e.graphTitleFontSize),Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight))/2,x,e.graphTitleBorders,e.graphTitleBordersColor,Math.ceil(t.chartLineScale*e.graphTitleBordersWidth),Math.ceil(t.chartSpaceScale*e.graphTitleBordersXSpace),Math.ceil(t.chartSpaceScale*e.graphTitleBordersYSpace),e.graphTitleBordersStyle,e.graphTitleBackgroundColor,"GRAPHTITLE",e.graphTitleBordersRadius),t.translate(Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight))/2,x),t.fillTextMultiLine(e.graphTitle,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.graphTitleFontSize),!0,e.detectMouseOnText,t,"TITLE_TEXTMOUSE",0,Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight))/2,x,-1,-1),t.stroke(),t.restore()),m>0&&(t.save(),t.beginPath(),t.font=e.graphSubTitleFontStyle+" "+Math.ceil(t.chartTextScale*e.graphSubTitleFontSize).toString()+"px "+e.graphSubTitleFontFamily,t.fillStyle=e.graphSubTitleFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,e.graphSubTitle,Math.ceil(t.chartTextScale*e.graphSubTitleFontSize),Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight))/2,D,e.graphSubTitleBorders,e.graphSubTitleBordersColor,Math.ceil(t.chartLineScale*e.graphSubTitleBordersWidth),Math.ceil(t.chartSpaceScale*e.graphSubTitleBordersXSpace),Math.ceil(t.chartSpaceScale*e.graphSubTitleBordersYSpace),e.graphSubTitleBordersStyle,e.graphSubTitleBackgroundColor,"GRAPHSUBTITLE",e.graphSubTitleBordersRadius),t.translate(Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight))/2,D),t.fillTextMultiLine(e.graphSubTitle,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.graphSubTitleFontSize),!0,e.detectMouseOnText,t,"SUBTITLE_TEXTMOUSE",0,Math.ceil(t.chartSpaceScale*e.spaceLeft)+(S-Math.ceil(t.chartSpaceScale*e.spaceLeft)-Math.ceil(t.chartSpaceScale*e.spaceRight))/2,D,-1,-1),t.stroke(),t.restore()),T>0&&(e.yAxisLeft&&(t.save(),t.beginPath(),t.font=e.yAxisUnitFontStyle+" "+Math.ceil(t.chartTextScale*e.yAxisUnitFontSize).toString()+"px "+e.yAxisUnitFontFamily,t.fillStyle=e.yAxisUnitFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,e.yAxisUnit,Math.ceil(t.chartTextScale*e.yAxisUnitFontSize),j,v,e.yAxisUnitBorders,e.yAxisUnitBordersColor,Math.ceil(t.chartLineScale*e.yAxisUnitBordersWidth),Math.ceil(t.chartSpaceScale*e.yAxisUnitBordersXSpace),Math.ceil(t.chartSpaceScale*e.yAxisUnitBordersYSpace),e.yAxisUnitBordersStyle,e.yAxisUnitBackgroundColor,"YAXISUNIT",e.yAxisUnitBordersRadius),t.translate(j,v),t.fillTextMultiLine(e.yAxisUnit,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.yAxisUnitFontSize),!0,e.detectMouseOnText,t,"YLEFTAXISUNIT_TEXTMOUSE",0,j,v,-1,-1),t.stroke(),t.restore()),e.yAxisRight&&(""==e.yAxisUnit2&&(e.yAxisUnit2=e.yAxisUnit),t.save(),t.beginPath(),t.font=e.yAxisUnitFontStyle+" "+Math.ceil(t.chartTextScale*e.yAxisUnitFontSize).toString()+"px "+e.yAxisUnitFontFamily,t.fillStyle=e.yAxisUnitFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,e.yAxisUnit2,Math.ceil(t.chartTextScale*e.yAxisUnitFontSize),S-U,v,e.yAxisUnitBorders,e.yAxisUnitBordersColor,Math.ceil(t.chartLineScale*e.yAxisUnitBordersWidth),Math.ceil(t.chartSpaceScale*e.yAxisUnitBordersXSpace),Math.ceil(t.chartSpaceScale*e.yAxisUnitBordersYSpace),e.yAxisUnitBordersStyle,e.yAxisUnitBackgroundColor,"YAXISUNIT",e.yAxisUnitBordersRadius),t.translate(S-U,v),t.fillTextMultiLine(e.yAxisUnit2,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.yAxisUnitFontSize),!0,e.detectMouseOnText,t,"YRIGHTAXISUNIT_TEXTMOUSE",0,S-U,v,-1,-1),t.stroke(),t.restore())),N>0&&(e.yAxisLeft&&(t.save(),t.beginPath(),t.font=e.yAxisFontStyle+" "+Math.ceil(t.chartTextScale*e.yAxisFontSize).toString()+"px "+e.yAxisFontFamily,t.fillStyle=e.yAxisFontColor,t.textAlign="center",t.textBaseline="bottom",t.translate(C,topNotUsableSize+availableHeight/2),t.rotate(-(90*(Math.PI/180))),setTextBordersAndBackground(t,e.yAxisLabel,Math.ceil(t.chartTextScale*e.yAxisFontSize),0,0,e.yAxisLabelBorders,e.yAxisLabelBordersColor,Math.ceil(t.chartLineScale*e.yAxisLabelBordersWidth),Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersXSpace),Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersYSpace),e.yAxisLabelBordersStyle,e.yAxisLabelBackgroundColor,"YAXISLABELLEFT",e.yAxisLabelBordersRadius),t.fillTextMultiLine(e.yAxisLabel,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.yAxisFontSize),!1,e.detectMouseOnText,t,"YLEFTAXISLABEL_TEXTMOUSE",-(90*(Math.PI/180)),C,topNotUsableSize+availableHeight/2,-1,-1),t.stroke(),t.restore()),e.yAxisRight&&(""==e.yAxisLabel2&&(e.yAxisLabel2=e.yAxisLabel),t.save(),t.beginPath(),t.font=e.yAxisFontStyle+" "+Math.ceil(t.chartTextScale*e.yAxisFontSize).toString()+"px "+e.yAxisFontFamily,t.fillStyle=e.yAxisFontColor,t.textAlign="center",t.textBaseline="bottom",t.translate(w,topNotUsableSize+availableHeight/2),t.rotate(+(90*(Math.PI/180))),setTextBordersAndBackground(t,e.yAxisLabel2,Math.ceil(t.chartTextScale*e.yAxisFontSize),0,0,e.yAxisLabelBorders,e.yAxisLabelBordersColor,Math.ceil(t.chartLineScale*e.yAxisLabelBordersWidth),Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersXSpace),Math.ceil(t.chartSpaceScale*e.yAxisLabelBordersYSpace),e.yAxisLabelBordersStyle,e.yAxisLabelBackgroundColor,"YAXISLABELLEFT",e.yAxisLabelBordersRadius),t.fillTextMultiLine(e.yAxisLabel2,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.yAxisFontSize),!1,e.detectMouseOnText,t,"YRIGHTAXISLABEL_TEXTMOUSE",+(90*(Math.PI/180)),w,topNotUsableSize+availableHeight/2,-1,-1),t.stroke(),t.restore())),H>0&&e.xAxisBottom&&(t.save(),t.beginPath(),t.font=e.xAxisFontStyle+" "+Math.ceil(t.chartTextScale*e.xAxisFontSize).toString()+"px "+e.xAxisFontFamily,t.fillStyle=e.xAxisFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,e.xAxisLabel,Math.ceil(t.chartTextScale*e.xAxisFontSize),j+availableWidth/2,f,e.xAxisLabelBorders,e.xAxisLabelBordersColor,Math.ceil(t.chartLineScale*e.xAxisLabelBordersWidth),Math.ceil(t.chartSpaceScale*e.xAxisLabelBordersXSpace),Math.ceil(t.chartSpaceScale*e.xAxisLabelBordersYSpace),e.xAxisLabelBordersStyle,e.xAxisLabelBackgroundColor,"XAXISLABEL",e.xAxisLabelBordersRadius),t.translate(j+availableWidth/2,f),t.fillTextMultiLine(e.xAxisLabel,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.xAxisFontSize),!0,e.detectMouseOnText,t,"XAXISLABEL_TEXTMOUSE",0,j+availableWidth/2,f,-1,-1),t.stroke(),t.restore());var la;L>1||1==L&&e.showSingleLegend?(la={dispLegend:!0,xLegendBorderPos:B,yLegendBorderPos:R,legendBorderWidth:K,legendBorderHeight:Z,nbLegendCols:b,xFirstLegendTextPos:I,yFirstLegendTextPos:G,drawLegendOnData:h,reverseLegend:s,legendBox:d,widestLegend:y},(0==e.legendPosY||4==e.legendPosY||0==e.legendPosX||4==e.legendPosX)&&(drawLegend(la,a,e,t,u),la={dispLegend:!1})):la={dispLegend:!1},""!=e.footNote.trim()&&(t.save(),t.font=e.footNoteFontStyle+" "+Math.ceil(t.chartTextScale*e.footNoteFontSize).toString()+"px "+e.footNoteFontFamily,t.fillStyle=e.footNoteFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,e.footNote,Math.ceil(t.chartTextScale*e.footNoteFontSize),j+availableWidth/2,M,e.footNoteBorders,e.footNoteBordersColor,Math.ceil(t.chartLineScale*e.footNoteBordersWidth),Math.ceil(t.chartSpaceScale*e.footNoteBordersXSpace),Math.ceil(t.chartSpaceScale*e.footNoteBordersYSpace),e.footNoteBordersStyle,e.footNoteBackgroundColor,"FOOTNOTE",e.footNoteBordersRadius),t.translate(j+availableWidth/2,M),t.fillTextMultiLine(e.footNote,0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.footNoteFontSize),!0,e.detectMouseOnText,t,"FOOTNOTE_TEXTMOUSE",0,j+availableWidth/2,M,-1,-1),t.stroke(),t.restore())}return clrx=j,clrwidth=availableWidth,clry=topNotUsableSize,clrheight=availableHeight,{leftNotUsableSize:j,rightNotUsableSize:U,availableWidth:availableWidth,topNotUsableSize:topNotUsableSize,bottomNotUsableHeightWithoutXLabels:bottomNotUsableHeightWithoutXLabels,bottomNotUsableHeightWithXLabels:bottomNotUsableHeightWithXLabels,availableHeight:availableHeight,widestXLabel:k,highestXLabel:E,widestYLabel:z,widestYLabel2:Y,highestYLabel:W,rotateLabels:_,xLabelPos:J,clrx:clrx,clry:clry,clrwidth:clrwidth,clrheight:clrheight,legendMsr:la}}function drawLinesDataset(a,e,t,i,l,n){function o(a,n,o,s){0==setOptionValue(!0,!0,1,"LINKTYPE",i,e,l,e.datasets[s].linkType,t.linkType,"linkType",s,v,{nullvalue:null})&&setOptionValue(!0,!0,1,"BEZIERCURVE",i,e,l,void 0,t.bezierCurve,"bezierCurve",s,-1,{nullValue:!0})&&(a.length=0,a.push(n),a.push(o)),m=o}function s(a,e,t,i){return yposOrigin="undefined","undefined"!=typeof i[a][e].yPosOffsetOrigin&&(yposOrigin=i[a][e].yAxisPos-x.mainVal*i[a][e].yPosOffsetOrigin),yposOrigin}function r(a,e,t,i,l,n,o,s,r){0==setOptionValue(!0,!0,1,"LINKTYPE",e,n,o,n.datasets[s].linkType,l.linkType,"linkType",s,v,{nullvalue:null})&&setOptionValue(!0,!0,1,"BEZIERCURVE",e,n,o,void 0,l.bezierCurve,"bezierCurve",s,-1,{nullValue:!0})?(a.push(t),a.push(i)):0==setOptionValue(!0,!0,1,"LINKTYPE",e,n,o,n.datasets[s].linkType,l.linkType,"linkType",s,v,{nullvalue:null})?e.lineTo(t,i):1==setOptionValue(!0,!0,1,"LINKTYPE",e,n,o,n.datasets[s].linkType,l.linkType,"linkType",s,v,{nullvalue:null})?("undefined"!=r?e.moveTo(t,r):e.moveTo(t,o[s][0].xAxisPosY-o[s][0].zeroY),e.lineTo(t,i)):2==setOptionValue(!0,!0,1,"LINKTYPE",e,n,o,n.datasets[s].linkType,l.linkType,"linkType",s,v,{nullvalue:null})&&"undefined"!=typeof m&&(e.lineTo(t,m),e.lineTo(t,i),m=i)}function c(a,t,i,n){0==setOptionValue(!0,!0,1,"LINKTYPE",t,e,l,e.datasets[n].linkType,i.linkType,"linkType",n,v,{nullvalue:null})&&setOptionValue(!0,!0,1,"BEZIERCURVE",t,e,l,void 0,i.bezierCurve,"bezierCurve",n,-1,{nullValue:!0})&&(minimumpos=l[n][0].xAxisPosY,maximumpos=l[n][0].xAxisPosY-l[n][0].calculatedScale.steps*l[n][0].scaleHop,d(t,a,setOptionValue(!0,!0,1,"BEZIERCURVETENSION",t,e,l,void 0,i.bezierCurveTension,"bezierCurveTension",n,-1,{nullValue:!0}),minimumpos,maximumpos),a.length=0),m=void 0}function h(a,e,t,i,l,n,o){var s=Math.sqrt(Math.pow(t-a,2)+Math.pow(i-e,2)),r=Math.sqrt(Math.pow(l-t,2)+Math.pow(n-i,2)),c=o*s/(s+r),h=o-c,d=t+c*(a-l),u=i+c*(e-n),p=t-h*(a-l),S=i-h*(e-n);return[d,u,p,S]}function d(a,i,n,o,s){var r=[],c=i.length;if(i.push(2*i[c-2]-i[c-4]),i.push(2*i[c-1]-i[c-3]),4==c)return a.moveTo(i[0],i[1]),void a.lineTo(i[2],i[3]);for(var d=0;c-2>d;d+=2)r=r.concat(h(i[d],i[d+1],i[d+2],i[d+3],i[d+4],i[d+5],n));for(a.beginPath(),a.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",a,e,l,e.datasets[P].strokeColor,t.defaultStrokeColor,"strokeColor",P,v,{nullvalue:null}),a.lineWidth=Math.ceil(a.chartLineScale*setOptionValue(!0,!0,1,"LINEWIDTH",a,e,l,e.datasets[P].datasetStrokeWidth,t.datasetStrokeWidth,"datasetStrokeWidth",P,v,{nullvalue:null})),a.moveTo(i[0],i[1]),a.quadraticCurveTo(r[0],Math.max(Math.min(r[1],o),s),i[2],i[3]),a.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",a,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),d=2;d<i.length-4;d+=2)u=Math.max(Math.min(r[2*d-1],o),s),p=Math.max(Math.min(r[2*d+1],o),s),a.bezierCurveTo(r[2*d-2],u,r[2*d],p,i[d+2],i[d+3]);a.stroke()}for(var u,p,S,g,f,A,x,m,D=[],P=0;P<e.datasets.length;P++)if(1==setOptionValue(!0,!0,1,"ANIMATION",i,e,l,e.datasets[P].animation,t.animation,"animation",P,-1,{nullvalue:null})||a>=1){if(m="undefined","Line"!=l[P][0].tpchart)continue;if(0==l[P].length)continue;if(-1==l[P][0].firstNotMissing)continue;i.save(),i.beginPath(),prevAnimPc={mainVal:0,subVal:0,animVal:0};for(var M=-1,T=-1,v=l[P][0].firstNotMissing;v<=l[P][0].lastNotMissing;v++)if(todisplay=!0,0==setOptionValue(!0,!0,1,"DISPLAYDATA",i,e,l,e.datasets[P].displayData,t.displayData,"displayData",P,v,{nullvalue:null})&&(todisplay=!1),0==setOptionValue(!0,!0,1,"DISPLAYDATA",i,e,l,e.displayData,t.displayData,"displayData",v,-1,{nullvalue:null})&&(todisplay=!1),"undefined"==typeof e.datasets[P].data[v]&&(todisplay=!1),!(0==prevAnimPc.animVal&&v>l[P][0].firstNotMissing))if(x=animationCorrection(a,e,t,P,v,!0),0==x.mainVal&&prevAnimPc.mainVal>0&&-1!=M)i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),t.extrapolateMissingData?(u=l[P][l[P][v].prevNotMissing].yAxisPos-prevAnimPc.mainVal*l[P][l[P][v].prevNotMissing].yPosOffset,p=l[P][v].yAxisPos-prevAnimPc.mainVal*l[P][l[P][v-1].nextNotMissing].yPosOffset,g=l[P][v-1].nextNotMissing-l[P][v].prevNotMissing,f=v-1-l[P][v].prevNotMissing,A=(f+prevAnimPc.subVal)/g,S=u+A*(p-u),r(D,i,l[P][l[P][v].prevNotMissing].xPos+A*(l[P][l[P][v-1].nextNotMissing].xPos-l[P][l[P][v].prevNotMissing].xPos),S,t,e,l,P,s(P,v,e,l)),c(D,i,t,P),i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle="rgba(0,0,0,0)",t.datasetFill&&1!=setOptionValue(!0,!0,1,"LINKTYPE",i,e,l,e.datasets[P].linkType,t.linkType,"linkType",P,v,{nullvalue:null})&&(i.lineTo(l[P][l[P][v].prevNotMissing].xPos+A*(l[P][l[P][v-1].nextNotMissing].xPos-l[P][l[P][v].prevNotMissing].xPos),l[P][v].yAxisPos),i.lineTo(l[P][M].xPos,l[P][M].xAxisPosY-l[P][0].zeroY),i.closePath(),i.fillStyle=setOptionValue(!0,!0,1,"COLOR",i,e,l,e.datasets[P].fillColor,t.defaultFillColor,"fillColor",P,v,{animationValue:x.mainVal,xPosLeft:l[P][0].xPos,yPosBottom:Math.max(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lminvalue_offset),xPosRight:l[P][e.datasets[P].data.length-1].xPos,yPosTop:Math.min(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lmaxvalue_offset)}),i.fill(),M=-1)):1==todisplay&&(r(D,i,l[P][v-1].xPos+prevAnimPc.subVal*(l[P][v].xPos-l[P][v-1].xPos),l[P][v].yAxisPos-prevAnimPc.mainVal*l[P][l[P][v-1].nextNotMissing].yPosOffset,t,e,l,P,s(P,v,e,l)),c(D,i,t,P),i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle="rgba(0,0,0,0)",t.datasetFill&&1!=setOptionValue(!0,!0,1,"LINKTYPE",i,e,l,e.datasets[P].linkType,t.linkType,"linkType",P,v,{nullvalue:null})&&(i.lineTo(l[P][v-1].xPos+prevAnimPc.subVal*(l[P][v].xPos-l[P][v-1].xPos),l[P][v].yAxisPos),i.lineTo(l[P][M].xPos,l[P][M].xAxisPosY-l[P][0].zeroY),i.closePath(),i.fillStyle=setOptionValue(!0,!0,1,"COLOR",i,e,l,e.datasets[P].fillColor,t.defaultFillColor,"fillColor",P,v,{animationValue:x.mainVal,xPosLeft:l[P][0].xPos,yPosBottom:Math.max(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lminvalue_offset),xPosRight:l[P][e.datasets[P].data.length-1].xPos,yPosTop:Math.min(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lmaxvalue_offset)}),i.fill())),prevAnimPc=x;else switch(0==x.totVal?(i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle="rgba(0,0,0,0)"):(i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",i,e,l,e.datasets[P].strokeColor,t.defaultStrokeColor,"strokeColor",P,v,{nullvalue:null})),prevAnimPc=x,todisplay){case!1:if(t.extrapolateMissingData)x.subVal>0&&(T=l[P][v].xPos+x.subVal*(l[P][v+1].xPos-l[P][v].xPos),u=l[P][l[P][v+1].prevNotMissing].yAxisPos-l[P][l[P][v+1].prevNotMissing].yPosOffset,p=l[P][l[P][v].nextNotMissing].yAxisPos-l[P][l[P][v].nextNotMissing].yPosOffset,g=l[P][v].nextNotMissing-l[P][v+1].prevNotMissing,f=v-l[P][v+1].prevNotMissing,A=(f+prevAnimPc.subVal)/g,S=u+A*(p-u),r(D,i,l[P][l[P][v].prevNotMissing].xPos+A*(l[P][l[P][v-1].nextNotMissing].xPos-l[P][l[P][v].prevNotMissing].xPos),S,t,e,l,P,s(P,v,e,l)));else{if(-1==M)continue;c(D,i,t,P),i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),t.datasetFill&&-1!=M&&1!=setOptionValue(!0,!0,1,"LINKTYPE",i,e,l,e.datasets[P].linkType,t.linkType,"linkType",P,v,{nullvalue:null})&&(T=-1,i.strokeStyle="rgba(0,0,0,0)",i.lineTo(l[P][v-1].xPos,l[P][v-1].yAxisPos),i.lineTo(l[P][M].xPos,l[P][M].yAxisPos),i.closePath(),i.fillStyle=setOptionValue(!0,!0,1,"COLOR",i,e,l,e.datasets[P].fillColor,t.defaultFillColor,"fillColor",P,v,{animationValue:x.mainVal,xPosLeft:l[P][0].xPos,yPosBottom:Math.max(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lminvalue_offset),xPosRight:l[P][e.datasets[P].data.length-1].xPos,yPosTop:Math.min(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lmaxvalue_offset)}),i.fill()),i.beginPath(),prevAnimPc={mainVal:0,subVal:0},M=-1}break;default:i.lineWidth=Math.ceil(i.chartLineScale*setOptionValue(!0,!0,1,"LINEWIDTH",i,e,l,e.datasets[P].datasetStrokeWidth,t.datasetStrokeWidth,"datasetStrokeWidth",P,v,{nullvalue:null})),-1==M?(M=v,i.beginPath(),1==setOptionValue(!0,!0,1,"LINKTYPE",i,e,l,e.datasets[P].linkType,t.linkType,"linkType",P,v,{nullvalue:null})?("undefined"!=typeof l[P][v].yPosOffsetOrigin?i.moveTo(l[P][v].xPos,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffsetOrigin):i.moveTo(l[P][M].xPos,l[P][M].xAxisPosY-l[P][0].zeroY),i.lineTo(l[P][v].xPos,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset)):i.moveTo(l[P][v].xPos,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset),o(D,l[P][v].xPos,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset,P),T=l[P][v].xPos):(T=l[P][v].xPos,r(D,i,l[P][v].xPos,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset,t,e,l,P,s(P,v,e,l))),x.subVal>0&&-1!=l[P][v].nextNotMissing&&(t.extrapolateMissing||l[P][v].nextNotMissing==v+1)&&(T=l[P][v].xPos+x.subVal*(l[P][v+1].xPos-l[P][v].xPos),u=l[P][l[P][v+1].prevNotMissing].yAxisPos-l[P][l[P][v+1].prevNotMissing].yPosOffset,p=l[P][l[P][v].nextNotMissing].yAxisPos-l[P][l[P][v].nextNotMissing].yPosOffset,S=u+x.subVal*(p-u),r(D,i,l[P][v].xPos+x.subVal*(l[P][l[P][v].nextNotMissing].xPos-l[P][v].xPos),S,t,e,l,P,s(P,v,e,l)))}if(c(D,i,t,P),i.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",i,e,l,e.datasets[P].datasetStrokeStyle,t.datasetStrokeStyle,"datasetStrokeStyle",P,v,{nullvalue:null}))),i.stroke(),i.setLineDash([]),t.datasetFill&&1!=setOptionValue(!0,!0,1,"LINKTYPE",i,e,l,e.datasets[P].linkType,t.linkType,"linkType",P,v,{nullvalue:null})&&M>=0&&(i.strokeStyle="rgba(0,0,0,0)",i.lineTo(T,l[P][0].xAxisPosY-l[P][0].zeroY),i.lineTo(l[P][M].xPos,l[P][M].xAxisPosY-l[P][0].zeroY),i.closePath(),i.fillStyle=setOptionValue(!0,!0,1,"COLOR",i,e,l,e.datasets[P].fillColor,t.defaultFillColor,"fillColor",P,-1,{animationValue:x.mainVal,xPosLeft:l[P][0].xPos,yPosBottom:Math.max(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lminvalue_offset),xPosRight:l[P][e.datasets[P].data.length-1].xPos,yPosTop:Math.min(l[P][0].yAxisPos,l[P][0].yAxisPos-(t.animationLeftToRight?1:1*x.mainVal)*l[P][0].lmaxvalue_offset)}),i.fill()),i.restore(),a>=1)for(v=0;v<e.datasets[P].data.length;v++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",i,e,l,e.datasets[P].displayData,t.displayData,"displayData",P,v,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",i,e,l,e.displayData,t.displayData,"displayData",v,-1,{
nullvalue:null})&&"undefined"!=typeof e.datasets[P].data[v]&&(x=animationCorrection(a,e,t,P,v,!0),(x.mainVal>0||!t.animationLeftToRight)&&setOptionValue(!0,!0,1,"POINTDOT",i,e,l,void 0,t.pointDot,"pointDot",P,v,{nullvalue:null}))){i.beginPath(),i.fillStyle=setOptionValue(!0,!0,1,"MARKERFILLCOLOR",i,e,l,e.datasets[P].pointColor,t.defaultStrokeColor,"pointColor",P,v,{nullvalue:!0}),i.strokeStyle=setOptionValue(!0,!0,1,"MARKERSTROKESTYLE",i,e,l,e.datasets[P].pointStrokeColor,t.defaultStrokeColor,"pointStrokeColor",P,v,{nullvalue:!0}),i.lineWidth=setOptionValue(!0,!0,i.chartLineScale,"MARKERLINEWIDTH",i,e,l,e.datasets[P].pointDotStrokeWidth,t.pointDotStrokeWidth,"pointDotStrokeWidth",P,v,{nullvalue:!0});var y=setOptionValue(!0,!0,1,"MARKERSHAPE",i,e,l,e.datasets[P].markerShape,t.markerShape,"markerShape",P,v,{nullvalue:!0}),L=setOptionValue(!0,!0,i.chartSpaceScale,"MARKERRADIUS",i,e,l,e.datasets[P].pointDotRadius,t.pointDotRadius,"pointDotRadius",P,v,{nullvalue:!0}),V=setOptionValue(!0,!0,1,"MARKERSTROKESTYLE",i,e,l,e.datasets[P].pointDotStrokeStyle,t.pointDotStrokeStyle,"pointDotStrokeStyle",P,v,{nullvalue:!0});drawMarker(i,l[P][v].xPos,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset,y,L,V)}if(a>=t.animationStopValue)for(v=0;v<e.datasets[P].data.length;v++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",i,e,l,e.datasets[P].displayData,t.displayData,"displayData",P,v,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",i,e,l,e.displayData,t.displayData,"displayData",v,-1,{nullvalue:null})&&"undefined"!=typeof e.datasets[P].data[v]&&(0!=e.datasets[P].mouseDetection&&(jsGraphAnnotate[i.ChartNewId][jsGraphAnnotate[i.ChartNewId].length]=["POINT",P,v,l,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",i,e,l,e.datasets[P].annotateDisplay,t.annotateDisplay,"annotateDisplay",P,v,{nullValue:!0})]),setOptionValue(!0,!0,1,"INGRAPHDATASHOW",i,e,l,e.datasets[P].inGraphDataShow,t.inGraphDataShow,"inGraphDataShow",P,v,{nullValue:!0}))){i.save(),i.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",i,e,l,void 0,t.inGraphDataAlign,"inGraphDataAlign",P,v,{nullValue:!0}),i.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",i,e,l,void 0,t.inGraphDataVAlign,"inGraphDataVAlign",P,v,{nullValue:!0}),i.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",i,e,l,void 0,t.inGraphDataFontStyle,"inGraphDataFontStyle",P,v,{nullValue:!0})+" "+setOptionValue(!0,!0,i.chartTextScale,"INGRAPHDATAFONTSIZE",i,e,l,void 0,t.inGraphDataFontSize,"inGraphDataFontSize",P,v,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",i,e,l,void 0,t.inGraphDataFontFamily,"inGraphDataFontFamily",P,v,{nullValue:!0}),i.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",i,e,l,void 0,t.inGraphDataFontColor,"inGraphDataFontColor",P,v,{nullValue:!0});var b=setOptionValue(!0,!0,i.chartSpaceScale,"INGRAPHDATAPADDINGX",i,e,l,void 0,t.inGraphDataPaddingX,"inGraphDataPaddingX",P,v,{nullValue:!0}),O=setOptionValue(!0,!0,i.chartSpaceScale,"INGRAPHDATAPADDINGY",i,e,l,void 0,t.inGraphDataPaddingY,"inGraphDataPaddingY",P,v,{nullValue:!0}),I=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",i,e,l,void 0,t.inGraphDataTmpl,"inGraphDataTmpl",P,v,{nullValue:!0}),l[P][v],t);i.translate(l[P][v].xPos+b,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset-O);var G=setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",i,e,l,void 0,t.inGraphDataRotate,"inGraphDataRotate",P,v,{nullValue:!0})*(Math.PI/180);i.rotate(G),setTextBordersAndBackground(i,I,setOptionValue(!0,!0,i.chartTextScale,"INGRAPHDATAFONTSIZE",i,e,l,void 0,t.inGraphDataFontSize,"inGraphDataFontSize",P,v,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",i,e,l,void 0,t.inGraphDataBorders,"inGraphDataBorders",P,v,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",i,e,l,void 0,t.inGraphDataBordersColor,"inGraphDataBordersColor",P,v,{nullValue:!0}),setOptionValue(!0,!0,i.chartLineScale,"INGRAPHDATABORDERSWIDTH",i,e,l,void 0,t.inGraphDataBordersWidth,"inGraphDataBordersWidth",P,v,{nullValue:!0}),setOptionValue(!0,!0,i.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",i,e,l,void 0,t.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",P,v,{nullValue:!0}),setOptionValue(!0,!0,i.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",i,e,l,void 0,t.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",P,v,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",i,e,l,void 0,t.inGraphDataBordersStyle,"inGraphDataBordersStyle",P,v,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",i,e,l,void 0,t.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",P,v,{nullValue:!0}),"INGRAPHDATA",t.inGraphDataBordersRadius),i.fillTextMultiLine(I,0,0,i.textBaseline,setOptionValue(!0,!0,i.chartTextScale,"INGRAPHDATAFONTSIZE",i,e,l,void 0,t.inGraphDataFontSize,"inGraphDataFontSize",P,v,{nullValue:!0}),!0,t.detectMouseOnText,i,"INGRAPHDATA_TEXTMOUSE",G,l[P][v].xPos+b,l[P][v].yAxisPos-x.mainVal*l[P][v].yPosOffset-O,P,v),i.restore()}}i.setLineDash([])}function log10(a){return Math.log(a)/Math.LN10}function setRect(a,e){e.clearRect?e.multiGraph||(clear(a),a.clearRect(0,0,width,height)):(clear(a),a.clearRect(0,0,width,height),a.fillStyle=e.savePngBackgroundColor,a.strokeStyle=e.savePngBackgroundColor,a.beginPath(),a.moveTo(0,0),a.lineTo(0,a.canvas.height),a.lineTo(a.canvas.width,a.canvas.height),a.lineTo(a.canvas.width,0),a.lineTo(0,0),a.stroke(),a.fill())}function defMouse(a,e,t){function i(a,e){a.mouseAction.indexOf("/"+e)>=0?a.mouseAction[a.mouseAction.indexOf("/"+e)]=e:a.mouseAction.indexOf(e)<0&&(a.mouseAction[a.mouseAction.length]=e)}function l(a,e){isIE()<9&&0!=isIE()?a.canvas.attachEvent("on"+e.split(" ")[0],function(t){doMouseAction(t,a.ChartNewId,e.split(" ")[0])}):a.canvas.addEventListener(e.split(" ")[0],function(t){doMouseAction(t,a,e.split(" ")[0])},!1)}var n=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";if("undefined"==typeof a.mouseAction)a.mouseAction=[];else for(var o=0;o<a.mouseAction;o++)"/"!=a.mouseAction.substring(0,1)&&(a.mouseAction[o]="/"+a.mouseAction[o]);1==t.savePng&&("mousedown left"==t.savePngFunction?i(a,"mousedown 1"):"mousedown middle"==t.savePngFunction?i(a,"mousedown 2"):"mousedown right"==t.savePngFunction&&i(a,"mousedown 3")),1==t.annotateDisplay&&(0==cursorDivCreated&&(oCursor=new makeCursorObj("divCursor")),"mousedown left"==t.annotateFunction?i(a,"mousedown 1"):"mousedown middle"==t.annotateFunction?i(a,"mousedown 2"):"mousedown right"==t.annotateFunction?i(a,"mousedown 3"):"mousemove"==t.annotateFunction&&i(a,"mousemove")),1==t.highLight&&("mousedown left"==t.highLightMouseFunction?i(a,"mousedown 1"):"mousedown middle"==t.highLightMouseFunction?i(a,"mousedown 2"):"mousedown right"==t.highLightMouseFunction?i(a,"mousedown 3"):"mousemove"==t.highLightMouseFunction&&i(a,"mousemove")),"function"==typeof t.mouseMove&&i(a,"mousemove"),"function"==typeof t.mouseDownLeft&&i(a,"mousedown 1"),"function"==typeof t.mouseDownMiddle&&i(a,"mousedown 2"),"function"==typeof t.mouseDownRight&&i(a,"mousedown 3"),"function"==typeof t.mouseWheel&&i(a,n),"function"==typeof t.mouseOut&&i(a,"mouseout"),"function"==typeof t.mouseDblClick&&i(a,"dblclick");var s=!1;(a.mouseAction.indexOf("mousemove")>=0&&a.mouseAction.indexOf("/mousemove")<0||a.mouseAction.indexOf("mouseout")>=0&&a.mouseAction.indexOf("/mouseout")<0)&&(i(a,"mouseout"),s=!0,l(a,"mouseout")),(a.mouseAction.indexOf("mousemove")>=0&&a.mouseAction.indexOf("/mousemove")<0||a.mouseAction.indexOf(n)>=0&&a.mouseAction.indexOf("/"+n)<0)&&(i(a,n),s=!0,l(a,n)),a.mouseAction.indexOf("mousemove")>=0&&a.mouseAction.indexOf("/mousemove")<0&&(s=!0,l(a,"mousemove")),a.mouseAction.indexOf("dblclick")>=0&&a.mouseAction.indexOf("/dblclick")<0&&(s=!0,l(a,"dblclick")),(a.mouseAction.indexOf("mousedown 1")>=0&&a.mouseAction.indexOf("/mousedown 1")<0||a.mouseAction.indexOf("mousedown 2")>=0&&a.mouseAction.indexOf("/mousedown 2")<0||a.mouseAction.indexOf("mousedown 3")>=0&&a.mouseAction.indexOf("/mousedown 3")<0)&&(s=!0,l(a,"mousedown")),(0==t.contextMenu||a.mouseAction.indexOf("mousedown 3")>=0)&&a.mouseAction.indexOf("/removeContextMenu")<0&&(a.mouseAction[a.mouseAction.length]="removeContextMenu",a.canvas.oncontextmenu=function(a){a.preventDefault()}),inMouseAction[a.ChartNewId]=!1,mouseActionData[a.ChartNewId]={data:e,config:t,prevShow:-1}}var chart=this,animationOptions={linear:function(a){return a},easeInQuad:function(a){return a*a},easeOutQuad:function(a){return-1*a*(a-2)},easeInOutQuad:function(a){return(a/=.5)<1?.5*a*a:-0.5*(--a*(a-2)-1)},easeInCubic:function(a){return a*a*a},easeOutCubic:function(a){return 1*((a=a/1-1)*a*a+1)},easeInOutCubic:function(a){return(a/=.5)<1?.5*a*a*a:.5*((a-=2)*a*a+2)},easeInQuart:function(a){return a*a*a*a},easeOutQuart:function(a){return-1*((a=a/1-1)*a*a*a-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*a*a*a*a:-0.5*((a-=2)*a*a*a-2)},easeInQuint:function(a){return 1*(a/=1)*a*a*a*a},easeOutQuint:function(a){return 1*((a=a/1-1)*a*a*a*a+1)},easeInOutQuint:function(a){return(a/=.5)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)},easeInSine:function(a){return-1*Math.cos(a/1*(Math.PI/2))+1},easeOutSine:function(a){return 1*Math.sin(a/1*(Math.PI/2))},easeInOutSine:function(a){return-0.5*(Math.cos(Math.PI*a/1)-1)},easeInExpo:function(a){return 0==a?1:1*Math.pow(2,10*(a/1-1))},easeOutExpo:function(a){return 1==a?1:1*(-Math.pow(2,-10*a/1)+1)},easeInOutExpo:function(a){return 0==a?0:1==a?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return a>=1?a:-1*(Math.sqrt(1-(a/=1)*a)-1)},easeOutCirc:function(a){return 1*Math.sqrt(1-(a=a/1-1)*a)},easeInOutCirc:function(a){return(a/=.5)<1?-0.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeInElastic:function(a){var e=1.70158,t=0,i=1;return 0==a?0:1==(a/=1)?1:(t||(t=.3),i<Math.abs(1)?(i=1,e=t/4):e=t/(2*Math.PI)*Math.asin(1/i),-(i*Math.pow(2,10*(a-=1))*Math.sin((1*a-e)*(2*Math.PI)/t)))},easeOutElastic:function(a){var e=1.70158,t=0,i=1;return 0==a?0:1==(a/=1)?1:(t||(t=.3),i<Math.abs(1)?(i=1,e=t/4):e=t/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*a)*Math.sin((1*a-e)*(2*Math.PI)/t)+1)},easeInOutElastic:function(a){var e=1.70158,t=0,i=1;return 0==a?0:2==(a/=.5)?1:(t||(t=1*(.3*1.5)),i<Math.abs(1)?(i=1,e=t/4):e=t/(2*Math.PI)*Math.asin(1/i),1>a?-.5*(i*Math.pow(2,10*(a-=1))*Math.sin((1*a-e)*(2*Math.PI)/t)):i*Math.pow(2,-10*(a-=1))*Math.sin((1*a-e)*(2*Math.PI)/t)*.5+1)},easeInBack:function(a){var e=1.70158;return 1*(a/=1)*a*((e+1)*a-e)},easeOutBack:function(a){var e=1.70158;return 1*((a=a/1-1)*a*((e+1)*a+e)+1)},easeInOutBack:function(a){var e=1.70158;return(a/=.5)<1?.5*(a*a*(((e*=1.525)+1)*a-e)):.5*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)},easeInBounce:function(a){return 1-animationOptions.easeOutBounce(1-a)},easeOutBounce:function(a){return(a/=1)<1/2.75?1*(7.5625*a*a):2/2.75>a?1*(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?1*(7.5625*(a-=2.25/2.75)*a+.9375):1*(7.5625*(a-=2.625/2.75)*a+.984375)},easeInOutBounce:function(a){return.5>a?.5*animationOptions.easeInBounce(2*a):.5*animationOptions.easeOutBounce(2*a-1)+.5}},width=context.canvas.width,height=context.canvas.height;this.Doughnut=function(a,e){chart.Doughnut.defaults=chart.defaults.PieAndDoughnutV2,chart.Doughnut.defaults=mergeChartConfig(chart.defaults.PieAndDoughnut,chart.Doughnut.defaults),isIE()<9&&0!=isIE()&&(chart.Doughnut.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.Doughnut.defaults)),chart.Doughnut.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.Doughnut.defaults),chart.Doughnut.defaults=mergeChartConfig(chart.Doughnut.defaults,charJSPersonalDefaultOptions),chart.Doughnut.defaults=mergeChartConfig(chart.Doughnut.defaults,charJSPersonalDefaultOptionsDoughnut);var t=e?mergeChartConfig(chart.Doughnut.defaults,e):chart.Doughnut.defaults;return new Doughnut(a,t,context)},this.PolarArea=function(a,e){chart.PolarArea.defaults=chart.defaults.PolarAreaV2,chart.PolarArea.defaults=mergeChartConfig(chart.defaults.PolarArea,chart.PolarArea.defaults),isIE()<9&&0!=isIE()&&(chart.PolarArea.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.PolarArea.defaults)),chart.PolarArea.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.PolarArea.defaults),chart.PolarArea.defaults=mergeChartConfig(chart.PolarArea.defaults,charJSPersonalDefaultOptions),chart.PolarArea.defaults=mergeChartConfig(chart.PolarArea.defaults,charJSPersonalDefaultOptionsPolarArea);var t=e?mergeChartConfig(chart.PolarArea.defaults,e):chart.PolarArea.defaults;return new PolarArea(a,t,context)},this.PolarArea=function(a,e){chart.PolarArea.defaults=chart.defaults.PolarAreaV2,chart.PolarArea.defaults=mergeChartConfig(chart.defaults.PolarArea,chart.PolarArea.defaults),isIE()<9&&0!=isIE()&&(chart.PolarArea.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.PolarArea.defaults)),chart.PolarArea.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.PolarArea.defaults),chart.PolarArea.defaults=mergeChartConfig(chart.PolarArea.defaults,charJSPersonalDefaultOptions),chart.PolarArea.defaults=mergeChartConfig(chart.PolarArea.defaults,charJSPersonalDefaultOptionsPolarArea);var t=e?mergeChartConfig(chart.PolarArea.defaults,e):chart.PolarArea.defaults;return new PolarArea(a,t,context)},this.Radar=function(a,e){chart.Radar.defaults={highLightSet:{pointDotRadius:15,pointDot:!0},inGraphDataShow:!1,inGraphDataPaddingRadius:5,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,yAxisMinimumInterval:"none",scaleGridLinesStep:1,scaleOverlay:!1,scaleOverride:!1,scaleOverride2:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineStyle:"solid",scaleLineWidth:1,scaleShowLabels:!1,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,angleShowLineOut:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineStyle:"solid",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:12,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointDotStrokeStyle:"solid",datasetFill:!0,datasetStrokeWidth:2,datasetStrokeStyle:"solid",animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3%>",pointHitDetectionRadius:10,startAngle:90},isIE()<9&&0!=isIE()&&(chart.Radar.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.Radar.defaults)),chart.Radar.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.Radar.defaults),chart.Radar.defaults=mergeChartConfig(chart.Radar.defaults,charJSPersonalDefaultOptions),chart.Radar.defaults=mergeChartConfig(chart.Radar.defaults,charJSPersonalDefaultOptionsRadar);var t=e?mergeChartConfig(chart.Radar.defaults,e):chart.Radar.defaults;return new Radar(a,t,context)},this.Pie=function(a,e){chart.Pie.defaults=chart.defaults.PieAndDoughnutV2,chart.Pie.defaults=mergeChartConfig(chart.defaults.PieAndDoughnut,chart.Pie.defaults),isIE()<9&&0!=isIE()&&(chart.Pie.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.Pie.defaults)),chart.Pie.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.Pie.defaults),chart.Pie.defaults=mergeChartConfig(chart.Pie.defaults,charJSPersonalDefaultOptions),chart.Pie.defaults=mergeChartConfig(chart.Pie.defaults,charJSPersonalDefaultOptionsPie);var t=e?mergeChartConfig(chart.Pie.defaults,e):chart.Pie.defaults;return new Pie(a,t,context)},this.Doughnut=function(a,e){chart.Doughnut.defaults=chart.defaults.PieAndDoughnutV2,chart.Doughnut.defaults=mergeChartConfig(chart.defaults.PieAndDoughnut,chart.Doughnut.defaults),isIE()<9&&0!=isIE()&&(chart.Doughnut.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.Doughnut.defaults)),chart.Doughnut.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.Doughnut.defaults),chart.Doughnut.defaults=mergeChartConfig(chart.Doughnut.defaults,charJSPersonalDefaultOptions),chart.Doughnut.defaults=mergeChartConfig(chart.Doughnut.defaults,charJSPersonalDefaultOptionsDoughnut);var t=e?mergeChartConfig(chart.Doughnut.defaults,e):chart.Doughnut.defaults;return new Doughnut(a,t,context)},this.Line=function(a,e){chart.Line.defaults={inGraphDataShow:!1,highLightSet:{pointDotRadius:15,pointDot:!0},inGraphDataPaddingX:3,inGraphDataPaddingY:3,inGraphDataTmpl:"<%=v3%>",inGraphDataAlign:"left",inGraphDataVAlign:"bottom",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",drawXScaleLine:[{position:"bottom"}],scaleOverlay:!1,scaleOverride:!1,scaleOverride2:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleSteps2:null,scaleStepWidth2:null,scaleStartValue2:null,scaleLabel2:"<%=value%>",scaleLineColor:"rgba(0,0,0,.1)",scaleLineStyle:"solid",scaleLineWidth:1,scaleShowLabels:!0,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineStyle:"solid",scaleGridLineWidth:1,showYAxisMin:!0,rotateLabels:"smart",logarithmic:!1,logarithmic2:!1,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,bezierCurve:!0,linkType:0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeStyle:"solid",pointDotStrokeWidth:2,datasetStrokeStyle:"solid",datasetStrokeWidth:2,datasetFill:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",extrapolateMissingData:!0,onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3%>",pointHitDetectionRadius:10},isIE()<9&&0!=isIE()&&(chart.Line.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.Line.defaults)),chart.Line.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.Line.defaults),chart.Line.defaults=mergeChartConfig(chart.defaults.xyAxisCommonOptions,chart.Line.defaults),chart.Line.defaults=mergeChartConfig(chart.Line.defaults,charJSPersonalDefaultOptions),chart.Line.defaults=mergeChartConfig(chart.Line.defaults,charJSPersonalDefaultOptionsLine);var t=e?mergeChartConfig(chart.Line.defaults,e):chart.Line.defaults;return new Line(a,t,context)},this.StackedBar=function(a,e){chart.StackedBar.defaults={annotateBarMinimumDetectionHeight:0,highLightSet:{pointDotRadius:15,barStrokeWidth:5,pointDot:!0},inGraphDataShow:!1,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:!1,scaleOverride:!1,scaleOverride2:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineStyle:"solid",scaleLineWidth:1,scaleShowLabels:!0,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineStyle:"solid",scaleGridLineWidth:1,showYAxisMin:!0,rotateLabels:"smart",scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,pointDot:!0,pointDotRadius:4,pointDotStrokeStyle:"solid",pointDotStrokeWidth:2,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,spaceBetweenBar:0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,bezierCurve:!0,linkType:0,bezierCurveTension:.4,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>",pointHitDetectionRadius:10},isIE()<9&&0!=isIE()&&(chart.StackedBar.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.StackedBar.defaults)),chart.StackedBar.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.StackedBar.defaults),chart.StackedBar.defaults=mergeChartConfig(chart.defaults.xyAxisCommonOptions,chart.StackedBar.defaults),chart.StackedBar.defaults=mergeChartConfig(chart.StackedBar.defaults,charJSPersonalDefaultOptions),chart.StackedBar.defaults=mergeChartConfig(chart.StackedBar.defaults,charJSPersonalDefaultOptionsStackedBar);var t=e?mergeChartConfig(chart.StackedBar.defaults,e):chart.StackedBar.defaults;return new StackedBar(a,t,context)},this.HorizontalStackedBar=function(a,e){chart.HorizontalStackedBar.defaults={annotateBarMinimumDetectionHeight:0,highLightSet:{pointDotRadius:15,barStrokeWidth:5,pointDot:!0},inGraphDataShow:!1,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:!1,scaleOverride:!1,scaleOverride2:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineStyle:"solid",scaleLineWidth:1,scaleShowLabels:!0,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineStyle:"solid",scaleGridLineWidth:1,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,showYAxisMin:!0,rotateLabels:"smart",barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,spaceBetweenBar:0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>",reverseOrder:!1},isIE()<9&&0!=isIE()&&(chart.HorizontalStackedBar.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.HorizontalStackedBar.defaults)),chart.HorizontalStackedBar.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.HorizontalStackedBar.defaults),chart.HorizontalStackedBar.defaults=mergeChartConfig(chart.defaults.xyAxisCommonOptions,chart.HorizontalStackedBar.defaults),chart.HorizontalStackedBar.defaults=mergeChartConfig(chart.HorizontalStackedBar.defaults,charJSPersonalDefaultOptions),chart.HorizontalStackedBar.defaults=mergeChartConfig(chart.HorizontalStackedBar.defaults,charJSPersonalDefaultOptionsHorizontalStackedBar);var t=e?mergeChartConfig(chart.HorizontalStackedBar.defaults,e):chart.HorizontalStackedBar.defaults;return new HorizontalStackedBar(a,t,context)},this.Bar=function(a,e){chart.Bar.defaults={annotateBarMinimumDetectionHeight:0,highLightSet:{pointDotRadius:15,barStrokeWidth:5,pointDot:!0},inGraphDataShow:!1,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:!1,scaleOverride:!1,scaleOverride2:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleSteps2:null,scaleStepWidth2:null,scaleStartValue2:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineStyle:"solid",scaleLineWidth:1,scaleShowLabels:!0,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleLabel2:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleGridLineStyle:"solid",showYAxisMin:!0,rotateLabels:"smart",logarithmic:!1,logarithmic2:!1,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,barBorderRadius:0,complementaryBar:!1,complementaryColor:"rgba(100,100,100,0.3)",complementaryStrokeColor:"rgba(100,100,100,0.1)",pointDot:!0,pointDotRadius:4,pointDotStrokeStyle:"solid",pointDotStrokeWidth:2,extrapolateMissingData:!0,animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,bezierCurve:!0,linkType:0,bezierCurveTension:.4,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>",pointHitDetectionRadius:10},isIE()<9&&0!=isIE()&&(chart.Bar.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.Bar.defaults)),chart.Bar.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.Bar.defaults),chart.Bar.defaults=mergeChartConfig(chart.defaults.xyAxisCommonOptions,chart.Bar.defaults),chart.Bar.defaults=mergeChartConfig(chart.Bar.defaults,charJSPersonalDefaultOptions),chart.Bar.defaults=mergeChartConfig(chart.Bar.defaults,charJSPersonalDefaultOptionsBar);var t=e?mergeChartConfig(chart.Bar.defaults,e):chart.Bar.defaults;return new Bar(a,t,context)},this.HorizontalBar=function(a,e){chart.HorizontalBar.defaults={annotateBarMinimumDetectionHeight:0,highLightSet:{pointDotRadius:15,barStrokeWidth:5,pointDot:!0},inGraphDataShow:!1,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:!1,scaleOverride:!1,scaleOverride2:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineStyle:"solid",scaleLineWidth:1,scaleShowLabels:!0,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowGridLines:!0,scaleXGridLinesStep:1,scaleYGridLinesStep:1,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineStyle:"solid",scaleGridLineWidth:1,scaleTickSizeLeft:5,scaleTickSizeRight:5,scaleTickSizeBottom:5,scaleTickSizeTop:5,showYAxisMin:!0,rotateLabels:"smart",barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,barBorderRadius:0,complementaryBar:!1,complementaryColor:"rgba(100,100,100,0.3)",complementaryStrokeColor:"rgba(100,100,100,0.1)",animation:!0,animationSteps:60,animationEasing:"easeOutQuart",onAnimationComplete:null,annotateLabel:"<%=(v1 == '' ? '' : v1) + (v1!='' && v2 !='' ? ' - ' : '')+(v2 == '' ? '' : v2)+(v1!='' || v2 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>",reverseOrder:!1},isIE()<9&&0!=isIE()&&(chart.HorizontalBar.defaults=mergeChartConfig(chart.defaults.IExplorer8,chart.HorizontalBar.defaults)),chart.HorizontalBar.defaults=mergeChartConfig(chart.defaults.commonOptions,chart.HorizontalBar.defaults),chart.HorizontalBar.defaults=mergeChartConfig(chart.defaults.xyAxisCommonOptions,chart.HorizontalBar.defaults),chart.HorizontalBar.defaults=mergeChartConfig(chart.HorizontalBar.defaults,charJSPersonalDefaultOptions),chart.HorizontalBar.defaults=mergeChartConfig(chart.HorizontalBar.defaults,charJSPersonalDefaultOptionsHorizontalBar);var t=e?mergeChartConfig(chart.HorizontalBar.defaults,e):chart.HorizontalBar.defaults;return new HorizontalBar(a,t,context)},chart.defaults={},chart.defaults.IExplorer8={annotateBackgroundColor:"black",annotateFontColor:"white"},chart.defaults.commonOptions={generateConvertedData:!1,displayData:!0,chartTextScale:1,chartLineScale:1,chartSpaceScale:1,multiGraph:!1,clearRect:!0,dynamicDisplay:!1,dynamicDisplayXPartOfChart:.5,dynamicDisplayYPartOfChart:.5,animationForceSetTimeOut:!1,graphSpaceBefore:5,graphSpaceAfter:5,canvasBorders:!1,canvasBackgroundColor:"none",canvasBordersRadius:0,canvasBordersWidth:3,canvasBordersStyle:"solid",canvasBordersColor:"black",zeroValue:1e-10,graphTitle:"",graphTitleFontFamily:"'Arial'",graphTitleFontSize:24,graphTitleFontStyle:"bold",graphTitleFontColor:"#666",graphTitleSpaceBefore:5,graphTitleSpaceAfter:5,graphTitleBorders:!1,graphTitleBordersRadius:0,graphTitleBordersColor:"black",graphTitleBordersXSpace:3,graphTitleBordersYSpace:3,graphTitleBordersWidth:1,graphTitleBordersStyle:"solid",graphTitleBackgroundColor:"none",graphSubTitle:"",graphSubTitleFontFamily:"'Arial'",graphSubTitleFontSize:18,graphSubTitleFontStyle:"normal",graphSubTitleFontColor:"#666",graphSubTitleSpaceBefore:5,graphSubTitleSpaceAfter:5,graphSubTitleBorders:!1,graphSubTitleBordersColor:"black",graphSubTitleBordersRadius:0,graphSubTitleBordersXSpace:3,graphSubTitleBordersYSpace:3,graphSubTitleBordersWidth:1,graphSubTitleBordersStyle:"solid",graphSubTitleBackgroundColor:"none",footNote:"",footNoteFontFamily:"'Arial'",footNoteFontSize:8,footNoteFontStyle:"bold",footNoteFontColor:"#666",footNoteSpaceBefore:5,footNoteSpaceAfter:5,footNoteBorders:!1,footNoteBordersColor:"black",footNoteBordersRadius:0,footNoteBordersXSpace:3,footNoteBordersYSpace:3,footNoteBordersWidth:1,footNoteBordersStyle:"solid",footNoteBackgroundColor:"none",legend:!1,showSingleLegend:!1,maxLegendCols:999,legendPosY:4,legendPosX:-2,legendFontFamily:"'Arial'",legendFontSize:12,legendFontStyle:"normal",legendFontColor:"#666",legendBlockSize:15,legendBlockRadius:0,legendBorders:!0,legendBordersStyle:"solid",legendBordersWidth:1,legendBordersColors:"#666",legendBordersRadius:0,legendBordersSpaceBefore:5,legendBordersSpaceAfter:5,legendBordersSpaceLeft:5,legendBordersSpaceRight:5,legendSpaceBeforeText:5,legendSpaceAfterText:5,legendSpaceLeftText:5,legendSpaceRightText:5,legendSpaceBetweenTextVertical:5,legendSpaceBetweenTextHorizontal:5,legendSpaceBetweenBoxAndText:5,legendFillColor:"rgba(0,0,0,0)",legendXPadding:0,legendYPadding:0,inGraphDataBorders:!1,inGraphDataBordersRadius:0,inGraphDataBordersColor:"black",inGraphDataBordersXSpace:3,inGraphDataBordersYSpace:3,inGraphDataBordersWidth:1,inGraphDataBordersStyle:"solid",inGraphDataBackgroundColor:"none",annotateDisplay:!1,annotateRelocate:!1,savePng:!1,savePngOutput:"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:"",annotateFunctionIn:null,annotateFunctionOut:null,detectMouseOnText:!1,crossText:[""],crossTextIter:["all"],crossTextOverlay:[!0],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,crossTextBorders:[!1],crossTextBordersColor:["black"],crossTextBordersRadius:[0],crossTextBordersXSpace:[3],crossTextBordersYSpace:[3],crossTextBordersWidth:[1],crossTextBordersStyle:["solid"],crossTextBackgroundColor:["none"],crossImage:[void 0],crossImageIter:["all"],crossImageOverlay:[!0],crossImageRelativePosX:[2],crossImageRelativePosY:[2],crossImageBaseline:["middle"],crossImageAlign:["center"],crossImagePosX:[0],crossImagePosY:[0],crossImageAngle:[0],spaceTop:0,spaceBottom:0,spaceRight:0,spaceLeft:0,decimalSeparator:".",thousandSeparator:"",currency:"€",currencyPosition:"after",roundNumber:"none",roundPct:-1,templatesOpenTag:"<%=",templatesCloseTag:"%>",fmtV1:"none",fmtV2:"none",fmtV3:"none",fmtV4:"none",fmtV5:"none",fmtV6:"none",fmtV6T:"none",fmtV7:"none",fmtV8:"none",fmtV8T:"none",fmtV9:"none",fmtV10:"none",fmtV11:"none",fmtV12:"none",fmtV13:"none",fmtV14:"none",fmtV15:"none",fmtXLabel:"none",fmtYLabel:"none",
fmtYLabel2:"none",fmtLegend:"none",animationStartValue:0,animationStopValue:1,animationCount:1,animationPauseTime:5,animationBackward:!1,animationStartWithDataset:1,animationStartWithData:1,animationLeftToRight:!1,animationByDataset:!1,defaultStrokeColor:"rgba(220,220,220,1)",defaultFillColor:"rgba(220,220,220,0.5)",defaultLineWidth:2,graphMaximized:!1,contextMenu:!0,mouseDownRight:null,mouseDownLeft:null,mouseDownMiddle:null,mouseMove:null,mouseOut:null,mouseDblClick:null,mouseWheel:null,highLight:!1,highLightMouseFunction:"mousemove",highLightFullLine:!1,highLightRerunEndFunction:!1,savePngName:"canvas",responsive:!1,responsiveMinWidth:0,responsiveMinHeight:0,responsiveMaxWidth:9999999,responsiveMaxHeight:9999999,maintainAspectRatio:!0,responsiveScaleContent:!1,responsiveWindowInitialWidth:!1,pointMarker:"circle",initFunction:null,beforeDrawFunction:null,endDrawDataFunction:null,endDrawScaleFunction:null},chart.defaults.PolarAreaV1={highLightSet:{color:"red"},inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>"},chart.defaults.PolarAreaV2={highLightSet:{fillColor:"red"},inGraphDataTmpl:"<%=(data.labels.length == 1 ? (v1 == '' ? '' : v1+':') + v3 + ' (' + v6 + ' %)' : (i==0 ? v2 : '') )%>",annotateLabel:"<%=(v2 == '' ? '' : v2) + (v2!='' && v1 !='' ? ' - ' : '')+(v1 == '' ? '' : v1)+(v2!='' || v1 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>"},chart.defaults.PolarArea={inGraphDataShow:!1,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,scaleOverlay:!0,scaleOverride:!1,scaleOverride2:!1,scaleGridLinesStep:1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleShowLine:!0,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleLineStyle:"solid",scaleShowLabels:!0,scaleShowLabels2:!0,scaleLabel:"<%=value%>",scaleFontFamily:"'Arial'",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeStyle:"solid",segmentStrokeWidth:2,animation:!0,animationByData:"ByArc",animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null,startAngle:90,totalAmplitude:360,radiusScale:1},chart.defaults.PieAndDoughnutV1={inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>"},chart.defaults.PieAndDoughnutV2={inGraphDataTmpl:"<%=(data.labels.length == 1 ? (v1 == '' ? '' : v1+':') + v3 + ' (' + v6 + ' %)' : (i==0 ? v2 : '') )%>",annotateLabel:"<%=(v2 == '' ? '' : v2) + (v2!='' && v1 !='' ? ' - ' : '')+(v1 == '' ? '' : v1)+(v2!='' || v1 !='' ? ':' : '') + v3 + ' (' + v6 + ' %)'%>"},chart.defaults.PieAndDoughnut={highLightSet:{expandOutRadius:.1,expandInRadius:-.1},inGraphDataShow:!1,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,inGraphDataMinimumAngle:0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeStyle:"solid",segmentStrokeWidth:2,percentageInnerCutout:50,animation:!0,animationByData:!1,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,onAnimationComplete:null,startAngle:90,totalAmplitude:360,radiusScale:1,radiusDataWeight:1,radiusSpaceWeight:.3},chart.defaults.xyAxisCommonOptions={maxBarWidth:-1,yAxisMinimumInterval:"none",yAxisMinimumInterval2:"none",yScaleLabelsMinimumWidth:0,xScaleLabelsMinimumWidth:0,yAxisLeft:!0,yAxisRight:!1,xAxisBottom:!0,xAxisTop:!1,xAxisSpaceBetweenLabels:5,fullWidthGraph:!1,yAxisLabel:"",yAxisLabel2:"",yAxisFontFamily:"'Arial'",yAxisFontSize:16,yAxisFontStyle:"normal",yAxisFontColor:"#666",yAxisLabelSpaceRight:5,yAxisLabelSpaceLeft:5,yAxisSpaceRight:5,yAxisSpaceLeft:5,yAxisLabelBorders:!1,yAxisLabelBordersColor:"black",yAxisLabelBordersRadius:0,yAxisLabelBordersXSpace:3,yAxisLabelBordersYSpace:3,yAxisLabelBordersWidth:1,yAxisLabelBordersStyle:"solid",yAxisLabelBackgroundColor:"none",xAxisLabel:"",xAxisFontFamily:"'Arial'",xAxisFontSize:16,xAxisFontStyle:"normal",xAxisFontColor:"#666",xAxisLabelSpaceBefore:5,xAxisLabelSpaceAfter:5,xAxisSpaceBefore:5,xAxisSpaceAfter:5,xAxisLabelBorders:!1,xAxisLabelBordersColor:"black",xAxisLabelBordersRadius:0,xAxisLabelBordersXSpace:3,xAxisLabelBordersYSpace:3,xAxisLabelBordersWidth:1,xAxisLabelBordersStyle:"solid",xAxisLabelBackgroundColor:"none",showXLabels:1,firstLabelToShow:1,showYLabels:1,firstYLabelToShow:1,yAxisUnit:"",yAxisUnit2:"",yAxisUnitFontFamily:"'Arial'",yAxisUnitFontSize:8,yAxisUnitFontStyle:"normal",yAxisUnitFontColor:"#666",yAxisUnitSpaceBefore:5,yAxisUnitSpaceAfter:5,yAxisUnitBorders:!1,yAxisUnitBordersColor:"black",yAxisUnitBordersradius:0,yAxisUnitBordersXSpace:3,yAxisUnitBordersYSpace:3,yAxisUnitBordersWidth:1,yAxisUnitBordersStyle:"solid",yAxisUnitBackgroundColor:"none"};var clear=function(a){a.clearRect(0,0,width,height)},MPolarArea=function(a,e,t){function i(i){var l=0,n=g[0][0].firstAngle;1*e.animationStartWithData>1&&1*e.animationStartWithData-1<a.length&&(l=g[e.animationStartWithData-1].startAngle-g[0][0].firstAngle,n=g[e.animationStartWithData-1].startAngle),prevAngle=g[0][0].firstAngle;for(var r=0;r<a.labels.length;r++){var c=1,h=1;e.animation&&(e.animateScale&&(c=i),e.animateRotate&&(h=i));for(var d=0;d<a.datasets.length;d++)if(correctedRotateAnimation=animationCorrection(h,a,e,d,-1,!1).mainVal,"undefined"!=typeof a.datasets[d].data[r]){if(t.beginPath(),"ByArc"==e.animationByData)endAngle=g[d][r].startAngle+correctedRotateAnimation*g[d][r].segmentAngle,t.arc(p,S,c*g[d][r].radiusOffset,g[d][r].startAngle,endAngle,!1);else if(e.animationByData)if(d<1*e.animationStartWithData-1)t.arc(midPieX,midPieY,c*g[d][r].radiusOffset,g[d][r].startAngle,g[d][r].endAngle,!1);else{if(!(g[d][r].startAngle<=n+correctedRotateAnimation*(2*Math.PI-l)))continue;endAngle=g[d][r].endAngle,g[d][r].endAngle>n+correctedRotateAnimation*(2*Math.PI-l)&&(endAngle=n+correctedRotateAnimation*(2*Math.PI-l)),t.arc(midPieX,midPieY,c*g[d][r].radiusOffset,g[d][r].startAngle,endAngle,!1)}else t.arc(midPieX,midPieY,c*g[d][r].radiusOffset,prevAngle,prevAngle+correctedRotateAnimation*(g[d][r].endAngle-g[d][r].startAngle),!1),prevAngle+=correctedRotateAnimation*(g[d][r].endAngle-g[d][r].startAngle);t.lineTo(p,S),t.closePath(),t.fillStyle=setOptionValue(!0,!0,1,"FILLCOLOR",t,a,g,a.datasets[d].fillColor,e.defaultFillColor,"fillColor",d,r,{animationDecimal:i,scaleAnimation:c}),t.fill(),"merge"==e.segmentShowStroke?(t.lineWidth=0,t.strokeStyle=setOptionValue(!0,!0,1,"FILLCOLOR",t,a,g,a.datasets[d].fillColor,e.defaultFillColor,"fillColor",d,r,{animationDecimal:i,scaleAnimation:c}),t.setLineDash([]),t.stroke()):e.segmentShowStroke&&(t.strokeStyle=e.segmentStrokeColor,t.lineWidth=Math.ceil(t.chartLineScale*e.segmentStrokeWidth),t.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"SEGMENTSTROKESTYLE",t,a,g,a.datasets[d].segmentStrokeStyle,e.segmentStrokeStyle,"segmentStrokeStyle",d,r,{animationDecimal:i,scaleAnimation:c}))),t.stroke(),t.setLineDash([]))}}if(i>=e.animationStopValue)for(d=0;d<a.datasets.length;d++)for(r=0;r<a.labels.length;r++)if("undefined"!=typeof a.datasets[d].data[r]&&(jsGraphAnnotate[t.ChartNewId][jsGraphAnnotate[t.ChartNewId].length]=["MARC",d,r,g,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",t,a,g,a.datasets[d].annotateDisplay,e.annotateDisplay,"annotateDisplay",d,r,{nullValue:!0})],setOptionValue(!0,!0,1,"INGRAPHDATASHOW",t,a,g,a.datasets[d].inGraphDataShow,e.inGraphDataShow,"inGraphDataShow",d,r,{nullValue:!0}))){1==setOptionValue(!0,!0,1,"INGRAPHDATAANGLEPOSITION",t,a,g,void 0,e.inGraphDataAnglePosition,"inGraphDataAnglePosition",d,r,{nullValue:!0})?posAngle=g[d][r].realStartAngle+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINANGLE",t,a,g,void 0,e.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",d,r,{nullValue:!0})*(Math.PI/180):2==setOptionValue(!0,!0,1,"INGRAPHDATAANGLEPOSITION",t,a,g,void 0,e.inGraphDataAnglePosition,"inGraphDataAnglePosition",d,r,{nullValue:!0})?posAngle=(2*g[d][r].realStartAngle-g[d][r].segmentAngle)/2+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINANGLE",t,a,g,void 0,e.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",d,r,{nullValue:!0})*(Math.PI/180):3==setOptionValue(!0,!0,1,"INGRAPHDATAANGLEPOSITION",t,a,g,void 0,e.inGraphDataAnglePosition,"inGraphDataAnglePosition",d,r,{nullValue:!0})&&(posAngle=g[d][r].realStartAngle-g[d][r].segmentAngle+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINANGLE",t,a,g,void 0,e.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",d,r,{nullValue:!0})*(Math.PI/180)),1==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,g,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",d,r,{nullValue:!0})?labelRadius=0+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,g,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",d,r,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,g,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",d,r,{nullValue:!0})?labelRadius=g[d][r].radiusOffset/2+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,g,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",d,r,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,g,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",d,r,{nullValue:!0})?labelRadius=g[d][r].radiusOffset+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,g,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",d,r,{nullValue:!0}):4==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,g,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",d,r,{nullValue:!0})&&(labelRadius=o*s.steps+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,g,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",d,r,{nullValue:!0})),t.save(),"off-center"==setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,g,void 0,e.inGraphDataAlign,"inGraphDataAlign",d,r,{nullValue:!0})?"inRadiusAxis"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,g,void 0,e.inGraphDataRotate,"inGraphDataRotate",d,r,{nullValue:!0})||(posAngle+2*Math.PI)%(2*Math.PI)>=3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<=Math.PI/2?t.textAlign="left":t.textAlign="right":"to-center"==setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,g,void 0,e.inGraphDataAlign,"inGraphDataAlign",d,r,{nullValue:!0})?"inRadiusAxis"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,g,void 0,e.inGraphDataRotate,"inGraphDataRotate",d,r,{nullValue:!0})||(posAngle+2*Math.PI)%(2*Math.PI)>=3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<=Math.PI/2?t.textAlign="right":t.textAlign="left":t.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,g,void 0,e.inGraphDataAlign,"inGraphDataAlign",d,r,{nullValue:!0}),"off-center"==setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,g,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",d,r,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="top":t.textBaseline="bottom":"to-center"==setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,g,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",d,r,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="bottom":t.textBaseline="top":t.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,g,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",d,r,{nullValue:!0}),t.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",t,a,g,void 0,e.inGraphDataFontStyle,"inGraphDataFontStyle",d,r,{nullValue:!0})+" "+setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,g,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",d,r,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",t,a,g,void 0,e.inGraphDataFontFamily,"inGraphDataFontFamily",d,r,{nullValue:!0}),t.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",t,a,g,void 0,e.inGraphDataFontColor,"inGraphDataFontColor",d,r,{nullValue:!0});var f=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",t,a,g,void 0,e.inGraphDataTmpl,"inGraphDataTmpl",d,r,{nullValue:!0}),g[d][r],e);t.translate(p+labelRadius*Math.cos(posAngle),S-labelRadius*Math.sin(posAngle));var A=0;A="inRadiusAxis"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,g,void 0,e.inGraphDataRotate,"inGraphDataRotate",d,r,{nullValue:!0})?2*Math.PI-posAngle:"inRadiusAxisRotateLabels"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,g,void 0,e.inGraphDataRotate,"inGraphDataRotate",d,r,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(posAngle+2*Math.PI)%(2*Math.PI)<3*Math.PI/2?3*Math.PI-posAngle:2*Math.PI-posAngle:setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,g,void 0,e.inGraphDataRotate,"inGraphDataRotate",d,r,{nullValue:!0})*(Math.PI/180),t.rotate(A),setTextBordersAndBackground(t,f,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,g,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",d,r,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",t,a,g,void 0,e.inGraphDataBorders,"inGraphDataBorders",d,r,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",t,a,g,void 0,e.inGraphDataBordersColor,"inGraphDataBordersColor",d,r,{nullValue:!0}),setOptionValue(!0,!0,t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,a,g,void 0,e.inGraphDataBordersWidth,"inGraphDataBordersWidth",d,r,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,a,g,void 0,e.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",d,r,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,a,g,void 0,e.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",d,r,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",t,a,g,void 0,e.inGraphDataBordersStyle,"inGraphDataBordersStyle",d,r,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",t,a,g,void 0,e.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",d,r,{nullValue:!0}),"INGRAPHDATA",e.inGraphDataBordersRadius),t.fillTextMultiLine(f,0,0,t.textBaseline,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,g,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",d,r,{nullValue:!0}),!0,e.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",A,p+labelRadius*Math.cos(posAngle),S-labelRadius*Math.sin(posAngle),d,r),t.restore()}u.legendMsr.dispLegend&&drawLegend(u.legendMsr,a,e,t,"PolarArea")}function l(){for(var a=0;a<s.steps;a++)if(e.scaleShowLine&&(a+1)%e.scaleGridLinesStep==0&&(t.beginPath(),t.arc(p,S,o*(a+1),4*Math.PI-x,4*Math.PI-m,!0),t.strokeStyle=e.scaleLineColor,t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.stroke(),t.setLineDash([])),e.scaleShowLabels){Math.abs(e.totalAmplitude-360)<e.zeroValue?scaleAngle=Math.PI/2:scaleAngle=(x+m)/2,t.textAlign="center",t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily;var i=s.labels[a+1];if(e.scaleShowLabelBackdrop){var l=t.measureTextMultiLine(i,Math.ceil(t.chartTextScale*e.scaleFontSize));t.fillStyle=e.scaleBackdropColor,t.beginPath(),t.rect(Math.round(p+Math.cos(scaleAngle)*(o*(a+1))-l/2-Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingX)),Math.round(S-Math.sin(scaleAngle)*(o*(a+1))-.5*Math.ceil(t.chartTextScale*e.scaleFontSize)-Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingY)),Math.round(l+2*Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingX)),Math.round(Math.ceil(t.chartTextScale*e.scaleFontSize)+2*Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingY))),t.fill()}t.textBaseline="middle",t.fillStyle=e.scaleFontColor,t.fillTextMultiLine(i,p+Math.cos(scaleAngle)*(o*(a+1)),S-Math.sin(scaleAngle)*(o*(a+1)),t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"SCALE_TEXTMOUSE",0,0,0,a,-1)}}function n(){for(var i=-Number.MAX_VALUE,l=Number.MAX_VALUE,n=0;n<a.datasets.length;n++)for(j=0;j<a.labels.length;j++)"undefined"!=typeof a.datasets[n].data[j]&&(1*a.datasets[n].data[j]>i&&(i=1*a.datasets[n].data[j]),1*a.datasets[n].data[j]<l&&(l=1*a.datasets[n].data[j]));l>i&&(i=0,l=0),Math.abs(i-l)<e.zeroValue&&(Math.abs(i)<e.zeroValue&&(i=.9),i>0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),"function"==typeof e.graphMin?l=setOptionValue(!0,!0,1,"GRAPHMIN",t,a,g,void 0,e.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(e.graphMin)||(l=e.graphMin),"function"==typeof e.graphMax?i=setOptionValue(!0,!0,1,"GRAPHMAX",t,a,g,void 0,e.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(e.graphMax)||(i=e.graphMax);var o=Math.floor(c/(.66*r)),s=Math.floor(c/r*.5);return l>i&&(l=i-1),{maxValue:i,minValue:l,maxSteps:o,minSteps:s}}var o,s,r,c,h,d,u,p,S;if(t.tpchart="PolarArea",t.tpdata=0,init_and_start(t,a,e)){var g=initPassVariableData_part1(a,e,t),f=((e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);e.logarithmic=!1,e.logarithmic2=!1;var A=((e.totalAmplitude*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);A<=e.zeroValue&&(A=2*Math.PI);var x=(f-A+4*Math.PI)%(2*Math.PI),m=x+A;if(h=n(),d=e.scaleShowLabels?e.scaleLabel:"",e.scaleOverride){var D=setOptionValue(!0,!0,1,"SCALESTARTVALUE",t,a,g,void 0,e.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),P=setOptionValue(!0,!0,1,"SCALESTEPS",t,a,g,void 0,e.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),M=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",t,a,g,void 0,e.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});s={steps:P,stepValue:M,graphMin:D,graphMax:D+P*M,labels:[]},populateLabels(1,e,d,s.labels,s.steps,D,s.graphMax,M),u=setMeasures(a,e,t,t.canvas.height,t.canvas.width,s.labels,null,!0,!1,!1,!0,!0,"PolarArea")}else s=calculateScale(1,e,h.maxSteps,h.minSteps,h.maxValue,h.minValue,d),u=setMeasures(a,e,t,t.canvas.height,t.canvas.width,s.labels,null,!0,!1,!1,!0,!0,"PolarArea");var T=s.graphMin+s.steps*s.stepValue,v=calculatePieDrawingSize(t,u,e,a,g);return p=v.midPieX,S=v.midPieY,o=Math.floor(v.radius/s.steps),o>0?(initPassVariableData_part2(g,a,e,t,{midPosX:p,midPosY:S,int_radius:0,ext_radius:o*s.steps,calculatedScale:s,scaleHop:o,outerVal:T}),animationLoop(e,l,i,t,u.clrx,u.clry,u.clrwidth,u.clrheight,p,S,p-(Min([u.availableHeight,u.availableWidth])/2-5),S+(Min([u.availableHeight,u.availableWidth])/2-5),a,g)):(testRedraw(t,a,e),t.firstPass=9),{data:a,config:e,ctx:t}}},PolarArea=function(a,e,t){return"undefined"!=typeof a.length?MPolarArea(convertData(a,e.generateConvertedData),e,t):MPolarArea(a,e,t)},Radar=function(a,e,t){function i(i){var l=2*Math.PI/a.datasets[0].data.length;t.save();for(var n=0;n<a.datasets.length;n++){for(var o=-1,s=0;s<a.datasets[n].data.length;s++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,A,a.datasets[n].displayData,e.displayData,"displayData",n,s,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,A,a.displayData,e.displayData,"displayData",s,-1,{nullvalue:null})){var r=animationCorrection(i,a,e,n,s,!1).animVal;r>1&&(r-=1),"undefined"!=typeof a.datasets[n].data[s]&&(-1==o?(t.beginPath(),t.moveTo(g+r*A[n][s].offsetX,f-r*A[n][s].offsetY),o=s):t.lineTo(g+r*A[n][s].offsetX,f-r*A[n][s].offsetY))}if(t.closePath(),e.datasetFill?t.fillStyle=setOptionValue(!0,!0,1,"COLOR",t,a,A,a.datasets[n].fillColor,e.defaultFillColor,"fillColor",n,-1,{animationValue:r,midPosX:A[n][0].midPosX,midPosY:A[n][0].midPosY,ext_radius:(e.animationLeftToRight?1:r)*A[n][0].calculated_offset_max}):t.fillStyle="rgba(0,0,0,0)",t.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",t,a,A,a.datasets[n].strokeColor,e.defaultStrokeColor,"strokeColor",n,-1,{nullvalue:null}),t.lineWidth=Math.ceil(t.chartLineScale*setOptionValue(!0,!0,1,"LINEWIDTH",t,a,A,a.datasets[n].datasetStrokeWidth,e.datasetStrokeWidth,"datasetStrokeWidth",n,-1,{nullvalue:null})),t.fill(),t.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"LINEDASH",t,a,A,a.datasets[n].datasetStrokeStyle,e.datasetStrokeStyle,"datasetStrokeStyle",n,s,{nullvalue:null}))),t.stroke(),t.setLineDash([]),i>=e.animationStopValue){t.beginPath();for(var c=0;c<a.datasets[n].data.length;c++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,A,a.datasets[n].displayData,e.displayData,"displayData",n,c,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,A,a.displayData,e.displayData,"displayData",c,-1,{nullvalue:null})&&"undefined"!=typeof a.datasets[n].data[c]&&setOptionValue(!0,!0,1,"POINTDOT",t,a,A,void 0,e.pointDot,"pointDot",n,c,{nullvalue:null})){t.beginPath(),t.fillStyle=setOptionValue(!0,!0,1,"MARKERFILLCOLOR",t,a,A,a.datasets[n].pointColor,e.defaultStrokeColor,"pointColor",n,c,{nullvalue:!0}),t.strokeStyle=setOptionValue(!0,!0,1,"MARKERSTROKESTYLE",t,a,A,a.datasets[n].pointStrokeColor,e.defaultStrokeColor,"pointStrokeColor",n,c,{nullvalue:!0}),t.lineWidth=setOptionValue(!0,!0,t.chartLineScale,"MARKERLINEWIDTH",t,a,A,a.datasets[n].pointDotStrokeWidth,e.pointDotStrokeWidth,"pointDotStrokeWidth",n,c,{nullvalue:!0});var h=setOptionValue(!0,!0,1,"MARKERSHAPE",t,a,A,a.datasets[n].markerShape,e.markerShape,"markerShape",n,c,{nullvalue:!0}),d=setOptionValue(!0,!0,t.chartSpaceScale,"MARKERRADIUS",t,a,A,a.datasets[n].pointDotRadius,e.pointDotRadius,"pointDotRadius",n,c,{nullvalue:!0}),u=setOptionValue(!0,!0,1,"MARKERSTROKESTYLE",t,a,A,a.datasets[n].pointDotStrokeStyle,e.pointDotStrokeStyle,"pointDotStrokeStyle",n,c,{nullvalue:!0});drawMarker(t,g+r*A[n][c].offsetX,f-r*A[n][c].offsetY,h,d,u)}}}if(t.restore(),i>=e.animationStopValue)for(n=0;n<a.datasets.length;n++)for(s=0;s<a.datasets[n].data.length;s++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,A,a.datasets[n].displayData,e.displayData,"displayData",n,s,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,A,a.displayData,e.displayData,"displayData",s,-1,{nullvalue:null})&&"undefined"!=typeof a.datasets[n].data[s]&&(jsGraphAnnotate[t.ChartNewId][jsGraphAnnotate[t.ChartNewId].length]=["POINT",n,s,A,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",t,a,A,a.datasets[n].annotateDisplay,e.annotateDisplay,"annotateDisplay",n,s,{nullValue:!0})],setOptionValue(!0,!0,1,"INGRAPHDATASHOW",t,a,A,a.datasets[n].inGraphDataShow,e.inGraphDataShow,"inGraphDataShow",n,s,{nullValue:!0}))){t.save(),t.beginPath(),t.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,A,void 0,e.inGraphDataAlign,"inGraphDataAlign",n,s,{nullValue:!0}),t.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,A,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",n,s,{nullValue:!0}),"off-center"==setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,A,void 0,e.inGraphDataAlign,"inGraphDataAlign",n,s,{nullValue:!0})?"inRadiusAxis"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,A,void 0,e.inGraphDataRotate,"inGraphDataRotate",n,s,{nullValue:!0})||(e.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)>3*Math.PI/2||(e.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)<=Math.PI/2?t.textAlign="left":t.textAlign="right":"to-center"==setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,A,void 0,e.inGraphDataAlign,"inGraphDataAlign",n,s,{nullValue:!0})?"inRadiusAxis"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,A,void 0,e.inGraphDataRotate,"inGraphDataRotate",n,s,{nullValue:!0})||(e.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)>3*Math.PI/2||(e.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)<Math.PI/2?t.textAlign="right":t.textAlign="left":t.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,A,void 0,e.inGraphDataAlign,"inGraphDataAlign",n,s,{nullValue:!0}),"off-center"==setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,A,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",n,s,{nullValue:!0})?(e.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="bottom":t.textBaseline="top":"to-center"==setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,A,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",n,s,{nullValue:!0})?(e.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="top":t.textBaseline="bottom":t.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,A,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",n,s,{nullValue:!0}),t.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",t,a,A,void 0,e.inGraphDataFontStyle,"inGraphDataFontStyle",n,s,{nullValue:!0})+" "+setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,A,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",n,s,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",t,a,A,void 0,e.inGraphDataFontFamily,"inGraphDataFontFamily",n,s,{nullValue:!0}),t.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",t,a,A,void 0,e.inGraphDataFontColor,"inGraphDataFontColor",n,s,{nullValue:!0});var p;1==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,A,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",n,s,{nullValue:!0})?p=0+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,A,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",n,s,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,A,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",n,s,{nullValue:!0})?p=A[n][s].calculated_offset/2+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,A,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",n,s,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,A,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",n,s,{nullValue:!0})&&(p=A[n][s].calculated_offset+setOptionValue(!0,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,A,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",n,s,{nullValue:!0}));var x,m;A[n][s].calculated_offset>0?(x=g+A[n][s].offsetX*(p/A[n][s].calculated_offset),m=f-A[n][s].offsetY*(p/A[n][s].calculated_offset)):(x=g,m=f),t.translate(x,m);var D=0;D="inRadiusAxis"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,A,void 0,e.inGraphDataRotate,"inGraphDataRotate",n,s,{nullValue:!0})?s*l:"inRadiusAxisRotateLabels"==setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,A,void 0,e.inGraphDataRotate,"inGraphDataRotate",n,s,{nullValue:!0})?(s*l+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(s*l+2*Math.PI)%(2*Math.PI)<3*Math.PI/2?3*Math.PI+s*l:2*Math.PI+s*l:setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,A,void 0,e.inGraphDataRotate,"inGraphDataRotate",n,s,{nullValue:!0})*(Math.PI/180),t.rotate(D);var P=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",t,a,A,void 0,e.inGraphDataTmpl,"inGraphDataTmpl",n,s,{nullValue:!0}),A[n][s],e);setTextBordersAndBackground(t,P,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,A,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",n,s,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",t,a,A,void 0,e.inGraphDataBorders,"inGraphDataBorders",n,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",t,a,A,void 0,e.inGraphDataBordersColor,"inGraphDataBordersColor",n,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,a,A,void 0,e.inGraphDataBordersWidth,"inGraphDataBordersWidth",n,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,a,A,void 0,e.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",n,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,a,A,void 0,e.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",n,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",t,a,A,void 0,e.inGraphDataBordersStyle,"inGraphDataBordersStyle",n,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",t,a,A,void 0,e.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",n,s,{nullValue:!0}),"INGRAPHDATA",e.inGraphDataBordersRadius),t.fillTextMultiLine(P,0,0,t.textBaseline,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,A,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",n,s,{nullValue:!0}),!0,e.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",D,x,m,n,s),t.restore()}S.legendMsr.dispLegend&&drawLegend(S.legendMsr,a,e,t,"Radar")}function l(){var i=2*Math.PI/a.datasets[0].data.length;if(t.save(),t.translate(g,f),t.rotate((90-e.startAngle)*Math.PI/180),e.angleShowLineOut){t.strokeStyle=e.angleLineColor,t.lineWidth=Math.ceil(t.chartLineScale*e.angleLineWidth);for(var l=0;l<a.datasets[0].data.length;l++)t.rotate(i),t.beginPath(),t.moveTo(0,0),t.lineTo(0,-s),t.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"ANGLELINESTYLE",t,a,A,void 0,e.angleLineStyle,"angleLineStyle",l,-1,{nullValue:!0}))),t.stroke(),t.setLineDash([])}for(var n=0;n<c.steps;n++)if(t.beginPath(),e.scaleShowLine&&(n+1)%e.scaleGridLinesStep==0){t.strokeStyle=e.scaleLineColor,t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.moveTo(0,-r*(n+1));for(var o=0;o<a.datasets[0].data.length;o++)t.rotate(i),t.lineTo(0,-r*(n+1));t.closePath(),t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.stroke(),t.setLineDash([])}if(t.rotate(-(90-e.startAngle)*Math.PI/180),e.scaleShowLabels)for(n=0;n<c.steps;n++){if(t.textAlign="center",t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,t.textBaseline="middle",e.scaleShowLabelBackdrop){var h=t.measureTextMultiLine(c.labels[n+1],Math.ceil(t.chartTextScale*e.scaleFontSize)).textWidth;t.fillStyle=e.scaleBackdropColor,t.beginPath(),t.rect(Math.round(Math.cos(e.startAngle*Math.PI/180)*(r*(n+1))-h/2-Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingX)),Math.round(-Math.sin(e.startAngle*Math.PI/180)*r*(n+1)-.5*Math.ceil(t.chartTextScale*e.scaleFontSize)-Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingY)),Math.round(h+2*Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingX)),Math.round(Math.ceil(t.chartTextScale*e.scaleFontSize)+2*Math.ceil(t.chartSpaceScale*e.scaleBackdropPaddingY))),t.fill()}t.fillStyle=e.scaleFontColor,t.fillTextMultiLine(c.labels[n+1],Math.cos(e.startAngle*Math.PI/180)*(r*(n+1)),-Math.sin(e.startAngle*Math.PI/180)*r*(n+1),t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"SCALE_TEXTMOUSE",0,g,f,n,-1)}for(var d=0;d<a.labels.length;d++){t.font=e.pointLabelFontStyle+" "+Math.ceil(t.chartTextScale*e.pointLabelFontSize).toString()+"px "+e.pointLabelFontFamily,t.fillStyle=e.pointLabelFontColor;for(var u=Math.sin((90-e.startAngle)*Math.PI/180+i*d)*(s+Math.ceil(t.chartTextScale*e.pointLabelFontSize)),p=Math.cos((90-e.startAngle)*Math.PI/180+i*d)*(s+Math.ceil(t.chartTextScale*e.pointLabelFontSize)),S=(90-e.startAngle)*Math.PI/180+i*d;0>S;)S+=2*Math.PI;for(;S>2*Math.PI;)S-=2*Math.PI;S==Math.PI||0==S?t.textAlign="center":S>Math.PI?t.textAlign="right":t.textAlign="left",t.textBaseline="middle",t.fillTextMultiLine(a.labels[d],u,-p,t.textBaseline,Math.ceil(t.chartTextScale*e.pointLabelFontSize),!0,e.detectMouseOnText,t,"LABEL_TEXTMOUSE",0,g,f,d,-1)}t.restore()}function n(){var i,l,n,o,r,c,d,u,p,f,A=2*Math.PI/a.datasets[0].data.length,x=e.startAngle*Math.PI/180;if(t.font=e.pointLabelFontStyle+" "+Math.ceil(t.chartTextScale*e.pointLabelFontSize).toString()+"px "+e.pointLabelFontFamily,e.graphMaximized)for(o=S.availableWidth/2,n=S.availableWidth/2,c=40,p=0;p<a.labels.length;p++)f=t.measureTextMultiLine(a.labels[p],Math.ceil(t.chartTextScale*e.scaleFontSize)).textWidth+t.measureTextMultiLine(a.labels[p],Math.ceil(t.chartTextScale*e.scaleFontSize)).textHeight,l=(S.availableWidth-f)/(1+Math.abs(Math.cos(x))),x<Math.PI/2&&x>-Math.PI/2||x>3*Math.PI/2?o>l&&(o=l):0!=Math.cos(x)&&n>l&&(n=l),x-=A;else o=S.availableWidth/2,n=S.availableWidth/2,c=1;for(d=0,u=0,g=o+S.leftNotUsableSize,i=o,r=0;c>r;++r,i+=(S.availableWidth-n-o)/c){for(s=Max([i,S.availableWidth-i]),x=e.startAngle*Math.PI/180,l=S.available,p=0;p<a.labels.length;p++)f=t.measureTextMultiLine(a.labels[p],Math.ceil(t.chartTextScale*e.scaleFontSize)).textWidth+t.measureTextMultiLine(a.labels[p],Math.ceil(t.chartTextScale*e.scaleFontSize)).textHeight,x<Math.PI/2&&x>-Math.PI/2||x>3*Math.PI/2?l=(S.availableWidth-i-f)/Math.abs(Math.cos(x)):Math.cos(0!=x)&&(l=(i-f)/Math.abs(Math.cos(x))),s>l&&(s=l),Math.sin(x)*S.availableHeight/2>S.availableHeight/2-2*Math.ceil(t.chartTextScale*e.scaleFontSize)&&(l=Math.sin(x)*S.availableHeight/2-1.5*Math.ceil(t.chartTextScale*e.scaleFontSize),
s>l&&(s=l)),x-=A;s>d&&(d=s,g=i+S.leftNotUsableSize)}s=d-Math.ceil(t.chartTextScale*e.scaleFontSize)/2,h=Default(h,5)}function o(){for(var i=-Number.MAX_VALUE,l=Number.MAX_VALUE,n=0;n<a.datasets.length;n++)for(var o=0;o<a.datasets[n].data.length;o++)"undefined"!=typeof a.datasets[n].data[o]&&(1*a.datasets[n].data[o]>i&&(i=1*a.datasets[n].data[o]),1*a.datasets[n].data[o]<l&&(l=1*a.datasets[n].data[o]));l>i&&(i=0,l=0),Math.abs(i-l)<e.zeroValue&&(Math.abs(i)<e.zeroValue&&(i=.9,l=-.9),i>0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),"function"==typeof e.graphMin?l=setOptionValue(!0,!0,1,"GRAPHMIN",t,a,A,void 0,e.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(e.graphMin)||(l=e.graphMin),"function"==typeof e.graphMax?i=setOptionValue(!0,!0,1,"GRAPHMAX",t,a,A,void 0,e.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(e.graphMax)||(i=e.graphMax);var s=Math.floor(d/(.66*h)),r=Math.floor(d/h*.5);return l>i&&(l=i-1),{maxValue:i,minValue:l,maxSteps:s,minSteps:r}}var s,r,c,h,d,u,p,S,g,f;if(t.tpchart="Radar",t.tpdata=0,init_and_start(t,a,e)){var A=initPassVariableData_part1(a,e,t);if(u=o(),e.logarithmic=!1,e.logarithmic2=!1,a.labels||(a.labels=[]),p=e.scaleShowLabels?e.scaleLabel:"",e.scaleOverride){var x=setOptionValue(!0,!0,1,"SCALESTARTVALUE",t,a,A,void 0,e.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),m=setOptionValue(!0,!0,1,"SCALESTEPS",t,a,A,void 0,e.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),D=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",t,a,A,void 0,e.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});c={steps:m,stepValue:D,graphMin:x,graphMax:x+m*D,labels:[]},populateLabels(1,e,p,c.labels,c.steps,x,c.graphMax,D),S=setMeasures(a,e,t,t.canvas.height,t.canvas.width,c.labels,null,!0,!1,!1,!0,e.datasetFill,"Radar")}else c=calculateScale(1,e,u.maxSteps,u.minSteps,u.maxValue,u.minValue,p),S=setMeasures(a,e,t,t.canvas.height,t.canvas.width,c.labels,null,!0,!1,!1,!0,e.datasetFill,"Radar");return n(),f=S.topNotUsableSize+S.availableHeight/2,r=s/c.steps,initPassVariableData_part2(A,a,e,t,{midPosX:g,midPosY:f,calculatedScale:c,scaleHop:r,maxSize:s,outerVal:-1}),animationLoop(e,l,i,t,S.clrx,S.clry,S.clrwidth,S.clrheight,g,f,g-s,f+s,a,A),{data:a,config:e,ctx:t}}},Pie=function(a,e,t){return t.tpchart="Pie","undefined"!=typeof a.length?PieDoughnut(convertData(a,e.generateConvertedData),e,t,"Pie"):PieDoughnut(a,e,t,"Pie")},Doughnut=function(a,e,t){return t.tpchart="Doughnut","undefined"!=typeof a.length?PieDoughnut(convertData(a,e.generateConvertedData),e,t,"Doughnut"):PieDoughnut(a,e,t,"Doughnut")},PieDoughnut=function(a,e,t,i){function l(l){var d,u,p,S,g,f,A,x;g=[],f=[],A=[],x=[];for(var m=0;m<a.datasets.length;m++){var D=1,P=1;for(j=0;j<a.labels.length;j++)if("undefined"==typeof g[j]&&"undefined"!=typeof h[m][j].firstAngle&&(g[j]=h[m][j].firstAngle,f[j]=0,A[j]=h[m][j].firstAngle,x[j]=((-e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),1*e.animationStartWithData>1&&1*e.animationStartWithData-1<a.datasets.length),0!=setOptionValue(!1,!0,1,"DISPLAYDATA",t,a,h,a.datasets[m].displayData,e.displayData,"displayData",m,j,{nullvalue:null})&&0!=setOptionValue(!1,!0,1,"DISPLAYDATA",t,a,h,a.displayData,e.displayData,"displayData",-1,j,{nullvalue:null})&&!("undefined"==typeof a.datasets[m].data[j]||1*a.datasets[m].data[j]<=0)){if(d="Pie"==i?c:c,u=r,p=d+(u-d)*h[m][j].startRadius,S=d+(u-d)*h[m][j].stopRadius,d=p,u=S,("Pie"!=i||j>0)&&(p=d-(u-d)*setOptionValue(!1,!0,1,"EXPANDINRADIUS",t,a,h,a.datasets[m].expandInRadius,0,"expandInRadius",m,j,{animationDecimal:l,scaleAnimation:D})),S=u+(u-d)*setOptionValue(!1,!0,1,"EXPANDOUTRADIUS",t,a,h,a.datasets[m].expandOutRadius,0,"expandOutRadius",m,j,{animationDecimal:l,scaleAnimation:D}),d=p,u=S,e.animation&&(e.animateScale&&(D=l),e.animateRotate&&(P=l)),correctedRotateAnimation=animationCorrection(P,a,e,m,-1,!1).mainVal,t.beginPath(),t.lineWidth=Math.ceil(t.chartLineScale*e.segmentStrokeWidth),t.strokeStyle="rgba(0,0,0,0)","ByArc"==e.animationByData)endAngle=h[m][j].startAngle+correctedRotateAnimation*h[m][j].segmentAngle,t.arc(o,s,D*u,h[m][j].startAngle,endAngle,!1),t.arc(o,s,D*d,endAngle,h[m][j].startAngle,!0);else if(e.animationByData)if(0>m)t.arc(o,s,D*u,h[m][j].startAngle,h[m].endAngle,!1),t.arc(o,s,D*d,h[m][j].endAngle,h[m][j].startAngle,!0);else{if(!(h[m][j].startAngle<=A[j]+correctedRotateAnimation*(2*Math.PI-f[j])))continue;endAngle=h[m][j].endAngle,h[m][j].endAngle>A[j]+correctedRotateAnimation*(2*Math.PI-f[j])&&(endAngle=A[j]+correctedRotateAnimation*(2*Math.PI-f[j])),t.arc(o,s,D*u,h[m][j].startAngle,endAngle,!1),t.arc(o,s,D*d,endAngle,h[m][j].startAngle,!0)}else t.arc(o,s,D*u,g[j],g[j]+correctedRotateAnimation*(h[m][j].endAngle-h[m][j].startAngle),!1),t.arc(o,s,D*d,g[j]+correctedRotateAnimation*(h[m][j].endAngle-h[m][j].startAngle),g[j],!0),g[j]=g[j]+correctedRotateAnimation*(h[m][j].endAngle-h[m][j].startAngle);t.closePath(),t.fillStyle=setOptionValue(!1,!0,1,"FILLCOLOR",t,a,h,a.datasets[m].fillColor,e.defaultFillColor,"fillColor",m,j,{animationDecimal:l,scaleAnimation:D}),t.fill(),"merge"==e.segmentShowStroke?(t.lineWidth=1.5,t.strokeStyle=setOptionValue(!1,!0,1,"FILLCOLOR",t,a,h,a.datasets[m].fillColor,e.defaultFillColor,"fillColor",m,j,{animationDecimal:l,scaleAnimation:D}),t.setLineDash([]),t.stroke()):e.segmentShowStroke&&(t.lineWidth=Math.ceil(t.chartLineScale*e.segmentStrokeWidth),t.strokeStyle=e.segmentStrokeColor,t.setLineDash(lineStyleFn(setOptionValue(!1,!0,1,"SEGMENTSTROKESTYLE",t,a,h,a.datasets[m].segmentStrokeStyle,e.segmentStrokeStyle,"segmentStrokeStyle",m,-1,{animationDecimal:l,scaleAnimation:D}))),t.stroke(),t.setLineDash([]))}}if(l>=e.animationStopValue)for(var m=0;m<a.datasets.length;m++)for(j=0;j<a.labels.length;j++)if(0!=setOptionValue(!1,!0,1,"DISPLAYDATA",t,a,h,a.datasets[m].displayData,e.displayData,"displayData",m,j,{nullvalue:null})&&0!=setOptionValue(!1,!0,1,"DISPLAYDATA",t,a,h,a.displayData,e.displayData,"displayData",-1,j,{nullvalue:null})&&!("undefined"==typeof a.datasets[m].data[j]||1*a.datasets[m].data[j]<=0)&&(d="Pie"==i?c:c-(r-c)*setOptionValue(!1,!0,1,"EXPANDINRADIUS",t,a,h,a.datasets[m].expandInRadius,0,"expandInRadius",m,j,{animationDecimal:l,scaleAnimation:D}),u=r+(r-c)*setOptionValue(!1,!0,1,"EXPANDOUTRADIUS",t,a,h,a.datasets[m].expandOutRadius,0,"expandOutRadius",m,j,{animationDecimal:l,scaleAnimation:D}),p=d+(u-d)*h[m][j].startRadius,S=d+(u-d)*h[m][j].stopRadius,d=p,u=S,jsGraphAnnotate[t.ChartNewId][jsGraphAnnotate[t.ChartNewId].length]=["MARC",m,j,h,setOptionValue(!1,!0,1,"ANNOTATEDISPLAY",t,a,h,a.datasets[m].annotateDisplay,e.annotateDisplay,"annotateDisplay",m,j,{nullValue:!0})],setOptionValue(!1,!0,1,"INGRAPHDATASHOW",t,a,h,a.datasets[m].inGraphDataShow,e.inGraphDataShow,"inGraphDataShow",m,j,{nullValue:!0})&&h[m][j].segmentAngle>=Math.PI/180*setOptionValue(!1,!0,1,"INGRAPHDATAMINIMUMANGLE",t,a,h,void 0,e.inGraphDataMinimumAngle,"inGraphDataMinimumAngle",m,j,{nullValue:!0}))){1==setOptionValue(!1,!0,1,"INGRAPHDATAANGLEPOSITION",t,a,h,void 0,e.inGraphDataAnglePosition,"inGraphDataAnglePosition",m,j,{nullValue:!0})?posAngle=h[m][j].realStartAngle+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINANGLE",t,a,h,void 0,e.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",m,j,{nullValue:!0})*(Math.PI/180):2==setOptionValue(!1,!0,1,"INGRAPHDATAANGLEPOSITION",t,a,h,void 0,e.inGraphDataAnglePosition,"inGraphDataAnglePosition",m,j,{nullValue:!0})?posAngle=h[m][j].realStartAngle-h[m][j].segmentAngle/2+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINANGLE",t,a,h,void 0,e.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",m,j,{nullValue:!0})*(Math.PI/180):3==setOptionValue(!1,!0,1,"INGRAPHDATAANGLEPOSITION",t,a,h,void 0,e.inGraphDataAnglePosition,"inGraphDataAnglePosition",m,j,{nullValue:!0})&&(posAngle=h[m][j].realStartAngle-h[m][j].segmentAngle+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINANGLE",t,a,h,void 0,e.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",m,j,{nullValue:!0})*(Math.PI/180)),1==setOptionValue(!1,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,h,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",m,j,{nullValue:!0})?labelRadius=d+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,h,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",m,j,{nullValue:!0}):2==setOptionValue(!1,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,h,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",m,j,{nullValue:!0})?labelRadius=d+(u-d)/2+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,h,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",m,j,{nullValue:!0}):3==setOptionValue(!1,!0,1,"INGRAPHDATARADIUSPOSITION",t,a,h,void 0,e.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",m,j,{nullValue:!0})&&(labelRadius=u+setOptionValue(!1,!0,1,"INGRAPHDATAPADDINGRADIUS",t,a,h,void 0,e.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",m,j,{nullValue:!0})),t.save(),"off-center"==setOptionValue(!1,!0,1,"INGRAPHDATAALIGN",t,a,h,void 0,e.inGraphDataAlign,"inGraphDataAlign",m,j,{nullValue:!0})?"inRadiusAxis"==setOptionValue(!1,!0,1,"INGRAPHDATAROTATE",t,a,h,void 0,e.inGraphDataRotate,"inGraphDataRotate",m,j,{nullValue:!0})||(posAngle+2*Math.PI)%(2*Math.PI)>=3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<=Math.PI/2?t.textAlign="left":t.textAlign="right":"to-center"==setOptionValue(!1,!0,1,"INGRAPHDATAALIGN",t,a,h,void 0,e.inGraphDataAlign,"inGraphDataAlign",m,j,{nullValue:!0})?"inRadiusAxis"==setOptionValue(!1,!0,1,"INGRAPHDATAROTATE",t,a,h,void 0,e.inGraphDataRotate,"inGraphDataRotate",m,j,{nullValue:!0})||(posAngle+2*Math.PI)%(2*Math.PI)>=3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)<=Math.PI/2?t.textAlign="right":t.textAlign="left":t.textAlign=setOptionValue(!1,!0,1,"INGRAPHDATAALIGN",t,a,h,void 0,e.inGraphDataAlign,"inGraphDataAlign",m,j,{nullValue:!0}),"off-center"==setOptionValue(!1,!0,1,"INGRAPHDATAVALIGN",t,a,h,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",m,j,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="top":t.textBaseline="bottom":"to-center"==setOptionValue(!1,!0,1,"INGRAPHDATAVALIGN",t,a,h,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",m,j,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="bottom":t.textBaseline="top":t.textBaseline=setOptionValue(!1,!0,1,"INGRAPHDATAVALIGN",t,a,h,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",m,j,{nullValue:!0}),t.font=setOptionValue(!1,!0,1,"INGRAPHDATAFONTSTYLE",t,a,h,void 0,e.inGraphDataFontStyle,"inGraphDataFontStyle",m,j,{nullValue:!0})+" "+setOptionValue(!1,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,h,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",m,j,{nullValue:!0})+"px "+setOptionValue(!1,!0,1,"INGRAPHDATAFONTFAMILY",t,a,h,void 0,e.inGraphDataFontFamily,"inGraphDataFontFamily",m,j,{nullValue:!0}),t.fillStyle=setOptionValue(!1,!0,1,"INGRAPHDATAFONTCOLOR",t,a,h,void 0,e.inGraphDataFontColor,"inGraphDataFontColor",m,j,{nullValue:!0});var M=tmplbis(setOptionValue(!1,!0,1,"INGRAPHDATATMPL",t,a,h,void 0,e.inGraphDataTmpl,"inGraphDataTmpl",m,j,{nullValue:!0}),h[m][j],e);t.translate(o+labelRadius*Math.cos(posAngle),s-labelRadius*Math.sin(posAngle));var T=0;T="inRadiusAxis"==setOptionValue(!1,!0,1,"INGRAPHDATAROTATE",t,a,h,void 0,e.inGraphDataRotate,"inGraphDataRotate",m,j,{nullValue:!0})?2*Math.PI-posAngle:"inRadiusAxisRotateLabels"==setOptionValue(!1,!0,1,"INGRAPHDATAROTATE",t,a,h,void 0,e.inGraphDataRotate,"inGraphDataRotate",m,j,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI/2&&(posAngle+2*Math.PI)%(2*Math.PI)<3*Math.PI/2?3*Math.PI-posAngle:2*Math.PI-posAngle:setOptionValue(!1,!0,1,"INGRAPHDATAROTATE",t,a,h,void 0,e.inGraphDataRotate,"inGraphDataRotate",m,j,{nullValue:!0})*(Math.PI/180),t.rotate(T),setTextBordersAndBackground(t,M,setOptionValue(!1,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,h,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",m,j,{nullValue:!0}),0,0,setOptionValue(!1,!0,1,"INGRAPHDATABORDERS",t,a,h,void 0,e.inGraphDataBorders,"inGraphDataBorders",m,j,{nullValue:!0}),setOptionValue(!1,!0,1,"INGRAPHDATABORDERSCOLOR",t,a,h,void 0,e.inGraphDataBordersColor,"inGraphDataBordersColor",m,j,{nullValue:!0}),setOptionValue(!1,!0,t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,a,h,void 0,e.inGraphDataBordersWidth,"inGraphDataBordersWidth",m,j,{nullValue:!0}),setOptionValue(!1,!0,t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,a,h,void 0,e.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",m,j,{nullValue:!0}),setOptionValue(!1,!0,t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,a,h,void 0,e.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",m,j,{nullValue:!0}),setOptionValue(!1,!0,1,"INGRAPHDATABORDERSSTYLE",t,a,h,void 0,e.inGraphDataBordersStyle,"inGraphDataBordersStyle",m,j,{nullValue:!0}),setOptionValue(!1,!0,1,"INGRAPHDATABACKGROUNDCOLOR",t,a,h,void 0,e.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",m,j,{nullValue:!0}),"INGRAPHDATA",e.inGraphDataBordersRadius),t.fillTextMultiLine(M,0,0,t.textBaseline,setOptionValue(!1,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,h,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",m,j,{nullValue:!0}),!0,e.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",T,o+labelRadius*Math.cos(posAngle),s-labelRadius*Math.sin(posAngle),m,j),t.restore()}n.legendMsr.dispLegend&&drawLegend(n.legendMsr,a,e,t,"Doughnut")}var n,o,s,r,c;if(t.tpdata=0,init_and_start(t,a,e)){var h=initPassVariableData_part1(a,e,t);((e.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);e.logarithmic=!1,e.logarithmic2=!1,n=setMeasures(a,e,t,t.canvas.height,t.canvas.width,"none",null,!0,!1,!1,!0,!0,"Doughnut");var d=calculatePieDrawingSize(t,n,e,a,h);return o=d.midPieX,s=d.midPieY,r=d.radius,c="Pie"==i?0:r*(e.percentageInnerCutout/100),r>0?(initPassVariableData_part2(h,a,e,t,{midPosX:o,midPosY:s,int_radius:c,ext_radius:r,outerVal:-1}),animationLoop(e,null,l,t,n.clrx,n.clry,n.clrwidth,n.clrheight,o,s,o-r,s+r,a,h)):(testRedraw(t,a,e),t.firstPass=9),{data:a,config:e,ctx:t}}},Line=function(data,config,ctx){function drawLines(a){drawLinesDataset(a,data,config,ctx,statData,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,nbValueHop:data.labels.length-1}),a>=1&&"function"==typeof drawMath&&drawMath(ctx,config,data,msr,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,scaleHop:scaleHop,zeroY:zeroY,calculatedScale:calculatedScale,calculateOffset:calculateOffset,statData:statData}),msr.legendMsr.dispLegend&&drawLegend(msr.legendMsr,data,config,ctx,"Line")}function drawScale(){if(config.drawXScaleLine!==!1)for(var a=0;a<config.drawXScaleLine.length;a++){ctx.lineWidth=config.drawXScaleLine[a].lineWidth?config.drawXScaleLine[a].lineWidth:Math.ceil(ctx.chartLineScale*config.scaleLineWidth),ctx.strokeStyle=config.drawXScaleLine[a].lineColor?config.drawXScaleLine[a].lineColor:config.scaleLineColor,ctx.beginPath();var e;switch(config.drawXScaleLine[a].position){case"bottom":e=xAxisPosY;break;case"top":e=xAxisPosY-msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop);break;case"0":case 0:0!=zeroY&&(e=xAxisPosY-zeroY)}ctx.moveTo(yAxisPosX-Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft),e),ctx.lineTo(yAxisPosX+msr.availableWidth+Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight),e),ctx.setLineDash(lineStyleFn(config.scaleLineStyle)),ctx.stroke(),ctx.setLineDash([])}for(var t=0;t<data.labels.length;t++)ctx.beginPath(),ctx.moveTo(yAxisPosX+t*valueHop,xAxisPosY+Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)),ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth),ctx.strokeStyle=config.scaleGridLineColor,config.scaleShowGridLines&&t>0&&t%config.scaleXGridLinesStep==0?ctx.lineTo(yAxisPosX+t*valueHop,xAxisPosY-msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)):ctx.lineTo(yAxisPosX+t*valueHop,xAxisPosY),ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)),ctx.stroke(),ctx.setLineDash([]);ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleLineWidth),ctx.strokeStyle=config.scaleLineColor,ctx.beginPath(),ctx.moveTo(yAxisPosX,xAxisPosY+Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)),ctx.lineTo(yAxisPosX,xAxisPosY-msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)),ctx.setLineDash(lineStyleFn(config.scaleLineStyle)),ctx.stroke(),ctx.setLineDash([]);for(var i=0;i<calculatedScale.steps;i++)ctx.beginPath(),ctx.moveTo(yAxisPosX-Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft),xAxisPosY-(i+1)*scaleHop),ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth),ctx.strokeStyle=config.scaleGridLineColor,config.scaleShowGridLines&&(i+1)%config.scaleYGridLinesStep==0?ctx.lineTo(yAxisPosX+msr.availableWidth+Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight),xAxisPosY-(i+1)*scaleHop):ctx.lineTo(yAxisPosX,xAxisPosY-(i+1)*scaleHop),ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle)),ctx.stroke(),ctx.setLineDash([])}function drawLabels(){if(ctx.font=config.scaleFontStyle+" "+Math.ceil(ctx.chartTextScale*config.scaleFontSize).toString()+"px "+config.scaleFontFamily,(config.xAxisTop||config.xAxisBottom)&&(ctx.textBaseline="top",msr.rotateLabels>90?(ctx.save(),ctx.textAlign="left"):msr.rotateLabels>0?(ctx.save(),ctx.textAlign="right"):ctx.textAlign="center",ctx.fillStyle=config.scaleFontColor,config.xAxisBottom))for(var a=0;a<data.labels.length;a++)showLabels(ctx,data,config,a)&&(ctx.save(),msr.rotateLabels>0?(ctx.translate(yAxisPosX+a*valueHop-msr.highestXLabel/2,msr.xLabelPos),ctx.rotate(-(msr.rotateLabels*(Math.PI/180))),ctx.fillTextMultiLine(fmtChartJS(config,data.labels[a],config.fmtXLabel),0,0,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XSCALE_TEXTMOUSE",-(msr.rotateLabels*(Math.PI/180)),yAxisPosX+a*valueHop-msr.highestXLabel/2,msr.xLabelPos,a,-1)):ctx.fillTextMultiLine(fmtChartJS(config,data.labels[a],config.fmtXLabel),yAxisPosX+a*valueHop,msr.xLabelPos,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XSCALE_TEXTMOUSE",0,0,0,a,-1),ctx.restore());ctx.textAlign="right",ctx.textBaseline="middle";for(var e=config.showYAxisMin?-1:0;e<calculatedScale.steps;e++)config.scaleShowLabels&&showYLabels(ctx,data,config,e+1,calculatedScale.labels[e+1])&&(config.yAxisLeft&&(ctx.textAlign="right",ctx.fillTextMultiLine(calculatedScale.labels[e+1],yAxisPosX-(Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft)+Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)),xAxisPosY-(e+1)*scaleHop,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"YLEFTAXIS_TEXTMOUSE",0,0,0,-1,e)),config.yAxisRight&&!valueBounds.dbAxis&&(ctx.textAlign="left",ctx.fillTextMultiLine(calculatedScale.labels[e+1],yAxisPosX+msr.availableWidth+(Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight)+Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)),xAxisPosY-(e+1)*scaleHop,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,e)));if(config.yAxisRight&&valueBounds.dbAxis)for(e=config.showYAxisMin?-1:0;e<calculatedScale2.steps;e++)config.scaleShowLabels&&(ctx.textAlign="left",ctx.fillTextMultiLine(calculatedScale2.labels[e+1],yAxisPosX+msr.availableWidth+(Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight)+Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)),xAxisPosY-(e+1)*scaleHop2,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,e))}function getValueBounds(){for(var upperValue=-Number.MAX_VALUE,lowerValue=Number.MAX_VALUE,upperValue2=-Number.MAX_VALUE,lowerValue2=Number.MAX_VALUE,secondAxis=!1,firstAxis=!1,mathValueHeight,i=0;i<data.datasets.length;i++){var mathFctName=data.datasets[i].drawMathDeviation,mathValueHeight=0;if("function"==typeof eval(mathFctName)){var parameter={data:data,datasetNr:i};mathValueHeightVal=window[mathFctName](parameter)}else mathValueHeightVal=0;for(var j=0;j<data.datasets[i].data.length;j++)mathValueHeight="object"==typeof mathValueHeightVal?mathValueHeightVal[Math.min(mathValueHeightVal.length,j)]:mathValueHeightVal,"undefined"!=typeof data.datasets[i].data[j]&&(2==data.datasets[i].axis?(secondAxis=!0,1*data.datasets[i].data[j]+mathValueHeight>upperValue2&&(upperValue2=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeight<lowerValue2&&(lowerValue2=1*data.datasets[i].data[j]-mathValueHeight)):(firstAxis=!0,1*data.datasets[i].data[j]+mathValueHeight>upperValue&&(upperValue=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeight<lowerValue&&(lowerValue=1*data.datasets[i].data[j]-mathValueHeight)))}lowerValue>upperValue&&(upperValue=0,lowerValue=0),Math.abs(upperValue-lowerValue)<config.zeroValue&&(Math.abs(upperValue)<config.zeroValue&&(upperValue=.9),upperValue>0?(upperValue=1.1*upperValue,lowerValue=.9*lowerValue):(upperValue=.9*upperValue,lowerValue=1.1*lowerValue)),"function"==typeof config.graphMin?lowerValue=setOptionValue(!0,!0,1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(config.graphMin)||(lowerValue=config.graphMin),"function"==typeof config.graphMax?upperValue=setOptionValue(!0,!0,1,"GRAPHMAX",ctx,data,statData,void 0,config.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(config.graphMax)||(upperValue=config.graphMax),secondAxis&&(lowerValue2>upperValue2&&(upperValue2=0,lowerValue2=0),Math.abs(upperValue2-lowerValue2)<config.zeroValue&&(Math.abs(upperValue2)<config.zeroValue&&(upperValue2=.9),upperValue2>0?(upperValue2=1.1*upperValue2,lowerValue2=.9*lowerValue2):(upperValue2=.9*upperValue2,lowerValue2=1.1*lowerValue2)),"function"==typeof config.graphMin2?lowerValue2=setOptionValue(!0,!0,1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin2,"graphMin2",-1,-1,{nullValue:!0}):isNaN(config.graphMin2)||(lowerValue2=config.graphMin2),"function"==typeof config.graphMax2?upperValue2=setOptionValue(!0,!0,1,"GRAPHMAX",ctx,data,statData,void 0,config.graphMax2,"graphMax2",-1,-1,{nullValue:!0}):isNaN(config.graphMax2)||(upperValue2=config.graphMax2)),!firstAxis&&secondAxis&&(upperValue=upperValue2,lowerValue=lowerValue2),labelHeight=Math.ceil(ctx.chartTextScale*config.scaleFontSize),scaleHeight=msr.availableHeight;var maxSteps=Math.floor(scaleHeight/(.66*labelHeight)),minSteps=Math.floor(scaleHeight/labelHeight*.5);return lowerValue>upperValue&&(lowerValue=upperValue-1),lowerValue2>upperValue2&&(lowerValue2=upperValue2-1),{maxValue:upperValue,minValue:lowerValue,maxValue2:upperValue2,minValue2:lowerValue2,dbAxis:secondAxis,maxSteps:maxSteps,minSteps:minSteps}}var maxSize,scaleHop,scaleHop2,calculatedScale,calculatedScale2,labelHeight,scaleHeight,valueBounds,labelTemplateString,labelTemplateString2,valueHop,widestXLabel,xAxisLength,yAxisPosX,xAxisPosY,rotateLabels=0,msr,zeroY=0,zeroY2=0;if(ctx.tpchart="Line",ctx.tpdata=0,init_and_start(ctx,data,config)){for(var mxlgt=0,i=0;i<data.datasets.length;i++)mxlgt=Max([mxlgt,data.datasets[i].data.length]);if(1==mxlgt){for("string"==typeof data.labels[0]&&(data.labels=["",data.labels[0],""]),i=0;i<data.datasets.length;i++)data.datasets[i].data=[void 0,data.datasets[i].data[0],void 0];mxlgt=3}var statData=initPassVariableData_part1(data,config,ctx);for(i=0;i<data.datasets.length;i++)statData[i][0].tpchart="Line";msr=setMeasures(data,config,ctx,ctx.canvas.height,ctx.canvas.width,"nihil",[""],!1,!1,!0,!0,config.datasetFill,"Line"),valueBounds=getValueBounds(),config.logarithmic!==!1&&valueBounds.minValue<=0&&(config.logarithmic=!1),config.logarithmic2!==!1&&valueBounds.minValue2<=0&&(config.logarithmic2=!1);var OrderOfMagnitude=calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.maxValue)+1))-calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.minValue)));("fuzzy"==config.logarithmic&&4>OrderOfMagnitude||config.scaleOverride)&&(config.logarithmic=!1);var OrderOfMagnitude2=calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.maxValue2)+1))-calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.minValue2)));if(("fuzzy"==config.logarithmic2&&4>OrderOfMagnitude2||config.scaleOverride2)&&(config.logarithmic2=!1),labelTemplateString=config.scaleShowLabels?config.scaleLabel:"",labelTemplateString2=config.scaleShowLabels2?config.scaleLabel2:"",config.scaleOverride){var scaleStartValue=setOptionValue(!0,!0,1,"SCALESTARTVALUE",ctx,data,statData,void 0,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),scaleSteps=setOptionValue(!0,!0,1,"SCALESTEPS",ctx,data,statData,void 0,config.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),scaleStepWidth=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",ctx,data,statData,void 0,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});calculatedScale={steps:scaleSteps,stepValue:scaleStepWidth,graphMin:scaleStartValue,graphMax:scaleStartValue+scaleSteps*scaleStepWidth,labels:[]},populateLabels(1,config,labelTemplateString,calculatedScale.labels,calculatedScale.steps,scaleStartValue,calculatedScale.graphMax,scaleStepWidth)}else valueBounds.maxSteps>0&&valueBounds.minSteps>0&&(calculatedScale=calculateScale(1,config,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString));if(valueBounds.dbAxis)if(config.scaleOverride2){var scaleStartValue2=setOptionValue(!0,!0,1,"SCALESTARTVALUE2",ctx,data,statData,void 0,config.scaleStartValue2,"scaleStartValue2",-1,-1,{nullValue:!0}),scaleSteps2=setOptionValue(!0,!0,1,"SCALESTEPS2",ctx,data,statData,void 0,config.scaleSteps2,"scaleSteps2",-1,-1,{nullValue:!0}),scaleStepWidth2=setOptionValue(!0,!0,1,"SCALESTEPWIDTH2",ctx,data,statData,void 0,config.scaleStepWidth2,"scaleStepWidth2",-1,-1,{nullValue:!0});calculatedScale2={steps:scaleSteps2,stepValue:scaleStepWidth2,graphMin:scaleStartValue2,graphMax:scaleStartValue2+scaleSteps2*scaleStepWidth2,labels:[]},populateLabels(2,config,labelTemplateString2,calculatedScale2.labels,calculatedScale2.steps,scaleStartValue2,calculatedScale2.graphMax,scaleStepWidth2)}else valueBounds.maxSteps>0&&valueBounds.minSteps>0&&(calculatedScale2=calculateScale(2,config,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue2,valueBounds.minValue2,labelTemplateString2));else calculatedScale2={steps:0,stepValue:0,graphMin:0,graphMax:0,labels:null};if(valueBounds.maxSteps>0&&valueBounds.minSteps>0){msr=setMeasures(data,config,ctx,ctx.canvas.height,ctx.canvas.width,calculatedScale.labels,calculatedScale2.labels,!1,!1,!0,!0,config.datasetFill,"Line");var prevHeight=msr.availableHeight;msr.availableHeight=msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop),msr.availableWidth=msr.availableWidth-Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft)-Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight),scaleHop=Math.floor(msr.availableHeight/calculatedScale.steps),scaleHop2=Math.floor(msr.availableHeight/calculatedScale2.steps),valueHop=Math.floor(msr.availableWidth/(data.labels.length-1)),(0==valueHop||config.fullWidthGraph)&&(valueHop=msr.availableWidth/(data.labels.length-1)),msr.clrwidth=msr.clrwidth-(msr.availableWidth-(data.labels.length-1)*valueHop),msr.availableWidth=(data.labels.length-1)*valueHop,msr.availableHeight=calculatedScale.steps*scaleHop,msr.xLabelPos+=Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)+Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)-(prevHeight-msr.availableHeight),msr.clrheight+=Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)+Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)-(prevHeight-msr.availableHeight),yAxisPosX=msr.leftNotUsableSize+Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft),xAxisPosY=msr.topNotUsableSize+msr.availableHeight+Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop),drawLabels(),zeroY=calculateOffset(config.logarithmic,0,calculatedScale,scaleHop),"object"==typeof calculatedScale2&&(zeroY2=calculateOffset(config.logarithmic2,0,calculatedScale2,scaleHop2)),initPassVariableData_part2(statData,data,config,ctx,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,nbValueHop:data.labels.length-1,scaleHop:scaleHop,zeroY:zeroY,calculatedScale:calculatedScale,logarithmic:config.logarithmic,scaleHop2:scaleHop2,zeroY2:zeroY2,msr:msr,calculatedScale2:calculatedScale2,logarithmic2:config.logarithmic2}),animationLoop(config,drawScale,drawLines,ctx,msr.clrx,msr.clry,msr.clrwidth,msr.clrheight,yAxisPosX+msr.availableWidth/2,xAxisPosY-msr.availableHeight/2,yAxisPosX,xAxisPosY,data,statData)}else testRedraw(ctx,data,config),ctx.firstPass=9;return{data:data,config:config,ctx:ctx}}},StackedBar=function(a,e,t){function i(i){for(var l=new Array,n=new Array,o=0;o<a.datasets.length;o++)if("Line"!=a.datasets[o].type)for(var s=0;s<a.datasets[o].data.length;s++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,x,a.displayData,e.displayData,"displayData",s,-1,{nullvalue:null})){var r=animationCorrection(i,a,e,o,s,!1).animVal;if(r>1&&(r-=1),"undefined"!=typeof a.datasets[o].data[s]&&1*a.datasets[o].data[s]!=0){"undefined"==typeof l[s]&&(l[s]=x[x[o][s].firstNotMissing][s].yPosBottom,n[s]=x[x[o][s].firstNotMissing][s].yPosBottom);var c,h;c=1*a.datasets[o].data[s]>0?l[s]:n[s],h=c+r*(x[o][s].yPosTop-x[o][s].yPosBottom),1*a.datasets[o].data[s]>0?l[s]=h:n[s]=h,0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,x,a.datasets[o].displayData,e.displayData,"displayData",o,s,{nullvalue:null})&&(t.save(),t.lineWidth=Math.ceil(t.chartLineScale*setOptionValue(!0,!0,1,"BARSTROKEWIDTH",t,a,x,a.datasets[o].barStrokeWidth,e.barStrokeWidth,"barStrokeWidth",o,s,{animationValue:r,xPosLeft:x[o][s].xPosLeft,yPosBottom:c,xPosRight:x[o][s].xPosRight,yPosTop:h})),t.fillStyle=setOptionValue(!0,!0,1,"COLOR",t,a,x,a.datasets[o].fillColor,e.defaultFillColor,"fillColor",o,s,{animationValue:r,xPosLeft:x[o][s].xPosLeft,yPosBottom:c,xPosRight:x[o][s].xPosRight,yPosTop:h}),t.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",t,a,x,a.datasets[o].strokeColor,e.defaultStrokeColor,"strokeColor",o,s,{nullvalue:null}),0!=r&&c!=h&&(t.beginPath(),t.moveTo(x[o][s].xPosLeft,c+(h-c)/2),t.lineTo(x[o][s].xPosLeft,h),t.lineTo(x[o][s].xPosRight,h),t.lineTo(x[o][s].xPosRight,c),t.lineTo(x[o][s].xPosLeft,c),t.lineTo(x[o][s].xPosLeft,c+(h-c)/2),e.barShowStroke&&(t.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"STROKESTYLE",t,a,x,a.datasets[o].datasetStrokeStyle,e.datasetStrokeStyle,"datasetStrokeStyle",o,s,{nullvalue:null}))),t.stroke(),t.setLineDash([])),t.closePath(),t.fill()),t.restore())}}if(drawLinesDataset(i,a,e,t,x,{xAxisPosY:g,yAxisPosX:S,valueHop:p,nbValueHop:a.labels.length}),i>=e.animationStopValue){var d=0,u=0;for(o=0;o<a.datasets.length;o++)for(s=0;s<a.datasets[o].data.length;s++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,x,a.datasets[o].displayData,e.displayData,"displayData",o,s,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,x,a.displayData,e.displayData,"displayData",s,-1,{nullvalue:null})&&"undefined"!=typeof a.datasets[o].data[s]&&(jsGraphAnnotate[t.ChartNewId][jsGraphAnnotate[t.ChartNewId].length]=["RECT",o,s,x,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",t,a,x,a.datasets[o].annotateDisplay,e.annotateDisplay,"annotateDisplay",o,s,{nullValue:!0})],setOptionValue(!0,!0,1,"INGRAPHDATASHOW",t,a,x,a.datasets[o].inGraphDataShow,e.inGraphDataShow,"inGraphDataShow",o,s,{nullValue:!0}))){t.save(),t.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,x,void 0,e.inGraphDataAlign,"inGraphDataAlign",o,s,{nullValue:!0}),t.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,x,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",o,s,{nullValue:!0}),t.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",t,a,x,void 0,e.inGraphDataFontStyle,"inGraphDataFontStyle",o,s,{nullValue:!0})+" "+setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,x,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",o,s,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",t,a,x,void 0,e.inGraphDataFontFamily,"inGraphDataFontFamily",o,s,{nullValue:!0}),t.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",t,a,x,void 0,e.inGraphDataFontColor,"inGraphDataFontColor",o,s,{
nullValue:!0});var m=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",t,a,x,void 0,e.inGraphDataTmpl,"inGraphDataTmpl",o,s,{nullValue:!0}),x[o][s],e);if(t.beginPath(),t.beginPath(),d=0,u=0,1==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,x,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",o,s,{nullValue:!0})?u=x[o][s].xPosLeft+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,x,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",o,s,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,x,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",o,s,{nullValue:!0})?u=x[o][s].xPosLeft+f/2+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,x,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",o,s,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,x,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",o,s,{nullValue:!0})&&(u=x[o][s].xPosLeft+f+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,x,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",o,s,{nullValue:!0})),1==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,x,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",o,s,{nullValue:!0})?d=x[o][s].yPosBottom-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,x,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",o,s,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,x,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",o,s,{nullValue:!0})?d=(x[o][s].yPosTop+x[o][s].yPosBottom)/2-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,x,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",o,s,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,x,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",o,s,{nullValue:!0})&&(d=x[o][s].yPosTop-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,x,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",o,s,{nullValue:!0})),d>A.topNotUsableSize){t.translate(u,d);var D=setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,x,void 0,e.inGraphDataRotate,"inGraphDataRotate",o,s,{nullValue:!0})*(Math.PI/180);t.rotate(D),setTextBordersAndBackground(t,m,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,x,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",o,s,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",t,a,x,void 0,e.inGraphDataBorders,"inGraphDataBorders",o,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",t,a,x,void 0,e.inGraphDataBordersColor,"inGraphDataBordersColor",o,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,a,x,void 0,e.inGraphDataBordersWidth,"inGraphDataBordersWidth",o,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,a,x,void 0,e.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",o,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,a,x,void 0,e.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",o,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",t,a,x,void 0,e.inGraphDataBordersStyle,"inGraphDataBordersStyle",o,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",t,a,x,void 0,e.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",o,s,{nullValue:!0}),"INGRAPHDATA",e.inGraphDataBordersRadius),t.fillTextMultiLine(m,0,0,t.textBaseline,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,x,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",o,s,{nullValue:!0}),!0,e.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",D,u,d,o,s)}t.restore()}}A.legendMsr.dispLegend&&drawLegend(A.legendMsr,a,e,t,"StackedBar")}function l(){t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.strokeStyle=e.scaleLineColor,t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.beginPath(),t.moveTo(S-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),g),t.lineTo(S+A.availableWidth+Math.ceil(t.chartLineScale*e.scaleTickSizeRight),g),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(e.scaleGridLineStyle));for(var i=0;i<a.labels.length;i++)t.beginPath(),t.moveTo(S+i*p,g+Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleGridLineWidth),t.strokeStyle=e.scaleGridLineColor,e.scaleShowGridLines&&i>0&&i%e.scaleXGridLinesStep==0?t.lineTo(S+i*p,g-A.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeTop)):t.lineTo(S+i*p,g),t.stroke();t.setLineDash([]),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.strokeStyle=e.scaleLineColor,t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.beginPath(),t.moveTo(S,g+Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)),t.lineTo(S,g-A.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeTop)),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(e.scaleGridLineStyle));for(var l=e.showYAxisMin?-1:0;l<r.steps;l++)t.beginPath(),t.moveTo(S-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),g-(l+1)*s),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleGridLineWidth),t.strokeStyle=e.scaleGridLineColor,e.scaleShowGridLines&&(l+1)%e.scaleYGridLinesStep==0?t.lineTo(S+A.availableWidth+Math.ceil(t.chartLineScale*e.scaleTickSizeRight),g-(l+1)*s):t.lineTo(S,g-(l+1)*s),t.stroke();t.setLineDash([])}function n(){if(t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,(e.xAxisTop||e.xAxisBottom)&&(t.textBaseline="top",A.rotateLabels>90?(t.save(),t.textAlign="left"):A.rotateLabels>0?(t.save(),t.textAlign="right"):t.textAlign="center",t.fillStyle=e.scaleFontColor,e.xAxisBottom))for(var i=0;i<a.labels.length;i++)showLabels(t,a,e,i)&&(t.save(),A.rotateLabels>0?(t.translate(S+Math.ceil(t.chartSpaceScale*e.barValueSpacing)+i*p+y+f/2-A.highestXLabel/2,A.xLabelPos),t.rotate(-(A.rotateLabels*(Math.PI/180))),t.fillTextMultiLine(fmtChartJS(e,a.labels[i],e.fmtXLabel),0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"XAXIS_TEXTMOUSE",-(A.rotateLabels*(Math.PI/180)),S+Math.ceil(t.chartSpaceScale*e.barValueSpacing)+i*p+y+f/2-A.highestXLabel/2,A.xLabelPos,i,-1)):t.fillTextMultiLine(fmtChartJS(e,a.labels[i],e.fmtXLabel),S+Math.ceil(t.chartSpaceScale*e.barValueSpacing)+i*p+y+f/2,A.xLabelPos,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"XAXIS_TEXTMOUSE",0,0,0,i,-1),t.restore());t.textAlign="right",t.textBaseline="middle";for(var l=e.showYAxisMin?-1:0;l<r.steps;l++)e.scaleShowLabels&&showYLabels(t,a,e,l+1,r.labels[l+1])&&(e.yAxisLeft&&(t.textAlign="right",t.fillTextMultiLine(r.labels[l+1],S-(Math.ceil(t.chartLineScale*e.scaleTickSizeLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),g-(l+1)*s,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"YLEFTAXIS_TEXTMOUSE",0,0,0,-1,l)),e.yAxisRight&&(t.textAlign="left",t.fillTextMultiLine(r.labels[l+1],S+A.availableWidth+(Math.ceil(t.chartLineScale*e.scaleTickSizeRight)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),g-(l+1)*s,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,l)))}function o(){for(var i=-Number.MAX_VALUE,l=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=[],r=[],d=0,u=0,p=0;p<a.datasets.length;p++)for(var S=0;S<a.datasets[p].data.length;S++)1*a.datasets[p].data[S]>0?("Bar"==x[p][0].tpchart?("undefined"==typeof s[S]&&(s[S]=0),s[S]+=1*a.datasets[p].data[S],i=Math.max(i,s[S])):i=Math.max(i,1*a.datasets[p].data[S]),l=Math.min(l,1*a.datasets[p].data[S]),d=1):"number"==typeof(1*a.datasets[p].data[S])&&"undefined"!=typeof a.datasets[p].data[S]&&("Bar"==x[p][0].tpchart?("undefined"==typeof r[S]&&(r[S]=0),r[S]+=1*a.datasets[p].data[S],o=Math.min(o,r[S])):o=Math.min(o,1*a.datasets[p].data[S]),n=Math.max(n,1*a.datasets[p].data[S]),u=1);var g,f;0==d?(g=n,f=o):0==u?(g=i,f=l):(g=i,f=o),"function"==typeof e.graphMin?f=setOptionValue(!0,!0,1,"GRAPHMIN",t,a,x,void 0,e.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(e.graphMin)||(f=e.graphMin),"function"==typeof e.graphMax?g=setOptionValue(!0,!0,1,"GRAPHMAX",t,a,x,void 0,e.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(e.graphMax)||(g=e.graphMax),f>g&&(g=0,f=0),Math.abs(g-f)<e.zeroValue&&(Math.abs(g)<e.zeroValue&&(g=.9),g>0?(g=1.1*g,f=.9*f):(g=.9*g,f=1.1*f)),c=Math.ceil(t.chartTextScale*e.scaleFontSize),h=A.availableHeight;var m=Math.floor(h/(.66*c)),D=Math.floor(h/c*.5);return f>g&&(f=g-1),{maxValue:g,minValue:f,maxSteps:m,minSteps:D}}var s,r,c,h,d,u,p,S,g,f,A;if(t.tpchart="StackedBar",t.tpdata=0,init_and_start(t,a,e)){for(var x=initPassVariableData_part1(a,e,t),m=a.datasets.length,D=0;D<a.datasets.length;D++)"Line"==a.datasets[D].type?(x[D][0].tpchart="Line",m--):x[D][0].tpchart="Bar";if(e.logarithmic=!1,A=setMeasures(a,e,t,t.canvas.height,t.canvas.width,"nihil",[""],!0,!1,!0,!0,!0,"StackedBar"),d=o(),d.maxSteps>0&&d.minSteps>0){if(u=e.scaleShowLabels?e.scaleLabel:"",e.scaleOverride){var P=setOptionValue(!0,!0,1,"SCALESTARTVALUE",t,a,x,void 0,e.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),M=setOptionValue(!0,!0,1,"SCALESTEPS",t,a,x,void 0,e.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),T=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",t,a,x,void 0,e.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});r={steps:M,stepValue:T,graphMin:P,labels:[]};for(var D=0;D<=r.steps;D++)u&&r.labels.push(tmpl(u,{value:fmtChartJS(e,1*(P+T*D).toFixed(getDecimalPlaces(T)),e.fmtYLabel)},e));A=setMeasures(a,e,t,t.canvas.height,t.canvas.width,r.labels,null,!0,!1,!0,!0,!0,"StackedBar")}else r=calculateScale(1,e,d.maxSteps,d.minSteps,d.maxValue,d.minValue,u),A=setMeasures(a,e,t,t.canvas.height,t.canvas.width,r.labels,null,!0,!1,!0,!0,!0,"StackedBar");var v=A.availableHeight;A.availableHeight=A.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)-Math.ceil(t.chartLineScale*e.scaleTickSizeTop),A.availableWidth=A.availableWidth-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft)-Math.ceil(t.chartLineScale*e.scaleTickSizeRight),s=Math.floor(A.availableHeight/r.steps),p=Math.floor(A.availableWidth/a.labels.length),(0==p||e.fullWidthGraph)&&(p=A.availableWidth/a.labels.length),A.clrwidth=A.clrwidth-(A.availableWidth-a.labels.length*p),A.availableWidth=a.labels.length*p,A.availableHeight=r.steps*s,A.xLabelPos+=Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)+Math.ceil(t.chartLineScale*e.scaleTickSizeTop)-(v-A.availableHeight),A.clrheight+=Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)+Math.ceil(t.chartLineScale*e.scaleTickSizeTop)-(v-A.availableHeight),S=A.leftNotUsableSize+Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),g=A.topNotUsableSize+A.availableHeight+Math.ceil(t.chartLineScale*e.scaleTickSizeTop),f=p-2*Math.ceil(t.chartLineScale*e.scaleGridLineWidth)-2*Math.ceil(t.chartSpaceScale*e.barValueSpacing)-(1*Math.ceil(t.chartSpaceScale*e.barDatasetSpacing)-1)-Math.ceil(t.chartLineScale*e.barStrokeWidth)/2-1,f>=0&&1>=f&&(f=1),0>f&&f>=-1&&(f=-1);var y;1*e.maxBarWidth>0&&f>1*e.maxBarWidth?(y=(f-1*e.maxBarWidth)/2,f=1*e.maxBarWidth):y=0;var L=0,V=0;L=calculateOffset(!1,0,r,s),"object"==typeof calculatedScale2&&(V=calculateOffset(e.logarithmic2,0,calculatedScale2,scaleHop2)),n(),initPassVariableData_part2(x,a,e,t,{msr:A,zeroY:L,zeroY2:V,logarithmic:!1,logarithmic2:!1,calculatedScale:r,additionalSpaceBetweenBars:y,scaleHop:s,valueHop:p,yAxisPosX:S,xAxisPosY:g,barWidth:f}),animationLoop(e,l,i,t,A.clrx,A.clry,A.clrwidth,A.clrheight,S+A.availableWidth/2,g-A.availableHeight/2,S,g,a,x)}else testRedraw(t,a,e),t.firstPass=9;return{data:a,config:e,ctx:t}}},HorizontalStackedBar=function(a,e,t){function i(a,e,t){var i=e.steps*e.stepValue,l=a-e.graphMin,n=CapValue(l/i,1,0);return t*e.steps*n}function l(i){for(var l=new Array,n=new Array,o=0;o<a.datasets.length;o++)for(var s=0;s<a.datasets[o].data.length;s++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.displayData,e.displayData,"displayData",s,-1,{nullvalue:null})){t.lineWidth=Math.ceil(t.chartLineScale*setOptionValue(!0,!0,1,"BARSTROKEWIDTH",t,a,m,a.datasets[o].barStrokeWidth,e.barStrokeWidth,"barStrokeWidth",o,s,{animationValue:r,xPosLeft:c,yPosBottom:m[o][s].yPosBottom,xPosRight:h,yPosTop:m[o][s].yPosBottom}));var r=animationCorrection(i,a,e,o,s,!1).animVal;if(r>1&&(r-=1),"undefined"!=typeof a.datasets[o].data[s]&&1*a.datasets[o].data[s]!=0){"undefined"==typeof l[s]&&(l[s]=m[m[o][s].firstNotMissing][s].xPosLeft,n[s]=m[m[o][s].firstNotMissing][s].xPosLeft);var c,h;c=1*a.datasets[o].data[s]>0?l[s]:n[s],h=c+r*(m[o][s].xPosRight-m[o][s].xPosLeft),1*a.datasets[o].data[s]>0?l[s]=h:n[s]=h,0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.datasets[o].displayData,e.displayData,"displayData",o,s,{nullvalue:null})&&(t.fillStyle=setOptionValue(!0,!0,1,"COLOR",t,a,m,a.datasets[o].fillColor,e.defaultFillColor,"fillColor",o,s,{animationValue:r,xPosLeft:c,yPosBottom:m[o][s].yPosBottom,xPosRight:h,yPosTop:m[o][s].yPosBottom}),t.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",t,a,m,a.datasets[o].strokeColor,e.defaultStrokeColor,"strokeColor",o,s,{nullvalue:null}),0!=r&&m[o][s].xPosLeft!=m[o][s].xPosRight&&(t.beginPath(),t.moveTo(c+(h-c)/2,m[o][s].yPosTop),t.lineTo(h,m[o][s].yPosTop),t.lineTo(h,m[o][s].yPosBottom),t.lineTo(c,m[o][s].yPosBottom),t.lineTo(c,m[o][s].yPosTop),t.lineTo(c+(h-c)/2,m[o][s].yPosTop),e.barShowStroke&&(t.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"STROKESTYLE",t,a,m,a.datasets[o].datasetStrokeStyle,e.datasetStrokeStyle,"datasetStrokeStyle",o,s,{nullvalue:null}))),t.stroke(),t.setLineDash([])),t.closePath(),t.fill()))}}if(i>=e.animationStopValue){var d=0,u=0;for(o=0;o<a.datasets.length;o++)for(s=0;s<a.datasets[o].data.length;s++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.datasets[o].displayData,e.displayData,"displayData",o,s,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.displayData,e.displayData,"displayData",s,-1,{nullvalue:null})&&"undefined"!=typeof a.datasets[o].data[s]&&(jsGraphAnnotate[t.ChartNewId][jsGraphAnnotate[t.ChartNewId].length]=["RECT",o,s,m,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",t,a,m,a.datasets[o].annotateDisplay,e.annotateDisplay,"annotateDisplay",o,s,{nullValue:!0})],setOptionValue(!0,!0,1,"INGRAPHDATASHOW",t,a,m,a.datasets[o].inGraphDataShow,e.inGraphDataShow,"inGraphDataShow",o,s,{nullValue:!0}))){t.save(),t.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,m,void 0,e.inGraphDataAlign,"inGraphDataAlign",o,s,{nullValue:!0}),t.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,m,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",o,s,{nullValue:!0}),t.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",t,a,m,void 0,e.inGraphDataFontStyle,"inGraphDataFontStyle",o,s,{nullValue:!0})+" "+setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,m,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",o,s,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",t,a,m,void 0,e.inGraphDataFontFamily,"inGraphDataFontFamily",o,s,{nullValue:!0}),t.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",t,a,m,void 0,e.inGraphDataFontColor,"inGraphDataFontColor",o,s,{nullValue:!0});var p=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",t,a,m,void 0,e.inGraphDataTmpl,"inGraphDataTmpl",o,s,{nullValue:!0}),m[o][s],e);t.beginPath(),d=0,u=0,1==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,m,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",o,s,{nullValue:!0})?u=m[o][s].xPosLeft+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,m,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",o,s,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,m,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",o,s,{nullValue:!0})?u=m[o][s].xPosLeft+(m[o][s].xPosRight-m[o][s].xPosLeft)/2+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,m,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",o,s,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,m,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",o,s,{nullValue:!0})&&(u=m[o][s].xPosRight+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,m,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",o,s,{nullValue:!0})),1==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,m,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",o,s,{nullValue:!0})?d=m[o][s].yPosBottom-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,m,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",o,s,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,m,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",o,s,{nullValue:!0})?d=m[o][s].yPosBottom-A/2-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,m,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",o,s,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,m,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",o,s,{nullValue:!0})&&(d=m[o][s].yPosTop-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,m,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",o,s,{nullValue:!0})),t.translate(u,d),rotateVal=setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,m,void 0,e.inGraphDataRotate,"inGraphDataRotate",o,s,{nullValue:!0})*(Math.PI/180),t.rotate(rotateVal),setTextBordersAndBackground(t,p,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,m,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",o,s,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",t,a,m,void 0,e.inGraphDataBorders,"inGraphDataBorders",o,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",t,a,m,void 0,e.inGraphDataBordersColor,"inGraphDataBordersColor",o,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,a,m,void 0,e.inGraphDataBordersWidth,"inGraphDataBordersWidth",o,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,a,m,void 0,e.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",o,s,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,a,m,void 0,e.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",o,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",t,a,m,void 0,e.inGraphDataBordersStyle,"inGraphDataBordersStyle",o,s,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",t,a,m,void 0,e.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",o,s,{nullValue:!0}),"INGRAPHDATA",e.inGraphDataBordersRadius),t.fillTextMultiLine(p,0,0,t.textBaseline,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,m,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",o,s,{nullValue:!0}),!0,e.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",rotateVal,u,d,o,s),t.restore()}}x.legendMsr.dispLegend&&drawLegend(x.legendMsr,a,e,t,"HorizontalStackedBar")}function n(){t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.strokeStyle=e.scaleLineColor,t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.beginPath(),t.moveTo(g-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),f),t.lineTo(g+x.availableWidth,f),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(e.scaleGridLineStyle));for(var i=e.showYAxisMin?-1:0;i<c.steps;i++)i>=0&&(t.beginPath(),t.moveTo(g+i*S,f+Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleGridLineWidth),t.strokeStyle=e.scaleGridLineColor,e.scaleShowGridLines&&i>0&&i%e.scaleXGridLinesStep==0?t.lineTo(g+i*S,f-x.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeTop)):t.lineTo(g+i*S,f),t.stroke()),t.setLineDash([]);t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.strokeStyle=e.scaleLineColor,t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.beginPath(),t.moveTo(g,f+Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)),t.lineTo(g,f-x.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeTop)),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(e.scaleGridLineStyle));for(var l=0;l<a.labels.length;l++)t.beginPath(),t.moveTo(g-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),f-(l+1)*r),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleGridLineWidth),t.strokeStyle=e.scaleGridLineColor,e.scaleShowGridLines&&(l+1)%e.scaleYGridLinesStep==0?t.lineTo(g+x.availableWidth,f-(l+1)*r):t.lineTo(g,f-(l+1)*r),t.stroke();t.setLineDash([])}function o(){if(t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,e.scaleShowLabels&&(e.xAxisTop||e.xAxisBottom)&&(t.textBaseline="top",x.rotateLabels>90?(t.save(),t.textAlign="left"):x.rotateLabels>0?(t.save(),t.textAlign="right"):t.textAlign="center",t.fillStyle=e.scaleFontColor,e.xAxisBottom))for(var i=e.showYAxisMin?-1:0;i<c.steps;i++)showYLabels(t,a,e,i+1,c.labels[i+1])&&(t.save(),x.rotateLabels>0?(t.translate(g+(i+1)*S-x.highestXLabel/2,x.xLabelPos),t.rotate(-(x.rotateLabels*(Math.PI/180))),t.fillTextMultiLine(c.labels[i+1],0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"XAXIS_TEXTMOUSE",-(x.rotateLabels*(Math.PI/180)),g+(i+1)*S-x.highestXLabel/2,x.xLabelPos,i,-1)):t.fillTextMultiLine(c.labels[i+1],g+(i+1)*S,x.xLabelPos,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"XAXIS_TEXTMOUSE",0,0,0,i,-1),t.restore());t.textAlign="right",t.textBaseline="middle";for(var l=0;l<a.labels.length;l++)showLabels(t,a,e,l)&&(e.yAxisLeft&&(t.textAlign="right",t.fillTextMultiLine(fmtChartJS(e,a.labels[l],e.fmtXLabel),g-(Math.ceil(t.chartLineScale*e.scaleTickSizeLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),f-(l+1)*r+Math.ceil(t.chartSpaceScale*e.barValueSpacing)+v+A/2,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"YLEFTAXIS_TEXTMOUSE",0,0,0,-1,l)),e.yAxisRight&&(t.textAlign="left",t.fillTextMultiLine(fmtChartJS(e,a.labels[l],e.fmtXLabel),g+x.availableWidth+(Math.ceil(t.chartLineScale*e.scaleTickSizeRight)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),f-(l+1)*r+v+A/2,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,l)))}function s(){for(var i=-Number.MAX_VALUE,l=Number.MAX_VALUE,n=(new Array(a.datasets.length),new Array(a.datasets.length),0);n<a.datasets.length;n++)for(var o=0;o<a.datasets[n].data.length;o++){var s=n,r=0,c=0;for("undefined"!=typeof a.datasets[0].data[o]&&(1*a.datasets[0].data[o]>0?(r+=1*a.datasets[0].data[o],r>i&&(i=r),l>r&&(l=r)):(c+=1*a.datasets[0].data[o],c>i&&(i=c),l>c&&(l=c)));s>0;)"undefined"!=typeof a.datasets[s].data[o]&&(1*a.datasets[s].data[o]>0?(r+=1*a.datasets[s].data[o],r>i&&(i=r),l>r&&(l=r)):(c+=1*a.datasets[s].data[o],c>i&&(i=c),l>c&&(l=c))),s--}"function"==typeof e.graphMin?l=setOptionValue(!0,!0,1,"GRAPHMIN",t,a,m,void 0,e.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(e.graphMin)||(l=e.graphMin),"function"==typeof e.graphMax?i=setOptionValue(!0,!0,1,"GRAPHMAX",t,a,m,void 0,e.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(e.graphMax)||(i=e.graphMax),l>i&&(i=0,l=0),Math.abs(i-l)<e.zeroValue&&(Math.abs(i)<e.zeroValue&&(i=.9),i>0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),h=Math.ceil(t.chartTextScale*e.scaleFontSize),d=x.availableHeight;var u=Math.floor(d/(.66*h)),p=Math.floor(d/h*.5);return l>i&&(l=i-1),{maxValue:i,minValue:l,maxSteps:u,minSteps:p}}var r,c,h,d,u,p,S,g,f,A,x;if(e.reverseOrder&&"undefined"==typeof t.reversed&&(t.reversed=!0,a=reverseData(a)),t.tpchart="HorizontalStackedBar",t.tpdata=0,init_and_start(t,a,e)){var m=initPassVariableData_part1(a,e,t);if(e.logarithmic=!1,x=setMeasures(a,e,t,t.canvas.height,t.canvas.width,"nihil",[""],!0,!0,!0,!0,!0,"HorizontalStackedBar"),u=s(),u.maxSteps>0&&u.minSteps>0){if(p=e.scaleShowLabels?e.scaleLabel:"",e.scaleOverride){var D=setOptionValue(!0,!0,1,"SCALESTARTVALUE",t,a,m,void 0,e.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),P=setOptionValue(!0,!0,1,"SCALESTEPS",t,a,m,void 0,e.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),M=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",t,a,m,void 0,e.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});c={steps:P,stepValue:M,graphMin:D,labels:[]};for(var T=0;T<=c.steps;T++)p&&c.labels.push(tmpl(p,{value:fmtChartJS(e,1*(D+M*T).toFixed(getDecimalPlaces(M)),e.fmtYLabel)},e));x=setMeasures(a,e,t,t.canvas.height,t.canvas.width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalStackedBar")}else c=calculateScale(1,e,u.maxSteps,u.minSteps,u.maxValue,u.minValue,p),x=setMeasures(a,e,t,t.canvas.height,t.canvas.width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalStackedBar");x.availableHeight=x.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)-Math.ceil(t.chartLineScale*e.scaleTickSizeTop),x.availableWidth=x.availableWidth-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft)-Math.ceil(t.chartLineScale*e.scaleTickSizeRight),r=Math.floor(x.availableHeight/a.labels.length),S=Math.floor(x.availableWidth/c.steps),(0==S||e.fullWidthGraph)&&(S=x.availableWidth/c.steps),x.clrwidth=x.clrwidth-(x.availableWidth-c.steps*S),x.availableWidth=c.steps*S,x.availableHeight=a.labels.length*r,g=x.leftNotUsableSize+Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),f=x.topNotUsableSize+x.availableHeight+Math.ceil(t.chartLineScale*e.scaleTickSizeTop),A=r-2*Math.ceil(t.chartLineScale*e.scaleGridLineWidth)-2*Math.ceil(t.chartSpaceScale*e.barValueSpacing)-(1*Math.ceil(t.chartSpaceScale*e.barDatasetSpacing)-1)-Math.ceil(t.chartLineScale*e.barStrokeWidth)/2-1,A>=0&&1>=A&&(A=1),0>A&&A>=-1&&(A=-1);var v;1*e.maxBarWidth>0&&A>1*e.maxBarWidth?(v=(A-1*e.maxBarWidth)/2,A=1*e.maxBarWidth):v=0,o();var y=i(0,c,r);initPassVariableData_part2(m,a,e,t,{yAxisPosX:g,additionalSpaceBetweenBars:v,xAxisPosY:f,barWidth:A,zeroY:y,scaleHop:r,valueHop:S,calculatedScale:c}),animationLoop(e,n,l,t,x.clrx,x.clry,x.clrwidth,x.clrheight,g+x.availableWidth/2,f-x.availableHeight/2,g,f,a,m)}else testRedraw(t,a,e),t.firstPass=9;return{data:a,config:e,ctx:t}}},Bar=function(data,config,ctx){function drawBars(a){for(var e,t,i,l=0;l<data.datasets.length;l++)if("Line"!=data.datasets[l].type)for(var n=0;n<data.datasets[l].data.length;n++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",ctx,data,statData,data.datasets[l].displayData,config.displayData,"displayData",l,n,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",n,-1,{nullvalue:null})){if(ctx.save(),ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(!0,!0,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[l].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",l,n,{animationValue:o,xPosLeft:statData[l][n].xPosLeft,yPosBottom:statData[l][n].yPosBottom,xPosRight:statData[l][n].xPosLeft+barWidth,yPosTop:statData[l][n].yPosBottom-s})),"undefined"!=typeof data.datasets[l].data[n]){var o=animationCorrection(a,data,config,l,n,!1).animVal;o>1&&(o-=1);var s=o*statData[l][n].barHeight+Math.ceil(ctx.chartLineScale*ctx.lineWidth)/2;ctx.fillStyle=setOptionValue(!0,!0,1,"COLOR",ctx,data,statData,data.datasets[l].fillColor,config.defaultFillColor,"fillColor",l,n,{animationValue:o,xPosLeft:statData[l][n].xPosLeft,yPosBottom:statData[l][n].yPosBottom,xPosRight:statData[l][n].xPosLeft+barWidth,yPosTop:statData[l][n].yPosBottom-s}),ctx.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",ctx,data,statData,data.datasets[l].strokeColor,config.defaultStrokeColor,"strokeColor",l,n,{nullvalue:null}),roundRect(ctx,statData[l][n].xPosLeft,statData[l][n].yPosBottom,barWidth,s,config.barShowStroke,config.barBorderRadius,l,n,data.datasets[l].data[n]<0?-1:1)}ctx.restore()}for(var l=0;l<data.datasets.length;l++)if("Line"!=data.datasets[l].type)for(var n=0;n<data.datasets[l].data.length;n++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",ctx,data,statData,data.datasets[l].displayData,config.displayData,"displayData",l,n,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",n,-1,{nullvalue:null})&&(i=setOptionValue(!0,!0,1,"COMPLEMENTARYBAR",ctx,data,statData,data.datasets[l].complementaryBar,config.complementaryBar,"complementaryBar",l,n,{nullvalue:null}),0!=i)){ctx.save(),ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(!0,!0,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[l].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",l,n,{animationValue:o,xPosLeft:statData[l][n].xPosLeft,yPosBottom:statData[l][n].yPosBottom,xPosRight:statData[l][n].xPosLeft+barWidth,yPosTop:statData[l][n].yPosBottom-s}));var o=animationCorrection(a,data,config,l,n,!1).animVal;if(o>1&&(o-=1),"undefined"!=typeof data.datasets[l].data[n])var s=o*statData[l][n].barHeight+Math.ceil(ctx.chartLineScale*ctx.lineWidth)/2;else s=0;1*data.datasets[l].data[n]<0?otherBarHeight=-(statData[l][n].yPosBottom-msr.clry)-s+ctx.lineWidth/2+Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft):otherBarHeight=statData[l][n].yPosBottom-msr.clry-s-ctx.lineWidth/2,ctx.fillStyle=setOptionValue(!0,!0,1,"COMPLEMENTARYCOLOR",ctx,data,statData,data.datasets[l].complementaryColor,config.complementaryColor,"complementaryColor",l,n,{animationValue:o,xPosLeft:statData[l][n].xPosLeft,yPosBottom:statData[l][n].yPosBottom-s,xPosRight:statData[l][n].xPosLeft+barWidth,yPosTop:statData[l][n].yPosBottom-s-otherBarHeight}),ctx.strokeStyle=setOptionValue(!0,!0,1,"COMPLEMENTARYSTROKECOLOR",ctx,data,statData,data.datasets[l].complementaryStrokeColor,config.complementaryStrokeColor,"strokeColor",l,n,{nullvalue:null}),roundRect(ctx,statData[l][n].xPosLeft,statData[l][n].yPosBottom-s,barWidth,otherBarHeight,config.barShowStroke,config.barBorderRadius,l,n,data.datasets[l].data[n]<0?-1:1),ctx.restore()}if(drawLinesDataset(a,data,config,ctx,statData,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,nbValueHop:data.labels.length}),a>=config.animationStopValue)for(l=0;l<data.datasets.length;l++)for(n=0;n<data.datasets[l].data.length;n++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",ctx,data,statData,data.datasets[l].displayData,config.displayData,"displayData",l,n,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",n,-1,{nullvalue:null})&&"undefined"!=typeof data.datasets[l].data[n]&&"Line"!=data.datasets[l].type&&(jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length]=["RECT",l,n,statData,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[l].annotateDisplay,config.annotateDisplay,"annotateDisplay",l,n,{nullValue:!0})],setOptionValue(!0,!0,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[l].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",l,n,{nullValue:!0}))){ctx.save(),ctx.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",ctx,data,statData,void 0,config.inGraphDataAlign,"inGraphDataAlign",l,n,{nullValue:!0}),ctx.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",ctx,data,statData,void 0,config.inGraphDataVAlign,"inGraphDataVAlign",l,n,{nullValue:!0}),ctx.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,void 0,config.inGraphDataFontStyle,"inGraphDataFontStyle",l,n,{nullValue:!0})+" "+setOptionValue(!0,!0,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,void 0,config.inGraphDataFontSize,"inGraphDataFontSize",l,n,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,void 0,config.inGraphDataFontFamily,"inGraphDataFontFamily",l,n,{nullValue:!0}),ctx.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,void 0,config.inGraphDataFontColor,"inGraphDataFontColor",l,n,{nullValue:!0}),e=statData[l][n].yPosBottom,t=statData[l][n].yPosTop,ctx.beginPath();var r=0,c=0;1==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",ctx,data,statData,void 0,config.inGraphDataXPosition,"inGraphDataXPosition",l,n,{nullValue:!0})?c=statData[l][n].xPosLeft+setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,void 0,config.inGraphDataPaddingX,"inGraphDataPaddingX",l,n,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",ctx,data,statData,void 0,config.inGraphDataXPosition,"inGraphDataXPosition",l,n,{nullValue:!0})?c=statData[l][n].xPosLeft+barWidth/2+setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,void 0,config.inGraphDataPaddingX,"inGraphDataPaddingX",l,n,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",ctx,data,statData,void 0,config.inGraphDataXPosition,"inGraphDataXPosition",l,n,{
nullValue:!0})&&(c=statData[l][n].xPosLeft+barWidth+setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,void 0,config.inGraphDataPaddingX,"inGraphDataPaddingX",l,n,{nullValue:!0})),1==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",ctx,data,statData,void 0,config.inGraphDataYPosition,"inGraphDataYPosition",l,n,{nullValue:!0})?r=statData[l][n].yPosBottom-setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,void 0,config.inGraphDataPaddingY,"inGraphDataPaddingY",l,n,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",ctx,data,statData,void 0,config.inGraphDataYPosition,"inGraphDataYPosition",l,n,{nullValue:!0})?r=(statData[l][n].yPosBottom+statData[l][n].yPosTop)/2-setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,void 0,config.inGraphDataPaddingY,"inGraphDataPaddingY",l,n,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",ctx,data,statData,void 0,config.inGraphDataYPosition,"inGraphDataYPosition",l,n,{nullValue:!0})&&(r=statData[l][n].yPosTop-setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,void 0,config.inGraphDataPaddingY,"inGraphDataPaddingY",l,n,{nullValue:!0})),ctx.translate(c,r);var h=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",ctx,data,statData,void 0,config.inGraphDataTmpl,"inGraphDataTmpl",l,n,{nullValue:!0}),statData[l][n],config);rotateVal=setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",ctx,data,statData,void 0,config.inGraphDataRotate,"inGraphDataRotate",l,n,{nullValue:!0})*(Math.PI/180),ctx.rotate(rotateVal),setTextBordersAndBackground(ctx,h,setOptionValue(!0,!0,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,void 0,config.inGraphDataFontSize,"inGraphDataFontSize",l,n,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",ctx,data,statData,void 0,config.inGraphDataBorders,"inGraphDataBorders",l,n,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,void 0,config.inGraphDataBordersColor,"inGraphDataBordersColor",l,n,{nullValue:!0}),setOptionValue(!0,!0,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,void 0,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",l,n,{nullValue:!0}),setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,void 0,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",l,n,{nullValue:!0}),setOptionValue(!0,!0,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,void 0,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",l,n,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,void 0,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",l,n,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,void 0,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",l,n,{nullValue:!0}),"INGRAPHDATA",config.inGraphDataBordersRadius),ctx.fillTextMultiLine(h,0,0,ctx.textBaseline,setOptionValue(!0,!0,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,void 0,config.inGraphDataFontSize,"inGraphDataFontSize",l,n,{nullValue:!0}),!0,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,c,r,l,n),ctx.restore()}a>=1&&"function"==typeof drawMath&&drawMath(ctx,config,data,msr,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,scaleHop:scaleHop,zeroY:zeroY,calculatedScale:calculatedScale,calculateOffset:calculateOffset,additionalSpaceBetweenBars:additionalSpaceBetweenBars,barWidth:barWidth}),msr.legendMsr.dispLegend&&drawLegend(msr.legendMsr,data,config,ctx,"Bar")}function roundRect(a,e,t,i,l,n,o,s,r,c){a.beginPath(),a.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"STROKESTYLE",a,data,statData,data.datasets[s].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",s,r,{nullvalue:null}))),a.moveTo(e+i/2,t),a.lineTo(e+i,t),a.lineTo(e+i,t-l+c*o),a.quadraticCurveTo(e+i,t-l,e+i-o,t-l),a.lineTo(e+o,t-l),a.quadraticCurveTo(e,t-l,e,t-l+c*o),a.lineTo(e,t),a.lineTo(e+i/2,t),n&&a.stroke(),a.closePath(),a.fill(),a.setLineDash([])}function drawScale(){ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleLineWidth),ctx.strokeStyle=config.scaleLineColor,ctx.setLineDash(lineStyleFn(config.scaleLineStyle)),ctx.beginPath(),ctx.moveTo(yAxisPosX-Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft),xAxisPosY),ctx.lineTo(yAxisPosX+msr.availableWidth+Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight),xAxisPosY),ctx.stroke(),ctx.setLineDash([]),ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle));for(var a=0;a<data.labels.length;a++)ctx.beginPath(),ctx.moveTo(yAxisPosX+a*valueHop,xAxisPosY+Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)),ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth),ctx.strokeStyle=config.scaleGridLineColor,config.scaleShowGridLines&&a>0&&a%config.scaleXGridLinesStep==0?ctx.lineTo(yAxisPosX+a*valueHop,xAxisPosY-msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)):ctx.lineTo(yAxisPosX+a*valueHop,xAxisPosY),ctx.stroke();ctx.setLineDash([]),ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleLineWidth),ctx.strokeStyle=config.scaleLineColor,ctx.setLineDash(lineStyleFn(config.scaleLineStyle)),ctx.beginPath(),ctx.moveTo(yAxisPosX,xAxisPosY+Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)),ctx.lineTo(yAxisPosX,xAxisPosY-msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)),ctx.stroke(),ctx.setLineDash([]),ctx.setLineDash(lineStyleFn(config.scaleGridLineStyle));for(var e=0;e<calculatedScale.steps;e++)ctx.beginPath(),ctx.moveTo(yAxisPosX-Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft),xAxisPosY-(e+1)*scaleHop),ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth),ctx.strokeStyle=config.scaleGridLineColor,config.scaleShowGridLines&&(e+1)%config.scaleYGridLinesStep==0?ctx.lineTo(yAxisPosX+msr.availableWidth+Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight),xAxisPosY-(e+1)*scaleHop):ctx.lineTo(yAxisPosX,xAxisPosY-(e+1)*scaleHop),ctx.stroke();ctx.setLineDash([])}function drawLabels(){if(ctx.font=config.scaleFontStyle+" "+Math.ceil(ctx.chartTextScale*config.scaleFontSize).toString()+"px "+config.scaleFontFamily,(config.xAxisTop||config.xAxisBottom)&&(ctx.textBaseline="top",msr.rotateLabels>90?(ctx.save(),ctx.textAlign="left"):msr.rotateLabels>0?(ctx.save(),ctx.textAlign="right"):ctx.textAlign="center",ctx.fillStyle=config.scaleFontColor,config.xAxisBottom))for(var a=0;a<data.labels.length;a++)showLabels(ctx,data,config,a)&&(ctx.save(),msr.rotateLabels>0?(ctx.translate(yAxisPosX+a*valueHop+valueHop/2-msr.highestXLabel/2,msr.xLabelPos),ctx.rotate(-(msr.rotateLabels*(Math.PI/180))),ctx.fillTextMultiLine(fmtChartJS(config,data.labels[a],config.fmtXLabel),0,0,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XAXIS_TEXTMOUSE",-(msr.rotateLabels*(Math.PI/180)),yAxisPosX+a*valueHop+valueHop/2-msr.highestXLabel/2,msr.xLabelPos,a,-1)):ctx.fillTextMultiLine(fmtChartJS(config,data.labels[a],config.fmtXLabel),yAxisPosX+a*valueHop+valueHop/2,msr.xLabelPos,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XAXIS_TEXTMOUSE",0,0,0,a,-1),ctx.restore());ctx.textAlign="right",ctx.textBaseline="middle";for(var e=config.showYAxisMin?-1:0;e<calculatedScale.steps;e++)config.scaleShowLabels&&showYLabels(ctx,data,config,e+1,calculatedScale.labels[e+1])&&(config.yAxisLeft&&(ctx.textAlign="right",ctx.fillTextMultiLine(calculatedScale.labels[e+1],yAxisPosX-(Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft)+Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)),xAxisPosY-(e+1)*scaleHop,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"YLEFTAXIS_TEXTMOUSE",0,0,0,-1,e)),config.yAxisRight&&!valueBounds.dbAxis&&(ctx.textAlign="left",ctx.fillTextMultiLine(calculatedScale.labels[e+1],yAxisPosX+msr.availableWidth+(Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight)+Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)),xAxisPosY-(e+1)*scaleHop,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,e)));if(config.yAxisRight&&valueBounds.dbAxis)for(e=config.showYAxisMin?-1:0;e<calculatedScale2.steps;e++)config.scaleShowLabels&&(ctx.textAlign="left",ctx.fillTextMultiLine(calculatedScale2.labels[e+1],yAxisPosX+msr.availableWidth+(Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight)+Math.ceil(ctx.chartSpaceScale*config.yAxisSpaceRight)),xAxisPosY-(e+1)*scaleHop2,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,e))}function getValueBounds(){for(var upperValue=-Number.MAX_VALUE,lowerValue=Number.MAX_VALUE,upperValue2=-Number.MAX_VALUE,lowerValue2=Number.MAX_VALUE,secondAxis=!1,firstAxis=!1,mathValueHeight,i=0;i<data.datasets.length;i++){var mathFctName=data.datasets[i].drawMathDeviation,mathValueHeight=0;if("function"==typeof eval(mathFctName)){var parameter={data:data,datasetNr:i};mathValueHeightVal=window[mathFctName](parameter)}else mathValueHeightVal=0;for(var j=0;j<data.datasets[i].data.length;j++)mathValueHeight="object"==typeof mathValueHeightVal?mathValueHeightVal[Math.min(mathValueHeightVal.length,j)]:mathValueHeightVal,"undefined"!=typeof data.datasets[i].data[j]&&(2==data.datasets[i].axis?(secondAxis=!0,1*data.datasets[i].data[j]+mathValueHeight>upperValue2&&(upperValue2=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeight<lowerValue2&&(lowerValue2=1*data.datasets[i].data[j]-mathValueHeight)):(firstAxis=!0,1*data.datasets[i].data[j]+mathValueHeight>upperValue&&(upperValue=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeight<lowerValue&&(lowerValue=1*data.datasets[i].data[j]-mathValueHeight)))}lowerValue>upperValue&&(upperValue=0,lowerValue=0),Math.abs(upperValue-lowerValue)<config.zeroValue&&(Math.abs(upperValue)<config.zeroValue&&(upperValue=.9),upperValue>0?(upperValue=1.1*upperValue,lowerValue=.9*lowerValue):(upperValue=.9*upperValue,lowerValue=1.1*lowerValue)),"function"==typeof config.graphMin?lowerValue=setOptionValue(!0,!0,1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(config.graphMin)||(lowerValue=config.graphMin),"function"==typeof config.graphMax?upperValue=setOptionValue(!0,!0,1,"GRAPHMAX",ctx,data,statData,void 0,config.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(config.graphMax)||(upperValue=config.graphMax),secondAxis&&(lowerValue2>upperValue2&&(upperValue2=0,lowerValue2=0),Math.abs(upperValue2-lowerValue2)<config.zeroValue&&(Math.abs(upperValue2)<config.zeroValue&&(upperValue2=.9),upperValue2>0?(upperValue2=1.1*upperValue2,lowerValue2=.9*lowerValue2):(upperValue2=.9*upperValue2,lowerValue2=1.1*lowerValue2)),"function"==typeof config.graphMin2?lowerValue2=setOptionValue(!0,!0,1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin2,"graphMin2",-1,-1,{nullValue:!0}):isNaN(config.graphMin2)||(lowerValue2=config.graphMin2),"function"==typeof config.graphMax2?upperValue2=setOptionValue(!0,!0,1,"GRAPHMAX",ctx,data,statData,void 0,config.graphMax2,"graphMax2",-1,-1,{nullValue:!0}):isNaN(config.graphMax2)||(upperValue2=config.graphMax2)),!firstAxis&&secondAxis&&(upperValue=upperValue2,lowerValue=lowerValue2),labelHeight=Math.ceil(ctx.chartTextScale*config.scaleFontSize),scaleHeight=msr.availableHeight;var maxSteps=Math.floor(scaleHeight/(.66*labelHeight)),minSteps=Math.floor(scaleHeight/labelHeight*.5);return lowerValue>upperValue&&(lowerValue=upperValue-1),lowerValue2>upperValue2&&(lowerValue2=upperValue2-1),{maxValue:upperValue,minValue:lowerValue,maxValue2:upperValue2,minValue2:lowerValue2,dbAxis:secondAxis,maxSteps:maxSteps,minSteps:minSteps}}var maxSize,scaleHop,scaleHop2,calculatedScale,calculatedScale2,labelHeight,scaleHeight,valueBounds,labelTemplateString,labelTemplateString2,valueHop,widestXLabel,xAxisLength,yAxisPosX,xAxisPosY,barWidth,rotateLabels=0,msr;if(ctx.tpchart="Bar",ctx.tpdata=0,init_and_start(ctx,data,config)){for(var statData=initPassVariableData_part1(data,config,ctx),nrOfBars=data.datasets.length,i=0;i<data.datasets.length;i++)"Line"==data.datasets[i].type?(statData[i][0].tpchart="Line",nrOfBars--):statData[i][0].tpchart="Bar";var bufferDataset,l=0;if(msr=setMeasures(data,config,ctx,ctx.canvas.height,ctx.canvas.width,"nihil",[""],!0,!1,!0,!0,!0,"Bar"),valueBounds=getValueBounds(),valueBounds.minValue<=0&&(config.logarithmic=!1),valueBounds.maxSteps>0&&valueBounds.minSteps>0){config.logarithmic!==!1&&valueBounds.minValue<=0&&(config.logarithmic=!1),config.logarithmic2!==!1&&valueBounds.minValue2<=0&&(config.logarithmic2=!1);var OrderOfMagnitude=calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.maxValue)+1))-calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.minValue)));("fuzzy"==config.logarithmic&&4>OrderOfMagnitude||config.scaleOverride)&&(config.logarithmic=!1);var OrderOfMagnitude2=calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.maxValue2)+1))-calculateOrderOfMagnitude(Math.pow(10,calculateOrderOfMagnitude(valueBounds.minValue2)));if(("fuzzy"==config.logarithmic2&&4>OrderOfMagnitude2||config.scaleOverride2)&&(config.logarithmic2=!1),labelTemplateString=config.scaleShowLabels?config.scaleLabel:"",labelTemplateString2=config.scaleShowLabels2?config.scaleLabel2:"",config.scaleOverride){var scaleStartValue=setOptionValue(!0,!0,1,"SCALESTARTVALUE",ctx,data,statData,void 0,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),scaleSteps=setOptionValue(!0,!0,1,"SCALESTEPS",ctx,data,statData,void 0,config.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),scaleStepWidth=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",ctx,data,statData,void 0,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});calculatedScale={steps:scaleSteps,stepValue:scaleStepWidth,graphMin:scaleStartValue,graphMax:scaleStartValue+scaleSteps*scaleStepWidth,labels:[]},populateLabels(1,config,labelTemplateString,calculatedScale.labels,calculatedScale.steps,scaleStartValue,calculatedScale.graphMax,scaleStepWidth)}else calculatedScale=calculateScale(1,config,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue,valueBounds.minValue,labelTemplateString);if(valueBounds.dbAxis)if(config.scaleOverride2){var scaleStartValue2=setOptionValue(!0,!0,1,"SCALESTARTVALUE2",ctx,data,statData,void 0,config.scaleStartValue2,"scaleStartValue2",-1,-1,{nullValue:!0}),scaleSteps2=setOptionValue(!0,!0,1,"SCALESTEPS2",ctx,data,statData,void 0,config.scaleSteps2,"scaleSteps2",-1,-1,{nullValue:!0}),scaleStepWidth2=setOptionValue(!0,!0,1,"SCALESTEPWIDTH2",ctx,data,statData,void 0,config.scaleStepWidth2,"scaleStepWidth2",-1,-1,{nullValue:!0});calculatedScale2={steps:scaleSteps2,stepValue:scaleStepWidth2,graphMin:scaleStartValue2,graphMax:scaleStartValue2+scaleSteps2*scaleStepWidth2,labels:[]},populateLabels(2,config,labelTemplateString2,calculatedScale2.labels,calculatedScale2.steps,scaleStartValue2,calculatedScale2.graphMax,scaleStepWidth2)}else calculatedScale2=calculateScale(2,config,valueBounds.maxSteps,valueBounds.minSteps,valueBounds.maxValue2,valueBounds.minValue2,labelTemplateString2);else calculatedScale2={steps:0,stepValue:0,graphMin:0,graphMax:0,labels:null};msr=setMeasures(data,config,ctx,ctx.canvas.height,ctx.canvas.width,calculatedScale.labels,calculatedScale2.labels,!0,!1,!0,!0,!0,"Bar");var prevHeight=msr.availableHeight;msr.availableHeight=msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop),msr.availableWidth=msr.availableWidth-Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft)-Math.ceil(ctx.chartLineScale*config.scaleTickSizeRight),scaleHop=Math.floor(msr.availableHeight/calculatedScale.steps),scaleHop2=Math.floor(msr.availableHeight/calculatedScale2.steps),valueHop=Math.floor(msr.availableWidth/data.labels.length),(0==valueHop||config.fullWidthGraph)&&(valueHop=msr.availableWidth/data.labels.length),msr.clrwidth=msr.clrwidth-(msr.availableWidth-data.labels.length*valueHop),msr.availableWidth=data.labels.length*valueHop,msr.availableHeight=calculatedScale.steps*scaleHop,msr.xLabelPos+=Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)+Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)-(prevHeight-msr.availableHeight),msr.clrheight+=Math.ceil(ctx.chartLineScale*config.scaleTickSizeBottom)+Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)-(prevHeight-msr.availableHeight),yAxisPosX=msr.leftNotUsableSize+Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft),xAxisPosY=msr.topNotUsableSize+msr.availableHeight+Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop),barWidth=(valueHop-2*Math.ceil(ctx.chartLineScale*config.scaleGridLineWidth)-2*Math.ceil(ctx.chartSpaceScale*config.barValueSpacing)-(Math.ceil(ctx.chartSpaceScale*config.barDatasetSpacing)*nrOfBars-1)-(Math.ceil(ctx.chartLineScale*config.barStrokeWidth)/2*nrOfBars-1))/nrOfBars,barWidth>=0&&1>=barWidth&&(barWidth=1),0>barWidth&&barWidth>=-1&&(barWidth=-1);var additionalSpaceBetweenBars;1*config.maxBarWidth>0&&barWidth>1*config.maxBarWidth?(additionalSpaceBetweenBars=nrOfBars*(barWidth-1*config.maxBarWidth)/2,barWidth=1*config.maxBarWidth):additionalSpaceBetweenBars=0;var zeroY2=0,zeroY=calculateOffset(config.logarithmic,0,calculatedScale,scaleHop);"object"==typeof calculatedScale2&&(zeroY2=calculateOffset(config.logarithmic2,0,calculatedScale2,scaleHop2)),initPassVariableData_part2(statData,data,config,ctx,{msr:msr,yAxisPosX:yAxisPosX,xAxisPosY:xAxisPosY,valueHop:valueHop,nbValueHop:data.labels.length-1,barWidth:barWidth,additionalSpaceBetweenBars:additionalSpaceBetweenBars,zeroY:zeroY,zeroY2:zeroY2,calculatedScale:calculatedScale,calculatedScale2:calculatedScale2,scaleHop:scaleHop,scaleHop2:scaleHop2}),drawLabels(),animationLoop(config,drawScale,drawBars,ctx,msr.clrx,msr.clry,msr.clrwidth,msr.clrheight,yAxisPosX+msr.availableWidth/2,xAxisPosY-msr.availableHeight/2,yAxisPosX,xAxisPosY,data,statData)}else testRedraw(ctx,data,config),ctx.firstPass=9;return{data:data,config:config,ctx:ctx}}},HorizontalBar=function(a,e,t){function i(i){for(var n=0;n<a.datasets.length;n++)for(var o=0;o<a.datasets[n].data.length;o++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.datasets[n].displayData,e.displayData,"displayData",n,o,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.displayData,e.displayData,"displayData",o,-1,{nullvalue:null})){t.save(),t.lineWidth=Math.ceil(t.chartLineScale*setOptionValue(!0,!0,1,"BARSTROKEWIDTH",t,a,m,a.datasets[n].barStrokeWidth,e.barStrokeWidth,"barStrokeWidth",n,o,{animationValue:s,xPosLeft:m[n][o].xPosLeft,yPosBottom:m[n][o].yPosBottom,xPosRight:m[n][o].xPosLeft+A,yPosTop:m[n][o].yPosBottom-r}));var s=animationCorrection(i,a,e,n,o,!1).animVal;s>1&&(s-=1);var r=s*m[n][o].barWidth+Math.ceil(t.chartLineScale*e.barStrokeWidth)/2;t.fillStyle=setOptionValue(!0,!0,1,"COLOR",t,a,m,a.datasets[n].fillColor,e.defaultFillColor,"fillColor",n,o,{animationValue:s,xPosLeft:m[n][o].xPosLeft,yPosBottom:m[n][o].yPosBottom,xPosRight:m[n][o].xPosLeft+r,yPosTop:m[n][o].yPosBottom}),t.strokeStyle=setOptionValue(!0,!0,1,"STROKECOLOR",t,a,m,a.datasets[n].strokeColor,e.defaultStrokeColor,"strokeColor",n,o,{nullvalue:null}),"undefined"!=typeof a.datasets[n].data[o]&&l(t,m[n][o].yPosTop,m[n][o].xPosLeft,A,r,e.barShowStroke,e.barBorderRadius,0,n,o,a.datasets[n].data[o]<0?-1:1),t.restore()}for(var n=0;n<a.datasets.length;n++)for(var o=0;o<a.datasets[n].data.length;o++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.datasets[n].displayData,e.displayData,"displayData",n,o,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.displayData,e.displayData,"displayData",o,-1,{nullvalue:null})&&(complementaryBar=setOptionValue(!0,!0,1,"COMPLEMENTARYBAR",t,a,m,a.datasets[n].complementaryBar,e.complementaryBar,"complementaryBar",n,o,{nullvalue:null}),0!=complementaryBar)){t.save(),t.lineWidth=Math.ceil(t.chartLineScale*setOptionValue(!0,!0,1,"BARSTROKEWIDTH",t,a,m,a.datasets[n].barStrokeWidth,e.barStrokeWidth,"barStrokeWidth",n,o,{animationValue:s,xPosLeft:m[n][o].xPosLeft,yPosBottom:m[n][o].yPosBottom,xPosRight:m[n][o].xPosLeft+A,yPosTop:m[n][o].yPosBottom-r}));var s=animationCorrection(i,a,e,n,o,!1).animVal;s>1&&(s-=1);var r=s*m[n][o].barWidth+Math.ceil(t.chartLineScale*e.barStrokeWidth)/2;1*a.datasets[n].data[o]<0?otherBarHeight=-(x.clrwidth-(m[n][o].xPosLeft-x.clrx-r))+Math.ceil(t.chartLineScale*e.scaleTickSizeLeft):otherBarHeight=x.clrwidth-(m[n][o].xPosLeft-x.clrx+r+t.lineWidth),t.fillStyle=setOptionValue(!0,!0,1,"COMPLEMENTARYCOLOR",t,a,m,a.datasets[n].complementaryColor,e.complementaryColor,"complementaryColor",n,o,{animationValue:s,xPosLeft:m[n][o].xPosLeft+r,yPosBottom:m[n][o].yPosBottom,xPosRight:m[n][o].xPosLeft+r+otherBarHeight,yPosTop:m[n][o].yPosBottom}),t.strokeStyle=setOptionValue(!0,!0,1,"COMPLEMENTARYSTROKECOLOR",t,a,m,a.datasets[n].complementaryStrokeColor,e.complementaryStrokeColor,"strokeColor",n,o,{nullvalue:null}),l(t,m[n][o].yPosTop,m[n][o].xPosLeft+r,A,otherBarHeight,e.barShowStroke,e.barBorderRadius,0,n,o,a.datasets[n].data[o]<0?-1:1),t.restore()}if(i>=e.animationStopValue)for(n=0;n<a.datasets.length;n++)for(o=0;o<a.datasets[n].data.length;o++)if(0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.datasets[n].displayData,e.displayData,"displayData",n,o,{nullvalue:null})&&0!=setOptionValue(!0,!0,1,"DISPLAYDATA",t,a,m,a.displayData,e.displayData,"displayData",o,-1,{nullvalue:null})&&"undefined"!=typeof a.datasets[n].data[o]&&(jsGraphAnnotate[t.ChartNewId][jsGraphAnnotate[t.ChartNewId].length]=["RECT",n,o,m,setOptionValue(!0,!0,1,"ANNOTATEDISPLAY",t,a,m,a.datasets[n].annotateDisplay,e.annotateDisplay,"annotateDisplay",n,o,{nullValue:!0})],setOptionValue(!0,!0,1,"INGRAPHDATASHOW",t,a,m,a.datasets[n].inGraphDataShow,e.inGraphDataShow,"inGraphDataShow",n,o,{nullValue:!0}))){t.save(),t.textAlign=setOptionValue(!0,!0,1,"INGRAPHDATAALIGN",t,a,m,void 0,e.inGraphDataAlign,"inGraphDataAlign",n,o,{nullValue:!0}),t.textBaseline=setOptionValue(!0,!0,1,"INGRAPHDATAVALIGN",t,a,m,void 0,e.inGraphDataVAlign,"inGraphDataVAlign",n,o,{nullValue:!0}),t.font=setOptionValue(!0,!0,1,"INGRAPHDATAFONTSTYLE",t,a,m,void 0,e.inGraphDataFontStyle,"inGraphDataFontStyle",n,o,{nullValue:!0})+" "+setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,m,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",n,o,{nullValue:!0})+"px "+setOptionValue(!0,!0,1,"INGRAPHDATAFONTFAMILY",t,a,m,void 0,e.inGraphDataFontFamily,"inGraphDataFontFamily",n,o,{nullValue:!0}),t.fillStyle=setOptionValue(!0,!0,1,"INGRAPHDATAFONTCOLOR",t,a,m,void 0,e.inGraphDataFontColor,"inGraphDataFontColor",n,o,{nullValue:!0}),t.beginPath();var c=0,h=0;1==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,m,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",n,o,{nullValue:!0})?c=m[n][o].yPosTop-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,m,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",n,o,{nullValue:!0})+A:2==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,m,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",n,o,{nullValue:!0})?c=m[n][o].yPosTop+A/2-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,m,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",n,o,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAYPOSITION",t,a,m,void 0,e.inGraphDataYPosition,"inGraphDataYPosition",n,o,{nullValue:!0})&&(c=m[n][o].yPosTop-setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGY",t,a,m,void 0,e.inGraphDataPaddingY,"inGraphDataPaddingY",n,o,{nullValue:!0})),1==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,m,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",n,o,{nullValue:!0})?h=m[n][o].xPosLeft+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,m,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",n,o,{nullValue:!0}):2==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,m,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",n,o,{nullValue:!0})?h=(m[n][o].xPosLeft+m[n][o].xPosRight)/2+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,m,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",n,o,{nullValue:!0}):3==setOptionValue(!0,!0,1,"INGRAPHDATAXPOSITION",t,a,m,void 0,e.inGraphDataXPosition,"inGraphDataXPosition",n,o,{nullValue:!0})&&(h=m[n][o].xPosRight+setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATAPADDINGX",t,a,m,void 0,e.inGraphDataPaddingX,"inGraphDataPaddingX",n,o,{nullValue:!0})),t.translate(h,c);var d=tmplbis(setOptionValue(!0,!0,1,"INGRAPHDATATMPL",t,a,m,void 0,e.inGraphDataTmpl,"inGraphDataTmpl",n,o,{nullValue:!0}),m[n][o],e),u=setOptionValue(!0,!0,1,"INGRAPHDATAROTATE",t,a,m,void 0,e.inGraphDataRotate,"inGraphDataRotate",n,o,{nullValue:!0})*(Math.PI/180);t.rotate(u),setTextBordersAndBackground(t,d,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,m,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",n,o,{nullValue:!0}),0,0,setOptionValue(!0,!0,1,"INGRAPHDATABORDERS",t,a,m,void 0,e.inGraphDataBorders,"inGraphDataBorders",n,o,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSCOLOR",t,a,m,void 0,e.inGraphDataBordersColor,"inGraphDataBordersColor",n,o,{nullValue:!0}),setOptionValue(!0,!0,t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,a,m,void 0,e.inGraphDataBordersWidth,"inGraphDataBordersWidth",n,o,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,a,m,void 0,e.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",n,o,{nullValue:!0}),setOptionValue(!0,!0,t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,a,m,void 0,e.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",n,o,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABORDERSSTYLE",t,a,m,void 0,e.inGraphDataBordersStyle,"inGraphDataBordersStyle",n,o,{nullValue:!0}),setOptionValue(!0,!0,1,"INGRAPHDATABACKGROUNDCOLOR",t,a,m,void 0,e.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",n,o,{nullValue:!0}),"INGRAPHDATA",e.inGraphDataBordersRadius),t.fillTextMultiLine(d,0,0,t.textBaseline,setOptionValue(!0,!0,t.chartTextScale,"INGRAPHDATAFONTSIZE",t,a,m,void 0,e.inGraphDataFontSize,"inGraphDataFontSize",n,o,{nullValue:!0}),!0,e.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",u,h,c,n,o),t.restore()}x.legendMsr.dispLegend&&drawLegend(x.legendMsr,a,e,t,"HorizontalBar")}function l(t,i,l,n,o,s,r,c,h,d,u){t.beginPath(),t.moveTo(l+c,i),t.lineTo(l+c,i+n),t.lineTo(l+o-u*r,i+n),t.quadraticCurveTo(l+o,i+n,l+o,i+n-r),t.lineTo(l+o,i+r),t.quadraticCurveTo(l+o,i,l+o-u*r,i),t.lineTo(l+c,i),t.quadraticCurveTo(l+c,i,l+c,i+n),s&&(t.setLineDash(lineStyleFn(setOptionValue(!0,!0,1,"STROKESTYLE",t,a,m,a.datasets[h].datasetStrokeStyle,e.datasetStrokeStyle,"datasetStrokeStyle",h,d,{nullvalue:null}))),t.stroke(),t.setLineDash([])),t.closePath(),t.fill()}function n(){t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.strokeStyle=e.scaleLineColor,t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.beginPath(),t.moveTo(g-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),f),t.lineTo(g+x.availableWidth+Math.ceil(t.chartLineScale*e.scaleTickSizeRight),f),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(e.scaleGridLineStyle));for(var i=e.showYAxisMin?-1:0;i<c.steps;i++)i>=0&&(t.beginPath(),t.moveTo(g+i*S,f+Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleGridLineWidth),t.strokeStyle=e.scaleGridLineColor,e.scaleShowGridLines&&i>0&&i%e.scaleXGridLinesStep==0?t.lineTo(g+i*S,f-x.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeTop)):t.lineTo(g+i*S,f),t.stroke());t.setLineDash([]),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleLineWidth),t.strokeStyle=e.scaleLineColor,t.setLineDash(lineStyleFn(e.scaleLineStyle)),t.beginPath(),t.moveTo(g,f+Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)),t.lineTo(g,f-x.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeTop)),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(e.scaleGridLineStyle));for(var l=0;l<a.labels.length;l++)t.beginPath(),t.moveTo(g-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),f-(l+1)*r),t.lineWidth=Math.ceil(t.chartLineScale*e.scaleGridLineWidth),t.strokeStyle=e.scaleGridLineColor,e.scaleShowGridLines&&(l+1)%e.scaleYGridLinesStep==0?t.lineTo(g+x.availableWidth+Math.ceil(t.chartLineScale*e.scaleTickSizeRight),f-(l+1)*r):t.lineTo(g,f-(l+1)*r),t.stroke();t.setLineDash([])}function o(){if(t.font=e.scaleFontStyle+" "+Math.ceil(t.chartTextScale*e.scaleFontSize).toString()+"px "+e.scaleFontFamily,e.scaleShowLabels&&(e.xAxisTop||e.xAxisBottom)&&(t.textBaseline="top",x.rotateLabels>90?(t.save(),t.textAlign="left"):x.rotateLabels>0?(t.save(),t.textAlign="right"):t.textAlign="center",t.fillStyle=e.scaleFontColor,e.xAxisBottom))for(var i=e.showYAxisMin?-1:0;i<c.steps;i++)showYLabels(t,a,e,i+1,c.labels[i+1])&&(t.save(),x.rotateLabels>0?(t.translate(g+(i+1)*S-x.highestXLabel/2,x.xLabelPos),t.rotate(-(x.rotateLabels*(Math.PI/180))),t.fillTextMultiLine(c.labels[i+1],0,0,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"XAXIS_TEXTMOUSE",-(x.rotateLabels*(Math.PI/180)),g+(i+1)*S-x.highestXLabel/2,x.xLabelPos,i,-1)):t.fillTextMultiLine(c.labels[i+1],g+(i+1)*S,x.xLabelPos,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"XAXIS_TEXTMOUSE",0,0,0,i,-1),t.restore());t.textAlign="right",t.textBaseline="middle";for(var l=0;l<a.labels.length;l++)showLabels(t,a,e,l)&&(e.yAxisLeft&&(t.textAlign="right",t.fillTextMultiLine(fmtChartJS(e,a.labels[l],e.fmtXLabel),g-(Math.ceil(t.chartLineScale*e.scaleTickSizeLeft)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),f-l*r-r/2,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"YLEFTAXIS_TEXTMOUSE",0,0,0,-1,l)),e.yAxisRight&&(t.textAlign="left",t.fillTextMultiLine(fmtChartJS(e,a.labels[l],e.fmtXLabel),g+x.availableWidth+(Math.ceil(t.chartLineScale*e.scaleTickSizeRight)+Math.ceil(t.chartSpaceScale*e.yAxisSpaceRight)),f-l*r-r/2,t.textBaseline,Math.ceil(t.chartTextScale*e.scaleFontSize),!0,e.detectMouseOnText,t,"YRIGHTAXIS_TEXTMOUSE",0,0,0,-1,l)))}function s(){for(var i=-Number.MAX_VALUE,l=Number.MAX_VALUE,n=0;n<a.datasets.length;n++)for(var o=0;o<a.datasets[n].data.length;o++)"undefined"!=typeof a.datasets[n].data[o]&&(1*a.datasets[n].data[o]>i&&(i=1*a.datasets[n].data[o]),1*a.datasets[n].data[o]<l&&(l=1*a.datasets[n].data[o]));l>i&&(i=0,l=0),Math.abs(i-l)<e.zeroValue&&(Math.abs(i)<e.zeroValue&&(i=.9),i>0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),"function"==typeof e.graphMin?l=setOptionValue(!0,!0,1,"GRAPHMIN",t,a,m,void 0,e.graphMin,"graphMin",-1,-1,{nullValue:!0}):isNaN(e.graphMin)||(l=e.graphMin),"function"==typeof e.graphMax?i=setOptionValue(!0,!0,1,"GRAPHMAX",t,a,m,void 0,e.graphMax,"graphMax",-1,-1,{nullValue:!0}):isNaN(e.graphMax)||(i=e.graphMax),h=Math.ceil(t.chartTextScale*e.scaleFontSize),d=x.availableHeight;var s=Math.floor(d/(.66*h)),r=Math.floor(d/h*.5);return l>i&&(l=i-1),{maxValue:i,minValue:l,maxSteps:s,minSteps:r}}var r,c,h,d,u,p,S,g,f,A,x;if(t.tpchart="HorizontalBar",t.tpdata=0,init_and_start(t,a,e)){e.reverseOrder&&"undefined"==typeof t.reversed&&(t.reversed=!0,a=reverseData(a));var m=initPassVariableData_part1(a,e,t);if(x=setMeasures(a,e,t,t.canvas.height,t.canvas.width,"nihil",[""],!0,!0,!0,!0,!0,"StackedBar"),u=s(),u.minValue<=0&&(e.logarithmic=!1),u.maxSteps>0&&u.minSteps>0){if(e.logarithmic!==!1&&u.minValue<=0&&(e.logarithmic=!1),p=e.scaleShowLabels?e.scaleLabel:"",e.scaleOverride){var D=setOptionValue(!0,!0,1,"SCALESTARTVALUE",t,a,m,void 0,e.scaleStartValue,"scaleStartValue",-1,-1,{nullValue:!0}),P=setOptionValue(!0,!0,1,"SCALESTEPS",t,a,m,void 0,e.scaleSteps,"scaleSteps",-1,-1,{nullValue:!0}),M=setOptionValue(!0,!0,1,"SCALESTEPWIDTH",t,a,m,void 0,e.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue:!0});c={steps:P,stepValue:M,graphMin:D,graphMax:D+P*M,labels:[]},populateLabels(1,e,p,c.labels,c.steps,D,c.graphMax,M),
x=setMeasures(a,e,t,t.canvas.height,t.canvas.width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalBar")}else c=calculateScale(1,e,u.maxSteps,u.minSteps,u.maxValue,u.minValue,p),x=setMeasures(a,e,t,t.canvas.height,t.canvas.width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalBar");x.availableHeight=x.availableHeight-Math.ceil(t.chartLineScale*e.scaleTickSizeBottom)-Math.ceil(t.chartLineScale*e.scaleTickSizeTop),x.availableWidth=x.availableWidth-Math.ceil(t.chartLineScale*e.scaleTickSizeLeft)-Math.ceil(t.chartLineScale*e.scaleTickSizeRight),r=Math.floor(x.availableHeight/a.labels.length),S=Math.floor(x.availableWidth/c.steps),(0==S||e.fullWidthGraph)&&(S=x.availableWidth/c.steps),x.clrwidth=x.clrwidth-(x.availableWidth-c.steps*S),x.availableWidth=c.steps*S,x.availableHeight=a.labels.length*r,g=x.leftNotUsableSize+Math.ceil(t.chartLineScale*e.scaleTickSizeLeft),f=x.topNotUsableSize+x.availableHeight+Math.ceil(t.chartLineScale*e.scaleTickSizeTop),A=(r-2*Math.ceil(t.chartLineScale*e.scaleGridLineWidth)-2*Math.ceil(t.chartSpaceScale*e.barValueSpacing)-(Math.ceil(t.chartSpaceScale*e.barDatasetSpacing)*a.datasets.length-1)-(Math.ceil(t.chartLineScale*e.barStrokeWidth)/2*a.datasets.length-1))/a.datasets.length,A>=0&&1>=A&&(A=1),0>A&&A>=-1&&(A=-1);var T;1*e.maxBarWidth>0&&A>1*e.maxBarWidth?(T=a.datasets.length*(A-1*e.maxBarWidth)/2,A=1*e.maxBarWidth):T=0;var v=0;v=calculateOffset(e.logarithmic,0,c,S),o(),initPassVariableData_part2(m,a,e,t,{yAxisPosX:g,xAxisPosY:f,barWidth:A,additionalSpaceBetweenBars:T,zeroY:v,scaleHop:r,valueHop:S,calculatedScale:c}),animationLoop(e,n,i,t,x.clrx,x.clry,x.clrwidth,x.clrheight,g+x.availableWidth/2,f-x.availableHeight/2,g,f,a,m)}else testRedraw(t,a,e),t.firstPass=9;return{data:a,config:e,ctx:t}}},requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),requestAnimFrameSetTimeOut=function(){return function(a){window.setTimeout(a,1e3/60)}}(),cache={}};