/* CanvasJS HTML5 & JavaScript Charts - v2.0 Beta 2 - 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 la(q,s){q.prototype=Za(s.prototype);q.prototype.constructor=q;q.base=s.prototype}function Za(q){function s(){}s.prototype=q;return new s}function Ra(q,s,u){"millisecond"===u?q.setMilliseconds(q.getMilliseconds()+1*s):"second"===u?q.setSeconds(q.getSeconds()+1*s):"minute"===u?q.setMinutes(q.getMinutes()+1*s):"hour"===u?q.setHours(q.getHours()+1*s):"day"===u?q.setDate(q.getDate()+1*s):"week"===u?q.setDate(q.getDate()+7*s):"month"===u?q.setMonth(q.getMonth()+1*s):"year"===u&&q.setFullYear(q.getFullYear()+ 1*s);return q}function fa(q,s){var u=!1;0>q&&(u=!0,q*=-1);q=""+q;for(s=s?s:1;q.length>16).toString(16),u=((q&65280)>>8).toString(16);q=((q&255)>>0).toString(16);s=2>s.length?"0"+s:s;u=2>u.length?"0"+u:u;q=2>q.length?"0"+q:q;return"#"+s+u+q}function $a(q,s){var u=this.length>>>0,w=Number(s)||0,w=0>w?Math.ceil(w):Math.floor(w); for(0>w&&(w+=u);wu;u++)if(q[u]!==q[u+4]|q[u]!==q[u+8]|q[u]!==q[u+12]){s=!1;break}return s?q[0]<<16|q[1]<<8|q[2]:0}function ja(q,s,u){return q in s?s[q]:u[q]}function Fa(q,s,u){if(w&&Va){var x=q.getContext("2d");Ja=x.webkitBackingStorePixelRatio||x.mozBackingStorePixelRatio||x.msBackingStorePixelRatio||x.oBackingStorePixelRatio||x.backingStorePixelRatio||1;ia=Oa/Ja;q.width=s*ia;q.height=u*ia;Oa!==Ja&&(q.style.width=s+"px",q.style.height=u+"px",x.scale(ia,ia))}else q.width=s,q.height=u}function Wa(q){if(!Xa){var s= !1,u=!1;"undefined"===typeof qa.Chart.creditHref?(q.creditHref="https://canvasjs.com/",q.creditText="CanvasJS.com"):(s=q.updateOption("creditText"),u=q.updateOption("creditHref"));if(q.creditHref&&q.creditText){q._creditLink||(q._creditLink=document.createElement("a"),q._creditLink.setAttribute("class","canvasjs-chart-credit"),q._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:2px;top:"+(q.height-14)+"px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"), q._creditLink.setAttribute("tabIndex",-1),q._creditLink.setAttribute("target","_blank"));if(0===q.renderCount||s||u)q._creditLink.setAttribute("href",q.creditHref),q._creditLink.innerHTML=q.creditText;q._creditLink&&q.creditHref&&q.creditText?(q._creditLink.parentElement||q._canvasJSContainer.appendChild(q._creditLink),q._creditLink.style.top=q.height-14+"px"):q._creditLink.parentElement&&q._canvasJSContainer.removeChild(q._creditLink)}}}function ta(q,s){var u=document.createElement("canvas");u.setAttribute("class", "canvasjs-chart-canvas");Fa(u,q,s);w||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(u);return u}function na(q,s,u){for(var w in u)s.style[w]=u[w]}function ua(q,s,u){s.getAttribute("state")||(s.style.backgroundColor=q.toolbar.backgroundColor,s.style.color=q.toolbar.fontColor,s.style.border="none",na(q,s,{WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}));s.getAttribute("state")!==u&&(s.setAttribute("state",u),s.setAttribute("type","button"), na(q,s,{padding:"5px 12px",cursor:"pointer","float":"left",width:"40px",height:"25px",outline:"0px",verticalAlign:"baseline",lineHeight:"0"}),s.setAttribute("title",q._cultureInfo[u+"Text"]),s.innerHTML=""+q._cultureInfo[u+"Text"]+"")}function Ka(){for(var q=null,s=0;sQ?"a":"p"; case "tt":return 12>Q?"am":"pm";case "T":return 12>Q?"A":"P";case "TT":return 12>Q?"AM":"PM";case "K":return M?"UTC":(String(R).match(y)||[""]).pop().replace(z,"");case "z":return(0q?!0: !1;w&&(q*=-1);var x=u?u.decimalSeparator:".",y=u?u.digitGroupSeparator:",",z="";s=String(s);var z=1,R=u="",B=-1,J=[],F=[],V=0,P=0,W=0,M=!1,T=0,R=s.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);s=null;for(var Y=0;R&&YB)B=Y;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);B=Y+s.length-1;continue}else"E"!==s[0]&&"e"!==s[0]||"0"!==s[s.length-1]||(M=!0);0>B?(J.push(s),"#"===s|| "0"===s?V++:","===s&&W++):(F.push(s),"#"!==s&&"0"!==s||P++)}M&&(s=Math.floor(q),R=-Math.floor(Math.log(q)/Math.LN10+1),T=0===q?0:0===s?-(V+R):String(s).length-V,z/=Math.pow(10,T));0>B&&(B=Y);z=(q*z).toFixed(P);s=z.split(".");z=(s[0]+"").split("");q=(s[1]+"").split("");z&&"0"===z[0]&&z.shift();for(M=R=Y=P=B=0;0T?s.replace("+","").replace("-",""):s.replace("-",""),u+=s.replace(/[0]+/,function(q){return fa(T,q.length)}));y="";for(J=!1;0T?s.replace("+","").replace("-",""):s.replace("-",""),y+=s.replace(/[0]+/,function(q){return fa(T,q.length)}));u+=(J?x:"")+y;return w?"-"+u:u},Ma=function(q){var s=0,u=0;q=q||window.event;q.offsetX||0===q.offsetX?(s=q.offsetX,u=q.offsetY): q.layerX||0==q.layerX?(s=q.layerX,u=q.layerY):(s=q.pageX-q.target.offsetLeft,u=q.pageY-q.target.offsetTop);return{x:s,y:u}},Va=!0,Oa=window.devicePixelRatio||1,Ja=1,ia=Va?Oa/Ja:1,Xa=window&&window.location&&window.location.href&&window.location.href.indexOf&&(-1!==window.location.href.indexOf("canvasjs.com")||-1!==window.location.href.indexOf("fenopix.com")||-1!==window.location.href.indexOf("fiddle")),bb={reset:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAeCAYAAABJ/8wUAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAPjSURBVFhHxVdJaFNRFP1J/jwkP5MxsbaC1WJEglSxOFAXIsFpVRE3ggi1K90obioRRBA33XXnQnciirhQcMCdorgQxBkXWlREkFKsWkv5npvckp/XnzRpKh64kLw733fffe9L/wrL0+mVUdO8uTSZ3MBL/we2qg4rkuSpodCELstXE46ziVkLQ6FQcGOmeSSq6wd4aV50d3drWjj8kQKZJTUc9kxFGenv79dZrDksTSTWWJp2QYtEPiErysyzdX0LsxsCQR8keX8gs6RHIk8ysdgKFg2G53mhuOPsshTlBjKaFo1g7SqLNoShKLdFXT8huQ/paLSbxatYnc2mHMM4hr18Vi8TIvCmXF3vYrW6cF23gGTOk0M1wA4RKvOmq6vLZRVJipvmSWT6tZ6CSEYkco5V50VPT4+D7RwOqi6RiSZm0fJ+vggSqkeoypdsNmuyelNwbXsbgvkWYMtzDWNvWaijoyOBqE+hVK8abcssUeXQ/YfKyi0gFYv1Ipgfoj34fYGTJLOYJA0ODirok32GLN8XhUWCwSes1hIwBg6LydJ/tEeRRapAdUp+wSAiZchtZZWWgAZ+JNpD8peYXQVK9UwUxNpzOK8pq97kURZhYTCKBwPD7h2zK+js7Myi7D8Fod+0TkMI8+EMAngLGc/WtBFWawkFHFnoj/t9KLgGmF0B3QfkxC+EarxkdhnFYlFLY06USqUwL7UMjICHfh/wOc2sCqhpxGbCkLvL7EUDbF73+6DkmVWB6zi7xUDQSLeYvWjAILvm9zEnkJhlbRcDQZcv6Kg2AipyT/Axw6wKlqVSqxDdjF8Izfod13qURdrG/nxehY+xGh+h0CSzKygGvSNQIcc097BI24jb9hax6kj2E7OrMFX1il+ICEf2NrPbhiXLl+fYl+U7zK4iYdsDcyLGf+ofFlkwcN+s10KhmpuYhhtm0hCLVIFL0MDsqNlDIqy9x2CLs1jL6OvrI7vPRbtohXG6eFmsFnHDGAp6n9AgyuVySRZrGvROxRgIfLXhzjrNYnNBUxNX/dMgRWT1mt4XLDovaApD53E9W3ilNX5M55LJHpRtIsgAvciR4WWcgK2Dvb1YqgXevmF8z2zEBTcKG39EfSKsT9EbhVUaI2FZO+oZIqImxol6j66/hcAu4sSN4vc1ZPoKeoE6RGhYL2YYA+ymOSSi0Z0wWntbtkGUWCvfSDXIxONraZ/FY90KUfNTpfC5spnNLgxoYNnR9RO4F8ofXEHOgogCQE99w+fF2Xw+b7O59rEOsyRqGEfpVoaDMQQ1CZrG46bcM6AZ0C/wPqNfHliqejyTySxh9TqQpL+xmbIlkB9SlAAAAABJRU5ErkJggg=="}, pan:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAICSURBVEhLxZbPahNRGMUn/5MpuAiBEAIufQGfzr5E40YptBXajYzudCEuGqS+gGlrFwquDGRTutBdYfydzJ3LzeQmJGZue+Dw/Z17Mnfmu5Pof9Hr9Z61Wq0bWZMKj263O6xWq99wU9lOpzPMKgEhEcRucNOcioOK+0RzBhNvt9tPV4nmVF19+OWhVqt9xXgFXZq+8lCv119UKpUJ7iX2FmvFTKz8RH34YdBsNk8wVtjE4fGYwm8wrrDi3WBG5oKXZGRSS9hGuNFojLTe2lFz5xThWZIktayyiE2FdT3rzXBXz7krKiL8c17wAKFDjCus2AvW+YGZ9y2JF0VFRuMPfI//rsCE/C+s26s4gQu9ul7r4NteKx7H8XOC724xNNGbaNu++IrBqbOV7Tj3FgMRvc/YKOr3+3sE47wgEt/Bl/gaK5cHbNU11vYSXylfpK7XOvjuumPp4Wcoipu30Qsez2uMXYz4lfI+mOmwothY+SLiXJy7mKVpWs3Si0CoOMfeI9Od43Wic+jO+ZVv+crsm9QSNhUW9LXSeoPBYLXopthGuFQgdIxxhY+UDwlt1x5CZ1hX+NTUdt/OIvjKaDSmuOJfaIVNPKX+W18j/PLA2/kR44p5Sd8HbHngT/yTfNRWUXX14ZcL3wmX0+TLf8YO7CGT8yFE5zB3/gney25/OETRP9CtPDFe5jShAAAAAElFTkSuQmCC"}, zoom:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALWSURBVEhLvZZLaBNRFIabyftBIgEfqCCBoCC6MYqiXYiIj4U76U4X7sUHbhQhUBfixhZEUBDB16YuFERaUaQLK7ooCOJj4UKtYEFU0EptShO/A9Ph3js3k8lo/eHnP7n3nP/M3LlzMz1hkUwmNziOcyKRSFyFt+LxeD/c2Wq1Ym7Kv0M2m11Os1OxWGycn1OwZXCGuXfwIhezkd9/jRgNT2L4ldhs1pbkX5OLJe4euVxuGQaPCa3mnUjtJx7BDuKusJTCV6jVVGHTMuYRjxma7yIOhTgFY6jNaAKew2xPKpVay9ganmkvj+M448/MfJdT5K5Gg4HJacRngPFgqVRaRNwW1B4i7yehWfsEDdz1K+A01AoxPIqGAiuwGfkOTY8+1A6u7AyiFTB2Hu0KPIrdiOnzHLWDybeImvy+Wq2mZa5bUHsD0Zpz+KxHdWQymV6kAb1ElqeORgJLvgnRdj1+R1AfzkIvSUjxVjQSarVakrueIPT8+H1F5jSUy+WXiJrUYBVWyVxU4PEU8TzhfaijUqnMIWrjaY492eWRwdKOIqrnIxnXwLLeRLwk2GQzrEMjg0avEbXxkIxr4OoOImpj2QwyFgms1koa/SZUG8s+0iGnEhNfCNXEhzIXBVz0McTzEvJ+70P9oNFtxEzei3aFYrFYxmuSUPWSv9Yi9IMm2xE1We56Mp1OV4nDwqFmBDV9gk9AEh4gZtFHNt8W4kAUCoXF5MorY9Z/kDni9nDv7hc0i2fhgLvTtX8a99PoMPPagTFPxofRzmDJ9yM+AyEmTfgGysYbQcfhDzPPJDmX0c7gDg4gs9BqFIWhm/Nct5H8gtBq1I7UfIbtvmIuoaGQcp+fdpbbSM43eEH5wrwLbXmhm/fU63VHXjcuok7hEByFY/AeHGC8L5/PL3HT5xGH1uYwfPOICGo+CBcU0vwO1BqzUqILDl/z/9VYIMfpddiAc47jDP8BsUpb13wOLRwAAAAASUVORK5CYII="}, menu:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAYAAABE4bxTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADoSURBVFhH7dc9CsJAFATgRxIIBCwCqZKATX5sbawsY2MvWOtF9AB6AU8gguAJbD2AnZ2VXQT/Ko2TYGCL2OYtYQc+BuYA+1hCtnCVwMm27SGaXpDJIAiCvCkVR05hGOZNN3HkFMdx3nQRR06+76/R1IcFLJlNQEWlmWlBTwJtKLKHynehZqnjOGM0PYWRVXk61C37p7xlZ3Hk5HneCk1dmMH811xGoKLSzDiQwIBZB4ocoPJdqNkDt2yKlueWRVGUtzy3rPwo3sWRU3nLjuLI6OO67oZM00wMw3hrmpZx0XU9syxrR0T0BeMpb9dneSR2AAAAAElFTkSuQmCC"}}; T.prototype.setOptions=function(q,s){if(qa[this._defaultsKey]){var u=qa[this._defaultsKey],w;for(w in u)"publicProperties"!==w&&u.hasOwnProperty(w)&&(this[w]=q&&w in q?q[w]:s&&w in s?s[w]:u[w])}};T.prototype.get=function(q){var s=qa[this._defaultsKey];if("options"===q)return this.options&&this.options._isPlaceholder?null:this.options;if(s.hasOwnProperty(q)||s.publicProperties&&s.publicProperties.hasOwnProperty(q))return this[q];window.console&&window.console.log('Property "'+q+"\" doesn't exist. Please check for typo.")}; T.prototype.set=function(q,s,u){u="undefined"===typeof u?!0:u;var w=qa[this._defaultsKey];if("options"===q)this.createUserOptions(s);else if(w.hasOwnProperty(q)||w.publicProperties&&w.publicProperties.hasOwnProperty(q)&&"readWrite"===w.publicProperties[q])this.options._isPlaceholder&&this.createUserOptions(),this.options[q]=s;else{window.console&&(w.publicProperties&&w.publicProperties.hasOwnProperty(q)&&"readOnly"===w.publicProperties[q]?window.console.log('Property "'+q+'" is read-only.'):window.console.log('Property "'+ q+"\" doesn't exist. Please check for typo."));return}u&&(this.chart||this).render()};T.prototype.addTo=function(q,s,u,w){w="undefined"===typeof w?!0:w;var x=qa[this._defaultsKey];x.hasOwnProperty(q)||x.publicProperties&&x.publicProperties.hasOwnProperty(q)&&"readWrite"===x.publicProperties[q]?(this.options._isPlaceholder&&this.createUserOptions(),"undefined"===typeof this.options[q]&&(this.options[q]=[]),q=this.options[q],u="undefined"===typeof u||null===u?q.length:u,q.splice(u,0,s),w&&(this.chart|| this).render()):window.console&&(x.publicProperties&&x.publicProperties.hasOwnProperty(q)&&"readOnly"===x.publicProperties[q]?window.console.log('Property "'+q+'" is read-only.'):window.console.log('Property "'+q+"\" doesn't exist. Please check for typo."))};T.prototype.createUserOptions=function(q){if("undefined"!==typeof q||this.options._isPlaceholder)if(this.parent.options._isPlaceholder&&this.parent.createUserOptions(),this.isOptionsInArray){this.parent.options[this.optionsName]||(this.parent.options[this.optionsName]= []);var s=this.parent.options[this.optionsName],w=s.length;this.options._isPlaceholder||(Ea(s),w=s.indexOf(this.options));this.options="undefined"===typeof q?{}:q;s[w]=this.options}else this.options="undefined"===typeof q?{}:q,q=this.parent.options,this.optionsName?s=this.optionsName:(s=this._defaultsKey)&&0!==s.length?(w=s.charAt(0).toLowerCase(),1w)y=z-1;else break}u>w&&1z&&(F=w.pop(),x-=F.height,y=M)}this._wrappedText={lines:w,width:y,height:x};this.width=y+(this.leftPadding+this.rightPadding); this.height=x+(this.topPadding+this.bottomPadding);this.ctx.font=u};ka.prototype._getFontString=function(){var q;q=""+(this.fontStyle?this.fontStyle+" ":"");q+=this.fontWeight?this.fontWeight+" ":"";q+=this.fontSize?this.fontSize+"px ":"";var s=this.fontFamily?this.fontFamily+"":"";!w&&s&&(s=s.split(",")[0],"'"!==s[0]&&'"'!==s[0]&&(s="'"+s+"'"));return q+=s};la(Pa,T);la(Ga,T);Ga.prototype.render=function(){if(this.text){var q=this.dockInsidePlotArea?this.chart.plotArea:this.chart,w=q.layoutManager.getFreeSpace(), u=w.x1,y=w.y1,z=0,F=0,M=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,P,B;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=w.width-4-M*("center"===this.horizontalAlign?2:1)),F=0.5*w.height-this.margin-2,z=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=w.height-4),F=0.5*w.width-this.margin-2):"center"===this.horizontalAlign&&(null=== this.maxWidth&&(this.maxWidth=w.width-4),F=0.5*w.height-4));var J;x(this.padding)||"number"!==typeof this.padding?x(this.padding)||"object"!==typeof this.padding||(J=this.padding.top?this.padding.top:this.padding.bottom?this.padding.bottom:0,J+=this.padding.bottom?this.padding.bottom:this.padding.top?this.padding.top:0,J*=1.25):J=2.5*this.padding;this.wrap||(F=Math.min(F,Math.max(1.5*this.fontSize,this.fontSize+J)));F=new ka(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:F,cornerRadius:this.cornerRadius,text:this.text,padding:this.padding,textBaseline:"top"});J=F.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(y=w.y1+2,B="top"):"bottom"===this.verticalAlign&& (y=w.y2-2-J.height,B="bottom"),"left"===this.horizontalAlign?u=w.x1+2:"center"===this.horizontalAlign?u=w.x1+w.width/2-J.width/2:"right"===this.horizontalAlign&&(u=w.x2-2-J.width-M),P=this.horizontalAlign,this.width=J.width,this.height=J.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?(u=w.x1+2,y=w.y2-2-(this.maxWidth/2-J.width/2),z=-90,B="left",this.width=J.height,this.height=J.width):"right"===this.horizontalAlign?(u=w.x2-2,y=w.y1+2+(this.maxWidth/2-J.width/2),z=90,B="right", this.width=J.height,this.height=J.width):"center"===this.horizontalAlign&&(y=q.y1+(q.height/2-J.height/2),u=q.x1+(q.width/2-J.width/2),B="center",this.width=J.width,this.height=J.height),P="center");F.x=u;F.y=y;F.angle=z;F.horizontalAlign=P;F.render(!0);q.layoutManager.registerSpace(B,{width:this.width+("left"===B||"right"===B?this.margin+2:0),height:this.height+("top"===B||"bottom"===B?this.margin+2:0)});this.bounds={x1:u,y1:y,x2:u+this.width,y2:y+this.height};this.ctx.textBaseline="top"}};la(La, T);La.prototype.render=Ga.prototype.render;la(Ha,T);y={addTheme:function(q,w){xa[q]=w},addColorSet:function(q,w){ya[q]=w},addCultureInfo:function(q,w){Ia[q]=w},formatNumber:function(q,w,u){u=u||"en";if(Ia[u])return ea(q,w||"#,##0.##",new Ha(u));throw"Unknown Culture Name";},formatDate:function(q,w,u){u=u||"en";if(Ia[u])return za(q,w||"DD MMM YYYY",new Ha(u));throw"Unknown Culture Name";}};window.CanvasJS=y;y.Chart=function(){function q(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 d=!1,g=document.createElement("a");g.download=b;g.href=a;g.target="_blank";if("undefined"!==typeof Blob&&new Blob){for(var k=a.replace(/^data:[a-z\/]*;base64,/,""),k=atob(k),l=new ArrayBuffer(k.length),l=new Uint8Array(l),n=0;n
Please right click on the image and save it to your device
"),f.document.close()}}}function u(a,f){f=f||{};this.theme=x(f.theme)||x(xa[f.theme])?"light1":f.theme;u.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,d=0,c=this.options.width? this.width:0a[g].x&&0n?{x:a[l].x+n/3,y:a[l].y+c/3}:{x:a[l].x, y:a[l].y+c/9};l=d;g=0===l?0:l-1;k=l===a.length-1?l:l+1;c=Math.abs((a[k].x-a[g].x)/(0===a[l].x-a[g].x?0.01:a[l].x-a[g].x))*(f-1)/2+1;n=(a[k].x-a[g].x)/c;c=(a[k].y-a[g].y)/c;b[b.length]=a[l].x>a[g].x&&0n?{x:a[l].x-n/3,y:a[l].y-c/3}:{x:a[l].x,y:a[l].y-c/9};b[b.length]=a[d]}return b}function z(a,f,b,c,d,g,k,l,n,h){var r=0;h?(k.color=g,l.color=g):h=1;r=n?Math.abs(d-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 J(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 ca(a,f,b,c,d,g){ca.base.constructor.call(this,"Break",f,b,c,g);this.id=d;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=x(b.fillOpacity)?g.fillOpacity:this.fillOpacity;this.lineThickness=x(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;!x(this.startValue)&&this.startValue.getTime&&(this.startValue=this.startValue.getTime());!x(this.endValue)&&this.endValue.getTime&&(this.endValue=this.endValue.getTime());"number"===typeof this.startValue&&("number"===typeof this.endValue&&this.endValue=navigator.userAgent.search("MSIE")&&na(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(100%)", filter:"invert(100%)"})}),$(this._zoomButton,"mouseout",function(){na(a,a._zoomButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&na(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})})),this._resetButton||(va(this._resetButton=document.createElement("button")),ua(this,this._resetButton,"reset"),this._resetButton.style.borderRight=(this.exportEnabled?this.toolbar.borderThickness: 0)+"px solid "+this.toolbar.borderColor,this._toolBar.appendChild(this._resetButton),$(this._resetButton,"click",function(){a.toolTip.hide();a.zoomEnabled||a.panEnabled?(a.zoomEnabled=!0,a.panEnabled=!1,ua(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")&&na(a,a._resetButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"})}), $(this._resetButton,"mouseout",function(){na(a,a._resetButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&na(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),Ka(a._zoomButton,a._resetButton)):(this.zoomEnabled=!0,this.panEnabled=!1))):this.panEnabled=this.zoomEnabled=!1;this._menuButton?this.exportEnabled?Ka(this._menuButton):va(this._menuButton):this.exportEnabled&&w&&(this._menuButton=document.createElement("button"),ua(this,this._menuButton,"menu"),this._toolBar.appendChild(this._menuButton),$(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),$(this._menuButton,"mouseover",function(){na(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.fontColorOnHover});0>=navigator.userAgent.search("MSIE")&&na(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"})},!0),$(this._menuButton,"mouseout",function(){na(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColor, color:a.toolbar.fontColor});0>=navigator.userAgent.search("MSIE")&&na(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})},!0));if(!this._dropdownMenu&&this.exportEnabled&&w){this._dropdownMenu=document.createElement("div");this._dropdownMenu.setAttribute("tabindex",-1);var f=-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 "+f;a._dropdownMenu.style.display="none";this._toolBar.appendChild(this._dropdownMenu);$(this._dropdownMenu,"blur",function(){va(a._dropdownMenu);a._dropDownCloseTime=new Date},!0);f=document.createElement("div");f.style.cssText="padding: 12px 8px 12px 8px";f.innerHTML=this._cultureInfo.printText;f.style.backgroundColor=this.toolbar.backgroundColor;f.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(f);$(f,"mouseover",function(){this.style.backgroundColor= a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);$(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);$(f,"click",function(){a.print();va(a._dropdownMenu)},!0);f=document.createElement("div");f.style.cssText="padding: 12px 8px 12px 8px";f.innerHTML=this._cultureInfo.saveJPGText;f.style.backgroundColor=this.toolbar.backgroundColor;f.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(f); $(f,"mouseover",function(){this.style.backgroundColor=a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);$(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);$(f,"click",function(){s(a.canvas,"jpeg",a.exportFileName);va(a._dropdownMenu)},!0);f=document.createElement("div");f.style.cssText="padding: 12px 8px 12px 8px";f.innerHTML=this._cultureInfo.savePNGText;f.style.backgroundColor=this.toolbar.backgroundColor; f.style.color=this.toolbar.fontColor;this._dropdownMenu.appendChild(f);$(f,"mouseover",function(){this.style.backgroundColor=a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);$(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);$(f,"click",function(){s(a.canvas,"png",a.exportFileName);va(a._dropdownMenu)},!0)}"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?ua(a,a._zoomButton, "zoom"):ua(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&ua(a,a._resetButton,"reset"));this.options.toolTip&&this.toolTip.options!==this.options.toolTip&&(this.toolTip.options=this.options.toolTip);for(var b in this.toolTip.options)this.toolTip.options.hasOwnProperty(b)&&this.toolTip.updateOption(b)};u.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 h.startTimePercent?a>=h.startTimePercent&&h.animationCallback(h.easingFunction(a-h.startTimePercent,0,1,1-h.startTimePercent),h):h.animationCallback(h.easingFunction(a,0,1,1),h); 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,d,g=!1,k=0;kb.max&&(b.max=c);df.max&&"number"===typeof d&&(f.max=d);if(0t&&(t=1/t);b.minDiff>t&&1!==t&&(b.minDiff=t)}else t=c-l.dataPoints[n-1].x,0>t&&(t*=-1),b.minDiff>t&&0!==t&&(b.minDiff=t);null!==d&&null!==l.dataPoints[n-1].y&&(a.axisY.logarithmic?(t=d/l.dataPoints[n-1].y,1>t&&(t=1/t),f.minDiff>t&&1!==t&&(f.minDiff=t)):(t=d-l.dataPoints[n-1].y,0>t&&(t*=-1),f.minDiff>t&&0!==t&&(f.minDiff=t)))}if(ce&& !r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);cb.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&pf.viewPortMax&&"number"===typeof d&&(f.viewPortMax=d))}}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":"number"}};u.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var f= a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=[],l=[],n=Infinity,h=-Infinity,r=0;rb.max&&(b.max=c);if(0E&&(E=1/E);b.minDiff>E&&1!==E&&(b.minDiff=E)}else E=c-p.dataPoints[m-1].x,0>E&&(E*=-1),b.minDiff>E&&0!==E&&(b.minDiff=E);null!==d&&null!==p.dataPoints[m-1].y&&(a.axisY.logarithmic?0E&&(E=1/E),f.minDiff>E&&1!==E&&(f.minDiff=E)):(E=d-p.dataPoints[m-1].y,0>E&&(E*=-1),f.minDiff> E&&0!==E&&(f.minDiff=E)))}if(cv&&!t)t=!0;else if(c>v&&t)continue;p.dataPoints[m].label&&(a.axisX.labels[c]=p.dataPoints[m].label);cb.viewPortMax&&(b.viewPortMax=c);null===p.dataPoints[m].y?b.viewPortMin===c&&raf.max&&(f.max=a),mb.viewPortMax||(af.viewPortMax&&(f.viewPortMax=a)));for(m in l)l.hasOwnProperty(m)&&!isNaN(m)&&(a=l[m],af.max&&(f.max=Math.max(a,h)),mb.viewPortMax||(af.viewPortMax&&(f.viewPortMax=Math.max(a,h))))}};u.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=!1,l=!1,n=[],h=0;hb.max&&(b.max=c);if(0v&&(v=1/v);b.minDiff>v&&1!==v&&(b.minDiff=v)}else v=c-r.dataPoints[p-1].x,0>v&&(v*=-1),b.minDiff>v&&0!==v&&(b.minDiff=v);x(d)||null===r.dataPoints[p-1].y||(a.axisY.logarithmic?0v&&(v=1/v),f.minDiff>v&&1!==v&&(f.minDiff=v)):(v=d-r.dataPoints[p-1].y,0>v&&(v*=-1),f.minDiff>v&&0!==v&&(f.minDiff=v)))}if(cC&&!e)e=!0;else if(c> C&&e)continue;r.dataPoints[p].label&&(a.axisX.labels[c]=r.dataPoints[p].label);cb.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&td&&(l=!0),n[c]=n[c]?n[c]+Math.abs(d):Math.abs(d))}}this.plotInfo.axisXValueType=r.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(f.max=x(f.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(f.viewPortMax,99*Math.pow(a.axisY.logarithmBase, -0.05)),f.min=x(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&!l?(f.max=x(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=x(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&l?(f.max=x(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=x(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99)):!k&&l&&(f.max=x(f.viewPortMax)?-1:Math.max(f.viewPortMax,-1),f.min=x(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99));f.viewPortMin=f.min;f.viewPortMax=f.max;a.dataPointYSums=n}};u.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&& !(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g,k,l=!1,n=0;nb.max&&(b.max=c);gf.max&&(f.max=k);0t&&(t=1/t),b.minDiff>t&&1!==t&&(b.minDiff=t)):(t=c-h.dataPoints[r-1].x,0>t&&(t*=-1),b.minDiff>t&&0!==t&&(b.minDiff=t)),d&&(null!==d[0]&&h.dataPoints[r-1].y&&null!== h.dataPoints[r-1].y[0])&&(a.axisY.logarithmic?(t=d[0]/h.dataPoints[r-1].y[0],1>t&&(t=1/t),f.minDiff>t&&1!==t&&(f.minDiff=t)):(t=d[0]-h.dataPoints[r-1].y[0],0>t&&(t*=-1),f.minDiff>t&&0!==t&&(f.minDiff=t))));if(!(cv&&!m)m=!0;else if(c>v&&m)continue;h.dataPoints[r].label&&(a.axisX.labels[c]=h.dataPoints[r].label);cb.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&d)for(E=0;Ef.viewPortMax&&(f.viewPortMax=k))}}this.plotInfo.axisXValueType=h.xValueType=l?"dateTime":"number"}};u.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,d,g=!1,k=0;kb.max&&(b.max=c),l.dataPointEOs[n].cumulativeSumf.max&&(f.max=l.dataPointEOs[n].cumulativeSum),0p&&(p=1/p),b.minDiff>p&&1!==p&&(b.minDiff=p)):(p=c-l.dataPoints[n-1].x,0>p&& (p*=-1),b.minDiff>p&&0!==p&&(b.minDiff=p)),null!==d&&null!==l.dataPoints[n-1].y&&(a.axisY.logarithmic?(d=l.dataPointEOs[n].cumulativeSum/l.dataPointEOs[n-1].cumulativeSum,1>d&&(d=1/d),f.minDiff>d&&1!==d&&(f.minDiff=d)):(d=l.dataPointEOs[n].cumulativeSum-l.dataPointEOs[n-1].cumulativeSum,0>d&&(d*=-1),f.minDiff>d&&0!==d&&(f.minDiff=d)))),!(ce&&!r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);cb.viewPortMax&&(b.viewPortMax=c);0f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n-1].cumulativeSum));l.dataPointEOs[n].cumulativeSumf.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n].cumulativeSum)}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime": "number"}};u.prototype.calculateAutoBreaks=function(){function a(a,c){var b=c-a,d=Math.pow(10,Math.floor(Math.log(b)/Math.LN10)),f=Math.pow(10,Math.floor(Math.log(Math.abs(a||b))/Math.LN10)),g,h;fh&&(h=Math.pow(0.1,Number((Math.log(d)/Math.LN10+1).toFixed(2))>>1),0.01>h?(g=Math.ceil(a*(1+(00.01*b){var l=B.getNiceNumber(m);h+=Math.floor(0.99*m/l)*l}k>0.01*b&&(b=Math.min(B.getNiceNumber(k),Math.ceil(d/10),Math.ceil(f/10)))&&(g-=Math.floor(0.99*k/b)*b);return{startValue:g,endValue:h}}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,h,k=g.min,m=g.max,l=f.min,n=f.max,g=g._dataRanges,f=f._dataRanges,p,r=0,q=0;qw.dataPoints.length))for(r=0;rg[p].max&&(g[p].max=h)),b){var u=(n+1-l)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((h="waterfall"===a.type?w.dataPointEOs[r].cumulativeSum:w.dataPoints[r].y)&&h.length)for(var s=0;sf[p].max&&(f[p].max=h[s]);else x(h)||(p=Math.floor((h-l)/u),hf[p].max&&(f[p].max=h))}}}}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,h,k=0,m=0;ml.dataPoints.length))for(k=0;kg[h].max&&(g[h].max= c)}}for(var c,d=this,g=!1,k=0;kr[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYPositiveSums}if(this._axes[k].dataInfo.dataPointYNegativeSums){m= this._axes[k].dataInfo.dataPointYNegativeSums;r=h;for(l in m)m.hasOwnProperty(l)&&!isNaN(l)&&(p=-1*m[l],x(p)||(index=Math.floor((p-n)/c),pr[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYNegativeSums}for(l=0;lc&&g.push({diff:p,start:r,end:n});break}else l++;if(this._axes[k].scaleBreaks.customBreaks)for(l=0;l=d.x1&&(a<=d.x2&&f>=d.y1&&f<=d.y2)&&(c=d.id)}return c};u.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)))};u.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};u.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))};u.prototype.attachEvent=function(a){this._events.push(a)};u.prototype._touchEventHandler= function(a){if(a.changedTouches&&this.interactivityEnabled){var f=[],b=a.changedTouches,c=b?b[0]:a,d=null;switch(a.type){case "touchstart":case "MSPointerDown":f=["mousemove","mousedown"];this._lastTouchData=Ma(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=d.x1&&f.x<=d.x2&&f.y>=d.y1&&f.y<=d.y2){c[b].call(c.context,f.x,f.y);"mousedown"===b&&!0===c.capture?(u.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)}};u.prototype._plotAreaMouseDown=function(a,f){this.isDrag=!0;this.dragStartPoint={x:a,y:f}};u.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,d=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),k=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=d,d=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(d=g=0;db.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,k=!0):b.viewportMinimumb.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum= b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,k=!0);else if((!d||2Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,f);if((!d||2e)var t=e,e=m,m=t;if(p.scaleBreaks)for(t=0;!g&&t= e;if(isFinite(p.dataInfo.minDiff))if(t=p.getAppearentDifferceReplacingBreaksToSize(m,e,null,!0),!(g||!(this.panEnabled&&p.scaleBreaks&&p.scaleBreaks._appliedBreaks.length)&&(p.logarithmic&&tp.maximum))n.push(p),r.push({val1:m,val2:e}),l=!0;else if(!d){l=!1;break}}return{isValid:l,axesWithValidRange:n,axesRanges:r}};u.prototype.preparePlotArea=function(){var a=this.plotArea;!w&&(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;w||(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||h.point.yb.y2+1)continue}else if("rangearea"===r||"rangesplinearea"===r){if(h.dataPoint.xs.viewportMaximum|| Math.max.apply(null,h.dataPoint.y)A.viewportMaximum)continue}else if(0<=r.indexOf("line")||0<=r.indexOf("area")||0<=r.indexOf("bubble")||0<=r.indexOf("scatter")){if(h.dataPoint.xs.viewportMaximum||h.dataPoint.yA.viewportMaximum)continue}else if(0<=r.indexOf("column")||"waterfall"===r||"error"===r&&!h.axisSwapped){if(h.dataPoint.xs.viewportMaximum|| h.bounds.y1>b.y2||h.bounds.y2s.viewportMaximum||h.bounds.x1>b.x2||h.bounds.x2s.viewportMaximum||Math.max.apply(null,h.dataPoint.y)A.viewportMaximum)continue}else if(h.dataPoint.xs.viewportMaximum)continue; d=k=2;"horizontal"===E?(l=e.width,n=e.height):(n=e.width,l=e.height);if("normal"===this.plotInfo.axisPlacement){if(0<=r.indexOf("line")||0<=r.indexOf("area"))v="auto",k=4;else if(0<=r.indexOf("stacked"))"auto"===v&&(v="inside");else if("bubble"===r||"scatter"===r)v="inside";p=h.point.x-l/2;"inside"!==v?(d=b.y1,g=b.y2,0h.point.y)):(m=h.point.y+k+c,m>g-n-k-c&&(m="auto"===v?Math.min(h.point.y,g)-n-k-c:g-n-k-c,oa=mg-n-k&&("bubble"===r||"scatter"===r)&&(m=Math.min(h.point.y+k,b.y2-n-k))),m=Math.min(m,g-n))}else 0<=r.indexOf("line")||0<=r.indexOf("area")|| 0<=r.indexOf("scatter")?(v="auto",d=4):0<=r.indexOf("stacked")?"auto"===v&&(v="inside"):"bubble"===r&&(v="inside"),m=h.point.y-n/2,"inside"!==v?(k=b.x1,g=b.x2,0>u?(p=h.point.x-l-d-c,ph.point.x)):(p=h.point.x+d+c,p>g-l-d-c&&(p="auto"===v?Math.min(h.point.x,g)-l-d-c:g-l-d-c,oa=pu?Math.max(h.bounds.x1,b.x1)+l/2+d:Math.min(h.bounds.x2,b.x2)- l/2-d:(Math.max(h.bounds.x1,b.x1)+Math.min(h.bounds.x2,b.x2))/2,p=0>u?Math.max(h.point.x,c)-l/2:Math.min(h.point.x,c)-l/2,p=Math.max(p,k));"vertical"===E&&(m+=n);e.x=p;e.y=m;e.render(!0);C&&("inside"!==v&&(0>r.indexOf("bar")&&("error"!==r||!h.axisSwapped)&&h.point.x>b.x1&&h.point.xr.indexOf("column")&&("error"!==r||h.axisSwapped)&&h.point.y>b.y1&&h.point.y=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var d=this.plotArea;b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();for(var g=[],k,l=0;la.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!u)))if("number"!==typeof r[v].y)0r[v].y===a.axisY.reversed?1:-1,color:t})}b.stroke();w&&c.stroke()}}aa.drawMarkers(g);w&&(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(d.x1, d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStepLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var d=this.plotArea;b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();for(var g=[],k,l=0;la.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!u)))if("number"!==typeof r[v].y)0r[v].y===a.axisY.reversed?1:-1,color:t})}b.stroke();w&&c.stroke()}}aa.drawMarkers(g);w&&(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(d.x1,d.y1,d.width,d.height),c.beginPath());b.restore();b.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderSpline=function(a){function f(a){a=y(a,2);if(0=a.dataSeriesIndexes.length)){var d=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 k=[],l=0;la.axisX.dataInfo.viewPortMax&& (!h.connectNullData||!E)))if("number"!==typeof r[C].y)0r[C].y===a.axisY.reversed?1:-1,color:t});E=!1}f(G)}aa.drawMarkers(k);w&&(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),d.beginPath());c.restore();c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};var Y=function(a,f,b,c,d,g,k,l,n,h,r,p,m){"undefined"===typeof m&&(m=1);k=k||0;l=l||"black";var e=15=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h=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*(d.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();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(r=0;ra.axisX.dataInfo.viewPortMax)&&"number"===typeof t[g].y){k=a.axisX.convertValueToPixel(n);l=a.axisY.convertValueToPixel(t[g].y);k=a.axisX.reversed?k+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+r)*p<<0:k-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+r)*p<<0;var C=a.axisX.reversed? k-p<<0:k+p<<0,v;0<=t[g].y?v=h:(v=l,l=h);l>v&&(c=l,l=v,v=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,k,l,C,v,c,0,null,q&&0<=t[g].y,0>t[g].y&&q,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:k,y1:l,x2:C,y2:v};c=W(c);w&&Y(this._eventManager.ghostCtx,k,l,C,v,c,0,null,!1,!1,!1,!1);(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)&&this._indexLabels.push({chartType:"column", dataPoint:t[g],dataSeries:e,point:{x:k+(C-k)/2,y:0>t[g].y===a.axisY.reversed?l:v},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:k,y1:Math.min(l,v),x2:C,y2:Math.max(l,v)},color:c})}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ha.axisY.bounds.y2?a.axisY.bounds.y2:h}}};u.prototype.renderStackedColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea, g=[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/ Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(e=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height), this._eventManager.ghostCtx.clip());for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){r=a.axisX.convertValueToPixel(c);var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,u=G+e<<0,s;if(a.axisY.logarithmic||a.axisY.scaleBreaks&& 0=v[h].y)n[c]=v[h].y+(n[c]?n[c]:0),s=a.axisY.convertValueToPixel(n[c]),p="undefined"!==typeof k[c]?k[c]:m,k[c]=s;else if(p=a.axisY.convertValueToPixel(v[h].y),0<=v[h].y){var x="undefined"!==typeof g[c]?g[c]:0;p-=x;s=m-x;g[c]=x+(s-p)}else x=k[c]?k[c]:0,s=p+x, p=m+x,k[c]=x+(s-p);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,G,p,u,s,c,0,null,E&&0<=v[h].y,0>v[h].y&&E,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:G,y1:p,x2:u,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,G,p,u,s,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:v[h],dataSeries:C, point:{x:r,y:0<=v[h].y?p:s},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,s),x2:u,y2:Math.max(p,s)},color:c})}}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ma.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderStackedColumn100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=[],k=[],l=[],n=[],h=0, r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;r=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/Math.abs(a.axisX.range))/ a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>r&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,r));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&rr&&(e=r);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip()); for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){r=a.axisX.convertValueToPixel(c);p=0!==a.dataPointYSums[c]?100*(v[h].y/a.dataPointYSums[c]):0;var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=G+e<<0,u;if(a.axisY.logarithmic||a.axisY.scaleBreaks&& 0=l[c])continue;p=a.axisY.convertValueToPixel(l[c]);u=g[c]?g[c]:m;g[c]=p}else if(a.axisY.scaleBreaks&&0=v[h].y)n[c]=p+("undefined"!==typeof n[c]?n[c]:0),u=a.axisY.convertValueToPixel(n[c]),p=k[c]?k[c]:m,k[c]=u;else if(p=a.axisY.convertValueToPixel(p),0<=v[h].y){var x="undefined"!==typeof g[c]?g[c]:0;p-=x;u=m-x;g[c]=x+(u-p)}else x="undefined"!==typeof k[c]? k[c]:0,u=p+x,p=m+x,k[c]=x+(u-p);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,G,p,s,u,c,0,null,E&&0<=v[h].y,0>v[h].y&&E,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:G,y1:p,x2:s,y2:u};c=W(c);w&&Y(this._eventManager.ghostCtx,G,p,s,u,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:v[h], dataSeries:C,point:{x:r,y:0<=v[h].y?p:u},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,u),x2:s,y2:Math.max(p,u)},color:c})}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.yScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ma.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h=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*(d.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();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip()); for(r=0;ra.axisX.dataInfo.viewPortMax)&&"number"===typeof t[g].y){l=a.axisX.convertValueToPixel(n);k=a.axisY.convertValueToPixel(t[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 C=a.axisX.reversed?l-p<<0:l+p<<0,v;0<=t[g].y?v=h:(v=k,k=h);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,v,l,k,C,c,0,null,q,!1,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:v,y1:l,x2:k,y2:C};c=W(c);w&&Y(this._eventManager.ghostCtx,v,l,k,C,c,0,null,!1,!1,!1,!1);(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar", dataPoint:t[g],dataSeries:e,point:{x:0<=t[g].y?k:v,y:l+(C-l)/2},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v,k),y1:l,x2:Math.max(v,k),y2:C},color:c})}}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ha.axisY.bounds.x2?a.axisY.bounds.x2:h}}};u.prototype.renderStackedBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g= [],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/ Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&pp&&(e=p);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height), this._eventManager.ghostCtx.clip());for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){p=a.axisX.convertValueToPixel(c);var u=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=u+e<<0,x;if(a.axisY.logarithmic||a.axisY.scaleBreaks&& 0=v[h].y)n[c]=v[h].y+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=x=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(v[h].y),0<=v[h].y){var A=g[c]?g[c]:0;x=m+A;r+=A;g[c]=A+(r-x)}else A=k[c]?k[c]:0,x=r-A,r=m-A,k[c]=A+(r-x);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length]; Y(b,x,u,r,s,c,0,null,E,!1,!1,!1,C.fillOpacity);c=C.dataPointIds[h];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:x,y1:u,x2:r,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,x,u,r,s,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:v[h],dataSeries:C,point:{x:0<=v[h].y?r:x,y:p},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(x, r),y1:u,x2:Math.max(x,r),y2:s},color:c})}}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore(); return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart,animationBase:ma.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderStackedBar100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=[],k=[],l=[],n=[],h=0,r,p,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.dataPointMinWidth? this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;p=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0;var e=a.axisX.dataInfo.minDiff;isFinite(e)||(e=0.3*Math.abs(a.axisX.range));e=this.dataPointWidth?this.dataPointWidth:0.9*(d.height*(a.axisX.logarithmic?Math.log(e)/Math.log(a.axisX.range):Math.abs(e)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&h>p&&(h=Math.min(this.dataPointWidth?this.dataPointWidth: Infinity,p));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&pp&&(e=p);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var t=0;ta.axisX.dataInfo.viewPortMax)&&"number"===typeof v[h].y){p=a.axisX.convertValueToPixel(c);var u;u=0!==a.dataPointYSums[c]?100*(v[h].y/a.dataPointYSums[c]):0;var s=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,x=s+e<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=l[c])continue;u=g[c]?g[c]:m;g[c]=r=a.axisY.convertValueToPixel(l[c])}else if(a.axisY.scaleBreaks&&0=v[h].y)n[c]=u+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=u=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(u),0<=v[h].y){var A=g[c]?g[c]:0;u=m+A;r+=A;g[c]=A+(r-u)}else A=k[c]?k[c]:0,u=r-A,r=m-A,k[c]=A+(r-u);c=v[h].color?v[h].color:C._colorSet[h%C._colorSet.length];Y(b,u,s,r,x,c,0,null,E,!1,!1,!1,C.fillOpacity);c=C.dataPointIds[h]; this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:u,y1:s,x2:r,y2:x};c=W(c);w&&Y(this._eventManager.ghostCtx,u,s,r,x,c,0,null,!1,!1,!1,!1);(v[h].indexLabel||C.indexLabel||v[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:v[h],dataSeries:C,point:{x:0<=v[h].y?r:u,y:p},direction:0>v[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,r),y1:s,x2:Math.max(u,r),y2:x},color:c})}}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.xScaleAnimation,easingFunction:Q.easing.easeOutQuart, animationBase:ma.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderArea=function(a){var f,b;function c(){A&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?x=s:0>a.axisY.viewportMaximum?x=n.y1:0=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();w&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();w&&(k.beginPath(),k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!Z)))if("number"!==typeof q[C].y)t.connectNullData||(Z||f)||c(),Z=!0;else{v=a.axisX.convertValueToPixel(u);E=a.axisY.convertValueToPixel(q[C].y);f||Z?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType||b===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=v,b=E,v=p.x,E=p.y,c(),g.moveTo(p.x,p.y), v=f,E=b,A=p,b=t.nullDataLineDashType,g.setLineDash(U)),g.lineTo(v,E),w&&k.lineTo(v,E)):(g.beginPath(),g.moveTo(v,E),w&&(k.beginPath(),k.moveTo(v,E)),A={x:v,y:E}),Z=f=!1):(g.lineTo(v,E),w&&k.lineTo(v,E),0==C%250&&c());p={x:v,y:E};C q[C].y===a.axisY.reversed?1:-1,color:y})}c();aa.drawMarkers(h)}}w&&(d.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:d,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderSplineArea=function(a){function f(){var b=y(s,2);if(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=C:0>a.axisY.viewportMaximum?v=k.y1:0=a.dataSeriesIndexes.length)){var d= this._eventManager.ghostCtx,g=a.axisX.lineCoordinates,k=a.axisY.lineCoordinates,l=[],n=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(n.x1,n.y1,n.width,n.height);c.clip();w&&(d.beginPath(),d.rect(n.x1,n.y1,n.width,n.height),d.clip());for(var h=0;ha.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!q)))if("number"!== typeof m[e].y)0m[e].y===a.axisY.reversed?1:-1,color:x});q=!1}f();aa.drawMarkers(l)}}w&&(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(n.x1,n.y1,n.width,n.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStepArea=function(a){var f,b;function c(){A&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?D=x:0>a.axisY.viewportMaximum?D=n.y1:0=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();w&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();w&&(k.beginPath(), k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!b))){var O=u;"number"!==typeof q[C].y?(t.connectNullData||(b||f)||c(),b=!0):(v=a.axisX.convertValueToPixel(s),u=a.axisY.convertValueToPixel(q[C].y),f||b?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType|| U===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=v,b=u,v=p.x,u=p.y,c(),g.moveTo(p.x,p.y),v=f,u=b,A=p,U=t.nullDataLineDashType,g.setLineDash(ba)),g.lineTo(v,O),g.lineTo(v,u),w&&(k.lineTo(v,O),k.lineTo(v,u))):(g.beginPath(),g.moveTo(v,u),w&&(k.beginPath(),k.moveTo(v,u)),A={x:v,y:u}),b=f=!1):(g.lineTo(v,O),w&&k.lineTo(v,O),g.lineTo(v,u),w&&k.lineTo(v,u),0==C%250&&c()),p={x:v,y:u},Cq[C].y===a.axisY.reversed?1:-1,color:y}))}c();aa.drawMarkers(h)}}w&&(d.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:d,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStackedArea=function(a){function f(){if(!(1>n.length)){for(0=a.dataSeriesIndexes.length)){var d=null,g=[],k=this.plotArea,l=[],n=[],h=[],r=[],p=0,m,e,t,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),C=this._eventManager.ghostCtx,v,u,s;w&&C.beginPath();c.save();w&&C.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(C.beginPath(),C.rect(k.x1,k.y1,k.width, k.height),C.clip());for(var d=[],x=0;xa.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!Z)))if("number"!==typeof O.y)A.connectNullData|| (Z||u)||f(),Z=!0;else{m=a.axisX.convertValueToPixel(t);var I=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(O.y),e-=I;n.push({x:m,y:q-I});l[t]=q-e;u||Z?(!u&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||s===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(u=n.pop(),s=n[n.length-1], f(),c.moveTo(v.x,v.y),n.push(s),n.push(u),s=A.nullDataLineDashType,c.setLineDash(U)),c.lineTo(m,e),w&&C.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),w&&(C.beginPath(),C.moveTo(m,e))),Z=u=!1):(c.lineTo(m,e),w&&C.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),w&&C.moveTo(m,e),n.push({x:m,y:q-I})));v={x:m,y:e};py[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);w&&C.moveTo(m,e)}delete A.dataPointIndexes}aa.drawMarkers(g);w&&(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(k.x1,k.y1,k.width,k.height),C.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderStackedArea100=function(a){function f(){for(0=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=[],l=[],n=[],h=[],r=[],p=0,m,e,t,q,u,v,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),x=this._eventManager.ghostCtx;c.save();w&&x.save(); c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();w&&(x.beginPath(),x.rect(g.x1,g.y1,g.width,g.height),x.clip());for(var d=[],y=0;ya.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!Z)))if("number"!==typeof O.y)A.connectNullData||(Z||u)||f(),Z=!0;else{var I;I=0!==a.dataPointYSums[t]?100*(O.y/a.dataPointYSums[t]):0;m=a.axisX.convertValueToPixel(t);var ma=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(I),e-=ma;n.push({x:m,y:s-ma});l[t]=s-e; u||Z?(!u&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||v===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(u=n.pop(),v=n[n.length-1],f(),c.moveTo(q.x,q.y),n.push(v),n.push(u),v=A.nullDataLineDashType,c.setLineDash(U)),c.lineTo(m,e),w&&x.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),w&&(x.beginPath(),x.moveTo(m,e))),Z=u=!1):(c.lineTo(m,e),w&&x.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),w&&x.moveTo(m,e),n.push({x:m,y:s-ma})));q={x:m,y:e};pz[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);w&&x.moveTo(m,e)}delete A.dataPointIndexes}aa.drawMarkers(k); w&&(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),x.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation, easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderBubble=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=-Infinity,n=Infinity,h=0;h< a.dataSeriesIndexes.length;h++)for(var r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,e=0,d=0;da.axisX.dataInfo.viewPortMax||"undefined"===typeof m[d].z||(e=m[d].z,e>l&&(l=e),ea.axisX.dataInfo.viewPortMax)&&"number"===typeof m[d].y){g=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(m[d].y);var e=m[d].z,u=2*Math.max(Math.sqrt((l===n?q/2:t+(q-t)/(l-n)*(e-n))/Math.PI)<<0,1),e=p.getMarkerProperties(d,b);e.size=u;b.globalAlpha=p.fillOpacity;aa.drawMarker(g,k,b,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;var v=p.dataPointIds[d];this._eventManager.objectMap[v]= {id:v,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:d,x1:g,y1:k,size:u};u=W(v);w&&aa.drawMarker(g,k,this._eventManager.ghostCtx,e.type,e.size,u,u,e.borderThickness);(m[d].indexLabel||p.indexLabel||m[d].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:m[d],dataSeries:p,point:{x:g,y:k},direction:1,bounds:{x1:g-e.size/2,y1:k-e.size/2,x2:g+e.size/2,y2:k+e.size/2},color:null})}w&&(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:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderScatter= function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();w&&(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[d].y){g=a.axisX.convertValueToPixel(g);k=a.axisY.convertValueToPixel(r[d].y);var e=h.getMarkerProperties(d,g,k,b);b.globalAlpha=h.fillOpacity;aa.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;Math.sqrt((p- g)*(p-g)+(m-k)*(m-k))Math.min(this.plotArea.width,this.plotArea.height)||(p=h.dataPointIds[d],this._eventManager.objectMap[p]={id:p,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:d,x1:g,y1:k},p=W(p),w&&aa.drawMarker(e.x,e.y,this._eventManager.ghostCtx,e.type,e.size,p,p,e.borderThickness),(r[d].indexLabel||h.indexLabel||r[d].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:r[d],dataSeries:h,point:{x:g,y:k},direction:1, bounds:{x1:g-e.size/2,y1:k-e.size/2,x2:g+e.size/2,y2:k+e.size/2},color:null}),p=g,m=k)}}}w&&(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:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderCandlestick=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=null,k=this.plotArea,l=0,n,h,r,p,m,e,d=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,g=this.dataPointMaxWidth?this.dataPointMaxWidth: this.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.dataPointWidth?this.dataPointWidth:0.7*k.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&d>g&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(t=g);b.save();w&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();w&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(var q=0;qa.axisX.dataInfo.viewPortMax)&&!x(s[l].y)&&s[l].y.length&&"number"===typeof s[l].y[0]&&"number"=== typeof s[l].y[1]&&"number"===typeof s[l].y[2]&&"number"===typeof s[l].y[3]){n=a.axisX.convertValueToPixel(e);h=a.axisY.convertValueToPixel(s[l].y[0]);r=a.axisY.convertValueToPixel(s[l].y[1]);p=a.axisY.convertValueToPixel(s[l].y[2]);m=a.axisY.convertValueToPixel(s[l].y[3]);var y=n-t/2<<0,D=y+t<<0,g=v.options.fallingColor?v.fallingColor:v._colorSet[0],d=s[l].color?s[l].color:v._colorSet[0],A=Math.round(Math.max(1,0.15*t)),z=0===A%2?0:0.5,B=v.dataPointIds[l];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint", dataSeriesIndex:u,dataPointIndex:l,x1:y,y1:h,x2:D,y2:r,x3:n,y3:p,x4:n,y4:m,borderThickness:A,color:d};b.strokeStyle=d;b.beginPath();b.lineWidth=A;c.lineWidth=Math.max(A,4);"candlestick"===v.type?(b.moveTo(n-z,r),b.lineTo(n-z,Math.min(h,m)),b.stroke(),b.moveTo(n-z,Math.max(h,m)),b.lineTo(n-z,p),b.stroke(),Y(b,y,Math.min(h,m),D,Math.max(h,m),s[l].y[0]<=s[l].y[3]?v.risingColor:g,A,d,G,G,!1,!1,v.fillOpacity),w&&(d=W(B),c.strokeStyle=d,c.moveTo(n-z,r),c.lineTo(n-z,Math.min(h,m)),c.stroke(),c.moveTo(n- z,Math.max(h,m)),c.lineTo(n-z,p),c.stroke(),Y(c,y,Math.min(h,m),D,Math.max(h,m),d,0,null,!1,!1,!1,!1))):"ohlc"===v.type&&(b.moveTo(n-z,r),b.lineTo(n-z,p),b.stroke(),b.beginPath(),b.moveTo(n,h),b.lineTo(y,h),b.stroke(),b.beginPath(),b.moveTo(n,m),b.lineTo(D,m),b.stroke(),w&&(d=W(B),c.strokeStyle=d,c.moveTo(n-z,r),c.lineTo(n-z,p),c.stroke(),c.beginPath(),c.moveTo(n,h),c.lineTo(y,h),c.stroke(),c.beginPath(),c.moveTo(n,m),c.lineTo(D,m),c.stroke()));(s[l].indexLabel||v.indexLabel||s[l].indexLabelFormatter|| v.indexLabelFormatter)&&this._indexLabels.push({chartType:v.type,dataPoint:s[l],dataSeries:v,point:{x:y+(D-y)/2,y:a.axisY.reversed?p:r},direction:1,bounds:{x1:y,y1:Math.min(r,p),x2:D,y2:Math.max(r,p)},color:d})}}w&&(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(k.x1,k.y1,k.width,k.height),c.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderBoxAndWhisker=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=0,l,n,h,r,p,m,e,d=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth? this.dataPointWidth:1,k=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));t=this.dataPointWidth?this.dataPointWidth:0.7*g.width*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&d>k&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&kk&&(t=k);b.save();w&&c.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();w&&(c.beginPath(),c.rect(g.x1,g.y1,g.width,g.height),c.clip());for(var q=!1,q=!!a.axisY.reversed,u=0;ua.axisX.dataInfo.viewPortMax)&&!x(G[k].y)&&G[k].y.length&&"number"===typeof G[k].y[0]&&"number"===typeof G[k].y[1]&&"number"===typeof G[k].y[2]&&"number"===typeof G[k].y[3]&&"number"===typeof G[k].y[4]&&5===G[k].y.length){l=a.axisX.convertValueToPixel(e);n=a.axisY.convertValueToPixel(G[k].y[0]);h=a.axisY.convertValueToPixel(G[k].y[1]);r=a.axisY.convertValueToPixel(G[k].y[2]);p=a.axisY.convertValueToPixel(G[k].y[3]);m=a.axisY.convertValueToPixel(G[k].y[4]);var D=l-t/2<<0,A=l+t/2<<0,d=G[k].color? G[k].color:s._colorSet[0],z=Math.round(Math.max(1,0.15*t)),B=0===z%2?0:0.5,N=G[k].whiskerColor?G[k].whiskerColor:G[k].color?s.whiskerColor?s.whiskerColor:G[k].color:s.whiskerColor?s.whiskerColor:d,U="number"===typeof G[k].whiskerThickness?G[k].whiskerThickness:"number"===typeof s.options.whiskerThickness?s.whiskerThickness:z,ba=G[k].whiskerDashType?G[k].whiskerDashType:s.whiskerDashType,Z=x(G[k].whiskerLength)?x(s.options.whiskerLength)?t:s.whiskerLength:G[k].whiskerLength,Z="number"===typeof Z?0>= Z?0:Z>=t?t:Z:"string"===typeof Z?parseInt(Z)*t/100>t?t:parseInt(Z)*t/100:t,O=1===Math.round(U)%2?0.5:0,I=G[k].stemColor?G[k].stemColor:G[k].color?s.stemColor?s.stemColor:G[k].color:s.stemColor?s.stemColor:d,ma="number"===typeof G[k].stemThickness?G[k].stemThickness:"number"===typeof s.options.stemThickness?s.stemThickness:z,sa=1===Math.round(ma)%2?0.5:0,P=G[k].stemDashType?G[k].stemDashType:s.stemDashType,M=G[k].lineColor?G[k].lineColor:G[k].color?s.lineColor?s.lineColor:G[k].color:s.lineColor?s.lineColor: d,J="number"===typeof G[k].lineThickness?G[k].lineThickness:"number"===typeof s.options.lineThickness?s.lineThickness:z,V=G[k].lineDashType?G[k].lineDashType:s.lineDashType,K=1===Math.round(J)%2?0.5:0,R=s.upperBoxColor,cb=s.lowerBoxColor,L=x(s.options.fillOpacity)?1:s.fillOpacity,ha=s.dataPointIds[k];this._eventManager.objectMap[ha]={id:ha,objectType:"dataPoint",dataSeriesIndex:v,dataPointIndex:k,x1:D,y1:n,x2:A,y2:h,x3:l,y3:r,x4:l,y4:p,y5:m,borderThickness:z,color:d,stemThickness:ma,stemColor:I,whiskerThickness:U, whiskerLength:Z,whiskerColor:N,lineThickness:J,lineColor:M};b.save();0=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;k=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth: 0.03*this.width;var h=a.axisX.dataInfo.minDiff;isFinite(h)||(h=0.3*Math.abs(a.axisX.range));h=this.dataPointWidth?this.dataPointWidth:0.9*(d.width*(a.axisX.logarithmic?Math.log(h)/Math.log(a.axisX.range):Math.abs(h)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&g>k&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k k&&(h=k);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var r=0;ra.axisX.dataInfo.viewPortMax)&&!x(e[g].y)&&e[g].y.length&&"number"===typeof e[g].y[0]&&"number"===typeof e[g].y[1]){c=a.axisX.convertValueToPixel(n);k=a.axisY.convertValueToPixel(e[g].y[0]);l=a.axisY.convertValueToPixel(e[g].y[1]);var q=a.axisX.reversed?c+a.plotType.totalDataSeries*h/2-(a.previousDataSeriesCount+r)*h<<0:c-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+r)*h<<0,s=a.axisX.reversed?q-h<<0:q+h<<0,c=e[g].color?e[g].color:m._colorSet[g%m._colorSet.length];if(k>l){var v=k;k= l;l=v}v=m.dataPointIds[g];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:g,x1:q,y1:k,x2:s,y2:l};Y(b,q,k,s,l,c,0,c,t,t,!1,!1,m.fillOpacity);c=W(v);w&&Y(this._eventManager.ghostCtx,q,k,s,l,c,0,null,!1,!1,!1,!1);if(e[g].indexLabel||m.indexLabel||e[g].indexLabelFormatter||m.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:e[g],dataSeries:m,indexKeyword:0,point:{x:q+(s-q)/2,y:e[g].y[1]>=e[g].y[0]?l:k},direction:e[g].y[1]>=e[g].y[0]? -1:1,bounds:{x1:q,y1:Math.min(k,l),x2:s,y2:Math.max(k,l)},color:c}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:e[g],dataSeries:m,indexKeyword:1,point:{x:q+(s-q)/2,y:e[g].y[1]>=e[g].y[0]?k:l},direction:e[g].y[1]>=e[g].y[0]?1:-1,bounds:{x1:q,y1:Math.min(k,l),x2:s,y2:Math.max(k,l)},color:c})}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderError=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f,c=a.axisY._position? "left"===a.axisY._position||"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=!1,k=this.plotArea,l=0,n,h,r,p,m,e,t,q=a.axisX.dataInfo.minDiff;isFinite(q)||(q=0.3*Math.abs(a.axisX.range));b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.clip());for(var s=0,v=0;vl&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&ll&&(v=l);if(0=N.length?0:N.length>=v?v:N.length:"string"===typeof N.length?parseInt(N.length)*v/100>v?v: parseInt(N.length)*v/100>v:v;N.thickness="number"===typeof N.thickness?0>N.thickness?0:Math.round(N.thickness):2;var U={color:D[l].stemColor?D[l].stemColor:D[l].color?y.stemColor?y.stemColor:D[l].color:y.stemColor?y.stemColor:d,thickness:D[l].stemThickness?D[l].stemThickness:y.stemThickness,dashType:D[l].stemDashType?D[l].stemDashType:y.stemDashType};U.thickness="number"===typeof U.thickness?0>U.thickness?0:Math.round(U.thickness):2;D[l].getTime?t=D[l].x.getTime():t=D[l].x;if(!(ta.axisX.dataInfo.viewPortMax)&&!x(D[l].y)&&D[l].y.length&&"number"===typeof D[l].y[0]&&"number"===typeof D[l].y[1]){var ba=a.axisX.convertValueToPixel(t);c?h=ba:n=ba;ba=a.axisY.convertValueToPixel(D[l].y[0]);c?r=ba:m=ba;ba=a.axisY.convertValueToPixel(D[l].y[1]);c?p=ba:e=ba;c?(m=a.axisX.reversed?h+(A?s:1)*v/2-(A?B-1:0)*v<<0:h-(A?s:1)*v/2+(A?B-1:0)*v<<0,e=a.axisX.reversed?m-v<<0:m+v<<0):(r=a.axisX.reversed?n+(A?s:1)*v/2-(A?B-1:0)*v<<0:n-(A?s:1)*v/2+(A?B-1:0)*v<<0,p=a.axisX.reversed?r-v<<0:r+v<<0); !c&&m>e&&(ba=m,m=e,e=ba);c&&r>p&&(ba=r,r=p,p=ba);ba=y.dataPointIds[l];this._eventManager.objectMap[ba]={id:ba,objectType:"dataPoint",dataSeriesIndex:G,dataPointIndex:l,x1:Math.min(r,p),y1:Math.min(m,e),x2:Math.max(p,r),y2:Math.max(e,m),isXYSwapped:c,stemProperties:U,whiskerProperties:N};z(b,Math.min(r,p),Math.min(m,e),Math.max(p,r),Math.max(e,m),d,N,U,c);w&&z(this._eventManager.ghostCtx,r,m,p,e,d,N,U,c);if(D[l].indexLabel||y.indexLabel||D[l].indexLabelFormatter||y.indexLabelFormatter)this._indexLabels.push({chartType:"error", dataPoint:D[l],dataSeries:y,indexKeyword:0,point:{x:c?D[l].y[1]>=D[l].y[0]?r:p:r+(p-r)/2,y:c?m+(e-m)/2:D[l].y[1]>=D[l].y[0]?e:m},direction:D[l].y[1]>=D[l].y[0]?-1:1,bounds:{x1:c?Math.min(r,p):r,y1:c?m:Math.min(m,e),x2:c?Math.max(r,p):p,y2:c?e:Math.max(m,e)},color:d,axisSwapped:c}),this._indexLabels.push({chartType:"error",dataPoint:D[l],dataSeries:y,indexKeyword:1,point:{x:c?D[l].y[1]>=D[l].y[0]?p:r:r+(p-r)/2,y:c?m+(e-m)/2:D[l].y[1]>=D[l].y[0]?m:e},direction:D[l].y[1]>=D[l].y[0]?1:-1,bounds:{x1:c? Math.min(r,p):r,y1:c?m:Math.min(m,e),x2:c?Math.max(r,p):p,y2:c?e:Math.max(m,e)},color:d,axisSwapped:c})}}}w&&(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(k.x1,k.y1,k.width, k.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=w?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=null,d=this.plotArea,g=0,k,l,n,h,g=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;k=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*(d.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>k&&(g=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&& kk&&(r=k);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var p=0;pa.axisX.dataInfo.viewPortMax)&&!x(t[g].y)&&t[g].y.length&&"number"===typeof t[g].y[0]&&"number"===typeof t[g].y[1]){k=a.axisY.convertValueToPixel(t[g].y[0]);l=a.axisY.convertValueToPixel(t[g].y[1]);n=a.axisX.convertValueToPixel(h);n=a.axisX.reversed?n+a.plotType.totalDataSeries*r/2-(a.previousDataSeriesCount+p)*r<<0:n-a.plotType.totalDataSeries*r/2+(a.previousDataSeriesCount+p)*r<<0;var s= a.axisX.reversed?n-r<<0:n+r<<0;k>l&&(c=k,k=l,l=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];Y(b,k,n,l,s,c,0,null,q,!1,!1,!1,e.fillOpacity);c=e.dataPointIds[g];this._eventManager.objectMap[c]={id:c,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:g,x1:k,y1:n,x2:l,y2:s};c=W(c);w&&Y(this._eventManager.ghostCtx,k,n,l,s,c,0,null,!1,!1,!1,!1);if(t[g].indexLabel||e.indexLabel||t[g].indexLabelFormatter||e.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:t[g], dataSeries:e,indexKeyword:0,point:{x:t[g].y[1]>=t[g].y[0]?k:l,y:n+(s-n)/2},direction:t[g].y[1]>=t[g].y[0]?-1:1,bounds:{x1:Math.min(k,l),y1:n,x2:Math.max(k,l),y2:s},color:c}),this._indexLabels.push({chartType:"rangeBar",dataPoint:t[g],dataSeries:e,indexKeyword:1,point:{x:t[g].y[1]>=t[g].y[0]?l:k,y:n+(s-n)/2},direction:t[g].y[1]>=t[g].y[0]?1:-1,bounds:{x1:Math.min(k,l),y1:n,x2:Math.max(k,l),y2:s},color:c})}}}w&&(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(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeArea= function(a){function f(){if(u){var a=null;0= a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;la.axisX.dataInfo.viewPortMax&&(!r.connectNullData||!N)))if(null!==p[e].y&&p[e].y.length&&"number"===typeof p[e].y[0]&&"number"===typeof p[e].y[1]){t= a.axisX.convertValueToPixel(v);q=a.axisY.convertValueToPixel(p[e].y[0]);s=a.axisY.convertValueToPixel(p[e].y[1]);m||N?(r.connectNullData&&!m?(c.setLineDash&&(r.options.nullDataLineDashType||A===r.lineDashType&&r.lineDashType!==r.nullDataLineDashType)&&(n[n.length-1].newLineDashArray=J,A=r.nullDataLineDashType,c.setLineDash(B)),c.lineTo(t,q),w&&d.lineTo(t,q),n.push({x:t,y:s})):(c.beginPath(),c.moveTo(t,q),u={x:t,y:q},n=[],n.push({x:t,y:s}),w&&(d.beginPath(),d.moveTo(t,q))),N=m=!1):(c.lineTo(t,q),n.push({x:t, y:s}),w&&d.lineTo(t,q),0==e%250&&f());v=r.dataPointIds[e];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:e,x1:t,y1:q,y2:s};ep[e].y[1]===a.axisY.reversed?-1:1,color:x}),this._indexLabels.push({chartType:"rangeArea",dataPoint:p[e],dataSeries:r,indexKeyword:1,point:{x:t,y:s},direction:p[e].y[0]>p[e].y[1]===a.axisY.reversed?1:-1,color:x})}else N||m||f(),N=!0;f();aa.drawMarkers(g)}}w&&(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(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:Q.xClipAnimation,easingFunction:Q.easing.linear,animationBase:0}}};u.prototype.renderRangeSplineArea=function(a){function f(a,b){var e=y(q,2);if(0=a.dataSeriesIndexes.length)){var d= this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();w&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();w&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;la.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!e)))if(null!==r[p].y&&r[p].y.length&&"number"===typeof r[p].y[0]&&"number"===typeof r[p].y[1]){m=a.axisX.convertValueToPixel(m);e=a.axisY.convertValueToPixel(r[p].y[0]);t=a.axisY.convertValueToPixel(r[p].y[1]); var B=h.dataPointIds[p];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:p,x1:m,y1:e,y2:t};q[q.length]={x:m,y:e};s[s.length]={x:m,y:t};p=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,d=null,g=this.plotArea,k=0,l,n,h,r,p=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),k=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15* this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0;var m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.dataPointWidth?this.dataPointWidth:0.6*(g.width*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&k>n&&(k=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(m=n);b.save();w&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();w&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var e=0;eh&&(d=n,n=h,h=d);a.axisY.reversed&&(d=n,n=h,h=d);d=q.dataPointIds[k];this._eventManager.objectMap[d]={id:d,objectType:"dataPoint", dataSeriesIndex:t,dataPointIndex:k,x1:l,y1:n,x2:J,y2:h};var N=s[k].color?s[k].color:-1s[k].y===a.axisY.reversed?1:-1,bounds:{x1:l,y1:Math.min(n,h),x2:J,y2:Math.max(n,h)},color:d})}}w&&(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:Q.fadeInAnimation,easingFunction:Q.easing.easeInQuad,animationBase:0}}};var qa=function(a,f,b,c,d,g,k,l,n){if(!(0>b)){"undefined"===typeof l&&(l=1);if(!w){var h=Number((k%(2*Math.PI)).toFixed(8));Number((g%(2*Math.PI)).toFixed(8))===h&&(k-=1E-4)}a.save();a.globalAlpha=l;"pie"===d?(a.beginPath(),a.moveTo(f.x,f.y),a.arc(f.x,f.y, b,g,k,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===d&&(a.beginPath(),a.arc(f.x,f.y,b,g,k,!1),0<=n&&a.arc(f.x,f.y,n*b,k,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};u.prototype.renderPie=function(a){function f(){if(h&&r){for(var a=0,b=0,c=0,d=0,f=0;fMath.PI/2-v&&l.midAnglel.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v){if(0===b||e[d].midAngle>l.midAngle)d=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new ka(n.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()}k=g=0;p=!1;for(f=0;fMath.PI/2-v&&l.midAngle3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v)&&(k<=b/2&&!p?(l.hemisphere= "left",k++):(l.hemisphere="right",p=!0))}}function b(a){var b=n.plotArea.ctx;b.clearRect(m.x1,m.y1,m.width,m.height);b.fillStyle=n.backgroundColor;b.fillRect(m.x1,m.y1,m.width,m.height);for(b=0;bc){var f=0.07*A*Math.cos(e[b].midAngle),g=0.07*A*Math.sin(e[b].midAngle),k=!1;if(r[b].exploded){if(1E-9a.indexLabelTextBlock.y?e-d:c-f}function d(a){for(var b=null,d=1;dc(e[b],e[a])||("right"===e[a].hemisphere?e[b].indexLabelTextBlock.y>=e[a].indexLabelTextBlock.y:e[b].indexLabelTextBlock.y<=e[a].indexLabelTextBlock.y)))break; else b=null;return b}function g(a,b,f){f=(f||0)+1;if(1E3b&&l.indexLabelTextBlock.ym)return 0;var n=0,p=0,p=n=n=0;0>b?l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2>k&&l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2+bm&&(b=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+b-m);b=l.indexLabelTextBlock.y+b;k=0;k="right"===l.hemisphere?w.x+Math.sqrt(Math.pow(q,2)-Math.pow(b-w.y,2)):w.x-Math.sqrt(Math.pow(q,2)-Math.pow(b-w.y,2));p=w.x+A*Math.cos(l.midAngle);n=w.y+A*Math.sin(l.midAngle);n=Math.sqrt(Math.pow(k-p,2)+Math.pow(b-n,2));p=Math.acos(A/q);n=Math.acos((q*q+A*A-n*n)/(2*A*q));b=nc(e[k],e[a])||("right"===e[a].hemisphere?e[k].indexLabelTextBlock.y<=e[a].indexLabelTextBlock.y:e[k].indexLabelTextBlock.y>=e[a].indexLabelTextBlock.y)))break;else k=null;p=k;n=d(a);m=k=0;0>b?(m="right"===l.hemisphere?p:n,h=b,null!==m&&(p=-b,b=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2-(e[m].indexLabelTextBlock.y+e[m].indexLabelTextBlock.height/2),b-p +k.toFixed(u)&&(h=b>t?-(b-t):-(p-(m-k)))))):0t?b-t:p-(k-m)))));h&&(f=l.indexLabelTextBlock.y+h,b=0,b="right"===l.hemisphere?w.x+Math.sqrt(Math.pow(q,2)-Math.pow(f-w.y,2)):w.x-Math.sqrt(Math.pow(q,2)-Math.pow(f-w.y,2)),l.midAngle>Math.PI/2-v&&l.midAnglek.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===l.hemisphere&&("left"===a.hemisphere&&b3*Math.PI/2-v&&l.midAngle<3*Math.PI/2+v&&(k=(a-1+e.length)%e.length,k=e[k],a=e[(a+1+e.length)%e.length],"right"===l.hemisphere&&"left"===k.hemisphere&&ba.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),l.indexLabelTextBlock.y=f,l.indexLabelTextBlock.x=b,l.indexLabelAngle=Math.atan2(l.indexLabelTextBlock.y-w.y,l.indexLabelTextBlock.x-w.x))}return h}function k(){var a=n.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,f=0,k=!0,b=0;10>b&&(1>b||0z){for(var D=x=0,F=0;Fx?l.indexLabelText="":l.indexLabelTextBlock.maxWidth=0.85*x,0.3*l.indexLabelTextBlock.maxWidthf&&(f=y)),y=y=0,0f&&(f=y)));var K=function(a,b,c){for(var d=[],f=0;d.push(e[b]),b!==c;b=(b+1+r.length)%r.length);d.sort(function(a,b){return a.y-b.y});for(b=0;bz){m=v.indexLabelTextBlock.x;var n=v.indexLabelTextBlock.y-v.indexLabelTextBlock.height/2,t=v.indexLabelTextBlock.y+v.indexLabelTextBlock.height/2,q=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2,s=l.indexLabelTextBlock.x+l.indexLabelTextBlock.width,u=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2;m=v.indexLabelTextBlock.x+v.indexLabelTextBlock.widths+p||n>u+p||ta&&(a=k),h!==a&&(b=h,f+=-z),0===k%Math.max(r.length/ 10,3)&&(g=!0)):g=!0;g&&(0=a.dataSeriesIndexes.length)){var h=this.data[a.dataSeriesIndexes[0]],r=h.dataPoints,p=10,m=this.plotArea,e=h.dataPointEOs,t=2,q,s=1.3,v=20/180*Math.PI,u=6,w={x:(m.x2+m.x1)/2,y:(m.y2+m.y1)/2},y=0;a=!1;for(var z=0;za&&(d=a,f=!0);var g=r[b].color?r[b].color:h._colorSet[b%h._colorSet.length];d>c&&qa(n.plotArea.ctx,e[b].center,e[b].radius,g,h.type,c,d,h.fillOpacity,e[b].percentInnerRadius);if(f)break}l()},function(){n.disableToolTip=!1;n._animator.animate(0,n.animatedRender?500:0,function(a){b(a);l()})})}}};var wa=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())};u.prototype.renderFunnel=function(a){function f(){for(var a=0,b=[],c=0;csqrt?(m=c,h=(b+m)*(e-l)/2,a-=h,h=e-l,l+=e-l,h+=0==m?0:a/m,l+=a/m,n=!0):(h=(Math.abs(da)*b-Math.sqrt(sqrt))/2,m=b-2*h/Math.abs(da),l+=h,l>e&&(l-=h,m=c,h=(b+m)*(e-l)/2,a-=h,h=e-l,l+=e-l,h+=a/m,l+=a/m,n=!0),b=m)),d.push(h);return d}function c(){if(v&&u){for(var a,b,c,d,f,g,h,k,l,m,n,p,r,t,q=[],x=[],y={percent:null,total:null},A=null,z=0;zq[z]&&(q[z]=z!==ea?v.reversed?L[z].x3-L[z].x4:L[z].x2-L[z].x1:L[z].x2-L[z].x1,q[z]/=2));r=b.indexLabelMaxWidth||v.indexLabelMaxWidth||q[z];if(r>q[z]||0>r)r=q[z];x[z]="inside"===v.indexLabelPlacement?L[z].height:!1;y=s.getPercentAndTotal(v,b);if(v.indexLabelFormatter||b.indexLabelFormatter)A={chart:s.options,dataSeries:v,dataPoint:b, total:y.total,percent:y.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(A):b.indexLabel?s.replaceKeywordsWithValue(b.indexLabel,b,v,z):v.indexLabelFormatter?v.indexLabelFormatter(A):v.indexLabel?s.replaceKeywordsWithValue(v.indexLabel,b,v,z):b.label?b.label:"";0>=m&&(m=0);1E3>r&&1E3-rg?g:v.indexLabelMaxWidth:g,h=H.length-1;0<=h;h--){dataPoint=u[H[h].id];c=H[h];d=c.textBlock;b=(a=m(h)b.y&&(e=!0);c=dataPoint.indexLabelMaxWidth|| g;if(c>g||0>c)c=g;f.push(c)}if(e)for(h=H.length-1;0<=h;h--)a=L[h],H[h].textBlock.maxWidth=f[f.length-(h+1)],H[h].textBlock.measureText(),H[h].textBlock.x=J-g,c=H[h].textBlock.height T+z&&(H[h].textBlock.y=T+z-H[h].height),H[h].textBlock.yX+z&&(H[h].textBlock.y=X+z-H[h].height))}function g(){var a,b,c,d;if("inside"!==v.indexLabelPlacement)for(var f=0;f$?e(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5? c<$?e(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,H[f].textBlock.x=b+M,H[f].textBlock.y=c-H[f].height/2,v.reversed?(H[f].textBlock.y+H[f].height>T+z&&(H[f].textBlock.y=T+z-H[f].height),H[f].textBlock.yX+z&&(H[f].textBlock.y=X+z-H[f].height)));else for(f=0;f=c?(b=f!=ea?(a.x4+a.x3)/2-d/2:(a.x5+ a.x4)/2-d/2,c=f!=ea?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,H[f].textBlock.x=b,H[f].textBlock.y=c):H[f].isDirty=!0)}function k(){function a(b,c){var d;if(0>b||b>=H.length)return 0;var e,f=H[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==L.length-1)return 0e)&&(k=m(r),!(k>=H.length-1)&&H[r].textBlock.y+H[r].height+fa>H[k].textBlock.y&&(H[r].textBlock.y=H[r].textBlock.y+H[r].height-e>e-H[r].textBlock.y?e+1:e-H[r].height-1))}for(k=L.length-1;0e&&(e=0,H[e].isDirty))break;if(H[k].textBlock.y=f){f=0;h+=H[f].height;break}e=p(f);if(0>e){f=0;h+=H[f].height;break}}if(f!=k){g=H[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(L[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d+k.y.toFixed(6))&&(d=g.y+d+fa-k.y,e=a(t,-d),ea?v.reversed?X-z:T-z:H[a].textBlock.y+H[a].height+fa)}function n(a, b,c){function d(b,c,f,h){ia=!0;var k=((new Date).getTime()-f.startTime)/f.duration,k=f.easingFunction(f.startTime,k,0,f.duration/1E3);1<=k&&(k=1);e(c);f.changeSection(k,b);var l={};l.dataSeries=v;l.dataPoint=v.reversed?v.dataPoints[u.length-1-b]:v.dataPoints[b];l.index=v.reversed?u.length-1-b:b;a.toolTip.highlightObjects([l]);for(l=0;ls&&(s*=-1),c.y1+=newY-s[d],c.y2+=newY-s[d],c.y3+=newY-s[d],c.y4+=newY-s[d],c.y5&&(c.y5+=newY-s[d],c.y6+=newY-s[d]),s[d]=newY}};d(b, a.ctx,c,a)}function h(){for(var a=0,b=0;ba){b=L[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 t(a){for(var b=0;b=a.dataSeriesIndexes.length)){for(var v=this.data[a.dataSeriesIndexes[0]],u=v.dataPoints,y=this.plotArea,z=0.025*y.width,D=0.01*y.width,A=!1,B=0;BP?O=P:0>=O&&(O=!0),I>D?I=D-0.5:0>=I&&(I=!0)):"pyramid"===v.type&&(I=O=!0,v.reversed=v.reversed?!1:!0);O=O?"number"===typeof O?O:0:0.35*P;I=I?"number"===typeof I?I:0:0.25*D;var R=B+D/2,W=B,S=B+D,T=v.reversed?U:N,Y=R-I/2,K=R+I/2,$=v.reversed?N+O:U-O,X=v.reversed?N:U,D=[],R=[],L=[],ha=[],ca=N,ea,da=($-T)/(Y-W),ga=-da,B="area"===(v.valueRepresents?v.valueRepresents:"height")?b():f();if(-1!==B){if(v.reversed)for(ha.push(ca),I=B.length-1;0\n');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(f)},1E3)},500)};u.prototype.getPercentAndTotal=function(a,f){var b=null,c=null,d=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],d=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=k||"undefined"===typeof k||0>=y||"undefined"===typeof y)){if("horizontal"===this.orientation){e.textBlock=new ka(this.ctx,{x:0,y:0,maxWidth:y,maxHeight:this.itemWrap?k:this.lineHeight,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor, fontStyle:this.fontStyle,textBaseline:"middle"});e.textBlock.measureText();null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0)));if(!m||m.width+Math.round(e.textBlock.width+s+l+(0===m.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)m={items:[],width:0},h.push(m),this.height+=w,w=0;w=Math.max(w,e.textBlock.height)}else e.textBlock= new ka(this.ctx,{x:0,y:0,maxWidth:y,maxHeight:!0===this.itemWrap?k:1.5*this.fontSize,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),e.textBlock.measureText(),null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.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-d&&r+d>=this.dataPoints.length)break;-1===k?(d++,k=1):k=-1}return f||b.dataPoint.x!==a?f&&null!==b.dataPoint?b:null:b};R.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=[],d=0,g=0,k=1,l=!1,n=Infinity,h=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 m=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1>0,0),this.dataPoints.length):0;else m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0>0,0),this.dataPoints.length):0;for(;;){g=0< k?p+d:p-d;if(0<=g&&g=m.x1&&(a<=m.x2&&f>=m.y1&&f<=m.y2)&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y1-f),Math.abs(m.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=ja("markerSize",e,this)||4,s=b?20:q,t=Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y1-f,2));t<=s&&c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t});m=Math.abs(m.x1-a);m<=n?n=m:0s&&(t=Math.atan2(f-q.y,a-q.x),0>t&&(t+=2*Math.PI),t=Number(((180*(t/Math.PI)%360+360)%360).toFixed(12)),q=Number(((180*(m.startAngle/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(m.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===s&&1=s&&0!==e.y&&(s+=360,tq&&tt.y1&&ft.y6?(g=t.x6+(t.x5-t.x6)/ (t.y5-t.y6)*(f-t.y6),t=t.x3+(t.x4-t.x3)/(t.y4-t.y3)*(f-t.y3)):(g=t.x1+(t.x6-t.x1)/(t.y6-t.y1)*(f-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(f-t.y2)):(g=t.x1+(t.x4-t.x1)/(t.y4-t.y1)*(f-t.y1),t=t.x2+(t.x3-t.x2)/(t.y3-t.y2)*(f-t.y2)),a>g&&a=m.x1-m.borderThickness/2&&a<=m.x2+m.borderThickness/2&&f>=m.y4-m.borderThickness/2&&f<=m.y1+m.borderThickness/2||Math.abs(m.x2-a+m.x1-a)=m.y1&&f<=m.y4)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-f))}),l=!0;break;case "candlestick":if(a>=m.x1-m.borderThickness/2&&a<=m.x2+m.borderThickness/2&&f>=m.y2-m.borderThickness/2&&f<=m.y3+m.borderThickness/2||Math.abs(m.x2-a+m.x1-a)=m.y1&&f<=m.y4)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3- f))}),l=!0;break;case "ohlc":if(Math.abs(m.x2-a+m.x1-a)=m.y2&&f<=m.y3||a>=m.x1&&a<=(m.x2+m.x1)/2&&f>=m.y1-m.borderThickness/2&&f<=m.y1+m.borderThickness/2||a>=(m.x1+m.x2)/2&&a<=m.x2&&f>=m.y4-m.borderThickness/2&&f<=m.y4+m.borderThickness/2)c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(m.x1-a),Math.abs(m.x2-a),Math.abs(m.y2-f),Math.abs(m.y3-f))}),l=!0}if(l||1E3p-d&&p+d>=this.dataPoints.length)break;-1===k?(d++,k=1): k=-1}a=null;for(f=0;fm[t].endValue;t++);p=a;a=t=m[t].startValue&&a<=m[t].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart, axis:this.options,value:new Date(p),label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:za(p,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx,{x:0,y:0,maxWidth:g,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:k,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:p,textBlock:a,effectiveHeight:null,breaksLabelType:void 0}))}}else{d=this.viewportMaximum;if(this.labels){a=Math.ceil(l);c=Math.ceil(this.intervalStartPosition);t=!1;for(b=c;bm[t].endValue;t++);a=t=m[t].startValue&&b<=m[t].endValue;p=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:p,label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:ea(p,this.valueFormatString,this.chart._cultureInfo),a=new ka(this.ctx, {x:0,y:0,maxWidth:g,maxHeight:k,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:p,textBlock:a,effectiveHeight:null}))}t= e;for(b=this.intervalStartPosition;b<=d;b=parseFloat((this.logarithmic&&this.equidistantInterval?b*Math.pow(this.logarithmBase,this.interval):b+this.interval).toFixed(12))){for(;tm[t].endValue;t++);a=t=m[t].startValue&&b<=m[t].endValue;p=b;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:p,label:this.labels[p]?this.labels[p]:null}):"axisX"===this.type&&this.labels[p]?this.labels[p]:ea(p,this.valueFormatString,this.chart._cultureInfo), a=new ka(this.ctx,{x:0,y:0,maxWidth:g,maxHeight:k,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:p,textBlock:a,effectiveHeight:null}))}}if("bottom"=== this._position||"top"===this._position)n=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))*M[this.intervalType+"Duration"]*this.interval, g="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(k="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)n=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))*M[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),k="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*n>>0,e=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize; this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=k;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;be&&(q=b,e=l.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):x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelMaxWidth=g,p.width+f.width>> 0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth))this.options.labelMaxWidth>0,t=this.labelFontSize,ed&&(d=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth=g,x(this.options.labelFontSize)&&12=2.2*g&&c<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=t):c>=2.8*g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,e),this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*g&&c<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelFontSize=this.labelFontSize):c>3.6*g&&c<5*g?(x(this.options.labelFontSize)&&125*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=t,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelAngle=this.labelAngle));else if(q===b&&(0===q&&e+this._labels[q+1].textBlock.measureText().width-2*g>d||q===this._labels.length-1&&e+this._labels[q-1].textBlock.measureText().width-2*g>d||0d&&e+this._labels[q-1].textBlock.measureText().width- 2*g>d))d=0===q?e+this._labels[q+1].textBlock.measureText().width-2*g:e+this._labels[q-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l;else if(0===d)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?t: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?k:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/ Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),l=0!=this.labelAngle?(r-(h+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=k=this.labelWrap?(r-l*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,x(this.options.labelWrap))?x(this.options.labelWrap)&&(this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap= this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelMaxHeight=k):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=l,this.sessionVariables.labelMaxHeight=c<0.9*n?0.9*n:c,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l): (x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:l,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=k)}for(c=0;c>0:this.options.labelMaxWidth,k="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=k;this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b>0,n-2*k>e&&(e=n-2*k,n>=2*k&&n<2.4*k?(x(this.options.labelFontSize)&&12=2.4*k&&n<2.8*k?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):n>=2.8*k&&n<3.2*k?(this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12< this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):n>=3.2*k&&n<3.6*k?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):n>3.6*k&&n<10*k?(x(this.options.labelFontSize)&& 1210*k&&n<50*k&&(x(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?k:c,x(this.options.labelMaxWidth)&& (this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?k:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMaxHeight=k,x(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)s=x(g.options.labelWrap)?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;x(g.labelBackgroundColor)&&(g.labelBackgroundColor="#EEEEEE")}else k="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>> 0,s=x(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,x(g.labelBackgroundColor)&&(x(g.startValue)&&0!==g.startValue?g.labelBackgroundColor=w?"transparent":null:g.labelBackgroundColor="#EEEEEE");a=new ka(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:k,maxHeight:s,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})}};B.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.valuem[e].viewportMaximum);q++)t[q].endValue=m[e].viewPortMinimum&&(m[e].scaleBreaks.lastBreakIndex=q));for(var s=q=0,v=0,u=0,y=0,z=0,B=0,A,F,J=l=0,N,U,P,t=N=U=P=!1,e=0;eq;){var R=0,T=0,W=0,V=0,S=d=0,K=0,Y=0,X=0,L=0,$=0,aa=0;if(b&&0r.width-10?r.width-10:g.x2-aa-Y);if(a&&0r.width-10?r.width-10:g.x2-aa-Y),a[e]._labels&&1n&&(l+=0a[e].labelAngle?A-sn&&(l=F+v/2-n-aa),A-sa[e].labelAngle&&0r.width-10?r.width-10:g.x2-aa-Y),f[e].lineCoordinates.width=Math.abs(n-k),f[e]._labels&&1q;){L=X=$=V=Y=K=S=d=W=M=T=R=0;if(a&&0r.width-10?r.width-10:g.x2-L-S),b[e].labelAutoFit&&!x(u)&&(0b[e].labelAngle?Math.max(k,u):0===b[e].labelAngle?Math.max(k,u/2):k),0c[e].chart.width-10?c[e].chart.width-10:g.x2-L-S),c[e]&&c[e].labelAutoFit&&!x(z)&&(0b[e].chart.height-10?b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=l-(A[e]+b[e].margin+R),b[e].lineCoordinates.y2=l-(A[e]+b[e].margin+R),b[e].bounds={x1:k,y1:l-(A[e]+R+b[e].margin),x2:n,y2:h-(R+b[e].margin),width:n-k,height:A[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2-V):g.y2>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2;if(b&&0b[K].labelAngle?Math.max(n,u):0===b[K].labelAngle?Math.max(n,u/2):n,k= 0>b[K].labelAngle||0===b[K].labelAngle?n-X:k);if(c&&0r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2-V):g.y2>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2;if(b&& 0b[K].labelAngle?Math.max(n,u):0===b[K].labelAngle?Math.max(n,u/2):n,k=0>b[K].labelAngle||0===b[K].labelAngle?n-L:k);if(c&&0f[g].spacing?0:Math.abs(f[g].spacing/b),this.logarithmic&&(f[g].size=Math.pow(this.logarithmBase,f[g].size))};B.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||(x(this.scaleBreaks.firstBreakIndex)&&(this.scaleBreaks.firstBreakIndex=f),a[f].startValue>=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)))}};B.prototype.renderLabelsTicksAndTitle=function(){var a=this,f=!1,b=0,c=0,d=1,g=0;0!==this.labelAngle&&360!==this.labelAngle&&(d=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=[],d=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,k,l=this.viewportMaximum,n=this.lineCoordinates.width/Math.log(this.range),h=this._labels.length-1;0<=h;h--){p=this._labels[h];if(p.positionthis.viewportMaximum||!(h===this._labels.length-1||kthis.lineCoordinates.width*d&&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,n=this.lineCoordinates.height/Math.log(this.range),h=this._labels.length-1;0<=h;h--){p=this._labels[h];if(p.positionthis.viewportMaximum||!(h===this._labels.length-1||rthis.lineCoordinates.height*d&&this.labelAutoFit&&(f=!0)}}this.logarithmic&&(!this.equidistantInterval&&this.labelAutoFit)&&this._labels.sort(function(a,b){return a.position-b.position});var h=0,p,m;if("bottom"===this._position){for(h=0;hthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=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?(m.x<<0)+0.5:m.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,m.y<<0),this.ctx.lineTo(c,m.y+this.tickLength<<0),this.ctx.stroke()),0===p.textBlock.angle?(m.x-=p.textBlock.width/2,m.y="inside"===this.labelPlacement? m.y-(this.tickLength+p.textBlock.fontSize/2):m.y+this.tickLength+p.textBlock.fontSize/2):(m.x="inside"===this.labelPlacement?0>this.labelAngle?m.x:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):m.x-(0>this.labelAngle?p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),m.y="inside"===this.labelPlacement?0>this.labelAngle?m.y-this.tickLength-5:m.y-this.tickLength-Math.abs(p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+5):m.y+this.tickLength+Math.abs(0>this.labelAngle?p.textBlock.width* Math.sin(Math.PI/180*this.labelAngle)-5:5)),p.textBlock.x=m.x,p.textBlock.y=m.y);"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;ha.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(m.x<<0)+0.5:m.x<<0;a.ctx.save(); a.ctx.beginPath();a.ctx.moveTo(b,m.y<<0);a.ctx.lineTo(b,m.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(h=0;hthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=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?(m.x<<0)+0.5:m.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,m.y<<0),this.ctx.lineTo(c,m.y-this.tickLength<<0),this.ctx.stroke()),0===p.textBlock.angle?(m.x-=p.textBlock.width/2,m.y="inside"===this.labelPlacement? m.y+this.labelFontSize/2+this.tickLength+5:m.y-(this.tickLength+p.textBlock.height-p.textBlock.fontSize/2)):(m.x="inside"===this.labelPlacement?0a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&& (m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===this.ctx.lineWidth%2?(m.x<<0)+0.5:m.x<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(b,m.y<<0);a.ctx.lineTo(b,m.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(h=0;hthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=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?(m.y<<0)+0.5:m.y<<0,this.ctx.beginPath(),this.ctx.moveTo(m.x<< 0,c),this.ctx.lineTo(m.x-this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(p.textBlock.y=m.y,p.textBlock.x="inside"===this.labelPlacement?m.x+this.tickLength+5:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5):(p.textBlock.y="inside"===this.labelPlacement?m.y:m.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?m.x+this.tickLength+5:0a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness; a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(m.y<<0)+0.5:m.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(m.x<<0,b);a.ctx.lineTo(m.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(h=0;hthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit)||(m=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?(m.y<<0)+0.5:m.y<<0,this.ctx.beginPath(),this.ctx.moveTo(m.x<<0,c),this.ctx.lineTo(m.x+this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle? (p.textBlock.y=m.y,p.textBlock.x="inside"===this.labelPlacement?m.x-p.textBlock.width-this.tickLength-5:m.x+this.tickLength+5):(p.textBlock.y="inside"===this.labelPlacement?m.y-p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0>this.labelAngle?m.y:m.y-(p.textBlock.height-p.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),p.textBlock.x="inside"===this.labelPlacement?m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:0a.viewportMaximum||f&&0!==g++%2&&a.labelAutoFit)&&(m=a.getPixelCoordinatesOnAxis(p.position),a.tickThickness)){a.ctx.lineWidth=a.tickThickness;a.ctx.strokeStyle=a.tickColor;var b=1===a.ctx.lineWidth%2?(m.y<< 0)+0.5:m.y<<0;a.ctx.save();a.ctx.beginPath();a.ctx.moveTo(m.x<<0,b);a.ctx.lineTo(m.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(h=0;ha.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(h=0;hthis.viewportMaximum||f&&0!==g++%2&&this.labelAutoFit&&p.skipFlag)||p.textBlock.render(!0)};B.prototype.renderInterlacedColors=function(){var a=this.chart.plotArea.ctx, f,b,c=this.chart.plotArea,d=0;f=!0;if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,d=0;dthis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[d+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,d=0;dthis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[d+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()};B.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0this.viewportMaximum||x(h.value)||isNaN(this.range))||l.push(h))}for(c=0;cthis.viewportMaximum||isNaN(this.range))){a=this.getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(h&& (this.ctx.strokeStyle=h.color,"pixel"===h._thicknessType&&(this.ctx.lineWidth=h.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?x(h.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,x(h.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?x(h.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,x(h.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?x(h.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? x(h.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()}};B.prototype.renderCrosshair=function(a,f){this.crosshair.render(a,f)};B.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()}};B.prototype.renderAxisLine=function(){var a=this.chart.ctx,f=w?this.chart._preRenderCtx:a,b=Math.ceil(this.tickThickness/(this.reversed?-2:2)),c=Math.ceil(this.tickThickness/(this.reversed?2:-2)),d,g;f.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){this.reversed?(d=this.lineCoordinates.x2,g=this.lineCoordinates.x1): (d=this.lineCoordinates.x1,g=this.lineCoordinates.x2);f.lineWidth=this.lineThickness;f.strokeStyle=this.lineColor?this.lineColor:"black";f.setLineDash&&f.setLineDash(F(this.lineDashType,this.lineThickness));var k=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;f.beginPath();if(this.scaleBreaks&&!x(this.scaleBreaks.firstBreakIndex))if(x(this.scaleBreaks.lastBreakIndex))d=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+c;else for(var l= this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)f.moveTo(d,k),f.lineTo(this.scaleBreaks._appliedBreaks[l].startPixel+b,k),d=this.scaleBreaks._appliedBreaks[l].endPixel+c;d&&(f.moveTo(d,k),f.lineTo(g,k));f.stroke()}}else if(("left"===this._position||"right"===this._position)&&this.lineThickness){this.reversed?(d=this.lineCoordinates.y1,g=this.lineCoordinates.y2):(d=this.lineCoordinates.y2,g=this.lineCoordinates.y1);f.lineWidth=this.lineThickness;f.strokeStyle=this.lineColor; f.setLineDash&&f.setLineDash(F(this.lineDashType,this.lineThickness));k=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<<0;f.beginPath();if(this.scaleBreaks&&!x(this.scaleBreaks.firstBreakIndex))if(x(this.scaleBreaks.lastBreakIndex))d=this.scaleBreaks._appliedBreaks[this.scaleBreaks.firstBreakIndex].endPixel+b;else for(l=this.scaleBreaks.firstBreakIndex;l<=this.scaleBreaks.lastBreakIndex;l++)f.moveTo(k,d),f.lineTo(k,this.scaleBreaks._appliedBreaks[l].startPixel+c), d=this.scaleBreaks._appliedBreaks[l].endPixel+b;d&&(f.moveTo(k,d),f.lineTo(k,g));f.stroke()}w&&(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()};B.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};B.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var f=0,b=0,c,f=!0,d=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;bd[b].startValue/this.conversionParameters.minimum){c/=d[b].startValue/this.conversionParameters.minimum;if(cd[b].startValue/d[b-1].endValue){c/=d[b].startValue/d[b-1].endValue;if(cthis.conversionParameters.minimum))if(f)if(d[b].endValue>this.conversionParameters.minimum){if(1d[b].startValue){a=Math.pow(d[b].endValue/d[b].startValue,Math.log(c)/Math.log(d[b].size));break}else a*=d[b].startValue/this.conversionParameters.minimum*Math.pow(d[b].size,Math.log(d[b].startValue/this.conversionParameters.minimum)/Math.log(d[b].endValue/d[b].startValue))*c,c*=Math.pow(d[b].size,Math.log(this.conversionParameters.minimum/d[b].startValue)/Math.log(d[b].endValue/d[b].startValue));f=!1}else if(c1/d[b].size){a*=Math.pow(d[b].endValue/d[b].startValue,1>=d[b].size?1:Math.log(c)/Math.log(d[b].size))*c;break}else a/=d[b].endValue/d[b].startValue/d[b].size;c*=d[b].size;f=!1}else break;else if(c1/d[b].size){a*=Math.pow(d[b].endValue/d[b].startValue,1>=d[b].size?1:Math.log(c)/Math.log(d[b].size))*c;break}else a/=d[b].endValue/d[b].startValue/d[b].size;c*=d[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=d[b].size?0:c*(d[b].endValue- d[b].startValue)/d[b].size;break}else a+=d[b].endValue-this.conversionParameters.minimum-d[b].size*(d[b].endValue-this.conversionParameters.minimum)/(d[b].endValue-d[b].startValue),c-=d[b].size*(d[b].endValue-this.conversionParameters.minimum)/(d[b].endValue-d[b].startValue);f=!1}else if(c>d[b].startValue-this.conversionParameters.minimum){c-=d[b].startValue-this.conversionParameters.minimum;if(cd[b].startValue-d[b-1].endValue){c-=d[b].startValue-d[b-1].endValue;if(cthis.conversionParameters.minimum))if(f)if(d[b].endValue>this.conversionParameters.minimum)if(d[b].size&&this.conversionParameters.minimum+c*(d[b].endValue- d[b].startValue)/d[b].size>d[b].startValue){a=0>=d[b].size?0:c*(d[b].endValue-d[b].startValue)/d[b].size;break}else a+=d[b].startValue-this.conversionParameters.minimum+d[b].size*(this.conversionParameters.minimum-d[b].startValue)/(d[b].endValue-d[b].startValue),c+=d[b].size*(this.conversionParameters.minimum-d[b].startValue)/(d[b].endValue-d[b].startValue),f=!1;else if(c-1*d[b].size){a+=(d[b].endValue- d[b].startValue)*(0===d[b].size?1:c/d[b].size)+c;break}else a-=d[b].endValue-d[b].startValue-d[b].size;c+=d[b].size;f=!1}else break;else if(c-1*d[b].size){a+=(d[b].endValue-d[b].startValue)*(0===d[b].size?1:c/d[b].size)+c;break}else a-=d[b].endValue-d[b].startValue-d[b].size;c+=d[b].size}else break;f=this.conversionParameters.minimum+a}return f};B.prototype.convertValueToPixel=function(a){a=this.getAppearentDifferceReplacingBreaksToSize(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};B.prototype.getAppearentDifferceReplacingBreaksToSize=function(a,f,b,c){var d=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];if(this.logarithmic){b=x(b)?f/a:b;for(var g=0;gd[g].endValue||(a<=d[g].startValue&&f>=d[g].endValue?b=b/d[g].endValue*d[g].startValue*d[g].size:a>=d[g].startValue&&f>=d[g].endValue?b=b/d[g].endValue*a*Math.pow(d[g].size,Math.log(d[g].endValue/a)/Math.log(d[g].endValue/d[g].startValue)):a<=d[g].startValue&&f<=d[g].endValue?b=b/f*d[g].startValue*Math.pow(d[g].size,Math.log(f/d[g].startValue)/Math.log(d[g].endValue/d[g].startValue)):!c&&(a>d[g].startValue&&fd[g].endValue||(a<=d[g].startValue&&f>=d[g].endValue?b=b-d[g].endValue+d[g].startValue+d[g].size:a>d[g].startValue&&f>=d[g].endValue?b=b-d[g].endValue+a+d[g].size*(d[g].endValue-a)/(d[g].endValue-d[g].startValue):a<=d[g].startValue&&fd[g].startValue&&fa[d].endValue||(this.viewportMinimum>=a[d].startValue&&this.viewportMaximum<=a[d].endValue?b=0:this.viewportMinimum<=a[d].startValue&&this.viewportMaximum>=a[d].endValue? (c=c/a[d].endValue*a[d].startValue,b=0a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c/a[d].endValue*this.viewportMinimum,b=0 a[d].endValue||(this.viewportMinimum>=a[d].startValue&&this.viewportMaximum<=a[d].endValue?b=0:this.viewportMinimum<=a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c-a[d].endValue+a[d].startValue,b=0a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c-a[d].endValue+this.viewportMinimum,b=0this.maxWidth?8:6);var a=Math.max(c,Math.floor(this.maxWidth/a)),d,g,k,c=0;!x(this.options.viewportMinimum)&&(!x(this.options.viewportMaximum)&&this.options.viewportMinimum>=this.options.viewportMaximum)&&(this.viewportMinimum=this.viewportMaximum=null);if(x(this.options.viewportMinimum)&& !x(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(x(this.options.viewportMaximum)&&!x(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||!x(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[c].startValue||!x(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[c].startValue)&&(!x(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<= this.scaleBreaks._appliedBreaks[c].endValue||!x(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[c].endValue||!x(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.getAppearentDifferceReplacingBreaksToSize(g,d,null,!0)),5),0<=g?d=g-c:g=isFinite(d)?d+c:0):(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(d,g,null,!0)),0.05),0!==g&&(g+=c),0!==d&&(d-= c)),k=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0));c=this.getAppearentDifferceReplacingBreaksToSize(isNaN(this.viewportMinimum)||null===this.viewportMinimum?d: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*M.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*M.secondDuration)<=a?(this.interval=2,this.intervalType="second"):c/(5*M.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*M.secondDuration)<=a?(this.interval=10,this.intervalType= "second"):c/(15*M.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*M.secondDuration)<=a?(this.interval=20,this.intervalType="second"):c/(30*M.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*M.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*M.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):c/(5*M.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*M.minuteDuration)<=a?(this.interval=10,this.intervalType= "minute"):c/(15*M.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*M.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):c/(30*M.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*M.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*M.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):c/(3*M.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*M.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1* M.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*M.dayDuration)<=a?(this.interval=2,this.intervalType="day"):c/(4*M.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*M.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*M.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*M.weekDuration)<=a?(this.interval=3,this.intervalType="week"):c/(1*M.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*M.monthDuration)<=a?(this.interval=2, this.intervalType="month"):c/(3*M.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*M.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=c/(1*M.yearDuration)<=a?1:c/(2*M.yearDuration)<=a?2:c/(4*M.yearDuration)<=a?4:Math.floor(B.getNiceNumber(c/(a-1),!0)/M.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=d-k/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum= g+k/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=B.getNiceNumber(c,!1);this.interval=this.options&&0g?(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(g,d,null,!0)),5),0<=g?d=g-c:g=isFinite(d)?d+c:0):(c=Math.min(0.01*Math.abs(this.getAppearentDifferceReplacingBreaksToSize(d,g,null,!0)),0.05),0!==g&&(g+=c),0!==d&&(d-=c)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,d="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),k=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0)),Math.abs(this.getAppearentDifferceReplacingBreaksToSize(d,g,null,!0)),"axisX"===this.type&&b){if(null===this.minimum||isNaN(this.minimum))this.minimum=d-k/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+k/2}else this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?d-k/2:Math.floor(d/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+k/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));x(this.sessionVariables.newViewportMinimum)&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));x(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=B.generateValueFormatString(this.range,2))}};B.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,d,g,k;k=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(k=0;k=this.scaleBreaks._appliedBreaks[k].startValue||!x(this.options.minimum)&&this.options.minimum>= this.scaleBreaks._appliedBreaks[k].startValue||!x(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[k].startValue)&&(!x(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[k].endValue||!x(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[k].endValue||!x(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[k].endValue)){this.scaleBreaks._appliedBreaks.splice(k, 1);break}"axisX"===this.type?(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,d=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===d/c&&(k=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),d*=k,c/=k),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.viewportMinimum?this.viewportMinimum: this.dataInfo.viewPortMin,d=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=c&&!isFinite(d)?(d="undefined"===typeof this.options.interval?0:this.options.interval,c=1):0>=c?c=d:isFinite(d)||(d=c),1===c&&1===d?(d*=this.logarithmBase-1/this.logarithmBase,c=1):1===d/c?(k=Math.min(d*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),d*=k,c/=k):c>d?(k=Math.min(c/d*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=d?c=d/k:d=c*k):(k=Math.min(d/ c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==d&&(d*=k),1!==c&&(c/=k)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&1d&&(d=1));k=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?d:this.viewportMaximum)/(isNaN(this.viewportMinimum)|| null===this.viewportMinimum?c:this.viewportMinimum);linearRange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?d:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);this.intervalType="number";k=Math.pow(this.logarithmBase,B.getNiceNumber(Math.abs(Math.log(k)/f),!1));this.options&&0this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.minimum?this.minimum:this.dataInfo.min,d=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(c)||isFinite(d)?1===c&&1===d?(d*=this.logarithmBase,c/=this.logarithmBase):1===d/c?(k=Math.pow(this.logarithmBase, this.interval),d*=k,c/=k):c>d?(k=Math.min(0.01*(c/d),5),1<=d?c=d/k:d=c*k):(k=Math.min(d/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==d&&(d*=k),1!==c&&(c/=k)):(d="undefined"===typeof this.options.interval?0:this.options.interval,c=1),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:d/c>this.logarithmBase?d/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1d&&(d=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?d*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(d)/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 d=0;db?1>=c?1:5>=c?5:10:Math.max(Math.floor(c),1);return Number((c*Math.pow(10,b)).toFixed(20))};B.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))};B.prototype.getLabelStartPoint=function(){var a=M[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(k,l),this.ctx.lineTo(k,d);else if("wavy"===this.type){n=c;h=d;g=0.5;r=(l-h)/a/3;for(var m=0;m=a||"right"===this.scaleBreaks.parent._position&&0<=a)this.ctx.lineTo(k,d),this.ctx.lineTo(k,l),this.ctx.lineTo(c,l);else if("wavy"===this.type){n=c;h=d;g=0.5;r= (k-n)/a/3;for(m=0;mthis.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=B.generateValueFormatString(this.parent.range,h)}var l=null===this.opacity?1:this.opacity,h=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=h;r.save();this.labelFontSize=x(this.options.labelFontSize)?this.parent.labelFontSize:this.labelFontSize;if("left"===this.parent._position||"right"===this.parent._position)this.labelMaxWidth=x(this.options.labelMaxWidth)?this.parent.bounds.x2-this.parent.bounds.x1:this.labelMaxWidth,this.labelMaxHeight=x(this.options.labelWrap)||this.labelWrap?3*this.chart.height:2*this.labelFontSize;else if("top"===this.parent._position||"bottom"===this.parent._position)this.labelMaxWidth= x(this.options.labelMaxWidth)?3*this.chart.width:this.labelMaxWidth,this.labelMaxHeight=x(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){m=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)}k=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)&& d<=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)}):x(this.options.label)?ea(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))};X.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,d=null,g=[],k=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 n=0;nh.dataSeries.axisY.viewportMaximum&&b++;b-h.dataPoint.y.length&&g.push(h)}else"column"===d.type||"bar"===d.type?0>h.dataPoint.y?0>h.dataSeries.axisY.viewportMinimum&&h.dataSeries.axisY.viewportMaximum>=h.dataPoint.y&&g.push(h):h.dataSeries.axisY.viewportMinimum<=h.dataPoint.y&&0<=h.dataSeries.axisY.viewportMaximum&& g.push(h):"bubble"===d.type?(b=this.chart._eventManager.objectMap[d.dataPointIds[h.index]].size/2,h.dataPoint.y>=h.dataSeries.axisY.viewportMinimum-b&&h.dataPoint.y<=h.dataSeries.axisY.viewportMaximum+b&&g.push(h)):"waterfall"===d.type?(b=0,h.cumulativeSumYStartValueh.dataSeries.axisY.viewportMaximum&&b++,h.cumulativeSumh.dataSeries.axisY.viewportMaximum&&b++,2>b&&-2=h.dataSeries.axisY.viewportMinimum&&h.dataPoint.y<=h.dataSeries.axisY.viewportMaximum)&&g.push(h);else g.push(h)}}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}",n=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,d)+f,l"+f)):(f+=this.chart.replaceKeywordsWithValue(g,c,b,d),l")));null!==f&&(f=h+f)}else{b=a[0].dataSeries;c=a[0].dataPoint;d=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,d)}return f};X.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}};X.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition= "",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};X.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())};X.prototype.show=function(a,f,b){this._updateToolTip(a,f,"undefined"===typeof b?!1:b)};X.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}();