/* CanvasJS HTML5 & JavaScript Charts - v2.0 GA - https://canvasjs.com/ Copyright 2017 fenopix --------------------- License Information -------------------- CanvasJS is a commercial product which requires purchase of license. Without a commercial license you can use it for evaluation purposes for upto 30 days. Please refer to the following link for further details. https://canvasjs.com/license-canvasjs/ */ (function(){function pa(m,s){m.prototype=$a(s.prototype);m.prototype.constructor=m;m.base=s.prototype}function $a(m){function s(){}s.prototype=m;return new s}function Ta(m,s,q){"millisecond"===q?m.setMilliseconds(m.getMilliseconds()+1*s):"second"===q?m.setSeconds(m.getSeconds()+1*s):"minute"===q?m.setMinutes(m.getMinutes()+1*s):"hour"===q?m.setHours(m.getHours()+1*s):"day"===q?m.setDate(m.getDate()+1*s):"week"===q?m.setDate(m.getDate()+7*s):"month"===q?m.setMonth(m.getMonth()+1*s):"year"===q&&m.setFullYear(m.getFullYear()+ 1*s);return m}function ia(m,s){var q=!1;0>m&&(q=!0,m*=-1);m=""+m;for(s=s?s:1;m.length>16).toString(16),q=((m&65280)>>8).toString(16);m=((m&255)>>0).toString(16);s=2>s.length?"0"+s:s;q=2>q.length?"0"+q:q;m=2>m.length?"0"+m:m;return"#"+s+q+m}function ab(m,s){var q=this.length>>>0,v=Number(s)||0,v=0>v?Math.ceil(v):Math.floor(v); for(0>v&&(v+=q);vq;q++)if(m[q]!==m[q+4]|m[q]!==m[q+8]|m[q]!==m[q+12]){s=!1;break}return s?m[0]<<16|m[1]<<8|m[2]:0}function na(m,s,q){return m in s?s[m]:q[m]}function Ha(m,s,q){if(v&&Xa){var y=m.getContext("2d");La=y.webkitBackingStorePixelRatio||y.mozBackingStorePixelRatio||y.msBackingStorePixelRatio||y.oBackingStorePixelRatio||y.backingStorePixelRatio||1;ha=Qa/La;m.width=s*ha;m.height=q*ha;Qa!==La&&(m.style.width=s+"px",m.style.height=q+"px",y.scale(ha,ha))}else m.width=s,m.height=q}function cb(m){if(!Ya){var s= !1,q=!1;"undefined"===typeof sa.Chart.creditHref?(m.creditHref=ka("iuuqr;..b`ow`rkr/bnl."),m.creditText=ka("B`ow`rKR/bnl")):(s=m.updateOption("creditText"),q=m.updateOption("creditHref"));if(m.creditHref&&m.creditText){m._creditLink||(m._creditLink=document.createElement("a"),m._creditLink.setAttribute("class","canvasjs-chart-credit"),m._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:2px;top:"+(m.height-14)+"px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"), m._creditLink.setAttribute("tabIndex",-1),m._creditLink.setAttribute("target","_blank"));if(0===m.renderCount||s||q)m._creditLink.setAttribute("href",m.creditHref),m._creditLink.innerHTML=m.creditText;m._creditLink&&m.creditHref&&m.creditText?(m._creditLink.parentElement||m._canvasJSContainer.appendChild(m._creditLink),m._creditLink.style.top=m.height-14+"px"):m._creditLink.parentElement&&m._canvasJSContainer.removeChild(m._creditLink)}}}function ua(m,s){var q=document.createElement("canvas");q.setAttribute("class", "canvasjs-chart-canvas");Ha(q,m,s);v||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(q);return q}function qa(m,s,q){for(var v in q)s.style[v]=q[v]}function va(m,s,q){s.getAttribute("state")||(s.style.backgroundColor=m.toolbar.backgroundColor,s.style.color=m.toolbar.fontColor,s.style.border="none",qa(m,s,{WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}));s.getAttribute("state")!==q&&(s.setAttribute("state",q),s.setAttribute("type","button"), qa(m,s,{padding:"5px 12px",cursor:"pointer","float":"left",width:"40px",height:"25px",outline:"0px",verticalAlign:"baseline",lineHeight:"0"}),s.setAttribute("title",m._cultureInfo[q+"Text"]),s.innerHTML=""+m._cultureInfo[q+"Text"]+"")}function Ma(){for(var m=null,s=0;sH?"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 U?"UTC":(String(Q).match(x)||[""]).pop().replace(z,"");case "z":return(0m?!0: !1;v&&(m*=-1);var y=q?q.decimalSeparator:".",x=q?q.digitGroupSeparator:",",z="";s=String(s);var z=1,Q=q="",C=-1,P=[],G=[],O=0,R=0,U=0,N=!1,Z=0,Q=s.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);s=null;for(var V=0;Q&&VC)C=V;else{if("%"===s)z*=100;else if("\u2030"===s){z*=1E3;continue}else if(","===s[0]&&"."===s[s.length-1]){z/=Math.pow(1E3,s.length-1);C=V+s.length-1;continue}else"E"!==s[0]&&"e"!==s[0]||"0"!==s[s.length-1]||(N=!0);0>C?(P.push(s),"#"===s|| "0"===s?O++:","===s&&U++):(G.push(s),"#"!==s&&"0"!==s||R++)}N&&(s=Math.floor(m),Q=-Math.floor(Math.log(m)/Math.LN10+1),Z=0===m?0:0===s?-(O+Q):String(s).length-O,z/=Math.pow(10,Z));0>C&&(C=V);z=(m*z).toFixed(R);s=z.split(".");z=(s[0]+"").split("");m=(s[1]+"").split("");z&&"0"===z[0]&&z.shift();for(N=Q=V=R=C=0;0Z?s.replace("+","").replace("-",""):s.replace("-",""),q+=s.replace(/[0]+/,function(m){return ia(Z,m.length)}));x="";for(P=!1;0Z?s.replace("+","").replace("-",""):s.replace("-",""),x+=s.replace(/[0]+/,function(m){return ia(Z,m.length)}));q+=(P?y:"")+x;return v?"-"+q:q},Oa=function(m){var s=0,q=0;m=m||window.event;m.offsetX||0===m.offsetX?(s=m.offsetX,q=m.offsetY): m.layerX||0==m.layerX?(s=m.layerX,q=m.layerY):(s=m.pageX-m.target.offsetLeft,q=m.pageY-m.target.offsetTop);return{x:s,y:q}},Xa=!0,Qa=window.devicePixelRatio||1,La=1,ha=Xa?Qa/La:1,ka=function(m){for(var s="",q=0;qs)x=z-1;else break}v>s&&1z&&(G=v.pop(),y-=G.height,x=Q)}this._wrappedText={lines:v,width:x,height:y};this.width=x+(this.leftPadding+this.rightPadding); this.height=y+(this.topPadding+this.bottomPadding);this.ctx.font=q};la.prototype._getFontString=function(){var m;m=""+(this.fontStyle?this.fontStyle+" ":"");m+=this.fontWeight?this.fontWeight+" ":"";m+=this.fontSize?this.fontSize+"px ":"";var s=this.fontFamily?this.fontFamily+"":"";!v&&s&&(s=s.split(",")[0],"'"!==s[0]&&'"'!==s[0]&&(s="'"+s+"'"));return m+=s};pa(Ra,X);pa(Ia,X);Ia.prototype.render=function(){if(this.text){var m=this.dockInsidePlotArea?this.chart.plotArea:this.chart,v=m.layoutManager.getFreeSpace(), q=v.x1,x=v.y1,z=0,G=0,R=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,Q,C;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=v.width-4-R*("center"===this.horizontalAlign?2:1)),G=0.5*v.height-this.margin-2,z=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=v.height-4),G=0.5*v.width-this.margin-2):"center"===this.horizontalAlign&&(null=== this.maxWidth&&(this.maxWidth=v.width-4),G=0.5*v.height-4));var P;y(this.padding)||"number"!==typeof this.padding?y(this.padding)||"object"!==typeof this.padding||(P=this.padding.top?this.padding.top:this.padding.bottom?this.padding.bottom:0,P+=this.padding.bottom?this.padding.bottom:this.padding.top?this.padding.top:0,P*=1.25):P=2.5*this.padding;this.wrap||(G=Math.min(G,Math.max(1.5*this.fontSize,this.fontSize+P)));G=new la(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:this.maxWidth,maxHeight:G,cornerRadius:this.cornerRadius,text:this.text,padding:this.padding,textBaseline:"top"});P=G.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(x=v.y1+2,C="top"):"bottom"===this.verticalAlign&& (x=v.y2-2-P.height,C="bottom"),"left"===this.horizontalAlign?q=v.x1+2:"center"===this.horizontalAlign?q=v.x1+v.width/2-P.width/2:"right"===this.horizontalAlign&&(q=v.x2-2-P.width-R),Q=this.horizontalAlign,this.width=P.width,this.height=P.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?(q=v.x1+2,x=v.y2-2-(this.maxWidth/2-P.width/2),z=-90,C="left",this.width=P.height,this.height=P.width):"right"===this.horizontalAlign?(q=v.x2-2,x=v.y1+2+(this.maxWidth/2-P.width/2),z=90,C="right", this.width=P.height,this.height=P.width):"center"===this.horizontalAlign&&(x=m.y1+(m.height/2-P.height/2),q=m.x1+(m.width/2-P.width/2),C="center",this.width=P.width,this.height=P.height),Q="center");G.x=q;G.y=x;G.angle=z;G.horizontalAlign=Q;G.render(!0);m.layoutManager.registerSpace(C,{width:this.width+("left"===C||"right"===C?this.margin+2:0),height:this.height+("top"===C||"bottom"===C?this.margin+2:0)});this.bounds={x1:q,y1:x,x2:q+this.width,y2:x+this.height};this.ctx.textBaseline="top"}};pa(Na, X);Na.prototype.render=Ia.prototype.render;pa(Ja,X);x={addTheme:function(m,v){ya[m]=v},addColorSet:function(m,v){Aa[m]=v},addCultureInfo:function(m,v){Ka[m]=v},formatNumber:function(m,v,q){q=q||"en";if(Ka[q])return W(m,v||"#,##0.##",new Ja(q));throw"Unknown Culture Name";},formatDate:function(m,v,q){q=q||"en";if(Ka[q])return Ba(m,v||"DD MMM YYYY",new Ja(q));throw"Unknown Culture Name";}};window.CanvasJS=x;x.Chart=function(){function m(a,f){return a.x-f.x}function s(a,f,b){if(a&&f&&b){b=b+"."+f;var c= "image/"+f;a=a.toDataURL(c);var e=!1,g=document.createElement("a");g.download=b;g.href=a;if("undefined"!==typeof Blob&&new Blob){for(var h=a.replace(/^data:[a-z\/]*;base64,/,""),h=atob(h),l=new ArrayBuffer(h.length),l=new Uint8Array(l),t=0;t
Please right click on the image and save it to your device
"),f.document.close()}}}function q(a,f){f=f||{};this.theme=y(f.theme)||y(ya[f.theme])?"light1":f.theme;q.base.constructor.call(this,"Chart",null,f,null,null);var b=this;this._containerId=a;this._objectsInitialized=!1;this.overlaidCanvasCtx= this.ctx=null;this._indexLabels=[];this._panTimerId=0;this._lastTouchEventType="";this._lastTouchData=null;this.isAnimating=!1;this.renderCount=0;this.panEnabled=this.disableToolTip=this.animatedRender=!1;this._defaultCursor="default";this.plotArea={canvas:null,ctx:null,x1:0,y1:0,x2:0,y2:0,width:0,height:0};this._dataInRenderedOrder=[];if(this.container="string"===typeof this._containerId?document.getElementById(this._containerId):this._containerId){this.container.innerHTML="";var c=0,e=0,c=this.options.width? this.width:0a[g].x&&0 t?{x:a[l].x+t/3,y:a[l].y+c/3}:{x:a[l].x,y:a[l].y+c/9};l=e;g=0===l?0:l-1;h=l===a.length-1?l:l+1;c=Math.abs((a[h].x-a[g].x)/(0===a[l].x-a[g].x?0.01:a[l].x-a[g].x))*(f-1)/2+1;t=(a[h].x-a[g].x)/c;c=(a[h].y-a[g].y)/c;b[b.length]=a[l].x>a[g].x&&0t?{x:a[l].x-t/3,y:a[l].y-c/3}:{x:a[l].x,y:a[l].y-c/9};b[b.length]=a[e]}return b}function z(a,f,b,c,e,g,h,l,t,k){var r=0;k?(h.color=g,l.color=g):k=1;r=t?Math.abs(e-b):Math.abs(c-f);r=0this.labelAngle?this.labelAngle-= 180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360);this.options.scaleBreaks&&(this.scaleBreaks=new P(this.chart,this.options.scaleBreaks,++this.chart._eventManager.lastObjectId,this));this.stripLines=[];if(this.options.stripLines&&0=this._appliedBreaks[a+1].startValue&&(this._appliedBreaks[a].endValue=Math.max(this._appliedBreaks[a].endValue,this._appliedBreaks[a+1].endValue),window.console&&window.console.log("CanvasJS Error: Breaks "+a+" and "+(a+1)+" are overlapping."), this._appliedBreaks.splice(a,2),a--)}}function aa(a,f,b,c,e,g){aa.base.constructor.call(this,"Break",f,b,c,g);this.id=e;this.chart=a;this.ctx=this.chart.ctx;this.scaleBreaks=g;this.optionsName=f;this.isOptionsInArray=!0;this.type=b.type?this.type:g.type;this.fillOpacity=y(b.fillOpacity)?g.fillOpacity:this.fillOpacity;this.lineThickness=y(b.lineThickness)?g.lineThickness:this.lineThickness;this.color=b.color?this.color:g.color;this.lineColor=b.lineColor?this.lineColor:g.lineColor;this.lineDashType= b.lineDashType?this.lineDashType:g.lineDashType;!y(this.startValue)&&this.startValue.getTime&&(this.startValue=this.startValue.getTime());!y(this.endValue)&&this.endValue.getTime&&(this.endValue=this.endValue.getTime());"number"===typeof this.startValue&&("number"===typeof this.endValue&&this.endValue=navigator.userAgent.search("MSIE")&&qa(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))});N(this._zoomButton,"mouseout",function(){f||(qa(a,a._zoomButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&qa(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}))})}this._resetButton||(f=!1,wa(this._resetButton= document.createElement("button")),va(this,this._resetButton,"reset"),this._resetButton.style.borderRight=(this.exportEnabled?this.toolbar.borderThickness:0)+"px solid "+this.toolbar.borderColor,this._toolBar.appendChild(this._resetButton),N(this._resetButton,"touchstart",function(a){f=!0}),N(this._resetButton,"click",function(){a.toolTip.hide();a.zoomEnabled||a.panEnabled?(a.zoomEnabled=!0,a.panEnabled=!1,va(a,a._zoomButton,"pan"),a._defaultCursor="default",a.overlaidCanvas.style.cursor=a._defaultCursor): (a.zoomEnabled=!1,a.panEnabled=!1);if(a.sessionVariables.axisX)for(var c=0;c=navigator.userAgent.search("MSIE")&&qa(a,a._resetButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))}),N(this._resetButton,"mouseout",function(){f||(qa(a,a._resetButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"}),0>=navigator.userAgent.search("MSIE")&&qa(a,a._resetButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}))}), this.overlaidCanvas.style.cursor=a._defaultCursor);this.zoomEnabled||this.panEnabled||(this._zoomButton?(a._zoomButton.getAttribute("state")===a._cultureInfo.zoomText?(this.panEnabled=!0,this.zoomEnabled=!1):(this.zoomEnabled=!0,this.panEnabled=!1),Ma(a._zoomButton,a._resetButton)):(this.zoomEnabled=!0,this.panEnabled=!1))}else this.panEnabled=this.zoomEnabled=!1;this._menuButton?this.exportEnabled?Ma(this._menuButton):wa(this._menuButton):this.exportEnabled&&v&&(f=!1,this._menuButton=document.createElement("button"), va(this,this._menuButton,"menu"),this._toolBar.appendChild(this._menuButton),N(this._menuButton,"touchstart",function(a){f=!0}),N(this._menuButton,"click",function(){"none"!==a._dropdownMenu.style.display||a._dropDownCloseTime&&500>=(new Date).getTime()-a._dropDownCloseTime.getTime()||(a._dropdownMenu.style.display="block",a._menuButton.blur(),a._dropdownMenu.focus())},!0),N(this._menuButton,"mouseover",function(){f||(qa(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.fontColorOnHover}), 0>=navigator.userAgent.search("MSIE")&&qa(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"}))},!0),N(this._menuButton,"mouseout",function(){f||(qa(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor}),0>=navigator.userAgent.search("MSIE")&&qa(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"}))},!0));if(!this._dropdownMenu&&this.exportEnabled&&v){f=!1;this._dropdownMenu=document.createElement("div");this._dropdownMenu.setAttribute("tabindex", -1);var b=-1!==this.theme.indexOf("dark")?"black":"#888888";this._dropdownMenu.style.cssText="position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer;right: 0px;top: 25px;min-width: 120px;outline: 0;font-size: 14px; font-family: Arial, Helvetica, sans-serif;padding: 5px 0px 5px 0px;text-align: left;line-height: 10px;background-color:"+this.toolbar.backgroundColor+";box-shadow: 2px 2px 10px "+b;a._dropdownMenu.style.display="none"; this._toolBar.appendChild(this._dropdownMenu);N(this._dropdownMenu,"blur",function(){wa(a._dropdownMenu);a._dropDownCloseTime=new Date},!0);b=document.createElement("div");b.style.cssText="padding: 12px 8px 12px 8px";b.innerHTML=this._cultureInfo.printText;b.style.backgroundColor=this.toolbar.backgroundColor;b.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(b);N(b,"touchstart",function(a){f=!0});N(b,"mouseover",function(){f||(this.style.backgroundColor=a.toolbar.backgroundColorOnHover, this.style.color=a.toolbar.fontColorOnHover)},!0);N(b,"mouseout",function(){f||(this.style.backgroundColor=a.toolbar.backgroundColor,this.style.color=a.toolbar.fontColor)},!0);N(b,"click",function(){a.print();wa(a._dropdownMenu)},!0);b=document.createElement("div");b.style.cssText="padding: 12px 8px 12px 8px";b.innerHTML=this._cultureInfo.saveJPGText;b.style.backgroundColor=this.toolbar.backgroundColor;b.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(b);N(b,"touchstart",function(a){f= !0});N(b,"mouseover",function(){f||(this.style.backgroundColor=a.toolbar.backgroundColorOnHover,this.style.color=a.toolbar.fontColorOnHover)},!0);N(b,"mouseout",function(){f||(this.style.backgroundColor=a.toolbar.backgroundColor,this.style.color=a.toolbar.fontColor)},!0);N(b,"click",function(){s(a.canvas,"jpeg",a.exportFileName);wa(a._dropdownMenu)},!0);b=document.createElement("div");b.style.cssText="padding: 12px 8px 12px 8px";b.innerHTML=this._cultureInfo.savePNGText;b.style.backgroundColor=this.toolbar.backgroundColor; b.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(b);N(b,"touchstart",function(a){f=!0});N(b,"mouseover",function(){f||(this.style.backgroundColor=a.toolbar.backgroundColorOnHover,this.style.color=a.toolbar.fontColorOnHover)},!0);N(b,"mouseout",function(){f||(this.style.backgroundColor=a.toolbar.backgroundColor,this.style.color=a.toolbar.fontColor)},!0);N(b,"click",function(){s(a.canvas,"png",a.exportFileName);wa(a._dropdownMenu)},!0)}"none"!==this._toolBar.style.display&&this._zoomButton&& (this.panEnabled?va(a,a._zoomButton,"zoom"):va(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&va(a,a._resetButton,"reset"));this.options.toolTip&&this.toolTip.options!==this.options.toolTip&&(this.toolTip.options=this.options.toolTip);for(var c in this.toolTip.options)this.toolTip.options.hasOwnProperty(c)&&this.toolTip.updateOption(c)};q.prototype._updateSize=function(){var a=0,f=0;this.options.width?a=this.width:this.width=a=0c.linkedDataSeriesIndex||c.linkedDataSeriesIndex>=this.options.data.length||"number"!==typeof c.linkedDataSeriesIndex||"error"===this.options.data[c.linkedDataSeriesIndex].type)&&(c.linkedDataSeriesIndex=null);null===c.name&&(c.name="DataSeries "+a);null===c.color?1a&&"undefined"!==typeof k.startTimePercent?a>=k.startTimePercent&&k.animationCallback(k.easingFunction(a-k.startTimePercent,0,1,1-k.startTimePercent),k):k.animationCallback(k.easingFunction(a,0,1,1),k); r.dispatchEvent("dataAnimationIterationEnd",{chart:r})},function(){c=[];for(var a=0;aa.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,g=!1,h=0;hb.max&&(b.max=c);ef.max&&"number"===typeof e&&(f.max=e);if(0w&&(w=1/w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-l.dataPoints[t-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);null!==e&&null!==l.dataPoints[t-1].y&&(a.axisY.logarithmic?(w=e/l.dataPoints[t-1].y,1>w&&(w=1/w),f.minDiff>w&&1!==w&&(f.minDiff=w)):(w=e-l.dataPoints[t-1].y,0>w&&(w*=-1),f.minDiff>w&&0!==w&&(f.minDiff=w)))}if(cd&& !r)r=!0;else if(c>d&&r)continue;l.dataPoints[t].label&&(a.axisX.labels[c]=l.dataPoints[t].label);cb.viewPortMax&&(b.viewPortMax=c);null===e?b.viewPortMin===c&&pf.viewPortMax&&"number"===typeof e&&(f.viewPortMax=e))}}l.axisX.valueType=l.xValueType=g?"dateTime":"number"}};q.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var f= a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,g=!1,h=[],l=[],t=Infinity,k=-Infinity,r=0;rb.max&&(b.max=c);if(0m&&(m=1/m);b.minDiff>m&&1!==m&&(b.minDiff=m)}else m=c-p.dataPoints[n-1].x,0>m&&(m*=-1),b.minDiff>m&&0!==m&&(b.minDiff=m);null!==e&&null!==p.dataPoints[n-1].y&&(a.axisY.logarithmic?0m&&(m=1/m),f.minDiff>m&&1!==m&&(f.minDiff=m)):(m=e-p.dataPoints[n-1].y,0>m&&(m*=-1),f.minDiff> m&&0!==m&&(f.minDiff=m)))}if(cu&&!w)w=!0;else if(c>u&&w)continue;p.dataPoints[n].label&&(a.axisX.labels[c]=p.dataPoints[n].label);cb.viewPortMax&&(b.viewPortMax=c);null===p.dataPoints[n].y?b.viewPortMin===c&&zaf.max&&(f.max=a),nb.viewPortMax||(af.viewPortMax&&(f.viewPortMax=a)));for(n in l)l.hasOwnProperty(n)&&!isNaN(n)&&(a=l[n],af.max&&(f.max=Math.max(a,k)),nb.viewPortMax||(af.viewPortMax&&(f.viewPortMax=Math.max(a,k))))}};q.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,g=!1,h=!1,l=!1,t=[],k=0;kb.max&&(b.max=c);if(0u&&(u=1/u);b.minDiff>u&&1!==u&&(b.minDiff=u)}else u=c-r.dataPoints[p-1].x,0>u&&(u*=-1),b.minDiff>u&&0!==u&&(b.minDiff=u);y(e)||null===r.dataPoints[p-1].y||(a.axisY.logarithmic?0u&&(u=1/u),f.minDiff>u&&1!==u&&(f.minDiff=u)):(u=e-r.dataPoints[p-1].y,0>u&&(u*=-1),f.minDiff>u&&0!==u&&(f.minDiff=u)))}if(cD&&!d)d=!0;else if(c> D&&d)continue;r.dataPoints[p].label&&(a.axisX.labels[c]=r.dataPoints[p].label);cb.viewPortMax&&(b.viewPortMax=c);null===e?b.viewPortMin===c&&we&&(l=!0),t[c]=t[c]?t[c]+Math.abs(e):Math.abs(e))}}r.axisX.valueType=r.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(f.max=y(f.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(f.viewPortMax,99*Math.pow(a.axisY.logarithmBase, -0.05)),f.min=y(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):h&&!l?(f.max=y(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=y(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):h&&l?(f.max=y(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=y(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99)):!h&&l&&(f.max=y(f.viewPortMax)?-1:Math.max(f.viewPortMax,-1),f.min=y(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99));f.viewPortMin=f.min;f.viewPortMax=f.max;a.dataPointYSums=t}};q.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&& !(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,g,h,l=!1,t=0;tb.max&&(b.max=c);gf.max&&(f.max=h);0w&&(w=1/w),b.minDiff>w&&1!==w&&(b.minDiff=w)):(w=c-k.dataPoints[r-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w)),e&&(null!==e[0]&&k.dataPoints[r-1].y&&null!== k.dataPoints[r-1].y[0])&&(a.axisY.logarithmic?(w=e[0]/k.dataPoints[r-1].y[0],1>w&&(w=1/w),f.minDiff>w&&1!==w&&(f.minDiff=w)):(w=e[0]-k.dataPoints[r-1].y[0],0>w&&(w*=-1),f.minDiff>w&&0!==w&&(f.minDiff=w))));if(!(cu&&!n)n=!0;else if(c>u&&n)continue;k.dataPoints[r].label&&(a.axisX.labels[c]=k.dataPoints[r].label);cb.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&e)for(v=0;vf.viewPortMax&&(f.viewPortMax=h))}}k.axisX.valueType=k.xValueType=l?"dateTime":"number"}};q.prototype._processSpecificPlotUnit=function(a){if("waterfall"===a.type&&a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,e,g=!1,h=0;hb.max&&(b.max=c),l.dataPointEOs[t].cumulativeSumf.max&&(f.max=l.dataPointEOs[t].cumulativeSum),0p&&(p=1/p),b.minDiff>p&&1!==p&&(b.minDiff=p)):(p=c-l.dataPoints[t-1].x,0>p&& (p*=-1),b.minDiff>p&&0!==p&&(b.minDiff=p)),null!==e&&null!==l.dataPoints[t-1].y&&(a.axisY.logarithmic?(e=l.dataPointEOs[t].cumulativeSum/l.dataPointEOs[t-1].cumulativeSum,1>e&&(e=1/e),f.minDiff>e&&1!==e&&(f.minDiff=e)):(e=l.dataPointEOs[t].cumulativeSum-l.dataPointEOs[t-1].cumulativeSum,0>e&&(e*=-1),f.minDiff>e&&0!==e&&(f.minDiff=e)))),!(cd&&!r)r=!0;else if(c>d&&r)continue;l.dataPoints[t].label&&(a.axisX.labels[c]=l.dataPoints[t].label);cb.viewPortMax&&(b.viewPortMax=c);0f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[t-1].cumulativeSum));l.dataPointEOs[t].cumulativeSumf.viewPortMax&&(f.viewPortMax=l.dataPointEOs[t].cumulativeSum)}l.axisX.valueType=l.xValueType=g?"dateTime":"number"}}; q.prototype.calculateAutoBreaks=function(){function a(a,c,b,e){if(e)return b=Math.pow(Math.min(b*a/c,c/a),0.2),1>=b&&(b=Math.pow(1>a?1/a:Math.min(c/a,a),0.25)),{startValue:a*b,endValue:c/b};b=0.2*Math.min(b-c+a,c-a);0>=b&&(b=0.25*Math.min(c-a,Math.abs(a)));return{startValue:a+b,endValue:c-b}}function f(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){var c=a.axisX.scaleBreaks&&a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks,b=a.axisY.scaleBreaks&&a.axisY.scaleBreaks.autoCalculate&& 1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks;if(c||b)for(var f=a.axisY.dataInfo,g=a.axisX.dataInfo,k,h=g.min,n=g.max,l=f.min,t=f.max,g=g._dataRanges,f=f._dataRanges,p,r=0,m=0;mv.dataPoints.length))for(r=0;rg[p].max&&(g[p].max=k)),b){var s=(t+1-l)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((k="waterfall"===a.type?v.dataPointEOs[r].cumulativeSum:v.dataPoints[r].y)&&k.length)for(var q=0;qf[p].max&&(f[p].max=k[q]);else y(k)||(p=Math.floor((k-l)/s),kf[p].max&&(f[p].max=k))}}}}function b(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)&&a.axisX.scaleBreaks&& a.axisX.scaleBreaks.autoCalculate&&1<=a.axisX.scaleBreaks.maxNumberOfAutoBreaks)for(var c=a.axisX.dataInfo,b=c.min,f=c.max,g=c._dataRanges,k,h=0,n=0;nl.dataPoints.length))for(h=0;hg[k].max&&(g[k].max= c)}}for(var c,e=this,g=!1,h=0;hr[index].max&&(r[index].max=p)));delete this._axes[h].dataInfo.dataPointYPositiveSums}if(this._axes[h].dataInfo.dataPointYNegativeSums){n= this._axes[h].dataInfo.dataPointYNegativeSums;r=k;for(l in n)n.hasOwnProperty(l)&&!isNaN(l)&&(p=-1*n[l],y(p)||(index=Math.floor((p-t)/c),pr[index].max&&(r[index].max=p)));delete this._axes[h].dataInfo.dataPointYNegativeSums}for(l=0;lc&&g.push({diff:p,start:r,end:t});break}else l++;if(this._axes[h].scaleBreaks.customBreaks)for(l=0;l=e.x1&&(a<=e.x2&&f>=e.y1&&f<=e.y2)&&(c=e.id)}return c};q.prototype.getAutoFontSize=function(a,f,b){f=Math.min(this.width,this.height);return Math.max("theme4"===this.theme?0:300<=f?12:10,Math.round(f*(a/400)))};q.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};q.prototype.clearCanvas=function(){this.ctx.clearRect(0,0,this.width,this.height);this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.width,this.height))}; q.prototype.attachEvent=function(a){this._events.push(a)};q.prototype._touchEventHandler=function(a){if(a.changedTouches&&this.interactivityEnabled){var f=[],b=a.changedTouches,c=b?b[0]:a,e=null;switch(a.type){case "touchstart":case "MSPointerDown":f=["mousemove","mousedown"];this._lastTouchData=Oa(c);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":f=["mousemove"];break;case "touchend":case "MSPointerUp":f="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType? ["mouseup","click"]:["mouseup"];break;default:return}if(!(b&&1=e.x1&&f.x<=e.x2&&f.y>=e.y1&&f.y<=e.y2){c[b].call(c.context,f.x,f.y);"mousedown"===b&&!0===c.capture?(q.capturedEventParam=c,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler, !1)):"mouseup"===b&&(c.chart.overlaidCanvas.releaseCapture?c.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",this._mouseEventHandler,!1));break}else c=null;a.target.style.cursor=c&&c.cursor?c.cursor:this._defaultCursor}b=this.plotArea;if(f.xb.x2||f.yb.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};q.prototype._plotAreaMouseDown= function(a,f){this.isDrag=!0;this.dragStartPoint={x:a,y:f}};q.prototype._plotAreaMouseUp=function(a,f){if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var b=f-this.dragStartPoint.y,c=a-this.dragStartPoint.x,e=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),h=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=e,e=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(e=g=0;eb.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,h=!0):b.viewportMinimumb.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,h=!0);else if((!e||2Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,f);if((!e|| 2d)var w=d,d=n,n=w;if(p.scaleBreaks)for(w=0;!g&&w=d;if(isFinite(p.dataInfo.minDiff))if(w=p.getApparentDifference(n,d,null,!0),!(g||!(this.panEnabled&&p.scaleBreaks&&p.scaleBreaks._appliedBreaks.length)&&(p.logarithmic&&wp.maximum))t.push(p), r.push({val1:n,val2:d}),l=!0;else if(!e){l=!1;break}}return{isValid:l,axesWithValidRange:t,axesRanges:r}};q.prototype.preparePlotArea=function(){var a=this.plotArea;!v&&(0b.lineCoordinates.x2?f.x2:b.lineCoordinates.x2;a.y2=f.y2>f.y1?f.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0b.lineCoordinates.x2?f.x2:b.lineCoordinates.x2,a.y2=f.y2>f.y1?f.y2:b.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else f=this.layoutManager.getFreeSpace(), a.x1=f.x1,a.x2=f.x2,a.y1=f.y1,a.y2=f.y2,a.width=f.width,a.height=f.height;v||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0b.x2||k.point.yb.y2+1)continue}else if("rangearea"===r||"rangesplinearea"===r){if(k.dataPoint.xq.viewportMaximum||Math.max.apply(null,k.dataPoint.y)A.viewportMaximum)continue}else if(0<=r.indexOf("line")||0<=r.indexOf("area")||0<=r.indexOf("bubble")||0<=r.indexOf("scatter")){if(k.dataPoint.xq.viewportMaximum|| k.dataPoint.yA.viewportMaximum)continue}else if(0<=r.indexOf("column")||"waterfall"===r||"error"===r&&!k.axisSwapped){if(k.dataPoint.xq.viewportMaximum||k.bounds.y1>b.y2||k.bounds.y2q.viewportMaximum||k.bounds.x1>b.x2||k.bounds.x2 q.viewportMaximum||Math.max.apply(null,k.dataPoint.y)A.viewportMaximum)continue}else if(k.dataPoint.xq.viewportMaximum)continue;e=h=2;"horizontal"===S?(l=d.width,t=d.height):(t=d.width,l=d.height);if("normal"===this.plotInfo.axisPlacement){if(0<=r.indexOf("line")||0<=r.indexOf("area"))u="auto",h=4;else if(0<=r.indexOf("stacked"))"auto"===u&&(u="inside");else if("bubble"===r||"scatter"===r)u="inside";p=k.point.x- l/2;"inside"!==u?(e=b.y1,g=b.y2,0k.point.y)):(n=k.point.y+h+c,n>g-t-h-c&&(n="auto"===u?Math.min(k.point.y,g)-t-h-c:g-t-h-c,x=ng-t-h&&("bubble"===r||"scatter"===r)&&(n=Math.min(k.point.y+h,b.y2-t-h))),n=Math.min(n,g-t))}else 0<=r.indexOf("line")||0<=r.indexOf("area")||0<=r.indexOf("scatter")?(u="auto",e=4):0<=r.indexOf("stacked")?"auto"===u&&(u="inside"):"bubble"===r&&(u="inside"),n=k.point.y-t/2,"inside"!==u?(h=b.x1,g=b.x2,0>s?(p=k.point.x-l-e-c,pk.point.x)):(p=k.point.x+e+c,p>g-l-e-c&&(p="auto"=== u?Math.min(k.point.x,g)-l-e-c:g-l-e-c,x=ps?Math.max(k.bounds.x1,b.x1)+l/2+e:Math.min(k.bounds.x2,b.x2)-l/2-e:(Math.max(k.bounds.x1,b.x1)+Math.min(k.bounds.x2,b.x2))/2,p=0>s?Math.max(k.point.x,c)-l/2:Math.min(k.point.x,c)-l/2,p=Math.max(p,h));"vertical"===S&&(n+=t);d.x=p;d.y=n;d.render(!0);D&&("inside"!==u&&(0>r.indexOf("bar")&&("error"!==r||!k.axisSwapped)&&k.point.x>b.x1&&k.point.xr.indexOf("column")&&("error"!==r||k.axisSwapped)&&k.point.y>b.y1&&k.point.y=a.dataSeriesIndexes.length)){var c= this._eventManager.ghostCtx;b.save();var e=this.plotArea;b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();for(var g=[],h,l=0;la.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!s)))if("number"!==typeof r[u].y)0r[u].y===a.axisY.reversed?1:-1,color:w})}b.stroke();v&&c.stroke()}}ja.drawMarkers(g);v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop", a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}};q.prototype.renderStepLine=function(a){var f= a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var e=this.plotArea;b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();for(var g=[],h,l=0;la.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!s)))if("number"!==typeof r[u].y)0< u&&!(k.connectNullData||s||D)&&(b.stroke(),v&&c.stroke()),s=!0;else{var q=ca;S=a.axisX.convertValueToPixel(S);ca=a.axisY.convertValueToPixel(r[u].y);var A=k.dataPointIds[u];this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:t,dataPointIndex:u,x1:S,y1:ca};D||s?(!D&&k.connectNullData?(b.setLineDash&&(k.options.nullDataLineDashType||p===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(h.x,h.y),p=k.nullDataLineDashType,b.setLineDash(n)), b.lineTo(S,q),b.lineTo(S,ca),v&&(c.lineTo(S,q),c.lineTo(S,ca))):(b.beginPath(),b.moveTo(S,ca),v&&(c.beginPath(),c.moveTo(S,ca))),s=D=!1):(b.lineTo(S,q),v&&c.lineTo(S,q),b.lineTo(S,ca),v&&c.lineTo(S,ca),0==u%500&&(b.stroke(),b.beginPath(),b.moveTo(S,ca),v&&(c.stroke(),c.beginPath(),c.moveTo(S,ca))));h={x:S,y:ca};ur[u].y===a.axisY.reversed? 1:-1,color:w})}b.stroke();v&&c.stroke()}}ja.drawMarkers(g);v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),c.beginPath());b.restore();b.beginPath(); return{source:f,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}};q.prototype.renderSpline=function(a){function f(a){a=x(a,2);if(0=a.dataSeriesIndexes.length)){var e= this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var h=[],l=0;la.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!S)))if("number"!==typeof r[D].y)0r[D].y===a.axisY.reversed?1:-1,color:w});S=!1}f(q)}ja.drawMarkers(h); v&&(b.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(g.x1,g.y1,g.width,g.height),e.beginPath());c.restore();c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation, easingFunction:H.easing.linear,animationBase:0}}};var V=function(a,f,b,c,e,g,h,l,t,k,r,p,n){"undefined"===typeof n&&(n=1);h=h||0;l=l||"black";var d=15=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=0,h,l,t,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),g=this.dataPointMinWidth=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,r=this.dataPointMaxWidth=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth: Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth=this.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>r&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(p=r);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(r=0;ra.axisX.dataInfo.viewPortMax)&&"number"===typeof w[g].y){h=a.axisX.convertValueToPixel(t);l=a.axisY.convertValueToPixel(w[g].y);h=a.axisX.reversed?h+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:h-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+r)*p<<0;var D=a.axisX.reversed?h-p<<0:h+p<<0,u;0<=w[g].y?u=k:(u=l,l=k);l>u&&(c=l,l=u,u=c);c=w[g].color?w[g].color:d._colorSet[g%d._colorSet.length];V(b,h,l,D,u,c, 0,null,m&&0<=w[g].y,0>w[g].y&&m,!1,!1,d.fillOpacity);c=d.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:g,x1:h,y1:l,x2:D,y2:u};c=R(c);v&&V(this._eventManager.ghostCtx,h,l,D,u,c,0,null,!1,!1,!1,!1);(w[g].indexLabel||d.indexLabel||w[g].indexLabelFormatter||d.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:w[g],dataSeries:d,point:{x:h+(D-h)/2,y:0>w[g].y===a.axisY.reversed?l:u},direction:0>w[g].y===a.axisY.reversed? 1:-1,bounds:{x1:h,y1:Math.min(l,u),x2:D,y2:Math.max(l,u)},color:c})}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore()); b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.yScaleAnimation,easingFunction:H.easing.easeOutQuart,animationBase:ka.axisY.bounds.y2?a.axisY.bounds.y2:k}}};q.prototype.renderStackedColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=[],h=[],l=[],t=[],k=0,r,p,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k= this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var d=a.axisX.dataInfo.minDiff;isFinite(d)||(d=0.3*Math.abs(a.axisX.range));d=this.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(d)/Math.log(a.axisX.range):Math.abs(d)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>r&&(k=Math.min(this.dataPointWidth? this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(d=r);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var w=0;wa.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){r=a.axisX.convertValueToPixel(c);var s=r-a.plotType.plotUnits.length*d/2+a.index*d<<0,y=s+d<<0,B;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=u[k].y)t[c]=u[k].y+(t[c]?t[c]:0),B=a.axisY.convertValueToPixel(t[c]),p="undefined"!==typeof h[c]?h[c]:n,h[c]=B;else if(p=a.axisY.convertValueToPixel(u[k].y),0<=u[k].y){var A="undefined"!==typeof g[c]?g[c]:0;p-=A;B=n-A;g[c]=A+(B-p)}else A=h[c]?h[c]:0,B=p+A,p=n+A,h[c]=A+(B-p);c=u[k].color?u[k].color:D._colorSet[k%D._colorSet.length];V(b,s,p,y,B,c,0,null,q&&0<=u[k].y,0>u[k].y&&q,!1, !1,D.fillOpacity);c=D.dataPointIds[k];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:k,x1:s,y1:p,x2:y,y2:B};c=R(c);v&&V(this._eventManager.ghostCtx,s,p,y,B,c,0,null,!1,!1,!1,!1);(u[k].indexLabel||D.indexLabel||u[k].indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:u[k],dataSeries:D,point:{x:r,y:0<=u[k].y?p:B},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:s,y1:Math.min(p,B),x2:y,y2:Math.max(p, B)},color:c})}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx, animationCallback:H.yScaleAnimation,easingFunction:H.easing.easeOutQuart,animationBase:na.axisY.bounds.y2?a.axisY.bounds.y2:n}}};q.prototype.renderStackedColumn100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=[],h=[],l=[],t=[],k=0,r,p,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth? this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var d=a.axisX.dataInfo.minDiff;isFinite(d)||(d=0.3*Math.abs(a.axisX.range));d=this.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(d)/Math.log(a.axisX.range):Math.abs(d)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>r&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&& (this.dataPointMinWidth&&rr&&(d=r);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var w=0;wa.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){r=a.axisX.convertValueToPixel(c);p=0!==a.dataPointYSums[c]?100*(u[k].y/a.dataPointYSums[c]):0;var s=r-a.plotType.plotUnits.length*d/2+a.index*d<<0,y=s+d<<0,B;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=l[c])continue;p=a.axisY.convertValueToPixel(l[c]); B=g[c]?g[c]:n;g[c]=p}else if(a.axisY.scaleBreaks&&0=u[k].y)t[c]=p+("undefined"!==typeof t[c]?t[c]:0),B=a.axisY.convertValueToPixel(t[c]),p=h[c]?h[c]:n,h[c]=B;else if(p=a.axisY.convertValueToPixel(p),0<=u[k].y){var A="undefined"!==typeof g[c]?g[c]:0;p-=A;B=n-A;g[c]=A+(B-p)}else A="undefined"!==typeof h[c]?h[c]:0,B=p+A,p=n+A,h[c]=A+(B-p);c=u[k].color?u[k].color:D._colorSet[k%D._colorSet.length];V(b,s,p,y,B,c,0,null,q&&0<=u[k].y,0>u[k].y&&q,!1,!1,D.fillOpacity); c=D.dataPointIds[k];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:k,x1:s,y1:p,x2:y,y2:B};c=R(c);v&&V(this._eventManager.ghostCtx,s,p,y,B,c,0,null,!1,!1,!1,!1);(u[k].indexLabel||D.indexLabel||u[k].indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:u[k],dataSeries:D,point:{x:r,y:0<=u[k].y?p:B},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:s,y1:Math.min(p,B),x2:y,y2:Math.max(p,B)},color:c})}}v&& (f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.yScaleAnimation, easingFunction:H.easing.easeOutQuart,animationBase:na.axisY.bounds.y2?a.axisY.bounds.y2:n}}};q.prototype.renderBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=0,h,l,t,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,r=this.dataPointMaxWidth?this.dataPointMaxWidth: this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>r&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&& rr&&(p=r);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(r=0;ra.axisX.dataInfo.viewPortMax)&&"number"===typeof w[g].y){l=a.axisX.convertValueToPixel(t);h=a.axisY.convertValueToPixel(w[g].y);l=a.axisX.reversed?l+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:l-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+r)*p<<0;var D=a.axisX.reversed?l-p<<0:l+p<<0,u;0<=w[g].y?u=k:(u=h,h=k);c=w[g].color?w[g].color:d._colorSet[g%d._colorSet.length]; V(b,u,l,h,D,c,0,null,m,!1,!1,!1,d.fillOpacity);c=d.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:g,x1:u,y1:l,x2:h,y2:D};c=R(c);v&&V(this._eventManager.ghostCtx,u,l,h,D,c,0,null,!1,!1,!1,!1);(w[g].indexLabel||d.indexLabel||w[g].indexLabelFormatter||d.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:w[g],dataSeries:d,point:{x:0<=w[g].y?h:u,y:l+(D-l)/2},direction:0>w[g].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u, h),y1:l,x2:Math.max(u,h),y2:D},color:c})}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore(); return{source:f,dest:this.plotArea.ctx,animationCallback:H.xScaleAnimation,easingFunction:H.easing.easeOutQuart,animationBase:ka.axisY.bounds.x2?a.axisY.bounds.x2:k}}};q.prototype.renderStackedBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=[],h=[],l=[],t=[],k=0,r,p,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth? this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var d=a.axisX.dataInfo.minDiff;isFinite(d)||(d=0.3*Math.abs(a.axisX.range));d=this.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(d)/Math.log(a.axisX.range):Math.abs(d)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>p&&(k=Math.min(this.dataPointWidth?this.dataPointWidth: Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&pp&&(d=p);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var w=0;wa.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){p=a.axisX.convertValueToPixel(c);var s=p-a.plotType.plotUnits.length*d/2+a.index*d<<0,y=s+d<<0,B;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=u[k].y)t[c]=u[k].y+(t[c]?t[c]:0),r=h[c]?h[c]:n,h[c]=B=a.axisY.convertValueToPixel(t[c]);else if(r=a.axisY.convertValueToPixel(u[k].y),0<=u[k].y){var A=g[c]?g[c]:0;B=n+A;r+=A;g[c]=A+(r-B)}else A=h[c]?h[c]:0,B=r-A,r=n-A,h[c]=A+(r-B);c=u[k].color?u[k].color:D._colorSet[k%D._colorSet.length];V(b,B,s,r,y,c,0,null,q,!1,!1,!1,D.fillOpacity);c=D.dataPointIds[k];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m, dataPointIndex:k,x1:B,y1:s,x2:r,y2:y};c=R(c);v&&V(this._eventManager.ghostCtx,B,s,r,y,c,0,null,!1,!1,!1,!1);(u[k].indexLabel||D.indexLabel||u[k].indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:u[k],dataSeries:D,point:{x:0<=u[k].y?r:B,y:p},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(B,r),y1:s,x2:Math.max(B,r),y2:y},color:c})}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop", a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.xScaleAnimation,easingFunction:H.easing.easeOutQuart,animationBase:na.axisY.bounds.x2?a.axisY.bounds.x2:n}}};q.prototype.renderStackedBar100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=[],h=[],l=[],t=[],k=0,r,p,n=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth: 0.15*this.height<<0;var d=a.axisX.dataInfo.minDiff;isFinite(d)||(d=0.3*Math.abs(a.axisX.range));d=this.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(d)/Math.log(a.axisX.range):Math.abs(d)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&k>p&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&pp&&(d=p);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var w=0;wa.axisX.dataInfo.viewPortMax)&&"number"===typeof u[k].y){p=a.axisX.convertValueToPixel(c);var s;s=0!==a.dataPointYSums[c]?100*(u[k].y/a.dataPointYSums[c]):0;var y=p-a.plotType.plotUnits.length*d/2+a.index*d<<0,B=y+d<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=l[c])continue;s=g[c]?g[c]:n;g[c]=r=a.axisY.convertValueToPixel(l[c])}else if(a.axisY.scaleBreaks&&0=u[k].y)t[c]=s+(t[c]?t[c]:0),r=h[c]?h[c]:n,h[c]=s=a.axisY.convertValueToPixel(t[c]);else if(r=a.axisY.convertValueToPixel(s),0<=u[k].y){var A=g[c]?g[c]:0;s=n+A;r+=A;g[c]=A+(r-s)}else A=h[c]?h[c]:0,s=r-A,r=n-A,h[c]=A+(r-s);c=u[k].color?u[k].color:D._colorSet[k%D._colorSet.length];V(b,s,y,r,B,c,0,null,q,!1,!1,!1,D.fillOpacity);c=D.dataPointIds[k];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:k,x1:s,y1:y,x2:r,y2:B};c=R(c);v&&V(this._eventManager.ghostCtx, s,y,r,B,c,0,null,!1,!1,!1,!1);(u[k].indexLabel||D.indexLabel||u[k].indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:u[k],dataSeries:D,point:{x:0<=u[k].y?r:s,y:p},direction:0>u[k].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(s,r),y1:y,x2:Math.max(s,r),y2:B},color:c})}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height), a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.xScaleAnimation,easingFunction:H.easing.easeOutQuart,animationBase:na.axisY.bounds.x2?a.axisY.bounds.x2:n}}};q.prototype.renderArea= function(a){var f,b;function c(){A&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?B=y:0>a.axisY.viewportMaximum?B=t.y1:0=a.dataSeriesIndexes.length)){var h=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,t=a.axisY.lineCoordinates,k=[],r=this.plotArea,p;g.save();v&&h.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();v&&(h.beginPath(),h.rect(r.x1,r.y1,r.width,r.height),h.clip());for(var n=0;na.axisX.dataInfo.viewPortMax&&(!w.connectNullData||!ea)))if("number"!==typeof m[D].y)w.connectNullData||(ea||f)||c(),ea=!0;else{u=a.axisX.convertValueToPixel(q);s=a.axisY.convertValueToPixel(m[D].y);f||ea?(!f&&w.connectNullData?(g.setLineDash&&(w.options.nullDataLineDashType||b===w.lineDashType&&w.lineDashType!==w.nullDataLineDashType)&&(f=u,b=s,u=p.x,s=p.y,c(),g.moveTo(p.x,p.y),u=f,s=b,A=p,b=w.nullDataLineDashType,g.setLineDash(I)),g.lineTo(u,s),v&&h.lineTo(u,s)):(g.beginPath(),g.moveTo(u,s),v&& (h.beginPath(),h.moveTo(u,s)),A={x:u,y:s}),ea=f=!1):(g.lineTo(u,s),v&&h.lineTo(u,s),0==D%250&&c());p={x:u,y:s};Dm[D].y===a.axisY.reversed?1:-1,color:x})}c();ja.drawMarkers(k)}}v&&(e.drawImage(this._preRenderCanvas,0,0,this.width,this.height), g.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&g.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&g.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());g.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}}; q.prototype.renderSplineArea=function(a){function f(){var b=x(q,2);if(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?u=D:0>a.axisY.viewportMaximum? u=h.y1:0=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,g=a.axisX.lineCoordinates,h=a.axisY.lineCoordinates,l=[],t=this.plotArea;c.save();v&&e.save();c.beginPath();c.rect(t.x1, t.y1,t.width,t.height);c.clip();v&&(e.beginPath(),e.rect(t.x1,t.y1,t.width,t.height),e.clip());for(var k=0;ka.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!m)))if("number"!==typeof n[d].y)0 n[d].y===a.axisY.reversed?1:-1,color:y});m=!1}f();ja.drawMarkers(l)}}v&&(b.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(t.x1,t.y1,t.width,t.height),this._eventManager.ghostCtx.restore()); c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}};q.prototype.renderStepArea=function(a){var f,b;function c(){A&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?B=y:0>a.axisY.viewportMaximum?B=t.y1:0=a.dataSeriesIndexes.length)){var h=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,t=a.axisY.lineCoordinates,k=[],r=this.plotArea,p;g.save();v&&h.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();v&&(h.beginPath(),h.rect(r.x1,r.y1,r.width,r.height),h.clip());for(var n=0;na.axisX.dataInfo.viewPortMax&&(!w.connectNullData||!b))){var $=s;"number"!==typeof m[D].y?(w.connectNullData||(b||f)||c(),b=!0):(u=a.axisX.convertValueToPixel(q),s=a.axisY.convertValueToPixel(m[D].y),f||b?(!f&&w.connectNullData?(g.setLineDash&&(w.options.nullDataLineDashType||I===w.lineDashType&&w.lineDashType!==w.nullDataLineDashType)&&(f= u,b=s,u=p.x,s=p.y,c(),g.moveTo(p.x,p.y),u=f,s=b,A=p,I=w.nullDataLineDashType,g.setLineDash(da)),g.lineTo(u,$),g.lineTo(u,s),v&&(h.lineTo(u,$),h.lineTo(u,s))):(g.beginPath(),g.moveTo(u,s),v&&(h.beginPath(),h.moveTo(u,s)),A={x:u,y:s}),b=f=!1):(g.lineTo(u,$),v&&h.lineTo(u,$),g.lineTo(u,s),v&&h.lineTo(u,s),0==D%250&&c()),p={x:u,y:s},Dm[D].y===a.axisY.reversed?1:-1,color:x}))}c();ja.drawMarkers(k)}}v&&(e.drawImage(this._preRenderCanvas,0,0,this.width,this.height),g.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&g.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&g.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas, 0,0,this.width,this.height),g.clearRect(r.x1,r.y1,r.width,r.height),this._eventManager.ghostCtx.restore());g.restore();return{source:e,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}};q.prototype.renderStackedArea=function(a){function f(){if(!(1>t.length)){for(0=a.dataSeriesIndexes.length)){var e=null,g=[],h=this.plotArea,l=[],t=[],k=[],r=[],p=0,n,d,w,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),s=this._eventManager.ghostCtx,u,q,y;v&&s.beginPath();c.save();v&&s.save();c.beginPath();c.rect(h.x1,h.y1,h.width,h.height);c.clip();v&&(s.beginPath(),s.rect(h.x1,h.y1,h.width,h.height),s.clip());for(var e=[],x=0;xa.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!ea)))if("number"!==typeof $.y)A.connectNullData||(ea||q)||f(),ea=!0;else{n=a.axisX.convertValueToPixel(w);var xa= l[w]?l[w]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=r[w]&&a.axisY.logarithmic)continue;d=a.axisY.convertValueToPixel(r[w])}else d=a.axisY.convertValueToPixel($.y),d-=xa;t.push({x:n,y:m-xa});l[w]=m-d;q||ea?(!q&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||y===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(q=t.pop(),y=t[t.length-1],f(),c.moveTo(u.x,u.y),t.push(y),t.push(q),y=A.nullDataLineDashType, c.setLineDash(I)),c.lineTo(n,d),v&&s.lineTo(n,d)):(c.beginPath(),c.moveTo(n,d),v&&(s.beginPath(),s.moveTo(n,d))),ea=q=!1):(c.lineTo(n,d),v&&s.lineTo(n,d),0==p%250&&(f(),c.moveTo(n,d),v&&s.moveTo(n,d),t.push({x:n,y:m-xa})));u={x:n,y:d};pz[p].y===a.axisY.reversed?1:-1,color:e})}}f();c.moveTo(n,d);v&&s.moveTo(n,d)}delete A.dataPointIndexes}ja.drawMarkers(g);v&&(b.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&& c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(h.x1,h.y1,h.width,h.height),s.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}};q.prototype.renderStackedArea100=function(a){function f(){for(0=a.dataSeriesIndexes.length)){var e=null,g=this.plotArea,h=[],l=[],t=[],k=[],r=[],p=0,n,d,w,m,s,u,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),y=this._eventManager.ghostCtx;c.save();v&&y.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();v&&(y.beginPath(), y.rect(g.x1,g.y1,g.width,g.height),y.clip());for(var e=[],x=0;xa.axisX.dataInfo.viewPortMax&&(!A.connectNullData|| !ea)))if("number"!==typeof $.y)A.connectNullData||(ea||s)||f(),ea=!0;else{var xa;xa=0!==a.dataPointYSums[w]?100*($.y/a.dataPointYSums[w]):0;n=a.axisX.convertValueToPixel(w);var oa=l[w]?l[w]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=r[w]&&a.axisY.logarithmic)continue;d=a.axisY.convertValueToPixel(r[w])}else d=a.axisY.convertValueToPixel(xa),d-=oa;t.push({x:n,y:q-oa});l[w]=q-d;s||ea?(!s&&A.connectNullData?(c.setLineDash&& (A.options.nullDataLineDashType||u===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(s=t.pop(),u=t[t.length-1],f(),c.moveTo(m.x,m.y),t.push(u),t.push(s),u=A.nullDataLineDashType,c.setLineDash(I)),c.lineTo(n,d),v&&y.lineTo(n,d)):(c.beginPath(),c.moveTo(n,d),v&&(y.beginPath(),y.moveTo(n,d))),ea=s=!1):(c.lineTo(n,d),v&&y.lineTo(n,d),0==p%250&&(f(),c.moveTo(n,d),v&&y.moveTo(n,d),t.push({x:n,y:q-oa})));m={x:n,y:d};pz[p].y===a.axisY.reversed?1:-1,color:e})}}f();c.moveTo(n,d);v&&y.moveTo(n,d)}delete A.dataPointIndexes}ja.drawMarkers(h);v&&(b.drawImage(this._preRenderCanvas, 0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(g.x1,g.y1,g.width,g.height),y.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear, animationBase:0}}};q.prototype.renderBubble=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,e=0,g,h;b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=-Infinity,t=Infinity,k=0;ka.axisX.dataInfo.viewPortMax||"undefined"===typeof n[e].z||(d=n[e].z,d>l&&(l=d),da.axisX.dataInfo.viewPortMax)&&"number"===typeof n[e].y){g=a.axisX.convertValueToPixel(g);h=a.axisY.convertValueToPixel(n[e].y);var d=n[e].z,s=2*Math.max(Math.sqrt((l===t?m/2:w+(m-w)/(l-t)*(d-t))/Math.PI)<<0,1),d=p.getMarkerProperties(e,b);d.size=s;b.globalAlpha=p.fillOpacity;ja.drawMarker(g,h,b,d.type,d.size,d.color,d.borderColor,d.borderThickness);b.globalAlpha=1;var u=p.dataPointIds[e];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint", dataSeriesIndex:r,dataPointIndex:e,x1:g,y1:h,size:s};s=R(u);v&&ja.drawMarker(g,h,this._eventManager.ghostCtx,d.type,d.size,s,s,d.borderThickness);(n[e].indexLabel||p.indexLabel||n[e].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:n[e],dataSeries:p,point:{x:g,y:h},direction:1,bounds:{x1:g-d.size/2,y1:h-d.size/2,x2:g+d.size/2,y2:h+d.size/2},color:null})}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop", a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};q.prototype.renderScatter= function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,e=0,g,h;b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=0;la.axisX.dataInfo.viewPortMax)&&"number"===typeof r[e].y){g=a.axisX.convertValueToPixel(g);h=a.axisY.convertValueToPixel(r[e].y);var d=k.getMarkerProperties(e,g,h,b);b.globalAlpha=k.fillOpacity;ja.drawMarker(d.x,d.y,d.ctx,d.type,d.size,d.color,d.borderColor,d.borderThickness);b.globalAlpha=1;Math.sqrt((p- g)*(p-g)+(n-h)*(n-h))Math.min(this.plotArea.width,this.plotArea.height)||(p=k.dataPointIds[e],this._eventManager.objectMap[p]={id:p,objectType:"dataPoint",dataSeriesIndex:t,dataPointIndex:e,x1:g,y1:h},p=R(p),v&&ja.drawMarker(d.x,d.y,this._eventManager.ghostCtx,d.type,d.size,p,p,d.borderThickness),(r[e].indexLabel||k.indexLabel||r[e].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:r[e],dataSeries:k,point:{x:g,y:h},direction:1, bounds:{x1:g-d.size/2,y1:h-d.size/2,x2:g+d.size/2,y2:h+d.size/2},color:null}),p=g,n=h)}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.restore()); b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};q.prototype.renderCandlestick=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,g=null,h=this.plotArea,l=0,t,k,r,p,n,d,e=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,g=this.dataPointMaxWidth?this.dataPointMaxWidth: this.dataPointWidth?this.dataPointWidth:0.015*this.width,w=a.axisX.dataInfo.minDiff;isFinite(w)||(w=0.3*Math.abs(a.axisX.range));w=this.dataPointWidth?this.dataPointWidth:0.7*h.width*(a.axisX.logarithmic?Math.log(w)/Math.log(a.axisX.range):Math.abs(w)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e>g&&(e=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(w=g);b.save();v&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();v&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax)&&!y(q[l].y)&&q[l].y.length&&"number"===typeof q[l].y[0]&& "number"===typeof q[l].y[1]&&"number"===typeof q[l].y[2]&&"number"===typeof q[l].y[3]){t=a.axisX.convertValueToPixel(d);k=a.axisY.convertValueToPixel(q[l].y[0]);r=a.axisY.convertValueToPixel(q[l].y[1]);p=a.axisY.convertValueToPixel(q[l].y[2]);n=a.axisY.convertValueToPixel(q[l].y[3]);var x=t-w/2<<0,B=x+w<<0,g=u.options.fallingColor?u.fallingColor:u._colorSet[0],e=q[l].color?q[l].color:u._colorSet[0],A=Math.round(Math.max(1,0.15*w)),z=0===A%2?0:0.5,L=u.dataPointIds[l];this._eventManager.objectMap[L]= {id:L,objectType:"dataPoint",dataSeriesIndex:s,dataPointIndex:l,x1:x,y1:k,x2:B,y2:r,x3:t,y3:p,x4:t,y4:n,borderThickness:A,color:e};b.strokeStyle=e;b.beginPath();b.lineWidth=A;c.lineWidth=Math.max(A,4);"candlestick"===u.type?(b.moveTo(t-z,r),b.lineTo(t-z,Math.min(k,n)),b.stroke(),b.moveTo(t-z,Math.max(k,n)),b.lineTo(t-z,p),b.stroke(),V(b,x,Math.min(k,n),B,Math.max(k,n),q[l].y[0]<=q[l].y[3]?u.risingColor:g,A,e,ca,ca,!1,!1,u.fillOpacity),v&&(e=R(L),c.strokeStyle=e,c.moveTo(t-z,r),c.lineTo(t-z,Math.min(k, n)),c.stroke(),c.moveTo(t-z,Math.max(k,n)),c.lineTo(t-z,p),c.stroke(),V(c,x,Math.min(k,n),B,Math.max(k,n),e,0,null,!1,!1,!1,!1))):"ohlc"===u.type&&(b.moveTo(t-z,r),b.lineTo(t-z,p),b.stroke(),b.beginPath(),b.moveTo(t,k),b.lineTo(x,k),b.stroke(),b.beginPath(),b.moveTo(t,n),b.lineTo(B,n),b.stroke(),v&&(e=R(L),c.strokeStyle=e,c.moveTo(t-z,r),c.lineTo(t-z,p),c.stroke(),c.beginPath(),c.moveTo(t,k),c.lineTo(x,k),c.stroke(),c.beginPath(),c.moveTo(t,n),c.lineTo(B,n),c.stroke()));(q[l].indexLabel||u.indexLabel|| q[l].indexLabelFormatter||u.indexLabelFormatter)&&this._indexLabels.push({chartType:u.type,dataPoint:q[l],dataSeries:u,point:{x:x+(B-x)/2,y:a.axisY.reversed?p:r},direction:1,bounds:{x1:x,y1:Math.min(r,p),x2:B,y2:Math.max(r,p)},color:e})}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height), this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(h.x1,h.y1,h.width,h.height),c.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};q.prototype.renderBoxAndWhisker=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var e=null,g=this.plotArea, h=0,l,t,k,r,p,n,d,e=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,h=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width,w=a.axisX.dataInfo.minDiff;isFinite(w)||(w=0.3*Math.abs(a.axisX.range));w=this.dataPointWidth?this.dataPointWidth:0.7*g.width*(a.axisX.logarithmic?Math.log(w)/Math.log(a.axisX.range):Math.abs(w)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&e>h&&(e=Math.min(this.dataPointWidth?this.dataPointWidth: Infinity,h));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&hh&&(w=h);b.save();v&&c.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();v&&(c.beginPath(),c.rect(g.x1,g.y1,g.width,g.height),c.clip());for(var m=!1,m=!!a.axisY.reversed,s=0;sa.axisX.dataInfo.viewPortMax)&&!y(x[h].y)&&x[h].y.length&&"number"===typeof x[h].y[0]&&"number"===typeof x[h].y[1]&&"number"===typeof x[h].y[2]&&"number"===typeof x[h].y[3]&&"number"===typeof x[h].y[4]&&5===x[h].y.length){l=a.axisX.convertValueToPixel(d);t=a.axisY.convertValueToPixel(x[h].y[0]);k=a.axisY.convertValueToPixel(x[h].y[1]);r=a.axisY.convertValueToPixel(x[h].y[2]);p=a.axisY.convertValueToPixel(x[h].y[3]);n=a.axisY.convertValueToPixel(x[h].y[4]); var B=l-w/2<<0,A=l+w/2<<0,e=x[h].color?x[h].color:q._colorSet[0],C=Math.round(Math.max(1,0.15*w)),L=0===C%2?0:0.5,J=x[h].whiskerColor?x[h].whiskerColor:x[h].color?q.whiskerColor?q.whiskerColor:x[h].color:q.whiskerColor?q.whiskerColor:e,I="number"===typeof x[h].whiskerThickness?x[h].whiskerThickness:"number"===typeof q.options.whiskerThickness?q.whiskerThickness:C,da=x[h].whiskerDashType?x[h].whiskerDashType:q.whiskerDashType,ea=y(x[h].whiskerLength)?y(q.options.whiskerLength)?w:q.whiskerLength:x[h].whiskerLength, ea="number"===typeof ea?0>=ea?0:ea>=w?w:ea:"string"===typeof ea?parseInt(ea)*w/100>w?w:parseInt(ea)*w/100:w,$=1===Math.round(I)%2?0.5:0,xa=x[h].stemColor?x[h].stemColor:x[h].color?q.stemColor?q.stemColor:x[h].color:q.stemColor?q.stemColor:e,oa="number"===typeof x[h].stemThickness?x[h].stemThickness:"number"===typeof q.options.stemThickness?q.stemThickness:C,E=1===Math.round(oa)%2?0.5:0,eb=x[h].stemDashType?x[h].stemDashType:q.stemDashType,P=x[h].lineColor?x[h].lineColor:x[h].color?q.lineColor?q.lineColor: x[h].color:q.lineColor?q.lineColor:e,O="number"===typeof x[h].lineThickness?x[h].lineThickness:"number"===typeof q.options.lineThickness?q.lineThickness:C,Q=x[h].lineDashType?x[h].lineDashType:q.lineDashType,K=1===Math.round(O)%2?0.5:0,N=q.upperBoxColor,U=q.lowerBoxColor,ta=y(q.options.fillOpacity)?1:q.fillOpacity,M=q.dataPointIds[h];this._eventManager.objectMap[M]={id:M,objectType:"dataPoint",dataSeriesIndex:u,dataPointIndex:h,x1:B,y1:t,x2:A,y2:k,x3:l,y3:r,x4:l,y4:p,y5:n,borderThickness:C,color:e, stemThickness:oa,stemColor:xa,whiskerThickness:I,whiskerLength:ea,whiskerColor:J,lineThickness:O,lineColor:P};b.save();0=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=0,h,l,t,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;h=this.dataPointMaxWidth?this.dataPointMaxWidth: this.dataPointWidth?this.dataPointWidth:0.03*this.width;var k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range):Math.abs(k)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>h&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,h));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&hh&&(k=h);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var r=0;ra.axisX.dataInfo.viewPortMax)&&!y(d[g].y)&&d[g].y.length&&"number"===typeof d[g].y[0]&&"number"===typeof d[g].y[1]){c=a.axisX.convertValueToPixel(t);h=a.axisY.convertValueToPixel(d[g].y[0]);l=a.axisY.convertValueToPixel(d[g].y[1]);var m=a.axisX.reversed?c+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+r)*k<<0:c-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+r)*k<<0,q=a.axisX.reversed?m-k<<0:m+k<<0,c=d[g].color?d[g].color:n._colorSet[g%n._colorSet.length]; if(h>l){var u=h;h=l;l=u}u=n.dataPointIds[g];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:g,x1:m,y1:h,x2:q,y2:l};V(b,m,h,q,l,c,0,c,w,w,!1,!1,n.fillOpacity);c=R(u);v&&V(this._eventManager.ghostCtx,m,h,q,l,c,0,null,!1,!1,!1,!1);if(d[g].indexLabel||n.indexLabel||d[g].indexLabelFormatter||n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:d[g],dataSeries:n,indexKeyword:0,point:{x:m+(q-m)/2,y:d[g].y[1]>=d[g].y[0]?l:h},direction:d[g].y[1]>= d[g].y[0]?-1:1,bounds:{x1:m,y1:Math.min(h,l),x2:q,y2:Math.max(h,l)},color:c}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:d[g],dataSeries:n,indexKeyword:1,point:{x:m+(q-m)/2,y:d[g].y[1]>=d[g].y[0]?h:l},direction:d[g].y[1]>=d[g].y[0]?1:-1,bounds:{x1:m,y1:Math.min(h,l),x2:q,y2:Math.max(h,l)},color:c})}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height), a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};q.prototype.renderError=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx: f,c=a.axisY._position?"left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var e=null,g=!1,h=this.plotArea,l=0,t,k,r,p,n,d,w,m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.clip());for(var q= 0,u=0;ul&&(e=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&ll&&(u=l);if(0=J.length?0: J.length>=u?u:J.length:"string"===typeof J.length?parseInt(J.length)*u/100>u?u:parseInt(J.length)*u/100>u:u;J.thickness="number"===typeof J.thickness?0>J.thickness?0:Math.round(J.thickness):2;var I={color:B[l].stemColor?B[l].stemColor:B[l].color?ba.stemColor?ba.stemColor:B[l].color:ba.stemColor?ba.stemColor:e,thickness:B[l].stemThickness?B[l].stemThickness:ba.stemThickness,dashType:B[l].stemDashType?B[l].stemDashType:ba.stemDashType};I.thickness="number"===typeof I.thickness?0>I.thickness?0:Math.round(I.thickness): 2;B[l].getTime?w=B[l].x.getTime():w=B[l].x;if(!(wa.axisX.dataInfo.viewPortMax)&&!y(B[l].y)&&B[l].y.length&&"number"===typeof B[l].y[0]&&"number"===typeof B[l].y[1]){var da=a.axisX.convertValueToPixel(w);c?k=da:t=da;da=a.axisY.convertValueToPixel(B[l].y[0]);c?r=da:n=da;da=a.axisY.convertValueToPixel(B[l].y[1]);c?p=da:d=da;c?(n=a.axisX.reversed?k+(A?q:1)*u/2-(A?C-1:0)*u<<0:k-(A?q:1)*u/2+(A?C-1:0)*u<<0,d=a.axisX.reversed?n-u<<0:n+u<<0):(r=a.axisX.reversed?t+(A?q:1)*u/ 2-(A?C-1:0)*u<<0:t-(A?q:1)*u/2+(A?C-1:0)*u<<0,p=a.axisX.reversed?r-u<<0:r+u<<0);!c&&n>d&&(da=n,n=d,d=da);c&&r>p&&(da=r,r=p,p=da);da=ba.dataPointIds[l];this._eventManager.objectMap[da]={id:da,objectType:"dataPoint",dataSeriesIndex:x,dataPointIndex:l,x1:Math.min(r,p),y1:Math.min(n,d),x2:Math.max(p,r),y2:Math.max(d,n),isXYSwapped:c,stemProperties:I,whiskerProperties:J};z(b,Math.min(r,p),Math.min(n,d),Math.max(p,r),Math.max(d,n),e,J,I,c);v&&z(this._eventManager.ghostCtx,r,n,p,d,e,J,I,c);if(B[l].indexLabel|| ba.indexLabel||B[l].indexLabelFormatter||ba.indexLabelFormatter)this._indexLabels.push({chartType:"error",dataPoint:B[l],dataSeries:ba,indexKeyword:0,point:{x:c?B[l].y[1]>=B[l].y[0]?r:p:r+(p-r)/2,y:c?n+(d-n)/2:B[l].y[1]>=B[l].y[0]?d:n},direction:B[l].y[1]>=B[l].y[0]?-1:1,bounds:{x1:c?Math.min(r,p):r,y1:c?n:Math.min(n,d),x2:c?Math.max(r,p):p,y2:c?d:Math.max(n,d)},color:e,axisSwapped:c}),this._indexLabels.push({chartType:"error",dataPoint:B[l],dataSeries:ba,indexKeyword:1,point:{x:c?B[l].y[1]>=B[l].y[0]? p:r:r+(p-r)/2,y:c?n+(d-n)/2:B[l].y[1]>=B[l].y[0]?n:d},direction:B[l].y[1]>=B[l].y[0]?1:-1,bounds:{x1:c?Math.min(r,p):r,y1:c?n:Math.min(n,d),x2:c?Math.max(r,p):p,y2:c?d:Math.max(n,d)},color:e,axisSwapped:c})}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas, 0,0,this.width,this.height),b.clearRect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};q.prototype.renderRangeBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=v?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,e=this.plotArea,g=0,h,l,t,k,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth: 1;h=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.dataPointWidth?this.dataPointWidth:0.9*(e.height*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>h&&(g=Math.min(this.dataPointWidth?this.dataPointWidth: Infinity,h));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&hh&&(r=h);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.clip());for(var p=0;pa.axisX.dataInfo.viewPortMax)&&!y(w[g].y)&&w[g].y.length&&"number"===typeof w[g].y[0]&&"number"===typeof w[g].y[1]){h=a.axisY.convertValueToPixel(w[g].y[0]);l=a.axisY.convertValueToPixel(w[g].y[1]);t=a.axisX.convertValueToPixel(k);t=a.axisX.reversed?t+a.plotType.totalDataSeries*r/2-(a.previousDataSeriesCount+p)*r<<0:t-a.plotType.totalDataSeries* r/2+(a.previousDataSeriesCount+p)*r<<0;var q=a.axisX.reversed?t-r<<0:t+r<<0;h>l&&(c=h,h=l,l=c);c=w[g].color?w[g].color:d._colorSet[g%d._colorSet.length];V(b,h,t,l,q,c,0,null,m,!1,!1,!1,d.fillOpacity);c=d.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:g,x1:h,y1:t,x2:l,y2:q};c=R(c);v&&V(this._eventManager.ghostCtx,h,t,l,q,c,0,null,!1,!1,!1,!1);if(w[g].indexLabel||d.indexLabel||w[g].indexLabelFormatter||d.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar", dataPoint:w[g],dataSeries:d,indexKeyword:0,point:{x:w[g].y[1]>=w[g].y[0]?h:l,y:t+(q-t)/2},direction:w[g].y[1]>=w[g].y[0]?-1:1,bounds:{x1:Math.min(h,l),y1:t,x2:Math.max(h,l),y2:q},color:c}),this._indexLabels.push({chartType:"rangeBar",dataPoint:w[g],dataSeries:d,indexKeyword:1,point:{x:w[g].y[1]>=w[g].y[0]?l:h,y:t+(q-t)/2},direction:w[g].y[1]>=w[g].y[0]?1:-1,bounds:{x1:Math.min(h,l),y1:t,x2:Math.max(h,l),y2:q},color:c})}}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation= "source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};q.prototype.renderRangeArea= function(a){function f(){if(s){var a=null;0= a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,g=[],h=this.plotArea;c.save();v&&e.save();c.beginPath();c.rect(h.x1,h.y1,h.width,h.height);c.clip();v&&(e.beginPath(),e.rect(h.x1,h.y1,h.width,h.height),e.clip());for(var l=0;la.axisX.dataInfo.viewPortMax&&(!r.connectNullData||!J)))if(null!==p[d].y&&p[d].y.length&&"number"===typeof p[d].y[0]&&"number"===typeof p[d].y[1]){w= a.axisX.convertValueToPixel(u);m=a.axisY.convertValueToPixel(p[d].y[0]);q=a.axisY.convertValueToPixel(p[d].y[1]);n||J?(r.connectNullData&&!n?(c.setLineDash&&(r.options.nullDataLineDashType||A===r.lineDashType&&r.lineDashType!==r.nullDataLineDashType)&&(t[t.length-1].newLineDashArray=C,A=r.nullDataLineDashType,c.setLineDash(z)),c.lineTo(w,m),v&&e.lineTo(w,m),t.push({x:w,y:q})):(c.beginPath(),c.moveTo(w,m),s={x:w,y:m},t=[],t.push({x:w,y:q}),v&&(e.beginPath(),e.moveTo(w,m))),J=n=!1):(c.lineTo(w,m),t.push({x:w, y:q}),v&&e.lineTo(w,m),0==d%250&&f());u=r.dataPointIds[d];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:d,x1:w,y1:m,y2:q};dp[d].y[1]===a.axisY.reversed?-1:1,color:y}),this._indexLabels.push({chartType:"rangeArea",dataPoint:p[d],dataSeries:r,indexKeyword:1,point:{x:w,y:q},direction:p[d].y[0]>p[d].y[1]===a.axisY.reversed?1:-1,color:y})}else J||n||f(),J=!0;f();ja.drawMarkers(g)}}v&&(b.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width, this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:H.xClipAnimation,easingFunction:H.easing.linear,animationBase:0}}};q.prototype.renderRangeSplineArea=function(a){function f(a,b){var d=x(m,2);if(0=a.dataSeriesIndexes.length)){var e= this._eventManager.ghostCtx,g=[],h=this.plotArea;c.save();v&&e.save();c.beginPath();c.rect(h.x1,h.y1,h.width,h.height);c.clip();v&&(e.beginPath(),e.rect(h.x1,h.y1,h.width,h.height),e.clip());for(var l=0;la.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!d)))if(null!==r[p].y&&r[p].y.length&&"number"===typeof r[p].y[0]&&"number"===typeof r[p].y[1]){n=a.axisX.convertValueToPixel(n);d=a.axisY.convertValueToPixel(r[p].y[0]);w=a.axisY.convertValueToPixel(r[p].y[1]); var C=k.dataPointIds[p];this._eventManager.objectMap[C]={id:C,objectType:"dataPoint",dataSeriesIndex:t,dataPointIndex:p,x1:n,y1:d,y2:w};m[m.length]={x:n,y:d};q[q.length]={x:n,y:w};p=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,e=null,g=this.plotArea,h=0,l,t,k,r,p=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;t=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15* this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth?this.dataPointWidth:0.6*(g.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>t&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,t));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&tt&&(n=t);b.save();v&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();v&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var d=0;dk&&(e=t,t=k,k=e);a.axisY.reversed&&(e=t,t=k,k=e);e=m.dataPointIds[h];this._eventManager.objectMap[e]={id:e,objectType:"dataPoint", dataSeriesIndex:w,dataPointIndex:h,x1:l,y1:t,x2:C,y2:k};var J=q[h].color?q[h].color:-1q[h].y===a.axisY.reversed?1:-1,bounds:{x1:l,y1:Math.min(t,k),x2:C,y2:Math.max(t,k)},color:e})}}v&&(f.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas, 0,0,this.width,this.height),b.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:H.fadeInAnimation,easingFunction:H.easing.easeInQuad,animationBase:0}}};var ra=function(a,f,b,c,e,g,h,l,t){if(!(0>b)){"undefined"===typeof l&&(l=1);if(!v){var k=Number((h%(2*Math.PI)).toFixed(8));Number((g%(2*Math.PI)).toFixed(8))===k&&(h-=1E-4)}a.save();a.globalAlpha=l;"pie"===e?(a.beginPath(),a.moveTo(f.x,f.y),a.arc(f.x,f.y, b,g,h,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===e&&(a.beginPath(),a.arc(f.x,f.y,b,g,h,!1),0<=t&&a.arc(f.x,f.y,t*b,h,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};q.prototype.renderPie=function(a){function f(){if(k&&r){for(var a=0,b=0,c=0,e=0,f=0;fMath.PI/2-u&&l.midAnglel.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-u&&l.midAngle<3*Math.PI/2+u){if(0===b||d[e].midAngle>l.midAngle)e=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new la(t.plotArea.ctx,{fontSize:l.indexLabelFontSize,fontFamily:l.indexLabelFontFamily,fontColor:l.indexLabelFontColor,fontStyle:l.indexLabelFontStyle,fontWeight:l.indexLabelFontWeight,horizontalAlign:"left",backgroundColor:l.indexLabelBackgroundColor, maxWidth:l.indexLabelMaxWidth,maxHeight:l.indexLabelWrap?5*l.indexLabelFontSize:1.5*l.indexLabelFontSize,text:l.indexLabelText,padding:0,textBaseline:"top"});l.indexLabelTextBlock.measureText()}h=g=0;p=!1;for(f=0;fMath.PI/2-u&&l.midAngle3*Math.PI/2-u&&l.midAngle<3*Math.PI/2+u)&&(h<=b/2&&!p?(l.hemisphere= "left",h++):(l.hemisphere="right",p=!0))}}function b(a){var b=t.plotArea.ctx;b.clearRect(n.x1,n.y1,n.width,n.height);b.fillStyle=t.backgroundColor;b.fillRect(n.x1,n.y1,n.width,n.height);for(b=0;bc){var f=0.07*A*Math.cos(d[b].midAngle),g=0.07*A*Math.sin(d[b].midAngle),h=!1;if(r[b].exploded){if(1E-9a.indexLabelTextBlock.y?e-d:c-f}function e(a){for(var b=null,e=1;ec(d[b],d[a])||("right"===d[a].hemisphere?d[b].indexLabelTextBlock.y>=d[a].indexLabelTextBlock.y:d[b].indexLabelTextBlock.y<=d[a].indexLabelTextBlock.y)))break; else b=null;return b}function g(a,b,f){f=(f||0)+1;if(1E3b&&l.indexLabelTextBlock.yn)return 0;var t=0,p=0,p=t=t=0;0>b?l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2>h&&l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2+bn&&(b=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+b-n);b=l.indexLabelTextBlock.y+b;h=0;h="right"===l.hemisphere?x.x+Math.sqrt(Math.pow(q,2)-Math.pow(b-x.y,2)):x.x-Math.sqrt(Math.pow(q,2)-Math.pow(b-x.y,2));p=x.x+A*Math.cos(l.midAngle);t=x.y+A*Math.sin(l.midAngle);t=Math.sqrt(Math.pow(h-p,2)+Math.pow(b-t,2));p=Math.acos(A/q);t=Math.acos((q*q+A*A-t*t)/(2*A*q));b=tc(d[h],d[a])||("right"===d[a].hemisphere?d[h].indexLabelTextBlock.y<=d[a].indexLabelTextBlock.y:d[h].indexLabelTextBlock.y>=d[a].indexLabelTextBlock.y)))break;else h=null;p=h;t=e(a);n=h=0;0>b?(n="right"===l.hemisphere?p:t,k=b,null!==n&&(p=-b,b=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2-(d[n].indexLabelTextBlock.y+d[n].indexLabelTextBlock.height/2),b-p +h.toFixed(v)&&(k=b>m?-(b-m):-(p-(n-h)))))):0m?b-m:p-(h-n)))));k&&(f=l.indexLabelTextBlock.y+k,b=0,b="right"===l.hemisphere?x.x+Math.sqrt(Math.pow(q,2)-Math.pow(f-x.y,2)):x.x-Math.sqrt(Math.pow(q,2)-Math.pow(f-x.y,2)),l.midAngle>Math.PI/2-u&&l.midAngleh.indexLabelTextBlock.x?b=h.indexLabelTextBlock.x-15:"right"===l.hemisphere&&("left"===a.hemisphere&&b3*Math.PI/2-u&&l.midAngle<3*Math.PI/2+u&&(h=(a-1+d.length)%d.length,h=d[h],a=d[(a+1+d.length)%d.length],"right"===l.hemisphere&&"left"===h.hemisphere&&ba.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),l.indexLabelTextBlock.y=f,l.indexLabelTextBlock.x=b,l.indexLabelAngle=Math.atan2(l.indexLabelTextBlock.y-x.y,l.indexLabelTextBlock.x-x.x))}return k}function h(){var a=t.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,f=0,h=!0,b=0;10>b&&(1>b||0z){for(var ba=y=0,G=0;Gy?l.indexLabelText="":l.indexLabelTextBlock.maxWidth=0.85*y,0.3*l.indexLabelTextBlock.maxWidthf&&(f=B)),B=B=0,0f&&(f=B)));var K=function(a,b,c){for(var e=[],f=0;e.push(d[b]),b!==c;b=(b+1+r.length)%r.length);e.sort(function(a,b){return a.y-b.y});for(b=0;bz){n=u.indexLabelTextBlock.x;var t=u.indexLabelTextBlock.y-u.indexLabelTextBlock.height/2,m=u.indexLabelTextBlock.y+u.indexLabelTextBlock.height/2,w=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2,q=l.indexLabelTextBlock.x+l.indexLabelTextBlock.width,s=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2;n=u.indexLabelTextBlock.x+u.indexLabelTextBlock.widthq+p||t>s+p||ma&&(a=h),k!==a&&(b=k,f+=-z),0===h%Math.max(r.length/ 10,3)&&(g=!0)):g=!0;g&&(0=a.dataSeriesIndexes.length)){var k=this.data[a.dataSeriesIndexes[0]],r=k.dataPoints,p=10,n=this.plotArea,d=k.dataPointEOs,m=2,q,s=1.3,u=20/180*Math.PI,v=6,x={x:(n.x2+n.x1)/2,y:(n.y2+n.y1)/2},z=0;a=!1;for(var B=0;Ba&&(e=a,f=!0);var g=r[b].color?r[b].color:k._colorSet[b%k._colorSet.length];e>c&&ra(t.plotArea.ctx,d[b].center,d[b].radius,g,k.type,c,e,k.fillOpacity,d[b].percentInnerRadius);if(f)break}l()},function(){t.disableToolTip=!1;t._animator.animate(0,t.animatedRender?500:0,function(a){b(a);l()})})}}};var sa=function(a,f,b,c){"undefined"===typeof b&&(b=1);0>=Math.round(f.y4-f.y1)||(a.save(),a.globalAlpha=b,a.beginPath(),a.moveTo(Math.round(f.x1),Math.round(f.y1)),a.lineTo(Math.round(f.x2), Math.round(f.y2)),a.lineTo(Math.round(f.x3),Math.round(f.y3)),a.lineTo(Math.round(f.x4),Math.round(f.y4)),"undefined"!==f.x5&&(a.lineTo(Math.round(f.x5),Math.round(f.y5)),a.lineTo(Math.round(f.x6),Math.round(f.y6))),a.closePath(),a.fillStyle=c?c:f.color,a.fill(),a.globalAplha=1,a.restore())};q.prototype.renderFunnel=function(a){function f(){for(var a=0,b=[],c=0;csqrt?(n=c,k=(b+n)*(e-l)/2,a-=k,k=e-l,l+=e-l,k+=0==n?0:a/n,l+=a/n,t=!0):(k=(Math.abs(fa)*b-Math.sqrt(sqrt))/2,n=b-2*k/Math.abs(fa),l+=k,l>e&&(l-=k,n=c,k=(b+n)*(e-l)/2,a-=k,k=e-l,l+=e-l,k+=a/n,l+=a/n,t=!0),b=n)),d.push(k);return d}function c(){if(u&&x){for(var a,b,c,e,f,g,h,k,l,n,t,p,r,m,w=[],q=[],A={percent:null,total:null},B=null,z=0;zw[z]&&(w[z]=z!==ga?u.reversed?M[z].x3-M[z].x4:M[z].x2-M[z].x1:M[z].x2-M[z].x1,w[z]/=2));r=b.indexLabelMaxWidth?b.indexLabelMaxWidth:u.options.indexLabelMaxWidth?u.indexLabelMaxWidth:w[z];if(r>w[z]||0>r)r=w[z];q[z]="inside"===u.indexLabelPlacement?M[z].height:!1;A=s.getPercentAndTotal(u,b); if(u.indexLabelFormatter||b.indexLabelFormatter)B={chart:s.options,dataSeries:u,dataPoint:b,total:A.total,percent:A.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(B):b.indexLabel?s.replaceKeywordsWithValue(b.indexLabel,b,u,z):u.indexLabelFormatter?u.indexLabelFormatter(B):u.indexLabel?s.replaceKeywordsWithValue(u.indexLabel,b,u,z):b.label?b.label:"";0>=n&&(n=0);1E3>r&&1E3-rg?g:u.indexLabelMaxWidth:g,h=F.length-1;0<=h;h--){dataPoint=x[F[h].id];c=F[h];d=c.textBlock; b=(a=n(h)b.y&&(e=!0);c=dataPoint.indexLabelMaxWidth||g;if(c>g||0>c)c=g;f.push(c)}if(e)for(h=F.length-1;0<=h;h--)a=M[h],F[h].textBlock.maxWidth=f[f.length-(h+1)],F[h].textBlock.measureText(),F[h].textBlock.x=P-g,c=F[h].textBlock.heightT+C&&(F[h].textBlock.y=T+C-F[h].height),F[h].textBlock.yta+C&&(F[h].textBlock.y=ta+C-F[h].height))}function g(){var a,b,c,e;if("inside"!==u.indexLabelPlacement)for(var f=0;faa?d(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?cT+C&&(F[f].textBlock.y=T+C-F[f].height),F[f].textBlock.yta+C&&(F[f].textBlock.y=ta+C-F[f].height)));else for(f=0;f=c?(b=f!=ga?(a.x4+a.x3)/2-e/2:(a.x5+a.x4)/2-e/2,c=f!=ga?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,F[f].textBlock.x=b,F[f].textBlock.y=c):F[f].isDirty=!0)}function h(){function a(b,c){var d;if(0>b||b>=F.length)return 0;var e,f=F[b].textBlock;if(0>c){c*=-1;e=p(b);d=l(e,b);if(d>=c)return f.y-=c,c;if(0==b)return 0=c)return f.y+=c,c;if(b==M.length- 1)return 0e)&&(k=n(r),!(k>=F.length-1)&&F[r].textBlock.y+F[r].height+ha>F[k].textBlock.y&&(F[r].textBlock.y=F[r].textBlock.y+F[r].height-e>e-F[r].textBlock.y?e+1:e-F[r].height-1))}for(k=M.length-1;0e&&(e=0,F[e].isDirty))break;if(F[k].textBlock.y< F[e].textBlock.y+F[e].height){d=d||k;f=k;for(h=0;F[f].textBlock.y=f){f=0;h+=F[f].height;break}e=p(f);if(0>e){f=0;h+=F[f].height;break}}if(f!=k){g=F[f].textBlock.y;a-=g;a=h-a;g=c(a,d,f);break}}}return g}function c(a,b,d){var e=[],f=0,g=0;for(a=Math.abs(a);d<=b;d++)e.push(M[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d+k.y.toFixed(6))&&(d=g.y+d+ha-k.y,e=a(m,-d),ea?u.reversed?ta-C:T-C:F[a].textBlock.y+F[a].height+ha)}function t(a,b,c){var d,e,f,h=[],l=C,n=[];-1!==b&&(0<=ma.indexOf(b)?(e=ma.indexOf(b),ma.splice(e,1)):(ma.push(b),ma=ma.sort(function(a,b){return a-b})));if(0===ma.length)h=ka;else{e=C*(1!=ma.length||0!=ma[0]&&ma[0]!=M.length-1?2:1)/k();for(var t=0;tn&&(n*=-1),c.y1+=newY-n[d],c.y2+=newY-n[d],c.y3+=newY-n[d],c.y4+=newY-n[d],c.y5&&(c.y5+=newY-n[d],c.y6+=newY-n[d]),n[d]=newY}};a._animator.animate(0,c,function(c){var d= a.plotArea.ctx||a.ctx;ja=!0;d.clearRect(z.x1,z.y1,z.x2-z.x1,z.y2-z.y1);d.fillStyle=a.backgroundColor;d.fillRect(z.x1,z.y1,z.width,z.height);p.changeSection(c,b);var e={};e.dataSeries=u;e.dataPoint=u.reversed?u.dataPoints[x.length-1-b]:u.dataPoints[b];e.index=u.reversed?x.length-1-b:b;a.toolTip.highlightObjects([e]);for(e=0;ea){b=M[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function m(a){for(var b=0;b= a.dataSeriesIndexes.length)){for(var u=this.data[a.dataSeriesIndexes[0]],x=u.dataPoints,z=this.plotArea,C=0.025*z.width,B=0.01*z.width,A=0,O=z.height-2*C,L=Math.min(z.width-2*B,2.8*z.height),J=!1,I=0;IO?N=O:0>=N&&(N=0),E>a?E=a-0.5:0>=E&&(E=0)):"pyramid"===u.type&&(E=N=0,u.reversed=u.reversed?!1:!0);var B=I+a/2,X=I,V=I+a,T=u.reversed?$:Q,K=B-E/2,Y=B+E/2,aa=u.reversed?Q+N:$-N,ta=u.reversed?Q:$;a=[];var B=[],M=[],L=[],W=Q,ga,fa=(aa-T)/(K-X),ia=-fa,I="area"===(u.valueRepresents?u.valueRepresents:"height")?b():f();if(-1!==I){if(u.reversed)for(L.push(W),E=I.length-1;0a&&(A=a));for(E=0;E\n');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(f)},1E3)},500)};q.prototype.getPercentAndTotal=function(a,f){var b=null,c=null,e=null;if(0<=a.type.indexOf("stacked"))c=0,b=f.x.getTime?f.x.getTime():f.x,b in a.plotUnit.yTotals&&(c=a.plotUnit.yTotals[b],e=isNaN(f.y)?0:100*(f.y/c));else if("pie"=== a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(i=c=0;i=h||"undefined"===typeof h||0>=q||"undefined"===typeof q)){if("horizontal"===this.orientation){d.textBlock=new la(this.ctx,{x:0,y:0,maxWidth:q,maxHeight:this.itemWrap?h:this.lineHeight,angle:0,text:d.text,horizontalAlign:"left",fontSize:this.fontSize, fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});d.textBlock.measureText();null!==this.itemWidth&&(d.textBlock.width=this.itemWidth-(s+l+("line"===d.chartType||"spline"===d.chartType||"stepLine"===d.chartType?2*0.1*this.lineHeight:0)));if(!n||n.width+Math.round(d.textBlock.width+s+l+(0===n.width?0:this.horizontalSpacing)+("line"===d.chartType||"spline"===d.chartType||"stepLine"===d.chartType?2*0.1*this.lineHeight:0))>g)n= {items:[],width:0},k.push(n),this.height+=x,x=0;x=Math.max(x,d.textBlock.height)}else d.textBlock=new la(this.ctx,{x:0,y:0,maxWidth:z,maxHeight:!0===this.itemWrap?h:1.5*this.fontSize,angle:0,text:d.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),d.textBlock.measureText(),null!==this.itemWidth&&(d.textBlock.width=this.itemWidth-(s+l+("line"===d.chartType||"spline"===d.chartType|| "stepLine"===d.chartType?2*0.1*this.lineHeight:0))),this.height>0,0),this.dataPoints.length):0):(r=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,r=0>0,0),this.dataPoints.length):0));for(;;){g=0a?c.x/a:a/c.x:Math.abs(c.x-a);pr-e&&r+e>=this.dataPoints.length)break;-1===h?(e++,h=1):h=-1}return f||b.dataPoint.x!==a?f&&null!==b.dataPoint?b:null:b};Q.prototype.getDataPointAtXY=function(a,f,b){if(!this.dataPoints||0===this.dataPoints.length||athis.chart.plotArea.x2||fthis.chart.plotArea.y2)return null;b=b||!1;var c=[],e=0,g=0,h= 1,l=!1,t=Infinity,k=0,r=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:f}),this.axisX.logarithmic)var n=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1>0,0),this.dataPoints.length):0;else n=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0>0,0),this.dataPoints.length):0;for(;;){g=0=n.x1&&(a<=n.x2&&f>=n.y1&&f<=n.y2)&&(c.push({dataPoint:d,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(n.x1- a),Math.abs(n.x2-a),Math.abs(n.y1-f),Math.abs(n.y2-f))}),l=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var q=na("markerSize",d,this)||4,s=b?20:q,m=Math.sqrt(Math.pow(n.x1-a,2)+Math.pow(n.y1-f,2));m<=s&&c.push({dataPoint:d,dataPointIndex:g,dataSeries:this,distance:m});n=Math.abs(n.x1-a);n<=t?t=n:0s&&(m=Math.atan2(f-q.y,a-q.x),0>m&&(m+=2*Math.PI),m=Number(((180*(m/Math.PI)%360+360)%360).toFixed(12)),q=Number(((180*(n.startAngle/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(n.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===s&&1=s&&0!==d.y&&(s+=360,mq&&mm.y1&&fm.y6?(g=m.x6+(m.x5-m.x6)/(m.y5-m.y6)*(f-m.y6),m=m.x3+(m.x4-m.x3)/(m.y4-m.y3)*(f-m.y3)):(g=m.x1+(m.x6-m.x1)/(m.y6-m.y1)*(f-m.y1),m=m.x2+(m.x3-m.x2)/(m.y3-m.y2)*(f-m.y2)):(g=m.x1+(m.x4-m.x1)/(m.y4-m.y1)*(f-m.y1),m=m.x2+(m.x3-m.x2)/(m.y3-m.y2)*(f-m.y2)),a>g&&a=n.x1-n.borderThickness/2&&a<=n.x2+n.borderThickness/2&&f>=n.y4-n.borderThickness/2&&f<=n.y1+n.borderThickness/ 2||Math.abs(n.x2-a+n.x1-a)=n.y1&&f<=n.y4)c.push({dataPoint:d,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(n.x1-a),Math.abs(n.x2-a),Math.abs(n.y2-f),Math.abs(n.y3-f))}),l=!0;break;case "candlestick":if(a>=n.x1-n.borderThickness/2&&a<=n.x2+n.borderThickness/2&&f>=n.y2-n.borderThickness/2&&f<=n.y3+n.borderThickness/2||Math.abs(n.x2-a+n.x1-a)=n.y1&&f<=n.y4)c.push({dataPoint:d,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(n.x1-a), Math.abs(n.x2-a),Math.abs(n.y2-f),Math.abs(n.y3-f))}),l=!0;break;case "ohlc":if(Math.abs(n.x2-a+n.x1-a)=n.y2&&f<=n.y3||a>=n.x1&&a<=(n.x2+n.x1)/2&&f>=n.y1-n.borderThickness/2&&f<=n.y1+n.borderThickness/2||a>=(n.x1+n.x2)/2&&a<=n.x2&&f>=n.y4-n.borderThickness/2&&f<=n.y4+n.borderThickness/2)c.push({dataPoint:d,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(n.x1-a),Math.abs(n.x2-a),Math.abs(n.y2-f),Math.abs(n.y3-f))}),l=!0}if(l||1E3p-e&&p+e>= this.dataPoints.length)break;-1===h?(e++,h=1):h=-1}a=null;for(f=0;fp[d].endValue;d++);a=d=p[d].startValue&&b<=p[d].endValue;m=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:m,label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:W(m,this.valueFormatString,this.chart._cultureInfo),a=new la(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:h,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius, 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:m,textBlock:a,effectiveHeight:null}))}d=n;for(b=this.intervalStartPosition;b<=e;b=parseFloat((this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,this.interval):b+this.interval).toFixed(12))){for(;dp[d].endValue;d++);a=d=p[d].startValue&&b<=p[d].endValue;m=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:m,label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:W(m,this.valueFormatString,this.chart._cultureInfo),a=new la(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:h,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness, cornerRadius:this.labelCornerRadius,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:m,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval),e=Ta(new Date(this.viewportMaximum),this.interval,this.intervalType),d=n,b=this.intervalStartPosition;b< e;Ta(b,c,this.intervalType)){for(a=b.getTime();dp[d].endValue;d++);m=a;a=d=p[d].startValue&&a<=p[d].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(m),label:this.labels[m]?this.labels[m]:null}):"axisX"===this.type&&this.labels[m]?this.labels[m]:Ba(m,this.valueFormatString,this.chart._cultureInfo),a=new la(this.ctx,{x:0,y:0,maxWidth:g,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness, cornerRadius:this.labelCornerRadius,maxHeight:h,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:m,textBlock:a,effectiveHeight:null,breaksLabelType:void 0}))}if("bottom"===this._position||"top"===this._position)l=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length? this.lineCoordinates.width*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*U[this.intervalType+"Duration"]*this.interval,g="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled|| (h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);else if("left"===this._position||"right"===this._position)l=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.height*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.height/(this.logarithmic&&this.equidistantInterval? Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*U[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(c=0;cthis.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*l>>0,n=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle= this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;bn&&(s=b,n=m.width)}b=0;for(b=this.intervalStartPosition>0>2*g&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap= this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle):y(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=g,q.width+f.width>>0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth> g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelWrap=this.labelWrap);else{if(y(this.options.labelWrap))if(!y(this.options.labelMaxWidth))this.options.labelMaxWidth>0,d=this.labelFontSize,np&&(p=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth=g,y(this.options.labelFontSize)&&12=2.2*g&&c<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelFontSize=d):c>=2.8* g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,n),this.sessionVariables.labelWrap=!0,y(this.options.labelFontSize)&&12=3.2*g&&c<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelFontSize= this.labelFontSize):c>3.6*g&&c<5*g?(y(this.options.labelFontSize)&&125*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=d,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelAngle= this.labelAngle));else if(s===b&&(0===s&&n+this._labels[s+1].textBlock.measureText().width-2*g>p||s===this._labels.length-1&&n+this._labels[s-1].textBlock.measureText().width-2*g>p||0p&&n+this._labels[s-1].textBlock.measureText().width-2*g>p))p=0===s?n+this._labels[s+1].textBlock.measureText().width-2*g:n+this._labels[s-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=y(this.options.labelFontSize)? d:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=m;else if(0===p)for(this.sessionVariables.labelFontSize=y(this.options.labelFontSize)?d:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,c=0;c>0>2*g&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),m=0!=this.labelAngle?(k-(t+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)): g,this.sessionVariables.labelMaxHeight=h=this.labelWrap?(k-m*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,y(this.options.labelWrap))?y(this.options.labelWrap)&&(this.labelWrap&&!y(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle, this.sessionVariables.labelMaxWidth=m,this.sessionVariables.labelMaxHeight=c<0.9*l?0.9*l:c,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m):(y(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:m,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight= h)}for(c=0;c>0:this.options.labelMaxWidth,h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=y(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b< this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=this._labels[b].textBlock;q=a.measureText();for(d=b+1;d>0,l-2*h>n&&(n=l-2*h,l>=2*h&&l<2.4*h?(y(this.options.labelFontSize)&&12=2.4*h&&l<2.8*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):l>=2.8*h&&l<3.2*h?(this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelWrap=!0,y(this.options.labelFontSize)&&12=3.2*h&&l<3.6*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):l>3.6*h&&l<10*h?(y(this.options.labelFontSize)&&1210*h&&l<50*h&&(y(this.options.labelFontSize)&&12this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap= this.labelWrap,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:g,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,y(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMaxHeight= h,y(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap)}for(c=0;c>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)x=y(g.options.labelWrap)? this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;y(g.labelBackgroundColor)&&(g.labelBackgroundColor="#EEEEEE")}else h="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,x=y(g.options.labelWrap)||g.labelWrap?"bottom"===this._position||"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,y(g.labelBackgroundColor)&&(y(g.startValue)&&0!==g.startValue?g.labelBackgroundColor= v?"transparent":null:g.labelBackgroundColor="#EEEEEE");a=new la(this.ctx,{x:0,y:0,backgroundColor:g.labelBackgroundColor,borderColor:g.labelBorderColor,borderThickness:g.labelBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?g.options.labelMaxWidth:h,maxHeight:x,angle:this.labelAngle,text:g.labelFormatter?g.labelFormatter({chart:this.chart,axis:this,stripLine:g}):g.label,horizontalAlign:"left",fontSize:"outside"===g.labelPlacement?g.options.labelFontSize?g.labelFontSize: this.labelFontSize:g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.labelFontFamily:this.labelFontFamily:g.labelFontFamily,fontWeight:"outside"===g.labelPlacement?g.options.labelFontWeight?g.labelFontWeight:this.labelFontWeight:g.labelFontWeight,fontColor:g.labelFontColor||g.color,fontStyle:"outside"===g.labelPlacement?g.options.labelFontStyle?g.labelFontStyle:this.fontWeight:g.labelFontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:g.value,textBlock:a, effectiveHeight:null,stripLine:g})}};C.prototype.createLabelsAndCalculateWidth=function(){var a=0,f=0;this._labels=[];this._stripLineLabels=[];if("left"===this._position||"right"===this._position){this.createLabels();for(f=0;fthis.viewportMinimum&&this._stripLineLabels[f].stripLine.valuen[d].viewportMaximum);s++)q[s].endValue=n[d].viewPortMinimum&&(n[d].scaleBreaks.lastBreakIndex=s));for(var x=s=0,u=0,z=0,C=0,G=0,B=0,A,H,L=l=0,J,I,N,q=J=I=N=!1,d=0;d s;){var E=0,T=0,U=0,X=0,V=e=0,K=0,Z=0,Y=0,W=0,M=0,aa=0;if(b&&0m.width-10?m.width-10:g.x2-aa-Z);if(a&&0m.width-10?m.width-10:g.x2-aa-Z),a[d]._labels&&1t&&(l+=0a[d].labelAngle?A-xt&&(l=H+u/2-t-aa),A-xa[d].labelAngle&&0m.width-10?m.width-10:g.x2-aa-Z),f[d].lineCoordinates.width=Math.abs(t-h),f[d]._labels&&1s;){W=Y=M=X=Z=K=V=e=U=Q=T=E=0;if(a&&0m.width-10?m.width-10:g.x2-W-V),b[d].labelAutoFit&&!y(z)&&(0b[d].labelAngle?Math.max(h,z):0===b[d].labelAngle?Math.max(h,z/2):h),0c[d].chart.width-10?c[d].chart.width-10:g.x2-W-V),c[d]&&c[d].labelAutoFit&&!y(G)&&(0b[d].chart.height-10?b[d].chart.height-10:g.y2),b[d].lineCoordinates.y1=l-(A[d]+b[d].margin+E),b[d].lineCoordinates.y2=l-(A[d]+b[d].margin+E),b[d].bounds={x1:h,y1:l-(A[d]+E+b[d].margin),x2:t,y2:k-(E+b[d].margin),width:t-h,height:A[d]},b[d].title&&(b[d]._titleTextBlock.maxWidth=0< b[d].titleMaxWidth&&b[d].titleMaxWidthm.height-Math.max(K,10)?m.height-Math.max(K,10):g.y2-X):g.y2>m.height-Math.max(K,10)?m.height-Math.max(K,10):g.y2;if(b&& 0b[K].labelAngle?Math.max(t,z):0===b[K].labelAngle?Math.max(t,z/2):t,h=0>b[K].labelAngle||0===b[K].labelAngle?t-Y:h);if(c&&0m.height-Math.max(K,10)?m.height-Math.max(K,10):g.y2-X):g.y2>m.height-Math.max(K,10)?m.height-Math.max(K,10):g.y2;if(b&&0b[K].labelAngle?Math.max(t,z):0===b[K].labelAngle?Math.max(t,z/2):t,h=0>b[K].labelAngle||0===b[K].labelAngle?t-W:h);if(c&&0f[g].spacing?0:Math.abs(f[g].spacing/b),this.logarithmic&&(f[g].size=Math.pow(this.logarithmBase,f[g].size))};C.prototype.calculateBreaksInPixels=function(){if(!(this.scaleBreaks&&0>=this.scaleBreaks._appliedBreaks.length)){var a=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];a.length&&(this.scaleBreaks.firstBreakIndex= this.scaleBreaks.lastBreakIndex=null);for(var f=0;fthis.conversionParameters.maximum);f++)a[f].endValue=this.conversionParameters.minimum&&(a[f].startPixel=this.convertValueToPixel(a[f].startValue),this.scaleBreaks.lastBreakIndex=f),a[f].endValue<=this.conversionParameters.maximum&&(a[f].endPixel=this.convertValueToPixel(a[f].endValue)))}};C.prototype.renderLabelsTicksAndTitle= function(){var a=this,f=!1,b=0,c=0,e=1,g=0;0!==this.labelAngle&&360!==this.labelAngle&&(e=1.2);if("undefined"===typeof this.options.interval){if("bottom"===this._position||"top"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var b=[],e=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,h,l=this.viewportMaximum,m=this.lineCoordinates.width/Math.log(this.range),k=this._labels.length-1;0<=k;k--){p=this._labels[k];if(p.position this.viewportMaximum||!(k===this._labels.length-1||hthis.lineCoordinates.width* e&&this.labelAutoFit&&(f=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var b=[],r,l=this.viewportMaximum,m=this.lineCoordinates.height/Math.log(this.range),k=this._labels.length-1;0<=k;k--){p=this._labels[k];if(p.positionthis.viewportMaximum||!(k===this._labels.length-1||rthis.lineCoordinates.height*e&&this.labelAutoFit&&(f=!0)}}this.logarithmic&&(!this.equidistantInterval&&this.labelAutoFit)&&this._labels.sort(function(a,b){return a.position-b.position}); var k=0,p,n;if("bottom"===this._position){for(k=0;kthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(n=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(n.x<<0)+0.5:n.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,n.y<<0),this.ctx.lineTo(c,n.y+this.tickLength<<0), this.ctx.stroke()),0===p.textBlock.angle?(n.x-=p.textBlock.width/2,n.y="inside"===this.labelPlacement?n.y-(this.tickLength+p.textBlock.fontSize/2):n.y+this.tickLength+p.textBlock.fontSize/2):(n.x="inside"===this.labelPlacement?0>this.labelAngle?n.x:n.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):n.x-(0>this.labelAngle?p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),n.y="inside"===this.labelPlacement?0>this.labelAngle?n.y-this.tickLength-5:n.y-this.tickLength-Math.abs(p.textBlock.width* Math.sin(Math.PI/180*this.labelAngle)+5):n.y+this.tickLength+Math.abs(0>this.labelAngle?p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:5)),p.textBlock.x=n.x,p.textBlock.y=n.y);"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(k=0;ka.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(n=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth= a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(n.x<<0)+0.5:n.x<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(b,n.y<<0);a.ctx.lineTo(b,n.y-a.tickLength<<0);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y2-this._titleTextBlock.height-3,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("top"=== this._position){for(k=0;kthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(n=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(n.x<<0)+0.5:n.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,n.y<<0),this.ctx.lineTo(c,n.y-this.tickLength<<0),this.ctx.stroke()),0===p.textBlock.angle? (n.x-=p.textBlock.width/2,n.y="inside"===this.labelPlacement?n.y+this.labelFontSize/2+this.tickLength+5:n.y-(this.tickLength+p.textBlock.height-p.textBlock.fontSize/2)):(n.x="inside"===this.labelPlacement?0a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(n=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===this.ctx.lineWidth%2?(n.x<<0)+0.5:n.x<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(b,n.y<<0);a.ctx.lineTo(b,n.y+a.tickLength<<0);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/ 2,this._titleTextBlock.y=this.bounds.y1+1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("left"===this._position){for(k=0;kthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(n=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth% 2?(n.y<<0)+0.5:n.y<<0,this.ctx.beginPath(),this.ctx.moveTo(n.x<<0,c),this.ctx.lineTo(n.x-this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(p.textBlock.y=n.y,p.textBlock.x="inside"===this.labelPlacement?n.x+this.tickLength+5:n.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5):(p.textBlock.y="inside"===this.labelPlacement?n.y:n.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?n.x+this.tickLength+5:0a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(n=a.getPixelCoordinatesOnAxis(p.position), a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(n.y<<0)+0.5:n.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(n.x<<0,b);a.ctx.lineTo(n.x+a.tickLength<<0,b);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x1+1,this._titleTextBlock.y=this.lineCoordinates.height/2+this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("right"=== this._position){for(k=0;kthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(n=this.getPixelCoordinatesOnAxis(p.position),this.tickThickness&&"inside"!=this.labelPlacement&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(n.y<<0)+0.5:n.y<<0,this.ctx.beginPath(),this.ctx.moveTo(n.x<<0,c),this.ctx.lineTo(n.x+this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle? (p.textBlock.y=n.y,p.textBlock.x="inside"===this.labelPlacement?n.x-p.textBlock.width-this.tickLength-5:n.x+this.tickLength+5):(p.textBlock.y="inside"===this.labelPlacement?n.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0>this.labelAngle?n.y:n.y-(p.textBlock.height-p.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?n.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:0a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(n=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(n.y<< 0)+0.5:n.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(n.x<<0,b);a.ctx.lineTo(n.x-a.tickLength<<0,b);a.ctx.stroke();a.ctx.restore()}},this);this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.bounds.x2-1,this._titleTextBlock.y=this.lineCoordinates.height/2-this._titleTextBlock.width/2+this.lineCoordinates.y1,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}g=0;if("inside"===this.labelPlacement)this.chart.addEventListener("dataAnimationIterationEnd", function(){for(k=0;ka.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit&&p.skipFlag)||(a.ctx.save(),a.ctx.beginPath(),p.textBlock.render(!0),a.ctx.restore())},p.textBlock);else for(k=0;kthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit&&p.skipFlag)||p.textBlock.render(!0)};C.prototype.renderInterlacedColors=function(){var a=this.chart.plotArea.ctx, f,b,c=this.chart.plotArea,e=0;f=!0;if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,e=0;ethis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[e+1].position),a.fillRect(Math.min(b.x,f.x),c.y1,Math.abs(b.x-f.x),Math.abs(c.y1-c.y2)),f=!1):f=!0;else if(("left"===this._position||"right"=== this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,e=0;ethis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[e+1].position),a.fillRect(c.x1,Math.min(b.y,f.y),Math.abs(c.x1-c.x2),Math.abs(f.y-b.y)),f=!1):f=!0;a.beginPath()};C.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0this.viewportMaximum||y(k.value)||isNaN(this.range))||l.push(k))}for(c=0;cthis.viewportMaximum||isNaN(this.range))){a=this.getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(k&& (this.ctx.strokeStyle=k.color,"pixel"===k._thicknessType&&(this.ctx.lineWidth=k.thickness)),"bottom"===this._position){var r=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0;this.ctx.beginPath();this.ctx.moveTo(r,a.y<<0);this.ctx.lineTo(r,a.y+this.tickLength<<0);this.ctx.stroke();0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y+=this.tickLength+b.textBlock.fontSize/2):(a.x-=0>this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,a.y+=this.tickLength+Math.abs(0>this.labelAngle?b.textBlock.width* Math.sin(Math.PI/180*this.labelAngle)-5:5))}else"top"===this._position?(r=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,this.ctx.beginPath(),this.ctx.moveTo(r,a.y<<0),this.ctx.lineTo(r,a.y-this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y-=this.tickLength+b.textBlock.height):(a.x+=(b.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.labelAngle?a.y:a.y-(b.textBlock.height- b.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0this.chart.plotArea.x1?y(k.startValue)?a.x-=b.textBlock.height- b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,y(k.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y1+b.textBlock.width+3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-b.textBlock.width- 3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.height-3,b.textBlock.measureText(),a.x-b.textBlock.height>this.chart.plotArea.x1?y(k.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,y(k.startValue)? a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+b.textBlock.width+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y2-3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y2- b.textBlock.width-3):"left"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.width-3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-b.textBlock.height>this.chart.plotArea.y1?y(k.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3:a.y-b.textBlock.heightthis.chart.plotArea.y1? y(k.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize/2-3:a.y-b.textBlock.heightthis.viewportMaximum|| isNaN(this.range))||a[f].render(this.maskCtx);this.maskCtx.restore()}};C.prototype.renderCrosshair=function(a,f){this.crosshair.render(a,f)};C.prototype.renderGrid=function(){if(this.gridThickness&&0this.viewportMaximum||this._labels[c].breaksLabelType)||(a.beginPath(),f=this.getPixelCoordinatesOnAxis(this._labels[c].position),f=1===a.lineWidth%2?(f.x<<0)+0.5:f.x<<0,a.moveTo(f,b.y1<<0),a.lineTo(f,b.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var c=0;cthis.viewportMaximum||this._labels[c].breaksLabelType)||(a.beginPath(), f=this.getPixelCoordinatesOnAxis(this._labels[c].position),f=1===a.lineWidth%2?(f.y<<0)+0.5:f.y<<0,a.moveTo(b.x1<<0,f),a.lineTo(b.x2<<0,f),a.stroke());a.restore()}};C.prototype.renderAxisLine=function(){var a=this.chart.ctx,f=v?this.chart._preRenderCtx:a,b=Math.ceil(this.tickThickness/(this.reversed?-2:2)),c=Math.ceil(this.tickThickness/(this.reversed?2:-2)),e,g;f.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){this.reversed?(e=this.lineCoordinates.x2,g=this.lineCoordinates.x1): (e=this.lineCoordinates.x1,g=this.lineCoordinates.x2);f.lineWidth=this.lineThickness;f.strokeStyle=this.lineColor?this.lineColor:"black";f.setLineDash&&f.setLineDash(G(this.lineDashType,this.lineThickness));var h=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;f.beginPath();if(this.scaleBreaks&&!y(this.scaleBreaks.firstBreakIndex))if(y(this.scaleBreaks.lastBreakIndex))e=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+c;else for(var l= this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)f.moveTo(e,h),f.lineTo(this.scaleBreaks._appliedBreaks[l].startPixel+b,h),e=this.scaleBreaks._appliedBreaks[l].endPixel+c;e&&(f.moveTo(e,h),f.lineTo(g,h));f.stroke()}}else if(("left"===this._position||"right"===this._position)&&this.lineThickness){this.reversed?(e=this.lineCoordinates.y1,g=this.lineCoordinates.y2):(e=this.lineCoordinates.y2,g=this.lineCoordinates.y1);f.lineWidth=this.lineThickness;f.strokeStyle=this.lineColor; f.setLineDash&&f.setLineDash(G(this.lineDashType,this.lineThickness));h=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<<0;f.beginPath();if(this.scaleBreaks&&!y(this.scaleBreaks.firstBreakIndex))if(y(this.scaleBreaks.lastBreakIndex))e=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+b;else for(l=this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)f.moveTo(h,e),f.lineTo(h,this.scaleBreaks._appliedBreaks[l].startPixel+c), e=this.scaleBreaks._appliedBreaks[l].endPixel+b;e&&(f.moveTo(h,e),f.lineTo(h,g));f.stroke()}v&&(a.drawImage(this.chart._preRenderCanvas,0,0,this.chart.width,this.chart.height),this.chart._breaksCanvasCtx&&this.chart._breaksCanvasCtx.drawImage(this.chart._preRenderCanvas,0,0,this.chart.width,this.chart.height),f.clearRect(0,0,this.chart.width,this.chart.height));f.restore()};C.prototype.getPixelCoordinatesOnAxis=function(a){var f={};if("bottom"===this._position||"top"===this._position)f.x=this.convertValueToPixel(a), f.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)f.y=this.convertValueToPixel(a),f.x=this.lineCoordinates.x2;return f};C.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var f=0,b=0,c,f=!0,e=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],b="number"===typeof a?a:"left"===this._position||"right"===this._position?a.y:a.x;if(this.logarithmic){a=c=Math.pow(this.logarithmBase,(b-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit); if(b<=this.conversionParameters.reference===("left"===this._position||"right"===this._position)!==this.reversed)for(b=0;be[b].startValue/this.conversionParameters.minimum){c/=e[b].startValue/this.conversionParameters.minimum;if(ce[b].startValue/e[b-1].endValue){c/=e[b].startValue/e[b-1].endValue;if(cthis.conversionParameters.minimum))if(f)if(e[b].endValue>this.conversionParameters.minimum){if(1e[b].startValue){a=Math.pow(e[b].endValue/e[b].startValue,Math.log(c)/Math.log(e[b].size));break}else a*=e[b].startValue/this.conversionParameters.minimum*Math.pow(e[b].size,Math.log(e[b].startValue/this.conversionParameters.minimum)/Math.log(e[b].endValue/e[b].startValue))*c,c*=Math.pow(e[b].size,Math.log(this.conversionParameters.minimum/e[b].startValue)/Math.log(e[b].endValue/e[b].startValue));f=!1}else if(c1/e[b].size){a*=Math.pow(e[b].endValue/e[b].startValue,1>=e[b].size?1:Math.log(c)/Math.log(e[b].size))*c;break}else a/=e[b].endValue/e[b].startValue/e[b].size;c*=e[b].size;f=!1}else break;else if(c1/e[b].size){a*=Math.pow(e[b].endValue/e[b].startValue,1>=e[b].size?1:Math.log(c)/Math.log(e[b].size))*c;break}else a/=e[b].endValue/e[b].startValue/e[b].size;c*=e[b].size}else break; f=a*this.viewportMinimum}else{a=c=(b-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit;if(b<=this.conversionParameters.reference===("left"===this._position||"right"===this._position)!==this.reversed)for(b=0;b=e[b].size?0:c*(e[b].endValue- e[b].startValue)/e[b].size;break}else a+=e[b].endValue-this.conversionParameters.minimum-e[b].size*(e[b].endValue-this.conversionParameters.minimum)/(e[b].endValue-e[b].startValue),c-=e[b].size*(e[b].endValue-this.conversionParameters.minimum)/(e[b].endValue-e[b].startValue);f=!1}else if(c>e[b].startValue-this.conversionParameters.minimum){c-=e[b].startValue-this.conversionParameters.minimum;if(ce[b].startValue-e[b-1].endValue){c-=e[b].startValue-e[b-1].endValue;if(cthis.conversionParameters.minimum))if(f)if(e[b].endValue>this.conversionParameters.minimum)if(e[b].size&&this.conversionParameters.minimum+c*(e[b].endValue- e[b].startValue)/e[b].size>e[b].startValue){a=0>=e[b].size?0:c*(e[b].endValue-e[b].startValue)/e[b].size;break}else a+=e[b].startValue-this.conversionParameters.minimum+e[b].size*(this.conversionParameters.minimum-e[b].startValue)/(e[b].endValue-e[b].startValue),c+=e[b].size*(this.conversionParameters.minimum-e[b].startValue)/(e[b].endValue-e[b].startValue),f=!1;else if(c-1*e[b].size){a+=(e[b].endValue- e[b].startValue)*(0===e[b].size?1:c/e[b].size)+c;break}else a-=e[b].endValue-e[b].startValue-e[b].size;c+=e[b].size;f=!1}else break;else if(c-1*e[b].size){a+=(e[b].endValue-e[b].startValue)*(0===e[b].size?1:c/e[b].size)+c;break}else a-=e[b].endValue-e[b].startValue-e[b].size;c+=e[b].size}else break;f=this.conversionParameters.minimum+a}return f};C.prototype.convertValueToPixel=function(a){a=this.getApparentDifference(this.conversionParameters.minimum, a,a);return this.logarithmic?this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*Math.log(a/this.conversionParameters.minimum)/this.conversionParameters.lnLogarithmBase+0.5<<0:this.conversionParameters.reference+this.conversionParameters.pixelPerUnit*(a-this.conversionParameters.minimum)+0.5<<0};C.prototype.getApparentDifference=function(a,f,b,c){var e=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];if(this.logarithmic){b=y(b)?f/a:b;for(var g=0;g e[g].endValue||(a<=e[g].startValue&&f>=e[g].endValue?b=b/e[g].endValue*e[g].startValue*e[g].size:a>=e[g].startValue&&f>=e[g].endValue?b=b/e[g].endValue*a*Math.pow(e[g].size,Math.log(e[g].endValue/a)/Math.log(e[g].endValue/e[g].startValue)):a<=e[g].startValue&&f<=e[g].endValue?b=b/f*e[g].startValue*Math.pow(e[g].size,Math.log(f/e[g].startValue)/Math.log(e[g].endValue/e[g].startValue)):!c&&(a>e[g].startValue&&fe[g].endValue||(a<=e[g].startValue&&f>=e[g].endValue?b=b-e[g].endValue+e[g].startValue+e[g].size:a>e[g].startValue&&f>=e[g].endValue?b=b-e[g].endValue+a+e[g].size*(e[g].endValue-a)/(e[g].endValue-e[g].startValue):a<=e[g].startValue&&fe[g].startValue&&fa[e].endValue||(this.viewportMinimum>=a[e].startValue&&this.viewportMaximum<=a[e].endValue?b=0:this.viewportMinimum<=a[e].startValue&&this.viewportMaximum>=a[e].endValue?(c=c/a[e].endValue*a[e].startValue, b=0a[e].startValue&&this.viewportMaximum>=a[e].endValue?(c=c/a[e].endValue*this.viewportMinimum,b=0a[e].endValue||(this.viewportMinimum>= a[e].startValue&&this.viewportMaximum<=a[e].endValue?b=0:this.viewportMinimum<=a[e].startValue&&this.viewportMaximum>=a[e].endValue?(c=c-a[e].endValue+a[e].startValue,b=0a[e].startValue&&this.viewportMaximum>=a[e].endValue?(c=c-a[e].endValue+this.viewportMinimum,b=0this.maxWidth?8:6);var a=Math.max(c,Math.floor(this.maxWidth/a)),e,g,h,c=0;!y(this.options.viewportMinimum)&&(!y(this.options.viewportMaximum)&&this.options.viewportMinimum>=this.options.viewportMaximum)&&(this.viewportMinimum=this.viewportMaximum=null);if(y(this.options.viewportMinimum)&&!y(this.sessionVariables.newViewportMinimum)&& !isNaN(this.sessionVariables.newViewportMinimum))this.viewportMinimum=this.sessionVariables.newViewportMinimum;else if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(y(this.options.viewportMaximum)&&!y(this.sessionVariables.newViewportMaximum)&&!isNaN(this.sessionVariables.newViewportMaximum))this.viewportMaximum=this.sessionVariables.newViewportMaximum;else if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum; if(this.scaleBreaks)for(c=0;c=this.scaleBreaks._appliedBreaks[c].startValue||!y(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[c].startValue||!y(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[c].startValue)&&(!y(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[c].endValue|| !y(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[c].endValue||!y(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[c].endValue)){this.scaleBreaks._appliedBreaks.splice(c,1);break}if("axisX"===this.type){if(this.dataSeries&&0g?(c=Math.min(0.01*Math.abs(this.getApparentDifference(g,e,null,!0)),5),0<=g?e=g-c:g=isFinite(e)?e+c:0):(c=Math.min(0.01*Math.abs(this.getApparentDifference(e,g,null,!0)),0.05),0!==g&&(g+=c),0!==e&&(e-=c)),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0));c=this.getApparentDifference(isNaN(this.viewportMinimum)||null===this.viewportMinimum?e:this.viewportMinimum,isNaN(this.viewportMaximum)||null===this.viewportMaximum?g:this.viewportMaximum,null,!0);if("axisX"===this.type&&b){this.intervalType||(c/1<=a?(this.interval=1,this.intervalType="millisecond"):c/2<=a?(this.interval=2,this.intervalType= "millisecond"):c/5<=a?(this.interval=5,this.intervalType="millisecond"):c/10<=a?(this.interval=10,this.intervalType="millisecond"):c/20<=a?(this.interval=20,this.intervalType="millisecond"):c/50<=a?(this.interval=50,this.intervalType="millisecond"):c/100<=a?(this.interval=100,this.intervalType="millisecond"):c/200<=a?(this.interval=200,this.intervalType="millisecond"):c/250<=a?(this.interval=250,this.intervalType="millisecond"):c/300<=a?(this.interval=300,this.intervalType="millisecond"):c/400<=a? (this.interval=400,this.intervalType="millisecond"):c/500<=a?(this.interval=500,this.intervalType="millisecond"):c/(1*U.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*U.secondDuration)<=a?(this.interval=2,this.intervalType="second"):c/(5*U.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*U.secondDuration)<=a?(this.interval=10,this.intervalType="second"):c/(15*U.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*U.secondDuration)<=a?(this.interval= 20,this.intervalType="second"):c/(30*U.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*U.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*U.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):c/(5*U.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*U.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):c/(15*U.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*U.minuteDuration)<=a?(this.interval= 20,this.intervalType="minute"):c/(30*U.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*U.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*U.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):c/(3*U.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*U.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1*U.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*U.dayDuration)<=a?(this.interval=2,this.intervalType="day"): c/(4*U.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*U.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*U.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*U.weekDuration)<=a?(this.interval=3,this.intervalType="week"):c/(1*U.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*U.monthDuration)<=a?(this.interval=2,this.intervalType="month"):c/(3*U.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*U.monthDuration)<=a?(this.interval= 6,this.intervalType="month"):(this.interval=c/(1*U.yearDuration)<=a?1:c/(2*U.yearDuration)<=a?2:c/(4*U.yearDuration)<=a?4:Math.floor(C.getNiceNumber(c/(a-1),!0)/U.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=e-h/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=g+h/2;f?this.autoValueFormatString="MMM DD YYYY HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===this.intervalType? this.autoValueFormatString="MMM YYYY":"week"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"hour"===this.intervalType?this.autoValueFormatString="hh:mm TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm TT":"second"===this.intervalType?this.autoValueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.valueFormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType= "number";c=C.getNiceNumber(c,!1);this.interval=this.options&&0g?(c=Math.min(0.01*Math.abs(this.getApparentDifference(g,e,null,!0)),5),0<=g?e=g-c:g=isFinite(e)?e+c:0):(c=Math.min(0.01*Math.abs(this.getApparentDifference(e,g,null,!0)),0.05),0!==g&&(g+=c), 0!==e&&(e-=c)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,e="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0)),Math.abs(this.getApparentDifference(e,g,null,!0)),"axisX"===this.type&&b){this.valueType= "dateTime";if(null===this.minimum||isNaN(this.minimum))this.minimum=e-h/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+h/2}else this.intervalType=this.valueType="number",null===this.minimum&&(this.minimum="axisX"===this.type?e-h/2:Math.floor(e/this.interval)*this.interval,this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="axisX"=== this.type?g+h/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimum&&(0===this.options.minimum?this.maximum+=10:0===this.options.maximum&&(this.minimum-=10));y(this.sessionVariables.newViewportMinimum)&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));y(this.sessionVariables.newViewportMaximum)&& (this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum));this.range=this.viewportMaximum-this.viewportMinimum;this.intervalStartPosition="axisX"===this.type&&b?this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval):Math.floor((this.viewportMinimum+0.2*this.interval)/this.interval)*this.interval;this.valueFormatString||(this.valueFormatString=C.generateValueFormatString(this.range,2))}};C.prototype.calculateLogarithmicAxisParameters=function(){var a=this.chart.layoutManager.getFreeSpace(), f=Math.log(this.logarithmBase),b;"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?7:Math.max(7,Math.floor(this.maxWidth/100)):Math.max(Math.floor(this.maxWidth/50),3),c,e,g,h;h=1;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum; if(this.scaleBreaks)for(h=0;h=this.scaleBreaks._appliedBreaks[h].startValue||!y(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[h].startValue||!y(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[h].startValue)&&(!y(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[h].endValue|| !y(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[h].endValue||!y(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[h].endValue)){this.scaleBreaks._appliedBreaks.splice(h,1);break}"axisX"===this.type?(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,e=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===e/c&&(h=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval? 0.4:this.options.interval),e*=h,c/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:e/c>this.logarithmBase?e/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,e=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=c&&!isFinite(e)?(e="undefined"===typeof this.options.interval?0:this.options.interval,c=1):0>=c?c=e:isFinite(e)||(e=c),1===c&&1===e?(e*=this.logarithmBase- 1/this.logarithmBase,c=1):1===e/c?(h=Math.min(e*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),e*=h,c/=h):c>e?(h=Math.min(c/e*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=e?c=e/h:e=c*h):(h=Math.min(e/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==e&&(e*=h),1!==c&&(c/=h)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:e/c>this.logarithmBase?e/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null=== this.viewportMinimum||isNaN(this.viewportMinimum))&&1e&&(e=1));h=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?e:this.viewportMaximum)/(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);linearRange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?e:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);this.intervalType= "number";h=Math.pow(this.logarithmBase,C.getNiceNumber(Math.abs(Math.log(h)/f),!1));this.options&&0this.logarithmBase?e/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.minimum? this.minimum:this.dataInfo.min,e=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(c)||isFinite(e)?1===c&&1===e?(e*=this.logarithmBase,c/=this.logarithmBase):1===e/c?(h=Math.pow(this.logarithmBase,this.interval),e*=h,c/=h):c>e?(h=Math.min(0.01*(c/e),5),1<=e?c=e/h:e=c*h):(h=Math.min(e/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==e&&(e*=h),1!==c&&(c/=h)):(e="undefined"===typeof this.options.interval?0:this.options.interval,c=1),g=Infinity!==this.dataInfo.minDiff? this.dataInfo.minDiff:e/c>this.logarithmBase?e/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1e&&(e=1)),this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?c/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(c)/f/this.interval)),this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum|| isNaN(this.sessionVariables.viewportMinimum)?"undefined"===typeof this.sessionVariables.newViewportMinimum?Infinity:this.sessionVariables.newViewportMinimum:this.sessionVariables.viewportMinimum)),null===this.maximum&&(this.maximum="axisX"===this.type?e*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(e)/f/this.interval)),this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?"undefined"===typeof this.sessionVariables.newViewportMaximum? 0:this.sessionVariables.newViewportMaximum:this.sessionVariables.viewportMaximum)),1===this.maximum&&1===this.minimum&&(1===this.options.minimum?this.maximum*=this.logarithmBase-1/this.logarithmBase:1===this.options.maximum&&(this.minimum/=this.logarithmBase-1/this.logarithmBase));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);this.viewportMaximum=Math.min(this.viewportMaximum,this.maximum);this.viewportMinimum>this.viewportMaximum&&(!this.options.viewportMinimum&&!this.options.minimum|| this.options.viewportMaximum||this.options.maximum?this.options.viewportMinimum||this.options.minimum||!this.options.viewportMaximum&&!this.options.maximum||(this.viewportMinimum=this.minimum=(this.options.viewportMaximum||this.options.maximum)/Math.pow(this.logarithmBase,2*Math.ceil(this.interval))):this.viewportMaximum=this.maximum=this.options.viewportMinimum||this.options.minimum);c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(f*this.interval)+0.2)*this.interval);this.range= this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&&this.rangethis.viewportMaximum||3>a?2:3)){for(f=Math.floor(this.viewportMinimum/b+0.5)*b;fthis.interval&&(this.interval=b,c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(f*this.interval)+0.2)*this.interval))), this.equidistantInterval=!0,this.intervalStartPosition=c;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){f=Math.floor(Math.abs(Math.log(this.viewportMinimum)/Math.LN10))+2;if(isNaN(f)||!isFinite(f))f=2;if(2a&&(c+=Math.floor(Math.abs(Math.log(a)/Math.LN10)),isNaN(c)||!isFinite(c))&&(c=f);for(var e=0;eb?1>=c?1:5>=c?5:10:Math.max(Math.floor(c),1);return Number((c*Math.pow(10,b)).toFixed(20))};C.getNiceNumber=function(a,f){var b=Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b);return Number(((f?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)).toFixed(20))};C.prototype.getLabelStartPoint=function(){var a=U[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!== this.intervalType)if("second"===this.intervalType)0=a||"bottom"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(c,l),this.ctx.lineTo(h,l),this.ctx.lineTo(h,e);else if("wavy"===this.type){m=c;k=e;g=0.5;r=(l-k)/a/3;for(var n=0;n=a||"right"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(h,e),this.ctx.lineTo(h,l),this.ctx.lineTo(c,l);else if("wavy"===this.type){m=c;k=e;g=0.5;r=(h-m)/a/3;for(n=0;nthis.parent.range?2:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.parent.range?2:10>this.parent.range?1:0):50this.parent.range?2:10>this.parent.range?1:0);this.valueFormatString=C.generateValueFormatString(this.parent.range,k)}var l=null===this.opacity?1: this.opacity,k=Math.abs("pixel"===this._thicknessType?this.thickness:this.parent.conversionParameters.pixelPerUnit*this.thickness),r=this.chart.overlaidCanvasCtx,p=r.globalAlpha;r.globalAlpha=l;r.beginPath();r.strokeStyle=this.color;r.lineWidth=k;r.save();this.labelFontSize=y(this.options.labelFontSize)?this.parent.labelFontSize:this.labelFontSize;if("left"===this.parent._position||"right"===this.parent._position)this.labelMaxWidth=y(this.options.labelMaxWidth)?this.parent.bounds.x2-this.parent.bounds.x1: this.labelMaxWidth,this.labelMaxHeight=y(this.options.labelWrap)||this.labelWrap?3*this.chart.height:2*this.labelFontSize;else if("top"===this.parent._position||"bottom"===this.parent._position)this.labelMaxWidth=y(this.options.labelMaxWidth)?3*this.chart.width:this.labelMaxWidth,this.labelMaxHeight=y(this.options.labelWrap)||this.labelWrap?this.parent.bounds.height:2*this.labelFontSize;0this.chart.bounds.x2?l.x=this.chart.bounds.x2-l.width:l.xthis.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2);"left"===this.parent._position?l.x=this.parent.lineCoordinates.x2-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2)}}else if("bottom"=== this.parent._position||"top"===this.parent._position){n=this.parent.convertPixelToValue({x:a});for(q=0;qthis.chart.bounds.x2&&(l.x=this.chart.bounds.x2-l.width);l.xthis.chart.bounds.y2&& (l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2);"left"===this.parent._position?l.x=this.parent.lineCoordinates.x2-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2)}h=null;("bottom"===this.parent._position||"top"===this.parent._position)&&(b>=this.parent.convertValueToPixel(this.parent.viewportMinimum)&&c<=this.parent.convertValueToPixel(this.parent.viewportMaximum))&&(0=this.parent.convertValueToPixel(this.parent.viewportMaximum)&&e<=this.parent.convertValueToPixel(this.parent.viewportMinimum))&&(0this.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2);"left"===this.parent._position?l.x=this.parent.lineCoordinates.x1-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2)}else{if("bottom"===this.parent._position||"top"===this.parent._position)l.text= this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):y(this.options.label)?W(this.parent.convertPixelToValue(a),this.valueFormatString,this.chart._cultureInfo):this.label,l.x=b-l.measureText().width/2,l.x+l.width>this.chart.bounds.x2&&(l.x=this.chart.bounds.x2-l.width),l.xthis.chart.bounds.x2&&(l.x=this.chart.bounds.x2-l.width);l.xthis.chart.bounds.y2&&(l.y=this.chart.bounds.y2-l.measureText().height+l.fontSize/2),"left"===this.parent._position?l.x=this.parent.lineCoordinates.x2-l.measureText().width:"right"===this.parent._position&&(l.x=this.parent.lineCoordinates.x2);0(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this.chart.resetOverlayedCanvas(),this._updateToolTip(a,f))};Y.prototype._updateToolTip=function(a,f,b){b="undefined"===typeof b?!0:b;this.container||this._initialize();this.enabled||this.hide();if(!this.chart.disableToolTip){if("undefined"===typeof a||"undefined"===typeof f){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;f=this._prevY}else this._prevX=a,this._prevY=f; var c=null,e=null,g=[],h=0;if(this.shared&&this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){if("xySwapped"===this.chart.plotInfo.axisPlacement){var l=[];if(this.chart.axisX)for(var m=0;mk.dataSeries.axisY.viewportMaximum&&b++;b-k.dataPoint.y.length&&g.push(k)}else"column"===e.type||"bar"===e.type?0>k.dataPoint.y?0>k.dataSeries.axisY.viewportMinimum&&k.dataSeries.axisY.viewportMaximum>=k.dataPoint.y&&g.push(k):k.dataSeries.axisY.viewportMinimum<=k.dataPoint.y&&0<=k.dataSeries.axisY.viewportMaximum&&g.push(k):"bubble"===e.type?(b=this.chart._eventManager.objectMap[e.dataPointIds[k.index]].size/ 2,k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum-b&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum+b&&g.push(k)):"waterfall"===e.type?(b=0,k.cumulativeSumYStartValuek.dataSeries.axisY.viewportMaximum&&b++,k.cumulativeSumk.dataSeries.axisY.viewportMaximum&&b++,2>b&&-2= k.dataSeries.axisY.viewportMinimum&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum)&&g.push(k);else g.push(k)}}if(0a&&(a+=this.container.clientWidth+ 20);a+this.container.clientWidth>Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(this.chart.container.clientWidth,this.chart.width)-this.container.clientWidth));f=1!==g.length||this.shared||"line"!==g[0].dataSeries.type&&"stepLine"!==g[0].dataSeries.type&&"spline"!==g[0].dataSeries.type&&"area"!==g[0].dataSeries.type&&"stepArea"!==g[0].dataSeries.type&&"splineArea"!==g[0].dataSeries.type?"bar"===g[0].dataSeries.type||"rangeBar"===g[0].dataSeries.type||"stackedBar"=== g[0].dataSeries.type||"stackedBar100"===g[0].dataSeries.type?g[0].dataSeries.axisX.convertValueToPixel(g[0].dataPoint.x):f:g[0].dataSeries.axisY.convertValueToPixel(g[0].dataPoint.y);f=-f+10;0":"X:{axisXIndex}
":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content? this.content:"{name}:  {y}",m=b.axisXIndex):"bubble"===b.type?(this.chart.axisX&&1":"X:{axisXIndex}
":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y},   {z}"): "rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"error"===b.type?(this.chart.axisX&&1":"X:{axisXIndex}
":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y[0]}, {y[1]}"):"candlestick"=== b.type||"ohlc"===b.type?(this.chart.axisX&&1":"X:{axisXIndex}
":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:
Open:   {y[0]}
High:    {y[1]}
Low:   {y[2]}
Close:   {y[3]}"):"boxAndWhisker"=== b.type&&(this.chart.axisX&&1":"X:{axisXIndex}
":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:
Minimum:   {y[0]}
Q1:               {y[1]}
Q2:               {y[4]}
Q3:               {y[2]}
Maximum:  {y[3]}"), null===f&&(f=""),!0===this.reversed?(f=this.chart.replaceKeywordsWithValue(g,c,b,e)+f,l"+f)):(f+=this.chart.replaceKeywordsWithValue(g,c,b,e),l")));null!==f&&(f=k+f)}else{b=a[0].dataSeries;c=a[0].dataPoint;e=a[0].index;if(null===c.toolTipContent||"undefined"===typeof c.toolTipContent&&null===b.options.toolTipContent)return null;"line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"stepArea"===b.type||"splineArea"===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||"waterfall"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(c.label?"{label}":"{x}")+":  {y}":"bubble"===b.type?g=c.toolTipContent? c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(c.label?"{label}":"{x}")+":  {y},   {z}":"pie"===b.type||"doughnut"===b.type||"funnel"===b.type||"pyramid"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(c.name?"{name}:  ":c.label?"{label}:  ":"")+"{y}":"rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"error"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(c.label?"{label}":"{x}")+" :  {y[0]},  {y[1]}": "candlestick"===b.type||"ohlc"===b.type?g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(c.label?"{label}":"{x}")+"
Open:   {y[0]}
High:    {y[1]}
Low:     {y[2]}
Close:   {y[3]}":"boxAndWhisker"===b.type&&(g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent: this.content&&"function"!==typeof this.content?this.content:""+(c.label?"{label}":"{x}")+"
Minimum:   {y[0]}
Q1:               {y[1]}
Q2:               {y[4]}
Q3:               {y[2]}
Maximum:  {y[3]}"); null===f&&(f="");f+=this.chart.replaceKeywordsWithValue(g,c,b,e)}return f};Y.prototype.enableAnimation=function(){if(!this.container.style.WebkitTransition){var a=this.getContainerTransition(this.containerTransitionDuration);this.container.style.WebkitTransition=a;this.container.style.MsTransition=a;this.container.style.transition=a;this.container.style.MozTransition=this.mozContainerTransition}};Y.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition= "",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};Y.prototype.hide=function(a){this.container&&(this.container.style.display="none",this.currentSeriesIndex=-1,this._prevY=this._prevX=NaN,("undefined"===typeof a||a)&&this.chart.resetOverlayedCanvas())};Y.prototype.show=function(a,f,b){this._updateToolTip(a,f,"undefined"===typeof b?!1:b)};Y.prototype.fixMozTransitionDelay=function(a,f){if(20c&&a.push(f),f.animationCallback(c),1<=c&&f.onComplete)f.onComplete();this.animations=a;0g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function P(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX= a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function Q(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function E(a,b,c){return Math.min(c,Math.max(b,a))}function F(a,b,c){0>c&&c++;16*c?a+6*(b-a)*c: 1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function G(a){if(a in H)return H[a];var b,c=1;a=String(a);if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=Q(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=v[E(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=Q(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=E(parseFloat(e[1])/100,0,1);e=E(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=F(d,f,b+1/3);e=F(d,f,b);b=F(d,f,b-1/3)}b="#"+ v[Math.floor(255*g)]+v[Math.floor(255*e)]+v[Math.floor(255*b)];c=c[3]}else b=Z[a]||a;return H[a]={color:b,alpha:c}}function C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*q;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute", c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function R(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function S(a,b){var c=G(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("')}function T(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,k=g.x-c.x,n=g.y-c.y;if(e instanceof w){var h=0,l=g=0,u=0,m=1;if("gradient"==e.type_){h=e.x1_/f;c=e.y1_/d;var p=s(a,e.x0_/f,e.y0_/d),h=s(a,h,c),h=180*Math.atan2(h.x-p.x,h.y-p.y)/Math.PI;0>h&&(h+=360);1E-6>h&&(h=0)}else p=s(a,e.x0_,e.y0_),g=(p.x-c.x)/k,l=(p.y-c.y)/n,k/=f*q, n/=d*q,m=x.max(k,n),u=2*e.r0_/m,m=2*e.r1_/m-u;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});d=f.length;p=f[0].color;c=f[d-1].color;k=f[0].alpha*a.globalAlpha;a=f[d-1].alpha*a.globalAlpha;for(var n=[],r=0;r')}else e instanceof I?k&&n&&b.push("'):(e=G(a.fillStyle),b.push(''))}function s(a,b,c){a=a.m_;return{x:q*(b*a[0][0]+c*a[1][0]+a[2][0])-r,y:q*(b*a[0][1]+c*a[1][1]+a[2][1])-r}}function z(a,b,c){isFinite(b[0][0])&&(isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1]))&&(a.m_=b,c&&(a.lineScale_=aa(ba(b[0][0]*b[1][1]-b[0][1]* b[1][0]))))}function w(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function I(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new A("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new A("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new A("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height} function A(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var x=Math,k=x.round,J=x.sin,K=x.cos,ba=x.abs,aa=x.sqrt,q=10,r=q/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var M=Array.prototype.slice;O(document);var U={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",W(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var b=0;bd;d++)for(var B=0;16>B;B++)v[16*d+B]=d.toString(16)+B.toString(16);var Z={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC", bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000", darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082", ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA", mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5", peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"}, H={},L={},$={butt:"flat",round:"round"},d=C.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo= function(a,b,c,g,e,f){e=s(this,e,f);a=s(this,a,b);c=s(this,c,g);R(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=s(this,a,b);c=s(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};R(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){c*=q;var d=f?"at":"wa",k=a+K(g)*c-r,n=b+J(g)*c-r;g=a+K(e)*c-r;e=b+J(e)*c-r;k!=g||f||(k+=0.125);a=s(this,a,b);k=s(this,k,n);g=s(this,g,e);this.currentPath_.push({type:d, x:a.x,y:a.y,radius:c,xStart:k.x,yStart:k.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+ c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new w("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new w("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,r,y,n,h;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var l=a.width,u=a.height;a.runtimeStyle.width= e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],r=y=0,n=e=l,h=d=u;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],r=y=0,n=l,h=u;else if(9==arguments.length)r=arguments[1],y=arguments[2],n=arguments[3],h=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var m=s(this,c,g),p=[];p.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stroke=function(a){var b=[];b.push("d.x)d.x=f.x;if(null==c.y||f.yd.y)d.y=f.y}}b.push(' ">');a?T(this,b,c,d):S(this,b);b.push("");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a= {};P(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=t(D(),this.m_)};d.restore=function(){this.aStack_.length&&(P(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){z(this,t([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=K(a);a=J(a);z(this,t([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(this,t([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){z(this,t([[a, b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_;d=0;var r=1E3,t=0,n=[],h;h=this.font;if(L[h])h=L[h];else{var l=document.createElement("div").style;try{l.font=h}catch(u){}h=L[h]={style:l.fontStyle||"normal",variant:l.fontVariant||"normal",weight:l.fontWeight||"normal",size:l.fontSize||10,family:l.fontFamily||"sans-serif"}}var l=h,m=this.element_;h={};for(var p in l)h[p]=l[p];p=parseFloat(m.currentStyle.fontSize); m=parseFloat(l.size);"number"==typeof l.size?h.size=l.size:-1!=l.size.indexOf("px")?h.size=m:-1!=l.size.indexOf("em")?h.size=p*m:-1!=l.size.indexOf("%")?h.size=p/100*m:-1!=l.size.indexOf("pt")?h.size=m/0.75:h.size=p;h.size*=0.981;p=h.style+" "+h.variant+" "+h.weight+" "+h.size+"px "+h.family;m=this.element_.currentStyle;l=this.textAlign.toLowerCase();switch(l){case "left":case "center":case "right":break;case "end":l="ltr"==m.direction?"right":"left";break;case "start":l="rtl"==m.direction?"right": "left";break;default:l="left"}switch(this.textBaseline){case "hanging":case "top":t=h.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":t=-h.size/2.25}switch(l){case "right":d=1E3;r=0.05;break;case "center":d=r=500}b=s(this,b+0,c+t);n.push('');e?S(this,n):T(this,n,{x:-d,y:0}, {x:r,y:h.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1].toFixed(3)+",0,0";b=k(b.x/q)+","+k(b.y/q);n.push('','','');this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a, b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd",''),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){}; d.arcTo=function(){};d.createPattern=function(a,b){return new I(a,b)};w.prototype.addColorStop=function(a,b){b=G(b);this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};d=A.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR= 13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=U;CanvasRenderingContext2D=C;CanvasGradient=w;CanvasPattern=I;DOMException=A}();