From e21c46928b38ccdb42c77a451691c1826d8e72a2 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 22 Jul 2016 14:41:00 +0200 Subject: [PATCH] update from git master --- dist/XStatic-Chart.js-1.0.2.2.tar.gz | Bin 38295 -> 0 bytes xstatic/pkg/chartnew_js/__init__.py | 2 +- xstatic/pkg/chartnew_js/data/ChartNew.js | 3307 +++++++++++------- xstatic/pkg/chartnew_js/data/ChartNew.min.js | 18 +- 4 files changed, 2033 insertions(+), 1294 deletions(-) delete mode 100644 dist/XStatic-Chart.js-1.0.2.2.tar.gz diff --git a/dist/XStatic-Chart.js-1.0.2.2.tar.gz b/dist/XStatic-Chart.js-1.0.2.2.tar.gz deleted file mode 100644 index 4b10a3d0bb8c798da9335b6c2d3a49009156e892..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38295 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 i$)M> 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 diff --git a/xstatic/pkg/chartnew_js/__init__.py b/xstatic/pkg/chartnew_js/__init__.py index b0a95d9..69cbd2e 100644 --- a/xstatic/pkg/chartnew_js/__init__.py +++ b/xstatic/pkg/chartnew_js/__init__.py @@ -11,7 +11,7 @@ NAME = __name__.split('.')[-1] # package name (e.g. 'foo' or 'foo_bar') # please use a all-lowercase valid python # package name -VERSION = '0.3.0' # version of the packaged files, please use the upstream +VERSION = '0.3.0.20160722' # version of the packaged files, please use the upstream # version number BUILD = '0' # our package build number, so we can release new builds # with fixes for xstatic stuff. diff --git a/xstatic/pkg/chartnew_js/data/ChartNew.js b/xstatic/pkg/chartnew_js/data/ChartNew.js index 6a49819..9a735dc 100644 --- a/xstatic/pkg/chartnew_js/data/ChartNew.js +++ b/xstatic/pkg/chartnew_js/data/ChartNew.js @@ -1,9 +1,9 @@ /* * ChartNew.js - * - * Vancoppenolle Francois - January 2014 - * francois.vancoppenolle@favomo.be - * + * + * Vancoppenolle Francois - January 2014 + * francois.vancoppenolle@favomo.be + * * GitHub community : https://github.com/FVANCOP/ChartNew.js * * This file is originally an adaptation of the chart.js source developped by Nick Downie (2013) @@ -28,10 +28,17 @@ * and lot of others... * */ + +// ctx.firstPass=0 or "undefined" : Chart has never been drawn (because dynamicDisplay = true and ctx has never been displayed in current screen) +// ctx.firstPass=1 : Chart has to be drawn with animation (if config.animation = true); +// ctx.firstPass=2 : chart has to be drawn without animation; +// ctx.firstPass=9 : chart is completely drawn; +// If chartJsResize called : increment the value of ctx.firstPass with a value of 10. + + // non standard functions; var chartJSLineStyle=[]; - chartJSLineStyle["solid"]=[]; chartJSLineStyle["dotted"]=[1,4]; chartJSLineStyle["shortDash"]=[2,1]; @@ -156,7 +163,7 @@ function fmtChartJS(config, value, fmt) { var return_value; if (fmt == "notformatted") { return_value = value; - } else if (fmt == "none" && typeof(value) == "number") { + } else if ((fmt == "none" || fmt=="money") && typeof(value) == "number") { if (config.roundNumber != "none") { var roundVal; if (config.roundNumber <= 0) { @@ -185,6 +192,10 @@ function fmtChartJS(config, value, fmt) { if (part2 != "") return_value = return_value + config.decimalSeparator + part2; } } else return_value = value; + if(fmt=="money") { + if(config.currencyPosition=="before")return_value=config.currency+return_value; + else return_value=return_value+config.currency; + } } else if (fmt != "none" && fmt != "notformatted") { return_value = fmtChartJSPerso(config, value, fmt); } else { @@ -379,8 +390,47 @@ if (typeof CanvasRenderingContext2D !== 'undefined') { CanvasRenderingContext2D.prototype.setLineDash = function( listdash) { return 0; }; - }; + }; + + CanvasRenderingContext2D.prototype.drawRectangle = function(TheRectangle){ + //this.shadowColor = '#999'; + // this.shadowBlur = 5; + // this.shadowOffsetX = 15; + //this.shadowOffsetY = 15; + originalfillStyle =this.fillStyle; + if(typeof TheRectangle.x=='undefined'){TheRectangle.x=0} + if(TheRectangle.width<0){TheRectangle.x+=TheRectangle.width;TheRectangle.width*=-1} + if(TheRectangle.height<0){TheRectangle.y+=TheRectangle.height;TheRectangle.height*=-1} + if(typeof TheRectangle.y=='undefined'){TheRectangle.y=0} + if(typeof TheRectangle.y=='undefined'){TheRectangle.y=0} + if(typeof TheRectangle.backgroundColor!='undefined'){this.fillStyle=TheRectangle.backgroundColor} + if(typeof TheRectangle.borderRadius=='undefined'){TheRectangle.borderRadius=0} + + if(TheRectangle.borderRadius==0 && TheRectangle.fill==true){this.fillRect(TheRectangle.x,TheRectangle.y,TheRectangle.width,TheRectangle.height);} + if(TheRectangle.borderRadius==0 && TheRectangle.stroke==true){this.strokeRect(TheRectangle.x,TheRectangle.y,TheRectangle.width,TheRectangle.height);} + if(TheRectangle.borderRadius!=0){ + rectangleRadius=parseInt(TheRectangle.borderRadius); + if(rectangleRadius>TheRectangle.width/2 ){rectangleRadius=TheRectangle.width/2} + if(TheRectangle.heightTheRectangle.height/2 ){rectangleRadius=TheRectangle.height/2} + this.beginPath(); + this.moveTo(TheRectangle.x+rectangleRadius,TheRectangle.y); + this.lineTo(TheRectangle.x+TheRectangle.width-rectangleRadius,TheRectangle.y); + this.arc(TheRectangle.x+TheRectangle.width-rectangleRadius,TheRectangle.y+rectangleRadius,rectangleRadius,1.5*Math.PI,0); + this.lineTo(TheRectangle.x+TheRectangle.width,TheRectangle.y+TheRectangle.height-rectangleRadius); + this.arc(TheRectangle.x+TheRectangle.width-rectangleRadius,TheRectangle.y+TheRectangle.height-rectangleRadius,rectangleRadius,0,0.5*Math.PI); + this.lineTo(TheRectangle.x+rectangleRadius,TheRectangle.y+TheRectangle.height); + this.arc(TheRectangle.x+rectangleRadius,TheRectangle.y+TheRectangle.height-rectangleRadius,rectangleRadius,0.5*Math.PI,1*Math.PI); + this.lineTo(TheRectangle.x,TheRectangle.y+rectangleRadius); + this.arc(TheRectangle.x+rectangleRadius,TheRectangle.y+rectangleRadius,rectangleRadius,1*Math.PI,1.5*Math.PI); + this.closePath(); + if(TheRectangle.fill==true) {this.fill()}; + if(TheRectangle.stroke==true) {this.stroke()}; + } + this.fillStyle= originalfillStyle; + return this; + }; }; + cursorDivCreated = false; function createCursorDiv() { @@ -397,21 +447,6 @@ initChartJsResize = false; var jsGraphResize = new Array(); function addResponsiveChart(id,ctx,data,config) { - initChartResize(); - var newSize=resizeGraph(ctx,config); - if(typeof ctx.prevWidth != "undefined") { - resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); - ctx.prevWidth=newSize.newWidth; - } else if (config.responsiveScaleContent && config.responsiveWindowInitialWidth) { - ctx.initialWidth =newSize.newWidth; - } - - ctx.prevWidth=newSize.newWidth; - ctx.prevHeight=newSize.newHeight; - jsGraphResize[jsGraphResize.length]= [id,ctx.tpchart,ctx,data,config]; -}; - -function initChartResize() { if(initChartJsResize==false) { if (window.addEventListener) { window.addEventListener("resize", chartJsResize); @@ -419,8 +454,10 @@ function initChartResize() { window.attachEvent("resize", chartJsResize); } } + jsGraphResize[jsGraphResize.length]= [id,ctx.tpchart,ctx,data,config]; }; + var container; function getMaximumWidth(domNode){ if(domNode.parentNode!=null) @@ -436,74 +473,92 @@ function getMaximumHeight(domNode){ return container.clientHeight; }; -function resizeCtx(ctx,newWidth,newHeight,config) +function resizeCtx(ctx,config) { - if(typeof ctx.DefaultchartTextScale=="undefined")ctx.DefaultchartTextScale=config.chartTextScale; - if(typeof ctx.DefaultchartLineScale=="undefined")ctx.DefaultchartLineScale=config.chartLineScale; - if(typeof ctx.DefaultchartSpaceScale=="undefined")ctx.DefaultchartSpaceScale=config.chartSpaceScale; + if (isIE() < 9 && isIE() != false) return(true); - ctx.canvas.height = newHeight ; - ctx.canvas.width = newWidth; - /* new ratio */ - if(typeof ctx.chartTextScale != "undefined" && config.responsiveScaleContent) { - ctx.chartTextScale=ctx.DefaultchartTextScale*(newWidth/ctx.initialWidth); - ctx.chartLineScale=ctx.DefaultchartLineScale*(newWidth/ctx.initialWidth); - ctx.chartSpaceScale=ctx.DefaultchartSpaceScale*(newWidth/ctx.initialWidth); + if(config.responsive) { + + if(typeof config.maintainAspectRatio == "undefined")config.maintainAspectRatio=true; + if(typeof config.responsiveMinWidth == "undefined")config.responsiveMinWidth=0; + if(typeof config.responsiveMinHeight == "undefined")config.responsiveMinHeight=0; + if(typeof config.responsiveMaxWidth == "undefined")config.responsiveMaxWidth=9999999; + if(typeof config.responsiveMaxHeight == "undefined")config.responsiveMaxHeight=9999999; + var canvas = ctx.canvas; + if(typeof ctx.aspectRatio == "undefined") { + ctx.aspectRatio = canvas.width / canvas.height; + } + var newWidth = getMaximumWidth(canvas); + var newHeight = config.maintainAspectRatio ? newWidth / ctx.aspectRatio : getMaximumHeight(canvas); + newWidth=Math.min(config.responsiveMaxWidth,Math.max(config.responsiveMinWidth,newWidth)); + newHeight=Math.min(config.responsiveMaxHeight,Math.max(config.responsiveMinHeight,newHeight)); + + if(typeof ctx.DefaultchartTextScale=="undefined")ctx.DefaultchartTextScale=config.chartTextScale; + if(typeof ctx.DefaultchartLineScale=="undefined")ctx.DefaultchartLineScale=config.chartLineScale; + if(typeof ctx.DefaultchartSpaceScale=="undefined")ctx.DefaultchartSpaceScale=config.chartSpaceScale; + /* new ratio */ + if(typeof ctx.chartTextScale != "undefined" && config.responsiveScaleContent) { + ctx.chartTextScale=ctx.DefaultchartTextScale*(newWidth/ctx.initialWidth); + ctx.chartLineScale=ctx.DefaultchartLineScale*(newWidth/ctx.initialWidth); + ctx.chartSpaceScale=ctx.DefaultchartSpaceScale*(newWidth/ctx.initialWidth); + } + + if (window.devicePixelRatio>1) { + ctx.canvas.style.width = newWidth + "px"; + ctx.canvas.style.height = newHeight + "px"; + } + ctx.canvas.height = newHeight * Math.max(1,window.devicePixelRatio); + ctx.canvas.width = newWidth * Math.max(1,window.devicePixelRatio); +// ctx.scale(window.devicePixelRatio, window.devicePixelRatio); + ctx.scale(Math.max(1,window.devicePixelRatio), Math.max(1,window.devicePixelRatio)); + } else if (window.devicePixelRatio>1) { + if(typeof ctx.original_width=="undefined") { + ctx.original_width=ctx.canvas.width; + ctx.original_height=ctx.canvas.height; + } + ctx.canvas.style.width = ctx.original_width + "px"; + ctx.canvas.style.height = ctx.original_height + "px"; + ctx.canvas.height = ctx.original_height * window.devicePixelRatio; + ctx.canvas.width = ctx.original_width * window.devicePixelRatio; + ctx.scale(window.devicePixelRatio, window.devicePixelRatio); } }; -function resizeGraph(ctx,config) { - if(typeof config.maintainAspectRatio == "undefined")config.maintainAspectRatio=true; - if(typeof config.responsiveMinWidth == "undefined")config.responsiveMinWidth=0; - if(typeof config.responsiveMinHeight == "undefined")config.responsiveMinHeight=0; - if(typeof config.responsiveMaxWidth == "undefined")config.responsiveMaxWidth=9999999; - if(typeof config.responsiveMaxHeight == "undefined")config.responsiveMaxHeight=9999999; - var canvas = ctx.canvas; - if(typeof ctx.aspectRatio == "undefined") { - ctx.aspectRatio = canvas.width / canvas.height; - } - - var newWidth = getMaximumWidth(canvas); - var newHeight = config.maintainAspectRatio ? newWidth / ctx.aspectRatio : getMaximumHeight(canvas); - newWidth=Math.min(config.responsiveMaxWidth,Math.max(config.responsiveMinWidth,newWidth)); - newHeight=Math.min(config.responsiveMaxHeight,Math.max(config.responsiveMinHeight,newHeight)); - return { newWidth : parseInt(newWidth), newHeight : parseInt(newHeight)}; -}; function chartJsResize() { for (var i=0;i10) { + ctx.firstPass=2; + redrawGraph(ctx,data,config) ; return true; } else { - ctx.firstPass=5; return false; } }; function updateChart(ctx,data,config,animation,runanimationcompletefunction) { - if (ctx.firstPass==5) + + if (ctx.firstPass==9) { - if (window.devicePixelRatio) { - ctx.canvas.width=ctx.canvas.width/window.devicePixelRatio; - ctx.canvas.height=ctx.canvas.height/window.devicePixelRatio; - - } + ctx.runanimationcompletefunction=runanimationcompletefunction; - if(animation)ctx.firstPass=0; - else if (config.responsive) ctx.firstPass=7; - else ctx.firstPass=7; + + if(animation)ctx.firstPass=1; + else ctx.firstPass=2; + if(config.responsive) { // update jsGraphResize; for (var i=0;i chart never drawn - // ctx.firstPass==0 => chart is drawn but need to be redrawn with animation - // ctx.firstPass==1 => chart is drawn with animation - // ctx.firstPass==2 => chart is in animation but at the end the graph need perhaps to be redrawn; - // ctx.firstPass==3 => chart currently drawing without animation; - // ctx.firstPass==4 => chart currently drawing without animationb but at the end, the graph need perhaps to be redrawn; - // ctx.firstPass==5 => chart is displayed ; - // ctx.firstPass==6 => chart is displayed but need to be redraw without animation (because of a resize); - // ctx.firstPass==7 => chart is displayed but need to be redraw without responsivity; - if(!dynamicFunction(data, config, ctx)) { return; } - var newSize; - if(typeof ctx.firstPass == "undefined") { - ctx.firstPass=1; - newSize=resizeGraph(ctx,config); - if(config.responsive) { - resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); - ctx.prevWidth=newSize.newWidth; - ctx.prevHeight=newSize.newHeight; - } else { - ctx.prevWidth=0; - ctx.prevHeight=0; - } - ctx.runanimationcompletefunction=true; - redrawGraph(ctx,data,config); - } else if(ctx.firstPass == 0) { - ctx.firstPass=1; - newSize=resizeGraph(ctx,config); - if(config.responsive) { - resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); - ctx.prevWidth=newSize.newWidth; - ctx.prevHeight=newSize.newHeight; - } else { - ctx.prevWidth=0; - ctx.prevHeight=0; - } - redrawGraph(ctx,data,config); - } else if(ctx.firstPass==1 || ctx.firstPass==2) { - ctx.firstPass=2; - } else if (ctx.firstPass==3 || ctx.firstPass==4) { - ctx.firstPass=4; - } else if(ctx.firstPass==5) { - ctx.firstPass=1; - redrawGraph(ctx,data,config); - } else if(ctx.firstPass==6) { - newSize=resizeGraph(ctx,config); - if (newSize.newWidth!=ctx.prevWidth || newSize.newHeight != ctx.prevHeight) { - ctx.firstPass=3; - ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); - if(config.responsive) { - resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); - ctx.prevWidth=newSize.newWidth; - ctx.prevHeight=newSize.newHeight; - } else { - ctx.prevWidth=0; - ctx.prevHeight=0; - } - redrawGraph(ctx,data,config); - } else ctx.firstPass=5; - } else if(ctx.firstPass==7) { - newSize=resizeGraph(ctx,config); - ctx.firstPass=3; - ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); - if(config.responsive) { - resizeCtx(ctx,newSize.newWidth,newSize.newHeight,config); - ctx.prevWidth=newSize.newWidth; - ctx.prevHeight=newSize.newHeight; - } else { - ctx.prevWidth=0; - ctx.prevHeight=0; - } - redrawGraph(ctx,data,config); - } -}; function redrawGraph(ctx,data,config) { - var myGraph = new Chart(ctx); - switch (ctx.tpchart) { - case "Bar": - myGraph.Bar(data,config); - break; - case "Pie": - myGraph.Pie(data,config); - break; - case "Doughnut": - myGraph.Doughnut(data,config); - break; - case "Radar": - myGraph.Radar(data,config); - break; - case "PolarArea": - myGraph.PolarArea(data,config); - break; - case "HorizontalBar": - myGraph.HorizontalBar(data,config); - break; - case "StackedBar": - myGraph.StackedBar(data,config); - break; - case "HorizontalStackedBar": - myGraph.HorizontalStackedBar(data,config); - break; - case "Line": - myGraph.Line(data,config); - break; - } + eval("myGraph."+ctx.tpchart+"(data,config);"); }; @@ -694,17 +644,17 @@ function sleep(ms) { function saveCanvas(ctx, data, config) { cvSave = ctx.getImageData(0, 0, ctx.canvas.width, ctx.canvas.height); - var saveCanvasConfig = { + var saveCanvasConfig1 = { savePng: false, annotateDisplay: false, animation: false, dynamicDisplay: false }; - var savePngConfig = mergeChartConfig(config, saveCanvasConfig); - savePngConfig.clearRect = false; + savePngConfig1 = mergeChartConfig(config, saveCanvasConfig1); + savePngConfig1.clearRect = false; /* And ink them */ - redrawGraph(ctx,data,savePngConfig); + redrawGraph(ctx,data,savePngConfig1); var image; if (config.savePngOutput == "NewWindow") { image = ctx.canvas.toDataURL(); @@ -735,11 +685,9 @@ var dynamicDisplay = new Array(); var dynamicDisplayList = new Array(); function dynamicFunction(data, config, ctx) { - if (isIE() < 9 && isIE() != false) return(true); - - if (config.dynamicDisplay) { + if (config.dynamicDisplay && ctx.firstPass==0) { if (ctx.canvas.id == "") { var cvdate = new Date(); var cvmillsec = cvdate.getTime(); @@ -747,48 +695,66 @@ function dynamicFunction(data, config, ctx) { } if (typeof(dynamicDisplay[ctx.canvas.id]) == "undefined") { dynamicDisplayList[dynamicDisplayList["length"]] = ctx.canvas.id; - dynamicDisplay[ctx.canvas.id] = [ctx, false, false, data, config, ctx.canvas]; - dynamicDisplay[ctx.canvas.id][1] = isScrolledIntoView(ctx.canvas); + dynamicDisplay[ctx.canvas.id] = [ctx, data, config]; window.onscroll = scrollFunction; - } else if (dynamicDisplay[ctx.canvas.id][2] == false) { - dynamicDisplay[ctx.canvas.id][1] = isScrolledIntoView(ctx.canvas); - } - if (dynamicDisplay[ctx.canvas.id][1] == false && dynamicDisplay[ctx.canvas.id][2] == false) { - return false; - } - dynamicDisplay[ctx.canvas.id][2] = true; + } + if (!isScrolledIntoView(ctx.canvas,config)) return false; } return true; }; -function isScrolledIntoView(element) { +function isScrolledIntoView(element,config) { var xPosition = 0; var yPosition = 0; + var eltWidth, eltHeight; + if(typeof element.recomputedHeight=="undefined") { + if (window.devicePixelRatio) { + // 31/12/2015 - On retina display, the size of the canvas changes after the canvas is displayed. + // before it is displayd, the size on the screen is the size on non retina display; + // If we do not divide the height & width by the devicePixelRatio, and if the + // value of config.dynamicDisplayYPartOfChart and if there is a chart on to bottom of the + // web page, this chart will never be displayed.... + // If the Size of the canvas was directly the real size displayed on the web page, we should not + // divide the height/width by the devicePixelRatio.... (Bug in Brosers ?) + element.recomputedHeight=element.height/window.devicePixelRatio; + element.recomputedWidth=element.width/window.devicePixelRatio; + } else { + element.recomputedHeight=element.height; + element.recomputedWidth=element.width; + } + } + eltWidth=element.recomputedWidth; + eltHeight=element.recomputedHeight; elem = element; while (elem) { - xPosition += (elem.offsetLeft - elem.scrollLeft + elem.clientLeft); - yPosition += (elem.offsetTop - elem.scrollTop + elem.clientTop); + xPosition += (elem.offsetLeft + elem.clientLeft); + yPosition += (elem.offsetTop + elem.clientTop); elem = elem.offsetParent; } - if (xPosition + element.width / 2 >= window.pageXOffset && - xPosition + element.width / 2 <= window.pageXOffset + window.innerWidth && - yPosition + element.height / 2 >= window.pageYOffset && - yPosition + element.height / 2 <= window.pageYOffset + window.innerHeight - ) return (true); - else return false; + + if (xPosition + (eltWidth * config.dynamicDisplayXPartOfChart) >= window.pageXOffset && + xPosition + (eltWidth * config.dynamicDisplayXPartOfChart) <= window.pageXOffset + window.innerWidth && + yPosition + (eltHeight * config.dynamicDisplayYPartOfChart) >= window.pageYOffset && + yPosition + (eltHeight * config.dynamicDisplayYPartOfChart) <= window.pageYOffset + window.innerHeight + ) { + return (true); + } + else { + return false; + } }; function scrollFunction() { for (var i = 0; i < dynamicDisplayList["length"]; i++) { - if (isScrolledIntoView(dynamicDisplay[dynamicDisplayList[i]][5]) && dynamicDisplay[dynamicDisplayList[i]][2] == false) { - dynamicDisplay[dynamicDisplayList[i]][1] = true; - redrawGraph(dynamicDisplay[dynamicDisplayList[i]][0],dynamicDisplay[dynamicDisplayList[i]][3], dynamicDisplay[dynamicDisplayList[i]][4]); + if ((dynamicDisplay[dynamicDisplayList[i]][0]).firstPass==0) { + redrawGraph(dynamicDisplay[dynamicDisplayList[i]][0],dynamicDisplay[dynamicDisplayList[i]][1], dynamicDisplay[dynamicDisplayList[i]][2]); } } }; var jsGraphAnnotate = new Array(); var jsTextMousePos = new Array(); +var mouseActionData=new Array(); function clearAnnotate(ctxid) { jsGraphAnnotate[ctxid] = []; @@ -803,38 +769,136 @@ function getMousePos(canvas, evt) { }; }; -var annotatePrevShow=-1; +function isHighLighted(reference,ctx,data,statData,posi,posj,othervars){ + var i; + if(typeof data.special=="object") { + for(i=data.special.length-1;i>=0;i--){ + if(data.special[i].typespecial=="highLight" && data.special[i].posi==posi && data.special[i].posj==posj) return true; + } + } + return false; +}; -function doMouseAction(config, ctx, event, data, action, funct) { +function isNotHighLighted(reference,ctx,data,statData,posi,posj,othervars) { + return(!isHighLighted(reference,ctx,data,statData,posi,posj,othervars)); +} +function deleteHighLight(ctx,data) { + var i; + if(typeof data.special=="object") { + for(i=data.special.length-1;i>=0;i--){ + if(data.special[i].typespecial=="highLight") data.special.splice(i,1); + } + } +}; - var onData = false; - var topY, bottomY; - var leftX, rightX; - var textMsr; +function highLightAction(action,ctx,data,config,v1,v2) { + if (ctx.firstPass!=9)return; + + var currentlyDisplayed=[-1,-1]; + var redisplay=false; + var i,j; + + + if(typeof data.special=="object") { + for(i=0;i=0;i--){ + if(data.special[i].typespecial=="highLight") data.special.splice(i,1); + } } - if (action=="annotate") { - show=false; - annotateDIV.style.display = show ? '' : 'none'; + if(addNew) { + redisplay=true; + if(typeof data.special == "undefined") data.special=[]; + if(config.highLightFullLine == "group") { + for(j=0;j 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; - onData = true; - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { - dispString = tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],-1,{otherVal:true}), myStatData,config); - textMsr=ctx.measureTextMultiLine(dispString,1*annotateDIV.style.fontSize.replace("pt","")); - ctx.restore(); - annotateDIV.innerHTML = dispString; - show = true; - } else if(typeof funct=="function") { - funct(event, ctx, config, data, myStatData ); - } - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { - x = bw.ns4 || bw.ns5 ? event.pageX : event.x; - y = bw.ns4 || bw.ns5 ? event.pageY : event.y; - if (bw.ie4 || bw.ie5) y = y + eval(scrolled); - if(config.annotateRelocate===true) { - var relocateX, relocateY; - relocateX=0;relocateY=0; - if(x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-fromLeft)relocateX=-textMsr.textWidth; - if(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); - } + pieceOfChartFound[pieceOfChartFound.length]={ + piece : i, + myStatData: myStatData + }; + } + } + } else if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "MARC") { + + 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)); + + if (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); + if (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); + if(myStatData.endAngle 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 (jsGraphAnnotate[ctx.ChartNewId][i][0] == "RECT") { @@ -890,33 +957,13 @@ function doMouseAction(config, ctx, event, data, action, funct) { if (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; - onData = true; - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { - dispString = tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],{otherVal:true}), myStatData,config); - textMsr=ctx.measureTextMultiLine(dispString,1*annotateDIV.style.fontSize.replace("pt","")); - ctx.restore(); - annotateDIV.innerHTML = dispString; - show = true; - } else if(typeof funct=="function") { - funct(event, ctx, config, data, myStatData ); - } - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { - x = bw.ns4 || bw.ns5 ? event.pageX : event.x; - y = bw.ns4 || bw.ns5 ? event.pageY : event.y; - if (bw.ie4 || bw.ie5) y = y + eval(scrolled); - if(config.annotateRelocate===true) { - var relocateX, relocateY; - relocateX=0;relocateY=0; - - if(x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-fromLeft)relocateX=-textMsr.textWidth; - if(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); - } + pieceOfChartFound[pieceOfChartFound.length]={ + piece : i, + myStatData: myStatData + }; } } else if (jsGraphAnnotate[ctx.ChartNewId][i][0] == "POINT") { myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]]; - var distance; if(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; @@ -931,108 +978,209 @@ function doMouseAction(config, ctx, event, data, action, funct) { var 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)); } if (distance < Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)) { myStatData.graphPosX = canvas_pos.x; myStatData.graphPosY = canvas_pos.y; - onData = true; - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { - dispString = tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],undefined,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],{otherVal:true}), myStatData,config); + pieceOfChartFound[pieceOfChartFound.length]={ + piece : i, + myStatData: myStatData + }; + } + } + } + + // search if mouse over one or more text; + if(config.detectMouseOnText) { + for(i=0;i Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p2))inRect=false; + if(canvas_pos.y < Math.min(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3))inRect=false; + if(canvas_pos.y > Math.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3))inRect=false; + } else if(Math.abs(jsTextMousePos[ctx.ChartNewId][i][2].p1 - jsTextMousePos[ctx.ChartNewId][i][2].p2) Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p3))inRect=false; + if(canvas_pos.y < Math.min(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2))inRect=false; + if(canvas_pos.y > Math.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2))inRect=false; + } else { + // D12 & D34; + + 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; + // D13 & D24; + 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; + // Check if in rectangle; + + y1=P12*canvas_pos.x+D12; + y2=P12*canvas_pos.x+D34; + y3=P13*canvas_pos.x+D13; + y4=P13*canvas_pos.x+D24; + + if(canvas_pos.y < Math.min(y1,y2))inRect=false; + if(canvas_pos.y > Math.max(y1,y2))inRect=false; + if(canvas_pos.y < Math.min(y3,y4))inRect=false; + if(canvas_pos.y > Math.max(y3,y4))inRect=false; + } + if(inRect)textOnChartFound[textOnChartFound.length]=i; + } + } + + function isAction(option,action) { + return(option==action || (option=="mousemove" && (action=="mousewheel" || action=="mouseout"))); + } + + if(config.savePng && isAction(config.savePngFunction,realAction)) { + // call savePng function; + saveCanvas(ctx, data, config); + } + + var whoToReferAnnotate=-1; + var whoToReferHighLight=-1; + var referAnnotateIsPoint=false; + var referHighLightIsPoint=false; + for(i=pieceOfChartFound.length-1;i>=0;i--) { + if (jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[i].piece][4]) { + if(referAnnotateIsPoint==false) { + if(whoToReferAnnotate==-1)whoToReferAnnotate=i; + if(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[i].piece][0] == "POINT") { + whoToReferAnnotate=i; + referAnnotateIsPoint=true; + } + } + } + if(referHighLightIsPoint==false) { + if(whoToReferHighLight==-1)whoToReferHighLight=i; + if(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[i].piece][0] == "POINT") { + whoToReferHighLight=i; + referHighLightIsPoint=true; + } + } + + } + + if(config.annotateDisplay && isAction(config.annotateFunction,realAction)) { + // annotate display functionality; + annotateDIV = document.getElementById('divCursor'); + annotateDIV.style.display = false ? '' : 'none'; + if(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(); + showDiv=false; + if(whoToReferAnnotate!=-1) { + if (jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][4]) { + if (jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][0] == "ARC") dispString = tmplbis(setOptionValue(true,true,1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][3],undefined,config.annotateLabel,"annotateLabel",jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][1],-1,{otherVal:true}), pieceOfChartFound[whoToReferAnnotate].myStatData,config); + else dispString = tmplbis(setOptionValue(true,true,1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][3],undefined,config.annotateLabel,"annotateLabel",jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][1],jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferAnnotate].piece][2],{otherVal:true}), pieceOfChartFound[whoToReferAnnotate].myStatData,config); textMsr=ctx.measureTextMultiLine(dispString,1*annotateDIV.style.fontSize.replace("pt","")); ctx.restore(); annotateDIV.innerHTML = dispString; - show = true; - } else if(typeof funct=="function"){ - funct(event, ctx, config, data, myStatData); - } - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { x = bw.ns4 || bw.ns5 ? event.pageX : event.x; y = bw.ns4 || bw.ns5 ? event.pageY : event.y; if (bw.ie4 || bw.ie5) y = y + eval(scrolled); if(config.annotateRelocate===true) { var relocateX, relocateY; relocateX=0;relocateY=0; - if(x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-fromLeft)relocateX=-textMsr.textWidth; - if(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); + if(x+fromLeft+textMsr.textWidth > window.innerWidth-rect.left-fromLeft)relocateX=-textMsr.textWidth; + if(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 = true ? '' : 'none'; + showDiv=true; } } - } - if (action == "annotate" && jsGraphAnnotate[ctx.ChartNewId][i][4]) { - annotateDIV.style.display = show ? '' : 'none'; - if(show && annotatePrevShow != i){ - if(annotatePrevShow >=0 && typeof config.annotateFunctionOut=="function") { - if(jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][0] == "ARC") config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],-1,null); - else config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][2],null); - } - annotatePrevShow=i; - if(typeof config.annotateFunctionIn=="function") { - if(jsGraphAnnotate[ctx.ChartNewId][i][0] == "ARC")config.annotateFunctionIn("INANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],jsGraphAnnotate[ctx.ChartNewId][i][1],-1,null); - else config.annotateFunctionIn("INANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],null); - } - } - //show=false; - } + } + + } - if(show==false && action=="annotate" && annotatePrevShow >=0) { + + if(inMouseAction[ctx.ChartNewId]==false && mouseActionData[ctx.ChartNewId].prevShow>=0 && isAction("mousemove",realAction) && (pieceOfChartFound.length==0 || mouseActionData[ctx.ChartNewId].prevShow!=pieceOfChartFound[pieceOfChartFound.length-1].piece)) { + inMouseAction[ctx.ChartNewId]=true; + prevShow=mouseActionData[ctx.ChartNewId].prevShow; + mouseActionData[ctx.ChartNewId].prevShow=-1; + + if(config.highLight && isAction(config.highLightMouseFunction,realAction) && pieceOfChartFound.length==0) { + highLightAction("HIDE",ctx,data,config,null,null); + } + if(typeof config.annotateFunctionOut=="function") { - if(jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][0] == "ARC") config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],-1,null); - else config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][2],null); + if(jsGraphAnnotate[ctx.ChartNewId][prevShow][0] == "ARC")config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][prevShow][3],jsGraphAnnotate[ctx.ChartNewId][prevShow][1],-1,null); + else config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][prevShow][3],jsGraphAnnotate[ctx.ChartNewId][prevShow][1],jsGraphAnnotate[ctx.ChartNewId][prevShow][2],null); } - annotatePrevShow=-1; + inMouseAction[ctx.ChartNewId]=false; } - var inRect; - if (action != "annotate") { - if(config.detectMouseOnText) { - for(var i=0;i Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p2))inRect=false; - if(canvas_pos.y < Math.min(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3))inRect=false; - if(canvas_pos.y > Math.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3))inRect=false; - } else if(Math.abs(jsTextMousePos[ctx.ChartNewId][i][2].p1 - jsTextMousePos[ctx.ChartNewId][i][2].p2) Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p3))inRect=false; - if(canvas_pos.y < Math.min(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2))inRect=false; - if(canvas_pos.y > Math.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2))inRect=false; - } else { - // D12 & D34; - var P12=Math.tan(jsTextMousePos[ctx.ChartNewId][i][4]); - var D12=jsTextMousePos[ctx.ChartNewId][i][3].p1-P12*jsTextMousePos[ctx.ChartNewId][i][2].p1; - var D34=jsTextMousePos[ctx.ChartNewId][i][3].p3-P12*jsTextMousePos[ctx.ChartNewId][i][2].p3; - // D13 & D24; - var P13=-1/P12; - var D13=jsTextMousePos[ctx.ChartNewId][i][3].p1-P13*jsTextMousePos[ctx.ChartNewId][i][2].p1; - var D24=jsTextMousePos[ctx.ChartNewId][i][3].p4-P13*jsTextMousePos[ctx.ChartNewId][i][2].p4; - // Check if in rectangle; - - var y1=P12*canvas_pos.x+D12; - var y2=P12*canvas_pos.x+D34; - var y3=P13*canvas_pos.x+D13; - var y4=P13*canvas_pos.x+D24; - - if(canvas_pos.y < Math.min(y1,y2))inRect=false; - if(canvas_pos.y > Math.max(y1,y2))inRect=false; - if(canvas_pos.y < Math.min(y3,y4))inRect=false; - if(canvas_pos.y > Math.max(y3,y4))inRect=false; - } - if(inRect){onData=true;funct(event, ctx, config, data, {type:"CLICKONTEXT",values:jsTextMousePos[ctx.ChartNewId][i]});} + + if(pieceOfChartFound.length>0 && inMouseAction[ctx.ChartNewId]==false && mouseActionData[ctx.ChartNewId].prevShow!=pieceOfChartFound[whoToReferHighLight].piece && isAction("mousemove",realAction)) { + inMouseAction[ctx.ChartNewId]=true; + prevShow=mouseActionData[ctx.ChartNewId].prevShow; + if(config.highLight && isAction(config.highLightMouseFunction,realAction)) { + if(whoToReferHighLight!=-1) { + if(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][0] == "ARC") highLightAction("ARC",ctx,data,config,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][1],-1); + else 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]); + } + } + + if(typeof config.annotateFunctionIn=="function") { + if(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[pieceOfChartFound.length-1].piece][0] == "ARC")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); + else 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]=false; + mouseActionData[ctx.ChartNewId].prevShow=pieceOfChartFound[whoToReferHighLight].piece; + } + + if (config.highLight && isAction(config.highLightMouseFunction,realAction) && isAction("mousemove",realAction)==false) { + if(pieceOfChartFound.length==0)highLightAction("HIDE",ctx,data,config,null,null); + else { + if(whoToReferHighLight!=-1) { + if(jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][0] == "ARC") highLightAction("ARC",ctx,data,config,jsGraphAnnotate[ctx.ChartNewId][pieceOfChartFound[whoToReferHighLight].piece][1],-1); + else 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]); } } - if(onData==false)funct(event, ctx, config, data, null); } + + + function runFunction(toBeRun){ + var i; + for(i=0;i", - inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" - inGraphDataVAlign: "off-center", // "bottom", "center", "top", "off-center" or "to-center" - inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" - inGraphDataFontFamily: "'Arial'", - inGraphDataFontSize: 12, - inGraphDataFontStyle: "normal", - inGraphDataFontColor: "#666", - inGraphDataRadiusPosition: 3, - inGraphDataAnglePosition: 2, - scaleOverlay: true, - scaleOverride: false, - scaleOverride2: false, - scaleGridLinesStep : 1, - scaleSteps: null, - scaleStepWidth: null, - scaleStartValue: null, - scaleShowLine: true, - scaleLineColor: "rgba(0,0,0,.1)", - scaleLineWidth: 1, - scaleLineStyle: "solid", - scaleShowLabels: true, - scaleShowLabels2: true, - scaleLabel: "<%=value%>", - scaleFontFamily: "'Arial'", - scaleFontSize: 12, - scaleFontStyle: "normal", - scaleFontColor: "#666", - scaleShowLabelBackdrop: true, - scaleBackdropColor: "rgba(255,255,255,0.75)", - scaleBackdropPaddingY: 2, - scaleBackdropPaddingX: 2, - segmentShowStroke: true, - segmentStrokeColor: "#fff", - segmentStrokeStyle: "solid", - segmentStrokeWidth: 2, - animation: true, - animationByData : "ByArc", - animationSteps: 100, - animationEasing: "easeOutBounce", - animateRotate: true, - animateScale: false, - onAnimationComplete: null, - annotateLabel: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", - startAngle: 90, - totalAmplitude : 360, - radiusScale : 1 - }; + chart.PolarArea.defaults = chart.defaults.PolarAreaV2; + chart.PolarArea.defaults = mergeChartConfig(chart.defaults.PolarArea, chart.PolarArea.defaults); if(isIE()<9 && isIE() != false)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); @@ -1259,8 +1362,22 @@ window.Chart = function(context) { var config = (options) ? mergeChartConfig(chart.PolarArea.defaults, options) : chart.PolarArea.defaults; return new PolarArea(data, config, context); }; + + this.PolarArea = function(data, options) { + chart.PolarArea.defaults = chart.defaults.PolarAreaV2; + chart.PolarArea.defaults = mergeChartConfig(chart.defaults.PolarArea, chart.PolarArea.defaults); + if(isIE()<9 && isIE() != false)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 config = (options) ? mergeChartConfig(chart.PolarArea.defaults, options) : chart.PolarArea.defaults; + return new PolarArea(data, config, context); + }; + + this.Radar = function(data, options) { chart.Radar.defaults = { + highLightSet : { pointDotRadius: 15, pointDot : true }, inGraphDataShow: false, inGraphDataPaddingRadius: 5, inGraphDataTmpl: "<%=v3%>", @@ -1326,8 +1443,10 @@ window.Chart = function(context) { var config = (options) ? mergeChartConfig(chart.Radar.defaults, options) : chart.Radar.defaults; return new Radar(data, config, context); }; + this.Pie = function(data, options) { - chart.Pie.defaults = chart.defaults.PieAndDoughnut; + chart.Pie.defaults = chart.defaults.PieAndDoughnutV2; + chart.Pie.defaults = mergeChartConfig(chart.defaults.PieAndDoughnut, chart.Pie.defaults); // merge annotate defaults if(isIE()<9 && isIE() != false)chart.Pie.defaults = mergeChartConfig(chart.defaults.IExplorer8, chart.Pie.defaults); chart.Pie.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Pie.defaults); @@ -1337,7 +1456,8 @@ window.Chart = function(context) { return new Pie(data, config, context); }; this.Doughnut = function(data, options) { - chart.Doughnut.defaults = chart.defaults.PieAndDoughnut; + chart.Doughnut.defaults = chart.defaults.PieAndDoughnutV2; + chart.Doughnut.defaults = mergeChartConfig(chart.defaults.PieAndDoughnut, chart.Doughnut.defaults); // merge annotate defaults if(isIE()<9 && isIE() != false)chart.Doughnut.defaults = mergeChartConfig(chart.defaults.IExplorer8, chart.Doughnut.defaults); chart.Doughnut.defaults = mergeChartConfig(chart.defaults.commonOptions, chart.Doughnut.defaults); @@ -1349,6 +1469,7 @@ window.Chart = function(context) { this.Line = function(data, options) { chart.Line.defaults = { inGraphDataShow: false, + highLightSet : { pointDotRadius: 15, pointDot : true }, inGraphDataPaddingX: 3, inGraphDataPaddingY: 3, inGraphDataTmpl: "<%=v3%>", @@ -1427,6 +1548,7 @@ window.Chart = function(context) { this.StackedBar = function(data, options) { chart.StackedBar.defaults = { annotateBarMinimumDetectionHeight : 0, + highLightSet : { pointDotRadius: 15, barStrokeWidth : 5, pointDot : true }, inGraphDataShow: false, inGraphDataPaddingX: 0, inGraphDataPaddingY: -3, @@ -1501,6 +1623,7 @@ window.Chart = function(context) { this.HorizontalStackedBar = function(data, options) { chart.HorizontalStackedBar.defaults = { annotateBarMinimumDetectionHeight : 0, + highLightSet : { pointDotRadius: 15, barStrokeWidth : 5, pointDot : true }, inGraphDataShow: false, inGraphDataPaddingX: -3, inGraphDataPaddingY: 0, @@ -1567,6 +1690,7 @@ window.Chart = function(context) { this.Bar = function(data, options) { chart.Bar.defaults = { annotateBarMinimumDetectionHeight : 0, + highLightSet : { pointDotRadius: 15, barStrokeWidth : 5, pointDot : true }, inGraphDataShow: false, inGraphDataPaddingX: 0, inGraphDataPaddingY: 3, @@ -1621,6 +1745,9 @@ window.Chart = function(context) { barValueSpacing: 5, barDatasetSpacing: 1, barBorderRadius: 0, + complementaryBar : false, + complementaryColor : "rgba(100,100,100,0.3)", + complementaryStrokeColor : "rgba(100,100,100,0.1)", pointDot: true, pointDotRadius: 4, pointDotStrokeStyle: "solid", @@ -1648,6 +1775,7 @@ window.Chart = function(context) { this.HorizontalBar = function(data, options) { chart.HorizontalBar.defaults = { annotateBarMinimumDetectionHeight : 0, + highLightSet : { pointDotRadius: 15, barStrokeWidth : 5, pointDot : true }, inGraphDataShow: false, inGraphDataPaddingX: 3, inGraphDataPaddingY: 0, @@ -1695,6 +1823,9 @@ window.Chart = function(context) { barValueSpacing: 5, barDatasetSpacing: 1, barBorderRadius: 0, + complementaryBar : false, + complementaryColor : "rgba(100,100,100,0.3)", + complementaryStrokeColor : "rgba(100,100,100,0.1)", animation: true, animationSteps: 60, animationEasing: "easeOutQuart", @@ -1718,16 +1849,22 @@ window.Chart = function(context) { annotateFontColor: "white" }; chart.defaults.commonOptions = { + generateConvertedData : false, + displayData : true, chartTextScale : 1, chartLineScale : 1, chartSpaceScale : 1, multiGraph: false, clearRect: true, // do not change clearRect options; for internal use only dynamicDisplay: false, + dynamicDisplayXPartOfChart : 0.5, + dynamicDisplayYPartOfChart : 0.5, + animationForceSetTimeOut : false, graphSpaceBefore: 5, graphSpaceAfter: 5, canvasBorders: false, canvasBackgroundColor: "none", + canvasBordersRadius : 0, canvasBordersWidth: 3, canvasBordersStyle: "solid", canvasBordersColor: "black", @@ -1740,6 +1877,7 @@ window.Chart = function(context) { graphTitleSpaceBefore: 5, graphTitleSpaceAfter: 5, graphTitleBorders : false, + graphTitleBordersRadius : 0, graphTitleBordersColor : "black", graphTitleBordersXSpace : 3, graphTitleBordersYSpace : 3, @@ -1755,6 +1893,7 @@ window.Chart = function(context) { graphSubTitleSpaceAfter: 5, graphSubTitleBorders : false, graphSubTitleBordersColor : "black", + graphSubTitleBordersRadius : 0, graphSubTitleBordersXSpace : 3, graphSubTitleBordersYSpace : 3, graphSubTitleBordersWidth : 1, @@ -1769,6 +1908,7 @@ window.Chart = function(context) { footNoteSpaceAfter: 5, footNoteBorders : false, footNoteBordersColor : "black", + footNoteBordersRadius : 0, footNoteBordersXSpace : 3, footNoteBordersYSpace : 3, footNoteBordersWidth : 1, @@ -1784,10 +1924,12 @@ window.Chart = function(context) { legendFontStyle: "normal", legendFontColor: "#666", legendBlockSize: 15, + legendBlockRadius:0, legendBorders: true, legendBordersStyle: "solid", legendBordersWidth: 1, legendBordersColors: "#666", + legendBordersRadius: 0, legendBordersSpaceBefore: 5, legendBordersSpaceAfter: 5, legendBordersSpaceLeft: 5, @@ -1803,6 +1945,7 @@ window.Chart = function(context) { legendXPadding : 0, legendYPadding : 0, inGraphDataBorders : false, + inGraphDataBordersRadius : 0, inGraphDataBordersColor : "black", inGraphDataBordersXSpace : 3, inGraphDataBordersYSpace : 3, @@ -1845,6 +1988,7 @@ window.Chart = function(context) { crossTextFunction: null, crossTextBorders : [false], crossTextBordersColor : ["black"], + crossTextBordersRadius : [0], crossTextBordersXSpace : [3], crossTextBordersYSpace : [3], crossTextBordersWidth : [1], @@ -1866,6 +2010,8 @@ window.Chart = function(context) { spaceLeft: 0, decimalSeparator: ".", thousandSeparator: "", + currency : "\u20AC", // 20AC= Euro + currencyPosition : "after", roundNumber: "none", roundPct: -1, templatesOpenTag : "<%=", @@ -1885,6 +2031,8 @@ window.Chart = function(context) { fmtV11: "none", fmtV12: "none", fmtV13: "none", + fmtV14: "none", + fmtV15: "none", fmtXLabel: "none", fmtYLabel: "none", fmtYLabel2: "none", @@ -1908,7 +2056,12 @@ window.Chart = function(context) { mouseDownMiddle: null, mouseMove: null, mouseOut: null, + mouseDblClick: null, mouseWheel : null, + highLight : false, + highLightMouseFunction : "mousemove", + highLightFullLine : false, // true, false or "group" + highLightRerunEndFunction : false, savePngName: "canvas", responsive : false, responsiveMinWidth : 0, @@ -1924,13 +2077,85 @@ window.Chart = function(context) { 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: false, + inGraphDataPaddingRadius: 5, + inGraphDataPaddingAngle: 0, + inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" + inGraphDataVAlign: "off-center", // "bottom", "center", "top", "off-center" or "to-center" + inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" + inGraphDataFontFamily: "'Arial'", + inGraphDataFontSize: 12, + inGraphDataFontStyle: "normal", + inGraphDataFontColor: "#666", + inGraphDataRadiusPosition: 3, + inGraphDataAnglePosition: 2, + scaleOverlay: true, + scaleOverride: false, + scaleOverride2: false, + scaleGridLinesStep : 1, + scaleSteps: null, + scaleStepWidth: null, + scaleStartValue: null, + scaleShowLine: true, + scaleLineColor: "rgba(0,0,0,.1)", + scaleLineWidth: 1, + scaleLineStyle: "solid", + scaleShowLabels: true, + scaleShowLabels2: true, + scaleLabel: "<%=value%>", + scaleFontFamily: "'Arial'", + scaleFontSize: 12, + scaleFontStyle: "normal", + scaleFontColor: "#666", + scaleShowLabelBackdrop: true, + scaleBackdropColor: "rgba(255,255,255,0.75)", + scaleBackdropPaddingY: 2, + scaleBackdropPaddingX: 2, + segmentShowStroke: true, + segmentStrokeColor: "#fff", + segmentStrokeStyle: "solid", + segmentStrokeWidth: 2, + animation: true, + animationByData : "ByArc", + animationSteps: 100, + animationEasing: "easeOutBounce", + animateRotate: true, + animateScale: false, + 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 : 0.10, expandInRadius : -0.10 }, inGraphDataShow: false, inGraphDataPaddingRadius: 5, inGraphDataPaddingAngle: 0, - inGraphDataTmpl: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", inGraphDataAlign: "off-center", // "right", "center", "left", "off-center" or "to-center" inGraphDataVAlign: "off-center", // "bottom", "middle", "top", "off-center" or "to-center" inGraphDataRotate: 0, // rotateAngle value (0->360) , "inRadiusAxis" or "inRadiusAxisRotateLabels" @@ -1953,10 +2178,11 @@ window.Chart = function(context) { animateRotate: true, animateScale: false, onAnimationComplete: null, - annotateLabel: "<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>", startAngle: 90, totalAmplitude : 360, - radiusScale: 1 + radiusScale: 1, + radiusDataWeight : 1, + radiusSpaceWeight :0.3 }; chart.defaults.xyAxisCommonOptions = { @@ -1983,6 +2209,7 @@ window.Chart = function(context) { yAxisSpaceLeft: 5, yAxisLabelBorders : false, yAxisLabelBordersColor : "black", + yAxisLabelBordersRadius : 0, yAxisLabelBordersXSpace : 3, yAxisLabelBordersYSpace : 3, yAxisLabelBordersWidth : 1, @@ -1999,6 +2226,7 @@ window.Chart = function(context) { xAxisSpaceAfter: 5, xAxisLabelBorders : false, xAxisLabelBordersColor : "black", + xAxisLabelBordersRadius : 0, xAxisLabelBordersXSpace : 3, xAxisLabelBordersYSpace : 3, xAxisLabelBordersWidth : 1, @@ -2018,6 +2246,7 @@ window.Chart = function(context) { yAxisUnitSpaceAfter: 5, yAxisUnitBorders : false, yAxisUnitBordersColor : "black", + yAxisUnitBordersradius : 0, yAxisUnitBordersXSpace : 3, yAxisUnitBordersYSpace : 3, yAxisUnitBordersWidth : 1, @@ -2027,113 +2256,99 @@ window.Chart = function(context) { var clear = function(c) { c.clearRect(0, 0, width, height); }; + + function init_and_start(ctx,data,config) { - var i; - - if (typeof ctx.initialWidth == "undefined") { - ctx.initialWidth =ctx.canvas.width; - } - if (typeof ctx.chartTextScale == "undefined") { - ctx.chartTextScale=config.chartTextScale; - } - if (typeof ctx.chartLineScale == "undefined") { - ctx.chartLineScale=config.chartLineScale; - } - if (typeof ctx.chartSpaceScale == "undefined") { - ctx.chartSpaceScale=config.chartSpaceScale; - } - if (typeof ctx.ChartNewId == "undefined") { + var i; + + if (typeof ctx.initialWidth == "undefined") ctx.initialWidth =ctx.canvas.width; + if (typeof ctx.chartTextScale == "undefined") ctx.chartTextScale=config.chartTextScale; + if (typeof ctx.chartLineScale == "undefined") ctx.chartLineScale=config.chartLineScale; + if (typeof ctx.chartSpaceScale == "undefined") ctx.chartSpaceScale=config.chartSpaceScale; + + if(typeof ctx.firstPass=="undefined"){ + ctx.firstPass=0; + if(config.responsive && !config.multiGraph) { + addResponsiveChart(ctx.ChartNewId,ctx,data,config); + } + if(typeof data.labels == "undefined")data.labels=[]; + if (data.labels.length==0) { + var mxlgt = 0; + for (i = 0; i < data.datasets.length; i++) {mxlgt = Max([mxlgt, data.datasets[i].data.length]);} + for (i=0;i 0) { initPassVariableData_part2(statData,data,config,ctx,{midPosX : midPosX,midPosY : midPosY,int_radius : 0,ext_radius : scaleHop*calculatedScale.steps, calculatedScale : calculatedScale, scaleHop : scaleHop,outerVal : outerVal}); animationLoop(config, drawScale, drawAllSegments, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, midPosX, midPosY, midPosX - ((Min([msr.availableHeight, msr.availableWidth]) / 2) - 5), midPosY + ((Min([msr.availableHeight, msr.availableWidth]) / 2) - 5), data, statData); } else { testRedraw(ctx,data,config); + ctx.firstPass=9; } function drawAllSegments(animationDecimal) { - for (var i = 0; i < data.length; i++) { + + var fixAngle=0; + var firstAngle=statData[0][0].firstAngle; + if(1*config.animationStartWithData>1 && 1*config.animationStartWithData-1 < data.length) { + fixAngle=(statData[config.animationStartWithData-1].startAngle-statData[0][0].firstAngle); + firstAngle=statData[config.animationStartWithData-1].startAngle; + } + + prevAngle=statData[0][0].firstAngle; + + + for(var j=0;j < data.labels.length;j++) { + var scaleAnimation = 1, rotateAnimation = 1; @@ -2175,88 +2403,99 @@ window.Chart = function(context) { rotateAnimation = animationDecimal; } } - correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1, 0).mainVal; - if (!(typeof(data[i].value) == 'undefined')) { + for (var i = 0; i < data.datasets.length; i++) { + correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1,false).mainVal; + + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { ctx.beginPath(); if(config.animationByData == "ByArc") { - endAngle=statData[i].startAngle+correctedRotateAnimation*statData[i].segmentAngle; - ctx.arc(midPosX, midPosY, scaleAnimation * statData[i].radiusOffset, statData[i].startAngle, endAngle, false); + endAngle=statData[i][j].startAngle+correctedRotateAnimation*statData[i][j].segmentAngle; + ctx.arc(midPosX, midPosY, scaleAnimation * statData[i][j].radiusOffset, statData[i][j].startAngle, endAngle, false); } else if(config.animationByData) { - if(statData[i].startAngle-statData[i].firstAngle < correctedRotateAnimation*2*Math.PI ) { - endAngle=statData[i].endAngle; - if((statData[i].endAngle-statData[i].firstAngle)> correctedRotateAnimation*2*Math.PI) endAngle=statData[i].firstAngle+correctedRotateAnimation*2*Math.PI; - ctx.arc(midPosX, midPosY, scaleAnimation * statData[i].radiusOffset, statData[i].startAngle, endAngle, false); - + + if (i<1*config.animationStartWithData-1) { + ctx.arc(midPieX, midPieY, scaleAnimation * statData[i][j].radiusOffset, statData[i][j].startAngle, statData[i][j].endAngle,false); + } else if(statData[i][j].startAngle <= firstAngle+correctedRotateAnimation*(2*Math.PI-fixAngle) ) { + endAngle=statData[i][j].endAngle; + if(statData[i][j].endAngle > firstAngle+correctedRotateAnimation*(2*Math.PI-fixAngle)) { + endAngle=firstAngle+correctedRotateAnimation*(2*Math.PI-fixAngle); + } + ctx.arc(midPieX, midPieY, scaleAnimation * statData[i][j].radiusOffset, statData[i][j].startAngle, endAngle,false); + } else { + continue; } - else continue; } else { - ctx.arc(midPosX, midPosY, scaleAnimation * statData[i].radiusOffset, statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle)); + ctx.arc(midPieX, midPieY, scaleAnimation * statData[i][j].radiusOffset, prevAngle, prevAngle+correctedRotateAnimation * (statData[i][j].endAngle-statData[i][j].startAngle),false); + prevAngle=prevAngle+correctedRotateAnimation * (statData[i][j].endAngle-statData[i][j].startAngle); } ctx.lineTo(midPosX, midPosY); ctx.closePath(); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.fillStyle=setOptionValue(true,true,1,"FILLCOLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); ctx.fill(); if(config.segmentShowStroke=="merge") { /* avoid blank stripes between piece of chart */ ctx.lineWidth =0; - ctx.strokeStyle =setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.strokeStyle =setOptionValue(true,true,1,"FILLCOLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); ctx.setLineDash([]); ctx.stroke(); } else if (config.segmentShowStroke) { ctx.strokeStyle = config.segmentStrokeColor; ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.segmentStrokeWidth); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",ctx,data,statData,data[i].segmentStrokeStyle,config.segmentStrokeStyle,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"SEGMENTSTROKESTYLE",ctx,data,statData,data.datasets[i].segmentStrokeStyle,config.segmentStrokeStyle,"segmentStrokeStyle",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); ctx.stroke(); ctx.setLineDash([]); } } + } } if (animationDecimal >= config.animationStopValue) { - for (i = 0; i < data.length; i++) { - if (typeof(data[i].value) == 'undefined') continue; -// if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,-1,{nullValue : true})) { - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["ARC", i, -1,statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data[i].annotateDisplay,config.annotateDisplay,i,-1,{nullValue : true})]; -// } - if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data[i].inGraphDataShow,config.inGraphDataShow,i,-1,{nullValue : true})) { - if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = statData[i].realStartAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = (2*statData[i].realStartAngle - statData[i].segmentAngle) / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = statData[i].realStartAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) labelRadius = 0 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) labelRadius = statData[i].radiusOffset / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) labelRadius = statData[i].radiusOffset + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 4) labelRadius = scaleHop * calculatedScale.steps + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - ctx.save() - if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "left"; - else ctx.textAlign = "right"; - } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; - else ctx.textAlign = "left"; - } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); - if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { - if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; - else ctx.textBaseline = "bottom"; - } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { - if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; - else ctx.textBaseline = "top"; - } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); - ctx.translate(midPosX + labelRadius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle)); - var rotateVal=0; - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") rotateVal=2 * Math.PI - posAngle; - else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { - if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) rotateVal=3 * Math.PI - posAngle; - else rotateVal=2 * Math.PI - posAngle; - } else rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180); - ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ), true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,midPosX + labelRadius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle),i,-1); - ctx.restore(); + for (i = 0; i < data.datasets.length; i++) { + for (j = 0; j < data.labels.length; j++) { + if (typeof(data.datasets[i].data[j]) == 'undefined') continue; + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["MARC", i, j, statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + + if (setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { + if (setOptionValue(true,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 1) posAngle = statData[i][j].realStartAngle + setOptionValue(true,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(true,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 2) posAngle = (2*statData[i][j].realStartAngle - statData[i][j].segmentAngle) / 2 + setOptionValue(true,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(true,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 3) posAngle = statData[i][j].realStartAngle - statData[i][j].segmentAngle + setOptionValue(true,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 1) labelRadius = 0 + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 2) labelRadius = statData[i][j].radiusOffset / 2 + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 3) labelRadius = statData[i][j].radiusOffset + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 4) labelRadius = scaleHop * calculatedScale.steps + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + ctx.save() + if (setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }) == "off-center") { + if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) >= 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "left"; + + else ctx.textAlign = "right"; + } else if (setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }) == "to-center") { + if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) >= 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "right"; + else ctx.textAlign = "left"; + } else ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + if (setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ) == "off-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; + else ctx.textBaseline = "bottom"; + } else if (setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ) == "to-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; + else ctx.textBaseline = "top"; + } else ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); + ctx.translate(midPosX + labelRadius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle)); + var rotateVal=0; + if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis") rotateVal=2 * Math.PI - posAngle; + else if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) rotateVal=3 * Math.PI - posAngle; + else rotateVal=2 * Math.PI - posAngle; + } else rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); + ctx.rotate(rotateVal); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ), true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,midPosX + labelRadius * Math.cos(posAngle), midPosY - labelRadius * Math.sin(posAngle),i,j); + ctx.restore(); + } } } } @@ -2305,13 +2544,11 @@ window.Chart = function(context) { function getValueBounds() { var upperValue = -Number.MAX_VALUE; var lowerValue = Number.MAX_VALUE; - for (var i = 0; i < data.length; i++) { - if(typeof data[i].value == "undefined") continue; - if (1 * data[i].value > upperValue) { - upperValue = 1 * data[i].value; - } - if (1 * data[i].value < lowerValue) { - lowerValue = 1 * data[i].value; + for (var i = 0; i < data.datasets.length; i++) { + for(j=0;j upperValue) upperValue = 1 * data.datasets[i].data[j]; + if (1 * data.datasets[i].data[j] < lowerValue) lowerValue = 1 * data.datasets[i].data[j]; } }; if(upperValue 1) currentAnimPc = currentAnimPc - 1; if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { if (fPt == -1) { @@ -2403,29 +2655,33 @@ window.Chart = function(context) { } ctx.closePath(); if (config.datasetFill) { - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,-1,{animationValue : currentAnimPc, midPosX : statData[i][0].midPosX, midPosY : statData[i][0].midPosY, ext_radius : (config.animationLeftToRight ? 1 : currentAnimPc) * (statData[i][0].calculated_offset_max)} ); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,-1,{animationValue : currentAnimPc, midPosX : statData[i][0].midPosX, midPosY : statData[i][0].midPosY, ext_radius : (config.animationLeftToRight ? 1 : currentAnimPc) * (statData[i][0].calculated_offset_max)} ); } else ctx.fillStyle = "rgba(0,0,0,0)"; - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,-1,{nullvalue : null} ); - ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(1,"LINEWIDTH",ctx,data,statData,data.datasets[i].datasetStrokeWidth,config.datasetStrokeWidth,i,-1,{nullvalue : null} )); + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,-1,{nullvalue : null} ); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"LINEWIDTH",ctx,data,statData,data.datasets[i].datasetStrokeWidth,config.datasetStrokeWidth,"datasetStrokeWidth",i,-1,{nullvalue : null} )); ctx.fill(); -// ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); - if (config.pointDot && (!config.animationLeftToRight || (config.animationLeftToRight && animationDecimal >= 1))) { + if (animationDecimal >= config.animationStopValue) { ctx.beginPath(); - ctx.fillStyle=setOptionValue(1,"MARKERFILLCOLOR",ctx,data,statData,data.datasets[i].pointColor,config.defaultStrokeColor,i,-1,{nullvalue: true} ); - ctx.strokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointStrokeColor,config.defaultStrokeColor,i,-1,{nullvalue: true} ); - ctx.lineWidth=setOptionValue(ctx.chartLineScale,"MARKERLINEWIDTH",ctx,data,statData,data.datasets[i].pointDotStrokeWidth,config.pointDotStrokeWidth,i,-1,{nullvalue: true} ); for (var k = 0; k < data.datasets[i].data.length; k++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,k,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",k,-1,{nullvalue : null} )== false) continue; + if (!(typeof(data.datasets[i].data[k]) == 'undefined')) { - ctx.beginPath(); - var markerShape=setOptionValue(1,"MARKERSHAPE",ctx,data,statData,data.datasets[i].markerShape,config.markerShape,i,k,{nullvalue: true} ); - var markerRadius=setOptionValue(ctx.chartSpaceScale,"MARKERRADIUS",ctx,data,statData,data.datasets[i].pointDotRadius,config.pointDotRadius,i,k,{nullvalue: true} ); - var markerStrokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointDotStrokeStyle,config.pointDotStrokeStyle,i,k,{nullvalue: true} ); - drawMarker(ctx,midPosX + currentAnimPc * statData[i][k].offsetX, midPosY - currentAnimPc * statData[i][k].offsetY, markerShape,markerRadius,markerStrokeStyle); + if(setOptionValue(true,true,1,"POINTDOT",ctx,data,statData,undefined,config.pointDot,"pointDot",i,k,{nullvalue : null} )) { + ctx.beginPath(); + ctx.fillStyle=setOptionValue(true,true,1,"MARKERFILLCOLOR",ctx,data,statData,data.datasets[i].pointColor,config.defaultStrokeColor,"pointColor",i,k,{nullvalue: true} ); + ctx.strokeStyle=setOptionValue(true,true,1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointStrokeColor,config.defaultStrokeColor,"pointStrokeColor",i,k,{nullvalue: true} ); + ctx.lineWidth=setOptionValue(true,true,ctx.chartLineScale,"MARKERLINEWIDTH",ctx,data,statData,data.datasets[i].pointDotStrokeWidth,config.pointDotStrokeWidth,"pointDotStrokeWidth",i,k,{nullvalue: true} ); + var markerShape=setOptionValue(true,true,1,"MARKERSHAPE",ctx,data,statData,data.datasets[i].markerShape,config.markerShape,"markerShape",i,k,{nullvalue: true} ); + var markerRadius=setOptionValue(true,true,ctx.chartSpaceScale,"MARKERRADIUS",ctx,data,statData,data.datasets[i].pointDotRadius,config.pointDotRadius,"pointDotRadius",i,k,{nullvalue: true} ); + var markerStrokeStyle=setOptionValue(true,true,1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointDotStrokeStyle,config.pointDotStrokeStyle,"pointDotStrokeStyle",i,k,{nullvalue: true} ); + drawMarker(ctx,midPosX + currentAnimPc * statData[i][k].offsetX, midPosY - currentAnimPc * statData[i][k].offsetY, markerShape,markerRadius,markerStrokeStyle); + } } } } @@ -2434,35 +2690,35 @@ window.Chart = function(context) { if (animationDecimal >= config.animationStopValue) { for (i = 0; i < data.datasets.length; i++) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if (typeof(data.datasets[i].data[j]) == 'undefined') continue; -// if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i,j,statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,i,j,{nullValue : true})]; -// } - if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i,j,statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + if(setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { ctx.save(); ctx.beginPath(); - ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); - ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); - if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "left"; + ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }) == "off-center") { + if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis" || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "left"; else ctx.textAlign = "right"; - } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; + } else if (setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }) == "to-center") { + if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis" || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; else ctx.textAlign = "left"; - } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); - if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { + } else ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + if (setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ) == "off-center") { if ((config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; else ctx.textBaseline = "top"; - } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { + } else if (setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ) == "to-center") { if ((config.startAngle * Math.PI / 180 - j * rotationDegree + 4 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; else ctx.textBaseline = "bottom"; - } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); + } else ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); var radiusPrt; - if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) radiusPrt = 0 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) radiusPrt = (statData[i][j].calculated_offset) / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) radiusPrt = (statData[i][j].calculated_offset) + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); + if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 1) radiusPrt = 0 + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 2) radiusPrt = (statData[i][j].calculated_offset) / 2 + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(true,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 3) radiusPrt = (statData[i][j].calculated_offset) + setOptionValue(true,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); var x_pos,y_pos; if(statData[i][j].calculated_offset>0) { x_pos=midPosX + statData[i][j].offsetX * (radiusPrt/statData[i][j].calculated_offset); @@ -2475,15 +2731,15 @@ window.Chart = function(context) { } ctx.translate(x_pos,y_pos); var rotateVal=0; - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") rotateVal= j * rotationDegree; - else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis") rotateVal= j * rotationDegree; + else if (setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxisRotateLabels") { if ((j * rotationDegree + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (j * rotationDegree + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) rotateVal= 3 * Math.PI + j * rotationDegree; else rotateVal = 2 * Math.PI + j * rotationDegree; - } else rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180); + } else rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); ctx.rotate(rotateVal); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i][j],config); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,x_pos,y_pos,i,j); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,x_pos,y_pos,i,j); ctx.restore(); } } @@ -2506,7 +2762,7 @@ window.Chart = function(context) { ctx.moveTo(0, 0); ctx.lineTo(0, -maxSize); // ctx.setLineDash(lineStyleFn(config.angleLineStyle)); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"ANGLELINESTYLE",ctx,data,statData,undefined,config.angleLineStyle,h,-1,{nullValue : true} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"ANGLELINESTYLE",ctx,data,statData,undefined,config.angleLineStyle,"angleLineStyle",h,-1,{nullValue : true} ))); ctx.stroke(); ctx.setLineDash([]); } @@ -2652,9 +2908,9 @@ window.Chart = function(context) { lowerValue=lowerValue*1.1; } } - if(typeof config.graphMin=="function") lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + if(typeof config.graphMin=="function") lowerValue= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,"graphMin",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; - if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + if(typeof config.graphMax=="function") upperValue= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,"graphMax",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax)) upperValue = config.graphMax; var maxSteps = Math.floor((scaleHeight / (labelHeight * 0.66))); var minSteps = Math.floor((scaleHeight / labelHeight * 0.5)); @@ -2666,57 +2922,109 @@ window.Chart = function(context) { minSteps: minSteps }; }; - }; + return { + data:data, + config:config, + ctx:ctx + }; + }; var Pie = function(data, config, ctx) { - var msr, midPieX, midPieY, pieRadius; ctx.tpchart="Pie"; - return(Doughnut(data,config,ctx)); + if(typeof data.length!="undefined") return(PieDoughnut(convertData(data,config.generateConvertedData),config,ctx,"Pie")); + else return (PieDoughnut(data,config,ctx,"Pie")); }; - + var Doughnut = function(data, config, ctx) { - var msr, midPieX, midPieY, doughnutRadius; + ctx.tpchart="Doughnut"; + if(typeof data.length!="undefined") return(PieDoughnut(convertData(data,config.generateConvertedData),config,ctx,"Doughnut")); + else return (PieDoughnut(data,config,ctx,"Doughnut")); + }; - if(typeof ctx.tpchart == "undefined")ctx.tpchart="Doughnut"; - ctx.tpdata=1; + var PieDoughnut = function(data, config, ctx,chartType) { + var msr, midPieX, midPieY, doughnutRadius,cutoutRadius; + ctx.tpdata=0; if (!init_and_start(ctx,data,config)) return; + var statData=initPassVariableData_part1(data,config,ctx); var realCumulativeAngle = (((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; config.logarithmic = false; config.logarithmic2 = false; - msr = setMeasures(data, config, ctx, height, width, "none", null, true, false, false, false, true, "Doughnut"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, "none", null, true, false, false, true, true, "Doughnut"); + var drwSize=calculatePieDrawingSize(ctx,msr,config,data,statData); + midPieX=drwSize.midPieX; midPieY=drwSize.midPieY; doughnutRadius=drwSize.radius; + - - var cutoutRadius; - if(ctx.tpchart == "Pie")cutoutRadius=0; + if(chartType == "Pie")cutoutRadius=0; else cutoutRadius = doughnutRadius * (config.percentageInnerCutout / 100); + if(doughnutRadius > 0) { initPassVariableData_part2(statData,data,config,ctx,{midPosX : midPieX,midPosY : midPieY ,int_radius : cutoutRadius ,ext_radius : doughnutRadius,outerVal : -1}); animationLoop(config, null, drawPieSegments, ctx, msr.clrx, msr.clry, msr.clrwidth, msr.clrheight, midPieX, midPieY, midPieX - doughnutRadius, midPieY + doughnutRadius, data, statData); } else { testRedraw(ctx,data,config); + ctx.firstPass=9; } - function drawPieSegments(animationDecimal) { - var cumulativeAngle = (((-config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; var dataCutoutRadius, dataDoughnutRadius; - - for (var i = 0; i < data.length; i++) { + var rdataCutoutRadius, rdataDoughnutRadius; + + var prevAngle,fixAngle,firstAngle,cumulativeAngle; + prevAngle=[]; + fixAngle=[]; + firstAngle=[]; + cumulativeAngle=[]; + + for (var i = 0; i < data.datasets.length; i++) { var scaleAnimation = 1, rotateAnimation = 1; - if (ctx.tpchart=="Pie")dataCutoutRadius=cutoutRadius; - else dataCutoutRadius=cutoutRadius-(doughnutRadius-cutoutRadius)*setOptionValue(1,"EXPANDINRADIUS",ctx,data,statData,data[i].expandInRadius,0,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); - dataDoughnutRadius=doughnutRadius+(doughnutRadius-cutoutRadius)*setOptionValue(1,"EXPANDOUTRADIUS",ctx,data,statData,data[i].expandOutRadius,0,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + + for(j=0;j1 && 1*config.animationStartWithData-1 < data.datasets.length) { +// fixAngle[j]=(statData[config.animationStartWithData-1][0].startAngle-statData[i][0].firstAngle); +// firstAngle[j]=statData[config.animationStartWithData-1][0].startAngle; + } + } + + if(setOptionValue(false,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(false,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",-1,j,{nullvalue : null} )== false) continue; + + if (typeof data.datasets[i].data[j] == 'undefined' || 1*data.datasets[i].data[j] <=0) continue; + + if (chartType=="Pie")dataCutoutRadius=cutoutRadius; + else dataCutoutRadius=cutoutRadius + dataDoughnutRadius=doughnutRadius + + + // correct radius for Multiple Doughnuts; + rdataCutoutRadius=dataCutoutRadius+(dataDoughnutRadius-dataCutoutRadius)*statData[i][j].startRadius; + rdataDoughnutRadius=dataCutoutRadius+(dataDoughnutRadius-dataCutoutRadius)*statData[i][j].stopRadius; + + dataCutoutRadius=rdataCutoutRadius; + dataDoughnutRadius=rdataDoughnutRadius; + + if (chartType!="Pie" || j>0)rdataCutoutRadius=dataCutoutRadius-(dataDoughnutRadius-dataCutoutRadius)*setOptionValue(false,true,1,"EXPANDINRADIUS",ctx,data,statData,data.datasets[i].expandInRadius,0,"expandInRadius",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + rdataDoughnutRadius=dataDoughnutRadius+(dataDoughnutRadius-dataCutoutRadius)*setOptionValue(false,true,1,"EXPANDOUTRADIUS",ctx,data,statData,data.datasets[i].expandOutRadius,0,"expandOutRadius",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + + dataCutoutRadius=rdataCutoutRadius; + dataDoughnutRadius=rdataDoughnutRadius; + if (config.animation) { if (config.animateScale) { scaleAnimation = animationDecimal; @@ -2726,97 +3034,130 @@ window.Chart = function(context) { } } - correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1, 0).mainVal; - if (!(typeof(data[i].value) == 'undefined') && 1*data[i].value >=0) { + correctedRotateAnimation = animationCorrection(rotateAnimation, data, config, i, -1, false).mainVal; + ctx.beginPath(); ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.segmentStrokeWidth); ctx.strokeStyle = "rgba(0,0,0,0)"; if (config.animationByData == "ByArc") { - endAngle=statData[i].startAngle+correctedRotateAnimation*statData[i].segmentAngle; - ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, statData[i].startAngle, endAngle,false); - ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, endAngle,statData[i].startAngle, true); + endAngle=statData[i][j].startAngle+correctedRotateAnimation*statData[i][j].segmentAngle; + ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, statData[i][j].startAngle, endAngle,false); + ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, endAngle,statData[i][j].startAngle, true); } else if(config.animationByData) { - if(statData[i].startAngle-statData[i].firstAngle < correctedRotateAnimation*2*Math.PI ) { - endAngle=statData[i].endAngle; - if((statData[i].endAngle-statData[i].firstAngle)> correctedRotateAnimation*2*Math.PI) endAngle=statData[i].firstAngle+correctedRotateAnimation*2*Math.PI; - ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, statData[i].startAngle, endAngle,false); - ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, endAngle,statData[i].startAngle, true); - +// animationStartWith data not implemented if (i<1*config.animationStartWithData-1) { + if (i<0) { + ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, statData[i][j].startAngle, statData[i].endAngle,false); + ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, statData[i][j].endAngle,statData[i][j].startAngle, true); + } else if(statData[i][j].startAngle <= firstAngle[j]+correctedRotateAnimation*(2*Math.PI-fixAngle[j]) ) { + endAngle=statData[i][j].endAngle; + if(statData[i][j].endAngle > firstAngle[j]+correctedRotateAnimation*(2*Math.PI-fixAngle[j])) { + endAngle=firstAngle[j]+correctedRotateAnimation*(2*Math.PI-fixAngle[j]); + } + ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, statData[i][j].startAngle, endAngle,false); + ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, endAngle,statData[i][j].startAngle, true); + + } else { + continue; } - else continue; } else { - ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle),false); - ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, statData[i].firstAngle+correctedRotateAnimation * (statData[i].endAngle-statData[i].firstAngle), statData[i].firstAngle+correctedRotateAnimation * (statData[i].startAngle-statData[i].firstAngle), true); + ctx.arc(midPieX, midPieY, scaleAnimation * dataDoughnutRadius, prevAngle[j], prevAngle[j]+correctedRotateAnimation * (statData[i][j].endAngle-statData[i][j].startAngle),false); + ctx.arc(midPieX, midPieY, scaleAnimation * dataCutoutRadius, prevAngle[j]+correctedRotateAnimation * (statData[i][j].endAngle-statData[i][j].startAngle), prevAngle[j], true); + prevAngle[j]=prevAngle[j]+correctedRotateAnimation * (statData[i][j].endAngle-statData[i][j].startAngle); } ctx.closePath(); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.fillStyle=setOptionValue(false,true,1,"FILLCOLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.fill(); if(config.segmentShowStroke=="merge") { /* avoid blank stripes between piece of chart */ ctx.lineWidth =1.5; - ctx.strokeStyle =setOptionValue(1,"COLOR",ctx,data,statData,data[i].color,config.defaultFillColor,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); + ctx.strokeStyle =setOptionValue(false,true,1,"FILLCOLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); ctx.setLineDash([]); ctx.stroke(); } else if (config.segmentShowStroke) { ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.segmentStrokeWidth); ctx.strokeStyle = config.segmentStrokeColor; - ctx.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",ctx,data,statData,data[i].segmentStrokeStyle,config.segmentStrokeStyle,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(false,true,1,"SEGMENTSTROKESTYLE",ctx,data,statData,data.datasets[i].segmentStrokeStyle,config.segmentStrokeStyle,"segmentStrokeStyle",i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ))); ctx.stroke(); ctx.setLineDash([]); } } } if (animationDecimal >= config.animationStopValue) { - for (i = 0; i < data.length; i++) { - if (ctx.tpchart=="Pie")dataCutOutRadius=cutoutRadius; - else dataCutoutRadius=cutoutRadius-(doughnutRadius-cutoutRadius)*setOptionValue(1,"EXPANDINRADIUS",ctx,data,statData,data[i].expandInRadius,0,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); - dataDoughnutRadius=doughnutRadius+(doughnutRadius-cutoutRadius)*setOptionValue(1,"EXPANDOUTRADIUS",ctx,data,statData,data[i].expandOutRadius,0,i,-1,{animationDecimal: animationDecimal, scaleAnimation : scaleAnimation} ); - if (typeof(data[i].value) == 'undefined' || 1*data[i].value<0) continue; - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["ARC", i,-1,statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data[i].annotateDisplay,config.annotateDisplay,i,-1,{nullValue : true})]; - if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data[i].inGraphDataShow,config.inGraphDataShow,i,-1,{nullValue : true}) && statData[i].segmentAngle >= (Math.PI/180) * setOptionValue(1,"INGRAPHDATAMINIMUMANGLE",ctx,data,statData,undefined,config.inGraphDataMinimumAngle,i,-1,{nullValue : true} )) { - if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = statData[i].realStartAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = statData[i].realStartAngle- statData[i].segmentAngle / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = statData[i].realStartAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 1) labelRadius = dataCutoutRadius + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 2) labelRadius = dataCutoutRadius + (dataDoughnutRadius - dataCutoutRadius) / 2 + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - else if (setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,i,-1,{nullValue : true} ) == 3) labelRadius = dataDoughnutRadius + setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ); - ctx.save(); - if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "off-center") { - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "left"; - else ctx.textAlign = "right"; - } else if (setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }) == "to-center") { - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) > 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) < Math.PI / 2) ctx.textAlign = "right"; - else ctx.textAlign = "left"; - } else ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,-1,{nullValue: true }); - if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "off-center") { - if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; - else ctx.textBaseline = "bottom"; - } else if (setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ) == "to-center") { - if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; - else ctx.textBaseline = "top"; - } else ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,-1,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,-1,{nullValue : true} ); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); - ctx.translate(midPieX + labelRadius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); - var rotateVal=0; - if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxis") rotateVal=2 * Math.PI - posAngle; - else if (setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) == "inRadiusAxisRotateLabels") { - if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) rotateVal=3 * Math.PI - posAngle; - else rotateVal=2 * Math.PI - posAngle; - } else rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,-1,{nullValue : true} ) * (Math.PI / 180); - ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,-1,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,-1,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,-1,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,-1,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,midPieX + labelRadius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle),i,-1); - ctx.restore(); + for (var i = 0; i < data.datasets.length; i++) { + for(j=0;j= (Math.PI/180) * setOptionValue(false,true,1,"INGRAPHDATAMINIMUMANGLE",ctx,data,statData,undefined,config.inGraphDataMinimumAngle,"inGraphDataMinimumAngle",i,j,{nullValue : true} )) { + if (setOptionValue(false,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 1) posAngle = statData[i][j].realStartAngle + setOptionValue(false,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(false,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 2) posAngle = statData[i][j].realStartAngle- statData[i][j].segmentAngle / 2 + setOptionValue(false,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(false,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 3) posAngle = statData[i][j].realStartAngle - statData[i][j].segmentAngle + setOptionValue(false,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + if (setOptionValue(false,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 1) labelRadius = dataCutoutRadius + setOptionValue(false,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(false,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 2) labelRadius = dataCutoutRadius + (dataDoughnutRadius - dataCutoutRadius) / 2 + setOptionValue(false,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + else if (setOptionValue(false,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",i,j,{nullValue : true} ) == 3) labelRadius = dataDoughnutRadius + setOptionValue(false,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ); + ctx.save(); + if (setOptionValue(false,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }) == "off-center") { + if (setOptionValue(false,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) >= 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "left"; + else ctx.textAlign = "right"; + } else if (setOptionValue(false,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }) == "to-center") { + if (setOptionValue(false,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis" || (posAngle + 2 * Math.PI) % (2 * Math.PI) >= 3 * Math.PI / 2 || (posAngle + 2 * Math.PI) % (2 * Math.PI) <= Math.PI / 2) ctx.textAlign = "right"; + else ctx.textAlign = "left"; + } else ctx.textAlign = setOptionValue(false,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + if (setOptionValue(false,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ) == "off-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "top"; + else ctx.textBaseline = "bottom"; + } else if (setOptionValue(false,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ) == "to-center") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI) ctx.textBaseline = "bottom"; + else ctx.textBaseline = "top"; + } else ctx.textBaseline = setOptionValue(false,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(false,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(false,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(false,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(false,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(false,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); + ctx.translate(midPieX + labelRadius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle)); + var rotateVal=0; + if (setOptionValue(false,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxis") rotateVal=2 * Math.PI - posAngle; + else if (setOptionValue(false,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) == "inRadiusAxisRotateLabels") { + if ((posAngle + 2 * Math.PI) % (2 * Math.PI) > Math.PI / 2 && (posAngle + 2 * Math.PI) % (2 * Math.PI) < 3 * Math.PI / 2) rotateVal=3 * Math.PI - posAngle; + else rotateVal=2 * Math.PI - posAngle; + } else rotateVal=setOptionValue(false,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); + ctx.rotate(rotateVal); + setTextBordersAndBackground(ctx,dispString,setOptionValue(false,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(false,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(false,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(false,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(false,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(false,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(false,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(false,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(false,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,midPieX + labelRadius * Math.cos(posAngle), midPieY - labelRadius * Math.sin(posAngle),i,j); + ctx.restore(); + } } } } if(msr.legendMsr.dispLegend)drawLegend(msr.legendMsr,data,config,ctx,"Doughnut"); }; - + return { + data:data, + config:config, + ctx:ctx + }; }; + + + + var Line = function(data, config, ctx) { var maxSize, scaleHop, scaleHop2, calculatedScale, calculatedScale2, labelHeight, scaleHeight, valueBounds, labelTemplateString, labelTemplateString2; var valueHop, widestXLabel, xAxisLength, yAxisPosX, xAxisPosY, rotateLabels = 0, @@ -2839,7 +3180,7 @@ window.Chart = function(context) { } 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, height, width, "nihil", [""], false, false, true, true, config.datasetFill, "Line"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, "nihil", [""], false, false, true, true, config.datasetFill, "Line"); valueBounds = getValueBounds(); // true or fuzzy (error for negativ values (included 0)) if (config.logarithmic !== false) { @@ -2870,9 +3211,9 @@ window.Chart = function(context) { calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); } } else { - var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); - var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); - var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + var scaleStartValue= setOptionValue(true,true,1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(true,true,1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,"scaleSteps",-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(true,true,1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue : true} ); calculatedScale = { steps: scaleSteps, stepValue: scaleStepWidth, @@ -2889,9 +3230,9 @@ window.Chart = function(context) { calculatedScale2 = calculateScale(2, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue2, valueBounds.minValue2, labelTemplateString2); } } else { - var scaleStartValue2= setOptionValue(1,"SCALESTARTVALUE2",ctx,data,statData,undefined,config.scaleStartValue2,-1,-1,{nullValue : true} ); - var scaleSteps2 =setOptionValue(1,"SCALESTEPS2",ctx,data,statData,undefined,config.scaleSteps2,-1,-1,{nullValue : true} ); - var scaleStepWidth2 = setOptionValue(1,"SCALESTEPWIDTH2",ctx,data,statData,undefined,config.scaleStepWidth2,-1,-1,{nullValue : true} ); + var scaleStartValue2= setOptionValue(true,true,1,"SCALESTARTVALUE2",ctx,data,statData,undefined,config.scaleStartValue2,"scaleStartValue2",-1,-1,{nullValue : true} ); + var scaleSteps2 =setOptionValue(true,true,1,"SCALESTEPS2",ctx,data,statData,undefined,config.scaleSteps2,"scaleSteps2",-1,-1,{nullValue : true} ); + var scaleStepWidth2 = setOptionValue(true,true,1,"SCALESTEPWIDTH2",ctx,data,statData,undefined,config.scaleStepWidth2,"scaleStepWidth2",-1,-1,{nullValue : true} ); calculatedScale2 = { steps: scaleSteps2, @@ -2912,7 +3253,7 @@ window.Chart = function(context) { } } if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, calculatedScale2.labels, false, false, true, true, config.datasetFill, "Line"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, calculatedScale2.labels, false, false, true, true, 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); @@ -2928,12 +3269,9 @@ window.Chart = function(context) { yAxisPosX = msr.leftNotUsableSize + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); xAxisPosY = msr.topNotUsableSize + msr.availableHeight + Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop); drawLabels(); - if (valueBounds.minValue < 0) { - zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, scaleHop); - } - if (valueBounds.minValue2 < 0) { - zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); - } + + zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, scaleHop); + if(typeof calculatedScale2 ==="object")zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); initPassVariableData_part2(statData,data,config,ctx,{ xAxisPosY : xAxisPosY, yAxisPosX : yAxisPosX, @@ -2951,6 +3289,7 @@ window.Chart = function(context) { 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; } @@ -2995,9 +3334,7 @@ window.Chart = function(context) { case "0": case 0: // check if zero exists - if (zeroY != 0) { - yPosXScale = xAxisPosY - zeroY; - } + if (zeroY != 0) yPosXScale = xAxisPosY - zeroY; break; } // draw the scale line @@ -3162,9 +3499,9 @@ window.Chart = function(context) { } } - if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + if(typeof config.graphMin=="function")lowerValue= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,"graphMin",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; - if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + if(typeof config.graphMax=="function") upperValue= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,"graphMax",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax)) upperValue = config.graphMax; if (secondAxis) { if(upperValue20 && valueBounds.minSteps>0) { //Check and set the scale labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; if (!config.scaleOverride) { calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); } else { - var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); - var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); - var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + var scaleStartValue= setOptionValue(true,true,1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(true,true,1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,"scaleSteps",-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(true,true,1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue : true} ); calculatedScale = { steps: scaleSteps, @@ -3247,7 +3589,7 @@ window.Chart = function(context) { },config)); } } - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, null, true, false, true, true, true, "StackedBar"); } var prevHeight=msr.availableHeight; @@ -3276,8 +3618,9 @@ window.Chart = function(context) { var zeroY = 0; var zeroY2 = 0; - if (valueBounds.minValue < 0) zeroY = calculateOffset(false, 0, calculatedScale, scaleHop); - if (valueBounds.minValue2 < 0) zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); + + zeroY = calculateOffset(false, 0, calculatedScale, scaleHop); + if(typeof calculatedScale2 ==="object") zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); drawLabels(); initPassVariableData_part2(statData,data,config,ctx,{ msr: msr, @@ -3296,41 +3639,55 @@ window.Chart = function(context) { 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; } function drawBars(animPc) { - ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); + var prevTopPos = new Array(); + var prevTopNeg = new Array(); + for (var i = 0; i < data.datasets.length; i++) { if(data.datasets[i].type=="Line") continue; for (var j = 0; j < data.datasets[i].data.length; j++) { - var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; + var currentAnimPc = animationCorrection(animPc, data, config, i, j, false).animVal; if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; if ((typeof data.datasets[i].data[j] == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; - var botBar, topBar; - if(config.animationByDataset) { - botBar=statData[i][j].yPosBottom; - topBar=statData[i][j].yPosTop; - topBar=botBar+currentAnimPc*(topBar-botBar); - } else { - botBar=statData[statData[i][j].firstNotMissing][j].yPosBottom - currentAnimPc*(statData[statData[i][j].firstNotMissing][j].yPosBottom-statData[i][j].yPosBottom); - topBar=statData[statData[i][j].firstNotMissing][j].yPosBottom - currentAnimPc*(statData[statData[i][j].firstNotMissing][j].yPosBottom-statData[i][j].yPosTop); + if(typeof prevTopPos[j]=="undefined"){ + prevTopPos[j]=statData[statData[i][j].firstNotMissing][j].yPosBottom; + prevTopNeg[j]=statData[statData[i][j].firstNotMissing][j].yPosBottom; } - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : botBar, xPosRight : statData[i][j].xPosRight, yPosTop : topBar} ); - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + var botBar, topBar; + if(1*data.datasets[i].data[j] > 0) botBar=prevTopPos[j]; + else botBar=prevTopNeg[j]; + topBar=botBar+currentAnimPc*(statData[i][j].yPosTop-statData[i][j].yPosBottom); + if(1*data.datasets[i].data[j] > 0) prevTopPos[j]=topBar; + else prevTopNeg[j]=topBar; + + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + + ctx.save(); + ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[i].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : botBar, xPosRight : statData[i][j].xPosRight, yPosTop : topBar} )); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : botBar, xPosRight : statData[i][j].xPosRight, yPosTop : topBar} ); + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,j,{nullvalue : null} ); + if(currentAnimPc !=0 && botBar!=topBar) { ctx.beginPath(); - ctx.moveTo(statData[i][j].xPosLeft, botBar); + ctx.moveTo(statData[i][j].xPosLeft, botBar+(topBar-botBar)/2); ctx.lineTo(statData[i][j].xPosLeft, topBar); ctx.lineTo(statData[i][j].xPosRight, topBar); ctx.lineTo(statData[i][j].xPosRight, botBar); + ctx.lineTo(statData[i][j].xPosLeft, botBar); + ctx.lineTo(statData[i][j].xPosLeft, botBar+(topBar-botBar)/2); if (config.barShowStroke) { - ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); }; ctx.closePath(); ctx.fill(); } + ctx.restore(); } } drawLinesDataset(animPc, data, config, ctx, statData,{xAxisPosY : xAxisPosY,yAxisPosX : yAxisPosX, valueHop : valueHop, nbValueHop : data.labels.length }); @@ -3340,41 +3697,41 @@ window.Chart = function(context) { xPos = 0; for (i = 0; i < data.datasets.length; i++) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if (typeof(data.datasets[i].data[j]) == 'undefined') continue; -// if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i, j, statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,i,j,{nullValue : true})]; -// } - if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i, j, statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + if(setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { ctx.save(); - ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); - ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); + ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); ctx.beginPath(); ctx.beginPath(); yPos = 0; xPos = 0; - if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { - xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { - xPos = statData[i][j].xPosLeft + barWidth / 2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { - xPos = statData[i][j].xPosLeft+ barWidth + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 2) { + xPos = statData[i][j].xPosLeft + barWidth / 2 + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosLeft+ barWidth + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); } - if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { - yPos = statData[i][j].yPosBottom - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { - yPos = (statData[i][j].yPosTop + statData[i][j].yPosBottom)/2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { - yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosBottom - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 2) { + yPos = (statData[i][j].yPosTop + statData[i][j].yPosBottom)/2 - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); } if(yPos>msr.topNotUsableSize) { ctx.translate(xPos, yPos); - var rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180); + var rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); } ctx.restore(); } @@ -3523,9 +3880,9 @@ window.Chart = function(context) { else if(inn==0) { upperValue=maxValp;lowerValue=minValp;} else { upperValue=maxValp;lowerValue=minValn; } - if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + if(typeof config.graphMin=="function")lowerValue= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,"graphMin",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; - if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + if(typeof config.graphMax=="function") upperValue= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,"graphMax",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax)) upperValue = config.graphMax; if(upperValue0 && valueBounds.minSteps>0) { @@ -3595,11 +3956,11 @@ window.Chart = function(context) { labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; if (!config.scaleOverride) { calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStackedBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStackedBar"); } else { - var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); - var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); - var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + var scaleStartValue= setOptionValue(true,true,1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(true,true,1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,"scaleSteps",-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(true,true,1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue : true} ); calculatedScale = { steps: scaleSteps, @@ -3614,7 +3975,7 @@ window.Chart = function(context) { },config)); } } - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStackedBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalStackedBar"); } 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); @@ -3636,7 +3997,7 @@ window.Chart = function(context) { } else additionalSpaceBetweenBars=0; drawLabels(); - zeroY= HorizontalCalculateOffset(0 , calculatedScale, scaleHop); + var zeroY= HorizontalCalculateOffset(0 , calculatedScale, scaleHop); initPassVariableData_part2(statData,data,config,ctx,{ yAxisPosX : yAxisPosX, additionalSpaceBetweenBars : additionalSpaceBetweenBars, @@ -3651,6 +4012,7 @@ window.Chart = function(context) { 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; } function HorizontalCalculateOffset(val, calculatedScale, scaleHop) { var outerValue = calculatedScale.steps * calculatedScale.stepValue; @@ -3660,34 +4022,54 @@ window.Chart = function(context) { }; function drawBars(animPc) { - ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); + var prevLeftPos = new Array(); + var prevLeftNeg = new Array(); + +// ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); for (var i = 0; i < data.datasets.length; i++) { for (var j = 0; j < data.datasets[i].data.length; j++) { - var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; + ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[i].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",i,j,{animationValue: currentAnimPc, xPosLeft : leftBar, yPosBottom : statData[i][j].yPosBottom, xPosRight : rightBar, yPosTop : statData[i][j].yPosBottom} )); + var currentAnimPc = animationCorrection(animPc, data, config, i, j, false).animVal; if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; if ((typeof(data.datasets[i].data[j]) == 'undefined') || 1*data.datasets[i].data[j] == 0 ) continue; - var leftBar, rightBar; - if(config.animationByDataset) { - leftBar= statData[i][j].xPosLeft; - rightBar= statData[i][j].xPosRight; - rightBar=leftBar+currentAnimPc*(rightBar-leftBar); - } else { - leftBar=statData[statData[i][j].firstNotMissing][j].xPosLeft + currentAnimPc*(statData[i][j].xPosLeft-statData[statData[i][j].firstNotMissing][j].xPosLeft); - rightBar=statData[statData[i][j].firstNotMissing][j].xPosLeft + currentAnimPc*(statData[i][j].xPosRight-statData[statData[i][j].firstNotMissing][j].xPosLeft); + if(typeof prevLeftPos[j]=="undefined"){ + prevLeftPos[j]=statData[statData[i][j].firstNotMissing][j].xPosLeft; + prevLeftNeg[j]=statData[statData[i][j].firstNotMissing][j].xPosLeft; } - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : leftBar, yPosBottom : statData[i][j].yPosBottom, xPosRight : rightBar, yPosTop : statData[i][j].yPosBottom} ); - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + var leftBar, rightBar; +//// if(config.animationByDataset) { +//// leftBar= statData[i][j].xPosLeft; +//// rightBar= statData[i][j].xPosRight; +//// rightBar=leftBar+currentAnimPc*(rightBar-leftBar); +//// } else { + if(1*data.datasets[i].data[j] > 0) leftBar=prevLeftPos[j]; + else leftBar=prevLeftNeg[j]; +// leftBar=statData[statData[i][j].firstNotMissing][j].xPosLeft + currentAnimPc*(statData[i][j].xPosLeft-statData[statData[i][j].firstNotMissing][j].xPosLeft); +// rightBar=statData[statData[i][j].firstNotMissing][j].xPosLeft + currentAnimPc*(statData[i][j].xPosRight-statData[statData[i][j].firstNotMissing][j].xPosLeft); + rightBar=leftBar+currentAnimPc*(statData[i][j].xPosRight-statData[i][j].xPosLeft); + + if(1*data.datasets[i].data[j] > 0) prevLeftPos[j]=rightBar; + else prevLeftNeg[j]=rightBar; +//// } + + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc, xPosLeft : leftBar, yPosBottom : statData[i][j].yPosBottom, xPosRight : rightBar, yPosTop : statData[i][j].yPosBottom} ); + + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,j,{nullvalue : null} ); if(currentAnimPc !=0 && statData[i][j].xPosLeft!=statData[i][j].xPosRight ) { ctx.beginPath(); - ctx.moveTo(leftBar, statData[i][j].yPosTop); + ctx.moveTo(leftBar+(rightBar-leftBar)/2, statData[i][j].yPosTop); ctx.lineTo(rightBar, statData[i][j].yPosTop); ctx.lineTo(rightBar, statData[i][j].yPosBottom); ctx.lineTo(leftBar, statData[i][j].yPosBottom); ctx.lineTo(leftBar, statData[i][j].yPosTop); + ctx.lineTo(leftBar+(rightBar-leftBar)/2, statData[i][j].yPosTop); if (config.barShowStroke){ - ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); } @@ -3701,40 +4083,40 @@ window.Chart = function(context) { xPos = 0; for (i = 0; i < data.datasets.length; i++) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if ((typeof(data.datasets[i].data[j]) == 'undefined')) continue; -// if (setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j, statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,i,j,{nullValue : true})]; -// } - if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j, statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + if(setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { ctx.save(); - ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); - ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ),statData[i][j],config); + ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ),statData[i][j],config); ctx.beginPath(); yPos = 0; xPos = 0; - if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { - xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { - xPos = statData[i][j].xPosLeft + (statData[i][j].xPosRight-statData[i][j].xPosLeft)/2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { - xPos = statData[i][j].xPosRight + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 2) { + xPos = statData[i][j].xPosLeft + (statData[i][j].xPosRight-statData[i][j].xPosLeft)/2 + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosRight + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); } - if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { - yPos = statData[i][j].yPosBottom - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { - yPos = statData[i][j].yPosBottom - barWidth / 2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { - yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosBottom - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 2) { + yPos = statData[i][j].yPosBottom - barWidth / 2 - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); } // if(xPos<=msr.availableWidth+msr.leftNotUsableSize) { ctx.translate(xPos, yPos); - rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180); + rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); ctx.restore(); // } } @@ -3898,9 +4280,9 @@ window.Chart = function(context) { } } }; - if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + if(typeof config.graphMin=="function")lowerValue= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,"graphMin",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; - if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + if(typeof config.graphMax=="function") upperValue= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,"graphMax",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax)) upperValue = config.graphMax; if(upperValue0 && valueBounds.minSteps>0) { - // true or fuzzy (error for negativ values (included 0)) if (config.logarithmic !== false) { if (valueBounds.minValue <= 0) { @@ -3983,9 +4368,9 @@ window.Chart = function(context) { if (!config.scaleOverride) { calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); } else { - var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); - var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); - var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + var scaleStartValue= setOptionValue(true,true,1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(true,true,1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,"scaleSteps",-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(true,true,1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue : true} ); calculatedScale = { steps: scaleSteps, @@ -4000,9 +4385,9 @@ window.Chart = function(context) { if (!config.scaleOverride2) { calculatedScale2 = calculateScale(2, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue2, valueBounds.minValue2, labelTemplateString2); } else { - var scaleStartValue2= setOptionValue(1,"SCALESTARTVALUE2",ctx,data,statData,undefined,config.scaleStartValue2,-1,-1,{nullValue : true} ); - var scaleSteps2 =setOptionValue(1,"SCALESTEPS2",ctx,data,statData,undefined,config.scaleSteps2,-1,-1,{nullValue : true} ); - var scaleStepWidth2 = setOptionValue(1,"SCALESTEPWIDTH2",ctx,data,statData,undefined,config.scaleStepWidth2,-1,-1,{nullValue : true} ); + var scaleStartValue2= setOptionValue(true,true,1,"SCALESTARTVALUE2",ctx,data,statData,undefined,config.scaleStartValue2,"scaleStartValue2",-1,-1,{nullValue : true} ); + var scaleSteps2 =setOptionValue(true,true,1,"SCALESTEPS2",ctx,data,statData,undefined,config.scaleSteps2,"scaleSteps2",-1,-1,{nullValue : true} ); + var scaleStepWidth2 = setOptionValue(true,true,1,"SCALESTEPWIDTH2",ctx,data,statData,undefined,config.scaleStepWidth2,"scaleStepWidth2",-1,-1,{nullValue : true} ); calculatedScale2 = { steps: scaleSteps2, @@ -4022,7 +4407,7 @@ window.Chart = function(context) { labels: null } } - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, calculatedScale2.labels, true, false, true, true, true, "Bar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, calculatedScale2.labels, true, false, true, true, true, "Bar"); var prevHeight=msr.availableHeight; @@ -4049,14 +4434,9 @@ window.Chart = function(context) { barWidth=1*config.maxBarWidth; } else additionalSpaceBetweenBars=0; - var zeroY = 0; var zeroY2 = 0; - if (valueBounds.minValue < 0) { - zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, scaleHop); - } - if (valueBounds.minValue2 < 0) { - zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); - } + var zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, scaleHop); + if(typeof calculatedScale2 ==="object") zeroY2 = calculateOffset(config.logarithmic2, 0, calculatedScale2, scaleHop2); initPassVariableData_part2(statData,data,config,ctx,{ msr: msr, yAxisPosX : yAxisPosX, @@ -4076,68 +4456,102 @@ window.Chart = function(context) { 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; } function drawBars(animPc) { - var t1, t2, t3; + var t1, t2, t3, complementaryBar; - ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); for (var i = 0; i < data.datasets.length; i++) { if(data.datasets[i].type=="Line") continue; for (var j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; + ctx.save(); + ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[i].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} )); if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { - var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + var currentAnimPc = animationCorrection(animPc, data, config, i, j, false).animVal; if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; - var barHeight = currentAnimPc * (statData[i][j].barHeight) + (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} ); - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + var barHeight = currentAnimPc * (statData[i][j].barHeight) + (Math.ceil(ctx.chartLineScale*ctx.lineWidth) / 2); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} ); + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,j,{nullvalue : null} ); roundRect(ctx, statData[i][j].xPosLeft, statData[i][j].yPosBottom, barWidth, barHeight, config.barShowStroke, config.barBorderRadius,i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); } + ctx.restore(); } } + + // complementary bar; + + for (var i = 0; i < data.datasets.length; i++) { + if(data.datasets[i].type=="Line") continue; + for (var j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; + complementaryBar=setOptionValue(true,true,1,"COMPLEMENTARYBAR",ctx,data,statData,data.datasets[i].complementaryBar,config.complementaryBar,"complementaryBar",i,j,{nullvalue : null} ); + if(complementaryBar == false)continue; + ctx.save(); + ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[i].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} )); + var currentAnimPc = animationCorrection(animPc, data, config, i, j, false).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { + var barHeight = currentAnimPc * (statData[i][j].barHeight) + (Math.ceil(ctx.chartLineScale*ctx.lineWidth) / 2); + } else barHeight=0; + if (1 * data.datasets[i].data[j]<0) { + otherBarHeight=-(statData[i][j].yPosBottom-msr.clry)-barHeight+ctx.lineWidth/2 + Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + } else { + otherBarHeight=(statData[i][j].yPosBottom-msr.clry)-barHeight-ctx.lineWidth/2; + } + ctx.fillStyle=setOptionValue(true,true,1,"COMPLEMENTARYCOLOR",ctx,data,statData,data.datasets[i].complementaryColor,config.complementaryColor,"complementaryColor",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom-barHeight, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight-otherBarHeight}); + ctx.strokeStyle=setOptionValue(true,true,1,"COMPLEMENTARYSTROKECOLOR",ctx,data,statData,data.datasets[i].complementaryStrokeColor,config.complementaryStrokeColor,"strokeColor",i,j,{nullvalue : null} ); + roundRect(ctx, statData[i][j].xPosLeft, statData[i][j].yPosBottom-barHeight, barWidth,otherBarHeight, config.barShowStroke, config.barBorderRadius,i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); + ctx.restore(); + } + } + drawLinesDataset(animPc, data, config, ctx, statData,{xAxisPosY : xAxisPosY,yAxisPosX : yAxisPosX, valueHop : valueHop, nbValueHop : data.labels.length }); if (animPc >= config.animationStopValue) { for (i = 0; i < data.datasets.length; i++) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if (typeof(data.datasets[i].data[j]) == 'undefined') continue; if (data.datasets[i].type == "Line") continue; -// if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i , j, statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,i,j,{nullValue : true})]; -// } - if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i , j, statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + if(setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { ctx.save(); - ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); - ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); t1 = statData[i][j].yPosBottom; t2 = statData[i][j].yPosTop; ctx.beginPath(); var yPos = 0, xPos = 0; - if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { - xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { - xPos = statData[i][j].xPosLeft + barWidth / 2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { - xPos = statData[i][j].xPosLeft + barWidth + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 2) { + xPos = statData[i][j].xPosLeft + barWidth / 2 + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosLeft + barWidth + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); } - if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { - yPos = statData[i][j].yPosBottom - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { - yPos = (statData[i][j].yPosBottom+statData[i][j].yPosTop)/2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { - yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosBottom - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 2) { + yPos = (statData[i][j].yPosBottom+statData[i][j].yPosTop)/2 - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); } ctx.translate(xPos, yPos); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); - rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); + rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); ctx.restore(); } } @@ -4161,16 +4575,15 @@ window.Chart = function(context) { function roundRect(ctx, x, y, w, h, stroke, radius,i,j,fact) { ctx.beginPath(); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); - ctx.moveTo(x + radius, y); - ctx.lineTo(x + w - radius, y); - ctx.quadraticCurveTo(x + w, y, x + w, y); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); + ctx.moveTo(x + (w/2), y); + ctx.lineTo(x + w , y); ctx.lineTo(x + w, y - h + fact*radius); ctx.quadraticCurveTo(x + w, y - h, x + w - radius, y - h); ctx.lineTo(x + radius, y - h); ctx.quadraticCurveTo(x, y - h, x, y - h + fact*radius); ctx.lineTo(x, y); - ctx.quadraticCurveTo(x, y, x + radius, y); + ctx.lineTo(x + (w/2), y); if (stroke) ctx.stroke(); ctx.closePath(); ctx.fill(); @@ -4341,9 +4754,9 @@ window.Chart = function(context) { lowerValue=lowerValue*1.1; } } - if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) + if(typeof config.graphMin=="function")lowerValue= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,"graphMin",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; - if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + if(typeof config.graphMax=="function") upperValue= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,"graphMax",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax)) upperValue = config.graphMax; if (secondAxis) { @@ -4358,9 +4771,9 @@ window.Chart = function(context) { lowerValue2=lowerValue2*1.1; } } - if(typeof config.graphMin2=="function")lowerValue2= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin2,-1,-1,{nullValue : true}) + if(typeof config.graphMin2=="function")lowerValue2= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin2,"graphMin2",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMin2)) lowerValue2 = config.graphMin2; - if(typeof config.graphMax2=="function") upperValue2= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax2,-1,-1,{nullValue : true}) + if(typeof config.graphMax2=="function") upperValue2= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax2,"graphMax2",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax2)) upperValue2 = config.graphMax2; } if (!firstAxis && secondAxis) { @@ -4384,6 +4797,12 @@ window.Chart = function(context) { minSteps: minSteps }; }; + + return { + data:data, + config:config, + ctx:ctx + }; }; var HorizontalBar = function(data, config, ctx) { @@ -4401,7 +4820,7 @@ window.Chart = function(context) { var statData=initPassVariableData_part1(data,config,ctx); - msr = setMeasures(data, config, ctx, height, width, "nihil", [""], true, true, true, true, true, "StackedBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, "nihil", [""], true, true, true, true, true, "StackedBar"); valueBounds = getValueBounds(); if(valueBounds.minValue<=0)config.logarithmic=false; if(valueBounds.maxSteps>0 && valueBounds.minSteps>0) { @@ -4414,11 +4833,11 @@ window.Chart = function(context) { labelTemplateString = (config.scaleShowLabels) ? config.scaleLabel : ""; if (!config.scaleOverride) { calculatedScale = calculateScale(1, config, valueBounds.maxSteps, valueBounds.minSteps, valueBounds.maxValue, valueBounds.minValue, labelTemplateString); - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalBar"); } else { - var scaleStartValue= setOptionValue(1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,-1,-1,{nullValue : true} ); - var scaleSteps =setOptionValue(1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,-1,-1,{nullValue : true} ); - var scaleStepWidth = setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,-1,-1,{nullValue : true} ); + var scaleStartValue= setOptionValue(true,true,1,"SCALESTARTVALUE",ctx,data,statData,undefined,config.scaleStartValue,"scaleStartValue",-1,-1,{nullValue : true} ); + var scaleSteps =setOptionValue(true,true,1,"SCALESTEPS",ctx,data,statData,undefined,config.scaleSteps,"scaleSteps",-1,-1,{nullValue : true} ); + var scaleStepWidth = setOptionValue(true,true,1,"SCALESTEPWIDTH",ctx,data,statData,undefined,config.scaleStepWidth,"scaleStepWidth",-1,-1,{nullValue : true} ); calculatedScale = { steps: scaleSteps, @@ -4428,7 +4847,7 @@ window.Chart = function(context) { labels: [] } populateLabels(1, config, labelTemplateString, calculatedScale.labels, calculatedScale.steps, scaleStartValue, calculatedScale.graphMax, scaleStepWidth); - msr = setMeasures(data, config, ctx, height, width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalBar"); + msr = setMeasures(data, config, ctx, ctx.canvas.height, ctx.canvas.width, calculatedScale.labels, null, true, true, true, true, true, "HorizontalBar"); } 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); @@ -4450,9 +4869,7 @@ window.Chart = function(context) { } else additionalSpaceBetweenBars=0; var zeroY = 0; - if (valueBounds.minValue < 0) { - zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, valueHop); - } + zeroY = calculateOffset(config.logarithmic, 0, calculatedScale, valueHop); drawLabels(); initPassVariableData_part2(statData,data,config,ctx,{ yAxisPosX : yAxisPosX, @@ -4467,59 +4884,91 @@ window.Chart = function(context) { 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; } function drawBars(animPc) { for (var i = 0; i < data.datasets.length; i++) { for (var j = 0; j < data.datasets[i].data.length; j++) { - ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.barStrokeWidth); - var currentAnimPc = animationCorrection(animPc, data, config, i, j, 1).animVal; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; + ctx.save(); + ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[i].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} )); + var currentAnimPc = animationCorrection(animPc, data, config, i, j, false).animVal; if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; var barHeight = currentAnimPc * statData[i][j].barWidth + (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barHeight, yPosTop : statData[i][j].yPosBottom} ); - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barHeight, yPosTop : statData[i][j].yPosBottom} ); + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,j,{nullvalue : null} ); if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { roundRect(ctx, statData[i][j].yPosTop, statData[i][j].xPosLeft , barWidth, barHeight, config.barShowStroke, config.barBorderRadius, 0,i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); } + ctx.restore(); } } + + // complementary bar; + + for (var i = 0; i < data.datasets.length; i++) { + for (var j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; + complementaryBar=setOptionValue(true,true,1,"COMPLEMENTARYBAR",ctx,data,statData,data.datasets[i].complementaryBar,config.complementaryBar,"complementaryBar",i,j,{nullvalue : null} ); + if(complementaryBar == false)continue; + ctx.save(); + ctx.lineWidth=Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"BARSTROKEWIDTH",ctx,data,statData,data.datasets[i].barStrokeWidth,config.barStrokeWidth,"barStrokeWidth",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barWidth, yPosTop : statData[i][j].yPosBottom-barHeight} )); + var currentAnimPc = animationCorrection(animPc, data, config, i, j, false).animVal; + if (currentAnimPc > 1) currentAnimPc = currentAnimPc - 1; + var barHeight = currentAnimPc * statData[i][j].barWidth + (Math.ceil(ctx.chartLineScale*config.barStrokeWidth) / 2); + if (1 * data.datasets[i].data[j]<0) { + otherBarHeight=-(msr.clrwidth - ((statData[i][j].xPosLeft-msr.clrx)-barHeight))+Math.ceil(ctx.chartLineScale*config.scaleTickSizeLeft); + } else { + otherBarHeight=msr.clrwidth - ((statData[i][j].xPosLeft-msr.clrx)+barHeight+ctx.lineWidth); + } + ctx.fillStyle=setOptionValue(true,true,1,"COMPLEMENTARYCOLOR",ctx,data,statData,data.datasets[i].complementaryColor,config.complementaryColor,"complementaryColor",i,j,{animationValue: currentAnimPc, xPosLeft : statData[i][j].xPosLeft+barHeight, yPosBottom : statData[i][j].yPosBottom, xPosRight : statData[i][j].xPosLeft+barHeight+otherBarHeight, yPosTop : statData[i][j].yPosBottom}); + ctx.strokeStyle=setOptionValue(true,true,1,"COMPLEMENTARYSTROKECOLOR",ctx,data,statData,data.datasets[i].complementaryStrokeColor,config.complementaryStrokeColor,"strokeColor",i,j,{nullvalue : null} ); +// roundRect(ctx, statData[i][j].yPosTop, statData[i][j].xPosLeft , barWidth, barHeight, config.barShowStroke, config.barBorderRadius, 0,i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); + roundRect(ctx, statData[i][j].yPosTop, statData[i][j].xPosLeft+barHeight, barWidth,otherBarHeight, config.barShowStroke, config.barBorderRadius,0, i,j,(data.datasets[i].data[j] < 0 ? -1 : 1)); + ctx.restore(); + } + } + if (animPc >= config.animationStopValue) { for (i = 0; i < data.datasets.length; i++) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if (typeof(data.datasets[i].data[j]) == 'undefined') continue; -// if(setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,undefined,config.annotateDisplay,i,j,{nullValue : true})) { - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j ,statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,i,j,{nullValue : true})]; -// } - if(setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,i,j,{nullValue : true})) { + jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["RECT", i ,j ,statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + if(setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { ctx.save(); - ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); - ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); + ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); ctx.beginPath(); var yPos = 0, xPos = 0; - if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 1) { - yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ) + barWidth; - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 2) { - yPos = statData[i][j].yPosTop + barWidth / 2 - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,i,j,{nullValue : true} ) == 3) { - yPos = statData[i][j].yPosTop - setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 1) { + yPos = statData[i][j].yPosTop - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ) + barWidth; + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 2) { + yPos = statData[i][j].yPosTop + barWidth / 2 - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAYPOSITION",ctx,data,statData,undefined,config.inGraphDataYPosition,"inGraphDataYPosition",i,j,{nullValue : true} ) == 3) { + yPos = statData[i][j].yPosTop - setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); } - if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 1) { - xPos = statData[i][j].xPosLeft + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 2) { - xPos = (statData[i][j].xPosLeft+statData[i][j].xPosRight)/2 + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); - } else if (setOptionValue(1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,i,j,{nullValue : true} ) == 3) { - xPos = statData[i][j].xPosRight + setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ); + if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 1) { + xPos = statData[i][j].xPosLeft + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 2) { + xPos = (statData[i][j].xPosLeft+statData[i][j].xPosRight)/2 + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); + } else if (setOptionValue(true,true,1,"INGRAPHDATAXPOSITION",ctx,data,statData,undefined,config.inGraphDataXPosition,"inGraphDataXPosition",i,j,{nullValue : true} ) == 3) { + xPos = statData[i][j].xPosRight + setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ); } ctx.translate(xPos, yPos); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); - var rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); + var rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,xPos, yPos,i,j); ctx.restore(); } } @@ -4530,17 +4979,17 @@ window.Chart = function(context) { function roundRect(ctx, x, y, w, h, stroke, radius, zeroY,i,j,fact) { ctx.beginPath(); - ctx.moveTo(y + zeroY, x + radius); - ctx.lineTo(y + zeroY, x + w - radius); - ctx.quadraticCurveTo(y + zeroY, x + w, y + zeroY, x + w); + ctx.moveTo(y + zeroY, x ); + ctx.lineTo(y + zeroY, x + w); ctx.lineTo(y + h - fact*radius, x + w); ctx.quadraticCurveTo(y + h, x + w, y + h, x + w - radius); ctx.lineTo(y + h, x + radius); ctx.quadraticCurveTo(y + h, x, y + h - fact*radius, x); ctx.lineTo(y + zeroY, x); - ctx.quadraticCurveTo(y + zeroY, x, y + zeroY, x + radius); + ctx.quadraticCurveTo(y + zeroY, x, y + zeroY, x + w); + if (stroke) { - ctx.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"STROKESTYLE",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); }; @@ -4676,9 +5125,9 @@ window.Chart = function(context) { } } // AJOUT CHANGEMENT - if(typeof config.graphMin=="function")lowerValue= setOptionValue(1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,-1,-1,{nullValue : true}) - else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; - if(typeof config.graphMax=="function") upperValue= setOptionValue(1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,-1,-1,{nullValue : true}) + if(typeof config.graphMin=="function")lowerValue= setOptionValue(true,true,1,"GRAPHMIN",ctx,data,statData,undefined,config.graphMin,"graphMin",-1,-1,{nullValue : true}) + else if (!isNaN(config.graphMin)) lowerValue = config.graphMin; + if(typeof config.graphMax=="function") upperValue= setOptionValue(true,true,1,"GRAPHMAX",ctx,data,statData,undefined,config.graphMax,"graphMax",-1,-1,{nullValue : true}) else if (!isNaN(config.graphMax)) upperValue = config.graphMax; labelHeight = (Math.ceil(ctx.chartTextScale*config.scaleFontSize)); @@ -4694,6 +5143,12 @@ window.Chart = function(context) { minSteps: minSteps }; }; + + return { + data:data, + config:config, + ctx:ctx + }; }; function calculateOffset(logarithmic, val, calculatedScale, scaleHop) { @@ -4728,14 +5183,18 @@ window.Chart = function(context) { var beginAnim = cntiter; var beginAnimPct = percentAnimComplete; if (typeof drawScale !== "function") drawScale = function() {}; - if (config.clearRect) requestAnimFrame(animLoop); - else animLoop(); + if (config.clearRect) { + if(config.animationForceSetTimeOut)requestAnimFrameSetTimeOut(animLoop); + else requestAnimFrame(animLoop); + } else animLoop(); function animateFrame() { var easeAdjustedAnimationPercent = (config.animation) ? CapValue(easingFunction(percentAnimComplete), null, 0) : 1; - if (1 * cntiter >= 1 * CapValue(config.animationSteps, Number.MAX_VALUE, 1) || config.animation == false || ctx.firstPass==3 || ctx.firstPass==4 || ctx.firstPass==8 || ctx.firstPass==9) easeAdjustedAnimationPercent = 1; + if (1 * cntiter >= 1 * CapValue(config.animationSteps, Number.MAX_VALUE, 1) || config.animation == false || ctx.firstPass%10!=1) easeAdjustedAnimationPercent = 1; else if (easeAdjustedAnimationPercent >= 1) easeAdjustedAnimationPercent = 0.9999; - if (config.animation && !(isIE() < 9 && isIE() != false) && config.clearRect) ctx.clearRect(clrx, clry, clrwidth, clrheight); + if (config.animation && !(isIE() < 9 && isIE() != false) && config.clearRect) { + ctx.clearRect(clrx, clry, clrwidth, clrheight); + } dispCrossImage(ctx, config, midPosX, midPosY, borderX, borderY, false, data, easeAdjustedAnimationPercent, cntiter); dispCrossText(ctx, config, midPosX, midPosY, borderX, borderY, false, data, easeAdjustedAnimationPercent, cntiter); if(typeof config.beforeDrawFunction == "function") config.beforeDrawFunction("BEFOREDRAWFUNCTION",ctx,data,statData,-1,-1,{animationValue : easeAdjustedAnimationPercent, cntiter: cntiter, config : config, borderX : borderX, borderY : borderY, midPosX : midPosX, midPosY : midPosY}); @@ -4758,18 +5217,20 @@ window.Chart = function(context) { //We need to check if the animation is incomplete (less than 1), or complete (1). cntiter += multAnim; percentAnimComplete += multAnim * animFrameAmount; - if (cntiter == config.animationSteps || config.animation == false || ctx.firstPass==3 || ctx.firstPass==4 || ctx.firstPass==8 || ctx.firstPass==9) percentAnimComplete = 1; + if (cntiter == config.animationSteps || config.animation == false || ctx.firstPass%10!=1) percentAnimComplete = 1; else if (percentAnimComplete >= 1) percentAnimComplete = 0.999; animateFrame(); //Stop the loop continuing forever if (multAnim == -1 && cntiter <= beginAnim) { - if (typeof config.onAnimationComplete == "function" && ctx.runanimationcompletefunction==true) config.onAnimationComplete(ctx, config, data, 0, animationCount + 1); + if (typeof config.onAnimationComplete == "function" && ctx.runanimationcompletefunction==true) config.onAnimationComplete(ctx, config, data, 0, animationCount + 1,statData); multAnim = 1; - requestAnimFrame(animLoop); + if(config.animationForceSetTimeOut)requestAnimFrameSetTimeOut(animLoop); + else requestAnimFrame(animLoop); } else if (percentAnimComplete < config.animationStopValue) { - requestAnimFrame(animLoop); + if(config.animationForceSetTimeOut)requestAnimFrameSetTimeOut(animLoop); + else requestAnimFrame(animLoop); } else { - if ((animationCount < config.animationCount || config.animationCount == 0) && (ctx.firstPass ==1 || ctx.firstPass!=2)) { + if ((animationCount < config.animationCount || config.animationCount == 0) && (ctx.firstPass%10==1)) { animationCount++; if (config.animationBackward && multAnim == 1) { percentAnimComplete -= animFrameAmount; @@ -4781,12 +5242,14 @@ window.Chart = function(context) { } window.setTimeout(animLoop, config.animationPauseTime*1000); } else { - if(!testRedraw(ctx,data,config) ) { + if(!testRedraw(ctx,data,config)) { if (typeof config.onAnimationComplete == "function" && ctx.runanimationcompletefunction==true) { - config.onAnimationComplete(ctx, config, data, 1, animationCount + 1); + config.onAnimationComplete(ctx, config, data, 1, animationCount + 1,statData); + ctx.runanimationcompletefunction=false; } } + ctx.firstPass=9; } } @@ -4804,6 +5267,10 @@ window.Chart = function(context) { window.setTimeout(callback, 1000 / 60); }; })(); + var requestAnimFrameSetTimeOut = (function() { + return function(callback) { window.setTimeout(callback, 1000 / 60); }; + })(); + function calculateScale(axis, config, maxSteps, minSteps, maxValue, minValue, labelTemplateString) { var graphMin, graphMax, graphRange, stepValue, numberOfSteps, valueRange, rangeOrderOfMagnitude, decimalNum; @@ -5113,7 +5580,7 @@ window.Chart = function(context) { if (typeof config.crossTextFunction == "function") disptxt = config.crossTextFunction(i, config.crossText[i], ctx, config, posX, posY, borderX, borderY, overlay, data, animPC); } else disptxt = config.crossText[i]; - setTextBordersAndBackground(ctx,disptxt,Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])]),0,0,config.crossTextBorders[Min([i, config.crossTextBorders.length - 1])],config.crossTextBordersColor[Min([i, config.crossTextBordersColor.length - 1])],Math.ceil(ctx.chartLineScale*config.crossTextBordersWidth[Min([i, config.crossTextBordersWidth.length - 1])]),Math.ceil(ctx.chartSpaceScale*config.crossTextBordersXSpace[Min([i, config.crossTextBordersXSpace.length - 1])]),Math.ceil(ctx.chartSpaceScale*config.crossTextBordersYSpace[Min([i, config.crossTextBordersYSpace.length - 1])]),config.crossTextBordersStyle[Min([i, config.crossTextBordersStyle.length - 1])],config.crossTextBackgroundColor[Min([i, config.crossTextBackgroundColor.length - 1])],"CROSSTEXT"); + setTextBordersAndBackground(ctx,disptxt,Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])]),0,0,config.crossTextBorders[Min([i, config.crossTextBorders.length - 1])],config.crossTextBordersColor[Min([i, config.crossTextBordersColor.length - 1])],Math.ceil(ctx.chartLineScale*config.crossTextBordersWidth[Min([i, config.crossTextBordersWidth.length - 1])]),Math.ceil(ctx.chartSpaceScale*config.crossTextBordersXSpace[Min([i, config.crossTextBordersXSpace.length - 1])]),Math.ceil(ctx.chartSpaceScale*config.crossTextBordersYSpace[Min([i, config.crossTextBordersYSpace.length - 1])]),config.crossTextBordersStyle[Min([i, config.crossTextBordersStyle.length - 1])],config.crossTextBackgroundColor[Min([i, config.crossTextBackgroundColor.length - 1])],"CROSSTEXT",config.crossTextBordersRadius); if((animPC==1 && config.crossTextIter[Min([i, config.crossTextIter.length - 1])] == "all") || config.crossTextIter[Min([i, config.crossTextIter.length - 1])] != "last") { ctx.fillTextMultiLine(disptxt, 0, 0, ctx.textBaseline, Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])]),true,config.detectMouseOnText,ctx,"CROSSTEXT_TEXTMOUSE",rotateVal,1 * txtposx, 1 * txtposy,i,-1); } else ctx.fillTextMultiLine(disptxt, 0, 0, ctx.textBaseline, Math.ceil(ctx.chartTextScale*config.crossTextFontSize[Min([i, config.crossTextFontSize.length - 1])]),true,false,ctx,"CROSSTEXT_TEXTMOUSE",rotateVal,1 * txtposx, 1 * txtposy,i,-1); @@ -5224,7 +5691,17 @@ window.Chart = function(context) { } }; //**************************************************************************************** - function setMeasures(data, config, ctx, height, width, ylabels, ylabels2, reverseLegend, reverseAxis, drawAxis, drawLegendOnData, legendBox, typegraph) { + function setMeasures(data, config, ctx, canvasheight, canvaswidth, ylabels, ylabels2, reverseLegend, reverseAxis, drawAxis, drawLegendOnData, legendBox, typegraph) { + + var height=canvasheight; + var width=canvaswidth; + if (window.devicePixelRatio>1) { + height=height/window.devicePixelRatio; + width=width/window.devicePixelRatio; + } + + + if (config.canvasBackgroundColor != "none") ctx.canvas.style.background = config.canvasBackgroundColor; var borderWidth = 0; var xAxisLabelPos = 0; @@ -5262,7 +5739,7 @@ window.Chart = function(context) { var xLabelPos = 0; var legendBorderWidth = 0; var legendBorderHeight = 0; - + ctx.widthAtSetMeasures=width; ctx.heightAtSetMeasures=height; @@ -5680,15 +6157,12 @@ window.Chart = function(context) { if (borderWidth > 0) { ctx.save(); ctx.beginPath(); - ctx.lineWidth = 2 * borderWidth; ctx.setLineDash(lineStyleFn(config.canvasBordersStyle)); ctx.strokeStyle = config.canvasBordersColor; - ctx.moveTo(0, 0); - ctx.lineTo(0, height); - ctx.lineTo(width, height); - ctx.lineTo(width, 0); - ctx.lineTo(0, 0); - ctx.stroke(); + ctx.lineWidth = borderWidth; + ctx.setLineDash(lineStyleFn(config.canvasBordersStyle)); + ctx.strokeStyle = config.canvasBordersColor; + ctx.drawRectangle({x:0+borderWidth/2,y:0+borderWidth/2,width:width-borderWidth,height:height-borderWidth,borderRadius:config.canvasBordersRadius,fill:false,stroke:true}) ctx.setLineDash([]); ctx.restore(); } @@ -5701,7 +6175,7 @@ window.Chart = function(context) { ctx.textAlign = "center"; ctx.textBaseline = "bottom"; - setTextBordersAndBackground(ctx,config.graphTitle,(Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)),Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2,graphTitlePosY,config.graphTitleBorders,config.graphTitleBordersColor,Math.ceil(ctx.chartLineScale*config.graphTitleBordersWidth),Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersYSpace),config.graphTitleBordersStyle,config.graphTitleBackgroundColor,"GRAPHTITLE"); + setTextBordersAndBackground(ctx,config.graphTitle,(Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)),Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2,graphTitlePosY,config.graphTitleBorders,config.graphTitleBordersColor,Math.ceil(ctx.chartLineScale*config.graphTitleBordersWidth),Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.graphTitleBordersYSpace),config.graphTitleBordersStyle,config.graphTitleBackgroundColor,"GRAPHTITLE",config.graphTitleBordersRadius); ctx.translate(Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2, graphTitlePosY); ctx.fillTextMultiLine(config.graphTitle, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.graphTitleFontSize)),true,config.detectMouseOnText,ctx,"TITLE_TEXTMOUSE",0,Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2, graphTitlePosY,-1,-1); @@ -5717,7 +6191,7 @@ window.Chart = function(context) { ctx.fillStyle = config.graphSubTitleFontColor; ctx.textAlign = "center"; ctx.textBaseline = "bottom"; - setTextBordersAndBackground(ctx,config.graphSubTitle,(Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)),Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2,graphSubTitlePosY,config.graphSubTitleBorders,config.graphSubTitleBordersColor,Math.ceil(ctx.chartLineScale*config.graphSubTitleBordersWidth),Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersYSpace),config.graphSubTitleBordersStyle,config.graphSubTitleBackgroundColor,"GRAPHSUBTITLE"); + setTextBordersAndBackground(ctx,config.graphSubTitle,(Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)),Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2,graphSubTitlePosY,config.graphSubTitleBorders,config.graphSubTitleBordersColor,Math.ceil(ctx.chartLineScale*config.graphSubTitleBordersWidth),Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.graphSubTitleBordersYSpace),config.graphSubTitleBordersStyle,config.graphSubTitleBackgroundColor,"GRAPHSUBTITLE",config.graphSubTitleBordersRadius); ctx.translate(Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2, graphSubTitlePosY); ctx.fillTextMultiLine(config.graphSubTitle, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.graphSubTitleFontSize)),true,config.detectMouseOnText,ctx,"SUBTITLE_TEXTMOUSE",0,Math.ceil(ctx.chartSpaceScale*config.spaceLeft) + (width - Math.ceil(ctx.chartSpaceScale*config.spaceLeft) - Math.ceil(ctx.chartSpaceScale*config.spaceRight)) / 2, graphSubTitlePosY,-1,-1); @@ -5734,7 +6208,7 @@ window.Chart = function(context) { ctx.textAlign = "center"; ctx.textBaseline = "bottom"; - setTextBordersAndBackground(ctx,config.yAxisUnit,(Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),leftNotUsableSize, yAxisUnitPosY,config.yAxisUnitBorders,config.yAxisUnitBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace),config.yAxisUnitBordersStyle,config.yAxisUnitBackgroundColor,"YAXISUNIT"); + setTextBordersAndBackground(ctx,config.yAxisUnit,(Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),leftNotUsableSize, yAxisUnitPosY,config.yAxisUnitBorders,config.yAxisUnitBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace),config.yAxisUnitBordersStyle,config.yAxisUnitBackgroundColor,"YAXISUNIT",config.yAxisUnitBordersRadius); ctx.translate(leftNotUsableSize, yAxisUnitPosY); ctx.fillTextMultiLine(config.yAxisUnit, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),true,config.detectMouseOnText,ctx,"YLEFTAXISUNIT_TEXTMOUSE",0,leftNotUsableSize, yAxisUnitPosY,-1,-1); ctx.stroke(); @@ -5748,7 +6222,7 @@ window.Chart = function(context) { ctx.fillStyle = config.yAxisUnitFontColor; ctx.textAlign = "center"; ctx.textBaseline = "bottom"; - setTextBordersAndBackground(ctx,config.yAxisUnit2,(Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),width - rightNotUsableSize, yAxisUnitPosY,config.yAxisUnitBorders,config.yAxisUnitBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace),config.yAxisUnitBordersStyle,config.yAxisUnitBackgroundColor,"YAXISUNIT"); + setTextBordersAndBackground(ctx,config.yAxisUnit2,(Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),width - rightNotUsableSize, yAxisUnitPosY,config.yAxisUnitBorders,config.yAxisUnitBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisUnitBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisUnitBordersYSpace),config.yAxisUnitBordersStyle,config.yAxisUnitBackgroundColor,"YAXISUNIT",config.yAxisUnitBordersRadius); ctx.translate(width - rightNotUsableSize, yAxisUnitPosY); ctx.fillTextMultiLine(config.yAxisUnit2, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisUnitFontSize)),true,config.detectMouseOnText,ctx,"YRIGHTAXISUNIT_TEXTMOUSE",0,width - rightNotUsableSize, yAxisUnitPosY,-1,-1); ctx.stroke(); @@ -5767,7 +6241,7 @@ window.Chart = function(context) { ctx.translate(yAxisLabelPosLeft, topNotUsableSize + (availableHeight / 2)); ctx.rotate(-(90 * (Math.PI / 180))); - setTextBordersAndBackground(ctx,config.yAxisLabel,(Math.ceil(ctx.chartTextScale*config.yAxisFontSize)), 0,0, config.yAxisLabelBorders,config.yAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace),config.yAxisLabelBordersStyle,config.yAxisLabelBackgroundColor,"YAXISLABELLEFT"); + setTextBordersAndBackground(ctx,config.yAxisLabel,(Math.ceil(ctx.chartTextScale*config.yAxisFontSize)), 0,0, config.yAxisLabelBorders,config.yAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace),config.yAxisLabelBordersStyle,config.yAxisLabelBackgroundColor,"YAXISLABELLEFT",config.yAxisLabelBordersRadius); ctx.fillTextMultiLine(config.yAxisLabel, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)),false,config.detectMouseOnText,ctx,"YLEFTAXISLABEL_TEXTMOUSE",-(90 * (Math.PI / 180)),yAxisLabelPosLeft, topNotUsableSize + (availableHeight / 2),-1,-1); ctx.stroke(); ctx.restore(); @@ -5782,7 +6256,7 @@ window.Chart = function(context) { ctx.textBaseline = "bottom"; ctx.translate(yAxisLabelPosRight, topNotUsableSize + (availableHeight / 2)); ctx.rotate(+(90 * (Math.PI / 180))); - setTextBordersAndBackground(ctx,config.yAxisLabel2,(Math.ceil(ctx.chartTextScale*config.yAxisFontSize)), 0,0, config.yAxisLabelBorders,config.yAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace),config.yAxisLabelBordersStyle,config.yAxisLabelBackgroundColor,"YAXISLABELLEFT"); + setTextBordersAndBackground(ctx,config.yAxisLabel2,(Math.ceil(ctx.chartTextScale*config.yAxisFontSize)), 0,0, config.yAxisLabelBorders,config.yAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.yAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.yAxisLabelBordersYSpace),config.yAxisLabelBordersStyle,config.yAxisLabelBackgroundColor,"YAXISLABELLEFT",config.yAxisLabelBordersRadius); ctx.fillTextMultiLine(config.yAxisLabel2, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.yAxisFontSize)),false,config.detectMouseOnText,ctx,"YRIGHTAXISLABEL_TEXTMOUSE",+(90 * (Math.PI / 180)),yAxisLabelPosRight, topNotUsableSize + (availableHeight / 2),-1,-1); ctx.stroke(); ctx.restore(); @@ -5797,7 +6271,7 @@ window.Chart = function(context) { ctx.fillStyle = config.xAxisFontColor; ctx.textAlign = "center"; ctx.textBaseline = "bottom"; - setTextBordersAndBackground(ctx,config.xAxisLabel,(Math.ceil(ctx.chartTextScale*config.xAxisFontSize)),leftNotUsableSize + (availableWidth / 2), xAxisLabelPos,config.xAxisLabelBorders,config.xAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.xAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersYSpace),config.xAxisLabelBordersStyle,config.xAxisLabelBackgroundColor,"XAXISLABEL"); + setTextBordersAndBackground(ctx,config.xAxisLabel,(Math.ceil(ctx.chartTextScale*config.xAxisFontSize)),leftNotUsableSize + (availableWidth / 2), xAxisLabelPos,config.xAxisLabelBorders,config.xAxisLabelBordersColor,Math.ceil(ctx.chartLineScale*config.xAxisLabelBordersWidth),Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.xAxisLabelBordersYSpace),config.xAxisLabelBordersStyle,config.xAxisLabelBackgroundColor,"XAXISLABEL",config.xAxisLabelBordersRadius); ctx.translate(leftNotUsableSize + (availableWidth / 2), xAxisLabelPos); ctx.fillTextMultiLine(config.xAxisLabel, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.xAxisFontSize)),true,config.detectMouseOnText,ctx,"XAXISLABEL_TEXTMOUSE",0,leftNotUsableSize + (availableWidth / 2), xAxisLabelPos,-1,-1); ctx.stroke(); @@ -5827,7 +6301,7 @@ window.Chart = function(context) { ctx.textAlign = "center"; ctx.textBaseline = "bottom"; - setTextBordersAndBackground(ctx,config.footNote,(Math.ceil(ctx.chartTextScale*config.footNoteFontSize)),leftNotUsableSize + (availableWidth / 2), footNotePosY,config.footNoteBorders,config.footNoteBordersColor,Math.ceil(ctx.chartLineScale*config.footNoteBordersWidth),Math.ceil(ctx.chartSpaceScale*config.footNoteBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.footNoteBordersYSpace),config.footNoteBordersStyle,config.footNoteBackgroundColor,"FOOTNOTE"); + setTextBordersAndBackground(ctx,config.footNote,(Math.ceil(ctx.chartTextScale*config.footNoteFontSize)),leftNotUsableSize + (availableWidth / 2), footNotePosY,config.footNoteBorders,config.footNoteBordersColor,Math.ceil(ctx.chartLineScale*config.footNoteBordersWidth),Math.ceil(ctx.chartSpaceScale*config.footNoteBordersXSpace),Math.ceil(ctx.chartSpaceScale*config.footNoteBordersYSpace),config.footNoteBordersStyle,config.footNoteBackgroundColor,"FOOTNOTE",config.footNoteBordersRadius); ctx.translate(leftNotUsableSize + (availableWidth / 2), footNotePosY); ctx.fillTextMultiLine(config.footNote, 0, 0, ctx.textBaseline, (Math.ceil(ctx.chartTextScale*config.footNoteFontSize)),true,config.detectMouseOnText,ctx,"FOOTNOTE_TEXTMOUSE",0,leftNotUsableSize + (availableWidth / 2), footNotePosY,-1,-1); @@ -5869,13 +6343,14 @@ window.Chart = function(context) { var y1,y2,y3,diffnb,diffnbj,fact, currentAnimPc; var prevypos; var pts=[]; + for (var i = 0; i < data.datasets.length; i++) { - if(setOptionValue(1,"ANIMATION",ctx,data,statData,data.datasets[i].animation,config.animation,i,-1,{nullvalue : null} )==true || animPc >= 1) { + + if(setOptionValue(true,true,1,"ANIMATION",ctx,data,statData,data.datasets[i].animation,config.animation,"animation",i,-1,{nullvalue : null} )==true || animPc >= 1) { prevypos="undefined"; if(statData[i][0].tpchart!="Line")continue; if (statData[i].length == 0) continue; if (statData[i][0].firstNotMissing == -1) continue; - ctx.save(); ctx.beginPath(); @@ -5883,10 +6358,16 @@ window.Chart = function(context) { var firstpt=-1; var lastxPos=-1; for (var j = statData[i][0].firstNotMissing; j <= statData[i][0].lastNotMissing; j++) { + + todisplay=true; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) todisplay=false; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) todisplay=false; + if(typeof(data.datasets[i].data[j])=="undefined")todisplay=false; if(prevAnimPc.animVal==0 && j>statData[i][0].firstNotMissing) continue; - currentAnimPc = animationCorrection(animPc, data, config, i, j, 0); + currentAnimPc = animationCorrection(animPc, data, config, i, j, true); + if (currentAnimPc.mainVal == 0 && (prevAnimPc.mainVal > 0 && firstpt !=-1)) { - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); if(config.extrapolateMissingData) { @@ -5898,63 +6379,64 @@ window.Chart = function(context) { y3=y1+fact*(y2-y1); traceLine(pts,ctx,statData[i][statData[i][j].prevNotMissing].xPos + fact*(statData[i][statData[i][j-1].nextNotMissing].xPos-statData[i][statData[i][j].prevNotMissing].xPos) , y3,config,data,statData,i,setYposOrigin(i,j,data,statData)); closebz(pts,ctx,config,i); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); ctx.strokeStyle = "rgba(0,0,0,0)"; - if(config.datasetFill && setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )!=1) { + if(config.datasetFill && setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )!=1) { ctx.lineTo(statData[i][statData[i][j].prevNotMissing].xPos + fact*(statData[i][statData[i][j-1].nextNotMissing].xPos-statData[i][statData[i][j].prevNotMissing].xPos) , statData[i][j].yAxisPos ); ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); ctx.closePath(); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); ctx.fill(); firstpt=-1; } - } else if (!(typeof statData[i][j].value == "undefined")) { + } else if (todisplay==true) { traceLine(pts,ctx,statData[i][j-1].xPos + prevAnimPc.subVal*(statData[i][j].xPos-statData[i][j-1].xPos) , statData[i][j].yAxisPos - prevAnimPc.mainVal*statData[i][statData[i][j-1].nextNotMissing].yPosOffset,config,data,statData,i,setYposOrigin(i,j,data,statData)); closebz(pts,ctx,config,i); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); ctx.strokeStyle = "rgba(0,0,0,0)"; - if(config.datasetFill && setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )!=1) { + if(config.datasetFill && setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )!=1) { ctx.lineTo(statData[i][j-1].xPos + prevAnimPc.subVal*(statData[i][j].xPos-statData[i][j-1].xPos) , statData[i][j].yAxisPos ); ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); ctx.closePath(); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); ctx.fill(); } } prevAnimPc = currentAnimPc; continue; } else if(currentAnimPc.totVal ==0) { - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); ctx.strokeStyle = "rgba(0,0,0,0)"; } else { - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,j,{nullvalue : null} ); } prevAnimPc = currentAnimPc; - switch(typeof data.datasets[i].data[j]) { - case "undefined" : + switch(todisplay) { + case false : if (!config.extrapolateMissingData) { if(firstpt==-1) continue; closebz(pts,ctx,config,i); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); - if (config.datasetFill && firstpt != -1 && setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )!=1) { + if (config.datasetFill && firstpt != -1 && setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )!=1) { lastxPos=-1; ctx.strokeStyle = "rgba(0,0,0,0)"; ctx.lineTo(statData[i][j-1].xPos, statData[i][j-1].yAxisPos); ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].yAxisPos); ctx.closePath(); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,j,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); ctx.fill(); } ctx.beginPath(); @@ -5968,16 +6450,15 @@ window.Chart = function(context) { diffnbj=(j)-statData[i][j+1].prevNotMissing; fact=(diffnbj+prevAnimPc.subVal)/diffnb; y3=y1+fact*(y2-y1); -// traceLine(pts,ctx,statData[i][j].xPos + currentAnimPc.subVal*(statData[i][j+1].xPos-statData[i][j].xPos), y3,config,data,statData,i); traceLine(pts,ctx,statData[i][statData[i][j].prevNotMissing].xPos + fact*(statData[i][statData[i][j-1].nextNotMissing].xPos-statData[i][statData[i][j].prevNotMissing].xPos) , y3,config,data,statData,i,setYposOrigin(i,j,data,statData)); } break; default : - ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(1,"LINEWIDTH",ctx,data,statData,data.datasets[i].datasetStrokeWidth,config.datasetStrokeWidth,i,j,{nullvalue : null} )); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"LINEWIDTH",ctx,data,statData,data.datasets[i].datasetStrokeWidth,config.datasetStrokeWidth,"datasetStrokeWidth",i,j,{nullvalue : null} )); if (firstpt==-1) { firstpt=j; ctx.beginPath(); - if(setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==1) { + if(setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==1) { if(typeof statData[i][j].yPosOffsetOrigin != "undefined")ctx.moveTo(statData[i][j].xPos, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffsetOrigin); else ctx.moveTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); ctx.lineTo(statData[i][j].xPos, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset); @@ -5999,56 +6480,62 @@ window.Chart = function(context) { } } closebz(pts,ctx,config,i); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); ctx.stroke(); ctx.setLineDash([]); - if (config.datasetFill && setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )!=1) { + if (config.datasetFill && setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )!=1) { if (firstpt>=0 ) { ctx.strokeStyle = "rgba(0,0,0,0)"; ctx.lineTo(lastxPos, statData[i][0].xAxisPosY-statData[i][0].zeroY); ctx.lineTo(statData[i][firstpt].xPos, statData[i][firstpt].xAxisPosY-statData[i][0].zeroY); ctx.closePath(); - ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,-1,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); + ctx.fillStyle=setOptionValue(true,true,1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,"fillColor",i,-1,{animationValue: currentAnimPc.mainVal, xPosLeft : statData[i][0].xPos, yPosBottom : Math.max(statData[i][0].yAxisPos,statData[i][0].yAxisPos- ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lminvalue_offset), xPosRight : statData[i][data.datasets[i].data.length-1].xPos, yPosTop : Math.min(statData[i][0].yAxisPos, statData[i][0].yAxisPos - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * statData[i][0].lmaxvalue_offset)} ); ctx.fill(); } } ctx.restore(); - if (config.pointDot && animPc >= 1) { + if (animPc >= 1) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if (!(typeof(data.datasets[i].data[j]) == 'undefined')) { - currentAnimPc = animationCorrection(animPc, data, config, i, j, 0); + currentAnimPc = animationCorrection(animPc, data, config, i, j, true); if (currentAnimPc.mainVal > 0 || !config.animationLeftToRight) { - ctx.beginPath(); - ctx.fillStyle=setOptionValue(1,"MARKERFILLCOLOR",ctx,data,statData,data.datasets[i].pointColor,config.defaultStrokeColor,i,j,{nullvalue: true} ); - ctx.strokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointStrokeColor,config.defaultStrokeColor,i,j,{nullvalue: true} ); - ctx.lineWidth=setOptionValue(ctx.chartLineScale,"MARKERLINEWIDTH",ctx,data,statData,data.datasets[i].pointDotStrokeWidth,config.pointDotStrokeWidth,i,j,{nullvalue: true} ); - var markerShape=setOptionValue(1,"MARKERSHAPE",ctx,data,statData,data.datasets[i].markerShape,config.markerShape,i,j,{nullvalue: true} ); - var markerRadius=setOptionValue(ctx.chartSpaceScale,"MARKERRADIUS",ctx,data,statData,data.datasets[i].pointDotRadius,config.pointDotRadius,i,j,{nullvalue: true} ); - var markerStrokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointDotStrokeStyle,config.pointDotStrokeStyle,i,j,{nullvalue: true} ); - drawMarker(ctx, statData[i][j].xPos , statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset, markerShape,markerRadius,markerStrokeStyle); - } + if(setOptionValue(true,true,1,"POINTDOT",ctx,data,statData,undefined,config.pointDot,"pointDot",i,j,{nullvalue : null} )) { + ctx.beginPath(); + ctx.fillStyle=setOptionValue(true,true,1,"MARKERFILLCOLOR",ctx,data,statData,data.datasets[i].pointColor,config.defaultStrokeColor,"pointColor",i,j,{nullvalue: true} ); + ctx.strokeStyle=setOptionValue(true,true,1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointStrokeColor,config.defaultStrokeColor,"pointStrokeColor",i,j,{nullvalue: true} ); + ctx.lineWidth=setOptionValue(true,true,ctx.chartLineScale,"MARKERLINEWIDTH",ctx,data,statData,data.datasets[i].pointDotStrokeWidth,config.pointDotStrokeWidth,"pointDotStrokeWidth",i,j,{nullvalue: true} ); + var markerShape=setOptionValue(true,true,1,"MARKERSHAPE",ctx,data,statData,data.datasets[i].markerShape,config.markerShape,"markerShape",i,j,{nullvalue: true} ); + var markerRadius=setOptionValue(true,true,ctx.chartSpaceScale,"MARKERRADIUS",ctx,data,statData,data.datasets[i].pointDotRadius,config.pointDotRadius,"pointDotRadius",i,j,{nullvalue: true} ); + var markerStrokeStyle=setOptionValue(true,true,1,"MARKERSTROKESTYLE",ctx,data,statData,data.datasets[i].pointDotStrokeStyle,config.pointDotStrokeStyle,"pointDotStrokeStyle",i,j,{nullvalue: true} ); + drawMarker(ctx, statData[i][j].xPos , statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset, markerShape,markerRadius,markerStrokeStyle); + } + } } } } if (animPc >= config.animationStopValue) { for (j = 0; j < data.datasets[i].data.length; j++) { + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.datasets[i].displayData,config.displayData,"displayData",i,j,{nullvalue : null} )== false) continue; + if(setOptionValue(true,true,1,"DISPLAYDATA",ctx,data,statData,data.displayData,config.displayData,"displayData",j,-1,{nullvalue : null} )== false) continue; if (typeof(data.datasets[i].data[j]) == 'undefined') continue; - jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData,setOptionValue(1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,i,j,{nullValue : true})]; - if (setOptionValue(1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,i,j,{nullValue : true})) { + if(!(data.datasets[i].mouseDetection==false))jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData,setOptionValue(true,true,1,"ANNOTATEDISPLAY",ctx,data,statData,data.datasets[i].annotateDisplay,config.annotateDisplay,"annotateDisplay",i,j,{nullValue : true})]; + if (setOptionValue(true,true,1,"INGRAPHDATASHOW",ctx,data,statData,data.datasets[i].inGraphDataShow,config.inGraphDataShow,"inGraphDataShow",i,j,{nullValue : true})) { ctx.save(); - ctx.textAlign = setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,i,j,{nullValue: true }); - ctx.textBaseline = setOptionValue(1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,i,j,{nullValue : true} ); - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,j,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,j,{nullValue : true} ); - ctx.fillStyle = setOptionValue(1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,i,j,{nullValue : true} ); - var paddingTextX = setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,i,j,{nullValue : true} ), - paddingTextY = setOptionValue(ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,i,j,{nullValue : true} ); - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,j,{nullValue : true} ), statData[i][j],config); + ctx.textAlign = setOptionValue(true,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",i,j,{nullValue: true }); + ctx.textBaseline = setOptionValue(true,true,1,"INGRAPHDATAVALIGN",ctx,data,statData,undefined,config.inGraphDataVAlign,"inGraphDataVAlign",i,j,{nullValue : true} ); + ctx.font = setOptionValue(true,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(true,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + ctx.fillStyle = setOptionValue(true,true,1,"INGRAPHDATAFONTCOLOR",ctx,data,statData,undefined,config.inGraphDataFontColor,"inGraphDataFontColor",i,j,{nullValue : true} ); + var paddingTextX = setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGX",ctx,data,statData,undefined,config.inGraphDataPaddingX,"inGraphDataPaddingX",i,j,{nullValue : true} ), + paddingTextY = setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATAPADDINGY",ctx,data,statData,undefined,config.inGraphDataPaddingY,"inGraphDataPaddingY",i,j,{nullValue : true} ); + var dispString = tmplbis(setOptionValue(true,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); ctx.translate(statData[i][j].xPos + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset - paddingTextY); - var rotateVal=setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,i,j,{nullValue : true} ) * (Math.PI / 180); + var rotateVal=setOptionValue(true,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",i,j,{nullValue : true} ) * (Math.PI / 180); ctx.rotate(rotateVal); - setTextBordersAndBackground(ctx,dispString,setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),0,0,setOptionValue(1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,i,j,{nullValue : true} ),setOptionValue(ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,i,j,{nullValue : true} ),setOptionValue(ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,i,j,{nullValue : true} ),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,i,j,{nullValue : true} ),"INGRAPHDATA"); - ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,statData[i][j].xPos + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset - paddingTextY,i,j); + setTextBordersAndBackground(ctx,dispString,setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),0,0,setOptionValue(true,true,1,"INGRAPHDATABORDERS",ctx,data,statData,undefined,config.inGraphDataBorders,"inGraphDataBorders",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSCOLOR",ctx,data,statData,undefined,config.inGraphDataBordersColor,"inGraphDataBordersColor",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartLineScale,"INGRAPHDATABORDERSWIDTH",ctx,data,statData,undefined,config.inGraphDataBordersWidth,"inGraphDataBordersWidth",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",ctx,data,statData,undefined,config.inGraphDataBordersXSpace,"inGraphDataBordersXSpace",i,j,{nullValue : true} ),setOptionValue(true,true,ctx.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",ctx,data,statData,undefined,config.inGraphDataBordersYSpace,"inGraphDataBordersYSpace",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABORDERSSTYLE",ctx,data,statData,undefined,config.inGraphDataBordersStyle,"inGraphDataBordersStyle",i,j,{nullValue : true} ),setOptionValue(true,true,1,"INGRAPHDATABACKGROUNDCOLOR",ctx,data,statData,undefined,config.inGraphDataBackgroundColor,"inGraphDataBackgroundColor",i,j,{nullValue : true} ),"INGRAPHDATA",config.inGraphDataBordersRadius); + ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ),true,config.detectMouseOnText,ctx,"INGRAPHDATA_TEXTMOUSE",rotateVal,statData[i][j].xPos + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset - paddingTextY,i,j); ctx.restore(); } } @@ -6058,7 +6545,7 @@ window.Chart = function(context) { function initbz(pts,xpos,ypos,i) { - if (setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==0 && setOptionValue(1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,i,-1,{nullValue : true})) { + if (setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==0 && setOptionValue(true,true,1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,"bezierCurve",i,-1,{nullValue : true})) { pts.length=0; pts.push(xpos);pts.push(ypos); } @@ -6073,16 +6560,16 @@ window.Chart = function(context) { function traceLine(pts,ctx,xpos,ypos,config,data,statData,i,yposOrigin) { - if (setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==0 && setOptionValue(1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,i,-1,{nullValue : true})) { + if (setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==0 && setOptionValue(true,true,1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,"bezierCurve",i,-1,{nullValue : true})) { pts.push(xpos); pts.push(ypos); } else { - if(setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==0)ctx.lineTo(xpos,ypos); - else if(setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==1){ + if(setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==0)ctx.lineTo(xpos,ypos); + else if(setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==1){ if(yposOrigin != "undefined")ctx.moveTo(xpos, yposOrigin); else ctx.moveTo(xpos, statData[i][0].xAxisPosY-statData[i][0].zeroY); // ctx.moveTo(xpos, statData[i][0].xAxisPosY-statData[i][0].zeroY); ctx.lineTo(xpos,ypos); - } else if (setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==2 && typeof prevypos!="undefined"){ + } else if (setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==2 && typeof prevypos!="undefined"){ ctx.lineTo(xpos,prevypos); ctx.lineTo(xpos,ypos); prevypos=ypos; @@ -6092,10 +6579,10 @@ window.Chart = function(context) { function closebz(pts,ctx,config,i){ - if(setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,i,j,{nullvalue : null} )==0 && setOptionValue(1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,i,-1,{nullValue : true})) { + if(setOptionValue(true,true,1,"LINKTYPE",ctx,data,statData,data.datasets[i].linkType,config.linkType,"linkType",i,j,{nullvalue : null} )==0 && setOptionValue(true,true,1,"BEZIERCURVE",ctx,data,statData,undefined,config.bezierCurve,"bezierCurve",i,-1,{nullValue : true})) { minimumpos= statData[i][0].xAxisPosY; maximumpos= statData[i][0].xAxisPosY - statData[i][0].calculatedScale.steps*statData[i][0].scaleHop; - drawSpline(ctx,pts,setOptionValue(1,"BEZIERCURVETENSION",ctx,data,statData,undefined,config.bezierCurveTension,i,-1,{nullValue : true}),minimumpos,maximumpos); + drawSpline(ctx,pts,setOptionValue(true,true,1,"BEZIERCURVETENSION",ctx,data,statData,undefined,config.bezierCurveTension,"bezierCurveTension",i,-1,{nullValue : true}),minimumpos,maximumpos); pts.length=0; } prevypos=undefined; @@ -6147,13 +6634,13 @@ window.Chart = function(context) { // For first is a simple quadratics. ctx.beginPath(); - ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,j,{nullvalue : null} ); - ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(1,"LINEWIDTH",ctx,data,statData,data.datasets[i].datasetStrokeWidth,config.datasetStrokeWidth,i,j,{nullvalue : null} )); + ctx.strokeStyle=setOptionValue(true,true,1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,"strokeColor",i,j,{nullvalue : null} ); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(true,true,1,"LINEWIDTH",ctx,data,statData,data.datasets[i].datasetStrokeWidth,config.datasetStrokeWidth,"datasetStrokeWidth",i,j,{nullvalue : null} )); ctx.moveTo(pts[0],pts[1]); ctx.quadraticCurveTo(cp[0],Math.max(Math.min(cp[1],minimumpos),maximumpos),pts[2],pts[3]); // ctx.setLineDash(lineStyleFn(config.datasetStrokeStyle)); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,i,j,{nullvalue : null} ))); + ctx.setLineDash(lineStyleFn(setOptionValue(true,true,1,"LINEDASH",ctx,data,statData,data.datasets[i].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",i,j,{nullvalue : null} ))); for(ti=2;ti Pas d'influence sur une action de souris. C'est lié à l'action de annotateFunction + // annotateFunctionIn : inBar, + // annotateFunctionOut : outBar, + // ---------------------------------------------------- + // - mouseDownRight mouseDownLeft: null mouseDownMiddle: null + // - mouseMove: null mouseWheel : null mouseOut: null (lorsque la souris sort du canvas) + // ---------------------------------------------------- + // mouse sur texte : detectMouseOnText => Pas d'influence sur une action de souris. C'est lié à une autre action; + // ---------------------------------------------------- - function add_event_listener(type, func, chk) - { - if(typeof func != 'function') - return; - - function do_func(event) { - if (chk == null || chk(event)) doMouseAction(config,ctx,event,data,"mouseaction",func); - }; - - var hash = type+' '+func.name; - if(hash in ctx._eventListeners) { - if(ctx.canvas.removeEventListener) - ctx.canvas.removeEventListener(type, ctx._eventListeners[hash]); - else if(ctx.canvas.detachEvent) - ctx.canvas.detachEvent(type, ctx._eventListeners[hash]); - } - - ctx._eventListeners[hash] = do_func; - - if(ctx.canvas.addEventListener) { - if(type=="mousewheel") type="DOMMouseScroll"; - ctx.canvas.addEventListener(type, do_func, false); - } else if(ctx.canvas.attachEvent) { - ctx.canvas.attachEvent("on"+type, do_func); - } + function setAction(ctx,action){ + if(ctx.mouseAction.indexOf("/"+action)>=0)ctx.mouseAction[ctx.mouseAction.indexOf("/"+action)]=action; + else if(ctx.mouseAction.indexOf(action)<0)ctx.mouseAction[ctx.mouseAction.length]=action; + }; + + function add_listener(ctx,action) { + if (isIE() < 9 && isIE() != false) ctx.canvas.attachEvent("on" + action.split(' ')[0], function(event) { + doMouseAction(event,ctx.ChartNewId, action.split(' ')[0]); + }); + else ctx.canvas.addEventListener(action.split(' ')[0], function(event) { + doMouseAction(event,ctx, action.split(' ')[0]); + }, false); }; - if(typeof config.mouseDownRight == 'function') - add_event_listener("mousedown", chartJsMouseDown, function(e) { return (e.which == 1 || e.which == 2 || e.which == 3); }); - else if(typeof config.mouseDownLeft == 'function') - add_event_listener("mousedown", chartJsMouseDown, function(e) { return (e.which == 1 || e.which == 2 || e.which == 3); }); - else if(typeof config.mouseDownMiddle == 'function') - add_event_listener("mousedown", chartJsMouseDown, function(e) { return (e.which == 1 || e.which == 2 || e.which == 3); }); - add_event_listener("mousemove", config.mouseMove); - add_event_listener("mouseout", config.mouseOut); - add_event_listener("mousewheel", config.mouseWheel); + // - saveScreen : savePngFunction: "mousedown right" - savePng=true + if(config.savePng==true) { + if(config.savePngFunction=="mousedown left")setAction(ctx,"mousedown 1"); + else if(config.savePngFunction=="mousedown middle")setAction(ctx,"mousedown 2"); + else if(config.savePngFunction=="mousedown right")setAction(ctx,"mousedown 3"); + } + + + // - annotateDisplay : true, annotateFunction: "mousemove" + if(config.annotateDisplay==true) { + if (cursorDivCreated == false) oCursor = new makeCursorObj('divCursor'); + if(config.annotateFunction=="mousedown left")setAction(ctx,"mousedown 1"); + else if(config.annotateFunction=="mousedown middle")setAction(ctx,"mousedown 2"); + else if(config.annotateFunction=="mousedown right")setAction(ctx,"mousedown 3"); + else if(config.annotateFunction=="mousemove")setAction(ctx,"mousemove"); + } + + // highLight : false, highLightMouseFunction : "mousemove", + if(config.highLight==true) { + if(config.highLightMouseFunction=="mousedown left")setAction(ctx,"mousedown 1"); + else if(config.highLightMouseFunction=="mousedown middle")setAction(ctx,"mousedown 2"); + else if(config.highLightMouseFunction=="mousedown right")setAction(ctx,"mousedown 3"); + else if(config.highLightMouseFunction=="mousemove")setAction(ctx,"mousemove"); + } + + // mouse actions; + if(typeof config.mouseMove=="function") setAction(ctx,"mousemove"); + if(typeof config.mouseDownLeft=="function") setAction(ctx,"mousedown 1"); + if(typeof config.mouseDownMiddle=="function") setAction(ctx,"mousedown 2"); + if(typeof config.mouseDownRight=="function") setAction(ctx,"mousedown 3"); + if(typeof config.mouseWheel=="function") setAction(ctx,mousewheelevt); + if(typeof config.mouseOut=="function") setAction(ctx,"mouseout"); + if(typeof config.mouseDblClick=="function") setAction(ctx,"dblclick"); + + var mouseAction=false; + + // add mouse event + if((ctx.mouseAction.indexOf("mousemove")>=0 && ctx.mouseAction.indexOf("/mousemove")<0) || (ctx.mouseAction.indexOf("mouseout")>=0 && ctx.mouseAction.indexOf("/mouseout")<0)) { + setAction(ctx,"mouseout"); + mouseAction=true; + add_listener(ctx,"mouseout"); + // mouseOut action; + } + + + if((ctx.mouseAction.indexOf("mousemove")>=0 && ctx.mouseAction.indexOf("/mousemove")<0) || (ctx.mouseAction.indexOf(mousewheelevt)>=0 && ctx.mouseAction.indexOf("/"+mousewheelevt)<0)) { + setAction(ctx,mousewheelevt); + mouseAction=true; + add_listener(ctx,mousewheelevt); + // mouseWheel action; + } + + if(ctx.mouseAction.indexOf("mousemove")>=0 && ctx.mouseAction.indexOf("/mousemove")<0) { + mouseAction=true; + add_listener(ctx,"mousemove"); + // mouseMove action; + } + + if(ctx.mouseAction.indexOf("dblclick")>=0 && ctx.mouseAction.indexOf("/dblclick")<0) { + mouseAction=true; + add_listener(ctx,"dblclick"); + // mouseMove action; + } + + if((ctx.mouseAction.indexOf("mousedown 1")>=0 && ctx.mouseAction.indexOf("/mousedown 1")<0) || (ctx.mouseAction.indexOf("mousedown 2")>=0 && ctx.mouseAction.indexOf("/mousedown 2")<0) || (ctx.mouseAction.indexOf("mousedown 3")>=0 && ctx.mouseAction.indexOf("/mousedown 3")<0)) { + mouseAction=true; + add_listener(ctx,"mousedown"); + // mouseDown action; + } + + // remove contextMenu if forced with option contextMenu or if mouseDownRight is defined + if((config.contextMenu==false || ctx.mouseAction.indexOf("mousedown 3")>=0) && ctx.mouseAction.indexOf("/removeContextMenu")<0){ + ctx.mouseAction[ctx.mouseAction.length]="removeContextMenu"; + ctx.canvas.oncontextmenu = function (e) { + e.preventDefault(); + }; + } + + // initialiser les variables nécessaires pour l'action doMouseAction; + inMouseAction[ctx.ChartNewId]=false; + mouseActionData[ctx.ChartNewId]={ data : data, config: config, prevShow : -1 }; }; + }; - - -function animationCorrection(animationValue, data, config, vdata, vsubdata, addone) { - var animValue = animationValue; +function animationCorrection(animationValue, data, config, vdata, vsubdata, isline) { + var animValue=animationValue; var animSubValue = 0; - if (vsubdata != -1) { - if (animValue < 1 && (vdata < (config.animationStartWithDataset - 1) && (config.animationStartWithDataset - 1) != -1)) { - animValue = 1; - } - if (animValue < 1 && (vsubdata < (config.animationStartWithData - 1) && (config.animationStartWithData - 1) != -1)) { - animValue = 1; - } - var totreat = 1; - var newAnimationValue = animationValue; - if (animValue < 1 && config.animationByDataset) { - animValue = 0; - totreat = 0; - var startDataset = (config.animationStartWithDataset - 1); - if ((config.animationStartWithDataset - 1) == -1) startDataset = 0 - var nbstepsperdatasets = config.animationSteps / (data.datasets.length - startDataset); - if (animationValue >= (vdata - startDataset + 1) * nbstepsperdatasets / config.animationSteps) animValue = 1; - else if (animationValue >= (vdata - startDataset) * nbstepsperdatasets / config.animationSteps) { - var redAnimationValue = animationValue - (vdata - startDataset) * nbstepsperdatasets / config.animationSteps; - if (!config.animationLeftToRight) { - animValue = redAnimationValue * (data.datasets.length - startDataset); - } else { - newAnimationValue = redAnimationValue * (data.datasets.length - startDataset); - } - totreat = 1; - } - } - if (totreat == 1 && animValue < 1 && config.animationLeftToRight) { - animValue = 0; - var startSub = (config.animationStartWithData - 1); - if ((config.animationStartWithData - 1) == -1) startSub = 0 - var nbstepspervalue = config.animationSteps / (data.datasets[vdata].data.length - startSub - 1 + addone); - if (newAnimationValue >= (vsubdata - startSub) * nbstepspervalue / config.animationSteps) { - animValue = 1; - if (newAnimationValue <= (vsubdata + 1 - startSub) * nbstepspervalue / config.animationSteps) { - animSubValue = (data.datasets[vdata].data.length - startSub - 1) * (newAnimationValue - ((vsubdata - startSub) * nbstepspervalue / config.animationSteps)); - } + + if(vsubdata<0) { + if(vdata < 1*config.animationStartWithData-1) animValue = 1; + else { + switch (config.animationByDataset) { + case "ByArc" : + animValue = animationValue; + break; + case true: + animValue = animationValue; + break; + case false: + default: + animValue = animationValue; + break; } } } else { - if (animValue < 1 && (vdata < (config.animationStartWithData - 1))) { - animValue = 1; + var startVal=Math.max(1,config.animationStartWithDataset); + var startSubVal=Math.max(1,config.animationStartWithData); + + if(vdata < 1*config.animationStartWithDataset-1) animValue = 1; + else if(vsubdata <1*config.animationStartWithData-1) animValue = 1; + else { + var maxData=0; + if(config.animationLeftToRight) { + for(var i=0;i=config.firstLabelToShow-1)doShowLabels=((i+config.firstLabelToShow-1) % parseInt(doShowLabels) ==0 ? true : false); else doShowLabels=false; @@ -6341,7 +6912,7 @@ function showLabels(ctx,data,config,i) { }; function showYLabels(ctx,data,config,i,text) { - var doShowLabels=setOptionValue(1,"SHOWYLABEL",ctx,data,undefined,undefined,config.showYLabels,-1,i,undefined,{labelValue: text}); + var doShowLabels=setOptionValue(true,true,1,"SHOWYLABEL",ctx,data,undefined,undefined,config.showYLabels,"showYLabels",-1,i,undefined,{labelValue: text}); if(typeof doShowLabels=="number") { if(i>=config.firstYLabelToShow-1)doShowLabels=((i+config.firstYLabelToShow-1) % parseInt(doShowLabels) ==0 ? true : false); else doShowLabels=false; @@ -6405,21 +6976,21 @@ function drawLegend(legendMsr,data,config,ctx,typegraph) { ctx.save(); ctx.beginPath(); var lgdbox=legendMsr.legendBox; - if(ctx.tpchart=="Bar" || ctx.tpchart=="StackedBar") if (data.datasets[orderi].type=="Line" && (!config.datasetFill || setOptionValue(1,"LINKTYPE",ctx,data,statData,data.datasets[orderi].linkType,config.linkType,orderi,-1,{nullvalue : null} )==1)) lgdbox=false; + if(ctx.tpchart=="Bar" || ctx.tpchart=="StackedBar") if (data.datasets[orderi].type=="Line" && (!config.datasetFill || setOptionValue(true,false,1,"LINKTYPE",ctx,data,undefined,data.datasets[orderi].linkType,config.linkType,"linkType",orderi,-1,{nullvalue : null} )==1)) lgdbox=false; if (lgdbox) { if (legendMsr.drawLegendOnData) { - ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(1,"LINEWIDTH",ctx,data,undefined,data.datasets[orderi].datasetStrokeWidth,config.datasetStrokeWidth,orderi,-1,{nullvalue : null} )); + ctx.lineWidth = Math.ceil(ctx.chartLineScale*setOptionValue(true,false,1,"LINEWIDTH",ctx,data,undefined,data.datasets[orderi].datasetStrokeWidth,config.datasetStrokeWidth,"datasetStrokeWidth",orderi,-1,{nullvalue : null} )); } else { ctx.lineWidth = Math.ceil(ctx.chartLineScale*config.datasetStrokeWidth); } ctx.beginPath(); if (legendMsr.drawLegendOnData) { - ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data.datasets[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDLINEDASH",ctx,data,undefined,data.datasets[orderi].datasetStrokeStyle,config.datasetStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + ctx.strokeStyle=setOptionValue(true,false,1,"LEGENDSTROKECOLOR",ctx,data,undefined,data.datasets[orderi].strokeColor,config.defaultFillColor,"strokeColor",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(true,false,1,"LEGENDLINEDASH",ctx,data,undefined,data.datasets[orderi].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); } else { - ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDSEGMENTTROKESTYLE",ctx,data,undefined,data[orderi].segmentStrokeStyle,config.segmentStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + ctx.strokeStyle=setOptionValue(true,false,1,"LEGENDSTROKECOLOR",ctx,data,undefined,data[orderi].strokeColor,config.defaultFillColor,"strokeColor",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(true,false,1,"LEGENDSEGMENTTROKESTYLE",ctx,data,undefined,data[orderi].segmentStrokeStyle,config.segmentStrokeStyle,"segmentStrokeStyle",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); } ctx.moveTo(xpos, ypos); ctx.lineTo(xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), ypos); @@ -6429,23 +7000,23 @@ function drawLegend(legendMsr,data,config,ctx,typegraph) { ctx.stroke(); ctx.closePath(); if (legendMsr.drawLegendOnData) { - ctx.fillStyle=setOptionValue(1,"LEGENDFILLCOLOR",ctx,data,undefined,data.datasets[orderi].fillColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.fillStyle=setOptionValue(true,false,1,"LEGENDFILLCOLOR",ctx,data,undefined,data.datasets[orderi].fillColor,config.defaultFillColor,"fillColor",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); } else { - ctx.fillStyle=setOptionValue(1,"LEGENDFILLCOLOR",ctx,data,undefined,data[orderi].color,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.fillStyle=setOptionValue(true,false,1,"LEGENDFILLCOLOR",ctx,data,undefined,data[orderi].color,config.defaultFillColor,"color",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); } ctx.fill(); } else { ctx.lineWidth = config.legendColorIndicatorStrokeWidth ? - config.legendColorIndicatorStrokeWidth : Math.ceil(ctx.chartLineScale*setOptionValue(1,"LINEWIDTH",ctx,data,undefined,data.datasets[orderi].datasetStrokeWidth,config.datasetStrokeWidth,orderi,-1,{nullvalue : null} )); + config.legendColorIndicatorStrokeWidth : Math.ceil(ctx.chartLineScale*setOptionValue(true,false,1,"LINEWIDTH",ctx,data,undefined,data.datasets[orderi].datasetStrokeWidth,config.datasetStrokeWidth,"datasetStrokeWidth",orderi,-1,{nullvalue : null} )); if (config.legendColorIndicatorStrokeWidth && config.legendColorIndicatorStrokeWidth > (Math.ceil(ctx.chartTextScale*config.legendFontSize))) { ctx.lineWidth = (Math.ceil(ctx.chartTextScale*config.legendFontSize)); } if (legendMsr.drawLegendOnData) { - ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data.datasets[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDLINEDASH",ctx,data,undefined,data.datasets[orderi].datasetStrokeStyle,config.datasetStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + ctx.strokeStyle=setOptionValue(true,false,1,"LEGENDSTROKECOLOR",ctx,data,undefined,data.datasets[orderi].strokeColor,config.defaultFillColor,"strokeColor",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(true,false,1,"LEGENDLINEDASH",ctx,data,undefined,data.datasets[orderi].datasetStrokeStyle,config.datasetStrokeStyle,"datasetStrokeStyle",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); } else { - ctx.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",ctx,data,undefined,data[orderi].strokeColor,config.defaultFillColor,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); - ctx.setLineDash(lineStyleFn(setOptionValue(1,"LEGENDSEGMENTTROKESTYLE",ctx,data,undefined,data[orderi].segmentStrokeStyle,config.segmentStrokeStyle,orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); + ctx.strokeStyle=setOptionValue(true,false,1,"LEGENDSTROKECOLOR",ctx,data,undefined,data[orderi].strokeColor,config.defaultFillColor,"strokeColor",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ); + ctx.setLineDash(lineStyleFn(setOptionValue(true,false,1,"LEGENDSEGMENTTROKESTYLE",ctx,data,undefined,data[orderi].segmentStrokeStyle,config.segmentStrokeStyle,"segmentStrokeStyle",orderi,-1,{animationValue: 1, xPosLeft : xpos, yPosBottom : ypos, xPosRight : xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize), yPosTop : ypos - (Math.ceil(ctx.chartTextScale*config.legendFontSize))} ))); } ctx.moveTo(xpos + 2, ypos - ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) / 2)); @@ -6457,13 +7028,13 @@ function drawLegend(legendMsr,data,config,ctx,typegraph) { if(config.pointDot) { ctx.beginPath(); - ctx.fillStyle=setOptionValue(1,"LEGENDMARKERFILLCOLOR",ctx,data,undefined,data.datasets[orderi].pointColor,config.defaultStrokeColor,orderi,-1,{nullvalue: true} ); - ctx.strokeStyle=setOptionValue(1,"LEGENDMARKERSTROKESTYLE",ctx,data,undefined,data.datasets[orderi].pointStrokeColor,config.defaultStrokeColor,orderi,-1,{nullvalue: true} ); - ctx.lineWidth=setOptionValue(ctx.chartLineScale,"LEGENDMARKERLINEWIDTH",ctx,data,undefined,data.datasets[orderi].pointDotStrokeWidth,config.pointDotStrokeWidth,orderi,-1,{nullvalue: true} ); + ctx.fillStyle=setOptionValue(true,false,1,"LEGENDMARKERFILLCOLOR",ctx,data,undefined,data.datasets[orderi].pointColor,config.defaultStrokeColor,"pointColor",orderi,-1,{nullvalue: true} ); + ctx.strokeStyle=setOptionValue(true,false,1,"LEGENDMARKERSTROKESTYLE",ctx,data,undefined,data.datasets[orderi].pointStrokeColor,config.defaultStrokeColor,"pointStrokeColor",orderi,-1,{nullvalue: true} ); + ctx.lineWidth=setOptionValue(true,false,ctx.chartLineScale,"LEGENDMARKERLINEWIDTH",ctx,data,undefined,data.datasets[orderi].pointDotStrokeWidth,config.pointDotStrokeWidth,"pointDotStrokeWidth",orderi,-1,{nullvalue: true} ); - var markerShape=setOptionValue(1,"LEGENDMARKERSHAPE",ctx,data,undefined,data.datasets[orderi].markerShape,config.markerShape,orderi,-1,{nullvalue: true} ); - var markerRadius=setOptionValue(ctx.chartSpaceScale,"LEGENDMARKERRADIUS",ctx,data,undefined,data.datasets[orderi].pointDotRadius,config.pointDotRadius,orderi,-1,{nullvalue: true} ); - var markerStrokeStyle=setOptionValue(1,"LEGENDMARKERSTROKESTYLE",ctx,data,undefined,data.datasets[orderi].pointDotStrokeStyle,config.pointDotStrokeStyle,orderi,-1,{nullvalue: true} ); + var markerShape=setOptionValue(true,false,1,"LEGENDMARKERSHAPE",ctx,data,undefined,data.datasets[orderi].markerShape,config.markerShape,"markerShape",orderi,-1,{nullvalue: true} ); + var markerRadius=setOptionValue(true,false,ctx.chartSpaceScale,"LEGENDMARKERRADIUS",ctx,data,undefined,data.datasets[orderi].pointDotRadius,config.pointDotRadius,"pointDotRadius",orderi,-1,{nullvalue: true} ); + var markerStrokeStyle=setOptionValue(true,false,1,"LEGENDMARKERSTROKESTYLE",ctx,data,undefined,data.datasets[orderi].pointDotStrokeStyle,config.pointDotStrokeStyle,"pointDotStrokeStyle",orderi,-1,{nullvalue: true} ); drawMarker(ctx,xpos + 2 + Math.ceil(ctx.chartTextScale*config.legendBlockSize)/2, ypos - ((Math.ceil(ctx.chartTextScale*config.legendFontSize)) / 2), markerShape,markerRadius,markerStrokeStyle); } ctx.fill(); @@ -6473,7 +7044,7 @@ function drawLegend(legendMsr,data,config,ctx,typegraph) { ctx.save(); ctx.beginPath(); ctx.font = config.legendFontStyle + " " + (Math.ceil(ctx.chartTextScale*config.legendFontSize)).toString() + "px " + config.legendFontFamily; - ctx.fillStyle = setOptionValue(1,"LEGENDFONTCOLOR",ctx,data,undefined,undefined,config.legendFontColor,orderi,-1,{nullvalue: true} ); + ctx.fillStyle = setOptionValue(true,false,1,"LEGENDFONTCOLOR",ctx,data,undefined,undefined,config.legendFontColor,"legendFontColor",orderi,-1,{nullvalue: true} ); ctx.textAlign = "left"; ctx.textBaseline = "bottom"; ctx.translate(xpos + Math.ceil(ctx.chartTextScale*config.legendBlockSize) + Math.ceil(ctx.chartSpaceScale*config.legendSpaceBetweenBoxAndText), ypos); @@ -6543,111 +7114,12 @@ function drawMarker(ctx,xpos,ypos,marker,markersize,markerStrokeStyle) { }; function initPassVariableData_part1(data,config,ctx) { + var i,j,result, mxvalue ,mnvalue, cumvalue, totvalue,lmaxvalue,lminvalue,lgtxt,lgtxt2,tp,prevpos,firstNotMissingi,lastNotMissingi,firstNotMissingj,lastNotMissingj,grandtotal; -switch(ctx.tpdata) { - case 1 : - - result=[]; - var segmentAngle,cumulativeAngle,realCumulativeAngle; - - var realAmplitude = (((config.totalAmplitude * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; - if(realAmplitude <= config.zeroValue)realAmplitude=2*Math.PI; - - cumulativeAngle = (((-config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; - realCumulativeAngle = (((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; - - startAngle=cumulativeAngle; - totvalue = 0; - notemptyval=0; - var firstNotMissing = -1; - var lastNotMissing = -1; - var prevNotMissing = -1; - mxvalue=-Number.MAX_VALUE; - mnvalue=Number.MAX_VALUE; - for (i = 0; i < data.length; i++) { - if(ctx.tpchart != "PolarArea" && 1*data[i].value<0)continue; - if (!(typeof(data[i].value) == 'undefined')) { - if(firstNotMissing==-1)firstNotMissing=i; - mxvalue=Math.max(mxvalue,1*data[i].value); - mnvalue=Math.min(mnvalue,1*data[i].value); - notemptyval++; - totvalue += 1 * data[i].value; - lastNotMissing=i; - } - } - - cumvalue=0; - var prevMissing=-1; - for(i=0;i=0)) { -// if(ctx.tpchart=="PolarArea") { if(notemptyval>0)segmentAngle= (Math.PI *2)/notemptyval; else segmentAngle=0; } -// else segmentAngle = (1 * data[i].value / totvalue) * (Math.PI * 2); - if(ctx.tpchart=="PolarArea") { if(notemptyval>0)segmentAngle= realAmplitude/notemptyval; else segmentAngle=0; } - else segmentAngle = (1 * data[i].value / totvalue) * realAmplitude; - if (segmentAngle >= Math.PI * 2) segmentAngle = Math.PI * 2 - 0.001; // bug on Android when segmentAngle is >= 2*PI; - cumvalue += 1 * data[i].value; - result[i]= { - config: config, - v1: fmtChartJS(config, lgtxt, config.fmtV1), - v2: fmtChartJS(config, 1 * data[i].value, config.fmtV2), - v3: fmtChartJS(config, cumvalue, config.fmtV3), - v4: fmtChartJS(config, totvalue, config.fmtV4), - v5: fmtChartJS(config, segmentAngle, config.fmtV5), - v6: roundToWithThousands(config, fmtChartJS(config, 100 * data[i].value / totvalue, config.fmtV6), config.roundPct), - v7 : 0, - v8 : 0, - v9 : 0, - v10 : 0, - v11: fmtChartJS(config, cumulativeAngle - segmentAngle, config.fmtV11), - v12: fmtChartJS(config, cumulativeAngle, config.fmtV12), - v13: fmtChartJS(config, i, config.fmtV13), - lgtxt: lgtxt, - datavalue: 1 * data[i].value, - cumvalue: cumvalue, - totvalue: totvalue, - segmentAngle: segmentAngle, - firstAngle : startAngle, - pctvalue: 100 * data[i].value / totvalue, - startAngle: cumulativeAngle, - realStartAngle : realCumulativeAngle, - endAngle: cumulativeAngle+segmentAngle, - maxvalue : mxvalue, - minvalue : mnvalue, - i: i, - firstNotMissing : firstNotMissing, - lastNotMissing : lastNotMissing, - prevNotMissing : prevNotMissing, - prevMissing : prevMissing, - nextNotMissing : -1, - radiusOffset : 0, - midPosX : 0, - midPosY : 0, - int_radius : 0, - ext_radius : 0, - data: data - }; - cumulativeAngle += segmentAngle; - realCumulativeAngle -= segmentAngle; - if(prevNotMissing != -1) result[prevNotMissing].nextNotMissing=i; - prevNotMissing = i; - } else { - result[i]={ - v1:lgtxt, - maxvalue : mxvalue, - minvalue : mnvalue, - i: i, - firstNotMissing : firstNotMissing, - lastNotMissing : lastNotMissing, - prevNotMissing : prevNotMissing - }; - prevMissing=i; - } - } - break; - case 0: - default : +var startAngle,segmentAngle,cumulativeAngle,realCumulativeAngle; +var MstartAngle,McumulativeAngle,MrealCumulativeAngle; +var startRadius,stopRadius; + var axis; result=[]; mxvalue=[]; @@ -6676,7 +7148,53 @@ switch(ctx.tpdata) { prevpos[0]=[]; prevpos[1]=[]; grandtotal=0; + MstartAngle=[]; + McumulativeAngle=[]; + MrealCumulativeAngle=[]; + startRadius=[]; + stopRadius=[]; + switch(ctx.tpchart) { + case "PolarArea" : + var notemptyval, prevnotemptyval; + notemptyval=[]; + prevnotemptyval=[]; + for(i=0;i0)nbnotemptyval++; + startRadius[j]=0; + stopRadius[j]=1; + } + var totWeight=1; + break; + case "Doughnut" : + case "Pie" : + var totWeight=0; + var debPos=0; + var vl1,vl2; + for(j=0;j0)segmentAngle= (realAmplitude/nbnotemptyval)/notemptyval[j]; else segmentAngle=0; } + else segmentAngle = (1 * data.datasets[i].data[j] / totvalue[axis][j]) * realAmplitude; + if (segmentAngle >= Math.PI * 2) segmentAngle = Math.PI * 2 - 0.001; // bug on Android when segmentAngle is >= 2*PI; + result[i][j]= { + config: config, + v1: fmtChartJS(config, lgtxt, config.fmtV1), + v2: fmtChartJS(config, lgtxt2, config.fmtV2), + v3: fmtChartJS(config, 1 * data.datasets[i].data[j], config.fmtV3), + v4: fmtChartJS(config, cumvalue[axis][j], config.fmtV4), + v5: fmtChartJS(config, totvalue[axis][j], config.fmtV5), + v6: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[axis][j], config.fmtV6), config.roundPct), + v6T: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / grandtotal, config.fmtV6T), config.roundPct), + v7 : 0, + v8 : 0, + v9 : 0, + v10 : 0, + v11: fmtChartJS(config, i, config.fmtV11), + v12: fmtChartJS(config, j, config.fmtV12), + v13 : fmtChartJS(config, segmentAngle, config.fmtV13), + v14 : fmtChartJS(config, McumulativeAngle[j] , config.fmtV14), + v15 : fmtChartJS(config, McumulativeAngle[j] + segmentAngle, config.fmtV15), + lgtxt: lgtxt, + lgtxt2: lgtxt2, + datavalue: 1 * data.datasets[i].data[j], + cumvalue: cumvalue[axis][j], + totvalue: totvalue[axis][j], + pctvalue: 100 * data.datasets[i].data[j] / totvalue[axis][j], + pctvalueT: 100 * data.datasets[i].data[j] / grandtotal, + maxvalue : mxvalue[axis][j], + minvalue : mnvalue[axis][j], + lmaxvalue : lmaxvalue[axis][i], + lminvalue : lminvalue[axis][i], + grandtotal : grandtotal, + firstNotMissing : firstNotMissingj[j], + lastNotMissing : lastNotMissingj[j], + prevNotMissing : prevnotemptyj, + prevMissing : prevemptyj, + nextNotMissing : -1, + segmentAngle: segmentAngle, + firstAngle : MstartAngle[j], + startAngle: McumulativeAngle[j], + realStartAngle : MrealCumulativeAngle[j], + endAngle: McumulativeAngle[j]+segmentAngle, + radiusOffset : 0, + midPosX : 0, + midPosY : 0, + int_radius : 0, + ext_radius : 0, + startRadius : startRadius[j]/totWeight, + stopRadius : stopRadius[j]/totWeight, + totRadiusWeight : totWeight, + j: j, + i: i, + data: data + }; + McumulativeAngle[j] =McumulativeAngle[j]+ segmentAngle; + MrealCumulativeAngle[j] =MrealCumulativeAngle[j]- segmentAngle; + break; case "Bar" : case "StackedBar" : case "HorizontalBar" : @@ -6829,13 +7438,27 @@ switch(ctx.tpdata) { default: break; } - if(!(typeof(data.datasets[i].data[j]) == 'undefined')) { - if(prevnotemptyj!= -1) {for(k=prevnotemptyj;k=0;t--){ + if(typeof data.special[t].posi == "undefined" || typeof data.special[t].posj == "undefined") continue; + if(data.special[t].posi!=posi || data.special[t].posj != posj || posi==-1 || posj==-1) continue; + if(typeof data.special[t][varname]!="undefined") { + return data.special[t][varname]; + } + } + } + } if(typeof optionvar == "undefined") { if(typeof defaultvalue=="function") return defaultvalue(reference,ctx,data,statData,posi,posj,othervars); else if(typeof defaultvalue == "object") { -// if(posj==-1) - rv=defaultvalue[Math.min(defaultvalue.length-1,Math.max(0,posi))]; -// else rv=defaultvalue[Math.min(defaultvalue.length-1,Math.max(0,posj))]; + if (config_on_posi)rv=defaultvalue[Math.min(defaultvalue.length-1,Math.max(0,posi))]; + else rv=defaultvalue[Math.min(defaultvalue.length-1,Math.max(0,posj))]; } else { rv=defaultvalue; @@ -7294,7 +7925,7 @@ function tpdraw(ctx,dataval) { return tp; }; -function setTextBordersAndBackground(ctx,text,fontsize,xpos,ypos,borders,borderscolor,borderswidth,bordersxspace,bordersyspace,bordersstyle,backgroundcolor,optiongroup) { +function setTextBordersAndBackground(ctx,text,fontsize,xpos,ypos,borders,borderscolor,borderswidth,bordersxspace,bordersyspace,bordersstyle,backgroundcolor,optiongroup,BordersRadius) { var textHeight,textWidth; // compute text width and text height; if(typeof text != "string") { @@ -7340,8 +7971,9 @@ function setTextBordersAndBackground(ctx,text,fontsize,xpos,ypos,borders,borders ctx.save(); ctx.fillStyle=backgroundcolor; - ctx.fillRect(xright-bordersxspace,ybottom+bordersyspace,xleft-xright+2*bordersxspace,ytop-ybottom-2*bordersyspace); - ctx.stroke(); +// ctx.fillRect(xright-bordersxspace,ybottom+bordersyspace,xleft-xright+2*bordersxspace,ytop-ybottom-2*bordersyspace); +// ctx.stroke(); + ctx.drawRectangle({x:xright-bordersxspace,y:ybottom+bordersyspace,width:xleft-xright+2*bordersxspace,height:ytop-ybottom-2*bordersyspace,borderRadius:BordersRadius,fill:true,stroke:false}) ctx.restore(); ctx.fillStyle="black"; } @@ -7353,8 +7985,9 @@ function setTextBordersAndBackground(ctx,text,fontsize,xpos,ypos,borders,borders ctx.strokeStyle= borderscolor; ctx.fillStyle= borderscolor; ctx.setLineDash(lineStyleFn(bordersstyle)); - ctx.rect(xright-borderswidth/2-bordersxspace,ytop-borderswidth/2-bordersyspace,xleft-xright+borderswidth+2*bordersxspace,ybottom-ytop+borderswidth+2*bordersyspace); - ctx.stroke(); + ctx.drawRectangle({x:xright-bordersxspace,y:ybottom+bordersyspace,width:xleft-xright+2*bordersxspace,height:ytop-ybottom-2*bordersyspace,borderRadius:BordersRadius,fill:false,stroke:true}) +// ctx.rect(xright-borderswidth/2-bordersxspace,ytop-borderswidth/2-bordersyspace,xleft-xright+borderswidth+2*bordersxspace,ybottom-ytop+borderswidth+2*bordersyspace); +// ctx.stroke(); ctx.setLineDash([]); ctx.restore(); } @@ -7362,6 +7995,7 @@ function setTextBordersAndBackground(ctx,text,fontsize,xpos,ypos,borders,borders ctx.restore(); }; + function calculatePieDrawingSize(ctx,msr,config,data,statData) { var realCumulativeAngle = (((config.startAngle * (Math.PI / 180) + 2 * Math.PI) % (2 * Math.PI)) + 2* Math.PI) % (2* Math.PI) ; @@ -7405,24 +8039,28 @@ function calculatePieDrawingSize(ctx,msr,config,data,statData) { doughnutRadius = Math.min(doughnutRadius, (msr.availableWidth/2) -5); realAvailableWidth=(msr.availableWidth/2) -5 } + + // Computerange Pie Radius - if (isBooleanOptionTrue(undefined,config.inGraphDataShow) && setOptionValue(1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,0,-1,{nullValue : true} ) == 3 && setOptionValue(1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,0,-1,{nullValue: true }) == "off-center" && setOptionValue(1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,0,-1,{nullValue : true} ) == 0) { - doughnutRadius = doughnutRadius - setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,0,-1,{nullValue : true} ) - setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,0,-1,{nullValue: true} ) - 5; + var j=data.labels.length-1; + if (isBooleanOptionTrue(undefined,config.inGraphDataShow) && setOptionValue(false,true,1,"INGRAPHDATARADIUSPOSITION",ctx,data,statData,undefined,config.inGraphDataRadiusPosition,"inGraphDataRadiusPosition",0,j,{nullValue : true} ) == 3 && setOptionValue(false,true,1,"INGRAPHDATAALIGN",ctx,data,statData,undefined,config.inGraphDataAlign,"inGraphDataAlign",0,j,{nullValue: true }) == "off-center" && setOptionValue(false,true,1,"INGRAPHDATAROTATE",ctx,data,statData,undefined,config.inGraphDataRotate,"inGraphDataRotate",0,j,{nullValue : true} ) == 0) { + doughnutRadius = doughnutRadius - setOptionValue(false,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",0,j,{nullValue : true} ) - setOptionValue(false,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",0,j,{nullValue: true} ) - 5; var posAngle; - for (var i = 0; i < data.length; i++) { - if (!(typeof(data[i].value) == 'undefined') && 1*data[i].value>=0) { - ctx.font = setOptionValue(1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,i,-1,{nullValue : true} ) + ' ' + setOptionValue(ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,i,-1,{nullValue : true} ) + 'px ' + setOptionValue(1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,i,-1,{nullValue : true} ); - if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i].segmentAngle / 2 + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - else if (setOptionValue(1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,i,-1,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i].segmentAngle + setOptionValue(1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,i,-1,{nullValue: true }) * (Math.PI / 180); - realCumulativeAngle -= statData[i].segmentAngle; - var dispString = tmplbis(setOptionValue(1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,i,-1,{nullValue : true} ), statData[i],config); - var textMeasurement = ctx.measureText(dispString).width; - var MaxRadiusX = Math.abs((realAvailableWidth - textMeasurement) / Math.cos(posAngle)) - setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,i,-1,{nullValue: true} ) - 5; + for (var i = 0; i < data.datasets.length; i++) { + if (!(typeof(data.datasets[i].data[j]) == 'undefined') && 1*data.datasets[i].data[j]>=0) { + ctx.font = setOptionValue(false,true,1,"INGRAPHDATAFONTSTYLE",ctx,data,statData,undefined,config.inGraphDataFontStyle,"inGraphDataFontStyle",i,j,{nullValue : true} ) + ' ' + setOptionValue(false,true,ctx.chartTextScale,"INGRAPHDATAFONTSIZE",ctx,data,statData,undefined,config.inGraphDataFontSize,"inGraphDataFontSize",i,j,{nullValue : true} ) + 'px ' + setOptionValue(false,true,1,"INGRAPHDATAFONTFAMILY",ctx,data,statData,undefined,config.inGraphDataFontFamily,"inGraphDataFontFamily",i,j,{nullValue : true} ); + if (setOptionValue(false,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 1) posAngle = realCumulativeAngle + setOptionValue(false,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(false,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 2) posAngle = realCumulativeAngle - statData[i][j].segmentAngle / 2 + setOptionValue(false,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + else if (setOptionValue(false,true,1,"INGRAPHDATAANGLEPOSITION",ctx,data,statData,undefined,config.inGraphDataAnglePosition,"inGraphDataAnglePosition",i,j,{nullValue : true} ) == 3) posAngle = realCumulativeAngle - statData[i][j].segmentAngle + setOptionValue(false,true,1,"INGRAPHDATAPADDINANGLE",ctx,data,statData,undefined,config.inGraphDataPaddingAngle,"inGraphDataPaddingAngle",i,j,{nullValue: true }) * (Math.PI / 180); + realCumulativeAngle -= statData[i][j].segmentAngle; + var dispString = tmplbis(setOptionValue(false,true,1,"INGRAPHDATATMPL",ctx,data,statData,undefined,config.inGraphDataTmpl,"inGraphDataTmpl",i,j,{nullValue : true} ), statData[i][j],config); + var textMeasurement = ctx.measureTextMultiLine(dispString).textWidth; + var MaxRadiusX = Math.abs((realAvailableWidth - textMeasurement) / Math.cos(posAngle)) - setOptionValue(false,true,1,"INGRAPHDATAPADDINGRADIUS",ctx,data,statData,undefined,config.inGraphDataPaddingRadius,"inGraphDataPaddingRadius",i,j,{nullValue: true} ) - 5; if (MaxRadiusX < doughnutRadius) doughnutRadius = MaxRadiusX; } } } + doughnutRadius = doughnutRadius * config.radiusScale; return { radius : doughnutRadius, @@ -7431,3 +8069,102 @@ function calculatePieDrawingSize(ctx,msr,config,data,statData) { }; }; + +function convertData(data,generate) { + +console.log("GENERATE:"+generate); + +if(generate)console.log("var data = {"); +if(generate)console.log(' labels : [""],'); +if(generate)console.log(' datasets : ['); + + var newData = { + labels : [""], + datasets: [] + } + for(var i=0;i,'); + newData.datasets[i].imageLoad=data[i].imageLoad; + } + if(typeof data[i].imagePos != "undefined") { +if(generate)console.log(' imagePos : '+data[i].imagePos+','); + newData.datasets[i].imagePos=data[i].imagePos; + } + if(typeof data[i].imageHeight != "undefined") { +if(generate)console.log(' imageHeight : '+data[i].imageHeight+','); + newData.datasets[i].imageHeight=data[i].imageHeight; + } + if(typeof data[i].imageWidth != "undefined") { +if(generate)console.log(' imageWidth : '+data[i].imageWidth+','); + newData.datasets[i].imageWidth=data[i].imageWidth; + } + if(typeof data[i].text != "undefined") { +if(generate)console.log(' text : "'+data[i].text+'",'); + newData.datasets[i].text=data[i].text; + } + if(typeof data[i].fontStyle != "undefined") { +if(generate)console.log(' fontStyle : "'+data[i].fontStyle+'",'); + newData.datasets[i].fontStyle=data[i].fontStyle; + } + if(typeof data[i].fontSize != "undefined") { +if(generate)console.log(' fontSize : '+data[i].fontSize+','); + newData.datasets[i].fontSize=data[i].fontSize; + } + if(typeof data[i].expandOutRadius != "undefined") { +if(generate)console.log(' expandOutRadius : '+data[i].expandOutRadius+','); + newData.datasets[i].expandOutRadius=data[i].expandOutRadius; + } + if(typeof data[i].expandInRadius != "undefined") { +if(generate)console.log(' expandInRadius : '+data[i].expandInRadius+','); + newData.datasets[i].expandInRadius=data[i].expandInRadius; + } + if(typeof data[i].gradientColors != "undefined") { +if(generate)console.log(' gradientColors : < put here the gradient Colors definitions> '+data[i].gradientColors+','); + newData.datasets[i].gradientColors=data[i].gradientColors; + } +if(generate) { + console.log(' nothing : true // line added to avoid a comma after last line'); + if(i==data.length-1)console.log(" }"); + else console.log(" },"); +} + } +if(generate)console.log(']'); + if(data.length>0){ + if (typeof data[0].shapesInChart !="undefined") newData.shapesInChart=data[0].shapesInChart; + +if(generate){ + console.log(" ,"); + console.log(" < put here the shapesInChart >"); +} + } +if(generate)console.log("};"); + return newData; +} diff --git a/xstatic/pkg/chartnew_js/data/ChartNew.min.js b/xstatic/pkg/chartnew_js/data/ChartNew.min.js index 7c5143d..04753ac 100644 --- a/xstatic/pkg/chartnew_js/data/ChartNew.min.js +++ b/xstatic/pkg/chartnew_js/data/ChartNew.min.js @@ -1,8 +1,10 @@ -function lineStyleFn(e){return"object"==typeof chartJSLineStyle[e]?chartJSLineStyle[e]:chartJSLineStyle.solid}function roundToWithThousands(e,a,t){var i=1*unFormat(e,a);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(e,i,"none")}function unFormat(e,a){if("."==e.decimalSeparator&&""==e.thousandSeparator||"string"!=typeof a)return a;var t=""+a;if(""!=e.thousandSeparator)for(;t.indexOf(e.thousandSeparator)>=0;)t=""+t.replace(e.thousandSeparator,"");return"."!=e.decimalSeparator&&(t=""+t.replace(e.decimalSeparator,".")),1*t}function fmtChartJSPerso(e,a,t){switch(t){case"SampleJS_Format":"number"==typeof a?return_value="My Format : "+a.toString()+" $":return_value=a+"XX";break;case"Change_Month":"string"==typeof a?return_value=a.toString()+" 2014":return_value=a.toString()+"YY";break;default:return_value=a}return return_value}function fmtChartJS(e,a,t){var i;if("notformatted"==t)i=a;else if("none"==t&&"number"==typeof a){if("none"!=e.roundNumber){var l;if(e.roundNumber<=0)l=-e.roundNumber,a=+(Math.round(a+"e+"+l)+"e-"+l);else{l=e.roundNumber;var n="1e+"+l;a=+Math.round(a/n)*n}}if("."!=e.decimalSeparator||""!=e.thousandSeparator){if(i=a.toString().replace(/\./g,e.decimalSeparator),""!=e.thousandSeparator){var o=i,s="",r=o.indexOf(e.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,e.thousandSeparator),s=s.split("").reverse().join(""),i=o,""!=s&&(i=i+e.decimalSeparator+s)}}else i=a}else i="none"!=t&&"notformatted"!=t?fmtChartJSPerso(e,a,t):a;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(e){return!isNaN(parseFloat(e))&&isFinite(e)}function tmplbis(e,a,t){return newstr=e,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,a)}function tmplter(e,a){for(var t=["mean","varianz","stddev","cv","median"],i=new RegExp("<%=((?:(?:.*?)\\W)??)((?:"+t.join("|")+")(?:Dif)?)\\(([0-9]*?)\\)(.*?)%>","g");i.test(e);)e=e.replace(i,function(e,t,i,l,n){var o;o=l?l:2;var s=addParameters2Function(a,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(e)?cachebis[e]=cachebis[e]||tmplter(document.getElementById(e).innerHTML):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.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 a?l(a):l}function createCursorDiv(){if(0==cursorDivCreated){var e=document.createElement("divCursor");e.id="divCursor",e.style.position="absolute",document.body.appendChild(e),cursorDivCreated=!0}}function addResponsiveChart(e,a,t,i){initChartResize();var l=resizeGraph(a,i);"undefined"!=typeof a.prevWidth?(resizeCtx(a,l.newWidth,l.newHeight,i),a.prevWidth=l.newWidth):i.responsiveScaleContent&&i.responsiveWindowInitialWidth&&(a.initialWidth=l.newWidth),a.prevWidth=l.newWidth,a.prevHeight=l.newHeight,jsGraphResize[jsGraphResize.length]=[e,a.tpchart,a,t,i]}function initChartResize(){0==initChartJsResize&&(window.addEventListener?window.addEventListener("resize",chartJsResize):window.attachEvent("resize",chartJsResize))}function getMaximumWidth(e){return null!=e.parentNode&&void 0!=e.parentNode&&(container=e.parentNode),container.clientWidth}function getMaximumHeight(e){return null!=e.parentNode&&void 0!=e.parentNode&&(container=e.parentNode),container.clientHeight}function resizeCtx(e,a,t,i){"undefined"==typeof e.DefaultchartTextScale&&(e.DefaultchartTextScale=i.chartTextScale),"undefined"==typeof e.DefaultchartLineScale&&(e.DefaultchartLineScale=i.chartLineScale),"undefined"==typeof e.DefaultchartSpaceScale&&(e.DefaultchartSpaceScale=i.chartSpaceScale),e.canvas.height=t,e.canvas.width=a,"undefined"!=typeof e.chartTextScale&&i.responsiveScaleContent&&(e.chartTextScale=e.DefaultchartTextScale*(a/e.initialWidth),e.chartLineScale=e.DefaultchartLineScale*(a/e.initialWidth),e.chartSpaceScale=e.DefaultchartSpaceScale*(a/e.initialWidth))}function resizeGraph(e,a){"undefined"==typeof a.maintainAspectRatio&&(a.maintainAspectRatio=!0),"undefined"==typeof a.responsiveMinWidth&&(a.responsiveMinWidth=0),"undefined"==typeof a.responsiveMinHeight&&(a.responsiveMinHeight=0),"undefined"==typeof a.responsiveMaxWidth&&(a.responsiveMaxWidth=9999999),"undefined"==typeof a.responsiveMaxHeight&&(a.responsiveMaxHeight=9999999);var t=e.canvas;"undefined"==typeof e.aspectRatio&&(e.aspectRatio=t.width/t.height);var i=getMaximumWidth(t),l=a.maintainAspectRatio?i/e.aspectRatio:getMaximumHeight(t);return i=Math.min(a.responsiveMaxWidth,Math.max(a.responsiveMinWidth,i)),l=Math.min(a.responsiveMaxHeight,Math.max(a.responsiveMinHeight,l)),{newWidth:parseInt(i),newHeight:parseInt(l)}}function chartJsResize(){for(var e=0;e-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(e,a){this.x=e,this.y=a,this.css.left=this.x+"px",this.css.top=this.y+"px"}function isIE(){var e=navigator.userAgent.toLowerCase();return-1!=e.indexOf("msie")?parseInt(e.split("msie")[1]):!1}function mergeChartConfig(e,a){var t={};for(var i in e)t[i]=e[i];for(var l in a)t[l]=a[l];return t}function sleep(e){var a=new Date;for(a.setTime(a.getTime()+e);(new Date).getTime()=window.pageXOffset&&a+e.width/2<=window.pageXOffset+window.innerWidth&&t+e.height/2>=window.pageYOffset&&t+e.height/2<=window.pageYOffset+window.innerHeight?!0:!1}function scrollFunction(){for(var e=0;emyStatData.int_radius&&distancemyStatData.startAngle&&anglemyStatData.startAngle-2*Math.PI&&anglemyStatData.startAngle+2*Math.PI&&anglewindow.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)}else if("RECT"==jsGraphAnnotate[ctx.ChartNewId][i][0]){if(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-bottomYleftX&&canvas_pos.xbottomY&&(myStatData.graphPosX=canvas_pos.x,myStatData.graphPosY=canvas_pos.y,onData=!0,"annotate"==action&&jsGraphAnnotate[ctx.ChartNewId][i][4]?(dispString=tmplbis(setOptionValue(1,"ANNOTATELABEL",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],void 0,config.annotateLabel,jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],{otherVal:!0}),myStatData,config),textMsr=ctx.measureTextMultiLine(dispString,1*annotateDIV.style.fontSize.replace("pt","")),ctx.restore(),annotateDIV.innerHTML=dispString,show=!0):"function"==typeof funct&&funct(event,ctx,config,data,myStatData),"annotate"==action&&jsGraphAnnotate[ctx.ChartNewId][i][4]))if(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)}else if("POINT"==jsGraphAnnotate[ctx.ChartNewId][i][0]){myStatData=jsGraphAnnotate[ctx.ChartNewId][i][3][jsGraphAnnotate[ctx.ChartNewId][i][1]][jsGraphAnnotate[ctx.ChartNewId][i][2]];var distance;if(config.detectAnnotateOnFullLine)if(canvas_pos.xMath.max(myStatData.annotateStartPosX,myStatData.annotateEndPosX)+Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)||canvas_pos.yMath.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));if(distancewindow.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)}"annotate"==action&&jsGraphAnnotate[ctx.ChartNewId][i][4]&&(annotateDIV.style.display=show?"":"none",show&&annotatePrevShow!=i&&(annotatePrevShow>=0&&"function"==typeof config.annotateFunctionOut&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][0]?config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],-1,null):config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][2],null)),annotatePrevShow=i,"function"==typeof config.annotateFunctionIn&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][i][0]?config.annotateFunctionIn("INANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],jsGraphAnnotate[ctx.ChartNewId][i][1],-1,null):config.annotateFunctionIn("INANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][i][3],jsGraphAnnotate[ctx.ChartNewId][i][1],jsGraphAnnotate[ctx.ChartNewId][i][2],null))))}0==show&&"annotate"==action&&annotatePrevShow>=0&&("function"==typeof config.annotateFunctionOut&&("ARC"==jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][0]?config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],-1,null):config.annotateFunctionOut("OUTANNOTATE",ctx,data,jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][3],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][1],jsGraphAnnotate[ctx.ChartNewId][annotatePrevShow][2],null)),annotatePrevShow=-1);var inRect;if("annotate"!=action){if(config.detectMouseOnText)for(var i=0;iMath.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p2)&&(inRect=!1),canvas_pos.yMath.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p3)&&(inRect=!1);else if(Math.abs(jsTextMousePos[ctx.ChartNewId][i][2].p1-jsTextMousePos[ctx.ChartNewId][i][2].p2)Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p3)&&(inRect=!1),canvas_pos.yMath.max(jsTextMousePos[ctx.ChartNewId][i][3].p1,jsTextMousePos[ctx.ChartNewId][i][3].p2)&&(inRect=!1);else{var 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.yMath.max(y1,y2)&&(inRect=!1),canvas_pos.yMath.max(y3,y4)&&(inRect=!1)}inRect&&(onData=!0,funct(event,ctx,config,data,{type:"CLICKONTEXT",values:jsTextMousePos[ctx.ChartNewId][i]}))}0==onData&&funct(event,ctx,config,data,null)}}function animationCorrection(e,a,t,i,l,n){var o=e,s=0;if(-1!=l){1>o&&io&&lo&&t.animationByDataset){o=0,r=0;var h=t.animationStartWithDataset-1;t.animationStartWithDataset-1==-1&&(h=0);var d=t.animationSteps/(a.datasets.length-h);if(e>=(i-h+1)*d/t.animationSteps)o=1;else if(e>=(i-h)*d/t.animationSteps){var u=e-(i-h)*d/t.animationSteps;t.animationLeftToRight?c=u*(a.datasets.length-h):o=u*(a.datasets.length-h),r=1}}if(1==r&&1>o&&t.animationLeftToRight){o=0;var p=t.animationStartWithData-1;t.animationStartWithData-1==-1&&(p=0);var S=t.animationSteps/(a.datasets[i].data.length-p-1+n);c>=(l-p)*S/t.animationSteps&&(o=1,c<=(l+1-p)*S/t.animationSteps&&(s=(a.datasets[i].data.length-p-1)*(c-(l-p)*S/t.animationSteps)))}}else 1>o&&i=t.firstLabelToShow-1&&(i+t.firstLabelToShow-1)%parseInt(l)==0?!0:!1),l}function showYLabels(e,a,t,i,l){var n=setOptionValue(1,"SHOWYLABEL",e,a,void 0,void 0,t.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(e,a,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(e.xLegendBorderPos,e.yLegendBorderPos),i.lineTo(e.xLegendBorderPos,e.yLegendBorderPos+e.legendBorderHeight),i.lineTo(e.xLegendBorderPos+e.legendBorderWidth,e.yLegendBorderPos+e.legendBorderHeight),i.lineTo(e.xLegendBorderPos+e.legendBorderWidth,e.yLegendBorderPos),i.lineTo(e.xLegendBorderPos,e.yLegendBorderPos),i.stroke(),i.closePath(),i.setLineDash([]),i.fillStyle="rgba(0,0,0,0)",i.fillStyle=t.legendFillColor,i.fill(),i.restore()),nbcols=e.nbLegendCols-1,ypos=e.yFirstLegendTextPos-(Math.ceil(i.chartTextScale*t.legendFontSize)+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenTextVertical)),xpos=0,e.drawLegendOnData?fromi=a.datasets.length:fromi=a.length;for(var o=fromi-1;o>=0;o--)if(orderi=o,e.reverseLegend&&(e.drawLegendOnData?orderi=a.datasets.length-o-1:orderi=a.length-o-1),e.drawLegendOnData?tpof=typeof a.datasets[orderi].title:tpof=typeof a[orderi].title,"string"==tpof&&(n=e.drawLegendOnData?fmtChartJS(t,a.datasets[orderi].title,t.fmtLegend).trim():fmtChartJS(t,a[orderi].title,t.fmtLegend).trim(),""!=n)){nbcols++,nbcols==e.nbLegendCols?(nbcols=0,xpos=e.xFirstLegendTextPos,ypos+=Math.ceil(i.chartTextScale*t.legendFontSize)+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenTextVertical)):xpos+=e.widestLegend+Math.ceil(i.chartSpaceScale*t.legendSpaceBetweenTextHorizontal),i.save(),i.beginPath();var s=e.legendBox;if(("Bar"==i.tpchart||"StackedBar"==i.tpchart)&&("Line"!=a.datasets[orderi].type||t.datasetFill&&1!=setOptionValue(1,"LINKTYPE",i,a,statData,a.datasets[orderi].linkType,t.linkType,orderi,-1,{nullvalue:null})||(s=!1)),s)e.drawLegendOnData?i.lineWidth=Math.ceil(i.chartLineScale*setOptionValue(1,"LINEWIDTH",i,a,void 0,a.datasets[orderi].datasetStrokeWidth,t.datasetStrokeWidth,orderi,-1,{nullvalue:null})):i.lineWidth=Math.ceil(i.chartLineScale*t.datasetStrokeWidth),i.beginPath(),e.drawLegendOnData?(i.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",i,a,void 0,a.datasets[orderi].strokeColor,t.defaultFillColor,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(1,"LEGENDLINEDASH",i,a,void 0,a.datasets[orderi].datasetStrokeStyle,t.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(1,"LEGENDSTROKECOLOR",i,a,void 0,a[orderi].strokeColor,t.defaultFillColor,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(1,"LEGENDSEGMENTTROKESTYLE",i,a,void 0,a[orderi].segmentStrokeStyle,t.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(),e.drawLegendOnData?i.fillStyle=setOptionValue(1,"LEGENDFILLCOLOR",i,a,void 0,a.datasets[orderi].fillColor,t.defaultFillColor,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(1,"LEGENDFILLCOLOR",i,a,void 0,a[orderi].color,t.defaultFillColor,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(1,"LINEWIDTH",i,a,void 0,a.datasets[orderi].datasetStrokeWidth,t.datasetStrokeWidth,orderi,-1,{nullvalue:null})),t.legendColorIndicatorStrokeWidth&&t.legendColorIndicatorStrokeWidth>Math.ceil(i.chartTextScale*t.legendFontSize)&&(i.lineWidth=Math.ceil(i.chartTextScale*t.legendFontSize)),e.drawLegendOnData?(i.strokeStyle=setOptionValue(1,"LEGENDSTROKECOLOR",i,a,void 0,a.datasets[orderi].strokeColor,t.defaultFillColor,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(1,"LEGENDLINEDASH",i,a,void 0,a.datasets[orderi].datasetStrokeStyle,t.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(1,"LEGENDSTROKECOLOR",i,a,void 0,a[orderi].strokeColor,t.defaultFillColor,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(1,"LEGENDSEGMENTTROKESTYLE",i,a,void 0,a[orderi].segmentStrokeStyle,t.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(1,"LEGENDMARKERFILLCOLOR",i,a,void 0,a.datasets[orderi].pointColor,t.defaultStrokeColor,orderi,-1,{nullvalue:!0}),i.strokeStyle=setOptionValue(1,"LEGENDMARKERSTROKESTYLE",i,a,void 0,a.datasets[orderi].pointStrokeColor,t.defaultStrokeColor,orderi,-1,{nullvalue:!0}),i.lineWidth=setOptionValue(i.chartLineScale,"LEGENDMARKERLINEWIDTH",i,a,void 0,a.datasets[orderi].pointDotStrokeWidth,t.pointDotStrokeWidth,orderi,-1,{nullvalue:!0});var r=setOptionValue(1,"LEGENDMARKERSHAPE",i,a,void 0,a.datasets[orderi].markerShape,t.markerShape,orderi,-1,{nullvalue:!0}),c=setOptionValue(i.chartSpaceScale,"LEGENDMARKERRADIUS",i,a,void 0,a.datasets[orderi].pointDotRadius,t.pointDotRadius,orderi,-1,{nullvalue:!0}),h=setOptionValue(1,"LEGENDMARKERSTROKESTYLE",i,a,void 0,a.datasets[orderi].pointDotStrokeStyle,t.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(1,"LEGENDFONTCOLOR",i,a,void 0,void 0,t.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(e,a,t,i,l,n){switch(e.setLineDash(lineStyleFn(n)),i){case"square":e.rect(a-l,t-l,2*l,2*l),e.stroke(),e.fill(),e.setLineDash([]);break;case"triangle":pointA_x=0,pointA_y=2/3*l,e.moveTo(a,t-pointA_y),e.lineTo(a+pointA_y*Math.sin(4/3),t+pointA_y*Math.cos(4/3)),e.lineTo(a-pointA_y*Math.sin(4/3),t+pointA_y*Math.cos(4/3)),e.lineTo(a,t-pointA_y),e.stroke(),e.fill(),e.setLineDash([]);break;case"diamond":e.moveTo(a,t+l),e.lineTo(a+l,t),e.lineTo(a,t-l),e.lineTo(a-l,t),e.lineTo(a,t+l),e.stroke(),e.fill(),e.setLineDash([]);break;case"plus":e.moveTo(a,t-l),e.lineTo(a,t+l),e.moveTo(a-l,t),e.lineTo(a+l,t),e.stroke(),e.setLineDash([]);break;case"cross":e.moveTo(a-l,t-l),e.lineTo(a+l,t+l),e.moveTo(a-l,t+l),e.lineTo(a+l,t-l),e.stroke(),e.setLineDash([]);break;case"circle":default:e.arc(a,t,l,0,2*Math.PI*1,!0),e.stroke(),e.fill(),e.setLineDash([])}}function initPassVariableData_part1(e,a,t){var i,l,n,o,s,r,c,h,d,u,p,S,g,f,x,A,m;switch(t.tpdata){case 1:n=[];var M,T,P,v=((a.totalAmplitude*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);v<=a.zeroValue&&(v=2*Math.PI),T=((-a.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),P=((a.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),startAngle=T,c=0,notemptyval=0;var L=-1,D=-1,V=-1;for(o=-Number.MAX_VALUE,s=Number.MAX_VALUE,i=0;i=0)?(M="PolarArea"==t.tpchart?notemptyval>0?v/notemptyval:0:1*e[i].value/c*v,M>=2*Math.PI&&(M=2*Math.PI-.001),r+=1*e[i].value,n[i]={config:a,v1:fmtChartJS(a,u,a.fmtV1),v2:fmtChartJS(a,1*e[i].value,a.fmtV2),v3:fmtChartJS(a,r,a.fmtV3),v4:fmtChartJS(a,c,a.fmtV4),v5:fmtChartJS(a,M,a.fmtV5),v6:roundToWithThousands(a,fmtChartJS(a,100*e[i].value/c,a.fmtV6),a.roundPct),v7:0,v8:0,v9:0,v10:0,v11:fmtChartJS(a,T-M,a.fmtV11),v12:fmtChartJS(a,T,a.fmtV12),v13:fmtChartJS(a,i,a.fmtV13),lgtxt:u,datavalue:1*e[i].value,cumvalue:r,totvalue:c,segmentAngle:M,firstAngle:startAngle,pctvalue:100*e[i].value/c,startAngle:T,realStartAngle:P,endAngle:T+M,maxvalue:o,minvalue:s,i:i,firstNotMissing:L,lastNotMissing:D,prevNotMissing:V,prevMissing:y,nextNotMissing:-1,radiusOffset:0,midPosX:0,midPosY:0,int_radius:0,ext_radius:0,data:e},T+=M,P-=M,-1!=V&&(n[V].nextNotMissing=i),V=i):(n[i]={v1:u,maxvalue:o,minvalue:s,i:i,firstNotMissing:L,lastNotMissing:D,prevNotMissing:V},y=i);break;case 0:default:var b;for(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=[],x=[],A=[],S[0]=[],S[1]=[],m=0,i=0;i=0?(n[i][l].v4=fmtChartJS(a,-1!=S[b][l]?1*e.datasets[i].data[l]-n[S[b][l]][l].datavalue:1*e.datasets[i].data[l],a.fmtV4),n[i][l].diffprev=-1!=S[b][l]?1*e.datasets[i].data[l]-n[S[b][l]][l].datavalue:1*e.datasets[i].data[l],n[S[b][l]][l].diffnext=e.datasets[S[b][l]].data[l]-e.datasets[i].data[l],n[S[b][l]][l].v5=n[S[b][l]][l].diffnext):n[i][l].v4=1*e.datasets[i].data[l],S[b][l]=i}if("undefined"!=typeof e.datasets[i].data[l]){if(-1!=I)for(k=I;k=h&&(h=c+100),1*i.datasets[e].xPos[Math.floor(a+t.zeroValue)]>=c&&i.datasets[e].xPos[Math.floor(a+t.zeroValue)]<=h){var d=l+r*((1*i.datasets[e].xPos[Math.floor(a+t.zeroValue)]-c)/(h-c)),u=d;return Math.abs(a-Math.floor(a+t.zeroValue))>t.zeroValue&&(u=n(e,Math.ceil(a-t.zeroValue),i)),d+(a-Math.floor(a+t.zeroValue))*(u-d)}}return l+o*a}function o(e,a,t,i){if(e)return r(c(a)*i-c(t.graphMin)*i,void 0,0);var l=t.steps*t.stepValue,n=a-t.graphMin,o=r(n/l,1,0);return i*t.steps*o}function s(e,a,t){var i=a.steps*a.stepValue,l=e-a.graphMin,n=r(l/i,1,0);return t*a.steps*n}function r(e,a,t){return isNumber(a)&&e>a?a:isNumber(t)&&t>e?t:e}function c(e){return Math.log(e)/Math.LN10}var h,d,u=0;switch(i.tpdata){case 1:for(h=0;h=t.zeroValue?e[h][d].D2A=-(1/e[h][d].D1A):e[h][d].D2A=void 0);break;case"Bar":for(d=0;d0&&(1*a.datasets[h].data[d]<0?(e[h][d].yPosBottom+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),S[d]==1*a.datasets[h].data[d]&&(e[h][d].yPosBottom-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),e[h][d].yPosTop0&&(e[h][d].yPosBottom-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),p[d]==1*a.datasets[h].data[d]&&(e[h][d].yPosBottom+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),e[h][d].yPosTop>e[h][d].yPosBottom&&(e[h][d].yPosBottom=e[h][d].yPosTop))),e[h][d].v7=e[h][d].xPosLeft,e[h][d].v8=e[h][d].yPosBottom,e[h][d].v9=e[h][d].xPosRight,e[h][d].v10=e[h][d].yPosTop);break;case"HorizontalBar":for(d=0;d0&&(1*a.datasets[h].data[d]<0?(e[h][d].xPosLeft-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),S[d]==1*a.datasets[h].data[d]&&(e[h][d].xPosLeft+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),e[h][d].xPosLeft0&&(e[h][d].xPosLeft+=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar),p[d]==1*a.datasets[h].data[d]&&(e[h][d].xPosLeft-=Math.ceil(i.chartSpaceScale*t.spaceBetweenBar)/2),e[h][d].xPosLeft>e[h][d].xPosRight&&(e[h][d].xPosLeft=e[h][d].xPosRight))),e[h][d].v7=e[h][d].xPosLeft,e[h][d].v8=e[h][d].yPosBottom,e[h][d].v9=e[h][d].xPosRight,e[h][d].v10=e[h][d].yPosTop)}}}function isBooleanOptionTrue(e,a){var t;if("undefined"==typeof optionvar){if("function"==typeof a)return!0;if("object"==typeof a){for(t=0;t=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=a.topNotUsableSize+5,doughnutRadius=a.availableHeight-5):0==d[2]&&0==d[3]?(midPieY=a.topNotUsableSize+a.availableHeight,doughnutRadius=a.availableHeight-5):(midPieY=a.topNotUsableSize+a.availableHeight/2,doughnutRadius=a.availableHeight/2-5);var p;if(0==d[0]&&0==d[3]?(midPieX=a.leftNotUsableSize+a.availableWidth-5,doughnutRadius=Math.min(doughnutRadius,a.availableWidth-5),p=a.availableWidth-5):0==d[1]&&0==d[2]?(midPieX=a.leftNotUsableSize+5,doughnutRadius=Math.min(doughnutRadius,a.availableWidth-5),p=a.availableWidth-5):(midPieX=a.leftNotUsableSize+a.availableWidth/2,doughnutRadius=Math.min(doughnutRadius,a.availableWidth/2-5),p=a.availableWidth/2-5),isBooleanOptionTrue(void 0,t.inGraphDataShow)&&3==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",e,i,l,void 0,t.inGraphDataRadiusPosition,0,-1,{nullValue:!0})&&"off-center"==setOptionValue(1,"INGRAPHDATAALIGN",e,i,l,void 0,t.inGraphDataAlign,0,-1,{nullValue:!0})&&0==setOptionValue(1,"INGRAPHDATAROTATE",e,i,l,void 0,t.inGraphDataRotate,0,-1,{nullValue:!0})){doughnutRadius=doughnutRadius-setOptionValue(e.chartTextScale,"INGRAPHDATAFONTSIZE",e,i,l,void 0,t.inGraphDataFontSize,0,-1,{nullValue:!0})-setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",e,i,l,void 0,t.inGraphDataPaddingRadius,0,-1,{nullValue:!0})-5;for(var S,u=0;u=0){e.font=setOptionValue(1,"INGRAPHDATAFONTSTYLE",e,i,l,void 0,t.inGraphDataFontStyle,u,-1,{nullValue:!0})+" "+setOptionValue(e.chartTextScale,"INGRAPHDATAFONTSIZE",e,i,l,void 0,t.inGraphDataFontSize,u,-1,{nullValue:!0})+"px "+setOptionValue(1,"INGRAPHDATAFONTFAMILY",e,i,l,void 0,t.inGraphDataFontFamily,u,-1,{nullValue:!0}),1==setOptionValue(1,"INGRAPHDATAANGLEPOSITION",e,i,l,void 0,t.inGraphDataAnglePosition,u,-1,{nullValue:!0})?S=n+setOptionValue(1,"INGRAPHDATAPADDINANGLE",e,i,l,void 0,t.inGraphDataPaddingAngle,u,-1,{nullValue:!0})*(Math.PI/180):2==setOptionValue(1,"INGRAPHDATAANGLEPOSITION",e,i,l,void 0,t.inGraphDataAnglePosition,u,-1,{nullValue:!0})?S=n-l[u].segmentAngle/2+setOptionValue(1,"INGRAPHDATAPADDINANGLE",e,i,l,void 0,t.inGraphDataPaddingAngle,u,-1,{nullValue:!0})*(Math.PI/180):3==setOptionValue(1,"INGRAPHDATAANGLEPOSITION",e,i,l,void 0,t.inGraphDataAnglePosition,u,-1,{nullValue:!0})&&(S=n-l[u].segmentAngle+setOptionValue(1,"INGRAPHDATAPADDINANGLE",e,i,l,void 0,t.inGraphDataPaddingAngle,u,-1,{nullValue:!0})*(Math.PI/180)),n-=l[u].segmentAngle;var g=tmplbis(setOptionValue(1,"INGRAPHDATATMPL",e,i,l,void 0,t.inGraphDataTmpl,u,-1,{nullValue:!0}),l[u],t),f=e.measureText(g).width,x=Math.abs((p-f)/Math.cos(S))-setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",e,i,l,void 0,t.inGraphDataPaddingRadius,u,-1,{nullValue:!0})-5;x>>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 a&&a[l]===e)return l;return-1});var charJSPersonalDefaultOptions={},charJSPersonalDefaultOptionsLine={},charJSPersonalDefaultOptionsRadar={},charJSPersonalDefaultOptionsPolarArea={},charJSPersonalDefaultOptionsPie={},charJSPersonalDefaultOptionsDoughnut={},charJSPersonalDefaultOptionsBar={},charJSPersonalDefaultOptionsStackedBar={},charJSPersonalDefaultOptionsHorizontalBar={},charJSPersonalDefaultOptionsHorizontalStackedBar={},cachebis={};"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.fillTextMultiLine=function(e,a,t,i,l,n,o,s,r,c,h,d,u,p){var S=(""+e).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/gi,"\n").split("\n"),n=l.length*a,o=0;oi&&(i=t);return{textWidth:i,textHeight:1.5*n}},"function"!=typeof CanvasRenderingContext2D.prototype.setLineDash&&(CanvasRenderingContext2D.prototype.setLineDash=function(e){return 0})),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,annotatePrevShow=-1;window.Chart=function(context){function init_and_start(e,a,t){var i;if("undefined"==typeof e.initialWidth&&(e.initialWidth=e.canvas.width),"undefined"==typeof e.chartTextScale&&(e.chartTextScale=t.chartTextScale),"undefined"==typeof e.chartLineScale&&(e.chartLineScale=t.chartLineScale),"undefined"==typeof e.chartSpaceScale&&(e.chartSpaceScale=t.chartSpaceScale),"undefined"==typeof e.ChartNewId){e.runanimationcompletefunction=!0;var l=new Date,n=l.getTime();e.ChartNewId=e.tpchart+"_"+n,e._eventListeners={}}if(!dynamicFunction(a,t,e))return t.responsive&&"undefined"==typeof e.firstPass&&(t.multiGraph||addResponsiveChart(e.ChartNewId,e,a,t)),!1;if(t.responsive&&"undefined"==typeof e.firstPass){if(!t.multiGraph)return addResponsiveChart(e.ChartNewId,e,a,t),subUpdateChart(e,a,t),!1;e.firstPass=1}switch("undefined"==typeof jsGraphAnnotate[e.ChartNewId]?(jsGraphAnnotate[e.ChartNewId]=new Array,jsTextMousePos[e.ChartNewId]=new Array):t.multiGraph||clearAnnotate(e.ChartNewId),(0==t.contextMenu||"function"==typeof t.mouseDownRight)&&(e.canvas.oncontextmenu=function(e){e.preventDefault()}),e.tpdata){case 1:for(i=0;i=1*CapValue(e.animationSteps,Number.MAX_VALUE,1)||0==e.animation||3==i.firstPass||4==i.firstPass||8==i.firstPass||9==i.firstPass?S=1:S>=1&&(S=.9999),!e.animation||isIE()<9&&0!=isIE()||!e.clearRect||i.clearRect(l,n,o,s),dispCrossImage(i,e,r,c,h,d,!1,u,S,f),dispCrossText(i,e,r,c,h,d,!1,u,S,f),"function"==typeof e.beforeDrawFunction&&e.beforeDrawFunction("BEFOREDRAWFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:e,borderX:h,borderY:d,midPosX:r,midPosY:c}),e.scaleOverlay?(t(S),"function"==typeof e.endDrawDataFunction&&e.endDrawDataFunction("ENDDATAFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:e,borderX:h,borderY:d,midPosX:r,midPosY:c}),a(),"function"==typeof e.endDrawScaleFunction&&e.endDrawScaleFunction("ENDSCALEFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:e,borderX:h,borderY:d,midPosX:r,midPosY:c})):(a(),"function"==typeof e.endDrawScaleFunction&&e.endDrawScaleFunction("ENDSCALEFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:e,borderX:h,borderY:d,midPosX:r,midPosY:c}),t(S),"function"==typeof e.endDrawDataFunction&&e.endDrawDataFunction("ENDDATAFUNCTION",i,u,p,-1,-1,{animationValue:S,cntiter:f,config:e,borderX:h,borderY:d,midPosX:r,midPosY:c})),dispCrossImage(i,e,r,c,h,d,!0,u,S,f),dispCrossText(i,e,r,c,h,d,!0,u,S,f)}function g(){f+=A,T+=A*m,f==e.animationSteps||0==e.animation||3==i.firstPass||4==i.firstPass||8==i.firstPass||9==i.firstPass?T=1:T>=1&&(T=.999),S(),-1==A&&P>=f?("function"==typeof e.onAnimationComplete&&1==i.runanimationcompletefunction&&e.onAnimationComplete(i,e,u,0,x+1),A=1,requestAnimFrame(g)):T1)&&(e.animation.StartValue=0),(e.animationStopValue<0||e.animationStopValue>1)&&(e.animation.StopValue=1),e.animationStopValue0&&e.animationStartValue<=1)for(;Ta.zeroValue?Math.floor(n/(1*Math.pow(10,p)))*Math.pow(10,p):0,r=Math.abs(l)>a.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>a.zeroValue&&r%gr;)r+=g}if(c=r-s,h=Math.pow(10,p),d=Math.round(c/h),S)d=p;else{for(var A=!1;!A&&(i>d||d>t);)i>d?("number"==typeof g&&g>h/2&&(A=!0,h=g,d=Math.ceil(c/h)),A||(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>a.zeroValue&&h%gg-a.zeroValue?(h=2*h,d=Math.ceil(c/h)):(h=roundScale(a,(1+Math.floor(h/g))*g),d=Math.ceil(c/h)))),1==a.graphMaximized||"bottom"==a.graphMaximized||"undefined"!=typeof a.graphMin)for(;n>s+h&&d>=3;)s+=h,d--;if(1==a.graphMaximized||"top"==a.graphMaximized||"undefined"!=typeof a.graphMax)for(;s+(d-1)*h>=l&&d>=3;)d--}var m=[];return populateLabels(1,a,o,m,d,s,r,h),{steps:d,stepValue:h,graphMin:s,labels:m,maxValue:l}}function roundScale(e,a){var t=0,i=""+e.yAxisMinimumInterval;return i.indexOf(".")>0&&(t=i.substr(i.indexOf(".")).length),Math.round(a*Math.pow(10,t))/Math.pow(10,t)}function calculateOrderOfMagnitude(e){return 0==e?0:Math.floor(Math.log(e)/Math.LN10)}function populateLabels(e,a,t,i,l,n,o,s){var r;if(2==e?(r=a.logarithmic2,fmtYLabel=a.fmtYLabel2):(r=a.logarithmic,fmtYLabel=a.fmtYLabel),t){var c;if(r){var h=n;for(c=0;l+1>c;c++)i.push(tmpl(t,{value:fmtChartJS(a,1*h.toFixed(getDecimalPlaces(h)),fmtYLabel)},a)),h*=10}else for(c=0;l+1>c;c++)i.push(tmpl(t,{value:fmtChartJS(a,1*(n+s*c).toFixed(getDecimalPlaces(s)),fmtYLabel)},a))}}function Max(e){return Math.max.apply(Math,e)}function Min(e){return Math.min.apply(Math,e)}function Default(e,a){return e?e:a}function CapValue(e,a,t){return isNumber(a)&&e>a?a:isNumber(t)&&t>e?t:e}function getDecimalPlaces(e){var a=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return a?Math.max(0,(a[1]?a[1].length:0)-(a[2]?+a[2]:0)):0}function mergeChartConfig(e,a){var t={};for(var i in e)t[i]=e[i];for(var l in a)t[l]=a[l];return t}function tmpl(e,a,t){return newstr=e,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,a)}function tmplpart2(e,a){var t=/\W/.test(e)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+e.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):cache[e]=cache[e]||tmplpart2(document.getElementById(e).innerHTML);return a?t(a):t}function dispCrossText(e,a,t,i,l,n,o,s,r,c){var h,d,u,p,S,g;for(h=0;hC?K.textWidth:C,F=K.textHeight>F?K.textHeight:F);C=0;Z--)"string"==typeof n[Z]&&showYLabels(t,e,a,Z,n[Z])&&""!=n[Z].trim()&&(K=t.measureTextMultiLine(fmtChartJS(a,n[Z],a.fmtYLabel),Math.ceil(t.chartTextScale*a.scaleFontSize)),k=K.textWidth>k?K.textWidth:k,E=K.textHeight>E?K.textHeight:E);if(k=0;Z--)"string"==typeof o[Z]&&""!=o[Z].trim()&&(K=t.measureTextMultiLine(fmtChartJS(a,o[Z],a.fmtYLabel2),Math.ceil(t.chartTextScale*a.scaleFontSize)),z=K.textWidth>z?K.textWidth:z,W=K.textHeight>W?K.textHeight:W);else z=k;z=0;Z--)"string"==typeof e.datasets[Z].title&&""!=e.datasets[Z].title.trim()&&(L++,q=t.measureText(fmtChartJS(a,e.datasets[Z].title,a.fmtLegend)).width,v=q>v?q:v);else for(Z=e.length-1;Z>=0;Z--)"string"==typeof e[Z].title&&""!=e[Z].title.trim()&&(L++,q=t.measureText(fmtChartJS(a,e[Z].title,a.fmtLegend)).width,v=q>v?q:v);if(L>1||1==L&&a.showSingleLegend){v+=Math.ceil(t.chartTextScale*a.legendBlockSize)+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenBoxAndText),1==a.legendPosY||2==a.legendPosY||3==a.legendPosY?availableLegendWidth=availableWidth-Math.ceil(t.chartSpaceScale*Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText))-Math.ceil(t.chartSpaceScale*a.legendSpaceRightText):availableLegendWidth=l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-2*p-Math.ceil(t.chartSpaceScale*Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText))-Math.ceil(t.chartSpaceScale*a.legendSpaceRightText),1==a.legendBorders&&(availableLegendWidth-=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceLeft)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceRight)),maxLegendOnLine=Min([Math.floor((availableLegendWidth+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))),a.maxLegendCols]),D=Math.ceil(L/maxLegendOnLine),V=Math.ceil(L/D);var Q=D*(Math.ceil(t.chartTextScale*a.legendFontSize)+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextVertical))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextVertical)+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartSpaceScale*a.legendSpaceAfterText);switch(a.legendPosY){case 0:b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,y=Q,1==a.legendBorders?(B=topNotUsableSize+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartLineScale*a.legendBordersWidth)/2,I=B+Math.ceil(t.chartLineScale*a.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*a.legendFontSize),y+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),O=Math.floor(b-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2),J=Math.ceil(y-Math.ceil(t.chartLineScale*a.legendBordersWidth))-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),j=Math.ceil(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)):I=topNotUsableSize+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartLineScale*a.legendBordersWidth)/2,T>0&&(P+=y,1==a.legendBorders&&(B-=T),I-=T),topNotUsableSize+=y;break;case 1:y=Q,b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,I=topNotUsableSize+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*a.legendFontSize),1==a.legendBorders&&(I+=Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartLineScale*a.legendBordersWidth),B=I-Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*a.legendFontSize)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2,y+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),O=Math.floor(b-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2),J=Math.ceil(y-Math.ceil(t.chartLineScale*a.legendBordersWidth))-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),j=Math.ceil(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText));break;case 2:y=Q,b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,I=topNotUsableSize+(i-topNotUsableSize-bottomNotUsableHeightWithoutXLabels-y)/2+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*a.legendFontSize),1==a.legendBorders&&(I+=Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),B=I-Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*a.legendFontSize)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2,y+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),O=Math.floor(b-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2),J=Math.ceil(y-Math.ceil(t.chartLineScale*a.legendBordersWidth))-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),j=Math.ceil(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText));break;case-2:y=Q,b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,I=(i-y)/2+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*a.legendFontSize),1==a.legendBorders&&(I+=Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),B=I-Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*a.legendFontSize)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2,y+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),O=Math.floor(b-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2),J=Math.ceil(y-Math.ceil(t.chartLineScale*a.legendBordersWidth))-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),j=Math.ceil(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText));break;case 3:y=Q,b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,availableHeight=i-topNotUsableSize-bottomNotUsableHeightWithoutXLabels,I=topNotUsableSize+availableHeight-y+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*a.legendFontSize),1==a.legendBorders&&(I-=Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter)+Math.ceil(t.chartLineScale*a.legendBordersWidth),B=I-Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)-Math.ceil(t.chartTextScale*a.legendFontSize)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2,y+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),O=Math.floor(b-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2),J=Math.ceil(y-Math.ceil(t.chartLineScale*a.legendBordersWidth))-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),j=Math.ceil(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText));break;default:y=Q,I=i-p-Math.ceil(t.chartSpaceScale*a.spaceBottom)-m-y+Math.ceil(t.chartSpaceScale*a.legendSpaceBeforeText)+Math.ceil(t.chartTextScale*a.legendFontSize),b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,1==a.legendBorders&&(y+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),I-=Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),B=Math.floor(i-p-Math.ceil(t.chartSpaceScale*a.spaceBottom)-m-y+Math.ceil(t.chartLineScale*a.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)),O=Math.floor(b-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2),J=Math.ceil(y-Math.ceil(t.chartLineScale*a.legendBordersWidth))-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceBefore)-Math.ceil(t.chartSpaceScale*a.legendBordersSpaceAfter),j=Math.ceil(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)),S-=y,bottomNotUsableHeightWithoutXLabels+=y}var $=Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)+V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText);switch(1==a.legendBorders&&($+=2*Math.ceil(t.chartLineScale*a.legendBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceLeft)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceRight)),a.legendPosX){case 0:case 1:b=Math.ceil(t.chartSpaceScale*a.spaceLeft)+a.canvasBorders*Math.ceil(t.chartLineScale*a.canvasBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText),1==a.legendBorders&&(b+=Math.ceil(t.chartLineScale*a.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceLeft),O=Math.ceil(t.chartSpaceScale*a.spaceLeft)+a.canvasBorders*Math.ceil(t.chartLineScale*a.canvasBordersWidth)+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceLeft)),0==a.legendPosX&&(a.legendPosY>=1&&a.legendPosY<=3||-2==a.legendPosY)&&(Y+=$,N+=$);break;case 2:b=Y+(l-X-Y)/2-(Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)-Math.ceil(t.chartSpaceScale*a.legendSpaceRightText))-(V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))-Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))/2,1==a.legendBorders&&(b-=Math.ceil(t.chartLineScale*a.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceRight),O=b-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText));break;case 3:case 4:b=l-X-Math.ceil(t.chartSpaceScale*a.legendSpaceRightText)-V*(v+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal))+Math.ceil(t.chartSpaceScale*a.legendSpaceBetweenTextHorizontal)/2,1==a.legendBorders&&(b-=Math.ceil(t.chartLineScale*a.legendBordersWidth)/2+Math.ceil(t.chartSpaceScale*a.legendBordersSpaceRight),O=b-Math.ceil(t.chartLineScale*a.legendBordersWidth)/2-Math.ceil(t.chartSpaceScale*a.legendSpaceLeftText)),4==a.legendPosX&&(a.legendPosY>=1&&a.legendPosY<=3||-2==a.legendPosY)&&(X+=$,G-=$)}1==a.legendBorders&&(B+=Math.ceil(t.chartSpaceScale*a.legendYPadding),O+=Math.ceil(t.chartSpaceScale*a.legendXPadding)),I+=Math.ceil(t.chartSpaceScale*a.legendYPadding),b+=Math.ceil(t.chartSpaceScale*a.legendXPadding)}}if(xLabelWidth=0,bottomNotUsableHeightWithXLabels=bottomNotUsableHeightWithoutXLabels,c&&(a.xAxisBottom||a.xAxisTop)){var ee,ae;0==r?(ee=C,ae=F,nblab=e.labels.length):(ee=k,ae=E,nblab=n.length),"smart"==a.rotateLabels?(U=0,(availableWidth+Math.ceil(t.chartTextScale*a.xAxisSpaceBetweenLabels))/nblabU&&(U=0),U>180&&(U=180)),U>90&&(U+=180),H=Math.abs(Math.sin(U*Math.PI/180)*ee)+Math.abs(Math.sin((U+90)*Math.PI/180)*ae)+Math.ceil(t.chartSpaceScale*a.xAxisSpaceBefore)+Math.ceil(t.chartSpaceScale*a.xAxisSpaceAfter),_=i-p-Math.ceil(t.chartSpaceScale*a.spaceBottom)-m-w-(H-Math.ceil(t.chartSpaceScale*a.xAxisSpaceBefore))-Math.ceil(t.chartTextScale*a.graphSpaceAfter),xLabelWidth=Math.abs(Math.cos(U*Math.PI/180)*ee)+Math.abs(Math.cos((U+90)*Math.PI/180)*ae),Y=Max([Y,p+Math.ceil(t.chartSpaceScale*a.spaceLeft)+xLabelWidth/2]),X=Max([X,p+Math.ceil(t.chartSpaceScale*a.spaceRight)+xLabelWidth/2]),availableWidth=l-Y-X,a.legend&&a.xAxisBottom&&4==a.legendPosY&&(_-=y),bottomNotUsableHeightWithXLabels=bottomNotUsableHeightWithoutXLabels+H}else availableWidth=l-Y-X;if(availableHeight=i-topNotUsableSize-bottomNotUsableHeightWithXLabels,dispCrossImage(t,a,l/2,i/2,l/2,i/2,!1,e,-1,-1),"function"==typeof a.initFunction&&a.initFunction("INITFUNCTION",t,e,null,-1,-1,{animationValue:0,cntiter:0,config:a,borderX:0,borderY:0,midPosX:0,midPosY:0}),"nihil"!=n){p>0&&(t.save(),t.beginPath(),t.lineWidth=2*p,t.setLineDash(lineStyleFn(a.canvasBordersStyle)),t.strokeStyle=a.canvasBordersColor,t.moveTo(0,0),t.lineTo(0,i),t.lineTo(l,i),t.lineTo(l,0),t.lineTo(0,0),t.stroke(),t.setLineDash([]),t.restore()),g>0&&(t.save(),t.beginPath(),t.font=a.graphTitleFontStyle+" "+Math.ceil(t.chartTextScale*a.graphTitleFontSize).toString()+"px "+a.graphTitleFontFamily,t.fillStyle=a.graphTitleFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,a.graphTitle,Math.ceil(t.chartTextScale*a.graphTitleFontSize),Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight))/2,f,a.graphTitleBorders,a.graphTitleBordersColor,Math.ceil(t.chartLineScale*a.graphTitleBordersWidth),Math.ceil(t.chartSpaceScale*a.graphTitleBordersXSpace),Math.ceil(t.chartSpaceScale*a.graphTitleBordersYSpace),a.graphTitleBordersStyle,a.graphTitleBackgroundColor,"GRAPHTITLE"),t.translate(Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight))/2,f),t.fillTextMultiLine(a.graphTitle,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.graphTitleFontSize),!0,a.detectMouseOnText,t,"TITLE_TEXTMOUSE",0,Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight))/2,f,-1,-1),t.stroke(),t.restore()),x>0&&(t.save(),t.beginPath(),t.font=a.graphSubTitleFontStyle+" "+Math.ceil(t.chartTextScale*a.graphSubTitleFontSize).toString()+"px "+a.graphSubTitleFontFamily,t.fillStyle=a.graphSubTitleFontColor, -t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,a.graphSubTitle,Math.ceil(t.chartTextScale*a.graphSubTitleFontSize),Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight))/2,A,a.graphSubTitleBorders,a.graphSubTitleBordersColor,Math.ceil(t.chartLineScale*a.graphSubTitleBordersWidth),Math.ceil(t.chartSpaceScale*a.graphSubTitleBordersXSpace),Math.ceil(t.chartSpaceScale*a.graphSubTitleBordersYSpace),a.graphSubTitleBordersStyle,a.graphSubTitleBackgroundColor,"GRAPHSUBTITLE"),t.translate(Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight))/2,A),t.fillTextMultiLine(a.graphSubTitle,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.graphSubTitleFontSize),!0,a.detectMouseOnText,t,"SUBTITLE_TEXTMOUSE",0,Math.ceil(t.chartSpaceScale*a.spaceLeft)+(l-Math.ceil(t.chartSpaceScale*a.spaceLeft)-Math.ceil(t.chartSpaceScale*a.spaceRight))/2,A,-1,-1),t.stroke(),t.restore()),T>0&&(a.yAxisLeft&&(t.save(),t.beginPath(),t.font=a.yAxisUnitFontStyle+" "+Math.ceil(t.chartTextScale*a.yAxisUnitFontSize).toString()+"px "+a.yAxisUnitFontFamily,t.fillStyle=a.yAxisUnitFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,a.yAxisUnit,Math.ceil(t.chartTextScale*a.yAxisUnitFontSize),Y,P,a.yAxisUnitBorders,a.yAxisUnitBordersColor,Math.ceil(t.chartLineScale*a.yAxisUnitBordersWidth),Math.ceil(t.chartSpaceScale*a.yAxisUnitBordersXSpace),Math.ceil(t.chartSpaceScale*a.yAxisUnitBordersYSpace),a.yAxisUnitBordersStyle,a.yAxisUnitBackgroundColor,"YAXISUNIT"),t.translate(Y,P),t.fillTextMultiLine(a.yAxisUnit,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.yAxisUnitFontSize),!0,a.detectMouseOnText,t,"YLEFTAXISUNIT_TEXTMOUSE",0,Y,P,-1,-1),t.stroke(),t.restore()),a.yAxisRight&&(""==a.yAxisUnit2&&(a.yAxisUnit2=a.yAxisUnit),t.save(),t.beginPath(),t.font=a.yAxisUnitFontStyle+" "+Math.ceil(t.chartTextScale*a.yAxisUnitFontSize).toString()+"px "+a.yAxisUnitFontFamily,t.fillStyle=a.yAxisUnitFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,a.yAxisUnit2,Math.ceil(t.chartTextScale*a.yAxisUnitFontSize),l-X,P,a.yAxisUnitBorders,a.yAxisUnitBordersColor,Math.ceil(t.chartLineScale*a.yAxisUnitBordersWidth),Math.ceil(t.chartSpaceScale*a.yAxisUnitBordersXSpace),Math.ceil(t.chartSpaceScale*a.yAxisUnitBordersYSpace),a.yAxisUnitBordersStyle,a.yAxisUnitBackgroundColor,"YAXISUNIT"),t.translate(l-X,P),t.fillTextMultiLine(a.yAxisUnit2,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.yAxisUnitFontSize),!0,a.detectMouseOnText,t,"YRIGHTAXISUNIT_TEXTMOUSE",0,l-X,P,-1,-1),t.stroke(),t.restore())),R>0&&(a.yAxisLeft&&(t.save(),t.beginPath(),t.font=a.yAxisFontStyle+" "+Math.ceil(t.chartTextScale*a.yAxisFontSize).toString()+"px "+a.yAxisFontFamily,t.fillStyle=a.yAxisFontColor,t.textAlign="center",t.textBaseline="bottom",t.translate(N,topNotUsableSize+availableHeight/2),t.rotate(-(90*(Math.PI/180))),setTextBordersAndBackground(t,a.yAxisLabel,Math.ceil(t.chartTextScale*a.yAxisFontSize),0,0,a.yAxisLabelBorders,a.yAxisLabelBordersColor,Math.ceil(t.chartLineScale*a.yAxisLabelBordersWidth),Math.ceil(t.chartSpaceScale*a.yAxisLabelBordersXSpace),Math.ceil(t.chartSpaceScale*a.yAxisLabelBordersYSpace),a.yAxisLabelBordersStyle,a.yAxisLabelBackgroundColor,"YAXISLABELLEFT"),t.fillTextMultiLine(a.yAxisLabel,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.yAxisFontSize),!1,a.detectMouseOnText,t,"YLEFTAXISLABEL_TEXTMOUSE",-(90*(Math.PI/180)),N,topNotUsableSize+availableHeight/2,-1,-1),t.stroke(),t.restore()),a.yAxisRight&&(""==a.yAxisLabel2&&(a.yAxisLabel2=a.yAxisLabel),t.save(),t.beginPath(),t.font=a.yAxisFontStyle+" "+Math.ceil(t.chartTextScale*a.yAxisFontSize).toString()+"px "+a.yAxisFontFamily,t.fillStyle=a.yAxisFontColor,t.textAlign="center",t.textBaseline="bottom",t.translate(G,topNotUsableSize+availableHeight/2),t.rotate(+(90*(Math.PI/180))),setTextBordersAndBackground(t,a.yAxisLabel2,Math.ceil(t.chartTextScale*a.yAxisFontSize),0,0,a.yAxisLabelBorders,a.yAxisLabelBordersColor,Math.ceil(t.chartLineScale*a.yAxisLabelBordersWidth),Math.ceil(t.chartSpaceScale*a.yAxisLabelBordersXSpace),Math.ceil(t.chartSpaceScale*a.yAxisLabelBordersYSpace),a.yAxisLabelBordersStyle,a.yAxisLabelBackgroundColor,"YAXISLABELLEFT"),t.fillTextMultiLine(a.yAxisLabel2,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.yAxisFontSize),!1,a.detectMouseOnText,t,"YRIGHTAXISLABEL_TEXTMOUSE",+(90*(Math.PI/180)),G,topNotUsableSize+availableHeight/2,-1,-1),t.stroke(),t.restore())),w>0&&a.xAxisBottom&&(t.save(),t.beginPath(),t.font=a.xAxisFontStyle+" "+Math.ceil(t.chartTextScale*a.xAxisFontSize).toString()+"px "+a.xAxisFontFamily,t.fillStyle=a.xAxisFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,a.xAxisLabel,Math.ceil(t.chartTextScale*a.xAxisFontSize),Y+availableWidth/2,S,a.xAxisLabelBorders,a.xAxisLabelBordersColor,Math.ceil(t.chartLineScale*a.xAxisLabelBordersWidth),Math.ceil(t.chartSpaceScale*a.xAxisLabelBordersXSpace),Math.ceil(t.chartSpaceScale*a.xAxisLabelBordersYSpace),a.xAxisLabelBordersStyle,a.xAxisLabelBackgroundColor,"XAXISLABEL"),t.translate(Y+availableWidth/2,S),t.fillTextMultiLine(a.xAxisLabel,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.xAxisFontSize),!0,a.detectMouseOnText,t,"XAXISLABEL_TEXTMOUSE",0,Y+availableWidth/2,S,-1,-1),t.stroke(),t.restore());var te;L>1||1==L&&a.showSingleLegend?(te={dispLegend:!0,xLegendBorderPos:O,yLegendBorderPos:B,legendBorderWidth:j,legendBorderHeight:J,nbLegendCols:V,xFirstLegendTextPos:b,yFirstLegendTextPos:I,drawLegendOnData:h,reverseLegend:s,legendBox:d,widestLegend:v},(0==a.legendPosY||4==a.legendPosY||0==a.legendPosX||4==a.legendPosX)&&(drawLegend(te,e,a,t,u),te={dispLegend:!1})):te={dispLegend:!1},""!=a.footNote.trim()&&(t.save(),t.font=a.footNoteFontStyle+" "+Math.ceil(t.chartTextScale*a.footNoteFontSize).toString()+"px "+a.footNoteFontFamily,t.fillStyle=a.footNoteFontColor,t.textAlign="center",t.textBaseline="bottom",setTextBordersAndBackground(t,a.footNote,Math.ceil(t.chartTextScale*a.footNoteFontSize),Y+availableWidth/2,M,a.footNoteBorders,a.footNoteBordersColor,Math.ceil(t.chartLineScale*a.footNoteBordersWidth),Math.ceil(t.chartSpaceScale*a.footNoteBordersXSpace),Math.ceil(t.chartSpaceScale*a.footNoteBordersYSpace),a.footNoteBordersStyle,a.footNoteBackgroundColor,"FOOTNOTE"),t.translate(Y+availableWidth/2,M),t.fillTextMultiLine(a.footNote,0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.footNoteFontSize),!0,a.detectMouseOnText,t,"FOOTNOTE_TEXTMOUSE",0,Y+availableWidth/2,M,-1,-1),t.stroke(),t.restore())}return clrx=Y,clrwidth=availableWidth,clry=topNotUsableSize,clrheight=availableHeight,{leftNotUsableSize:Y,rightNotUsableSize:X,availableWidth:availableWidth,topNotUsableSize:topNotUsableSize,bottomNotUsableHeightWithoutXLabels:bottomNotUsableHeightWithoutXLabels,bottomNotUsableHeightWithXLabels:bottomNotUsableHeightWithXLabels,availableHeight:availableHeight,widestXLabel:C,highestXLabel:F,widestYLabel:k,widestYLabel2:z,highestYLabel:E,rotateLabels:U,xLabelPos:_,clrx:clrx,clry:clry,clrwidth:clrwidth,clrheight:clrheight,legendMsr:te}}function drawLinesDataset(e,a,t,i,l,n){function o(e,n,o,s){0==setOptionValue(1,"LINKTYPE",i,a,l,a.datasets[s].linkType,t.linkType,s,L,{nullvalue:null})&&setOptionValue(1,"BEZIERCURVE",i,a,l,void 0,t.bezierCurve,s,-1,{nullValue:!0})&&(e.length=0,e.push(n),e.push(o)),m=o}function s(e,a,t,i){return yposOrigin="undefined","undefined"!=typeof i[e][a].yPosOffsetOrigin&&(yposOrigin=i[e][a].yAxisPos-A.mainVal*i[e][a].yPosOffsetOrigin),yposOrigin}function r(e,a,t,i,l,n,o,s,r){0==setOptionValue(1,"LINKTYPE",a,n,o,n.datasets[s].linkType,l.linkType,s,L,{nullvalue:null})&&setOptionValue(1,"BEZIERCURVE",a,n,o,void 0,l.bezierCurve,s,-1,{nullValue:!0})?(e.push(t),e.push(i)):0==setOptionValue(1,"LINKTYPE",a,n,o,n.datasets[s].linkType,l.linkType,s,L,{nullvalue:null})?a.lineTo(t,i):1==setOptionValue(1,"LINKTYPE",a,n,o,n.datasets[s].linkType,l.linkType,s,L,{nullvalue:null})?("undefined"!=r?a.moveTo(t,r):a.moveTo(t,o[s][0].xAxisPosY-o[s][0].zeroY),a.lineTo(t,i)):2==setOptionValue(1,"LINKTYPE",a,n,o,n.datasets[s].linkType,l.linkType,s,L,{nullvalue:null})&&"undefined"!=typeof m&&(a.lineTo(t,m),a.lineTo(t,i),m=i)}function c(e,t,i,n){0==setOptionValue(1,"LINKTYPE",t,a,l,a.datasets[n].linkType,i.linkType,n,L,{nullvalue:null})&&setOptionValue(1,"BEZIERCURVE",t,a,l,void 0,i.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,e,setOptionValue(1,"BEZIERCURVETENSION",t,a,l,void 0,i.bezierCurveTension,n,-1,{nullValue:!0}),minimumpos,maximumpos),e.length=0),m=void 0}function h(e,a,t,i,l,n,o){var s=Math.sqrt(Math.pow(t-e,2)+Math.pow(i-a,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*(e-l),u=i+c*(a-n),p=t-h*(e-l),S=i-h*(a-n);return[d,u,p,S]}function d(e,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 e.moveTo(i[0],i[1]),void e.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(e.beginPath(),e.strokeStyle=setOptionValue(1,"STROKECOLOR",e,a,l,a.datasets[T].strokeColor,t.defaultStrokeColor,T,L,{nullvalue:null}),e.lineWidth=Math.ceil(e.chartLineScale*setOptionValue(1,"LINEWIDTH",e,a,l,a.datasets[T].datasetStrokeWidth,t.datasetStrokeWidth,T,L,{nullvalue:null})),e.moveTo(i[0],i[1]),e.quadraticCurveTo(r[0],Math.max(Math.min(r[1],o),s),i[2],i[3]),e.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",e,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),d=2;d=1){if(m="undefined","Line"!=l[T][0].tpchart)continue;if(0==l[T].length)continue;if(-1==l[T][0].firstNotMissing)continue;i.save(),i.beginPath(),prevAnimPc={mainVal:0,subVal:0,animVal:0};for(var P=-1,v=-1,L=l[T][0].firstNotMissing;L<=l[T][0].lastNotMissing;L++)if(!(0==prevAnimPc.animVal&&L>l[T][0].firstNotMissing))if(A=animationCorrection(e,a,t,T,L,0),0==A.mainVal&&prevAnimPc.mainVal>0&&-1!=P)i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),t.extrapolateMissingData?(u=l[T][l[T][L].prevNotMissing].yAxisPos-prevAnimPc.mainVal*l[T][l[T][L].prevNotMissing].yPosOffset,p=l[T][L].yAxisPos-prevAnimPc.mainVal*l[T][l[T][L-1].nextNotMissing].yPosOffset,g=l[T][L-1].nextNotMissing-l[T][L].prevNotMissing,f=L-1-l[T][L].prevNotMissing,x=(f+prevAnimPc.subVal)/g,S=u+x*(p-u),r(M,i,l[T][l[T][L].prevNotMissing].xPos+x*(l[T][l[T][L-1].nextNotMissing].xPos-l[T][l[T][L].prevNotMissing].xPos),S,t,a,l,T,s(T,L,a,l)),c(M,i,t,T),i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle="rgba(0,0,0,0)",t.datasetFill&&1!=setOptionValue(1,"LINKTYPE",i,a,l,a.datasets[T].linkType,t.linkType,T,L,{nullvalue:null})&&(i.lineTo(l[T][l[T][L].prevNotMissing].xPos+x*(l[T][l[T][L-1].nextNotMissing].xPos-l[T][l[T][L].prevNotMissing].xPos),l[T][L].yAxisPos),i.lineTo(l[T][P].xPos,l[T][P].xAxisPosY-l[T][0].zeroY),i.closePath(),i.fillStyle=setOptionValue(1,"COLOR",i,a,l,a.datasets[T].fillColor,t.defaultFillColor,T,L,{animationValue:A.mainVal,xPosLeft:l[T][0].xPos,yPosBottom:Math.max(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lminvalue_offset),xPosRight:l[T][a.datasets[T].data.length-1].xPos,yPosTop:Math.min(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lmaxvalue_offset)}),i.fill(),P=-1)):"undefined"!=typeof l[T][L].value&&(r(M,i,l[T][L-1].xPos+prevAnimPc.subVal*(l[T][L].xPos-l[T][L-1].xPos),l[T][L].yAxisPos-prevAnimPc.mainVal*l[T][l[T][L-1].nextNotMissing].yPosOffset,t,a,l,T,s(T,L,a,l)),c(M,i,t,T),i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle="rgba(0,0,0,0)",t.datasetFill&&1!=setOptionValue(1,"LINKTYPE",i,a,l,a.datasets[T].linkType,t.linkType,T,L,{nullvalue:null})&&(i.lineTo(l[T][L-1].xPos+prevAnimPc.subVal*(l[T][L].xPos-l[T][L-1].xPos),l[T][L].yAxisPos),i.lineTo(l[T][P].xPos,l[T][P].xAxisPosY-l[T][0].zeroY),i.closePath(),i.fillStyle=setOptionValue(1,"COLOR",i,a,l,a.datasets[T].fillColor,t.defaultFillColor,T,L,{animationValue:A.mainVal,xPosLeft:l[T][0].xPos,yPosBottom:Math.max(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lminvalue_offset),xPosRight:l[T][a.datasets[T].data.length-1].xPos,yPosTop:Math.min(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lmaxvalue_offset)}),i.fill())),prevAnimPc=A;else switch(0==A.totVal?(i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle="rgba(0,0,0,0)"):(i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),i.strokeStyle=setOptionValue(1,"STROKECOLOR",i,a,l,a.datasets[T].strokeColor,t.defaultStrokeColor,T,L,{nullvalue:null})),prevAnimPc=A,typeof a.datasets[T].data[L]){case"undefined":if(t.extrapolateMissingData)A.subVal>0&&(v=l[T][L].xPos+A.subVal*(l[T][L+1].xPos-l[T][L].xPos),u=l[T][l[T][L+1].prevNotMissing].yAxisPos-l[T][l[T][L+1].prevNotMissing].yPosOffset,p=l[T][l[T][L].nextNotMissing].yAxisPos-l[T][l[T][L].nextNotMissing].yPosOffset,g=l[T][L].nextNotMissing-l[T][L+1].prevNotMissing,f=L-l[T][L+1].prevNotMissing,x=(f+prevAnimPc.subVal)/g,S=u+x*(p-u),r(M,i,l[T][l[T][L].prevNotMissing].xPos+x*(l[T][l[T][L-1].nextNotMissing].xPos-l[T][l[T][L].prevNotMissing].xPos),S,t,a,l,T,s(T,L,a,l)));else{if(-1==P)continue;c(M,i,t,T),i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),t.datasetFill&&-1!=P&&1!=setOptionValue(1,"LINKTYPE",i,a,l,a.datasets[T].linkType,t.linkType,T,L,{nullvalue:null})&&(v=-1,i.strokeStyle="rgba(0,0,0,0)",i.lineTo(l[T][L-1].xPos,l[T][L-1].yAxisPos),i.lineTo(l[T][P].xPos,l[T][P].yAxisPos),i.closePath(),i.fillStyle=setOptionValue(1,"COLOR",i,a,l,a.datasets[T].fillColor,t.defaultFillColor,T,L,{animationValue:A.mainVal,xPosLeft:l[T][0].xPos,yPosBottom:Math.max(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lminvalue_offset),xPosRight:l[T][a.datasets[T].data.length-1].xPos,yPosTop:Math.min(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lmaxvalue_offset)}),i.fill()),i.beginPath(),prevAnimPc={mainVal:0,subVal:0},P=-1}break;default:i.lineWidth=Math.ceil(i.chartLineScale*setOptionValue(1,"LINEWIDTH",i,a,l,a.datasets[T].datasetStrokeWidth,t.datasetStrokeWidth,T,L,{nullvalue:null})),-1==P?(P=L,i.beginPath(),1==setOptionValue(1,"LINKTYPE",i,a,l,a.datasets[T].linkType,t.linkType,T,L,{nullvalue:null})?("undefined"!=typeof l[T][L].yPosOffsetOrigin?i.moveTo(l[T][L].xPos,l[T][L].yAxisPos-A.mainVal*l[T][L].yPosOffsetOrigin):i.moveTo(l[T][P].xPos,l[T][P].xAxisPosY-l[T][0].zeroY),i.lineTo(l[T][L].xPos,l[T][L].yAxisPos-A.mainVal*l[T][L].yPosOffset)):i.moveTo(l[T][L].xPos,l[T][L].yAxisPos-A.mainVal*l[T][L].yPosOffset),o(M,l[T][L].xPos,l[T][L].yAxisPos-A.mainVal*l[T][L].yPosOffset,T),v=l[T][L].xPos):(v=l[T][L].xPos,r(M,i,l[T][L].xPos,l[T][L].yAxisPos-A.mainVal*l[T][L].yPosOffset,t,a,l,T,s(T,L,a,l))),A.subVal>0&&-1!=l[T][L].nextNotMissing&&(t.extrapolateMissing||l[T][L].nextNotMissing==L+1)&&(v=l[T][L].xPos+A.subVal*(l[T][L+1].xPos-l[T][L].xPos),u=l[T][l[T][L+1].prevNotMissing].yAxisPos-l[T][l[T][L+1].prevNotMissing].yPosOffset,p=l[T][l[T][L].nextNotMissing].yAxisPos-l[T][l[T][L].nextNotMissing].yPosOffset,S=u+A.subVal*(p-u),r(M,i,l[T][L].xPos+A.subVal*(l[T][l[T][L].nextNotMissing].xPos-l[T][L].xPos),S,t,a,l,T,s(T,L,a,l)))}if(c(M,i,t,T),i.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",i,a,l,a.datasets[T].datasetStrokeStyle,t.datasetStrokeStyle,T,L,{nullvalue:null}))),i.stroke(),i.setLineDash([]),t.datasetFill&&1!=setOptionValue(1,"LINKTYPE",i,a,l,a.datasets[T].linkType,t.linkType,T,L,{nullvalue:null})&&P>=0&&(i.strokeStyle="rgba(0,0,0,0)",i.lineTo(v,l[T][0].xAxisPosY-l[T][0].zeroY),i.lineTo(l[T][P].xPos,l[T][P].xAxisPosY-l[T][0].zeroY),i.closePath(),i.fillStyle=setOptionValue(1,"COLOR",i,a,l,a.datasets[T].fillColor,t.defaultFillColor,T,-1,{animationValue:A.mainVal,xPosLeft:l[T][0].xPos,yPosBottom:Math.max(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lminvalue_offset),xPosRight:l[T][a.datasets[T].data.length-1].xPos,yPosTop:Math.min(l[T][0].yAxisPos,l[T][0].yAxisPos-(t.animationLeftToRight?1:1*A.mainVal)*l[T][0].lmaxvalue_offset)}),i.fill()),i.restore(),t.pointDot&&e>=1)for(L=0;L0||!t.animationLeftToRight)){i.beginPath(),i.fillStyle=setOptionValue(1,"MARKERFILLCOLOR",i,a,l,a.datasets[T].pointColor,t.defaultStrokeColor,T,L,{nullvalue:!0}),i.strokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",i,a,l,a.datasets[T].pointStrokeColor,t.defaultStrokeColor,T,L,{nullvalue:!0}),i.lineWidth=setOptionValue(i.chartLineScale,"MARKERLINEWIDTH",i,a,l,a.datasets[T].pointDotStrokeWidth,t.pointDotStrokeWidth,T,L,{nullvalue:!0});var D=setOptionValue(1,"MARKERSHAPE",i,a,l,a.datasets[T].markerShape,t.markerShape,T,L,{nullvalue:!0}),V=setOptionValue(i.chartSpaceScale,"MARKERRADIUS",i,a,l,a.datasets[T].pointDotRadius,t.pointDotRadius,T,L,{nullvalue:!0}),y=setOptionValue(1,"MARKERSTROKESTYLE",i,a,l,a.datasets[T].pointDotStrokeStyle,t.pointDotStrokeStyle,T,L,{nullvalue:!0});drawMarker(i,l[T][L].xPos,l[T][L].yAxisPos-A.mainVal*l[T][L].yPosOffset,D,V,y)}if(e>=t.animationStopValue)for(L=0;L=1?e:-1*(Math.sqrt(1-(e/=1)*e)-1)},easeOutCirc:function(e){return 1*Math.sqrt(1-(e=e/1-1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var a=1.70158,t=0,i=1;return 0==e?0:1==(e/=1)?1:(t||(t=.3),ie?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((1*e-a)*(2*Math.PI)/t)):i*Math.pow(2,-10*(e-=1))*Math.sin((1*e-a)*(2*Math.PI)/t)*.5+1)},easeInBack:function(e){var a=1.70158;return 1*(e/=1)*e*((a+1)*e-a)},easeOutBack:function(e){var a=1.70158;return 1*((e=e/1-1)*e*((a+1)*e+a)+1)},easeInOutBack:function(e){var a=1.70158;return(e/=.5)<1?.5*(e*e*(((a*=1.525)+1)*e-a)):.5*((e-=2)*e*(((a*=1.525)+1)*e+a)+2)},easeInBounce:function(e){return 1-animationOptions.easeOutBounce(1-e)},easeOutBounce:function(e){return(e/=1)<1/2.75?1*(7.5625*e*e):2/2.75>e?1*(7.5625*(e-=1.5/2.75)*e+.75):2.5/2.75>e?1*(7.5625*(e-=2.25/2.75)*e+.9375):1*(7.5625*(e-=2.625/2.75)*e+.984375)},easeInOutBounce:function(e){return.5>e?.5*animationOptions.easeInBounce(2*e):.5*animationOptions.easeOutBounce(2*e-1)+.5}},width=context.canvas.width,height=context.canvas.height;window.devicePixelRatio&&(context.canvas.style.width=width+"px",context.canvas.style.height=height+"px",context.canvas.height=height*window.devicePixelRatio,context.canvas.width=width*window.devicePixelRatio,context.scale(window.devicePixelRatio,window.devicePixelRatio)),this.PolarArea=function(e,a){chart.PolarArea.defaults={inGraphDataShow:!1,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,scaleOverlay:!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,annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",startAngle:90,totalAmplitude:360,radiusScale:1},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=a?mergeChartConfig(chart.PolarArea.defaults,a):chart.PolarArea.defaults;return new PolarArea(e,t,context)},this.Radar=function(e,a){chart.Radar.defaults={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=a?mergeChartConfig(chart.Radar.defaults,a):chart.Radar.defaults;return new Radar(e,t,context)},this.Pie=function(e,a){chart.Pie.defaults=chart.defaults.PieAndDoughnut,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=a?mergeChartConfig(chart.Pie.defaults,a):chart.Pie.defaults;return new Pie(e,t,context)},this.Doughnut=function(e,a){chart.Doughnut.defaults=chart.defaults.PieAndDoughnut,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=a?mergeChartConfig(chart.Doughnut.defaults,a):chart.Doughnut.defaults;return new Doughnut(e,t,context)},this.Line=function(e,a){chart.Line.defaults={inGraphDataShow:!1,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=a?mergeChartConfig(chart.Line.defaults,a):chart.Line.defaults;return new Line(e,t,context)},this.StackedBar=function(e,a){chart.StackedBar.defaults={annotateBarMinimumDetectionHeight: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=a?mergeChartConfig(chart.StackedBar.defaults,a):chart.StackedBar.defaults;return new StackedBar(e,t,context)},this.HorizontalStackedBar=function(e,a){chart.HorizontalStackedBar.defaults={annotateBarMinimumDetectionHeight: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=a?mergeChartConfig(chart.HorizontalStackedBar.defaults,a):chart.HorizontalStackedBar.defaults;return new HorizontalStackedBar(e,t,context)},this.Bar=function(e,a){chart.Bar.defaults={annotateBarMinimumDetectionHeight: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,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=a?mergeChartConfig(chart.Bar.defaults,a):chart.Bar.defaults;return new Bar(e,t,context)},this.HorizontalBar=function(e,a){chart.HorizontalBar.defaults={annotateBarMinimumDetectionHeight: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,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=a?mergeChartConfig(chart.HorizontalBar.defaults,a):chart.HorizontalBar.defaults;return new HorizontalBar(e,t,context)},chart.defaults={},chart.defaults.IExplorer8={annotateBackgroundColor:"black",annotateFontColor:"white"},chart.defaults.commonOptions={chartTextScale:1,chartLineScale:1,chartSpaceScale:1,multiGraph:!1,clearRect:!0,dynamicDisplay:!1,graphSpaceBefore:5,graphSpaceAfter:5,canvasBorders:!1,canvasBackgroundColor:"none",canvasBordersWidth:3,canvasBordersStyle:"solid",canvasBordersColor:"black",zeroValue:1e-10,graphTitle:"",graphTitleFontFamily:"'Arial'",graphTitleFontSize:24,graphTitleFontStyle:"bold",graphTitleFontColor:"#666",graphTitleSpaceBefore:5,graphTitleSpaceAfter:5,graphTitleBorders:!1,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",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",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,legendBorders:!0,legendBordersStyle:"solid",legendBordersWidth:1,legendBordersColors:"#666",legendBordersSpaceBefore:5,legendBordersSpaceAfter:5,legendBordersSpaceLeft:5,legendBordersSpaceRight:5,legendSpaceBeforeText:5,legendSpaceAfterText:5,legendSpaceLeftText:5,legendSpaceRightText:5,legendSpaceBetweenTextVertical:5,legendSpaceBetweenTextHorizontal:5,legendSpaceBetweenBoxAndText:5,legendFillColor:"rgba(0,0,0,0)",legendXPadding:0,legendYPadding:0,inGraphDataBorders:!1,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"],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:"",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",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,mouseWheel:null,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.PieAndDoughnut={inGraphDataShow:!1,inGraphDataPaddingRadius:5,inGraphDataPaddingAngle:0,inGraphDataTmpl:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",inGraphDataAlign:"off-center",inGraphDataVAlign:"off-center",inGraphDataRotate:0,inGraphDataFontFamily:"'Arial'",inGraphDataFontSize:12,inGraphDataFontStyle:"normal",inGraphDataFontColor:"#666",inGraphDataRadiusPosition:3,inGraphDataAnglePosition:2,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,annotateLabel:"<%=(v1 == ''? '' : v1+':')+ v2 + ' (' + v6 + ' %)'%>",startAngle:90,totalAmplitude:360,radiusScale:1},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",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",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",yAxisUnitBordersXSpace:3,yAxisUnitBordersYSpace:3,yAxisUnitBordersWidth:1,yAxisUnitBordersStyle:"solid",yAxisUnitBackgroundColor:"none"};var clear=function(e){e.clearRect(0,0,width,height)},PolarArea=function(e,a,t){function i(i){for(var l=0;l2*correctedRotateAnimation*Math.PI&&(endAngle=m[l].firstAngle+2*correctedRotateAnimation*Math.PI),t.arc(p,S,n*m[l].radiusOffset,m[l].startAngle,endAngle,!1)}else t.arc(p,S,n*m[l].radiusOffset,m[l].firstAngle+correctedRotateAnimation*(m[l].startAngle-m[l].firstAngle),m[l].firstAngle+correctedRotateAnimation*(m[l].endAngle-m[l].firstAngle));t.lineTo(p,S),t.closePath(),t.fillStyle=setOptionValue(1,"COLOR",t,e,m,e[l].color,a.defaultFillColor,l,-1,{animationDecimal:i,scaleAnimation:n}),t.fill(),"merge"==a.segmentShowStroke?(t.lineWidth=0,t.strokeStyle=setOptionValue(1,"COLOR",t,e,m,e[l].color,a.defaultFillColor,l,-1,{animationDecimal:i,scaleAnimation:n}),t.setLineDash([]),t.stroke()):a.segmentShowStroke&&(t.strokeStyle=a.segmentStrokeColor,t.lineWidth=Math.ceil(t.chartLineScale*a.segmentStrokeWidth),t.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",t,e,m,e[l].segmentStrokeStyle,a.segmentStrokeStyle,l,-1,{animationDecimal:i,scaleAnimation:n}))),t.stroke(),t.setLineDash([]))}}if(i>=a.animationStopValue)for(l=0;l3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)Math.PI?t.textBaseline="top":t.textBaseline="bottom":"to-center"==setOptionValue(1,"INGRAPHDATAVALIGN",t,e,m,void 0,a.inGraphDataVAlign,l,-1,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="bottom":t.textBaseline="top":t.textBaseline=setOptionValue(1,"INGRAPHDATAVALIGN",t,e,m,void 0,a.inGraphDataVAlign,l,-1,{nullValue:!0}),t.font=setOptionValue(1,"INGRAPHDATAFONTSTYLE",t,e,m,void 0,a.inGraphDataFontStyle,l,-1,{nullValue:!0})+" "+setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,m,void 0,a.inGraphDataFontSize,l,-1,{nullValue:!0})+"px "+setOptionValue(1,"INGRAPHDATAFONTFAMILY",t,e,m,void 0,a.inGraphDataFontFamily,l,-1,{nullValue:!0}),t.fillStyle=setOptionValue(1,"INGRAPHDATAFONTCOLOR",t,e,m,void 0,a.inGraphDataFontColor,l,-1,{nullValue:!0});var c=tmplbis(setOptionValue(1,"INGRAPHDATATMPL",t,e,m,void 0,a.inGraphDataTmpl,l,-1,{nullValue:!0}),m[l],a);t.translate(p+labelRadius*Math.cos(posAngle),S-labelRadius*Math.sin(posAngle));var h=0;h="inRadiusAxis"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,m,void 0,a.inGraphDataRotate,l,-1,{nullValue:!0})?2*Math.PI-posAngle:"inRadiusAxisRotateLabels"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,m,void 0,a.inGraphDataRotate,l,-1,{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,"INGRAPHDATAROTATE",t,e,m,void 0,a.inGraphDataRotate,l,-1,{nullValue:!0})*(Math.PI/180),t.rotate(h),setTextBordersAndBackground(t,c,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,m,void 0,a.inGraphDataFontSize,l,-1,{nullValue:!0}),0,0,setOptionValue(1,"INGRAPHDATABORDERS",t,e,m,void 0,a.inGraphDataBorders,l,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",t,e,m,void 0,a.inGraphDataBordersColor,l,-1,{nullValue:!0}),setOptionValue(t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,e,m,void 0,a.inGraphDataBordersWidth,l,-1,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,e,m,void 0,a.inGraphDataBordersXSpace,l,-1,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,e,m,void 0,a.inGraphDataBordersYSpace,l,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",t,e,m,void 0,a.inGraphDataBordersStyle,l,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",t,e,m,void 0,a.inGraphDataBackgroundColor,l,-1,{nullValue:!0}),"INGRAPHDATA"),t.fillTextMultiLine(c,0,0,t.textBaseline,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,m,void 0,a.inGraphDataFontSize,l,-1,{nullValue:!0}),!0,a.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",h,p+labelRadius*Math.cos(posAngle),S-labelRadius*Math.sin(posAngle),l,-1),t.restore()}u.legendMsr.dispLegend&&drawLegend(u.legendMsr,e,a,t,"PolarArea")}function l(){for(var e=0;ei&&(i=1*e[n].value),1*e[n].valuei&&(i=0,l=0),Math.abs(i-l)0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),"function"==typeof a.graphMin?l=setOptionValue(1,"GRAPHMIN",t,e,m,void 0,a.graphMin,-1,-1,{nullValue:!0}):isNaN(a.graphMin)||(l=a.graphMin),"function"==typeof a.graphMax?i=setOptionValue(1,"GRAPHMAX",t,e,m,void 0,a.graphMax,-1,-1,{nullValue:!0}):isNaN(a.graphMax)||(i=a.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=1,init_and_start(t,e,a)){var g=((a.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),f=((a.totalAmplitude*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);f<=a.zeroValue&&(f=2*Math.PI);var x=(g-f+4*Math.PI)%(2*Math.PI),A=x+f,m=initPassVariableData_part1(e,a,t);if(h=n(),a.logarithmic=!1,a.logarithmic2=!1,d=a.scaleShowLabels?a.scaleLabel:"",a.scaleOverride){var M=setOptionValue(1,"SCALESTARTVALUE",t,e,m,void 0,a.scaleStartValue,-1,-1,{nullValue:!0}),T=setOptionValue(1,"SCALESTEPS",t,e,m,void 0,a.scaleSteps,-1,-1,{nullValue:!0}),P=setOptionValue(1,"SCALESTEPWIDTH",t,e,m,void 0,a.scaleStepWidth,-1,-1,{nullValue:!0});s={steps:T,stepValue:P,graphMin:M,graphMax:M+T*P,labels:[]},populateLabels(1,a,d,s.labels,s.steps,M,s.graphMax,P),u=setMeasures(e,a,t,height,width,s.labels,null,!0,!1,!1,!1,!0,"PolarArea")}else s=calculateScale(1,a,h.maxSteps,h.minSteps,h.maxValue,h.minValue,d),u=setMeasures(e,a,t,height,width,s.labels,null,!0,!1,!1,!1,!0,"PolarArea");var v=s.graphMin+s.steps*s.stepValue,L=calculatePieDrawingSize(t,u,a,e,m);p=L.midPieX,S=L.midPieY,o=Math.floor(L.radius/s.steps),o>0?(initPassVariableData_part2(m,e,a,t,{midPosX:p,midPosY:S,int_radius:0,ext_radius:o*s.steps,calculatedScale:s,scaleHop:o,outerVal:v}),animationLoop(a,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),e,m)):testRedraw(t,e,a)}},Radar=function(e,a,t){function i(i){var l=2*Math.PI/e.datasets[0].data.length;t.save();for(var n=0;n1&&(r-=1),"undefined"!=typeof e.datasets[n].data[s]&&(-1==o?(t.beginPath(),t.moveTo(g+r*x[n][s].offsetX,f-r*x[n][s].offsetY),o=s):t.lineTo(g+r*x[n][s].offsetX,f-r*x[n][s].offsetY))}if(t.closePath(),a.datasetFill?t.fillStyle=setOptionValue(1,"COLOR",t,e,x,e.datasets[n].fillColor,a.defaultFillColor,n,-1,{animationValue:r,midPosX:x[n][0].midPosX,midPosY:x[n][0].midPosY,ext_radius:(a.animationLeftToRight?1:r)*x[n][0].calculated_offset_max}):t.fillStyle="rgba(0,0,0,0)",t.strokeStyle=setOptionValue(1,"STROKECOLOR",t,e,x,e.datasets[n].strokeColor,a.defaultStrokeColor,n,-1,{nullvalue:null}),t.lineWidth=Math.ceil(t.chartLineScale*setOptionValue(1,"LINEWIDTH",t,e,x,e.datasets[n].datasetStrokeWidth,a.datasetStrokeWidth,n,-1,{nullvalue:null})),t.fill(),t.setLineDash(lineStyleFn(setOptionValue(1,"LINEDASH",t,e,x,e.datasets[n].datasetStrokeStyle,a.datasetStrokeStyle,n,s,{nullvalue:null}))),t.stroke(),t.setLineDash([]),a.pointDot&&(!a.animationLeftToRight||a.animationLeftToRight&&i>=1)){t.beginPath(),t.fillStyle=setOptionValue(1,"MARKERFILLCOLOR",t,e,x,e.datasets[n].pointColor,a.defaultStrokeColor,n,-1,{nullvalue:!0}),t.strokeStyle=setOptionValue(1,"MARKERSTROKESTYLE",t,e,x,e.datasets[n].pointStrokeColor,a.defaultStrokeColor,n,-1,{nullvalue:!0}),t.lineWidth=setOptionValue(t.chartLineScale,"MARKERLINEWIDTH",t,e,x,e.datasets[n].pointDotStrokeWidth,a.pointDotStrokeWidth,n,-1,{nullvalue:!0});for(var c=0;c=a.animationStopValue)for(n=0;n3*Math.PI/2||(a.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)<=Math.PI/2?t.textAlign="left":t.textAlign="right":"to-center"==setOptionValue(1,"INGRAPHDATAALIGN",t,e,x,void 0,a.inGraphDataAlign,n,-1,{nullValue:!0})?"inRadiusAxis"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,x,void 0,a.inGraphDataRotate,n,-1,{nullValue:!0})||(a.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)>3*Math.PI/2||(a.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)Math.PI?t.textBaseline="bottom":t.textBaseline="top":"to-center"==setOptionValue(1,"INGRAPHDATAVALIGN",t,e,x,void 0,a.inGraphDataVAlign,n,-1,{nullValue:!0})?(a.startAngle*Math.PI/180-s*l+4*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="top":t.textBaseline="bottom":t.textBaseline=setOptionValue(1,"INGRAPHDATAVALIGN",t,e,x,void 0,a.inGraphDataVAlign,n,-1,{nullValue:!0}),t.font=setOptionValue(1,"INGRAPHDATAFONTSTYLE",t,e,x,void 0,a.inGraphDataFontStyle,n,-1,{nullValue:!0})+" "+setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,x,void 0,a.inGraphDataFontSize,n,-1,{nullValue:!0})+"px "+setOptionValue(1,"INGRAPHDATAFONTFAMILY",t,e,x,void 0,a.inGraphDataFontFamily,n,-1,{nullValue:!0}),t.fillStyle=setOptionValue(1,"INGRAPHDATAFONTCOLOR",t,e,x,void 0,a.inGraphDataFontColor,n,-1,{nullValue:!0});var p;1==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",t,e,x,void 0,a.inGraphDataRadiusPosition,n,-1,{nullValue:!0})?p=0+setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",t,e,x,void 0,a.inGraphDataPaddingRadius,n,-1,{nullValue:!0}):2==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",t,e,x,void 0,a.inGraphDataRadiusPosition,n,-1,{nullValue:!0})?p=x[n][s].calculated_offset/2+setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",t,e,x,void 0,a.inGraphDataPaddingRadius,n,-1,{nullValue:!0}):3==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",t,e,x,void 0,a.inGraphDataRadiusPosition,n,-1,{nullValue:!0})&&(p=x[n][s].calculated_offset+setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",t,e,x,void 0,a.inGraphDataPaddingRadius,n,-1,{nullValue:!0}));var A,m;x[n][s].calculated_offset>0?(A=g+x[n][s].offsetX*(p/x[n][s].calculated_offset),m=f-x[n][s].offsetY*(p/x[n][s].calculated_offset)):(A=g,m=f),t.translate(A,m);var M=0;M="inRadiusAxis"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,x,void 0,a.inGraphDataRotate,n,-1,{nullValue:!0})?s*l:"inRadiusAxisRotateLabels"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,x,void 0,a.inGraphDataRotate,n,-1,{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(1,"INGRAPHDATAROTATE",t,e,x,void 0,a.inGraphDataRotate,n,-1,{nullValue:!0})*(Math.PI/180),t.rotate(M);var T=tmplbis(setOptionValue(1,"INGRAPHDATATMPL",t,e,x,void 0,a.inGraphDataTmpl,n,-1,{nullValue:!0}),x[n][s],a);setTextBordersAndBackground(t,T,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,x,void 0,a.inGraphDataFontSize,n,-1,{nullValue:!0}),0,0,setOptionValue(1,"INGRAPHDATABORDERS",t,e,x,void 0,a.inGraphDataBorders,n,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",t,e,x,void 0,a.inGraphDataBordersColor,n,-1,{nullValue:!0}),setOptionValue(t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,e,x,void 0,a.inGraphDataBordersWidth,n,-1,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,e,x,void 0,a.inGraphDataBordersXSpace,n,-1,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,e,x,void 0,a.inGraphDataBordersYSpace,n,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",t,e,x,void 0,a.inGraphDataBordersStyle,n,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",t,e,x,void 0,a.inGraphDataBackgroundColor,n,-1,{nullValue:!0}),"INGRAPHDATA"),t.fillTextMultiLine(T,0,0,t.textBaseline,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,x,void 0,a.inGraphDataFontSize,n,-1,{nullValue:!0}),!0,a.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",M,A,m,n,s),t.restore()}S.legendMsr.dispLegend&&drawLegend(S.legendMsr,e,a,t,"Radar")}function l(){var i=2*Math.PI/e.datasets[0].data.length;if(t.save(),t.translate(g,f),t.rotate((90-a.startAngle)*Math.PI/180),a.angleShowLineOut){t.strokeStyle=a.angleLineColor,t.lineWidth=Math.ceil(t.chartLineScale*a.angleLineWidth);for(var l=0;lS;)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(e.labels[d],u,-p,t.textBaseline,Math.ceil(t.chartTextScale*a.pointLabelFontSize),!0,a.detectMouseOnText,t,"LABEL_TEXTMOUSE",0,g,f,d,-1)}t.restore()}function n(){var i,l,n,o,r,c,d,u,p,f,x=2*Math.PI/e.datasets[0].data.length,A=a.startAngle*Math.PI/180;if(t.font=a.pointLabelFontStyle+" "+Math.ceil(t.chartTextScale*a.pointLabelFontSize).toString()+"px "+a.pointLabelFontFamily,a.graphMaximized)for(o=S.availableWidth/2,n=S.availableWidth/2,c=40,p=0;p-Math.PI/2||A>3*Math.PI/2?o>l&&(o=l):0!=Math.cos(A)&&n>l&&(n=l),A-=x;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]),A=a.startAngle*Math.PI/180,l=S.available,p=0;p-Math.PI/2||A>3*Math.PI/2?l=(S.availableWidth-i-f)/Math.abs(Math.cos(A)):Math.cos(0!=A)&&(l=(i-f)/Math.abs(Math.cos(A))),s>l&&(s=l),Math.sin(A)*S.availableHeight/2>S.availableHeight/2-2*Math.ceil(t.chartTextScale*a.scaleFontSize)&&(l=Math.sin(A)*S.availableHeight/2-1.5*Math.ceil(t.chartTextScale*a.scaleFontSize),s>l&&(s=l)),A-=x;s>d&&(d=s,g=i+S.leftNotUsableSize)}s=d-Math.ceil(t.chartTextScale*a.scaleFontSize)/2,h=Default(h,5)}function o(){for(var i=-Number.MAX_VALUE,l=Number.MAX_VALUE,n=0;ni&&(i=1*e.datasets[n].data[o]),1*e.datasets[n].data[o]i&&(i=0,l=0),Math.abs(i-l)0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),"function"==typeof a.graphMin?l=setOptionValue(1,"GRAPHMIN",t,e,x,void 0,a.graphMin,-1,-1,{nullValue:!0}):isNaN(a.graphMin)||(l=a.graphMin),"function"==typeof a.graphMax?i=setOptionValue(1,"GRAPHMAX",t,e,x,void 0,a.graphMax,-1,-1,{nullValue:!0}):isNaN(a.graphMax)||(i=a.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,e,a)){var x=initPassVariableData_part1(e,a,t);if(u=o(),a.logarithmic=!1,a.logarithmic2=!1,e.labels||(e.labels=[]),p=a.scaleShowLabels?a.scaleLabel:"",a.scaleOverride){var A=setOptionValue(1,"SCALESTARTVALUE",t,e,x,void 0,a.scaleStartValue,-1,-1,{nullValue:!0}),m=setOptionValue(1,"SCALESTEPS",t,e,x,void 0,a.scaleSteps,-1,-1,{nullValue:!0}),M=setOptionValue(1,"SCALESTEPWIDTH",t,e,x,void 0,a.scaleStepWidth,-1,-1,{nullValue:!0});c={steps:m,stepValue:M,graphMin:A,graphMax:A+m*M,labels:[]},populateLabels(1,a,p,c.labels,c.steps,A,c.graphMax,M),S=setMeasures(e,a,t,height,width,c.labels,null,!0,!1,!1,!0,a.datasetFill,"Radar")}else c=calculateScale(1,a,u.maxSteps,u.minSteps,u.maxValue,u.minValue,p),S=setMeasures(e,a,t,height,width,c.labels,null,!0,!1,!1,!0,a.datasetFill,"Radar");n(),f=S.topNotUsableSize+S.availableHeight/2,r=s/c.steps,initPassVariableData_part2(x,e,a,t,{midPosX:g,midPosY:f,calculatedScale:c,scaleHop:r,maxSize:s,outerVal:-1}),animationLoop(a,l,i,t,S.clrx,S.clry,S.clrwidth,S.clrheight,g,f,g-s,f+s,e,x)}},Pie=function(e,a,t){return t.tpchart="Pie",Doughnut(e,a,t)},Doughnut=function(e,a,t){function i(i){for(var c,d,u=(((-a.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),0);u=0){if(t.beginPath(),t.lineWidth=Math.ceil(t.chartLineScale*a.segmentStrokeWidth),t.strokeStyle="rgba(0,0,0,0)","ByArc"==a.animationByData)endAngle=r[u].startAngle+correctedRotateAnimation*r[u].segmentAngle,t.arc(n,o,p*d,r[u].startAngle,endAngle,!1),t.arc(n,o,p*c,endAngle,r[u].startAngle,!0);else if(a.animationByData){if(!(r[u].startAngle-r[u].firstAngle<2*correctedRotateAnimation*Math.PI))continue;endAngle=r[u].endAngle,r[u].endAngle-r[u].firstAngle>2*correctedRotateAnimation*Math.PI&&(endAngle=r[u].firstAngle+2*correctedRotateAnimation*Math.PI),t.arc(n,o,p*d,r[u].startAngle,endAngle,!1),t.arc(n,o,p*c,endAngle,r[u].startAngle,!0)}else t.arc(n,o,p*d,r[u].firstAngle+correctedRotateAnimation*(r[u].startAngle-r[u].firstAngle),r[u].firstAngle+correctedRotateAnimation*(r[u].endAngle-r[u].firstAngle),!1),t.arc(n,o,p*c,r[u].firstAngle+correctedRotateAnimation*(r[u].endAngle-r[u].firstAngle),r[u].firstAngle+correctedRotateAnimation*(r[u].startAngle-r[u].firstAngle),!0);t.closePath(),t.fillStyle=setOptionValue(1,"COLOR",t,e,r,e[u].color,a.defaultFillColor,u,-1,{animationDecimal:i,scaleAnimation:p}),t.fill(),"merge"==a.segmentShowStroke?(t.lineWidth=1.5,t.strokeStyle=setOptionValue(1,"COLOR",t,e,r,e[u].color,a.defaultFillColor,u,-1,{animationDecimal:i,scaleAnimation:p}),t.setLineDash([]),t.stroke()):a.segmentShowStroke&&(t.lineWidth=Math.ceil(t.chartLineScale*a.segmentStrokeWidth),t.strokeStyle=a.segmentStrokeColor,t.setLineDash(lineStyleFn(setOptionValue(1,"SEGMENTSTROKESTYLE",t,e,r,e[u].segmentStrokeStyle,a.segmentStrokeStyle,u,-1,{animationDecimal:i,scaleAnimation:p}))),t.stroke(),t.setLineDash([]))}}if(i>=a.animationStopValue)for(u=0;u=Math.PI/180*setOptionValue(1,"INGRAPHDATAMINIMUMANGLE",t,e,r,void 0,a.inGraphDataMinimumAngle,u,-1,{nullValue:!0}))){1==setOptionValue(1,"INGRAPHDATAANGLEPOSITION",t,e,r,void 0,a.inGraphDataAnglePosition,u,-1,{nullValue:!0})?posAngle=r[u].realStartAngle+setOptionValue(1,"INGRAPHDATAPADDINANGLE",t,e,r,void 0,a.inGraphDataPaddingAngle,u,-1,{nullValue:!0})*(Math.PI/180):2==setOptionValue(1,"INGRAPHDATAANGLEPOSITION",t,e,r,void 0,a.inGraphDataAnglePosition,u,-1,{nullValue:!0})?posAngle=r[u].realStartAngle-r[u].segmentAngle/2+setOptionValue(1,"INGRAPHDATAPADDINANGLE",t,e,r,void 0,a.inGraphDataPaddingAngle,u,-1,{nullValue:!0})*(Math.PI/180):3==setOptionValue(1,"INGRAPHDATAANGLEPOSITION",t,e,r,void 0,a.inGraphDataAnglePosition,u,-1,{nullValue:!0})&&(posAngle=r[u].realStartAngle-r[u].segmentAngle+setOptionValue(1,"INGRAPHDATAPADDINANGLE",t,e,r,void 0,a.inGraphDataPaddingAngle,u,-1,{nullValue:!0})*(Math.PI/180)),1==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",t,e,r,void 0,a.inGraphDataRadiusPosition,u,-1,{nullValue:!0})?labelRadius=c+setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",t,e,r,void 0,a.inGraphDataPaddingRadius,u,-1,{nullValue:!0}):2==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",t,e,r,void 0,a.inGraphDataRadiusPosition,u,-1,{nullValue:!0})?labelRadius=c+(d-c)/2+setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",t,e,r,void 0,a.inGraphDataPaddingRadius,u,-1,{nullValue:!0}):3==setOptionValue(1,"INGRAPHDATARADIUSPOSITION",t,e,r,void 0,a.inGraphDataRadiusPosition,u,-1,{nullValue:!0})&&(labelRadius=d+setOptionValue(1,"INGRAPHDATAPADDINGRADIUS",t,e,r,void 0,a.inGraphDataPaddingRadius,u,-1,{nullValue:!0})),t.save(),"off-center"==setOptionValue(1,"INGRAPHDATAALIGN",t,e,r,void 0,a.inGraphDataAlign,u,-1,{nullValue:!0})?"inRadiusAxis"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,r,void 0,a.inGraphDataRotate,u,-1,{nullValue:!0})||(posAngle+2*Math.PI)%(2*Math.PI)>3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)3*Math.PI/2||(posAngle+2*Math.PI)%(2*Math.PI)Math.PI?t.textBaseline="top":t.textBaseline="bottom":"to-center"==setOptionValue(1,"INGRAPHDATAVALIGN",t,e,r,void 0,a.inGraphDataVAlign,u,-1,{nullValue:!0})?(posAngle+2*Math.PI)%(2*Math.PI)>Math.PI?t.textBaseline="bottom":t.textBaseline="top":t.textBaseline=setOptionValue(1,"INGRAPHDATAVALIGN",t,e,r,void 0,a.inGraphDataVAlign,u,-1,{nullValue:!0}),t.font=setOptionValue(1,"INGRAPHDATAFONTSTYLE",t,e,r,void 0,a.inGraphDataFontStyle,u,-1,{nullValue:!0})+" "+setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,r,void 0,a.inGraphDataFontSize,u,-1,{nullValue:!0})+"px "+setOptionValue(1,"INGRAPHDATAFONTFAMILY",t,e,r,void 0,a.inGraphDataFontFamily,u,-1,{nullValue:!0}),t.fillStyle=setOptionValue(1,"INGRAPHDATAFONTCOLOR",t,e,r,void 0,a.inGraphDataFontColor,u,-1,{nullValue:!0});var g=tmplbis(setOptionValue(1,"INGRAPHDATATMPL",t,e,r,void 0,a.inGraphDataTmpl,u,-1,{nullValue:!0}),r[u],a);t.translate(n+labelRadius*Math.cos(posAngle),o-labelRadius*Math.sin(posAngle));var f=0;f="inRadiusAxis"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,r,void 0,a.inGraphDataRotate,u,-1,{nullValue:!0})?2*Math.PI-posAngle:"inRadiusAxisRotateLabels"==setOptionValue(1,"INGRAPHDATAROTATE",t,e,r,void 0,a.inGraphDataRotate,u,-1,{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,"INGRAPHDATAROTATE",t,e,r,void 0,a.inGraphDataRotate,u,-1,{nullValue:!0})*(Math.PI/180),t.rotate(f),setTextBordersAndBackground(t,g,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,r,void 0,a.inGraphDataFontSize,u,-1,{nullValue:!0}),0,0,setOptionValue(1,"INGRAPHDATABORDERS",t,e,r,void 0,a.inGraphDataBorders,u,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",t,e,r,void 0,a.inGraphDataBordersColor,u,-1,{nullValue:!0}),setOptionValue(t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,e,r,void 0,a.inGraphDataBordersWidth,u,-1,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,e,r,void 0,a.inGraphDataBordersXSpace,u,-1,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,e,r,void 0,a.inGraphDataBordersYSpace,u,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",t,e,r,void 0,a.inGraphDataBordersStyle,u,-1,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",t,e,r,void 0,a.inGraphDataBackgroundColor,u,-1,{nullValue:!0}),"INGRAPHDATA"),t.fillTextMultiLine(g,0,0,t.textBaseline,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,r,void 0,a.inGraphDataFontSize,u,-1,{nullValue:!0}),!0,a.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",f,n+labelRadius*Math.cos(posAngle),o-labelRadius*Math.sin(posAngle),u,-1),t.restore()}l.legendMsr.dispLegend&&drawLegend(l.legendMsr,e,a,t,"Doughnut")}var l,n,o,s;if("undefined"==typeof t.tpchart&&(t.tpchart="Doughnut"),t.tpdata=1,init_and_start(t,e,a)){var r=initPassVariableData_part1(e,a,t);((a.startAngle*(Math.PI/180)+2*Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI);a.logarithmic=!1,a.logarithmic2=!1,l=setMeasures(e,a,t,height,width,"none",null,!0,!1,!1,!1,!0,"Doughnut");var c=calculatePieDrawingSize(t,l,a,e,r);n=c.midPieX,o=c.midPieY,s=c.radius;var h;h="Pie"==t.tpchart?0:s*(a.percentageInnerCutout/100),s>0?(initPassVariableData_part2(r,e,a,t,{midPosX:n,midPosY:o,int_radius:h,ext_radius:s,outerVal:-1}),animationLoop(a,null,i,t,l.clrx,l.clry,l.clrwidth,l.clrheight,n,o,n-s,o+s,e,r)):testRedraw(t,e,a)}},Line=function(data,config,ctx){function drawLines(e){drawLinesDataset(e,data,config,ctx,statData,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,nbValueHop:data.labels.length-1}),e>=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 e=0;e0&&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;i90?(ctx.save(),ctx.textAlign="left"):msr.rotateLabels>0?(ctx.save(),ctx.textAlign="right"):ctx.textAlign="center",ctx.fillStyle=config.scaleFontColor,config.xAxisBottom))for(var e=0;e0?(ctx.translate(yAxisPosX+e*valueHop-msr.highestXLabel/2,msr.xLabelPos),ctx.rotate(-(msr.rotateLabels*(Math.PI/180))),ctx.fillTextMultiLine(fmtChartJS(config,data.labels[e],config.fmtXLabel),0,0,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XSCALE_TEXTMOUSE",-(msr.rotateLabels*(Math.PI/180)),yAxisPosX+e*valueHop-msr.highestXLabel/2,msr.xLabelPos,e,-1)):ctx.fillTextMultiLine(fmtChartJS(config,data.labels[e],config.fmtXLabel),yAxisPosX+e*valueHop,msr.xLabelPos,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XSCALE_TEXTMOUSE",0,0,0,e,-1),ctx.restore());ctx.textAlign="right",ctx.textBaseline="middle";for(var a=config.showYAxisMin?-1:0;aupperValue2&&(upperValue2=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=0,lowerValue=0),Math.abs(upperValue-lowerValue)0?(upperValue=1.1*upperValue,lowerValue=.9*lowerValue):(upperValue=.9*upperValue,lowerValue=1.1*lowerValue)),"function"==typeof config.graphMin?lowerValue=setOptionValue(1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin,-1,-1,{nullValue:!0}):isNaN(config.graphMin)||(lowerValue=config.graphMin),"function"==typeof config.graphMax?upperValue=setOptionValue(1,"GRAPHMAX",ctx,data,statData,void 0,config.graphMax,-1,-1,{nullValue:!0}):isNaN(config.graphMax)||(upperValue=config.graphMax),secondAxis&&(lowerValue2>upperValue2&&(upperValue2=0,lowerValue2=0),Math.abs(upperValue2-lowerValue2)0?(upperValue2=1.1*upperValue2,lowerValue2=.9*lowerValue2):(upperValue2=.9*upperValue2,lowerValue2=1.1*lowerValue2)),"function"==typeof config.graphMin2?lowerValue2=setOptionValue(1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin2,-1,-1,{nullValue:!0}):isNaN(config.graphMin2)||(lowerValue2=config.graphMin2),"function"==typeof config.graphMax2?upperValue2=setOptionValue(1,"GRAPHMAX",ctx,data,statData,void 0,config.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;iOrderOfMagnitude||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(1,"SCALESTARTVALUE",ctx,data,statData,void 0,config.scaleStartValue,-1,-1,{nullValue:!0}),scaleSteps=setOptionValue(1,"SCALESTEPS",ctx,data,statData,void 0,config.scaleSteps,-1,-1,{nullValue:!0}),scaleStepWidth=setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,void 0,config.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(1,"SCALESTARTVALUE2",ctx,data,statData,void 0,config.scaleStartValue2,-1,-1,{nullValue:!0}),scaleSteps2=setOptionValue(1,"SCALESTEPS2",ctx,data,statData,void 0,config.scaleSteps2,-1,-1,{nullValue:!0}),scaleStepWidth2=setOptionValue(1,"SCALESTEPWIDTH2",ctx,data,statData,void 0,config.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,height,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(),valueBounds.minValue<0&&(zeroY=calculateOffset(config.logarithmic,0,calculatedScale,scaleHop)),valueBounds.minValue2<0&&(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)}},StackedBar=function(e,a,t){function i(i){t.lineWidth=Math.ceil(t.chartLineScale*a.barStrokeWidth);for(var l=0;l1&&(o-=1),"undefined"!=typeof e.datasets[l].data[n]&&1*e.datasets[l].data[n]!=0){var s,r;a.animationByDataset?(s=A[l][n].yPosBottom,r=A[l][n].yPosTop,r=s+o*(r-s)):(s=A[A[l][n].firstNotMissing][n].yPosBottom-o*(A[A[l][n].firstNotMissing][n].yPosBottom-A[l][n].yPosBottom),r=A[A[l][n].firstNotMissing][n].yPosBottom-o*(A[A[l][n].firstNotMissing][n].yPosBottom-A[l][n].yPosTop)),t.fillStyle=setOptionValue(1,"COLOR",t,e,A,e.datasets[l].fillColor,a.defaultFillColor,l,n,{animationValue:o,xPosLeft:A[l][n].xPosLeft,yPosBottom:s,xPosRight:A[l][n].xPosRight,yPosTop:r}),t.strokeStyle=setOptionValue(1,"STROKECOLOR",t,e,A,e.datasets[l].strokeColor,a.defaultStrokeColor,l,n,{nullvalue:null}),0!=o&&s!=r&&(t.beginPath(),t.moveTo(A[l][n].xPosLeft,s),t.lineTo(A[l][n].xPosLeft,r),t.lineTo(A[l][n].xPosRight,r),t.lineTo(A[l][n].xPosRight,s),a.barShowStroke&&(t.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",t,e,A,e.datasets[l].datasetStrokeStyle,a.datasetStrokeStyle,l,n,{nullvalue:null}))),t.stroke(),t.setLineDash([])),t.closePath(),t.fill())}}if(drawLinesDataset(i,e,a,t,A,{xAxisPosY:g,yAxisPosX:S,valueHop:p,nbValueHop:e.labels.length}),i>=a.animationStopValue){var c=0,h=0;for(l=0;lx.topNotUsableSize){t.translate(h,c);var u=setOptionValue(1,"INGRAPHDATAROTATE",t,e,A,void 0,a.inGraphDataRotate,l,n,{nullValue:!0})*(Math.PI/180);t.rotate(u),setTextBordersAndBackground(t,d,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,A,void 0,a.inGraphDataFontSize,l,n,{nullValue:!0}),0,0,setOptionValue(1,"INGRAPHDATABORDERS",t,e,A,void 0,a.inGraphDataBorders,l,n,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSCOLOR",t,e,A,void 0,a.inGraphDataBordersColor,l,n,{nullValue:!0}),setOptionValue(t.chartLineScale,"INGRAPHDATABORDERSWIDTH",t,e,A,void 0,a.inGraphDataBordersWidth,l,n,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSXSPACE",t,e,A,void 0,a.inGraphDataBordersXSpace,l,n,{nullValue:!0}),setOptionValue(t.chartSpaceScale,"INGRAPHDATABORDERSYSPACE",t,e,A,void 0,a.inGraphDataBordersYSpace,l,n,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABORDERSSTYLE",t,e,A,void 0,a.inGraphDataBordersStyle,l,n,{nullValue:!0}),setOptionValue(1,"INGRAPHDATABACKGROUNDCOLOR",t,e,A,void 0,a.inGraphDataBackgroundColor,l,n,{nullValue:!0}),"INGRAPHDATA"),t.fillTextMultiLine(d,0,0,t.textBaseline,setOptionValue(t.chartTextScale,"INGRAPHDATAFONTSIZE",t,e,A,void 0,a.inGraphDataFontSize,l,n,{nullValue:!0}),!0,a.detectMouseOnText,t,"INGRAPHDATA_TEXTMOUSE",u,h,c,l,n)}t.restore()}}x.legendMsr.dispLegend&&drawLegend(x.legendMsr,e,a,t,"StackedBar")}function l(){t.lineWidth=Math.ceil(t.chartLineScale*a.scaleLineWidth),t.strokeStyle=a.scaleLineColor,t.setLineDash(lineStyleFn(a.scaleLineStyle)),t.beginPath(),t.moveTo(S-Math.ceil(t.chartLineScale*a.scaleTickSizeLeft),g),t.lineTo(S+x.availableWidth+Math.ceil(t.chartLineScale*a.scaleTickSizeRight),g),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(a.scaleGridLineStyle));for(var i=0;i0&&i%a.scaleXGridLinesStep==0?t.lineTo(S+i*p,g-x.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeTop)):t.lineTo(S+i*p,g),t.stroke();t.setLineDash([]),t.lineWidth=Math.ceil(t.chartLineScale*a.scaleLineWidth),t.strokeStyle=a.scaleLineColor,t.setLineDash(lineStyleFn(a.scaleLineStyle)),t.beginPath(),t.moveTo(S,g+Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)),t.lineTo(S,g-x.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeTop)),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(a.scaleGridLineStyle));for(var l=a.showYAxisMin?-1:0;l90?(t.save(),t.textAlign="left"):x.rotateLabels>0?(t.save(),t.textAlign="right"):t.textAlign="center",t.fillStyle=a.scaleFontColor,a.xAxisBottom))for(var i=0;i0?(t.translate(S+Math.ceil(t.chartSpaceScale*a.barValueSpacing)+i*p+D+f/2-x.highestXLabel/2,x.xLabelPos),t.rotate(-(x.rotateLabels*(Math.PI/180))),t.fillTextMultiLine(fmtChartJS(a,e.labels[i],a.fmtXLabel),0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.scaleFontSize),!0,a.detectMouseOnText,t,"XAXIS_TEXTMOUSE",-(x.rotateLabels*(Math.PI/180)),S+Math.ceil(t.chartSpaceScale*a.barValueSpacing)+i*p+D+f/2-x.highestXLabel/2,x.xLabelPos,i,-1)):t.fillTextMultiLine(fmtChartJS(a,e.labels[i],a.fmtXLabel),S+Math.ceil(t.chartSpaceScale*a.barValueSpacing)+i*p+D+f/2,x.xLabelPos,t.textBaseline,Math.ceil(t.chartTextScale*a.scaleFontSize),!0,a.detectMouseOnText,t,"XAXIS_TEXTMOUSE",0,0,0,i,-1),t.restore());t.textAlign="right",t.textBaseline="middle";for(var l=a.showYAxisMin?-1:0;l0?("Bar"==A[p][0].tpchart?("undefined"==typeof s[S]&&(s[S]=0),s[S]+=1*e.datasets[p].data[S],i=Math.max(i,s[S])):i=Math.max(i,1*e.datasets[p].data[S]),l=Math.min(l,1*e.datasets[p].data[S]),d=1):"number"==typeof(1*e.datasets[p].data[S])&&"undefined"!=typeof e.datasets[p].data[S]&&("Bar"==A[p][0].tpchart?("undefined"==typeof r[S]&&(r[S]=0),r[S]+=1*e.datasets[p].data[S],o=Math.min(o,r[S])):o=Math.min(o,1*e.datasets[p].data[S]),n=Math.max(n,1*e.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 a.graphMin?f=setOptionValue(1,"GRAPHMIN",t,e,A,void 0,a.graphMin,-1,-1,{nullValue:!0}):isNaN(a.graphMin)||(f=a.graphMin),"function"==typeof a.graphMax?g=setOptionValue(1,"GRAPHMAX",t,e,A,void 0,a.graphMax,-1,-1,{nullValue:!0}):isNaN(a.graphMax)||(g=a.graphMax),f>g&&(g=0,f=0),Math.abs(g-f)0?(g=1.1*g,f=.9*f):(g=.9*g,f=1.1*f)),c=Math.ceil(t.chartTextScale*a.scaleFontSize),h=x.availableHeight;var m=Math.floor(h/(.66*c)),M=Math.floor(h/c*.5);return f>g&&(f=g-1),{maxValue:g,minValue:f,maxSteps:m,minSteps:M}}var s,r,c,h,d,u,p,S,g,f,x;if(t.tpchart="StackedBar",t.tpdata=0,init_and_start(t,e,a)){for(var A=initPassVariableData_part1(e,a,t),m=e.datasets.length,M=0;M0&&d.minSteps>0){if(u=a.scaleShowLabels?a.scaleLabel:"",a.scaleOverride){var T=setOptionValue(1,"SCALESTARTVALUE",t,e,A,void 0,a.scaleStartValue,-1,-1,{nullValue:!0}),P=setOptionValue(1,"SCALESTEPS",t,e,A,void 0,a.scaleSteps,-1,-1,{nullValue:!0}),v=setOptionValue(1,"SCALESTEPWIDTH",t,e,A,void 0,a.scaleStepWidth,-1,-1,{nullValue:!0});r={steps:P,stepValue:v,graphMin:T,labels:[]};for(var M=0;M<=r.steps;M++)u&&r.labels.push(tmpl(u,{value:fmtChartJS(a,1*(T+v*M).toFixed(getDecimalPlaces(v)),a.fmtYLabel)},a));x=setMeasures(e,a,t,height,width,r.labels,null,!0,!1,!0,!0,!0,"StackedBar")}else r=calculateScale(1,a,d.maxSteps,d.minSteps,d.maxValue,d.minValue,u),x=setMeasures(e,a,t,height,width,r.labels,null,!0,!1,!0,!0,!0,"StackedBar");var L=x.availableHeight;x.availableHeight=x.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)-Math.ceil(t.chartLineScale*a.scaleTickSizeTop),x.availableWidth=x.availableWidth-Math.ceil(t.chartLineScale*a.scaleTickSizeLeft)-Math.ceil(t.chartLineScale*a.scaleTickSizeRight),s=Math.floor(x.availableHeight/r.steps),p=Math.floor(x.availableWidth/e.labels.length),(0==p||a.fullWidthGraph)&&(p=x.availableWidth/e.labels.length),x.clrwidth=x.clrwidth-(x.availableWidth-e.labels.length*p),x.availableWidth=e.labels.length*p,x.availableHeight=r.steps*s,x.xLabelPos+=Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)+Math.ceil(t.chartLineScale*a.scaleTickSizeTop)-(L-x.availableHeight),x.clrheight+=Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)+Math.ceil(t.chartLineScale*a.scaleTickSizeTop)-(L-x.availableHeight),S=x.leftNotUsableSize+Math.ceil(t.chartLineScale*a.scaleTickSizeLeft),g=x.topNotUsableSize+x.availableHeight+Math.ceil(t.chartLineScale*a.scaleTickSizeTop),f=p-2*Math.ceil(t.chartLineScale*a.scaleGridLineWidth)-2*Math.ceil(t.chartSpaceScale*a.barValueSpacing)-(1*Math.ceil(t.chartSpaceScale*a.barDatasetSpacing)-1)-Math.ceil(t.chartLineScale*a.barStrokeWidth)/2-1,f>=0&&1>=f&&(f=1),0>f&&f>=-1&&(f=-1);var D;1*a.maxBarWidth>0&&f>1*a.maxBarWidth?(D=(f-1*a.maxBarWidth)/2,f=1*a.maxBarWidth):D=0;var V=0,y=0;d.minValue<0&&(V=calculateOffset(!1,0,r,s)),d.minValue2<0&&(y=calculateOffset(a.logarithmic2,0,calculatedScale2,scaleHop2)),n(),initPassVariableData_part2(A,e,a,t,{msr:x,zeroY:V,zeroY2:y,logarithmic:!1,logarithmic2:!1,calculatedScale:r,additionalSpaceBetweenBars:D,scaleHop:s,valueHop:p,yAxisPosX:S,xAxisPosY:g,barWidth:f}),animationLoop(a,l,i,t,x.clrx,x.clry,x.clrwidth,x.clrheight,S+x.availableWidth/2,g-x.availableHeight/2,S,g,e,A)}else testRedraw(t,e,a)}},HorizontalStackedBar=function(e,a,t){function i(e,a,t){var i=a.steps*a.stepValue,l=e-a.graphMin,n=CapValue(l/i,1,0);return t*a.steps*n}function l(i){t.lineWidth=Math.ceil(t.chartLineScale*a.barStrokeWidth);for(var l=0;l1&&(o-=1),"undefined"!=typeof e.datasets[l].data[n]&&1*e.datasets[l].data[n]!=0){var s,r;a.animationByDataset?(s=m[l][n].xPosLeft,r=m[l][n].xPosRight,r=s+o*(r-s)):(s=m[m[l][n].firstNotMissing][n].xPosLeft+o*(m[l][n].xPosLeft-m[m[l][n].firstNotMissing][n].xPosLeft),r=m[m[l][n].firstNotMissing][n].xPosLeft+o*(m[l][n].xPosRight-m[m[l][n].firstNotMissing][n].xPosLeft)),t.fillStyle=setOptionValue(1,"COLOR",t,e,m,e.datasets[l].fillColor,a.defaultFillColor,l,n,{animationValue:o,xPosLeft:s,yPosBottom:m[l][n].yPosBottom,xPosRight:r,yPosTop:m[l][n].yPosBottom}),t.strokeStyle=setOptionValue(1,"STROKECOLOR",t,e,m,e.datasets[l].strokeColor,a.defaultStrokeColor,l,n,{nullvalue:null}),0!=o&&m[l][n].xPosLeft!=m[l][n].xPosRight&&(t.beginPath(),t.moveTo(s,m[l][n].yPosTop),t.lineTo(r,m[l][n].yPosTop),t.lineTo(r,m[l][n].yPosBottom),t.lineTo(s,m[l][n].yPosBottom),t.lineTo(s,m[l][n].yPosTop),a.barShowStroke&&(t.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",t,e,m,e.datasets[l].datasetStrokeStyle,a.datasetStrokeStyle,l,n,{nullvalue:null}))),t.stroke(),t.setLineDash([])),t.closePath(),t.fill())}}if(i>=a.animationStopValue){var c=0,h=0;for(l=0;l=0&&(t.beginPath(),t.moveTo(g+i*S,f+Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)),t.lineWidth=Math.ceil(t.chartLineScale*a.scaleGridLineWidth),t.strokeStyle=a.scaleGridLineColor,a.scaleShowGridLines&&i>0&&i%a.scaleXGridLinesStep==0?t.lineTo(g+i*S,f-A.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeTop)):t.lineTo(g+i*S,f),t.stroke()),t.setLineDash([]);t.lineWidth=Math.ceil(t.chartLineScale*a.scaleLineWidth),t.strokeStyle=a.scaleLineColor,t.setLineDash(lineStyleFn(a.scaleLineStyle)),t.beginPath(),t.moveTo(g,f+Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)),t.lineTo(g,f-A.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeTop)),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(a.scaleGridLineStyle));for(var l=0;l90?(t.save(),t.textAlign="left"):A.rotateLabels>0?(t.save(),t.textAlign="right"):t.textAlign="center",t.fillStyle=a.scaleFontColor,a.xAxisBottom))for(var i=a.showYAxisMin?-1:0;i0?(t.translate(g+(i+1)*S-A.highestXLabel/2,A.xLabelPos),t.rotate(-(A.rotateLabels*(Math.PI/180))),t.fillTextMultiLine(c.labels[i+1],0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.scaleFontSize),!0,a.detectMouseOnText,t,"XAXIS_TEXTMOUSE",-(A.rotateLabels*(Math.PI/180)),g+(i+1)*S-A.highestXLabel/2,A.xLabelPos,i,-1)):t.fillTextMultiLine(c.labels[i+1],g+(i+1)*S,A.xLabelPos,t.textBaseline,Math.ceil(t.chartTextScale*a.scaleFontSize),!0,a.detectMouseOnText,t,"XAXIS_TEXTMOUSE",0,0,0,i,-1),t.restore());t.textAlign="right",t.textBaseline="middle";for(var l=0;l0?(r+=1*e.datasets[0].data[o],r>i&&(i=r),l>r&&(l=r)):(c+=1*e.datasets[0].data[o],c>i&&(i=c),l>c&&(l=c)));s>0;)"undefined"!=typeof e.datasets[s].data[o]&&(1*e.datasets[s].data[o]>0?(r+=1*e.datasets[s].data[o],r>i&&(i=r),l>r&&(l=r)):(c+=1*e.datasets[s].data[o],c>i&&(i=c),l>c&&(l=c))),s--}"function"==typeof a.graphMin?l=setOptionValue(1,"GRAPHMIN",t,e,m,void 0,a.graphMin,-1,-1,{nullValue:!0}):isNaN(a.graphMin)||(l=a.graphMin),"function"==typeof a.graphMax?i=setOptionValue(1,"GRAPHMAX",t,e,m,void 0,a.graphMax,-1,-1,{nullValue:!0}):isNaN(a.graphMax)||(i=a.graphMax),l>i&&(i=0,l=0),Math.abs(i-l)0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),h=Math.ceil(t.chartTextScale*a.scaleFontSize),d=A.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,x,A;if(a.reverseOrder&&"undefined"==typeof t.reversed&&(t.reversed=!0,e=reverseData(e)),t.tpchart="HorizontalStackedBar",t.tpdata=0,init_and_start(t,e,a)){var m=initPassVariableData_part1(e,a,t);if(a.logarithmic=!1,A=setMeasures(e,a,t,height,width,"nihil",[""],!0,!0,!0,!0,!0,"HorizontalStackedBar"),u=s(),u.maxSteps>0&&u.minSteps>0){if(p=a.scaleShowLabels?a.scaleLabel:"",a.scaleOverride){var M=setOptionValue(1,"SCALESTARTVALUE",t,e,m,void 0,a.scaleStartValue,-1,-1,{nullValue:!0}),T=setOptionValue(1,"SCALESTEPS",t,e,m,void 0,a.scaleSteps,-1,-1,{nullValue:!0}),P=setOptionValue(1,"SCALESTEPWIDTH",t,e,m,void 0,a.scaleStepWidth,-1,-1,{nullValue:!0});c={steps:T,stepValue:P,graphMin:M,labels:[]};for(var v=0;v<=c.steps;v++)p&&c.labels.push(tmpl(p,{value:fmtChartJS(a,1*(M+P*v).toFixed(getDecimalPlaces(P)),a.fmtYLabel)},a));A=setMeasures(e,a,t,height,width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalStackedBar")}else c=calculateScale(1,a,u.maxSteps,u.minSteps,u.maxValue,u.minValue,p),A=setMeasures(e,a,t,height,width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalStackedBar");A.availableHeight=A.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)-Math.ceil(t.chartLineScale*a.scaleTickSizeTop),A.availableWidth=A.availableWidth-Math.ceil(t.chartLineScale*a.scaleTickSizeLeft)-Math.ceil(t.chartLineScale*a.scaleTickSizeRight),r=Math.floor(A.availableHeight/e.labels.length),S=Math.floor(A.availableWidth/c.steps),(0==S||a.fullWidthGraph)&&(S=A.availableWidth/c.steps),A.clrwidth=A.clrwidth-(A.availableWidth-c.steps*S),A.availableWidth=c.steps*S,A.availableHeight=e.labels.length*r,g=A.leftNotUsableSize+Math.ceil(t.chartLineScale*a.scaleTickSizeLeft),f=A.topNotUsableSize+A.availableHeight+Math.ceil(t.chartLineScale*a.scaleTickSizeTop),x=r-2*Math.ceil(t.chartLineScale*a.scaleGridLineWidth)-2*Math.ceil(t.chartSpaceScale*a.barValueSpacing)-(1*Math.ceil(t.chartSpaceScale*a.barDatasetSpacing)-1)-Math.ceil(t.chartLineScale*a.barStrokeWidth)/2-1,x>=0&&1>=x&&(x=1),0>x&&x>=-1&&(x=-1);var L;1*a.maxBarWidth>0&&x>1*a.maxBarWidth?(L=(x-1*a.maxBarWidth)/2,x=1*a.maxBarWidth):L=0,o(),zeroY=i(0,c,r),initPassVariableData_part2(m,e,a,t,{yAxisPosX:g,additionalSpaceBetweenBars:L,xAxisPosY:f,barWidth:x,zeroY:zeroY,scaleHop:r,valueHop:S,calculatedScale:c}),animationLoop(a,n,l,t,A.clrx,A.clry,A.clrwidth,A.clrheight,g+A.availableWidth/2,f-A.availableHeight/2,g,f,e,m)}else testRedraw(t,e,a)}},Bar=function(data,config,ctx){function drawBars(e){var a,t;ctx.lineWidth=Math.ceil(ctx.chartLineScale*config.barStrokeWidth);for(var i=0;i1&&(n-=1);var o=n*statData[i][l].barHeight+Math.ceil(ctx.chartLineScale*config.barStrokeWidth)/2;ctx.fillStyle=setOptionValue(1,"COLOR",ctx,data,statData,data.datasets[i].fillColor,config.defaultFillColor,i,l,{animationValue:n,xPosLeft:statData[i][l].xPosLeft,yPosBottom:statData[i][l].yPosBottom,xPosRight:statData[i][l].xPosLeft+barWidth,yPosTop:statData[i][l].yPosBottom-o}),ctx.strokeStyle=setOptionValue(1,"STROKECOLOR",ctx,data,statData,data.datasets[i].strokeColor,config.defaultStrokeColor,i,l,{nullvalue:null}),roundRect(ctx,statData[i][l].xPosLeft,statData[i][l].yPosBottom,barWidth,o,config.barShowStroke,config.barBorderRadius,i,l,data.datasets[i].data[l]<0?-1:1)}if(drawLinesDataset(e,data,config,ctx,statData,{xAxisPosY:xAxisPosY,yAxisPosX:yAxisPosX,valueHop:valueHop,nbValueHop:data.labels.length}),e>=config.animationStopValue)for(i=0;i=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(e,a,t,i,l,n,o,s,r,c){e.beginPath(),e.setLineDash(lineStyleFn(setOptionValue(1,"STROKESTYLE",e,data,statData,data.datasets[s].datasetStrokeStyle,config.datasetStrokeStyle,s,r,{nullvalue:null}))),e.moveTo(a+o,t),e.lineTo(a+i-o,t),e.quadraticCurveTo(a+i,t,a+i,t),e.lineTo(a+i,t-l+c*o),e.quadraticCurveTo(a+i,t-l,a+i-o,t-l),e.lineTo(a+o,t-l),e.quadraticCurveTo(a,t-l,a,t-l+c*o),e.lineTo(a,t),e.quadraticCurveTo(a,t,a+o,t),n&&e.stroke(),e.closePath(),e.fill(),e.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 e=0;e0&&e%config.scaleXGridLinesStep==0?ctx.lineTo(yAxisPosX+e*valueHop,xAxisPosY-msr.availableHeight-Math.ceil(ctx.chartLineScale*config.scaleTickSizeTop)):ctx.lineTo(yAxisPosX+e*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 a=0;a90?(ctx.save(),ctx.textAlign="left"):msr.rotateLabels>0?(ctx.save(),ctx.textAlign="right"):ctx.textAlign="center",ctx.fillStyle=config.scaleFontColor,config.xAxisBottom))for(var e=0;e0?(ctx.translate(yAxisPosX+e*valueHop+valueHop/2-msr.highestXLabel/2,msr.xLabelPos),ctx.rotate(-(msr.rotateLabels*(Math.PI/180))),ctx.fillTextMultiLine(fmtChartJS(config,data.labels[e],config.fmtXLabel),0,0,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XAXIS_TEXTMOUSE",-(msr.rotateLabels*(Math.PI/180)),yAxisPosX+e*valueHop+valueHop/2-msr.highestXLabel/2,msr.xLabelPos,e,-1)):ctx.fillTextMultiLine(fmtChartJS(config,data.labels[e],config.fmtXLabel),yAxisPosX+e*valueHop+valueHop/2,msr.xLabelPos,ctx.textBaseline,Math.ceil(ctx.chartTextScale*config.scaleFontSize),!0,config.detectMouseOnText,ctx,"XAXIS_TEXTMOUSE",0,0,0,e,-1),ctx.restore());ctx.textAlign="right",ctx.textBaseline="middle";for(var a=config.showYAxisMin?-1:0;aupperValue2&&(upperValue2=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=0,lowerValue=0),Math.abs(upperValue-lowerValue)0?(upperValue=1.1*upperValue,lowerValue=.9*lowerValue):(upperValue=.9*upperValue,lowerValue=1.1*lowerValue)),"function"==typeof config.graphMin?lowerValue=setOptionValue(1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin,-1,-1,{nullValue:!0}):isNaN(config.graphMin)||(lowerValue=config.graphMin),"function"==typeof config.graphMax?upperValue=setOptionValue(1,"GRAPHMAX",ctx,data,statData,void 0,config.graphMax,-1,-1,{nullValue:!0}):isNaN(config.graphMax)||(upperValue=config.graphMax),secondAxis&&(lowerValue2>upperValue2&&(upperValue2=0,lowerValue2=0),Math.abs(upperValue2-lowerValue2)0?(upperValue2=1.1*upperValue2,lowerValue2=.9*lowerValue2):(upperValue2=.9*upperValue2,lowerValue2=1.1*lowerValue2)),"function"==typeof config.graphMin2?lowerValue2=setOptionValue(1,"GRAPHMIN",ctx,data,statData,void 0,config.graphMin2,-1,-1,{nullValue:!0}):isNaN(config.graphMin2)||(lowerValue2=config.graphMin2),"function"==typeof config.graphMax2?upperValue2=setOptionValue(1,"GRAPHMAX",ctx,data,statData,void 0,config.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;i0&&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(1,"SCALESTARTVALUE",ctx,data,statData,void 0,config.scaleStartValue,-1,-1,{nullValue:!0}),scaleSteps=setOptionValue(1,"SCALESTEPS",ctx,data,statData,void 0,config.scaleSteps,-1,-1,{nullValue:!0}),scaleStepWidth=setOptionValue(1,"SCALESTEPWIDTH",ctx,data,statData,void 0,config.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(1,"SCALESTARTVALUE2",ctx,data,statData,void 0,config.scaleStartValue2,-1,-1,{nullValue:!0}),scaleSteps2=setOptionValue(1,"SCALESTEPS2",ctx,data,statData,void 0,config.scaleSteps2,-1,-1,{nullValue:!0}),scaleStepWidth2=setOptionValue(1,"SCALESTEPWIDTH2",ctx,data,statData,void 0,config.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,height,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 zeroY=0,zeroY2=0;valueBounds.minValue<0&&(zeroY=calculateOffset(config.logarithmic,0,calculatedScale,scaleHop)),valueBounds.minValue2<0&&(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)}},HorizontalBar=function(e,a,t){function i(i){for(var n=0;n1&&(s-=1);var r=s*m[n][o].barWidth+Math.ceil(t.chartLineScale*a.barStrokeWidth)/2;t.fillStyle=setOptionValue(1,"COLOR",t,e,m,e.datasets[n].fillColor,a.defaultFillColor,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(1,"STROKECOLOR",t,e,m,e.datasets[n].strokeColor,a.defaultStrokeColor,n,o,{nullvalue:null}),"undefined"!=typeof e.datasets[n].data[o]&&l(t,m[n][o].yPosTop,m[n][o].xPosLeft,x,r,a.barShowStroke,a.barBorderRadius,0,n,o,e.datasets[n].data[o]<0?-1:1)}if(i>=a.animationStopValue)for(n=0;n=0&&(t.beginPath(),t.moveTo(g+i*S,f+Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)),t.lineWidth=Math.ceil(t.chartLineScale*a.scaleGridLineWidth),t.strokeStyle=a.scaleGridLineColor,a.scaleShowGridLines&&i>0&&i%a.scaleXGridLinesStep==0?t.lineTo(g+i*S,f-A.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeTop)):t.lineTo(g+i*S,f),t.stroke());t.setLineDash([]),t.lineWidth=Math.ceil(t.chartLineScale*a.scaleLineWidth),t.strokeStyle=a.scaleLineColor,t.setLineDash(lineStyleFn(a.scaleLineStyle)),t.beginPath(),t.moveTo(g,f+Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)),t.lineTo(g,f-A.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeTop)),t.stroke(),t.setLineDash([]),t.setLineDash(lineStyleFn(a.scaleGridLineStyle));for(var l=0;l90?(t.save(),t.textAlign="left"):A.rotateLabels>0?(t.save(),t.textAlign="right"):t.textAlign="center",t.fillStyle=a.scaleFontColor,a.xAxisBottom))for(var i=a.showYAxisMin?-1:0;i0?(t.translate(g+(i+1)*S-A.highestXLabel/2,A.xLabelPos),t.rotate(-(A.rotateLabels*(Math.PI/180))),t.fillTextMultiLine(c.labels[i+1],0,0,t.textBaseline,Math.ceil(t.chartTextScale*a.scaleFontSize),!0,a.detectMouseOnText,t,"XAXIS_TEXTMOUSE",-(A.rotateLabels*(Math.PI/180)),g+(i+1)*S-A.highestXLabel/2,A.xLabelPos,i,-1)):t.fillTextMultiLine(c.labels[i+1],g+(i+1)*S,A.xLabelPos,t.textBaseline,Math.ceil(t.chartTextScale*a.scaleFontSize),!0,a.detectMouseOnText,t,"XAXIS_TEXTMOUSE",0,0,0,i,-1),t.restore());t.textAlign="right",t.textBaseline="middle";for(var l=0;li&&(i=1*e.datasets[n].data[o]),1*e.datasets[n].data[o]i&&(i=0,l=0),Math.abs(i-l)0?(i=1.1*i,l=.9*l):(i=.9*i,l=1.1*l)),"function"==typeof a.graphMin?l=setOptionValue(1,"GRAPHMIN",t,e,m,void 0,a.graphMin,-1,-1,{nullValue:!0}):isNaN(a.graphMin)||(l=a.graphMin),"function"==typeof a.graphMax?i=setOptionValue(1,"GRAPHMAX",t,e,m,void 0,a.graphMax,-1,-1,{nullValue:!0}):isNaN(a.graphMax)||(i=a.graphMax),h=Math.ceil(t.chartTextScale*a.scaleFontSize),d=A.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,x,A;if(t.tpchart="HorizontalBar",t.tpdata=0,init_and_start(t,e,a)){a.reverseOrder&&"undefined"==typeof t.reversed&&(t.reversed=!0,e=reverseData(e));var m=initPassVariableData_part1(e,a,t);if(A=setMeasures(e,a,t,height,width,"nihil",[""],!0,!0,!0,!0,!0,"StackedBar"),u=s(),u.minValue<=0&&(a.logarithmic=!1),u.maxSteps>0&&u.minSteps>0){if(a.logarithmic!==!1&&u.minValue<=0&&(a.logarithmic=!1),p=a.scaleShowLabels?a.scaleLabel:"",a.scaleOverride){var M=setOptionValue(1,"SCALESTARTVALUE",t,e,m,void 0,a.scaleStartValue,-1,-1,{nullValue:!0}),T=setOptionValue(1,"SCALESTEPS",t,e,m,void 0,a.scaleSteps,-1,-1,{nullValue:!0}),P=setOptionValue(1,"SCALESTEPWIDTH",t,e,m,void 0,a.scaleStepWidth,-1,-1,{nullValue:!0});c={steps:T,stepValue:P,graphMin:M,graphMax:M+T*P,labels:[]},populateLabels(1,a,p,c.labels,c.steps,M,c.graphMax,P),A=setMeasures(e,a,t,height,width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalBar")}else c=calculateScale(1,a,u.maxSteps,u.minSteps,u.maxValue,u.minValue,p),A=setMeasures(e,a,t,height,width,c.labels,null,!0,!0,!0,!0,!0,"HorizontalBar");A.availableHeight=A.availableHeight-Math.ceil(t.chartLineScale*a.scaleTickSizeBottom)-Math.ceil(t.chartLineScale*a.scaleTickSizeTop),A.availableWidth=A.availableWidth-Math.ceil(t.chartLineScale*a.scaleTickSizeLeft)-Math.ceil(t.chartLineScale*a.scaleTickSizeRight),r=Math.floor(A.availableHeight/e.labels.length),S=Math.floor(A.availableWidth/c.steps),(0==S||a.fullWidthGraph)&&(S=A.availableWidth/c.steps),A.clrwidth=A.clrwidth-(A.availableWidth-c.steps*S),A.availableWidth=c.steps*S,A.availableHeight=e.labels.length*r,g=A.leftNotUsableSize+Math.ceil(t.chartLineScale*a.scaleTickSizeLeft),f=A.topNotUsableSize+A.availableHeight+Math.ceil(t.chartLineScale*a.scaleTickSizeTop),x=(r-2*Math.ceil(t.chartLineScale*a.scaleGridLineWidth)-2*Math.ceil(t.chartSpaceScale*a.barValueSpacing)-(Math.ceil(t.chartSpaceScale*a.barDatasetSpacing)*e.datasets.length-1)-(Math.ceil(t.chartLineScale*a.barStrokeWidth)/2*e.datasets.length-1))/e.datasets.length,x>=0&&1>=x&&(x=1),0>x&&x>=-1&&(x=-1);var v;1*a.maxBarWidth>0&&x>1*a.maxBarWidth?(v=e.datasets.length*(x-1*a.maxBarWidth)/2,x=1*a.maxBarWidth):v=0;var L=0;u.minValue<0&&(L=calculateOffset(a.logarithmic,0,c,S)),o(),initPassVariableData_part2(m,e,a,t,{yAxisPosX:g,xAxisPosY:f,barWidth:x,additionalSpaceBetweenBars:v,zeroY:L,scaleHop:r,valueHop:S,calculatedScale:c}),animationLoop(a,n,i,t,A.clrx,A.clry,A.clrwidth,A.clrheight,g+A.availableWidth/2,f-A.availableHeight/2,g,f,e,m)}else testRedraw(t,e,a)}},requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),cache={}}; \ No newline at end of file +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;a10?(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-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()=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=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=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;jmyStatData.int_radius&&distancemyStatData.startAngle&&anglemyStatData.startAngle-2*Math.PI&&anglemyStatData.startAngle+2*Math.PI&&anglemyStatData.int_radius&&distancemyStatData.startAngle&&anglemyStatData.startAngle-2*Math.PI&&anglemyStatData.startAngle+2*Math.PI&&angleleftX&&canvas_pos.xbottomY&&(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.xMath.max(myStatData.annotateStartPosX,myStatData.annotateEndPosX)+Math.ceil(ctx.chartSpaceScale*config.pointHitDetectionRadius)||canvas_pos.yMath.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));distanceMath.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p2)&&(inRect=!1),canvas_pos.yMath.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)Math.max(jsTextMousePos[ctx.ChartNewId][i][2].p1,jsTextMousePos[ctx.ChartNewId][i][2].p3)&&(inRect=!1),canvas_pos.yMath.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.yMath.max(y1,y2)&&(inRect=!1),canvas_pos.yMath.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;da?(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;i0&&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;l0?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=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=t.zeroValue?a[h][d].D2A=-(1/a[h][d].D1A):a[h][d].D2A=void 0);break;case"Bar":for(d=0;d0&&(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].yPosTop0&&(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;d0&&(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].xPosLeft0&&(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=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=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,"),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/gi,"\n").split("\n"),n=l.length*e,o=0;oi&&(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.heighta.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;ii;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=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)):P1)&&(a.animation.StartValue=0),(a.animationStopValue<0||a.animationStopValue>1)&&(a.animation.StopValue=1),a.animationStopValue0&&a.animationStartValue<=1)for(;Pe.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%gr;)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%gg-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;h1&&(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;Qk?q.textWidth:k,E=q.textHeight>E?q.textHeight:E);k=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=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=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_&&(_=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=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;v0||!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=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=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),ia?-.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-1n+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=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;ai&&(i=1*a.datasets[n].data[j]),1*a.datasets[n].data[j]i&&(i=0,l=0),Math.abs(i-l)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;n1&&(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=e.animationStopValue)for(n=0;n3*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?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;lS;)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-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-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;ni&&(i=1*a.datasets[n].data[o]),1*a.datasets[n].data[o]i&&(i=0,l=0),Math.abs(i-l)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;m1&&1*e.animationStartWithData-10)&&(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=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;a0&&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;i90?(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;a0?(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;eupperValue2&&(upperValue2=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=0,lowerValue=0),Math.abs(upperValue-lowerValue)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)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;iOrderOfMagnitude||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;o1&&(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;oA.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;i0&&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;l90?(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;i0?(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;l0?("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)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;D0&&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;o1&&(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=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;l90?(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;i0?(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;l0?(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)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;l1&&(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;l1&&(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=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;a0&&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;e90?(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;a0?(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;eupperValue2&&(upperValue2=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=1*data.datasets[i].data[j]+mathValueHeight),1*data.datasets[i].data[j]-mathValueHeightupperValue&&(upperValue=0,lowerValue=0),Math.abs(upperValue-lowerValue)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)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;i0&&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;n1&&(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;n1&&(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=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;l90?(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;i0?(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;li&&(i=1*a.datasets[n].data[o]),1*a.datasets[n].data[o]i&&(i=0,l=0),Math.abs(i-l)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={}}; \ No newline at end of file