﻿/*
* CanvasJS v1.0.2 - canvasjs.com 
* Copyright 2013 fenopix
*/

(function(){function K(a,d){var b;b=function(){};b.prototype=d.prototype;b=new b;a.prototype=b;a.prototype.constructor=a;a.parent=d.prototype}function Y(a,d,b){"millisecond"===b?a.setMilliseconds(a.getMilliseconds()+1*d):"second"===b?a.setSeconds(a.getSeconds()+1*d):"minute"===b?a.setMinutes(a.getMinutes()+1*d):"hour"===b?a.setHours(a.getHours()+1*d):"day"===b?a.setDate(a.getDate()+1*d):"week"===b?a.setDate(a.getDate()+7*d):"month"===b?a.setMonth(a.getMonth()+1*d):"year"===b&&a.setFullYear(a.getFullYear()+
1*d);return a}function M(a,d){return y[d+"Duration"]*a}function B(a,d){var b=!1;0>a&&(b=!0,a*=-1);a=""+a;for(d=!d?1:d;a.length<d;)a="0"+a;return b?"-"+a:a}function N(a){a=a.replace(/^\s\s*/,"");for(var d=/\s/,b=a.length;d.test(a.charAt(--b)););return a.slice(0,b+1)}function Z(a,d){return a-d}function ea(a,d){return a.x-d.x}function A(a){var d=((a&16711680)>>16).toString(16),b=((a&65280)>>8).toString(16);a=((a&255)>>0).toString(16);d=2>d.length?"0"+d:d;b=2>b.length?"0"+b:b;a=2>a.length?"0"+a:a;return"#"+
d+b+a}function T(a){var d=[];d[0]=(a&16711680)>>16;d[1]=(a&65280)>>8;d[2]=(a&255)>>0;return d}function G(a,d,b){this._defaultsKey=a;currentTheme={};b&&(U[b]&&U[b][a])&&(currentTheme=U[b][a]);this._options=d?d:{};this.setOptions(this._options,currentTheme)}function t(a,d,b){t.parent.constructor.call(this,"Chart",d,d.theme?d.theme:"theme1");t.externalReference=b;var c=this;this._containerId=a;this._objectsInitialized=!1;this.overlaidCanvasCtx=this.ctx=null;this._indexLabels=[];this._panTimerId=0;this._lastTouchEventType=
"";this.panEnabled=!1;if(this._container=document.getElementById(this._containerId))d=a=0,a=this._options.width?this.width:0<this._container.clientWidth?this._container.clientWidth:this.width,d=this._options.height?this.height:0<this._container.clientHeight?this._container.clientHeight:this.height,this.width=a,this.height=d,this._canvasJSContainer=document.createElement("div"),this._canvasJSContainer.style.position="relative",this._container.appendChild(this._canvasJSContainer),this.canvas=document.createElement("canvas"),
this.canvas.width=a,this.canvas.height=d,this.canvas.style.background=this.backgroundColor,this.canvas.style.position="absolute",this._canvasJSContainer.appendChild(this.canvas),this.overlaidCanvas=document.createElement("canvas"),this.overlaidCanvas.width=a,this.overlaidCanvas.height=d,this.overlaidCanvas.style.position="absolute",this._canvasJSContainer.appendChild(this.overlaidCanvas),this._eventManager=new Q(this),this._toolBar=document.createElement("div"),this._toolBar.style.position="absolute",
this._toolBar.style.top="0px",this._toolBar.style.right="0px",this._canvasJSContainer.appendChild(this._toolBar),this.zoomEnabled&&(this._zoomButton=document.createElement("button"),this._zoomButton.appendChild(document.createTextNode("Pan")),this._toolBar.appendChild(this._zoomButton),this._zoomButton.addEventListener("click",function(){c.zoomEnabled?(c.zoomEnabled=!1,c.panEnabled=!0,c._zoomButton.innerText="Zoom"):(c.zoomEnabled=!0,c.panEnabled=!1,c._zoomButton.innerText="Pan ");c.render()},!1)),
this.zoomEnabled&&(this._resetButton=document.createElement("button"),this._resetButton.appendChild(document.createTextNode("Reset")),this._toolBar.appendChild(this._resetButton),c.zoomEnabled=c._options.zoomEnabled?!0:!1,c.panEnabled=!1,this._resetButton.addEventListener("click",function(){c._toolTip.hide();c.zoomEnabled||c.panEnabled?(c.zoomEnabled=!0,c.panEnabled=!1,c._zoomButton.innerText="Pan"):(c.zoomEnabled=!1,c.panEnabled=!1);c.sessionVariables.axisX.internalMinimum=c._options.axisX&&c._options.axisX.minimum?
c._options.axisX.minimum:null;c.sessionVariables.axisX.internalMaximum=c._options.axisX&&c._options.axisX.maximum?c._options.axisX.maximum:null;c.resetOverlayedCanvas();c.render()},!1)),window.addEventListener("resize",function(){var a=0,b=0,a=c._options.width?c.width:0<c._container.clientWidth?c._container.clientWidth:c.width,b=c._options.height?c.height:0<c._container.clientHeight?c._container.clientHeight:c.height;if(c.canvas.width!==a||c.canvas.height!==b)c.renderCount--,c.canvas.width=a,c.canvas.height=
b,c.overlaidCanvas.width=a,c.overlaidCanvas.height=b,c.render()}),this._toolBar.style.display="none",this.bounds={x1:0,y1:0,x2:this.canvas.width,y2:this.canvas.height},c=this,this.canvas.getContext&&(this.ctx=this.canvas.getContext("2d"),this.ctx.textBaseline="top",this.overlaidCanvasCtx=this.overlaidCanvas.getContext("2d"),this.overlaidCanvasCtx.textBaseline="top",this.ctx.roundRect=function(a,b,c,d,h,j,m,n){m&&(this.fillStyle=m);n&&(this.strokeStyle=n);"undefined"==typeof stroke&&(stroke=!0);"undefined"===
typeof h&&(h=5);this.lineWidth=j;this.beginPath();this.moveTo(a+h,b);this.lineTo(a+c-h,b);this.quadraticCurveTo(a+c,b,a+c,b+h);this.lineTo(a+c,b+d-h);this.quadraticCurveTo(a+c,b+d,a+c-h,b+d);this.lineTo(a+h,b+d);this.quadraticCurveTo(a,b+d,a,b+d-h);this.lineTo(a,b+h);this.quadraticCurveTo(a,b,a+h,b);this.closePath();m&&this.fill();n&&0<j&&this.stroke()},this.overlaidCanvas.addEventListener("click",function(a){c._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener("mousemove",function(a){c._mouseEventHandler(a)},
!1),this.overlaidCanvas.addEventListener("mouseup",function(a){c._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener("mousedown",function(a){c._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener("mouseout",function(a){c._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",function(a){c._touchEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",
function(a){c._touchEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerUp":"touchend",function(a){c._touchEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){c._touchEventHandler(a)},!1)),this._toolTip=new I(this,this._options.toolTip,this.theme),this.layoutManager=new O(this.canvas),this.axisY2=this.axisY=this.axisX=this.data=null,this.renderCount=0,this.sessionVariables=
{axisX:{internalMinimum:null,internalMaximum:null},axisY:{internalMinimum:null,internalMaximum:null},axisY2:{internalMinimum:null,internalMaximum:null}}}function O(a){this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=0;this.canvas=a}function D(a,d){D.parent.constructor.call(this,"TextBlock",d);this.ctx=a;this._isDirty=!0;this._wrappedText=null}function R(a,d){R.parent.constructor.call(this,"Title",d,a.theme);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;"undefined"===
typeof this._options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}function S(a,d,b){S.parent.constructor.call(this,"Legend",d,b);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.height=this.width=0;this.orientation=null;this.horizontalSpacing=10;this.dataSeries=[];this.bounds={x1:null,y1:null,x2:null,y2:null}}function V(a,d){V.parent.constructor.call(this,d);this.chart=a;this.canvas=a.canvas;
this.ctx=this.chart.ctx}function J(a,d,b,c,e){J.parent.constructor.call(this,"DataSeries",d,b);this.chart=a;this.canvas=a.canvas;this._ctx=a.canvas.ctx;this.index=c;this.noDataPointsInPlotArea=0;this.id=e;this.dataPointIds=[];this.axisY=this.axisX=null;this.axisPlacement=this.getDefaultAxisPlacement()}function x(a,d,b,c){x.parent.constructor.call(this,"Axis",d,a.theme);this.chart=a;this.canvas=a.canvas;this.ctx=a.ctx;this.intervalStartPosition=this.maxHeight=this.maxWidth=0;this.labels=[];this.dataInfo=
{min:Infinity,max:-Infinity,viewPortMin:Infinity,viewPortMax:-Infinity,minDiff:Infinity};"axisX"===b?(this.sessionVariables=this.chart.sessionVariables[b],this._options.interval||(this.intervalType=null)):this.sessionVariables="left"===c||"top"===c?this.chart.sessionVariables.axisY:this.chart.sessionVariables.axisY2;"undefined"===typeof this._options.titleFontSize&&(this.titleFontSize=fontSize=this.chart.getAutoFontSize(this.titleFontSize));"undefined"===typeof this._options.labelFontSize&&(this.labelFontSize=
this.chart.getAutoFontSize(this.labelFontSize));this.type=b;if(!d||"undefined"===typeof d.gridThickness)this.gridThickness="axisX"===b?0:1;this._labels=null;this._position=c;this.lineCoordinates={x1:null,y1:null,x2:null,y2:null,width:null};this.labelAngle=(this.labelAngle%360+360)%360;90<this.labelAngle&&270>=this.labelAngle?this.labelAngle-=180:180<this.labelAngle&&270>=this.labelAngle?this.labelAngle-=180:270<this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360);this._absoluteMaximum=this._absoluteMinimum=
this._titleTextBlock=null;this.hasOptionChanged("minimum")&&(this.sessionVariables.internalMinimum=this.minimum);this.hasOptionChanged("maximum")&&(this.sessionVariables.internalMaximum=this.maximum);this.trackChanges("minimum");this.trackChanges("maximum")}function I(a,d,b){I.parent.constructor.call(this,"ToolTip",d,b);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.currentDataPointIndex=this.currentSeriesIndex=-1;this._timerId=0;this._prevY=this._prevX=NaN;this._initialize()}function Q(a){this.chart=
a;this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=[];this.previousDataPointEventObject=null;this.ghostCanvas=document.createElement("canvas");this.ghostCanvas.width=this.chart.canvas.width;this.ghostCanvas.height=this.chart.canvas.height;this.ghostCtx=this.ghostCanvas.getContext("2d")}var $={Chart:{width:500,height:400,zoomEnabled:!1,backgroundColor:"white",backgroundColor:"white",theme:"theme1",animationEnabled:!0,colorSet:"colorSet1"},Title:{padding:0,text:null,verticalAlign:"top",
horizontalAlign:"center",fontSize:20,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,margin:5},DataSeries:{name:null,dataPoints:null,label:"",bevelEnabled:!1,indexLabel:"",indexLabelPlacement:"outside",indexLabelOrientation:"horizontal",indexLabelFontColor:"black",indexLabelFontSize:12,indexLabelFontStyle:"normal",indexLabelFontFamily:"Arial",indexLabelFontWeight:"normal",indexLabelBackgroundColor:null,
indexLabelLineColor:"#808080",indexLabelLineThickness:1,lineThickness:2,color:null,startAngle:0,type:"column",xValueType:"number",axisYType:"primary",showInLegend:null,legendMarkerType:null,legendMarkerColor:null,legendText:null,markerType:"circle",markerColor:null,markerSize:null,markerBorderColor:null,markerBorderThickness:null,mouseover:null,mouseout:null,mousemove:null,click:null,toolTipContent:null},Axis:{minimum:null,maximum:null,interval:null,intervalType:null,title:null,titleFontColor:"black",
titleFontSize:20,titleFontFamily:"arial",titleFontWeight:"normal",titleFontStyle:"normal",labelAngle:0,labelFontFamily:"arial",labelFontColor:"black",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",prefix:"",suffix:"",includeZero:!0,tickLength:5,tickColor:"black",tickThickness:1,lineColor:"black",lineThickness:1,gridColor:"A0A0A0",gridThickness:0,interlacedColor:null,valueFormatString:null,margin:2},Legend:{name:null,borderThickness:0,borderColor:"black",cornerRadius:0,verticalAlign:"center",
horizontalAlign:"right",fontSize:14,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal"},ToolTip:{enabled:!0,borderColor:null,shared:!1,animationEnabled:!0,content:null},TextBlock:{x:0,y:0,width:null,height:null,maxWidth:null,maxHeight:null,padding:0,angle:0,text:"",horizontalAlign:"center",fontSize:12,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,textBaseline:"top"}},
P={colorSet1:"#369EAD #C24642 #7F6084 #86B402 #A2D1CF #C8B631 #6DBCEB #52514E #4F81BC #A064A1 #F79647".split(" "),colorSet2:"#4F81BC #C0504E #9BBB58 #23BFAA #8064A1 #4AACC5 #F79647".split(" "),colorSet3:"#8CA1BC #36845C #017E82 #8CB9D0 #708C98 #94838D #F08891 #0366A7 #008276 #EE7757 #E5BA3A #F2990B #03557B #782970".split(" ")},U={theme1:{Chart:{colorSet:P[0]},Title:{fontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",fontSize:33,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",
margin:10},Axis:{titleFontSize:26,titleFontColor:"#666666",titleFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",labelFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",labelFontSize:18,labelFontColor:"grey",tickColor:"#BBBBBB",tickThickness:2,gridThickness:2,gridColor:"#BBBBBB",lineThickness:2,lineColor:"#BBBBBB"},Legend:{verticalAlign:"bottom",horizontalAlign:"right",fontFamily:"monospace, sans-serif,arial black"},DataSeries:{indexLabelFontColor:"grey",indexLabelFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",
indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:2}},theme2:{Chart:{colorSet:"colorSet2"},Title:{fontFamily:"impact, charcoal, arial black, sans-serif",fontSize:32,fontColor:"#333333",verticalAlign:"top",margin:10},Axis:{titleFontSize:22,titleFontColor:"rgb(98,98,98)",titleFontFamily:"monospace, sans-serif,arial black",titleFontWeight:"bold",labelFontFamily:"monospace, Courier New, Courier",labelFontSize:16,labelFontColor:"grey",labelFontWeight:"bold",tickColor:"grey",
tickThickness:2,gridThickness:2,gridColor:"grey",lineThickness:0},Legend:{verticalAlign:"bottom",horizontalAlign:"right",fontFamily:"monospace, sans-serif,arial black"},DataSeries:{indexLabelFontColor:"grey",indexLabelFontFamily:"Courier New, Courier, monospace",indexLabelFontWeight:"bold",indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:2}},theme3:{Chart:{colorSet:"colorSet1"},Title:{fontFamily:"Candara, Optima, Trebuchet MS, Helvetica Neue, Helvetica, Trebuchet MS, serif",
fontSize:32,fontColor:"rgb(68,78,58)",fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",margin:10},Axis:{titleFontSize:22,titleFontColor:"rgb(98,98,98)",titleFontFamily:"Verdana, Geneva, Calibri, sans-serif",labelFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",labelFontSize:18,labelFontColor:"grey",tickColor:"grey",tickThickness:2,gridThickness:2,gridColor:"grey",lineThickness:2,lineColor:"grey"},Legend:{verticalAlign:"bottom",horizontalAlign:"right",fontFamily:"monospace, sans-serif,arial black"},
DataSeries:{bevelEnabled:!0,indexLabelFontColor:"grey",indexLabelFontFamily:"Candara, Optima, Calibri, Verdana, Geneva, sans-serif",indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:2}}},y={numberDuration:1,yearDuration:314496E5,monthDuration:2592E6,weekDuration:6048E5,dayDuration:864E5,hourDuration:36E5,minuteDuration:6E4,secondDuration:1E3,millisecondDuration:1,dayOfWeekFromInt:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")},W,fa=/D{1,4}|M{1,4}|Y{1,4}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|f{1,3}|t{1,2}|T{1,2}|K|z{1,3}|"[^"]*"|'[^']*'/g,
aa="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ba="January February March April May June July August September October November December".split(" "),ga=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,ha=/[^-+\dA-Z]/g;W=function(a,d){var b="",c=!1;a=a&&a.getTime?a:a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");"UTC:"==d.slice(0,4)&&(d=d.slice(4),c=!0);var b=c?"getUTC":
"get",e=a[b+"Date"](),f=a[b+"Day"](),g=a[b+"Month"](),k=a[b+"FullYear"](),h=a[b+"Hours"](),j=a[b+"Minutes"](),m=a[b+"Seconds"](),n=a[b+"Milliseconds"](),p=c?0:a.getTimezoneOffset();return b=d.replace(fa,function(b){switch(b){case "D":return e;case "DD":return B(e,2);case "DDD":return aa[f].slice(0,3);case "DDDD":return aa[f];case "M":return g+1;case "MM":return B(g+1,2);case "MMM":return ba[g].slice(0,3);case "MMMM":return ba[g];case "Y":return parseInt(String(k).slice(-2));case "YY":return B(String(k).slice(-2),
2);case "YYY":return B(String(k).slice(-3),3);case "YYYY":return B(k,4);case "h":return h%12||12;case "hh":return B(h%12||12,2);case "H":return h;case "HH":return B(h,2);case "m":return j;case "mm":return B(j,2);case "s":return m;case "ss":return B(m,2);case "f":return String(n).slice(0,1);case "ff":return B(String(n).slice(0,2),2);case "fff":return B(String(n).slice(0,3),3);case "t":return 12>h?"a":"p";case "tt":return 12>h?"am":"pm";case "T":return 12>h?"A":"P";case "TT":return 12>h?"AM":"PM";case "K":return c?
"UTC":(String(a).match(ga)||[""]).pop().replace(ha,"");case "z":return(0<p?"-":"+")+Math.floor(Math.abs(p)/60);case "zz":return(0<p?"-":"+")+B(Math.floor(Math.abs(p)/60),2);case "zzz":return(0<p?"-":"+")+B(Math.floor(Math.abs(p)/60),2)+B(Math.abs(p)%60,2);default:return b.slice(1,b.length-1)}})};var X=function(a,d){a=Number(a);var b=0>a?!0:!1;b&&(a*=-1);var c="";d=String(d);for(var e=1,f="",g="",k=-1,h=[],j=[],m=0,n=0,p=0,e=1,l=!1,s=0,g=d.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g),q=
0;g&&q<g.length;q++)if(c=g[q],"."===c&&0>k)k=q;else{if("%"===c)e*=100;else if("\u2030"===c){e*=1E3;continue}else if(","===c[0]&&"."===c[c.length-1]){e/=Math.pow(1E3,c.length-1);k=q+c.length-1;continue}else if(("E"===c[0]||"e"===c[0])&&"0"===c[c.length-1])l=!0;0>k?(h.push(c),"#"===c||"0"===c?m++:","===c&&p++):(j.push(c),("#"===c||"0"===c)&&n++)}l&&(c=Math.floor(a),s=(0===c?"":String(c)).length-m,e/=Math.pow(10,s));0>k&&(k=q);c=(a*e).toFixed(n);c=c.split(".");e=(c[0]+"").split("");k=(c[1]+"").split("");
e&&"0"===e[0]&&e.shift();for(var r=l=g=q=n=0;0<h.length;)if(c=h.pop(),"#"===c||"0"===c)if(n++,n===m){var u=e,e=[];if("0"===c)for(c=m-q-(u?u.length:0);0<c;)u.unshift("0"),c--;for(;0<u.length;)f=u.pop()+f,r++,0===r%l&&(g===p&&0<u.length)&&(f=","+f);b&&(f="-"+f)}else 0<e.length?(f=e.pop()+f,q++,r++):"0"===c&&(f="0"+f,q++,r++),0===r%l&&(g===p&&0<e.length)&&(f=","+f);else("E"===c[0]||"e"===c[0])&&"0"===c[c.length-1]&&/[eE][+-]*[0]+/.test(c)?(c=0>s?c.replace("+","").replace("-",""):c.replace("-",""),f+=
c.replace(/[0]+/,function(a){return B(s,a.length)})):","===c?(g++,l=r,r=0,0<e.length&&(f=c+f)):f=1<c.length&&('"'===c[0]&&'"'===c[c.length-1]||"'"===c[0]&&"'"===c[c.length-1])?c.slice(1,c.length-1)+f:c+f;for(b=0;0<j.length;)c=j.shift(),"#"===c||"0"===c?0<k.length&&0!==Number(k.join(""))?f+=(0===b++?".":"")+k.shift():"0"===c&&(f+=(0===b++?".":"")+"0"):1<c.length&&('"'===c[0]&&'"'===c[c.length-1]||"'"===c[0]&&"'"===c[c.length-1])?f+=(0===b++?".":"")+c.slice(1,c.length-1):("E"===c[0]||"e"===c[0])&&"0"===
c[c.length-1]&&/[eE][+-]*[0]+/.test(c)?(c=0>s?c.replace("+","").replace("-",""):c.replace("-",""),f+=c.replace(/[0]+/,function(a){return B(s,a.length)})):f+=(0===b++?".":"")+c;return f},ca=function(a){var d=0,b=0;a||(a=window.event);a.offsetX||0===a.offsetX?(d=a.offsetX,b=a.offsetY):a.layerX||0==a.layerX?(d=a.layerX,b=a.layerY):(d=a.pageX-a.target.offsetLeft,b=a.pageY-a.target.offsetTop);return{x:d,y:b}};G.prototype.setOptions=function(a,d){if($[this._defaultsKey]){var b=$[this._defaultsKey];for(prop in b)this[prop]=
a&&prop in a?a[prop]:d&&prop in d?d[prop]:b[prop]}};G.prototype.trackChanges=function(a){this._options._oldOptions||(this._options._oldOptions={});this._options._oldOptions[a]=this._options[a]};G.prototype.isBeingTracked=function(a){this._options._oldOptions||(this._options._oldOptions={});return this._options._oldOptions[a]?!0:!1};G.prototype.hasOptionChanged=function(a){this._options._oldOptions||(this._options._oldOptions={});return this._options._oldOptions[a]!==this._options[a]};K(t,G);t.prototype._initialize=
function(){this._selectedColorSet="undefined"!==typeof P[this.colorSet]?P[this.colorSet]:P.colorSet1;this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.ctx.beginPath();this.axisY2=this.axisY=this.axisX=null;this._indexLabels=[];this._events=[];this._eventManager&&this._eventManager.reset();this.plotInfo={axisPlacement:null,axisXValueType:null,plotTypes:[]};this.layoutManager.reset();this.data=[];var a=0;for(series in this._options.data)if(a++,!this._options.data[series].type||0<=t._supportedChartTypes.indexOf(this._options.data[series].type)){var d=
new J(this,this._options.data[series],this.theme,a-1,++this._eventManager.lastObjectId);null===d.name&&(d.name="DataSeries "+a);null===d.color?1<this._options.data.length?(d._colorSet=[this._selectedColorSet[d.index%this._selectedColorSet.length]],d.color=this._selectedColorSet[d.index%this._selectedColorSet.length]):d._colorSet="line"===d.type||"area"===d.type||"stackedArea"===d.type||"stackedArea100"===d.type?[this._selectedColorSet[0]]:this._selectedColorSet:d._colorSet=[d.color];if(null===d.markerSize&&
("line"===d.type&&d.dataPoints.length<this.canvas.width/16||"scatter"===d.type))d.markerSize=8;("bubble"===d.type||"scatter"===d.type)&&d.dataPoints.sort(ea);this.data.push(d);var b=d.axisPlacement,c;"normal"===b?"xySwapped"===this.plotInfo.axisPlacement?c='You cannot combine "'+d.type+'" with bar chart':"none"===this.plotInfo.axisPlacement?c='You cannot combine "'+d.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="normal"):"xySwapped"===b?"normal"===this.plotInfo.axisPlacement?
c='You cannot combine "'+d.type+'" with line, area, column or pie chart':"none"===this.plotInfo.axisPlacement?c='You cannot combine "'+d.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="xySwapped"):"none"==b&&("normal"===this.plotInfo.axisPlacement?c='You cannot combine "'+d.type+'" with line, area, column or bar chart':"xySwapped"===this.plotInfo.axisPlacement?c='You cannot combine "'+d.type+'" with bar chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement=
"none"));if(c&&window.console){window.console.log(c);return}}this._objectsInitialized=!0};t._supportedChartTypes="line column area bar bubble scatter stackedColumn stackedColumn100 stackedBar stackedBar100 stackedArea stackedArea100 pie doughnut".split(" ");t.prototype.render=function(){this._initialize();for(var a=0;a<this.data.length;a++)if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)!this.data[a].axisYType||"primary"===this.data[a].axisYType?(this.axisY||("normal"===
this.plotInfo.axisPlacement?this.axisY=new x(this,this._options.axisY,"axisY","left"):"xySwapped"===this.plotInfo.axisPlacement&&(this.axisY=new x(this,this._options.axisY,"axisY","bottom"))),this.data[a].axisY=this.axisY):"secondary"===this.data[a].axisYType&&(this.axisY2||("normal"===this.plotInfo.axisPlacement?this.axisY2=new x(this,this._options.axisY2,"axisY","right"):"xySwapped"===this.plotInfo.axisPlacement&&(this.axisY2=new x(this,this._options.axisY2,"axisY","top"))),this.data[a].axisY=this.axisY2),
this.axisX||("normal"===this.plotInfo.axisPlacement?this.axisX=new x(this,this._options.axisX,"axisX","bottom"):"xySwapped"===this.plotInfo.axisPlacement&&(this.axisX=new x(this,this._options.axisX,"axisX","left"))),this.data[a].axisX=this.axisX;this._processData();this._options.title&&(this._title=new R(this,this._options.title),this._title.render());this.legend=new S(this,this._options.legend,this.theme);for(a=0;a<this.data.length;a++)this.data[a].showInLegend&&this.legend.dataSeries.push(this.data[a]);
this.legend.render();if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)x.setLayoutAndRender(this.axisX,this.axisY,this.axisY2,this.plotInfo.axisPlacement,this.layoutManager.getFreeSpace());else if("none"!==this.plotInfo.axisPlacement)return;for(a=0;a<this.plotInfo.plotTypes.length;a++)for(var d=this.plotInfo.plotTypes[a],b=0;b<d.plotUnits.length;b++){var c=d.plotUnits[b];"line"===c.type?this.renderLine(c):"column"===c.type?this.renderColumn(c):"bar"===c.type?this.renderBar(c):
"area"===c.type?this.renderArea(c):"stackedColumn"===c.type?this.renderStackedColumn(c):"stackedColumn100"===c.type?this.renderStackedColumn100(c):"stackedBar"===c.type?this.renderStackedBar(c):"stackedBar100"===c.type?this.renderStackedBar100(c):"stackedArea"===c.type?this.renderStackedArea(c):"stackedArea100"===c.type?this.renderStackedArea100(c):"bubble"===c.type?this.renderBubble(c):"scatter"===c.type?this.renderScatter(c):"pie"===c.type?this.renderPie(c):"doughnut"===c.type&&this.renderPie(c)}0<
this._indexLabels.length&&this.renderIndexLabels();this.setToolbarButtonStates();this._toolTip._updateToolTip();this.renderCount++};t.prototype.setToolbarButtonStates=function(){this.zoomEnabled||this.panEnabled||this._toolTip.enabled?this.attachEvent({context:this,chart:this,mousedown:this._plotAreaMouseDown,mouseup:this._plotAreaMouseUp,mousemove:this._plotAreaMouseMove,cursor:this.panEnabled?"move":"default",capture:!0,bounds:this.getPlotArea()}):this._toolBar.style.display="none"};t.prototype.categoriseDataSeries=
function(){for(var a="",d=0;d<this.data.length;d++)if(a=this.data[d],a.dataPoints&&0!==a.dataPoints.length&&0<=t._supportedChartTypes.indexOf(a.type)){for(var b=null,c=!1,e=null,f=!1,g=0;g<this.plotInfo.plotTypes.length;g++)if(this.plotInfo.plotTypes[g].type===a.type){c=!0;b=this.plotInfo.plotTypes[g];break}c||(b={type:a.type,totalDataSeries:0,plotUnits:[]},this.plotInfo.plotTypes.push(b));for(g=0;g<b.plotUnits.length;g++)if(b.plotUnits[g].axisYType===a.axisYType){f=!0;e=b.plotUnits[g];break}f||(e=
{type:a.type,previousDataSeriesCount:0,index:b.plotUnits.length,plotType:b,axisYType:a.axisYType,axisY:"primary"===a.axisYType?this.axisY:this.axisY2,axisX:this.axisX,dataSeriesIndexes:[]},b.plotUnits.push(e));b.totalDataSeries++;e.dataSeriesIndexes.push(d)}for(d=0;d<this.plotInfo.plotTypes.length;d++){b=this.plotInfo.plotTypes[d];for(g=a=0;g<b.plotUnits.length;g++)b.plotUnits[g].previousDataSeriesCount=a,a+=b.plotUnits[g].dataSeriesIndexes.length}};t.prototype.assignIdToDataPoints=function(){for(var a=
0;a<this.data.length;a++){dataSeries=this.data[a];for(var d=dataSeries.dataPoints.length,b=0;b<d;b++)dataSeries.dataPointIds[b]=++this._eventManager.lastObjectId}};t.prototype._processData=function(){this.assignIdToDataPoints();this.categoriseDataSeries();for(var a=0;a<this.plotInfo.plotTypes.length;a++)for(var d=this.plotInfo.plotTypes[a],b=0;b<d.plotUnits.length;b++){var c=d.plotUnits[b];"line"===c.type||"column"===c.type||"area"===c.type||"bar"===c.type||"bubble"===c.type||"scatter"===c.type?this._processMultiseriesPlotUnit(c):
"stackedColumn"===c.type||"stackedBar"===c.type||"stackedArea"===c.type?this._processStackedPlotUnit(c):("stackedColumn100"===c.type||"stackedBar100"===c.type||"stackedArea100"===c.type)&&this._processStacked100PlotUnit(c)}};t.prototype._processMultiseriesPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,f=!1,g=0;g<a.dataSeriesIndexes.length;g++){var k=this.data[a.dataSeriesIndexes[g]],h=0,j=!1,m=!1;if("normal"===k.axisPlacement||
"xySwapped"===k.axisPlacement)var n=this.sessionVariables.axisX.internalMinimum?this.sessionVariables.axisX.internalMinimum:this._options.axisX&&this._options.axisX.minimum?this._options.axisX.minimum:-Infinity,p=this.sessionVariables.axisX.internalMaximum?this.sessionVariables.axisX.internalMaximum:this._options.axisX&&this._options.axisX.maximum?this._options.axisX.maximum:Infinity;if(k.dataPoints[h].x&&k.dataPoints[h].x.getTime||"dateTime"===k.xValueType)f=!0;for(h=0;h<k.dataPoints.length;h++){"undefined"===
typeof k.dataPoints[h].x&&(k.dataPoints[h].x=h);k.dataPoints[h].x.getTime?(f=!0,c=k.dataPoints[h].x.getTime()):c=k.dataPoints[h].x;e=k.dataPoints[h].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);e<d.min&&(d.min=e);e>d.max&&(d.max=e);if(0<h){var l=c-k.dataPoints[h-1].x;0>l&&(l*=-1);b.minDiff>l&&0!==l&&(b.minDiff=l)}if(!(c<n)||j){if(!j&&(j=!0,0<h)){h-=2;continue}if(c>p&&!m)m=!0;else if(c>p&&m)continue;k.dataPoints[h].label&&(a.axisX.labels[c]=k.dataPoints[h].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&
(b.viewPortMax=c);e<d.viewPortMin&&(d.viewPortMin=e);e>d.viewPortMax&&(d.viewPortMax=e)}}this.plotInfo.axisXValueType=k.xValueType=f?"dateTime":"number"}};t.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,f=!1,g=[],k=[],h=0;h<a.dataSeriesIndexes.length;h++){var j=this.data[a.dataSeriesIndexes[h]],m=0,n=!1,p=!1;if("normal"===j.axisPlacement||"xySwapped"===j.axisPlacement)var l=this.sessionVariables.axisX.internalMinimum?
this.sessionVariables.axisX.internalMinimum:this._options.axisX&&this._options.axisX.minimum?this._options.axisX.minimum:-Infinity,s=this.sessionVariables.axisX.internalMaximum?this.sessionVariables.axisX.internalMaximum:this._options.axisX&&this._options.axisX.maximum?this._options.axisX.maximum:Infinity;if(j.dataPoints[m].x&&j.dataPoints[m].x.getTime||"dateTime"===j.xValueType)f=!0;for(m=0;m<j.dataPoints.length;m++){"undefined"===typeof j.dataPoints[m].x&&(j.dataPoints[m].x=m);j.dataPoints[m].x.getTime?
(f=!0,c=j.dataPoints[m].x.getTime()):c=j.dataPoints[m].x;e=j.dataPoints[m].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);if(0<m){var q=c-j.dataPoints[m-1].x;0>q&&(q*=-1);b.minDiff>q&&0!==q&&(b.minDiff=q)}if(!(c<l)||n){if(!n&&(n=!0,0<m)){m-=2;continue}if(c>s&&!p)p=!0;else if(c>s&&p)continue;j.dataPoints[m].label&&(a.axisX.labels[c]=j.dataPoints[m].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);0<=e?g[c]=g[c]?g[c]+e:e:k[c]=k[c]?k[c]+e:e}}this.plotInfo.axisXValueType=j.xValueType=
f?"dateTime":"number"}for(m in g)a=g[m],a<d.min&&(d.min=a),a>d.max&&(d.max=a),m<b.viewPortMin||m>b.viewPortMax||(a<d.viewPortMin&&(d.viewPortMin=a),a>d.viewPortMax&&(d.viewPortMax=a));for(m in k)a=k[m],a<d.min&&(d.min=a),a>d.max&&(d.max=a),m<b.viewPortMin||m>b.viewPortMax||(a<d.viewPortMin&&(d.viewPortMin=a),a>d.viewPortMax&&(d.viewPortMax=a))}};t.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,
c,e,f=!1,g=!1,k=!1,h=[],j=0;j<a.dataSeriesIndexes.length;j++){var m=this.data[a.dataSeriesIndexes[j]],n=0,p=!1,l=!1;if("normal"===m.axisPlacement||"xySwapped"===m.axisPlacement)var s=this.sessionVariables.axisX.internalMinimum?this.sessionVariables.axisX.internalMinimum:this._options.axisX&&this._options.axisX.minimum?this._options.axisX.minimum:-Infinity,q=this.sessionVariables.axisX.internalMaximum?this.sessionVariables.axisX.internalMaximum:this._options.axisX&&this._options.axisX.maximum?this._options.axisX.maximum:
Infinity;if(m.dataPoints[n].x&&m.dataPoints[n].x.getTime||"dateTime"===m.xValueType)f=!0;for(n=0;n<m.dataPoints.length;n++){"undefined"===typeof m.dataPoints[n].x&&(m.dataPoints[n].x=n);m.dataPoints[n].x.getTime?(f=!0,c=m.dataPoints[n].x.getTime()):c=m.dataPoints[n].x;e=m.dataPoints[n].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);if(0<n){var r=c-m.dataPoints[n-1].x;0>r&&(r*=-1);b.minDiff>r&&0!==r&&(b.minDiff=r)}if(!(c<s)||p){if(!p&&(p=!0,0<n)){n-=2;continue}if(c>q&&!l)l=!0;else if(c>q&&l)continue;m.dataPoints[n].label&&
(a.axisX.labels[c]=m.dataPoints[n].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);0<=e?g=!0:k=!0;h[c]=h[c]?h[c]+Math.abs(e):Math.abs(e)}}this.plotInfo.axisXValueType=m.xValueType=f?"dateTime":"number"}g&&!k?(d.max=99,d.min=1):g&&k?(d.max=99,d.min=-99):!g&&k&&(d.max=-1,d.min=-99);d.viewPortMin=d.min;d.viewPortMax=d.max;a.dataPointYSums=h}};t.prototype.getAutoFontSize=function(a){return Math.min(this.canvas.width,this.canvas.height)*(a/400)};t.prototype.resetOverlayedCanvas=
function(){var a=this.overlaidCanvas.width;this.overlaidCanvas.width=0;this.overlaidCanvas.width=a};t.prototype.attachEvent=function(a){this._events.push(a)};t.prototype._touchEventHandler=function(a){if(a.changedTouches){var d=[];first=(d=a.changedTouches)?d[0]:a;switch(a.type){case "touchstart":case "MSPointerDown":d=["mousemove","mousedown"];break;case "touchmove":case "MSPointerMove":d=["mousemove"];break;case "touchend":case "MSPointerUp":d="touchstart"===this._lastTouchEventType||"MSPointerDown"===
this._lastTouchEventType?["mouseup","click"]:["mouseup"];break;default:return}this._lastTouchEventType=a.type;for(var b=0;b<d.length;b++){var c=d[b],e=document.createEvent("MouseEvent");e.initMouseEvent(c,!0,!0,window,1,first.screenX,first.screenY,first.clientX,first.clientY,!1,!1,!1,!1,0,null);first.target.dispatchEvent(e);a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault()}}};t.prototype._mouseEventHandler=function(a){a.preventManipulation&&a.preventManipulation();
a.preventDefault&&a.preventDefault();var d=ca(a),b=a.type,c,e;a.which?e=3==a.which:a.button&&(e=2==a.button);if(!e){if(t.capturedEventParam)c=t.capturedEventParam,"mouseup"===b&&(t.capturedEventParam=null,c.chart.overlaidCanvas.releaseCapture?c.chart.overlaidCanvas.releaseCapture():document.body.removeEventListener("mouseup",c.chart._mouseEventHandler,!1)),c.hasOwnProperty(b)&&c[b].call(c.context,d.x,d.y);else if(this._events){for(e=0;e<this._events.length;e++)if(this._events[e].hasOwnProperty(b)){c=
this._events[e];var f=c.bounds;if(d.x>=f.x1&&d.x<=f.x2&&d.y>=f.y1&&d.y<=f.y2){c[b].call(c.context,d.x,d.y);"mousedown"===b&&!0===c.capture?(t.capturedEventParam=c,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.body.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(c.chart.overlaidCanvas.releaseCapture?c.chart.overlaidCanvas.releaseCapture():document.body.removeEventListener("mouseup",this._mouseEventHandler,!1));break}else c=null}a.target.style.cursor=
c&&c.cursor?c.cursor:"default"}this._toolTip.enabled&&(b=this.getPlotArea(),(d.x<b.x1||d.x>b.x2||d.y<b.y1||d.y>b.y2)&&this._toolTip.hide());(!this.isDrag||!this.zoomEnabled)&&this._eventManager.mouseEventHandler(a)}};t.prototype._plotAreaMouseDown=function(a,d){if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)this.isDrag=!0,this.dragStartPoint={x:a,y:d,xMinimum:this.axisX.minimum,xMaximum:this.axisX.maximum}};t.prototype._plotAreaMouseUp=function(a,d){var b,c;if(("normal"===
this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){this.isDrag=!1;var e=0,e=this.axisX.lineCoordinates,e="xySwapped"===this.plotInfo.axisPlacement?d-this.dragStartPoint.y:this.dragStartPoint.x-a;Math.abs(this.axisX.maximum-this.axisX.minimum);if(2<Math.abs(e)){if(this.panEnabled)e=!1,c=0,this.axisX.sessionVariables.internalMinimum<this.axisX._absoluteMinimum?(c=this.axisX._absoluteMinimum-this.axisX.sessionVariables.internalMinimum,this.axisX.sessionVariables.internalMinimum+=
c,this.axisX.sessionVariables.internalMaximum+=c,e=!0):this.axisX.sessionVariables.internalMaximum>this.axisX._absoluteMaximum&&(c=this.axisX.sessionVariables.internalMaximum-this.axisX._absoluteMaximum,this.axisX.sessionVariables.internalMaximum-=c,this.axisX.sessionVariables.internalMinimum-=c,e=!0),e&&this.render();else if(this.zoomEnabled){this.resetOverlayedCanvas();if(!this.dragStartPoint)return;"xySwapped"===this.plotInfo.axisPlacement?(b=Math.min(this.dragStartPoint.y,d),c=Math.max(this.dragStartPoint.y,
d),1<Math.abs(b-c)&&(e=this.axisX.lineCoordinates,c=this.axisX.maximum-(this.axisX.maximum-this.axisX.minimum)/e.height*(c-e.y1),e=this.axisX.maximum-(this.axisX.maximum-this.axisX.minimum)/e.height*(b-e.y1),c=Math.max(c,this.axisX.dataInfo.min),e=Math.min(e,this.axisX.dataInfo.max),Math.abs((e-c)/this.axisX.dataInfo.minDiff)>=0.008*this.canvas.height&&(this.axisX.sessionVariables.internalMinimum=c,this.axisX.sessionVariables.internalMaximum=e,this.render()))):"normal"===this.plotInfo.axisPlacement&&
(c=Math.min(this.dragStartPoint.x,a),b=Math.max(this.dragStartPoint.x,a),1<Math.abs(c-b)&&(e=this.axisX.lineCoordinates,c=(this.axisX.maximum-this.axisX.minimum)/e.width*(c-e.x1)+this.axisX.minimum,e=(this.axisX.maximum-this.axisX.minimum)/e.width*(b-e.x1)+this.axisX.minimum,c=Math.max(c,this.axisX.dataInfo.min),e=Math.min(e,this.axisX.dataInfo.max),Math.abs((e-c)/this.axisX.dataInfo.minDiff)>=0.01*this.canvas.width&&(this.axisX.sessionVariables.internalMinimum=c,this.axisX.sessionVariables.internalMaximum=
e,this.render())))}this._toolBar.style.display="inline"}}this.dragStartPoint=null};t.prototype._plotAreaMouseMove=function(a,d){if(this.isDrag){var b=0,c=0,c=this.axisX.lineCoordinates;"xySwapped"===this.plotInfo.axisPlacement?(b=d-this.dragStartPoint.y,c=Math.abs(this.axisX.maximum-this.axisX.minimum)/c.height*b):(b=this.dragStartPoint.x-a,c=Math.abs(this.axisX.maximum-this.axisX.minimum)/c.width*b);2<Math.abs(b)&&8>Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this._toolTip.hide():this._toolTip.enabled&&
(!this.panEnabled&&!this.zoomEnabled)&&this._toolTip.mouseMoveHandler(a,d);if(2<Math.abs(b)&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled){this.axisX.sessionVariables.internalMinimum=this.dragStartPoint.xMinimum+c;this.axisX.sessionVariables.internalMaximum=this.dragStartPoint.xMaximum+c;b=0;this.axisX.sessionVariables.internalMinimum<this.axisX._absoluteMinimum-M(this.axisX.interval,this.axisX.intervalType)?(b=this.axisX._absoluteMinimum-M(this.axisX.interval,this.axisX.intervalType)-this.axisX.sessionVariables.internalMinimum,
this.axisX.sessionVariables.internalMinimum+=b,this.axisX.sessionVariables.internalMaximum+=b):this.axisX.sessionVariables.internalMaximum>this.axisX._absoluteMaximum+M(this.axisX.interval,this.axisX.intervalType)&&(b=this.axisX.sessionVariables.internalMaximum-(this.axisX._absoluteMaximum+M(this.axisX.interval,this.axisX.intervalType)),this.axisX.sessionVariables.internalMaximum-=b,this.axisX.sessionVariables.internalMinimum-=b);var e=this;clearTimeout(this._panTimerId);this._panTimerId=setTimeout(function(){e.render()},
0)}else this.zoomEnabled&&(b=this.getPlotArea(),this.resetOverlayedCanvas(),c=this.overlaidCanvasCtx.globalAlpha,this.overlaidCanvasCtx.globalAlpha=0.7,this.overlaidCanvasCtx.fillStyle="#A0ABB8","xySwapped"===this.plotInfo.axisPlacement?this.overlaidCanvasCtx.fillRect(b.x1,this.dragStartPoint.y,b.x2-b.x1,d-this.dragStartPoint.y):"normal"===this.plotInfo.axisPlacement&&this.overlaidCanvasCtx.fillRect(this.dragStartPoint.x,b.y1,a-this.dragStartPoint.x,b.y2-b.y1),this.overlaidCanvasCtx.globalAlpha=c)}else this._toolTip.enabled&&
this._toolTip.mouseMoveHandler(a,d)};t.prototype.getPlotArea=function(){var a,d,b,c;c=this.axisY?this.axisY:this.axisY2;if(this.axisX&&c)a=this.axisX.lineCoordinates.x1<this.axisX.lineCoordinates.x2?this.axisX.lineCoordinates.x1:c.lineCoordinates.x1,b=this.axisX.lineCoordinates.y1<c.lineCoordinates.y1?this.axisX.lineCoordinates.y1:c.lineCoordinates.y1,d=this.axisX.lineCoordinates.x2>c.lineCoordinates.x2?this.axisX.lineCoordinates.x2:c.lineCoordinates.x2,c=this.axisX.lineCoordinates.y2>this.axisX.lineCoordinates.y1?
this.axisX.lineCoordinates.y2:c.lineCoordinates.y2;else return this.layoutManager.getFreeSpace();return{x1:a,y1:b,x2:d,y2:c,width:d-a,height:c-b}};t.prototype.getPixelCoordinatesOnPlotArea=function(a,d){return{x:this.axisX.getPixelCoordinatesOnAxis(a).x,y:this.axisY.getPixelCoordinatesOnAxis(d).y}};t.prototype.renderIndexLabels=function(){this.ctx.textBaseline="middle";for(var a=this.getPlotArea(),d=0;d<this._indexLabels.length;d++){var b=this._indexLabels[d],c,e,f;this.ctx.fillStyle="indexLabelFontColor"in
b.dataPoint?b.dataPoint.indexLabelFontColor:b.dataSeries.indexLabelFontColor;f=this.ctx;var g=b.dataPoint,k=b.dataSeries,h="",h=h+(g.indexLabelFontStyle?g.indexLabelFontStyle+" ":k&&k.indexLabelFontStyle?k.indexLabelFontStyle+" ":""),h=h+(g.indexLabelFontWeight?g.indexLabelFontWeight+" ":k&&k.indexLabelFontWeight?k.indexLabelFontWeight+" ":""),h=h+(g.indexLabelFontSize?g.indexLabelFontSize+"px ":k&&k.indexLabelFontSize?k.indexLabelFontSize+"px ":""),h=h+(g.indexLabelFontFamily?g.indexLabelFontFamily+
" ":k&&k.indexLabelFontFamily?k.indexLabelFontFamily+" ":"");f.font=h;var g=this.replaceKeywordsWithValue("indexLabel"in b.dataPoint?b.dataPoint.indexLabel:b.dataSeries.indexLabel,b.dataPoint,b.dataSeries),k=this.ctx.measureText(g).width,h="indexLabelFontSize"in b.dataPoint?b.dataPoint.indexLabelFontSize:b.dataSeries.indexLabelFontSize,j="indexLabelPlacement"in b.dataPoint?b.dataPoint.indexLabelPlacement:b.dataSeries.indexLabelPlacement,m="indexLabelOrientation"in b.dataPoint?b.dataPoint.indexLabelOrientation:
b.dataSeries.indexLabelOrientation,n=f=0,p=0,l=0,s=0;"column"===b.chartType||"stackedColumn"===b.chartType||"stackedColumn100"===b.chartType||"bar"===b.chartType||"stackedBar"===b.chartType||"stackedBar100"===b.chartType?(Math.abs(b.bounds.x1,b.bounds.x2),Math.abs(b.bounds.y1,b.bounds.y2),"normal"===this.plotInfo.axisPlacement?("outside"===j?(n=a.y1,p=a.y2):"inside"===j&&(n=b.bounds.y1,p=b.bounds.y2),"horizontal"===m?(c=b.point.x-k/2,e=0<=b.dataPoint.y?Math.min(Math.max(b.point.y-h/2-5,n+h/2+5),p-
h/2-5):Math.max(Math.min(b.point.y+h/2+5,p-h/2),n+h/2+5)):"vertical"===m&&(c=b.point.x,e=0<=b.dataPoint.y?Math.min(Math.max(b.point.y-5,n+k+5),p):Math.max(Math.min(b.point.y+k+5,p-5),n),f=-90)):"xySwapped"===this.plotInfo.axisPlacement&&("outside"===j?(l=a.x1,s=a.x2):"inside"===j&&(l=b.bounds.x1,s=b.bounds.x2),"horizontal"===m?(e=b.point.y,c=0<=b.dataPoint.y?Math.max(Math.min(b.point.x+5,s-k),l):Math.min(Math.max(b.point.x-k-5,l),s)):"vertical"===m&&(e=b.point.y+k/2,c=0<=b.dataPoint.y?Math.max(Math.min(b.point.x+
h/2+5,s-h/2),l):Math.min(Math.max(b.point.x-h/2-5,l+h/2),s+h/2),f=-90))):"horizontal"===m?(c=b.point.x-k/2,e=0<=b.dataPoint.y?Math.max(b.point.y-h/2-5,a.y1+h/2):Math.min(b.point.y+h/2+5,a.y2-h/2)):"vertical"===m&&(c=b.point.x,e=0<=b.dataPoint.y?Math.max(b.point.y-5,a.y1+k):Math.min(b.point.y+k+5,a.y2),f=-90);this.ctx.save();this.ctx.translate(c,e);this.ctx.rotate(Math.PI/180*f);this.ctx.fillText(g,0,0);this.ctx.restore()}};t.prototype.renderLine=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=
this._eventManager.ghostCtx;this.ctx.save();var b=this.getPlotArea();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();for(var b=[],c=0;c<a.dataSeriesIndexes.length;c++){var e=a.dataSeriesIndexes[c],f=this.data[e];this.ctx.lineWidth=f.lineThickness;var g=f.dataPoints,k=f.id;this._eventManager.objectMap[k]={objectType:"dataSeries",dataSeriesIndex:e};k=A(k);d.strokeStyle=k;d.lineWidth=0<f.lineThickness?Math.max(f.lineThickness,4):0;colorSet=f._colorSet;color=colorSet[0];
this.ctx.strokeStyle=color;var k=!0,h=0,j,m;if(0<g.length){for(h=0;h<g.length;h++)if(j=g[h].getTime?g[h].x.getTime():g[h].x,!(j<a.axisX.dataInfo.viewPortMin||j>a.axisX.dataInfo.viewPortMax)&&"number"===typeof g[h].y){j=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(j-a.axisX.convertionParameters.minimum)+0.5<<0;m=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(g[h].y-a.axisY.convertionParameters.minimum)+0.5<<0;var n=f.dataPointIds[h];
this._eventManager.objectMap[n]={objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:h,x1:j,y1:m};k?(this.ctx.beginPath(),this.ctx.moveTo(j,m),d.beginPath(),d.moveTo(j,m),k=!1):(this.ctx.lineTo(j,m),d.lineTo(j,m),0==h%500&&(this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(j,m),d.stroke(),d.beginPath(),d.moveTo(j,m)));if(0<g[h].markerSize||0<f.markerSize){var p=f.getMarkerProperties(h,j,m,this.ctx);b.push(p);n=A(n);b.push({x:j,y:m,ctx:d,type:p.type,size:p.size,color:n,borderColor:n,borderThickness:p.borderThickness})}(g[h].indexLabel||
f.indexLabel)&&this._indexLabels.push({chartType:"line",dataPoint:g[h],dataSeries:f,point:{x:j,y:m},color:color})}this.ctx.stroke();d.stroke()}}H.drawMarkers(b);this.ctx.restore();this.ctx.beginPath();d.beginPath()}};var C=function(a,d,b,c,e,f,g,k,h,j){var m=15<c-d&&15<e-b?8:0.35*Math.min(c-d,e-b);color2="rgba(255, 255, 255, .4)";color3="rgba(255, 255, 255, 0.1)";color1=f;a.beginPath();a.moveTo(d,b);a.save();a.fillStyle=color1;a.fillRect(d,b,c-d,e-b);a.restore();!0===g&&(a.save(),a.beginPath(),a.moveTo(d,
b),a.lineTo(d+m,b+m),a.lineTo(c-m,b+m),a.lineTo(c,b),a.closePath(),f=a.createLinearGradient((c+d)/2,b+m,(c+d)/2,b),f.addColorStop(0,color1),f.addColorStop(1,color2),a.fillStyle=f,a.fill(),a.restore());!0===k&&(a.save(),a.beginPath(),a.moveTo(d,e),a.lineTo(d+m,e-m),a.lineTo(c-m,e-m),a.lineTo(c,e),a.closePath(),f=a.createLinearGradient((c+d)/2,e-m,(c+d)/2,e),f.addColorStop(0,color1),f.addColorStop(1,color2),a.fillStyle=f,a.fill(),a.restore());!0===h&&(a.save(),a.beginPath(),a.moveTo(d,b),a.lineTo(d+
m,b+m),a.lineTo(d+m,e-m),a.lineTo(d,e),a.closePath(),f=a.createLinearGradient(d+m,(e+b)/2,d,(e+b)/2),f.addColorStop(0,color1),f.addColorStop(1,color3),a.fillStyle=f,a.fill(),a.restore());!0===j&&(a.save(),a.beginPath(),a.moveTo(c,b),a.lineTo(c-m,b+m),a.lineTo(c-m,e-m),a.lineTo(c,e),f=a.createLinearGradient(c-m,(e+b)/2,c,(e+b)/2),f.addColorStop(0,color1),f.addColorStop(1,color3),a.fillStyle=f,f.addColorStop(0,color1),f.addColorStop(1,color3),a.fillStyle=f,a.fill(),a.closePath(),a.restore())};t.prototype.renderColumn=
function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=0,e,f,g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.width,c=a.axisX.dataInfo.minDiff,h=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(c)/a.plotType.totalDataSeries)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,
b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var j=0;j<a.dataSeriesIndexes.length;j++){var m=a.dataSeriesIndexes[j],n=this.data[m],p=n.dataPoints;1==p.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<p.length)for(var l=5<h&&n.bevelEnabled?!0:!1,c=0;c<p.length;c++)if(p[c].getTime?f=p[c].x.getTime():f=p[c].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[c].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(f-a.axisX.convertionParameters.minimum)+
0.5<<0;e=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(p[c].y-a.axisY.convertionParameters.minimum)+0.5<<0;var s=b-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+j)*h<<0,q=s+h<<0,r;0<=p[c].y?r=g:(r=e,e=g);e>r&&(r=e=r);d=p[c].color?p[c].color:n._colorSet[c%n._colorSet.length];C(this.ctx,s,e,q,r,d,l&&0<=p[c].y,0>p[c].y&&l,!1,!1);d=n.dataPointIds[c];this._eventManager.objectMap[d]={objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:c,x1:s,y1:e,x2:q,
y2:r};d=A(d);C(this._eventManager.ghostCtx,s,e,q,r,d,!1,!1,!1,!1);if(p[c].indexLabel||n.indexLabel)this._indexLabels.push({chartType:"column",dataPoint:p[c],dataSeries:n,point:{x:b,y:0<=p[c].y?e:r},bounds:{x1:s,y1:Math.min(e,r),x2:q,y2:Math.max(e,r)},color:d})}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};t.prototype.renderStackedColumn=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=[],e=[],f=0,g,k=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
(0-a.axisY.convertionParameters.minimum)<<0,h=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,j=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var m=0;m<a.dataSeriesIndexes.length;m++){var n=a.dataSeriesIndexes[m],p=this.data[n],
l=p.dataPoints;1==l.length&&(j=h);1>j?j=1:j>h&&(j=h);if(0<l.length){var s=5<j&&p.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(f=0;f<l.length;f++)if(d=l[f].x.getTime?l[f].x.getTime():l[f].x,!(d<a.axisX.dataInfo.viewPortMin||d>a.axisX.dataInfo.viewPortMax)&&"number"===typeof l[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(d-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
(l[f].y-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*j/2+a.index*j<<0,r=q+j<<0,u;if(0<=l[f].y){var v=c[d]?c[d]:0;g-=v;u=k-v;c[d]=v+(u-g)}else v=e[d]?e[d]:0,u=g+v,g=k+v,e[d]=v+(u-g);d=l[f].color?l[f].color:p._colorSet[f%p._colorSet.length];C(this.ctx,q,g,r,u,d,s&&0<=l[f].y,0>l[f].y&&s,!1,!1);d=p.dataPointIds[f];this._eventManager.objectMap[d]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:q,y1:g,x2:r,y2:u};d=A(d);C(this._eventManager.ghostCtx,q,g,
r,u,d,!1,!1,!1,!1);if(l[f].indexLabel||p.indexLabel)this._indexLabels.push({chartType:"stackedColumn",dataPoint:l[f],dataSeries:p,point:{x:b,y:0<=l[f].y?g:u},bounds:{x1:q,y1:Math.min(g,u),x2:r,y2:Math.max(g,u)},color:d})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};t.prototype.renderStackedColumn100=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=[],e=[],f=0,g,k=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<
0,h=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,j=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var m=0;m<a.dataSeriesIndexes.length;m++){var n=a.dataSeriesIndexes[m],p=this.data[n],l=p.dataPoints;1==l.length&&(j=
h);1>j?j=1:j>h&&(j=h);if(0<l.length)for(var s=5<j&&p.bevelEnabled?!0:!1,f=0;f<l.length;f++)if(d=l[f].x.getTime?l[f].x.getTime():l[f].x,!(d<a.axisX.dataInfo.viewPortMin||d>a.axisX.dataInfo.viewPortMax)&&"number"===typeof l[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(d-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*((0!==a.dataPointYSums[d]?100*(l[f].y/a.dataPointYSums[d]):
0)-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*j/2+a.index*j<<0,r=q+j<<0,u;if(0<=l[f].y){var v=c[d]?c[d]:0;g-=v;u=k-v;c[d]=v+(u-g)}else v=e[d]?e[d]:0,u=g+v,g=k+v,e[d]=v+(u-g);d=l[f].color?l[f].color:p._colorSet[f%p._colorSet.length];C(this.ctx,q,g,r,u,d,s&&0<=l[f].y,0>l[f].y&&s,!1,!1);d=p.dataPointIds[f];this._eventManager.objectMap[d]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:q,y1:g,x2:r,y2:u};d=A(d);C(this._eventManager.ghostCtx,q,g,r,u,d,
!1,!1,!1,!1);if(l[f].indexLabel||p.indexLabel)this._indexLabels.push({chartType:"stackedColumn100",dataPoint:l[f],dataSeries:p,point:{x:b,y:0<=l[f].y?g:u},bounds:{x1:q,y1:Math.min(g,u),x2:r,y2:Math.max(g,u)},color:d})}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};t.prototype.renderBar=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=0,e,f,g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<
0,k=0.15*this.canvas.height,c=a.axisX.dataInfo.minDiff,h=0.9*(b.height/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(c)/a.plotType.totalDataSeries)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var j=0;j<a.dataSeriesIndexes.length;j++){var m=a.dataSeriesIndexes[j],n=this.data[m],p=n.dataPoints;1==p.length&&(h=
k);1>h?h=1:h>k&&(h=k);if(0<p.length){var l=5<h&&n.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(c=0;c<p.length;c++)if(p[c].getTime?f=p[c].x.getTime():f=p[c].x,!(f<a.axisX.dataInfo.viewPortMin||f>a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[c].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(f-a.axisX.convertionParameters.minimum)+0.5<<0;e=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(p[c].y-a.axisY.convertionParameters.minimum)+
0.5<<0;var s=b-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+j)*h<<0,q=s+h<<0,r;0<=p[c].y?r=g:(r=e,e=g);d=p[c].color?p[c].color:n._colorSet[c%n._colorSet.length];C(this.ctx,r,s,e,q,d,l,!1,!1,!1);d=n.dataPointIds[c];this._eventManager.objectMap[d]={objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:c,x1:r,y1:s,x2:e,y2:q};d=A(d);C(this._eventManager.ghostCtx,r,s,e,q,d,!1,!1,!1,!1);this._indexLabels.push({chartType:"bar",dataPoint:p[c],dataSeries:n,point:{x:0<=p[c].y?e:r,y:b},bounds:{x1:Math.min(r,
e),y1:s,x2:Math.max(r,e),y2:q},color:d})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};t.prototype.renderStackedBar=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=[],e=[],f=0,g,k=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,h=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,j=0.9*(b.height/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<
0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var m=0;m<a.dataSeriesIndexes.length;m++){var n=a.dataSeriesIndexes[m],p=this.data[n],l=p.dataPoints;1==l.length&&(j=h);1>j?j=1:j>h&&(j=h);if(0<l.length){var s=5<j&&p.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(f=0;f<l.length;f++)if(d=l[f].x.getTime?l[f].x.getTime():
l[f].x,!(d<a.axisX.dataInfo.viewPortMin||d>a.axisX.dataInfo.viewPortMax)&&"number"===typeof l[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(d-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(l[f].y-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*j/2+a.index*j<<0,r=q+j<<0,u;if(0<=l[f].y){var v=c[d]?c[d]:0;u=k+v;g+=v;c[d]=v+(g-u)}else v=e[d]?e[d]:
0,u=g-v,g=k-v,e[d]=v+(g-u);d=l[f].color?l[f].color:p._colorSet[f%p._colorSet.length];C(this.ctx,u,q,g,r,d,s,!1,!1,!1);d=p.dataPointIds[f];this._eventManager.objectMap[d]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:u,y1:q,x2:g,y2:r};d=A(d);C(this._eventManager.ghostCtx,u,q,g,r,d,!1,!1,!1,!1);this._indexLabels.push({chartType:"stackedBar",dataPoint:l[f],dataSeries:p,point:{x:0<=l[f].y?g:u,y:b},bounds:{x1:Math.min(u,g),y1:q,x2:Math.max(u,g),y2:r},color:d})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};
t.prototype.renderStackedBar100=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=[],e=[],f=0,g,k=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,h=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,j=0.9*(b.height/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,
b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var m=0;m<a.dataSeriesIndexes.length;m++){var n=a.dataSeriesIndexes[m],p=this.data[n],l=p.dataPoints;1==l.length&&(j=h);1>j?j=1:j>h&&(j=h);if(0<l.length){var s=5<j&&p.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(f=0;f<l.length;f++)if(d=l[f].x.getTime?l[f].x.getTime():l[f].x,!(d<a.axisX.dataInfo.viewPortMin||d>a.axisX.dataInfo.viewPortMax)&&"number"===
typeof l[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(d-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*((0!==a.dataPointYSums[d]?100*(l[f].y/a.dataPointYSums[d]):0)-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*j/2+a.index*j<<0,r=q+j<<0,u;if(0<=l[f].y){var v=c[d]?c[d]:0;u=k+v;g+=v;c[d]=v+(g-u)}else v=e[d]?e[d]:0,u=g-v,g=k-v,e[d]=v+(g-u);d=
l[f].color?l[f].color:p._colorSet[f%p._colorSet.length];C(this.ctx,u,q,g,r,d,s,!1,!1,!1);d=p.dataPointIds[f];this._eventManager.objectMap[d]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:u,y1:q,x2:g,y2:r};d=A(d);C(this._eventManager.ghostCtx,u,q,g,r,d,!1,!1,!1,!1);this._indexLabels.push({chartType:"stackedBar100",dataPoint:l[f],dataSeries:p,point:{x:0<=l[f].y?g:u,y:b},bounds:{x1:Math.min(u,g),y1:q,x2:Math.max(u,g),y2:r},color:d})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};
t.prototype.renderArea=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx,b=a.axisX.lineCoordinates,c=a.axisY.lineCoordinates,e=[],f=this.getPlotArea();this.ctx.save();d.save();this.ctx.beginPath();this.ctx.rect(f.x1,f.y1,f.width,f.height);this.ctx.clip();d.beginPath();d.rect(f.x1,f.y1,f.width,f.height);d.clip();for(f=0;f<a.dataSeriesIndexes.length;f++){var g=a.dataSeriesIndexes[f],k=this.data[g],h=k.dataPoints,e=k.id;this._eventManager.objectMap[e]={objectType:"dataSeries",
dataSeriesIndex:g};e=A(e);d.fillStyle=e;var e=[],j=!0,m=0,n,p,l=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)+0.5<<0,s,q=null;if(0<h.length){color=k._colorSet[m%k._colorSet.length];for(this.ctx.fillStyle=color;m<h.length;m++)if(p=h[m].x.getTime?h[m].x.getTime():h[m].x,!(p<a.axisX.dataInfo.viewPortMin||p>a.axisX.dataInfo.viewPortMax))if(n=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(p-a.axisX.convertionParameters.minimum)+
0.5<<0,p=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(h[m].y-a.axisY.convertionParameters.minimum)+0.5<<0,"number"===typeof h[m].y){j?(this.ctx.beginPath(),this.ctx.moveTo(n,p),q={x:n,y:p},d.beginPath(),d.moveTo(n,p),j=!1):(this.ctx.lineTo(n,p),d.lineTo(n,p),0==m%250&&(0>=a.axisY.minimum&&0<=a.axisY.maximum?s=l:0>a.axisY.maximum?s=c.y1:0<a.axisY.minimum&&(s=b.y2),this.ctx.lineTo(n,s),this.ctx.lineTo(q.x,s),this.ctx.closePath(),this.ctx.fill(),this.ctx.beginPath(),
this.ctx.moveTo(n,p),d.lineTo(n,s),d.lineTo(q.x,s),d.closePath(),d.fill(),d.beginPath(),d.moveTo(n,p),q={x:n,y:p}));var r=k.dataPointIds[m];this._eventManager.objectMap[r]={objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:m,x1:n,y1:p};if(0!==h[m].markerSize&&(0<h[m].markerSize||0<k.markerSize)){var u=k.getMarkerProperties(m,n,p,this.ctx);e.push(u);markerColor=A(r);e.push({x:n,y:p,ctx:d,type:u.type,size:u.size,color:markerColor,borderColor:markerColor,borderThickness:u.borderThickness})}(h[m].indexLabel||
k.indexLabel)&&this._indexLabels.push({chartType:"area",dataPoint:h[m],dataSeries:k,point:{x:n,y:p},color:color})}0>=a.axisY.minimum&&0<=a.axisY.maximum?s=l:0>a.axisY.maximum?s=c.y1:0<a.axisY.minimum&&(s=b.y2);this.ctx.lineTo(n,s);this.ctx.lineTo(q.x,s);this.ctx.closePath();this.ctx.fill();d.lineTo(n,s);d.lineTo(q.x,s);d.closePath();d.fill();H.drawMarkers(e)}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};t.prototype.renderStackedArea=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=
null,b=[],c=this.getPlotArea(),e=[],f=[],g=0,k,h,j,m=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,n=this._eventManager.ghostCtx;n.beginPath();this.ctx.save();n.save();this.ctx.beginPath();this.ctx.rect(c.x1,c.y1,c.width,c.height);this.ctx.clip();n.beginPath();n.rect(c.x1,c.y1,c.width,c.height);n.clip();xValuePresent=[];for(c=0;c<a.dataSeriesIndexes.length;c++){var p=a.dataSeriesIndexes[c],l=this.data[p],s=l.dataPoints;
l.dataPointIndexes=[];for(g=0;g<s.length;g++)p=s[g].x.getTime?s[g].x.getTime():s[g].x,l.dataPointIndexes[p]=g,xValuePresent[p]||(f.push(p),xValuePresent[p]=!0);f.sort(Z)}for(c=0;c<a.dataSeriesIndexes.length;c++){var p=a.dataSeriesIndexes[c],l=this.data[p],s=l.dataPoints,q=!0,r=[],g=l.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:p};g=A(g);n.fillStyle=g;if(0<f.length){d=l._colorSet[0];this.ctx.fillStyle=d;for(g=0;g<f.length;g++){j=f[g];var u=null,u=0<=l.dataPointIndexes[j]?
s[l.dataPointIndexes[j]]:{x:j,y:0};if(!(j<a.axisX.dataInfo.viewPortMin||j>a.axisX.dataInfo.viewPortMax)&&"number"===typeof u.y){k=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(j-a.axisX.convertionParameters.minimum)+0.5<<0;h=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(u.y-a.axisY.convertionParameters.minimum)+0.5<<0;var v=e[j]?e[j]:0;h-=v;r.push({x:k,y:m-v});e[j]=m-h;if(q)this.ctx.beginPath(),this.ctx.moveTo(k,h),n.beginPath(),
n.moveTo(k,h),q=!1;else if(this.ctx.lineTo(k,h),n.lineTo(k,h),0==g%250){for(;0<r.length;){var t=r.pop();this.ctx.lineTo(t.x,t.y);n.lineTo(t.x,t.y)}this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(k,h);n.closePath();n.fill();n.beginPath();n.moveTo(k,h);r.push({x:k,y:m-v})}if(0<=l.dataPointIndexes[j]){var y=l.dataPointIds[l.dataPointIndexes[j]];this._eventManager.objectMap[y]={objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:l.dataPointIndexes[j],x1:k,y1:h}}if(0<=l.dataPointIndexes[j]&&
0!==u.markerSize&&(0<u.markerSize||0<l.markerSize))j=l.getMarkerProperties(g,k,h,this.ctx),b.push(j),markerColor=A(y),b.push({x:k,y:h,ctx:n,type:j.type,size:j.size,color:markerColor,borderColor:markerColor,borderThickness:j.borderThickness});(u.indexLabel||l.indexLabel)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:u,dataSeries:l,point:{x:k,y:h},color:d})}}for(;0<r.length;)t=r.pop(),this.ctx.lineTo(t.x,t.y),n.lineTo(t.x,t.y);this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(k,
h);n.closePath();n.fill();n.beginPath();n.moveTo(k,h)}delete l.dataPointIndexes}H.drawMarkers(b);this.ctx.restore();n.restore()}};t.prototype.renderStackedArea100=function(a){if(!(0>=a.dataSeriesIndexes.length)){var d=null,b=this.getPlotArea(),c=[],e=[],f=[],g=0,k,h,j,m=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,n=0.15*this.canvas.width,p=a.axisX.dataInfo.minDiff,p=0.9*b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*
Math.abs(p)<<0,l=this._eventManager.ghostCtx;this.ctx.save();l.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();l.beginPath();l.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();xValuePresent=[];for(b=0;b<a.dataSeriesIndexes.length;b++){var s=a.dataSeriesIndexes[b],q=this.data[s],r=q.dataPoints;q.dataPointIndexes=[];for(g=0;g<r.length;g++)s=r[g].x.getTime?r[g].x.getTime():r[g].x,q.dataPointIndexes[s]=g,xValuePresent[s]||(f.push(s),xValuePresent[s]=
!0);f.sort(Z)}for(b=0;b<a.dataSeriesIndexes.length;b++){var s=a.dataSeriesIndexes[b],q=this.data[s],r=q.dataPoints,u=!0,d=q.id;this._eventManager.objectMap[d]={objectType:"dataSeries",dataSeriesIndex:s};d=A(d);l.fillStyle=d;1==r.length&&(p=n);1>p?p=1:p>n&&(p=n);var v=[];if(0<f.length){d=q._colorSet[g%q._colorSet.length];this.ctx.fillStyle=d;for(g=0;g<f.length;g++){j=f[g];var t=null,t=0<=q.dataPointIndexes[j]?r[q.dataPointIndexes[j]]:{x:j,y:0};if(!(j<a.axisX.dataInfo.viewPortMin||j>a.axisX.dataInfo.viewPortMax)&&
"number"===typeof t.y){h=0!==a.dataPointYSums[j]?100*(t.y/a.dataPointYSums[j]):0;k=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(j-a.axisX.convertionParameters.minimum)+0.5<<0;h=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(h-a.axisY.convertionParameters.minimum)+0.5<<0;var y=e[j]?e[j]:0;h-=y;v.push({x:k,y:m-y});e[j]=m-h;if(u)this.ctx.beginPath(),this.ctx.moveTo(k,h),l.beginPath(),l.moveTo(k,h),u=!1;else if(this.ctx.lineTo(k,
h),l.lineTo(k,h),0==g%250){for(;0<v.length;){var x=v.pop();this.ctx.lineTo(x.x,x.y);l.lineTo(x.x,x.y)}this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(k,h);l.closePath();l.fill();l.beginPath();l.moveTo(k,h);v.push({x:k,y:m-y})}if(0<=q.dataPointIndexes[j]){var F=q.dataPointIds[q.dataPointIndexes[j]];this._eventManager.objectMap[F]={objectType:"dataPoint",dataSeriesIndex:s,dataPointIndex:q.dataPointIndexes[j],x1:k,y1:h}}if(0<=q.dataPointIndexes[j]&&0!==t.markerSize&&(0<t.markerSize||
0<q.markerSize))j=q.getMarkerProperties(g,k,h,this.ctx),c.push(j),markerColor=A(F),c.push({x:k,y:h,ctx:l,type:j.type,size:j.size,color:markerColor,borderColor:markerColor,borderThickness:j.borderThickness});(t.indexLabel||q.indexLabel)&&this._indexLabels.push({chartType:"stackedArea100",dataPoint:t,dataSeries:q,point:{x:k,y:h},color:d})}}for(;0<v.length;)x=v.pop(),this.ctx.lineTo(x.x,x.y),l.lineTo(x.x,x.y);this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(k,h);l.closePath();
l.fill();l.beginPath();l.moveTo(k,h)}delete q.dataPointIndexes}H.drawMarkers(c);this.ctx.restore();l.restore()}};t.prototype.renderBubble=function(a){var d=a.dataSeriesIndexes.length;if(!(0>=d)){var b=this.getPlotArea(),c=0,e,f,g=0.15*this.canvas.width,c=a.axisX.dataInfo.minDiff,d=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(c)/d)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,
b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var k=-Infinity,h=Infinity,j=0;j<a.dataSeriesIndexes.length;j++)for(var m=a.dataSeriesIndexes[j],n=this.data[m],p=n.dataPoints,l=0,c=0;c<p.length;c++)if(e=p[c].getTime?e=p[c].x.getTime():e=p[c].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"undefined"!==typeof p[c].z)l=p[c].z,l>k&&(k=l),l<h&&(h=l);for(var s=25*Math.PI,b=Math.max(Math.pow(0.25*Math.min(b.height,b.width)/2,2)*Math.PI,s),j=0;j<a.dataSeriesIndexes.length;j++)if(m=
a.dataSeriesIndexes[j],n=this.data[m],p=n.dataPoints,1==p.length&&(d=g),1>d?d=1:d>g&&(d=g),0<p.length){this.ctx.strokeStyle="#4572A7 ";for(c=0;c<p.length;c++)if(e=p[c].getTime?e=p[c].x.getTime():e=p[c].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[c].y){e=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(e-a.axisX.convertionParameters.minimum)+0.5<<0;f=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
(p[c].y-a.axisY.convertionParameters.minimum)+0.5<<0;var l=p[c].z,q=2*Math.max(Math.sqrt((s+(b-s)/(k-h)*(l-h))/Math.PI)<<0,1),l=n.getMarkerProperties(c,this.ctx);l.size=q;H.drawMarker(e,f,this.ctx,l.type,l.size,l.color,l.borderColor,l.borderThickness);var r=n.dataPointIds[c];this._eventManager.objectMap[r]={objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:c,x1:e,y1:f,size:q};q=A(r);H.drawMarker(e,f,this._eventManager.ghostCtx,l.type,l.size,q,q,l.borderThickness)}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};
t.prototype.renderScatter=function(a){var d=a.dataSeriesIndexes.length;if(!(0>=d)){var b=this.getPlotArea(),c=0,e,f,g=0.15*this.canvas.width,c=a.axisX.dataInfo.minDiff,d=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(c)/d)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var k=0;k<a.dataSeriesIndexes.length;k++){var h=
a.dataSeriesIndexes[k],j=this.data[h],m=j.dataPoints;1==m.length&&(d=g);1>d?d=1:d>g&&(d=g);if(0<m.length){this.ctx.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(b.height,b.width)/2,2);for(var n=0,p=0,c=0;c<m.length;c++)if(e=m[c].getTime?e=m[c].x.getTime():e=m[c].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[c].y){e=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(e-a.axisX.convertionParameters.minimum)+0.5<<0;f=a.axisY.convertionParameters.reference+
a.axisY.convertionParameters.pixelPerUnit*(m[c].y-a.axisY.convertionParameters.minimum)+0.5<<0;var l=j.getMarkerProperties(c,e,f,this.ctx);H.drawMarker(l.x,l.y,l.ctx,l.type,l.size,l.color,l.color,l.thickness);Math.sqrt((n-e)*(n-e)+(p-f)*(p-f))<Math.min(l.size,5)||(n=j.dataPointIds[c],this._eventManager.objectMap[n]={objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:c,x1:e,y1:f},n=A(n),H.drawMarker(l.x,l.y,this._eventManager.ghostCtx,l.type,l.size,n,n,l.borderThickness),n=e,p=f)}}}this.ctx.restore();
this._eventManager.ghostCtx.restore()}};var L=function(a,d,b,c,e,f,g){a.save();"pie"===e?(a.beginPath(),a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,f,g,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.stroke(),a.fill()):"doughnut"===e&&(a.beginPath(),a.arc(d.x,d.y,b,f,g,!1),a.arc(d.x,d.y,0.6*b,g,f,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.stroke(),a.fill());a.restore()};t.prototype.renderPie=function(a){function d(){w.ctx.save();w._eventManager.ghostCtx.save();
w.ctx.translate(t.x,t.y);w._eventManager.ghostCtx.translate(t.x,t.y);w.ctx.fillStyle=w.backgroundColor?w.backgroundColor:"white";w.ctx.fillRect(-v.width/2,-v.height/2,v.width,v.height);var a=!0===w.animationEnabled?60:1;if(null!=z&&z.frame<a){z.isAnimating--;for(var c=0,c=h[0],k=z.maxAngle+2*Math.PI/a,j=0;j<u;j++){var m=f.dataPoints[j].exploded,l=f.dataPoints[j].color?f.dataPoints[j].color:f.color?f.color:y[j%y.length],q=c,r=c=q+2*Math.PI/n*Math.abs(f.dataPoints[j].y),s=!1;r>k&&(r=k,s=!0);type=f.type;
"outside"===f.indexLabelPlacement?(indexLineMinLength=Math.min(v.width,v.height)/14,p=indexLineMinLength<x?x-indexLineMinLength:x-25):"inside"===f.indexLabelPlacement&&(p=(1-g)*0.5*Math.min(v.width,v.height));var B={x:0,y:0};L(w.ctx,B,p,l,type,q,r);q=!0===f.dataPoints[j].exploded?!0:!1;typeof f.dataPoints[j]===Boolean&&(userSetExploed=!0);r=f.dataPointIds[j];w._eventManager.objectMap[r]={objectType:"dataPoint",dataSeriesIndex:0,dataPointIndex:j,center:{x:t.x,y:t.y},radius:p,color:l,startAngle:h[j],
endAngle:h[j+1],currentlyExploded:q,userSetExploded:m,pastExploded:!1};m=T(r);w._eventManager.ghostCtx.save();l="rgb("+m[0]+","+m[1]+","+m[2]+")";L(w._eventManager.ghostCtx,B,p,l,type,h[j],h[j+1]);w._eventManager.ghostCtx.restore();if(s)break}z.maxAngle=k;z.frame++;z.frame<a?w.requestAnimFrame.call(window,d):(e(0,a),w.ctx.restore(),w._eventManager.ghostCtx.restore(),setTimeout(function(){z.frame=0;z.isAnimating=20;b()},200))}w.renderCount++;w.ctx.restore();w._eventManager.ghostCtx.restore()}function b(){w.ctx.save();
w._eventManager.ghostCtx.save();w.ctx.translate(t.x,t.y);w._eventManager.ghostCtx.translate(t.x,t.y);if(null!==z&&20>z.frame){z.isAnimating--;w.ctx.fillStyle=w.backgroundColor?w.backgroundColor:"white";w.ctx.fillRect(-v.width/2,-v.height/2,v.width,v.height);for(var a=0;a<u;a++){var c=f.dataPoints[a].color?f.dataPoints[a].color:f.color?f.color:y[a%y.length],d={x:0,y:0},k=p*g*Math.cos(j[a]),m=p*g*Math.sin(j[a]),l=f.type,n=f.dataPointIds[a],q=w._eventManager.objectMap[n].currentlyExploded,r=w._eventManager.objectMap[n].pastExploded;
!0===q&&!1===r?(d.x+=k/20*(z.frame+1),d.y+=m/20*(z.frame+1),20===z.frame+1&&(w._eventManager.objectMap[n].pastExploded=!0)):!0===q&&!0===r&&(d.x+=k,d.y+=m);w._eventManager.objectMap[n].center.x=d.x+t.x;w._eventManager.objectMap[n].center.y=d.y+t.y;r!==q&&(k={},k.dataSeries=f,k.dataPoint=f.dataPoints[a],k.index=a,w._toolTip.highlightObjects([k]));L(w.ctx,d,p,c,l,h[a],h[a+1]);19===z.frame&&(n=f.dataPointIds[a],c=T(n),w._eventManager.ghostCtx.save(),c="rgb("+c[0]+","+c[1]+","+c[2]+")",L(w._eventManager.ghostCtx,
d,p,c,l,h[a],h[a+1]),w._eventManager.ghostCtx.restore())}z.frame++;20>z.frame&&w.requestAnimFrame.call(window,b)}e(z.frame,20);w.ctx.restore();w._eventManager.ghostCtx.restore()}function c(){w.ctx.save();w._eventManager.ghostCtx.save();w.ctx.translate(t.x,t.y);w._eventManager.ghostCtx.translate(t.x,t.y);if(null!==z&&0<z.frame){z.isAnimating--;w.ctx.fillStyle=w.backgroundColor?w.backgroundColor:"white";w.ctx.fillRect(-v.width/2,-v.height/2,v.width,v.height);for(var a=0;a<u;a++){var b=f.dataPointIds[a],
d=w._eventManager.objectMap[b].currentlyExploded,k=w._eventManager.objectMap[b].pastExploded,m=f.dataPoints[a].color?f.dataPoints[a].color:f.color?f.color:y[a%y.length],l={x:0,y:0},n=f.type,d=w._eventManager.objectMap[b].currentlyExploded,q=p*g*Math.cos(j[a]),r=p*g*Math.sin(j[a]);!1===d&&!0===k?(l.x+=q/20*z.frame,l.y+=r/20*z.frame,1===z.frame&&(w._eventManager.objectMap[b].pastExploded=!1)):!0===d&&!0===k&&(l.x+=q,l.y+=r);w._eventManager.objectMap[b].center.x=l.x+t.x;w._eventManager.objectMap[b].center.y=
l.y+t.y;k!==d&&(b={},b.dataSeries=f,b.dataPoint=f.dataPoints[a],b.index=a,w._toolTip.highlightObjects([b]));L(w.ctx,l,p,m,n,h[a],h[a+1]);1===z.frame&&(b=f.dataPointIds[a],m=T(b),w._eventManager.ghostCtx.save(),m="rgb("+m[0]+","+m[1]+","+m[2]+")",L(w._eventManager.ghostCtx,l,p,m,n,h[a],h[a+1]),w._eventManager.ghostCtx.restore())}z.frame--;0<z.frame&&w.requestAnimFrame.call(window,c)}e(z.frame,20);w.ctx.restore();w._eventManager.ghostCtx.restore()}function e(a,b){for(var c=0;c<f.dataPoints.length;c++){var d=
f.dataPointIds[c],e=w.ctx,h=l[c],n=s[c],t=q[c],u=r[c],v=w._eventManager.objectMap[d].currentlyExploded,x=m[c],y=p,z=j[c],B=f.dataPoints[c].indexLabelFontColor?f.dataPoints[c].indexLabelFontColor:f.indexLabelFontColor,A=f.indexLabelPlacement,E=f.dataPoints[c].indexLabelLineColor?f.dataPoints[c].indexLabelLineColor:f.indexLabelLineColor,C=f.dataPoints[c].indexLabelLineThickness?f.dataPoints[c].indexLabelLineThickness:f.indexLabelLineThickness,D=a,F=b,d=w._eventManager.objectMap[d].pastExploded,G=k[c],
H=f.dataPoints[c].indexLabelFontStyle?f.dataPoints[c].indexLabelFontStyle:f.indexLabelFontStyle,I=f.dataPoints[c].indexLabelFontWeight?f.dataPoints[c].indexLabelFontWeight:f.indexLabelFontWeight,J=f.dataPoints[c].indexLabelFontSize?f.dataPoints[c].indexLabelFontSize:f.indexLabelFontSize,K=f.dataPoints[c].indexLabelFontFamily?f.dataPoints[c].indexLabelFontFamily:f.indexLabelFontFamily,L=f.dataPoints[c].indexLabelBackgroundColor?f.dataPoints[c].indexLabelBackgroundColor:f.indexLabelBackgroundColor?
f.indexLabelBackgroundColor:null,M=c;e.save();e.lineWidth=C;e.font=H+" "+I+" "+J+"px "+K;C="left";0>h&&"outside"===A?C="right":0<=h&&"outside"===A?C="left":"inside"===A&&(C="center");e.textAlign=C;e.textBaseline="middle";e.beginPath();L&&(e.fillStyle=L,"outside"===A?0<=h?e.fillRect(h-2.5,t-2.5,n-h+5,u-t+5):e.fillRect(h+2.5,t-2.5,n-h-5,u-t+5):"inside"===A&&(0<=h?e.fillRect(h-G/2-2.5,t-2.5,n-h+5,u-t+5):e.fillRect(h+G/2+2.5,t-2.5,n-h-5,u-t+5)));e.fillStyle=B;e.fillText(x,h,(t+u)/2);"outside"===A&&k[M]&&
(n=y*Math.cos(z),x=y*Math.sin(z),!0===v&&!0!==d?(n+=y*g*Math.cos(z)/F*D,x+=y*g*Math.sin(z)/F*D):!0===v&&!0===d?(n+=y*g*Math.cos(z),x+=y*g*Math.sin(z)):!0!==v&&!0===d&&(n+=y*g*Math.cos(z)/F*D,x+=y*g*Math.sin(z)/F*D),e.moveTo(n,x),0<h?(e.lineTo(h-10,(t+u)/2),e.lineTo(h-2,(t+u)/2)):0>h&&(e.lineTo(h+10,(t+u)/2),e.lineTo(h+2,(t+u)/2)),e.strokeStyle=E,e.stroke());e.restore()}}if(!(0>=a.dataSeriesIndexes.length)){var f=this.data[a.dataSeriesIndexes[0]],g=0.07;ctx=this.ctx;var k=[],h=[],j=[],m=[],n=0,p=0,
l=[],s=[],q=[],r=[],u=f.dataPoints.length,v=this.getPlotArea();v.width=v.x2-v.x1;v.height=v.y2-v.y1;var t={x:(v.x2+v.x1)/2,y:(v.y2+v.y1)/2};a=f.startAngle?f.startAngle:0;a=(a%360+360)%360*Math.PI/180;h.push(a);var y=this._selectedColorSet,x=0.5*Math.min(v.width,v.height);for(a=0;a<u;a++){var F=f.dataPoints[a].indexLabel?f.dataPoints[a].indexLabel:f.indexLabel?f.indexLabel:f.dataPoints[a].label?f.dataPoints[a].label:f.label?f.label:"",F=this.replaceKeywordsWithValue(F,f.dataPoints[a],f,a);m.push(F);
var F=f.dataPoints[a].indexLabelFontStyle?f.dataPoints[a].indexLabelFontStyle:f.indexLabelFontStyle,B=f.dataPoints[a].indexLabelFontWeight?f.dataPoints[a].indexLabelFontWeight:f.indexLabelFontWeight,E=f.dataPoints[a].indexLabelFontSize?f.dataPoints[a].indexLabelFontSize:f.indexLabelFontSize,A=f.dataPoints[a].indexLabelFontFamily?f.dataPoints[a].indexLabelFontFamily:f.indexLabelFontFamily;ctx.save();ctx.font=F+" "+B+" "+E+"px "+A;F=ctx.measureText(m[a]).width;ctx.restore();k.push(F);n+=Math.abs(f.dataPoints[a].y)}for(a=
F=0;a<u;a++)B=Math.abs(f.dataPoints[a].y),B=2*Math.PI*(B/n),h.push(h[a]+B),B=B/2+h[a],j.push(B%(2*Math.PI)),F+=k[a];0===F&&(f.indexLabelPlacement="inside");F=0;if("inside"===f.indexLabelPlacement){x*=0.8*(1-g);for(a=0;a<u;a++)E=x*Math.cos(j[a]),A=x*Math.sin(j[a]),l.push(E),0<E?s.push(l[a]+k[a]):s.push(l[a]-k[a]),q.push(A-f.indexLabelFontSize/2),r.push(A+f.indexLabelFontSize/2)}else if("outside"===f.indexLabelPlacement)for(B=0;3>B;B++){for(a=0;a<u;a++)E=x*Math.cos(j[a]),A=x*Math.sin(j[a]),l.push(E),
0<E?s.push(l[a]+k[a]):s.push(l[a]-k[a]),q.push(A-f.indexLabelFontSize/2),r.push(A+f.indexLabelFontSize/2);for(a=0;a<u;a++)j[a]<Math.PI/2&&(1<=a&&q[a]<r[a-1])&&(E=r[a-1]-q[a],q[a]+=E+2,r[a]+=E+2,20>u&&(q[a]+=3,r[a]+=3)),j[a]<3*Math.PI/2&&j[a]>=Math.PI&&r[a]>q[a-1]&&(E=r[a]-q[a-1],q[a]-=E+2,r[a]-=E+2,20>u&&(q[a]-=3,r[a]-=3));for(a=u;0<=a;a--)j[a]<Math.PI&&j[a]>=Math.PI/2&&q[a]<r[a+1]&&(E=r[a+1]-q[a],q[a]+=E+2,r[a]+=E+2,20>u&&(q[a]+=3,r[a]+=3)),j[a]>=3*Math.PI/2&&r[a]>q[a+1]&&(E=r[a]-q[a+1],q[a]-=E,
r[a]-=E,20>u&&(q[a]+=-3,r[a]+=-3));if(2>F){a=Math.min.apply(Math,q.concat(r));var E=Math.max.apply(Math,q.concat(r)),A=Math.max.apply(Math,s.concat(l)),D=Math.min.apply(Math,s.concat(l)),C=[];Math.abs(a)>v.height/2&&C.push(Math.abs(a)-v.height/2);Math.abs(E)>v.height/2&&C.push(Math.abs(E)-v.height/2);Math.abs(A)>v.width/2&&C.push(Math.abs(A)-v.width/2);Math.abs(D)>v.width/2&&C.push(Math.abs(D)-v.width/2);l=[];s=[];q=[];r=[];C.length&&(x-=Math.max.apply(Math,C)+f.indexLabelFontSize/2+2,40>x&&(x=40));
F++}}var w=this,z={frame:0,maxAngle:h[0],count:0};0!==w.renderCount&&(this.animationEnabled=!1);z.isAnimating=60;d();this.pieDoughnutClickHandler=function(a){if(0===z.isAnimating){a=a.dataPointIndex;var d=f.dataPointIds[a];!0===w._eventManager.objectMap[d].currentlyExploded?(!0===w._eventManager.objectMap[d].userSetExploded&&(f.dataPoints[a].exploded=!1),w._eventManager.objectMap[d].currentlyExploded=!1,z.frame=20,z.isAnimating=20,c()):!1===w._eventManager.objectMap[d].currentlyExploded&&(!0===w._eventManager.objectMap[d].userSetExploded&&
(f.dataPoints[a].exploded=!0),w._eventManager.objectMap[d].currentlyExploded=!0,z.isAnimating=20,z.frame=0,b())}}}};t.prototype.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)};O.prototype.registerSpace=function(a,d){"top"===a?this._topOccupied+=d.height:"bottom"===a?this._bottomOccupied+=d.height:"left"===a?this._leftOccupied+=
d.width:"right"===a&&(this._rightOccupied+=d.width)};O.prototype.unRegisterSpace=function(a,d){"top"===a?this._topOccupied-=d.height:"bottom"===a?this._bottomOccupied-=d.height:"left"===a?this._leftOccupied-=d.width:"right"===a&&(this._rightOccupied-=d.width)};O.prototype.getFreeSpace=function(){return{x1:this._leftOccupied,y1:this._topOccupied,x2:this.canvas.width-this._rightOccupied,y2:this.canvas.height-this._bottomOccupied,width:this.canvas.width-this._rightOccupied-this._leftOccupied,height:this.canvas.height-
this._bottomOccupied-this._topOccupied}};O.prototype.reset=function(){this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=0};K(D,G);D.prototype.render=function(a){a&&this.ctx.save();var d=this.ctx.font;this.ctx.textBaseline=this.textBaseline;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var b=0,c=this.padding,e=null;if(0<this.borderThickness&&this.borderColor||this.backgroundColor)this.ctx.roundRect(0,
0,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor),"middle"===this.textBaseline&&(c+=this.fontSize/2);this.ctx.fillStyle=this.fontColor;for(var f=0;f<this._wrappedText.lines.length;f++)e=this._wrappedText.lines[f],"right"===this.horizontalAlign?b=this.width-e.width-this.padding:"left"===this.horizontalAlign?b=this.padding:"center"===this.horizontalAlign&&(b=(this.width-2*this.padding)/2-e.width/2+this.padding),this.ctx.fillText(e.text,b,c),c+=e.height;
this.ctx.font=d;a&&this.ctx.restore()};D.prototype.setText=function(a){this.text=a;this._isDirty=!0;this._wrappedText=null};D.prototype.measureText=function(){if(null===this.maxWidth)throw"Please set maxWidth and height for TextBlock";this._wrapText(this.ctx);this._isDirty=!1;return{width:this.width,height:this.height}};D.prototype._wrapText=function(){text=new String(N(this.text));var a=[],d=this.ctx.font,b=0,c=0;for(this.ctx.font=this._getFontString();0<text.length;){for(var e=text,f=0,g=0,k=this.maxWidth-
2*this.padding,h=this.maxHeight-2*this.padding;;)if(f=this.ctx.measureText(e).width,g=0,f>k)g=e.length/f*k,f=Math.max(Math.min(Math.ceil(g),e.length-1),0),g=e.lastIndexOf(" ",f,e.length-1),e=0<=g?N(text.slice(0,g)):N(text.slice(0,f-1));else{a.push({text:e,width:f,height:this.fontSize});c=Math.max(c,f);b+=this.fontSize;text=N(text.slice(e.length,text.length));break}if(h&&b>h-this.fontSize&&0<text.length){e=a.pop();Math.min(e.text.length,3);a.push(e);break}}this._wrappedText={lines:a,width:c,height:b};
this.width=c+2*this.padding;this.height=b+2*this.padding;this.ctx.font=d};D.prototype._getFontString=function(){return this.fontStyle+" "+this.fontWeight+" "+this.fontSize+"px "+this.fontFamily};K(R,G);R.prototype.render=function(){if(this.text){var a=this.chart.layoutManager.getFreeSpace(),d=0,b=0,c=0,e=0,f=0,g,k;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(e=a.width-2*this.margin,f=0.5*a.height-2*this.margin,c=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===
this.horizontalAlign?(e=a.height-2*this.margin,f=0.5*a.width-2*this.margin):"center"===this.horizontalAlign&&(e=a.width-2*this.margin,f=0.5*a.height-2*this.margin));var f=new D(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,fontStyle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThickness,backgroundColor:this.backgroundColor,maxWidth:e,maxHeight:f,
cornerRadius:this.cornerRadius,text:this.text,padding:this.padding,textBaseline:this.borderColor&&0<this.borderThickness?"middle":"top"}),h=f.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(b=this.margin,k="top"):"bottom"===this.verticalAlign&&(b=a.y2-this.margin-h.height,k="bottom"),"left"===this.horizontalAlign?d=a.x1+this.margin:"center"===this.horizontalAlign?d=a.x1+(e/2-h.width/2)+this.margin:"right"===this.horizontalAlign&&(d=a.x2-this.margin-
h.width),g=this.horizontalAlign,this.width=h.width,this.height=h.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?(d=a.x1+this.margin,b=a.y2-this.margin-(e/2-h.width/2),c=-90,k="left",this.width=h.height,this.height=h.width):"right"===this.horizontalAlign?(d=a.x2-this.margin,b=a.y1+this.margin+(e/2-h.width/2),c=90,k="right",this.width=h.height,this.height=h.width):"center"===this.horizontalAlign&&(b=a.y1+(a.height/2-h.height/2),d=a.x1+(a.width/2-h.width/2),k="center",this.width=
h.width,this.height=h.height),g="center");f.x=d;f.y=b;f.angle=c;f.horizontalAlign=g;f.render(!0);this.chart.layoutManager.registerSpace(k,{width:this.width+2*this.margin,height:this.height+2*this.margin});this.bounds={x1:d,y1:b,x2:d+this.width,y2:b+this.height};this.ctx.textBaseline="top"}};K(S,G);S.prototype.render=function(){var a=this.chart.layoutManager.getFreeSpace(),d=null,b=0,c=0,e=0,f=0,g=[],k=[];"undefined"===typeof this._options.fontSize&&(this.fontSize=fontSize=this.chart.getAutoFontSize(this.fontSize));
"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",d=this.verticalAlign,e=0.9*a.width,f=0.5*a.height):"center"===this.verticalAlign&&(this.orientation="vertical",d=this.horizontalAlign,e=0.5*a.width,f=0.9*a.height);for(var h=0;h<this.dataSeries.length;h++){var j=this.dataSeries[h],m=j.legendMarkerType?j.legendMarkerType:("line"===j.type||"scatter"===j.type||"bubble"===j.type)&&j.markerType?j.markerType:J.getDefaultLegendMarker(j.type),n=j.legendText?j.legendText:
j.name,p=j.legendMarkerColor?j.legendMarkerColor:j.markerColor?j.markerColor:j._colorSet[0],l=!j.markerSize&&"line"===j.type?0:0.7*this.fontSize;if("pie"!==j.type&&"doughnut"!==j.type)m={markerType:m,markerColor:p,text:n,textBlock:null,chartType:j.type,markerSize:l,lineColor:j._colorSet[0]},g.push(m);else for(var s=0;s<j.dataPoints.length;s++)l=j.dataPoints[s],m=l.legendMarkerType?l.legendMarkerType:j.legendMarkerType?j.legendMarkerType:J.getDefaultLegendMarker(j.type),n=l.legendText?l.legendText:
j.legendText?j.legendText:l.name?l.name:"DataPoint: "+(s+1),p=l.markerColor?l.markerColor:j.markerColor?j.markerColor:l.color?l.color:j.color?j.color:j._colorSet[s],l=(0===l.markerSize||0===j.markerSize&&!l.markerSize)&&"line"===j.type?0:0.7*this.fontSize,m={markerType:m,markerColor:p,text:n,textBlock:null,chartType:j.type,markerSize:l},g.push(m)}if(0<g.length){j=null;for(h=s=0;h<g.length;h++){m=g[h];if("horizontal"===this.orientation){if(m.textBlock=new D(this.ctx,{x:0,y:0,maxWidth:e,maxHeight:this.fontSize,
angle:0,text:m.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"top"}),m.textBlock.measureText(),!j||j.width+m.textBlock.width+(0===j.width?0:this.horizontalSpacing)>e)j={entries:[],width:0},k.push(j),this.height=k.length*(this.fontSize+5)}else this.height+this.fontSize<f?(j={entries:[],width:0},k.push(j),this.height=k.length*this.fontSize):(j=k[s],s=(s+1)%k.length),m.textBlock=
new D(this.ctx,{x:0,y:0,maxWidth:e,maxHeight:this.fontSize,angle:0,text:m.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"top"}),m.textBlock.measureText();m.textBlock.x=j.width+(0===j.width?0:this.horizontalSpacing);m.textBlock.y=0;j.width+=m.textBlock.width+(this.fontSize+5)+(0===j.width?0:this.horizontalSpacing);j.entries.push(m);this.width=Math.max(j.width,this.width)}this.height=
k.length*this.fontSize}"top"===this.verticalAlign?(c="left"===this.horizontalAlign?a.x1:"right"===this.horizontalAlign?a.x2-this.width:a.x1+a.width/2-this.width/2,b=a.y1):"center"===this.verticalAlign?(c="left"===this.horizontalAlign?a.x1:"right"===this.horizontalAlign?a.x2-this.width:a.x1+a.width/2-this.width/2,b=a.y1+a.height/2-this.height/2):"bottom"===this.verticalAlign&&(c="left"===this.horizontalAlign?a.x1:"right"===this.horizontalAlign?a.x2-this.width:a.x1+a.width/2-this.width/2,b=a.y2-this.height-
5);for(h=0;h<k.length;h++){var j=k[h],q;for(q in j.entries)m=j.entries[q],a=m.textBlock.x+c,e=b+h*this.fontSize,"line"===m.chartType&&(this.ctx.strokeStyle=m.lineColor,this.ctx.lineWidth=Math.ceil(this.fontSize/8),this.ctx.beginPath(),this.ctx.moveTo(a-2,e+this.fontSize/2),this.ctx.lineTo(a+2+this.fontSize,e+this.fontSize/2),this.ctx.stroke()),H.drawMarker(a+this.fontSize/2,e+this.fontSize/2,this.ctx,m.markerType,l,m.markerColor,null,0),m.textBlock.x=a+this.fontSize+5,m.textBlock.y=e,m.textBlock.render(!0)}this.chart.layoutManager.registerSpace(d,
{width:this.width,height:this.height+5+5});this.bounds={x1:c,y1:b,x2:c+this.width,y2:b+this.height}};K(V,G);V.prototype.render=function(){var a=this.chart.layoutManager.getFreeSpace();this.ctx.fillStyle="red";this.ctx.fillRect(a.x1,a.y1,a.x2,a.y2)};K(J,G);J.prototype.getDefaultAxisPlacement=function(){type=this.type.toLowerCase();if("column"===type||"line"===type||"area"===type||"stackedcolumn"===type||"stackedline"===type||"bubble"===type||"scatter"===type||"stackedarea"===type||"stackedcolumn100"===
type||"stackedline100"===type||"stackedarea100"===type)return"normal";if("bar"===type||"stackedbar"===type||"stackedbar100"===type)return"xySwapped";if("pie"===type||"doughnut"===type)return"none";window.console.log("Unknown Chart Type: "+type);return null};J.getDefaultLegendMarker=function(a){a=a.toLowerCase();if("column"===a||"stackedcolumn"===a||"stackedline"===a||"bar"===a||"stackedbar"===a||"stackedbar100"===a||"bubble"===a||"scatter"===a||"stackedcolumn100"===a||"stackedline100"===a)return"square";
if("line"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"stackedarea"===a||"stackedarea100"===a)return"triangle";window.console.log("Unknown Chart Type: "+a);return null};J.prototype.findDataPointByX=function(a,d){for(var b=0,c=this.dataPoints.length,e,f={dataPoint:null,distance:Infinity,index:NaN},g=0,k=null;b<c;){g++;e=(b+c)/2<<0;var k=this.dataPoints[e],h=Math.abs(k.x-a);h<f.distance&&(f.dataPoint=k,f.distance=h,f.index=e);if(k.x<a)b=e+1;else if(k.x>a)c=e;else{f.dataPoint=k;f.distance=
h;f.index=e;break}}return!d&&f.dataPoint.x===a?f:d&&null!==f.dataPoint?f:null};J.prototype.getMarkerProperties=function(a,d,b,c){var e=this.dataPoints,f=e[a].markerColor?e[a].markerColor:this.markerColor?this.markerColor:e[a].color?e[a].color:this.color?this.color:this._colorSet[a%this._colorSet.length];return{x:d,y:b,ctx:c,type:e[a].markerType?e[a].markerType:this.markerType,size:e[a].markerSize?e[a].markerSize:this.markerSize,color:f,borderColor:e[a].markerBorderColor?e[a].markerBorderColor:this.markerBorderColor?
this.markerBorderColor:f,borderThickness:e[a].markerBorderThickness?e[a].markerBorderThickness:this.markerBorderThickness?this.markerBorderThickness:1}};K(x,G);x.prototype.createLabels=function(){var a,d=0,b,c;if("axisX"===this.type&&"dateTime"===this.chart.plotInfo.axisXValueType){b=Y(new Date(this.maximum),this.interval,this.intervalType);c=W;for(d=this.intervalStartPosition;d<b;Y(d,this.interval,this.intervalType))a="axisX"===this.type&&this.labels[d]?this.labels[d]:c(d,this.valueFormatString),
a=new D(this.ctx,{x:0,y:0,maxWidth:this.maxHeight,maxHeight:this.labelFontSize,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:d.getTime(),textBlock:a,effectiveHeight:null})}else{b=this.maximum;c=X;if(Math.floor(this.interval)<this.interval&&!this._options.interval){a=
Math.ceil(this.interval);for(var e=Math.ceil(this.intervalStartPosition),f=!1,d=e;d<=this.maximum;d+=a)if(this.labels[d])f=!0;else{f=!1;break}f&&(this.interval=a,this.intervalStartPosition=e)}for(d=this.intervalStartPosition;d<=b;d+=this.interval)a="axisX"===this.type&&this.labels[d]?this.labels[d]:c(d,this.valueFormatString),a=new D(this.ctx,{x:0,y:0,maxWidth:this.maxHeight,maxHeight:this.labelFontSize,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",fontSize:this.labelFontSize,
fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:d,textBlock:a,effectiveHeight:null})}};x.prototype.createLabelsAndCalculateWidth=function(){var a=0;this._labels=[];if("left"===this._position||"right"===this._position){this.createLabels();for(i=0;i<this._labels.length;i++){textBlock=this._labels[i].textBlock;var d=textBlock.measureText();labelEffectiveWidth=
0===this.labelAngle?d.width:d.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+d.height/2*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<labelEffectiveWidth&&(a=labelEffectiveWidth);this._labels[i].effectiveWidth=labelEffectiveWidth}}return(this.title?this.titleFontSize+5:0)+a+this.tickLength+10};x.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];var d,b=0;this.createLabels();if("bottom"===this._position||"top"===this._position)for(b=0;b<this._labels.length;b++){d=
this._labels[b].textBlock;d=d.measureText();var c=0,c=0===this.labelAngle?d.height:d.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+d.height/2*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<c&&(a=c);this._labels[b].effectiveHeight=c}return(this.title?this.titleFontSize+5:0)+a+this.tickLength};x.setLayoutAndRender=function(a,d,b,c,e){var f,g,k,h=a.chart.ctx;a.calculateAxisParameters();d&&d.calculateAxisParameters();b&&b.calculateAxisParameters();if(d&&b&&"undefined"===typeof d._options.maximum&&
"undefined"===typeof d._options.minimum&&"undefined"===typeof d._options.interval&&"undefined"===typeof b._options.maximum&&"undefined"===typeof b._options.minimum&&"undefined"===typeof b._options.interval){var j=(d.maximum-d.minimum)/d.interval,m=(b.maximum-b.minimum)/b.interval;j>m?b.maximum=b.interval*j+b.minimum:m>j&&(d.maximum=d.interval*m+d.minimum)}var j=d?d.lineThickness?d.lineThickness:0:0,m=b?b.lineThickness?b.lineThickness:0:0,n=d?d.gridThickness?d.gridThickness:0:0,p=b?b.gridThickness?
b.gridThickness:0:0,l=d?d.margin:0;if("normal"===c){var s=d?d.createLabelsAndCalculateWidth():0,q=b?b.createLabelsAndCalculateWidth():0,r=a.createLabelsAndCalculateHeight();c=e.x1+s+l+j/2;f=e.y2-r-a.margin;g=e.x2-q>a.chart.canvas.width-10?a.chart.canvas.width-10:e.x2-q;k=e.y2-a.margin;a.lineCoordinates={x1:c,y1:f,x2:g,y2:f,width:Math.abs(g-c)};a.boundingRect={x1:c,y1:f,x2:g,y2:k,width:g-c,height:k-f};d&&(c=e.x1+d.margin,f=10>e.y1?10:e.y1,g=e.x1+s+d.margin,k=e.y2-r-a.margin-a.lineThickness/2,d.lineCoordinates=
{x1:g,y1:f,x2:g,y2:k,height:Math.abs(k-f)},d.boundingRect={x1:c,y1:f,x2:g,y2:k,width:g-c,height:k-f});b&&(c=a.lineCoordinates.x2,f=10>e.y1?10:e.y1,g=c+q+b.margin,k=e.y2-r-a.margin-a.lineThickness/2,b.lineCoordinates={x1:c,y1:f,x2:c,y2:k,height:Math.abs(k-f)},b.boundingRect={x1:c,y1:f,x2:g,y2:k,width:g-c,height:k-f});h.save();h.rect(a.boundingRect.x1-40,a.boundingRect.y1,a.boundingRect.width+80,a.boundingRect.height);h.clip();a.renderLabelsTicksAndTitle();h.restore();d&&d.renderLabelsTicksAndTitle();
b&&b.renderLabelsTicksAndTitle();e=a.chart.getPlotArea();h.save();h.rect(e.x1-Math.max(j+a.gridThickness)/2,e.y1-Math.max(p,n)/2,Math.abs(e.x2-e.x1+Math.max(j+a.gridThickness)/2+Math.max(m,a.gridThickness)/2),Math.abs(e.y2-e.y1+Math.max(p,n,a.lineThickness)));h.clip();a.calculateValueToPixelConvertionParameters();d&&d.calculateValueToPixelConvertionParameters();b&&b.calculateValueToPixelConvertionParameters();a.renderInterlacedColors();d&&d.renderInterlacedColors();b&&b.renderInterlacedColors();h.restore();
a.renderGrid();d&&d.renderGrid();b&&b.renderGrid()}else s=d?d.createLabelsAndCalculateHeight():0,q=b?b.createLabelsAndCalculateHeight():0,r=a.createLabelsAndCalculateWidth(),d&&(c=e.x1+r+a.margin+a.lineThickness/2,f=e.y2-s-d.margin,g=e.x2>d.chart.canvas.width-10?d.chart.canvas.width-10:e.x2,k=e.y2-d.margin,d.lineCoordinates={x1:c,y1:f,x2:g,y2:f,width:Math.abs(g-c)},d.boundingRect={x1:c,y1:f,x2:g,y2:k,width:g-c,height:s}),b&&(c=e.x1+r+a.margin+a.lineThickness/2,f=e.y1+b.margin,g=e.x2>b.chart.canvas.width-
10?b.chart.canvas.width-10:e.x2,k=e.y1+b.margin+q,b.lineCoordinates={x1:c,y1:k,x2:g,y2:k,width:Math.abs(g-c)},b.boundingRect={x1:c,y1:f,x2:g,y2:k,width:g-c,height:q}),c=e.x1+a.margin,f=10>e.y1+q+m/2?10:e.y1+q+m/2,g=e.x1+r+a.margin,k=e.y2-s-l-j/2,a.lineCoordinates={x1:g,y1:f,x2:g,y2:k,height:Math.abs(k-f)},a.boundingRect={x1:c,y1:f,x2:g,y2:k,width:g-c,height:k-f},h.save(),d&&d.renderLabelsTicksAndTitle(),b&&b.renderLabelsTicksAndTitle(),a.renderLabelsTicksAndTitle(),e=a.chart.getPlotArea(),h.save(),
h.rect(e.x1-Math.max(a.lineThickness,n,p),e.y1,Math.abs(e.x2-e.x1+Math.max(a.lineThickness,n,p)+Math.max(n,p)),Math.abs(e.y2-e.y1+(j?j/2:0))),h.clip(),a.calculateValueToPixelConvertionParameters(),d&&d.calculateValueToPixelConvertionParameters(),b&&b.calculateValueToPixelConvertionParameters(),a.renderInterlacedColors(),d&&d.renderInterlacedColors(),b&&b.renderInterlacedColors(),a.renderGrid(),d&&d.renderGrid(),b&&b.renderGrid(),h.restore();a.renderAxisLine();d&&d.renderAxisLine();b&&b.renderAxisLine()};
x.prototype.renderLabelsTicksAndTitle=function(){var a=!1,d=0,b=0.9,c=0;0!==this.labelAngle&&360!==this.labelAngle&&(b=1.2);if("bottom"===this._position||"top"===this._position){for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||(f=f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+f.textBlock.height*Math.sin(Math.PI/180*this.labelAngle),d+=f);d>this.lineCoordinates.width*b&&(a=!0)}if("left"===this._position||"right"===this._position){for(e=0;e<this._labels.length;e++)f=
this._labels[e],f.position<this.minimum||(f=f.textBlock.height*Math.cos(Math.PI/180*this.labelAngle)+f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),d+=f);d>this.lineCoordinates.height*b&&(a=!0)}if("bottom"===this._position){var e=0;this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(var f,e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(d=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),
this.ctx.moveTo(d.x<<0,d.y<<0),this.ctx.lineTo(d.x<<0,d.y+this.tickLength<<0),this.ctx.stroke()),a&&0!==c++%2||(0===f.textBlock.angle?(d.x-=f.textBlock.width/2,d.y+=this.tickLength+f.textBlock.height/2):(d.x-=0>this.labelAngle?f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,d.y+=this.tickLength+Math.abs(0>this.labelAngle?f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)),f.textBlock.x=d.x,f.textBlock.y=d.y,f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new D(this.ctx,
{x:this.lineCoordinates.x1,y:this.boundingRect.y2-this.titleFontSize-5,maxWidth:this.lineCoordinates.width,maxHeight:this.titleFontSize,angle:0,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.render(!0))}else if("top"===
this._position){this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(d=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(d.x<<0,d.y<<0),this.ctx.lineTo(d.x<<0,d.y-this.tickLength<<0),this.ctx.stroke()),a&&0!==c++%2||(0===f.textBlock.angle?(d.x-=f.textBlock.width/2,d.y-=this.tickLength+f.textBlock.height/2):(d.x-=0<this.labelAngle?
f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,d.y-=this.tickLength+Math.abs(0<this.labelAngle?f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+5:5)),f.textBlock.x=d.x,f.textBlock.y=d.y,f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new D(this.ctx,{x:this.lineCoordinates.x1,y:this.boundingRect.y1,maxWidth:this.lineCoordinates.width,maxHeight:this.titleFontSize,angle:0,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,
fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.render(!0))}else if("left"===this._position){this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(d=this.getPixelCoordinatesOnAxis(f.position),
this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(d.x<<0,d.y<<0),this.ctx.lineTo(d.x-this.tickLength<<0,d.y<<0),this.ctx.stroke()),a&&0!==c++%2||(f.textBlock.x=d.x-f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5,f.textBlock.y=d.y-f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new D(this.ctx,{x:this.boundingRect.x1+5,y:this.lineCoordinates.y2,maxWidth:this.lineCoordinates.height,maxHeight:this.titleFontSize,
angle:-90,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.y=this.lineCoordinates.height/2+this._titleTextBlock.width/2+this.lineCoordinates.y1,this._titleTextBlock.render(!0))}else if("right"===this._position){this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;
for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(d=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(d.x<<0,d.y<<0),this.ctx.lineTo(d.x+this.tickLength<<0,d.y<<0),this.ctx.stroke()),a&&0!==c++%2||(f.textBlock.x=d.x+this.tickLength+5,f.textBlock.y=d.y,f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new D(this.ctx,{x:this.boundingRect.x2-5,y:this.lineCoordinates.y2,maxWidth:this.lineCoordinates.height,
maxHeight:this.titleFontSize,angle:90,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.y=this.lineCoordinates.height/2-this._titleTextBlock.width/2+this.lineCoordinates.y1,this._titleTextBlock.render(!0))}};x.prototype.renderInterlacedColors=function(){var a,d,b=this.chart.getPlotArea();
if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor){var c=0;this.ctx.fillStyle=this.interlacedColor;for(c=0;c<this._labels.length;c+=2)a=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=c+1>=this._labels.length?this.getPixelCoordinatesOnAxis(this.maximum):this.getPixelCoordinatesOnAxis(this._labels[c+1].position),this.ctx.fillRect(a.x,b.y1,Math.abs(d.x-a.x),Math.abs(b.y1-b.y2))}else if(("left"===this._position||"right"===this._position)&&this.interlacedColor){this.ctx.fillStyle=
this.interlacedColor;for(c=0;c<this._labels.length;c+=2)d=this.getPixelCoordinatesOnAxis(this._labels[c].position),a=c+1>=this._labels.length?this.getPixelCoordinatesOnAxis(this.maximum):this.getPixelCoordinatesOnAxis(this._labels[c+1].position),this.ctx.fillRect(b.x1,a.y,Math.abs(b.x1-b.x2),Math.abs(a.y-d.y))}};x.prototype.renderGrid=function(){var a,d=this.chart.getPlotArea();if("bottom"===this._position||"top"===this._position){if(this.gridThickness&&0<this.gridThickness){this.ctx.lineWidth=this.gridThickness;
this.ctx.strokeStyle=this.gridColor;this.ctx.beginPath();for(b=0;b<this._labels.length;b++)this._labels[b].position<this.minimum||this._labels[b].position>this.maximum||(a=this.getPixelCoordinatesOnAxis(this._labels[b].position),this.ctx.moveTo(a.x<<0,d.y1<<0),this.ctx.lineTo(a.x<<0,d.y2<<0),this.ctx.stroke())}}else if(("left"===this._position||"right"===this._position)&&this.gridThickness&&0<this.gridThickness){this.ctx.lineWidth=this.gridThickness;this.ctx.strokeStyle=this.gridColor;this.ctx.beginPath();
for(var b=0;b<this._labels.length;b++)this._labels[b].position<this.minimum||this._labels[b].position>this.maximum||(a=this.getPixelCoordinatesOnAxis(this._labels[b].position),this.ctx.moveTo(d.x1<<0,a.y<<0),this.ctx.lineTo(d.x2<<0,a.y<<0),this.ctx.stroke())}};x.prototype.renderAxisLine=function(){if("bottom"===this._position||"top"===this._position)this.lineThickness&&(this.ctx.lineWidth=this.lineThickness,this.ctx.strokeStyle=this.lineColor?this.lineColor:"black",this.ctx.beginPath(),this.ctx.moveTo(this.lineCoordinates.x1,
this.lineCoordinates.y1),this.ctx.lineTo(this.lineCoordinates.x2,this.lineCoordinates.y2),this.ctx.stroke());else if(("left"===this._position||"right"===this._position)&&this.lineThickness)this.ctx.lineWidth=this.lineThickness,this.ctx.strokeStyle=this.lineColor,this.ctx.beginPath(),this.ctx.moveTo(this.lineCoordinates.x1,this.lineCoordinates.y1),this.ctx.lineTo(this.lineCoordinates.x2,this.lineCoordinates.y2),this.ctx.stroke()};x.prototype.getPixelCoordinatesOnAxis=function(a){var d={},b=this.lineCoordinates.width,
c=this.lineCoordinates.height;if("bottom"===this._position||"top"===this._position)b/=Math.abs(this.maximum-this.minimum),d.x=this.lineCoordinates.x1+b*(a-this.minimum),d.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)b=c/Math.abs(this.maximum-this.minimum),d.y=this.lineCoordinates.y2-b*(a-this.minimum),d.x=this.lineCoordinates.x2;return d};x.prototype.calculateValueToPixelConvertionParameters=function(){var a={pixelPerUnit:null,minimum:null,reference:null},d=this.lineCoordinates.width,
b=this.lineCoordinates.height;a.minimum=this.minimum;if("bottom"===this._position||"top"===this._position)a.pixelPerUnit=d/Math.abs(this.maximum-this.minimum),a.reference=this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)a.pixelPerUnit=-1*b/Math.abs(this.maximum-this.minimum),a.reference=this.lineCoordinates.y2;this.convertionParameters=a};x.prototype.calculateAxisParameters=function(){var a=this.chart.layoutManager.getFreeSpace();"bottom"===this._position||"top"===this._position?
(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?500>this.maxWidth?8:Math.max(6,Math.floor(this.maxWidth/62)):Math.floor(this.maxWidth/40),d,b,c,e;"axisX"===this.type?(d=null!==this.sessionVariables.internalMinimum?this.sessionVariables.internalMinimum:this.dataInfo.viewPortMin,b=null!==this.sessionVariables.internalMaximum?this.sessionVariables.internalMaximum:this.dataInfo.viewPortMax,0===b-d&&(b+=1),c=Infinity!==this.dataInfo.minDiff?
this.dataInfo.minDiff:1):"axisY"===this.type&&(d="undefined"===typeof this._options.minimum?this.dataInfo.viewPortMin:this._options.minimum,b="undefined"===typeof this._options.maximum?this.dataInfo.viewPortMax:this._options.maximum,0===b-d?(b+=5,d-=5):(0!==b&&(b+=Math.abs(0.05)),0!==d&&(d-=Math.abs(0.05))),this.includeZero&&"undefined"===typeof this._options.minimum&&0<d&&(d=0),this.includeZero&&"undefined"===typeof this._options.maximum&&0>b&&(b=0));"axisX"===this.type&&"dateTime"===this.chart.plotInfo.axisXValueType?
(e=b-d,this.intervalType||(e/1<=a?(this.interval=1,this.intervalType="millisecond"):e/2<=a?(this.interval=2,this.intervalType="millisecond"):e/5<=a?(this.interval=5,this.intervalType="millisecond"):e/10<=a?(this.interval=10,this.intervalType="millisecond"):e/20<=a?(this.interval=20,this.intervalType="millisecond"):e/50<=a?(this.interval=50,this.intervalType="millisecond"):e/100<=a?(this.interval=100,this.intervalType="millisecond"):e/200<=a?(this.interval=200,this.intervalType="millisecond"):e/250<=
a?(this.interval=250,this.intervalType="millisecond"):e/300<=a?(this.interval=300,this.intervalType="millisecond"):e/400<=a?(this.interval=400,this.intervalType="millisecond"):e/500<=a?(this.interval=500,this.intervalType="millisecond"):e/(1*y.secondDuration)<=a?(this.interval=1,this.intervalType="second"):e/(2*y.secondDuration)<=a?(this.interval=2,this.intervalType="second"):e/(5*y.secondDuration)<=a?(this.interval=5,this.intervalType="second"):e/(10*y.secondDuration)<=a?(this.interval=10,this.intervalType=
"second"):e/(15*y.secondDuration)<=a?(this.interval=15,this.intervalType="second"):e/(20*y.secondDuration)<=a?(this.interval=20,this.intervalType="second"):e/(30*y.secondDuration)<=a?(this.interval=30,this.intervalType="second"):e/(1*y.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):e/(2*y.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):e/(5*y.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):e/(10*y.minuteDuration)<=a?(this.interval=10,this.intervalType=
"minute"):e/(15*y.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):e/(20*y.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):e/(30*y.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):e/(1*y.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):e/(2*y.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):e/(3*y.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):e/(6*y.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):e/(1*
y.dayDuration)<=a?(this.interval=1,this.intervalType="day"):e/(2*y.dayDuration)<=a?(this.interval=2,this.intervalType="day"):e/(4*y.dayDuration)<=a?(this.interval=4,this.intervalType="day"):e/(1*y.weekDuration)<=a?(this.interval=1,this.intervalType="week"):e/(2*y.weekDuration)<=a?(this.interval=2,this.intervalType="week"):e/(3*y.weekDuration)<=a?(this.interval=3,this.intervalType="week"):e/(1*y.monthDuration)<=a?(this.interval=1,this.intervalType="month"):e/(2*y.monthDuration)<=a?(this.interval=2,
this.intervalType="month"):e/(3*y.monthDuration)<=a?(this.interval=3,this.intervalType="month"):e/(6*y.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=e/(1*y.yearDuration)<=a?1:e/(2*y.yearDuration)<=a?2:e/(4*y.yearDuration)<=a?4:Math.floor(x.getNiceNumber(e/(a-1),!0)/y.yearDuration),this.intervalType="year")),this.minimum=null!==this.sessionVariables.internalMinimum?this.sessionVariables.internalMinimum:d-c/2,this.maximum=this.sessionVariables.internalMaximum?this.sessionVariables.internalMaximum:
b+c/2,this.valueFormatString||("year"===this.intervalType?this.valueFormatString="YYYY":"month"===this.intervalType?this.valueFormatString="MMM YYYY":"week"===this.intervalType?this.valueFormatString="MMM DD YYYY":"day"===this.intervalType?this.valueFormatString="MMM DD YYYY":"hour"===this.intervalType?this.valueFormatString="hh:mm TT":"minute"===this.intervalType?this.valueFormatString="hh:mm TT":"second"===this.intervalType?this.valueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&
(this.valueFormatString="f'ms'")),this.intervalStartPosition=this.getLabelStartPoint(new Date(this.minimum),this.intervalType,this.interval)):(this.intervalType="number",e=x.getNiceNumber(b-d,!1),this.interval=this._options&&this._options.interval?this._options.interval:x.getNiceNumber(e/(a-1),!0),this.minimum=null!==this.sessionVariables.internalMinimum?this.sessionVariables.internalMinimum:Math.floor(d/this.interval)*this.interval,this.maximum=null!==this.sessionVariables.internalMaximum?this.sessionVariables.internalMaximum:
Math.ceil(b/this.interval)*this.interval,"axisX"===this.type?(null===this.sessionVariables.internalMinimum&&(this.minimum=d-c/2),this.sessionVariables.internalMaximum||(this.maximum=b+c/2),this.intervalStartPosition=Math.floor((this.minimum+this.interval)/this.interval)*this.interval):"axisY"===this.type&&(this.intervalStartPosition=this.minimum));"axisX"===this.type&&(this._absoluteMinimum=this._options&&"undefined"!==typeof this._options.minimum?this._options.minimum:this.dataInfo.min-c/2,this._absoluteMaximum=
this._options&&"undefined"!==typeof this._options.maximum?this._options.maximum:this.dataInfo.max+c/2);if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",e=Math.abs(this.maximum-this.minimum),1>e&&(d=Math.floor(Math.abs(Math.log(e)/Math.LN10))+2,2<d)))for(b=0;b<d-2;b++)this.valueFormatString+="#"};x.prototype._getFontString=function(){return this.labelFontStyle+" "+this.labelFontWeight+" "+this.labelFontSize+"px "+this.labelFontFamily};x.getNiceNumber=function(a,d){var b=Math.floor(Math.log(a)/
Math.LN10),c=a/Math.pow(10,b);return(d?1.5>c?1:3>c?2:7>c?5:10:1>=c?1:2>=c?2:5>=c?5:10)*Math.pow(10,b)};x.prototype.getLabelStartPoint=function(){var a=M(this.interval,this.intervalType),a=new Date(Math.floor(this.minimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0<a.getMilliseconds()&&(a.setSeconds(a.getSeconds()+1),a.setMilliseconds(0));else if("minute"===this.intervalType){if(0<a.getSeconds()||0<a.getMilliseconds())a.setMinutes(a.getMinutes()+1),a.setSeconds(0),
a.setMilliseconds(0)}else if("hour"===this.intervalType){if(0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setHours(a.getHours()+1),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("day"===this.intervalType){if(0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("week"===this.intervalType){if(0<a.getDay()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||
0<a.getMilliseconds())a.setDate(a.getDate()+(7-a.getDay())),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("month"===this.intervalType){if(1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("year"===this.intervalType&&(0<a.getMonth()||1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds()))a.setFullYear(a.getFullYear()+
1),a.setMonth(0),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0);return a};K(I,G);I.prototype._initialize=function(){if(this.enabled){this.container=document.createElement("div");this.container.style.height="auto";this.container.style.position="absolute";this.container.style.boxShadow="1px 1px 2px 2px rgba(0,0,0,0.1)";this.container.style.zIndex="1000";this.container.style.display="none";var a;a='<div style=" width: auto;height: auto;min-width: 50px;';a+="line-height: 20px;";
a+="padding: 5px;";a+="font-family: Calibri, Arial, Georgia, serif;";a+="font-weight: 400;";a+="font-style: italic;";a+="font-size: 14px;";a+="color: #000000;";a+="text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);";a+="text-align: left;";a+="border: 2px solid gray;";a+="background: rgba(255,255,255,.9);";a+="text-indent: 0px;";a+="white-space: nowrap;";a+="border-radius: 10px;";a+='} "> Sample Tooltip</div>';this.container.innerHTML=a;this.contentDiv=this.container.firstChild;this.container.style.borderRadius=
this.contentDiv.style.borderRadius;this.chart._canvasJSContainer.appendChild(this.container)}};I.prototype.mouseMoveHandler=function(a,d){var b=this;clearTimeout(this._timerId);this._timerId=setTimeout(function(){b._updateToolTip(a,d)},5)};I.prototype._updateToolTip=function(a,d){if("undefined"===typeof a||"undefined"===typeof d){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;d=this._prevY}else this._prevX=a,this._prevY=d;var b=null,c=null,e=[],f=0;if(this.shared){f="xySwapped"===
this.chart.plotInfo.axisPlacement?(this.chart.axisX.maximum-this.chart.axisX.minimum)/this.chart.axisX.lineCoordinates.height*(this.chart.axisX.lineCoordinates.y2-d)+this.chart.axisX.minimum:(this.chart.axisX.maximum-this.chart.axisX.minimum)/this.chart.axisX.lineCoordinates.width*(a-this.chart.axisX.lineCoordinates.x1)+this.chart.axisX.minimum;b=[];for(c=0;c<this.chart.data.length;c++)if(g={},(g=this.chart.data[c].findDataPointByX(f,!0))&&0<=g.index)g.dataSeries=this.chart.data[c],b.push(g);if(0===
b.length)return;b.sort(function(a,b){return a.distance-b.distance});f=b[0];for(c=0;c<b.length;c++)b[c].dataPoint.x.valueOf()===f.dataPoint.x.valueOf()&&e.push(b[c]);b=null}else{g=this.chart._eventManager.ghostCtx.getImageData(a,d,2,2).data;b=!0;for(c=0;4>c;c++)if(g[c]!==g[c+4]|g[c]!==g[c+8]|g[c]!==g[c+12]){b=!1;break}g=b?g[0]<<16|g[1]<<8|g[2]:0;0<g&&"undefined"!==typeof this.chart._eventManager.objectMap[g]?(eventObject=this.chart._eventManager.objectMap[g],this.currentSeriesIndex=eventObject.dataSeriesIndex,
this.currentDataPointIndex=0<=eventObject.dataPointIndex?eventObject.dataPointIndex:-1):this.currentDataPointIndex=-1;if(0<=this.currentSeriesIndex){var c=this.chart.data[this.currentSeriesIndex],g={};if(0<=this.currentDataPointIndex)b=c.dataPoints[this.currentDataPointIndex],g.dataSeries=c,g.dataPoint=b,g.index=this.currentDataPointIndex,g.distance=Math.abs(b.x-f);else if("line"===c.type||"area"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type)f=(this.chart.axisX.maximum-this.chart.axisX.minimum)/
this.chart.axisX.lineCoordinates.width*(a-this.chart.axisX.lineCoordinates.x1)+this.chart.axisX.minimum.valueOf(),g=c.findDataPointByX(f,!0),g.dataSeries=c,this.currentDataPointIndex=g.index,b=g.dataPoint;else return;e.push(g)}}0<e.length&&(this.highlightObjects(e),f="",f=this.getToolTipInnerHTML({entries:e}),this.contentDiv.innerHTML=f,this.contentDiv.innerHTML=f,f=!1,"none"===this.container.style.display&&(f=!0,this.container.style.display="block"),this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=
this.contentDiv.style.borderColor=this.borderColor?this.borderColor:e[0].dataPoint.color?e[0].dataPoint.color:e[0].dataSeries.color?e[0].dataSeries.color:e[0].dataSeries._colorSet[e[0].index%e[0].dataSeries._colorSet.length],toolTipLeft="pie"===e[0].dataSeries.type||"doughnut"===e[0].dataSeries.type||"bar"===e[0].dataSeries.type||"stackedBar"===e[0].dataSeries.type||"stackedBar100"===e[0].dataSeries.type?a-10-this.container.clientWidth:this.chart.axisX.lineCoordinates.width/Math.abs(this.chart.axisX.maximum-
this.chart.axisX.minimum)*Math.abs(e[0].dataPoint.x-this.chart.axisX.minimum)+this.chart.axisX.lineCoordinates.x1+0.5-this.container.clientWidth<<0,toolTipLeft=0<toolTipLeft?toolTipLeft+"px":toolTipLeft+this.container.clientWidth+20+"px",e=1===e.length&&!this.shared&&("line"===e[0].dataSeries.type||"area"===e[0].dataSeries.type||"stackedArea"===e[0].dataSeries.type||"stackedArea100"===e[0].dataSeries.type)?e[0].dataSeries.axisY.lineCoordinates.y2-e[0].dataSeries.axisY.lineCoordinates.height/Math.abs(e[0].dataSeries.axisY.maximum-
e[0].dataSeries.axisY.minimum)*Math.abs(e[0].dataPoint.y-e[0].dataSeries.axisY.minimum)+0.5<<0:"bar"===e[0].dataSeries.type||"stackedBar"===e[0].dataSeries.type||"stackedBar100"===e[0].dataSeries.type?e[0].dataSeries.axisX.lineCoordinates.y2-e[0].dataSeries.axisX.lineCoordinates.height/Math.abs(e[0].dataSeries.axisX.maximum-e[0].dataSeries.axisX.minimum)*Math.abs(e[0].dataPoint.x-e[0].dataSeries.axisX.minimum)+0.5<<0:d,e=-e+10,0<e+this.container.clientHeight+5&&(e-=e+this.container.clientHeight+5-
0),this.container.style.left=toolTipLeft,this.container.style.bottom=e+"px",!this.animationEnabled||f?this.disableAnimation():this.enableAnimation())};I.prototype.highlightObjects=function(a){var d=this.chart.overlaidCanvasCtx;this.chart.resetOverlayedCanvas();var b=this.chart.getPlotArea();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();for(b=0;b<a.length;b++){var c=a[b];if((c=this.chart._eventManager.objectMap[c.dataSeries.dataPointIds[c.index]])&&c.objectType&&"dataPoint"===c.objectType){var e=
this.chart.data[c.dataSeriesIndex],f=c.dataPointIndex;if("line"===e.type||"scatter"===e.type||"area"===e.type||"stackedArea"===e.type||"stackedArea100"===e.type)e=e.getMarkerProperties(f,c.x1,c.y1,this.chart.overlaidCanvasCtx),e.size=Math.max(1.5*e.size<<0,10),H.drawMarkers([e]);else if("bubble"===e.type)e=e.getMarkerProperties(f,c.x1,c.y1,this.chart.overlaidCanvasCtx),e.size=c.size,e.color="white",e.borderColor="white",d.globalAlpha=0.3,H.drawMarkers([e]),d.globalAlpha=1;else if("column"===e.type||
"stackedColumn"===e.type||"stackedColumn100"===e.type||"bar"===e.type||"stackedBar"===e.type||"stackedBar100"===e.type)d.globalAlpha=0.3,C(d,c.x1,c.y1,c.x2,c.y2,"white",!1,!1,!1,!1),d.globalAlpha=1;else if("pie"===e.type||"doughnut"===e.type)d.globalAlpha=0.3,L(d,c.center,c.radius,"white",e.type,c.startAngle,c.endAngle),d.globalAlpha=1}}d.globalAlpha=1;d.restore()};I.prototype.getToolTipInnerHTML=function(a){a=a.entries;for(var d="",b=null,c=null,e=0,f="",g=!0,k=0;k<a.length;k++)if(a[k].dataSeries.toolTipContent||
a[k].dataPoint.toolTipContent){g=!1;break}if(g&&this.content&&"function"===typeof this.content)d=this.content({entries:a});else if(1<a.length)for(k=0;k<a.length;k++){b=a[k].dataSeries;c=a[k].dataPoint;e=a[k].index;f="";0===k&&(g&&!this.content)&&(f+="undefined"!==typeof this.chart.axisX.labels[c.x]?this.chart.axisX.labels[c.x]:"{x}",f+="</br>");if("line"===b.type||"area"===b.type||"column"===b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100"===b.type||"stackedBar"===
b.type||"stackedBar100"===b.type||"stackedArea"===b.type||"stackedArea100"===b.type)f+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>{name}:</span>&nbsp;&nbsp;{y}";else if("bubble"===b.type)f+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>{name}:</span>&nbsp;&nbsp;{y}, &nbsp;&nbsp;{z}";
else if("pie"===b.type||"doughnut"===b.type)f+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"&nbsp;&nbsp;{y}";d+=this.chart.replaceKeywordsWithValue(f,c,b,e);k<a.length-1&&(d+="</br>")}else{b=a[0].dataSeries;c=a[0].dataPoint;e=a[0].index;if("line"===b.type||"area"===b.type||"column"===b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100"===b.type||"stackedBar"===b.type||"stackedBar100"===
b.type||"stackedArea"===b.type||"stackedArea100"===b.type)f=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>"+(c.label?"{label}":"{x}")+" :</span>&nbsp;&nbsp;{y}";else if("bubble"===b.type)f=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>"+(c.label?"{label}":"{x}")+":</span>&nbsp;&nbsp;{y}, &nbsp;&nbsp;{z}";
else if("pie"===b.type||"doughnut"===b.type)f=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:(c.name?"{name}:&nbsp;&nbsp;":c.label?"{label}:&nbsp;&nbsp;":"")+"{y}";d+=this.chart.replaceKeywordsWithValue(f,c,b,e)}return d};I.prototype.enableAnimation=function(){this.container.style.WebkitTransition||(this.container.style.WebkitTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.MozTransition="left .2s ease-out, bottom .2s ease-out",
this.container.style.MsTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.transition="left .2s ease-out, bottom .2s ease-out")};I.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition="",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};I.prototype.hide=function(){this.container.style.display="none";this.currentSeriesIndex=-1;this._prevY=this._prevX=NaN;
this.chart.resetOverlayedCanvas()};t.prototype.replaceKeywordsWithValue=function(a,d,b,c){var e=this;return a.replace(/\{\s*[a-zA-Z]+\s*\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1,a.length-1);a=N(a.slice(1,a.length-1));var g=null;if("color"===a)return d.color?d.color:b.color?b.color:b._colorSet[c%b._colorSet.length];if(d.hasOwnProperty(a))g=d;else if(b.hasOwnProperty(a))g=b;else return"";return"x"===a?e.axisX&&"dateTime"===
e.plotInfo.axisXValueType?W(g[a],d.xValueFormatString?d.xValueFormatString:b.xValueFormatString?b.xValueFormatString:e.axisX.valueFormatString?e.axisX.valueFormatString:"DD MM YY"):X(g[a],d.xValueFormatString?d.xValueFormatString:b.xValueFormatString?b.xValueFormatString:"#,##0.##"):"y"===a?X(g[a],d.xValueFormatString?d.xValueFormatString:b.xValueFormatString?b.xValueFormatString:"#,###.##"):g[a]})};Q.prototype.reset=function(){this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=
[];this.previousDataPointEventObject=null;this.ghostCtx.clearRect(0,0,this.ghostCanvas.width,this.ghostCanvas.height);this.ghostCtx.beginPath()};Q.prototype.getNewObjectTrackingId=function(){return++this.lastObjectId};Q.prototype.mouseEventHandler=function(a){if(!("mousemove"!==a.type&&"click"!==a.type)){var d=null,b=null,c=null,e=-1,f=!1,g=!1,k=ca(a),b=this.ghostCtx.getImageData(k.x,k.y,1,1).data;if(240<b[3])if(b=b[0]<<16|b[1]<<8|b[2],"undefined"!==typeof this.objectMap[b]&&"dataPoint"===this.objectMap[b].objectType){d=
this.objectMap[b];b=this.chart.data[d.dataSeriesIndex];c=b.dataPoints[d.dataPointIndex];e=d.dataPointIndex;if(null===this.previousDataPointEventObject||this.previousDataPointEventObject.dataSeriesIndex!==d.dataSeriesIndex||this.previousDataPointEventObject.dataPointIndex!==d.dataPointIndex)if(this.previousDataPointEventObject&&(f=!0),c.mouseover&&c.mouseover.call(c,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,dataPointIndex:e}),b.mouseover&&(null===this.previousDataPointEventObject||this.previousDataPointEventObject.dataSeriesIndex!==
d.dataSeriesIndex))b.mouseover&&b.mouseover.call(b,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,dataPointIndex:e}),this.previousDataPointEventObject&&(g=!0);"mousemove"===a.type?(c.mousemove&&c.mousemove.call(c,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,dataPointIndex:e}),b.mousemove&&b.mousemove.call(b,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,dataPointIndex:e})):"click"===a.type&&(c.click&&c.click.call(c,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,dataPointIndex:e}),b.click&&b.click.call(b,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,
dataPointIndex:e}),this.chart.pieDoughnutClickHandler&&this.chart.pieDoughnutClickHandler.call(b,{x:k.x,y:k.y,dataPoint:c,dataSeries:b,dataPointIndex:e}))}else this.previousDataPointEventObject&&(g=f=!0);else this.previousDataPointEventObject&&(g=f=!0);if(f||g)a=this.chart.data[this.previousDataPointEventObject.dataSeriesIndex],b=a.dataPoints[this.previousDataPointEventObject.dataPointIndex],c=this.previousDataPointEventObject.dataPointIndex,f&&b.mouseout&&b.mouseout.call(b,{x:k.x,y:k.y,dataPoint:b,
dataSeries:a,dataPointIndex:c}),g&&a.mouseout&&a.mouseout.call(a,{x:k.x,y:k.y,dataPoint:b,dataSeries:a,dataPointIndex:c});this.previousDataPointEventObject=d}};var H={drawMarker:function(a,d,b,c,e,f,g,k){if(b){var h=1;b.fillStyle=f?f:"#000000";b.strokeStyle=g?g:"#000000";b.lineWidth=k?k:0;"circle"===c?(b.beginPath(),b.arc(a,d,e/2,0,360,!1),f&&b.fill(),k&&(g?b.stroke():(h=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=h))):"square"===c?(b.beginPath(),b.rect(a-e/2,d-
e/2,e,e),f&&b.fill(),k&&(g?b.stroke():(h=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=h))):"triangle"===c?(b.beginPath(),b.moveTo(a-e/2,d+e/2),b.lineTo(a+e/2,d+e/2),b.lineTo(a,d-e/2),b.closePath(),f&&b.fill(),k&&(g?b.stroke():(h=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=h))):"cross"===c&&(b.strokeStyle=f,b.lineWidth=e/4,b.beginPath(),b.moveTo(a-e/2,d-e/2),b.lineTo(a+e/2,d+e/2),b.stroke(),b.moveTo(a+e/2,d-e/2),b.lineTo(a-e/2,
d+e/2),b.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var b=a[d];H.drawMarker(b.x,b.y,b.ctx,b.type,b.size,b.color,b.borderColor,b.borderThickness)}}},da={Chart:function(a,d){var b=new t(a,d,this);this.render=function(){b.render()};this.options=b._options},addColorSet:function(a,d){P[a]=d}};da.Chart.version="1.0.2";window.CanvasJS=da})();