Edit file File name : jquery.canvasjs.min.js Content :/* 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 ka(q,v){q.prototype=Ya(v.prototype);q.prototype.constructor=q;q.base=v.prototype}function Ya(q){function v(){}v.prototype=q;return new v}function Ra(q,v,s){"millisecond"===s?q.setMilliseconds(q.getMilliseconds()+1*v):"second"===s?q.setSeconds(q.getSeconds()+1*v):"minute"===s?q.setMinutes(q.getMinutes()+1*v):"hour"===s?q.setHours(q.getHours()+1*v):"day"===s?q.setDate(q.getDate()+1*v):"week"===s?q.setDate(q.getDate()+7*v):"month"===s?q.setMonth(q.getMonth()+1*v):"year"===s&&q.setFullYear(q.getFullYear()+ 1*v);return q}function ga(q,v){var s=!1;0>q&&(s=!0,q*=-1);q=""+q;for(v=v?v:1;q.length<v;)q="0"+q;return s?"-"+q:q}function Da(q){if(!q)return q;q=q.replace(/^\s\s*/,"");for(var v=/\s/,s=q.length;v.test(q.charAt(--s)););return q.slice(0,s+1)}function Aa(q){q.roundRect=function(q,s,x,w,y,z,R,B){R&&(this.fillStyle=R);B&&(this.strokeStyle=B);"undefined"===typeof y&&(y=5);this.lineWidth=z;this.beginPath();this.moveTo(q+y,s);this.lineTo(q+x-y,s);this.quadraticCurveTo(q+x,s,q+x,s+y);this.lineTo(q+x,s+w- y);this.quadraticCurveTo(q+x,s+w,q+x-y,s+w);this.lineTo(q+y,s+w);this.quadraticCurveTo(q,s+w,q,s+w-y);this.lineTo(q,s+y);this.quadraticCurveTo(q,s,q+y,s);this.closePath();R&&this.fill();B&&0<z&&this.stroke()}}function Na(q,v){return q-v}function P(q){var v=((q&16711680)>>16).toString(16),s=((q&65280)>>8).toString(16);q=((q&255)>>0).toString(16);v=2>v.length?"0"+v:v;s=2>s.length?"0"+s:s;q=2>q.length?"0"+q:q;return"#"+v+s+q}function Za(q,v){var s=this.length>>>0,x=Number(v)||0,x=0>x?Math.ceil(x):Math.floor(x); for(0>x&&(x+=s);x<s;x++)if(x in this&&this[x]===q)return x;return-1}function w(q){return null===q||"undefined"===typeof q}function Ea(q){q.indexOf||(q.indexOf=Za);return q}function $a(q){if(na.fSDec)q[na.fSDec("`eeDwdouMhrudods")](na.fSDec("e`u`@ohl`uhnoHuds`uhnoDoe"),function(){na._fTWm&&na._fTWm(q)})}function Sa(q,v,s){s=s||"normal";var x=q+"_"+v+"_"+s,w=Ta[x];if(isNaN(w)){try{q="position:absolute; left:0px; top:-20000px; padding:0px;margin:0px;border:none;white-space:pre;line-height:normal;font-family:"+ q+"; font-size:"+v+"px; font-weight:"+s+";";if(!oa){var y=document.body;oa=document.createElement("span");oa.innerHTML="";var z=document.createTextNode("Mpgyi");oa.appendChild(z);y.appendChild(oa)}oa.style.display="";oa.setAttribute("style",q);w=Math.round(oa.offsetHeight);oa.style.display="none"}catch(R){w=Math.ceil(1.1*v)}w=Math.max(w,v);Ta[x]=w}return w}function F(q,v){var s=[];if(s={solid:[],shortDash:[3,1],shortDot:[1,1],shortDashDot:[3,1,1,1],shortDashDotDot:[3,1,1,1,1,1],dot:[1,2],dash:[4, 2],dashDot:[4,2,1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2]}[q||"solid"])for(var x=0;x<s.length;x++)s[x]*=v;else s=[];return s}function U(q,v,s,x){return q.addEventListener?(q.addEventListener(v,s,x||!1),s):q.attachEvent?(x=function(v){v=v||window.event;v.preventDefault=v.preventDefault||function(){v.returnValue=!1};v.stopPropagation=v.stopPropagation||function(){v.cancelBubble=!0};s.call(q,v)},q.attachEvent("on"+v,x),x):!1}function Ua(q,v,s){q*=aa;v*=aa;q=s.getImageData(q, v,2,2).data;v=!0;for(s=0;4>s;s++)if(q[s]!==q[s+4]|q[s]!==q[s+8]|q[s]!==q[s+12]){v=!1;break}return v?q[0]<<16|q[1]<<8|q[2]:0}function ia(q,v,s){return q in v?v[q]:s[q]}function Fa(q,v,s){if(x&&Va){var w=q.getContext("2d");Ja=w.webkitBackingStorePixelRatio||w.mozBackingStorePixelRatio||w.msBackingStorePixelRatio||w.oBackingStorePixelRatio||w.backingStorePixelRatio||1;aa=Oa/Ja;q.width=v*aa;q.height=s*aa;Oa!==Ja&&(q.style.width=v+"px",q.style.height=s+"px",w.scale(aa,aa))}else q.width=v,q.height=s}function Wa(q){if(!ab){var v= !1,s=!1;"undefined"===typeof qa.Chart.creditHref?(q.creditHref="https://canvasjs.com/",q.creditText="CanvasJS.com"):(v=q.updateOption("creditText"),s=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||v||s)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 ra(q,v){var s=document.createElement("canvas");s.setAttribute("class", "canvasjs-chart-canvas");Fa(s,q,v);x||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(s);return s}function ma(q,v,s){for(var x in s)v.style[x]=s[x]}function sa(q,v,s){v.getAttribute("state")||(v.style.backgroundColor=q.toolbar.backgroundColor,v.style.color=q.toolbar.fontColor,v.style.border="none",ma(q,v,{WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}));v.getAttribute("state")!==s&&(v.setAttribute("state",s),v.setAttribute("type","button"), ma(q,v,{padding:"5px 12px",cursor:"pointer","float":"left",width:"40px",height:"25px",outline:"0px",verticalAlign:"baseline",lineHeight:"0"}),v.setAttribute("title",q._cultureInfo[s+"Text"]),v.innerHTML="<img style='height:95%;' src='"+bb[s].image+"' alt='"+q._cultureInfo[s+"Text"]+"' />")}function Ka(){for(var q=null,v=0;v<arguments.length;v++)q=arguments[v],q.style&&(q.style.display="inline")}function ta(){for(var q=null,v=0;v<arguments.length;v++)(q=arguments[v])&&q.style&&(q.style.display="none")} function T(q,v,s,x,y){this._defaultsKey=q;this._themeOptionsKey=v;this._index=x;this.parent=y;this._eventListeners=[];q={};this.theme&&w(v)&&w(x)?q=w(va[this.theme])?va.light1:va[this.theme]:this.parent&&(this.parent.themeOptions&&this.parent.themeOptions[v])&&(null===x?q=this.parent.themeOptions[v]:0<this.parent.themeOptions[v].length&&(x=Math.min(this.parent.themeOptions[v].length-1,x),q=this.parent.themeOptions[v][x]));this.themeOptions=q;this.options=s?s:{_isPlaceholder:!0};this.setOptions(this.options, q)}function Ba(q,v,s,x,w){"undefined"===typeof w&&(w=0);this._padding=w;this._x1=q;this._y1=v;this._x2=s;this._y2=x;this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding}function ja(q,v){ja.base.constructor.call(this,"TextBlock",null,v,null,null);this.ctx=q;this._isDirty=!0;this._wrappedText=null;this._initialize()}function Pa(q,v){Pa.base.constructor.call(this,"Toolbar","toolbar",v,null,q);this.chart=q;this.canvas=q.canvas;this.ctx=this.chart.ctx;this.optionsName= "toolbar"}function Ga(q,v){Ga.base.constructor.call(this,"Title","title",v,null,q);this.chart=q;this.canvas=q.canvas;this.ctx=this.chart.ctx;this.optionsName="title";if(w(this.options.margin)&&q.options.subtitles)for(var s=q.options.subtitles,x=0;x<s.length;x++)if((w(s[x].horizontalAlign)&&"center"===this.horizontalAlign||s[x].horizontalAlign===this.horizontalAlign)&&(w(s[x].verticalAlign)&&"top"===this.verticalAlign||s[x].verticalAlign===this.verticalAlign)&&!s[x].dockInsidePlotArea===!this.dockInsidePlotArea){this.margin= 0;break}"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}function La(q,v,s){La.base.constructor.call(this,"Subtitle","subtitles",v,s,q);this.chart=q;this.canvas=q.canvas;this.ctx=this.chart.ctx;this.optionsName="subtitles";this.isOptionsInArray=!0;"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=this.width=null; this.bounds={x1:null,y1:null,x2:null,y2:null}}function Ha(q){var v;q&&Ia[q]&&(v=Ia[q]);Ha.base.constructor.call(this,"CultureInfo",null,v,null,null)}var na={},x=!!document.createElement("canvas").getContext,qa={Chart:{width:500,height:400,zoomEnabled:!1,zoomType:"x",backgroundColor:"white",theme:"theme1",animationEnabled:!1,animationDuration:1200,dataPointWidth:null,dataPointMinWidth:null,dataPointMaxWidth:null,colorSet:"colorSet1",culture:"en",creditHref:"",creditText:"CanvasJS",interactivityEnabled:!0, exportEnabled:!1,exportFileName:"Chart",rangeChanging:null,rangeChanged:null,publicProperties:{title:"readWrite",subtitles:"readWrite",toolbar:"readWrite",toolTip:"readWrite",legend:"readWrite",axisX:"readWrite",axisY:"readWrite",axisX2:"readWrite",axisY2:"readWrite",data:"readWrite",options:"readWrite",bounds:"readOnly",container:"readOnly"}},Title:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:20,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal", borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:x?"transparent":null,margin:5,wrap:!0,maxWidth:null,dockInsidePlotArea:!1,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},Subtitle:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:14,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,margin:2,wrap:!0,maxWidth:null,dockInsidePlotArea:!1, publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},Toolbar:{backgroundColor:"white",backgroundColorOnHover:"#2196f3",borderColor:"#2196f3",borderThickness:1,fontColor:"black",fontColorOnHover:"white",publicProperties:{options:"readWrite",chart:"readOnly"}},Legend:{name:null,verticalAlign:"center",horizontalAlign:"right",fontSize:14,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",cursor:null,itemmouseover:null,itemmouseout:null,itemmousemove:null, itemclick:null,dockInsidePlotArea:!1,reversed:!1,backgroundColor:x?"transparent":null,borderColor:x?"transparent":null,borderThickness:0,cornerRadius:0,maxWidth:null,maxHeight:null,markerMargin:null,itemMaxWidth:null,itemWidth:null,itemWrap:!0,itemTextFormatter:null,publicProperties:{options:"readWrite",bounds:"readOnly",chart:"readOnly"}},ToolTip:{enabled:!0,shared:!1,animationEnabled:!0,content:null,contentFormatter:null,reversed:!1,backgroundColor:x?"rgba(255,255,255,.9)":"rgb(255,255,255)",borderColor:null, borderThickness:2,cornerRadius:5,fontSize:14,fontColor:"black",fontFamily:"Calibri, Arial, Georgia, serif;",fontWeight:"normal",fontStyle:"italic",publicProperties:{options:"readWrite",chart:"readOnly"}},Axis:{minimum:null,maximum:null,viewportMinimum:null,viewportMaximum:null,interval:null,intervalType:null,reversed:!1,logarithmic:!1,logarithmBase:10,title:null,titleFontColor:"black",titleFontSize:20,titleFontFamily:"arial",titleFontWeight:"normal",titleFontStyle:"normal",titleWrap:!0,titleMaxWidth:null, titleBackgroundColor:x?"transparent":null,titleBorderColor:x?"transparent":null,titleBorderThickness:0,titleCornerRadius:0,labelAngle:0,labelFontFamily:"arial",labelFontColor:"black",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",labelAutoFit:!0,labelWrap:!0,labelMaxWidth:null,labelFormatter:null,labelBackgroundColor:x?"transparent":null,labelBorderColor:x?"transparent":null,labelBorderThickness:0,labelCornerRadius:0,labelPlacement:"outside",prefix:"",suffix:"",includeZero:!0,tickLength:5, tickColor:"black",tickThickness:1,lineColor:"black",lineThickness:1,lineDashType:"solid",gridColor:"A0A0A0",gridThickness:0,gridDashType:"solid",interlacedColor:x?"transparent":null,valueFormatString:null,margin:2,publicProperties:{options:"readWrite",stripLines:"readWrite",scaleBreaks:"readWrite",crosshair:"readWrite",bounds:"readOnly",chart:"readOnly"}},StripLine:{value:null,startValue:null,endValue:null,color:"orange",opacity:null,thickness:2,lineDashType:"solid",label:"",labelPlacement:"inside", labelAlign:"far",labelWrap:!0,labelMaxWidth:null,labelBackgroundColor:null,labelBorderColor:x?"transparent":null,labelBorderThickness:0,labelCornerRadius:0,labelFontFamily:"arial",labelFontColor:"orange",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",labelFormatter:null,showOnTop:!1,publicProperties:{options:"readWrite",axis:"readOnly",bounds:"readOnly",chart:"readOnly"}},ScaleBreaks:{autoCalculate:!1,collapsibleThreshold:"25%",maxNumberOfAutoBreaks:2,spacing:8,type:"straight", color:"#FFFFFF",fillOpacity:0.9,lineThickness:2,lineColor:"#E16E6E",lineDashType:"solid",publicProperties:{options:"readWrite",customBreaks:"readWrite",axis:"readOnly",autoBreaks:"readOnly",bounds:"readOnly",chart:"readOnly"}},Break:{startValue:null,endValue:null,spacing:8,type:"straight",color:"#FFFFFF",fillOpacity:0.9,lineThickness:2,lineColor:"#E16E6E",lineDashType:"solid",publicProperties:{options:"readWrite",scaleBreaks:"readOnly",bounds:"readOnly",chart:"readOnly"}},Crosshair:{enabled:!1,snapToDataPoint:!1, color:"grey",opacity:null,thickness:2,lineDashType:"solid",label:"",labelWrap:!0,labelMaxWidth:null,labelBackgroundColor:x?"grey":null,labelBorderColor:x?"grey":null,labelBorderThickness:0,labelCornerRadius:0,labelFontFamily:x?"Calibri, Optima, Candara, Verdana, Geneva, sans-serif":"calibri",labelFontSize:12,labelFontColor:"#fff",labelFontWeight:"normal",labelFontStyle:"normal",labelFormatter:null,valueFormatString:null,publicProperties:{options:"readWrite",axis:"readOnly",bounds:"readOnly",chart:"readOnly"}}, DataSeries:{name:null,dataPoints:null,label:"",bevelEnabled:!1,highlightEnabled:!0,cursor:"default",indexLabel:"",indexLabelPlacement:"auto",indexLabelOrientation:"horizontal",indexLabelFontColor:"black",indexLabelFontSize:12,indexLabelFontStyle:"normal",indexLabelFontFamily:"Arial",indexLabelFontWeight:"normal",indexLabelBackgroundColor:null,indexLabelLineColor:"gray",indexLabelLineThickness:1,indexLabelLineDashType:"solid",indexLabelMaxWidth:null,indexLabelWrap:!0,indexLabelFormatter:null,lineThickness:2, lineDashType:"solid",connectNullData:!1,nullDataLineDashType:"dash",color:null,lineColor:null,risingColor:"white",fallingColor:"red",fillOpacity:null,startAngle:0,radius:null,innerRadius:null,neckHeight:null,neckWidth:null,reversed:!1,valueRepresents:null,linkedDataSeriesIndex:null,whiskerThickness:2,whiskerDashType:"solid",whiskerColor:null,whiskerLength:null,stemThickness:2,stemColor:null,stemDashType:"solid",upperBoxColor:"white",lowerBoxColor:"white",type:"column",xValueType:"number",axisXType:"primary", axisYType:"primary",axisXIndex:0,axisYIndex:0,xValueFormatString:null,yValueFormatString:null,zValueFormatString:null,percentFormatString:null,showInLegend:null,legendMarkerType:null,legendMarkerColor:null,legendText:null,legendMarkerBorderColor:x?"transparent":null,legendMarkerBorderThickness:0,markerType:"circle",markerColor:null,markerSize:null,markerBorderColor:x?"transparent":null,markerBorderThickness:0,mouseover:null,mouseout:null,mousemove:null,click:null,toolTipContent:null,visible:!0,publicProperties:{options:"readWrite", axisX:"readWrite",axisY:"readWrite",chart:"readOnly"}},TextBlock:{x:0,y:0,width:null,height:null,maxWidth:null,maxHeight:null,padding:0,angle:0,text:"",horizontalAlign:"center",fontSize:12,fontFamily:"calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,textBaseline:"top"},CultureInfo:{decimalSeparator:".",digitGroupSeparator:",",zoomText:"Zoom",panText:"Pan",resetText:"Reset",menuText:"More Options",saveJPGText:"Save as JPEG", savePNGText:"Save as PNG",printText:"Print",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")}},Ia={en:{}},y=x?"Trebuchet MS, Helvetica, sans-serif":"Arial",ua=x?"Impact, Charcoal, sans-serif":"Arial",xa={colorSet1:"#4F81BC #C0504E #9BBB58 #23BFAA #8064A1 #4AACC5 #F79647 #7F6084 #77A033 #33558B #E59566".split(" "), colorSet2:"#6D78AD #51CDA0 #DF7970 #4C9CA0 #AE7D99 #C9D45C #5592AD #DF874D #52BCA8 #8E7AA3 #E3CB64 #C77B85 #C39762 #8DD17E #B57952 #FCC26C".split(" "),colorSet3:"#8CA1BC #36845C #017E82 #8CB9D0 #708C98 #94838D #F08891 #0366A7 #008276 #EE7757 #E5BA3A #F2990B #03557B #782970".split(" ")},J,ba,V,Z,fa;ba="#333333";V="#000000";J="#666666";fa=Z="#000000";var da=20,z=14,Qa={colorSet:"colorSet1",backgroundColor:"#FFFFFF",title:{fontFamily:ua,fontSize:32,fontColor:ba,fontWeight:"normal",verticalAlign:"top", margin:5},subtitles:[{fontFamily:ua,fontSize:z,fontColor:ba,fontWeight:"normal",verticalAlign:"top",margin:5}],data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:ba,indexLabelFontWeight:"normal",indexLabelLineThickness:1}],axisX:[{titleFontFamily:y,titleFontSize:da,titleFontColor:ba,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:0,gridColor:J,stripLines:[{labelFontFamily:y, labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisX2:[{titleFontFamily:y,titleFontSize:da,titleFontColor:ba,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z, labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:0,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1, lineDashType:"solid"}}],axisY:[{titleFontFamily:y,titleFontSize:da,titleFontColor:ba,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:1,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal", labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisY2:[{titleFontFamily:y,titleFontSize:da,titleFontColor:ba,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:1,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal", labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],legend:{fontFamily:y,fontSize:14,fontColor:ba,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1}}; V=ba="#F5F5F5";J="#FFFFFF";Z="#40BAF1";fa="#F5F5F5";var da=20,z=14,Xa={colorSet:"colorSet2",title:{fontFamily:y,fontSize:33,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",margin:5},subtitles:[{fontFamily:y,fontSize:z,fontColor:"#3A3A3A",fontWeight:"normal",verticalAlign:"top",margin:5}],data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:"#666666",indexLabelFontWeight:"normal",indexLabelLineThickness:1}],axisX:[{titleFontFamily:y,titleFontSize:da,titleFontColor:"#666666", titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",lineThickness:1,lineColor:"#BBBBBB",tickThickness:1,tickColor:"#BBBBBB",gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black", thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisX2:[{titleFontFamily:y,titleFontSize:da,titleFontColor:"#666666",titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",lineThickness:1,lineColor:"#BBBBBB",tickColor:"#BBBBBB",tickThickness:1,gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal", labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],axisY:[{titleFontFamily:y,titleFontSize:da,titleFontColor:"#666666",titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal", lineThickness:0,lineColor:"#BBBBBB",tickColor:"#BBBBBB",tickThickness:1,gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1, lineDashType:"solid"}}],axisY2:[{titleFontFamily:y,titleFontSize:da,titleFontColor:"#666666",titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:"#666666",labelFontWeight:"normal",lineThickness:0,lineColor:"#BBBBBB",tickColor:"#BBBBBB",tickThickness:1,gridThickness:1,gridColor:"#BBBBBB",stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FFA500",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FFA500",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z, labelFontColor:"#EEEEEE",labelFontWeight:"normal",labelBackgroundColor:"black",color:"black",thickness:1,lineDashType:"dot"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#BBBBBB",lineThickness:1,lineDashType:"solid"}}],legend:{fontFamily:y,fontSize:14,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1}};V=ba="#F5F5F5";J="#FFFFFF";Z="#40BAF1";fa="#F5F5F5";da=20;z=14;ua={colorSet:"colorSet12", backgroundColor:"#2A2A2A",title:{fontFamily:ua,fontSize:32,fontColor:ba,fontWeight:"normal",verticalAlign:"top",margin:5},subtitles:[{fontFamily:ua,fontSize:z,fontColor:ba,fontWeight:"normal",verticalAlign:"top",margin:5}],toolbar:{backgroundColor:"#666666",backgroundColorOnHover:"#FF7372",borderColor:"#FF7372",borderThickness:1,fontColor:"#F5F5F5",fontColorOnHover:"#F5F5F5"},data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:V,indexLabelFontWeight:"normal",indexLabelLineThickness:1}], axisX:[{titleFontFamily:y,titleFontSize:da,titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:0,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa, color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisX2:[{titleFontFamily:y,titleFontSize:da,titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:0,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null, color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY:[{titleFontFamily:y,titleFontSize:da,titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1, tickColor:J,gridThickness:1,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY2:[{titleFontFamily:y,titleFontSize:da, titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:1,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"}, scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],legend:{fontFamily:y,fontSize:14,fontColor:ba,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1,fontColor:V,backgroundColor:"rgba(0, 0, 0, .7)"}};J="#FFFFFF";V=ba="#FAFAFA";Z="#40BAF1";fa="#F5F5F5";var da=20,z=14,va={light1:Qa,light2:Xa,dark1:ua,dark2:{colorSet:"colorSet2",backgroundColor:"#32373A", title:{fontFamily:y,fontSize:32,fontColor:ba,fontWeight:"normal",verticalAlign:"top",margin:5},subtitles:[{fontFamily:y,fontSize:z,fontColor:ba,fontWeight:"normal",verticalAlign:"top",margin:5}],toolbar:{backgroundColor:"#666666",backgroundColorOnHover:"#FF7372",borderColor:"#FF7372",borderThickness:1,fontColor:"#F5F5F5",fontColorOnHover:"#F5F5F5"},data:[{indexLabelFontFamily:y,indexLabelFontSize:z,indexLabelFontColor:V,indexLabelFontWeight:"normal",indexLabelLineThickness:1}],axisX:[{titleFontFamily:y, titleFontSize:da,titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:0,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1, lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisX2:[{titleFontFamily:y,titleFontSize:da,titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:1,lineColor:J,tickThickness:1,tickColor:J,gridThickness:0,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null, color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY:[{titleFontFamily:y,titleFontSize:da,titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:0,lineColor:J,tickThickness:1, tickColor:J,gridThickness:1,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"},scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],axisY2:[{titleFontFamily:y,titleFontSize:da, titleFontColor:V,titleFontWeight:"normal",labelFontFamily:y,labelFontSize:z,labelFontColor:V,labelFontWeight:"normal",lineThickness:0,lineColor:J,tickThickness:1,tickColor:J,gridThickness:1,gridColor:J,stripLines:[{labelFontFamily:y,labelFontSize:z,labelFontColor:"#FF7300",labelFontWeight:"normal",labelBackgroundColor:null,color:"#FF7300",thickness:1}],crosshair:{labelFontFamily:y,labelFontSize:z,labelFontColor:"#000000",labelFontWeight:"normal",labelBackgroundColor:fa,color:Z,thickness:1,lineDashType:"dash"}, scaleBreaks:{type:"zigzag",spacing:"2%",lineColor:"#777777",lineThickness:1,lineDashType:"solid",color:"#111111"}}],legend:{fontFamily:y,fontSize:14,fontColor:ba,fontWeight:"bold",verticalAlign:"bottom",horizontalAlign:"center"},toolTip:{fontFamily:y,fontSize:14,fontStyle:"normal",cornerRadius:0,borderThickness:1,fontColor:V,backgroundColor:"rgba(0, 0, 0, .7)"}},theme1:Qa,theme2:Xa,theme3:Qa},Q={numberDuration:1,yearDuration:314496E5,monthDuration:2592E6,weekDuration:6048E5,dayDuration:864E5,hourDuration:36E5, minuteDuration:6E4,secondDuration:1E3,millisecondDuration:1,dayOfWeekFromInt:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")},Ta={},oa=null,ya=function(){var q=/D{1,4}|M{1,4}|Y{1,4}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|f{1,3}|t{1,2}|T{1,2}|K|z{1,3}|"[^"]*"|'[^']*'/g,v="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),s="Sun Mon Tue Wed Thu Fri Sat".split(" "),x="January February March April May June July August September October November December".split(" "),w="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), y=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,z=/[^-+\dA-Z]/g;return function(R,B,O){var F=O?O.days:v,J=O?O.months:x,P=O?O.shortDays:s,Q=O?O.shortMonths:w;O="";var U=!1;R=R&&R.getTime?R:R?new Date(R):new Date;if(isNaN(R))throw SyntaxError("invalid date");"UTC:"===B.slice(0,4)&&(B=B.slice(4),U=!0);O=U?"getUTC":"get";var T=R[O+"Date"](),W=R[O+"Day"](),V=R[O+"Month"](),X=R[O+"FullYear"](),L=R[O+"Hours"](),ea=R[O+ "Minutes"](),a=R[O+"Seconds"](),f=R[O+"Milliseconds"](),b=U?0:R.getTimezoneOffset();return O=B.replace(q,function(c){switch(c){case "D":return T;case "DD":return ga(T,2);case "DDD":return P[W];case "DDDD":return F[W];case "M":return V+1;case "MM":return ga(V+1,2);case "MMM":return Q[V];case "MMMM":return J[V];case "Y":return parseInt(String(X).slice(-2));case "YY":return ga(String(X).slice(-2),2);case "YYY":return ga(String(X).slice(-3),3);case "YYYY":return ga(X,4);case "h":return L%12||12;case "hh":return ga(L% 12||12,2);case "H":return L;case "HH":return ga(L,2);case "m":return ea;case "mm":return ga(ea,2);case "s":return a;case "ss":return ga(a,2);case "f":return String(f).slice(0,1);case "ff":return ga(String(f).slice(0,2),2);case "fff":return ga(String(f).slice(0,3),3);case "t":return 12>L?"a":"p";case "tt":return 12>L?"am":"pm";case "T":return 12>L?"A":"P";case "TT":return 12>L?"AM":"PM";case "K":return U?"UTC":(String(R).match(y)||[""]).pop().replace(z,"");case "z":return(0<b?"-":"+")+Math.floor(Math.abs(b)/ 60);case "zz":return(0<b?"-":"+")+ga(Math.floor(Math.abs(b)/60),2);case "zzz":return(0<b?"-":"+")+ga(Math.floor(Math.abs(b)/60),2)+ga(Math.abs(b)%60,2);default:return c.slice(1,c.length-1)}})}}(),X=function(q,v,s){if(null===q)return"";if(!isFinite(q))return q;q=Number(q);var x=0>q?!0:!1;x&&(q*=-1);var w=s?s.decimalSeparator:".",y=s?s.digitGroupSeparator:",",z="";v=String(v);var z=1,R=s="",B=-1,O=[],F=[],J=0,P=0,Q=0,U=!1,V=0,R=v.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);v=null;for(var W= 0;R&&W<R.length;W++)if(v=R[W],"."===v&&0>B)B=W;else{if("%"===v)z*=100;else if("\u2030"===v){z*=1E3;continue}else if(","===v[0]&&"."===v[v.length-1]){z/=Math.pow(1E3,v.length-1);B=W+v.length-1;continue}else"E"!==v[0]&&"e"!==v[0]||"0"!==v[v.length-1]||(U=!0);0>B?(O.push(v),"#"===v||"0"===v?J++:","===v&&Q++):(F.push(v),"#"!==v&&"0"!==v||P++)}U&&(v=Math.floor(q),R=-Math.floor(Math.log(q)/Math.LN10+1),V=0===q?0:0===v?-(J+R):String(v).length-J,z/=Math.pow(10,V));0>B&&(B=W);z=(q*z).toFixed(P);v=z.split("."); z=(v[0]+"").split("");q=(v[1]+"").split("");z&&"0"===z[0]&&z.shift();for(U=R=W=P=B=0;0<O.length;)if(v=O.pop(),"#"===v||"0"===v)if(B++,B===J){var T=z,z=[];if("0"===v)for(v=J-P-(T?T.length:0);0<v;)T.unshift("0"),v--;for(;0<T.length;)s=T.pop()+s,U++,0===U%R&&(W===Q&&0<T.length)&&(s=y+s)}else 0<z.length?(s=z.pop()+s,P++,U++):"0"===v&&(s="0"+s,P++,U++),0===U%R&&(W===Q&&0<z.length)&&(s=y+s);else"E"!==v[0]&&"e"!==v[0]||"0"!==v[v.length-1]||!/[eE][+-]*[0]+/.test(v)?","===v?(W++,R=U,U=0,0<z.length&&(s=y+s)): s=1<v.length&&('"'===v[0]&&'"'===v[v.length-1]||"'"===v[0]&&"'"===v[v.length-1])?v.slice(1,v.length-1)+s:v+s:(v=0>V?v.replace("+","").replace("-",""):v.replace("-",""),s+=v.replace(/[0]+/,function(q){return ga(V,q.length)}));y="";for(O=!1;0<F.length;)v=F.shift(),"#"===v||"0"===v?0<q.length&&0!==Number(q.join(""))?(y+=q.shift(),O=!0):"0"===v&&(y+="0",O=!0):1<v.length&&('"'===v[0]&&'"'===v[v.length-1]||"'"===v[0]&&"'"===v[v.length-1])?y+=v.slice(1,v.length-1):"E"!==v[0]&&"e"!==v[0]||"0"!==v[v.length- 1]||!/[eE][+-]*[0]+/.test(v)?y+=v:(v=0>V?v.replace("+","").replace("-",""):v.replace("-",""),y+=v.replace(/[0]+/,function(q){return ga(V,q.length)}));s+=(O?w:"")+y;return x?"-"+s:s},Ma=function(q){var v=0,s=0;q=q||window.event;q.offsetX||0===q.offsetX?(v=q.offsetX,s=q.offsetY):q.layerX||0==q.layerX?(v=q.layerX,s=q.layerY):(v=q.pageX-q.target.offsetLeft,s=q.pageY-q.target.offsetTop);return{x:v,y:s}},Va=!0,Oa=window.devicePixelRatio||1,Ja=1,aa=Va?Oa/Ja:1,ab=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,v){if(qa[this._defaultsKey]){var s=qa[this._defaultsKey],x;for(x in s)"publicProperties"!==x&&s.hasOwnProperty(x)&&(this[x]=q&&x in q?q[x]:v&&x in v?v[x]:s[x])}};T.prototype.get=function(q){var v=qa[this._defaultsKey];if("options"===q)return this.options&&this.options._isPlaceholder?null:this.options;if(v.hasOwnProperty(q)||v.publicProperties&&v.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,v,s){s="undefined"===typeof s?!0:s;var x=qa[this._defaultsKey];if("options"===q)this.createUserOptions(v);else if(x.hasOwnProperty(q)||x.publicProperties&&x.publicProperties.hasOwnProperty(q)&&"readWrite"===x.publicProperties[q])this.options._isPlaceholder&&this.createUserOptions(),this.options[q]=v;else{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."));return}s&&(this.chart||this).render()};T.prototype.addTo=function(q,v,x,w){w="undefined"===typeof w?!0:w;var y=qa[this._defaultsKey];y.hasOwnProperty(q)||y.publicProperties&&y.publicProperties.hasOwnProperty(q)&&"readWrite"===y.publicProperties[q]?(this.options._isPlaceholder&&this.createUserOptions(),"undefined"===typeof this.options[q]&&(this.options[q]=[]),q=this.options[q],x="undefined"===typeof x||null===x?q.length:x,q.splice(x,0,v),w&&(this.chart|| this).render()):window.console&&(y.publicProperties&&y.publicProperties.hasOwnProperty(q)&&"readOnly"===y.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 v=this.parent.options[this.optionsName],x=v.length;this.options._isPlaceholder||(Ea(v),x=v.indexOf(this.options));this.options="undefined"===typeof q?{}:q;v[x]=this.options}else this.options="undefined"===typeof q?{}:q,q=this.parent.options,this.optionsName?v=this.optionsName:(v=this._defaultsKey)&&0!==v.length?(x=v.charAt(0).toLowerCase(),1<v.length&&(x=x.concat(v.slice(1))),v=x):v=void 0,q[v]=this.options};T.prototype.remove=function(q){q="undefined"===typeof q?!0:q;if(this.isOptionsInArray){var v= this.parent.options[this.optionsName];Ea(v);var x=v.indexOf(this.options);0<=x&&v.splice(x,1)}else delete this.parent.options[this.optionsName];q&&(this.chart||this).render()};T.prototype.updateOption=function(q){var x=qa[this._defaultsKey],s={},y=this[q],z=this._themeOptionsKey,F=this._index;this.theme&&w(z)&&w(F)?s=w(va[this.theme])?va.light1:va[this.theme]:this.parent&&(this.parent.themeOptions&&this.parent.themeOptions[z])&&(null===F?s=this.parent.themeOptions[z]:0<this.parent.themeOptions[z].length&& (s=Math.min(this.parent.themeOptions[z].length-1,F),s=this.parent.themeOptions[z][s]));this.themeOptions=s;q in x&&(y=q in this.options?this.options[q]:s&&q in s?s[q]:x[q]);if(y===this[q])return!1;this[q]=y;return!0};T.prototype.trackChanges=function(q){if(!this.sessionVariables)throw"Session Variable Store not set";this.sessionVariables[q]=this.options[q]};T.prototype.isBeingTracked=function(q){this.options._oldOptions||(this.options._oldOptions={});return this.options._oldOptions[q]?!0:!1};T.prototype.hasOptionChanged= function(q){if(!this.sessionVariables)throw"Session Variable Store not set";return this.sessionVariables[q]!==this.options[q]};T.prototype.addEventListener=function(q,x,s){q&&x&&(this._eventListeners[q]=this._eventListeners[q]||[],this._eventListeners[q].push({context:s||this,eventHandler:x}))};T.prototype.removeEventListener=function(q,x){if(q&&x&&this._eventListeners[q])for(var s=this._eventListeners[q],w=0;w<s.length;w++)if(s[w].eventHandler===x){s[w].splice(w,1);break}};T.prototype.removeAllEventListeners= function(){this._eventListeners=[]};T.prototype.dispatchEvent=function(q,x,s){if(q&&this._eventListeners[q]){x=x||{};for(var w=this._eventListeners[q],y=0;y<w.length;y++)w[y].eventHandler.call(w[y].context,x)}"function"===typeof this[q]&&this[q].call(s||this.chart,x)};Ba.prototype.registerSpace=function(q,x){"top"===q?this._topOccupied+=x.height:"bottom"===q?this._bottomOccupied+=x.height:"left"===q?this._leftOccupied+=x.width:"right"===q&&(this._rightOccupied+=x.width)};Ba.prototype.unRegisterSpace= function(q,x){"top"===q?this._topOccupied-=x.height:"bottom"===q?this._bottomOccupied-=x.height:"left"===q?this._leftOccupied-=x.width:"right"===q&&(this._rightOccupied-=x.width)};Ba.prototype.getFreeSpace=function(){return{x1:this._x1+this._leftOccupied,y1:this._y1+this._topOccupied,x2:this._x2-this._rightOccupied,y2:this._y2-this._bottomOccupied,width:this._x2-this._x1-this._rightOccupied-this._leftOccupied,height:this._y2-this._y1-this._bottomOccupied-this._topOccupied}};Ba.prototype.reset=function(){this._rightOccupied= this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding};ka(ja,T);ja.prototype._initialize=function(){w(this.padding)||"object"!==typeof this.padding?this.topPadding=this.rightPadding=this.bottomPadding=this.leftPadding=Number(this.padding)|0:(this.topPadding=w(this.padding.top)?0:Number(this.padding.top)|0,this.rightPadding=w(this.padding.right)?0:Number(this.padding.right)|0,this.bottomPadding=w(this.padding.bottom)?0:Number(this.padding.bottom)|0,this.leftPadding=w(this.padding.left)? 0:Number(this.padding.left)|0)};ja.prototype.render=function(q){if(0!==this.fontSize){q&&this.ctx.save();var x=this.ctx.font;this.ctx.textBaseline=this.textBaseline;var s=0;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y+s);"middle"===this.textBaseline&&(s=-this._lineHeight/2);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var w=0,y=this.topPadding,z=null;this.ctx.roundRect||Aa(this.ctx);(0<this.borderThickness&&this.borderColor||this.backgroundColor)&& this.ctx.roundRect(0,s,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);this.ctx.fillStyle=this.fontColor;for(s=0;s<this._wrappedText.lines.length;s++)z=this._wrappedText.lines[s],"right"===this.horizontalAlign?w=(this.width-(this.leftPadding+this.rightPadding))/2-z.width/2+this.leftPadding:"left"===this.horizontalAlign?w=this.leftPadding:"center"===this.horizontalAlign&&(w=(this.width-(this.leftPadding+this.rightPadding))/2-z.width/2+this.leftPadding), this.ctx.fillText(z.text,w,y),y+=z.height;this.ctx.font=x;q&&this.ctx.restore()}};ja.prototype.setText=function(q){this.text=q;this._isDirty=!0;this._wrappedText=null};ja.prototype.measureText=function(){this._lineHeight=Sa(this.fontFamily,this.fontSize,this.fontWeight);if(null===this.maxWidth)throw"Please set maxWidth and height for TextBlock";this._wrapText(this.ctx);this._isDirty=!1;return{width:this.width,height:this.height}};ja.prototype._getLineWithWidth=function(q,x,s){q=String(q);if(!q)return{text:"", width:0};var w=s=0,y=q.length-1,z=Infinity;for(this.ctx.font=this._getFontString();w<=y;){var z=Math.floor((w+y)/2),F=q.substr(0,z+1);s=this.ctx.measureText(F).width;if(s<x)w=z+1;else if(s>x)y=z-1;else break}s>x&&1<F.length&&(F=F.substr(0,F.length-1),s=this.ctx.measureText(F).width);x=!0;if(F.length===q.length||" "===q[F.length])x=!1;x&&(q=F.split(" "),1<q.length&&q.pop(),F=q.join(" "),s=this.ctx.measureText(F).width);return{text:F,width:s}};ja.prototype._wrapText=function(){var q=new String(Da(String(this.text))), x=[],s=this.ctx.font,w=0,y=0;this.ctx.font=this._getFontString();if(0===this.frontSize)y=w=0;else for(;0<q.length;){var z=this.maxHeight-(this.topPadding+this.bottomPadding),F=this._getLineWithWidth(q,this.maxWidth-(this.leftPadding+this.rightPadding),!1);F.height=this._lineHeight;x.push(F);var R=y,y=Math.max(y,F.width),w=w+F.height,q=Da(q.slice(F.text.length,q.length));z&&w>z&&(F=x.pop(),w-=F.height,y=R)}this._wrappedText={lines:x,width:y,height:w};this.width=y+(this.leftPadding+this.rightPadding); this.height=w+(this.topPadding+this.bottomPadding);this.ctx.font=s};ja.prototype._getFontString=function(){var q;q=""+(this.fontStyle?this.fontStyle+" ":"");q+=this.fontWeight?this.fontWeight+" ":"";q+=this.fontSize?this.fontSize+"px ":"";var v=this.fontFamily?this.fontFamily+"":"";!x&&v&&(v=v.split(",")[0],"'"!==v[0]&&'"'!==v[0]&&(v="'"+v+"'"));return q+=v};ka(Pa,T);ka(Ga,T);Ga.prototype.render=function(){if(this.text){var q=this.dockInsidePlotArea?this.chart.plotArea:this.chart,x=q.layoutManager.getFreeSpace(), s=x.x1,y=x.y1,z=0,F=0,P=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,R,B;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=x.width-4-P*("center"===this.horizontalAlign?2:1)),F=0.5*x.height-this.margin-2,z=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=x.height-4),F=0.5*x.width-this.margin-2):"center"===this.horizontalAlign&&(null=== this.maxWidth&&(this.maxWidth=x.width-4),F=0.5*x.height-4));var O;w(this.padding)||"number"!==typeof this.padding?w(this.padding)||"object"!==typeof this.padding||(O=this.padding.top?this.padding.top:this.padding.bottom?this.padding.bottom:0,O+=this.padding.bottom?this.padding.bottom:this.padding.top?this.padding.top:0,O*=1.25):O=2.5*this.padding;this.wrap||(F=Math.min(F,Math.max(1.5*this.fontSize,this.fontSize+O)));F=new ja(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"});O=F.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(y=x.y1+2,B="top"):"bottom"===this.verticalAlign&& (y=x.y2-2-O.height,B="bottom"),"left"===this.horizontalAlign?s=x.x1+2:"center"===this.horizontalAlign?s=x.x1+x.width/2-O.width/2:"right"===this.horizontalAlign&&(s=x.x2-2-O.width-P),R=this.horizontalAlign,this.width=O.width,this.height=O.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?(s=x.x1+2,y=x.y2-2-(this.maxWidth/2-O.width/2),z=-90,B="left",this.width=O.height,this.height=O.width):"right"===this.horizontalAlign?(s=x.x2-2,y=x.y1+2+(this.maxWidth/2-O.width/2),z=90,B="right", this.width=O.height,this.height=O.width):"center"===this.horizontalAlign&&(y=q.y1+(q.height/2-O.height/2),s=q.x1+(q.width/2-O.width/2),B="center",this.width=O.width,this.height=O.height),R="center");F.x=s;F.y=y;F.angle=z;F.horizontalAlign=R;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:s,y1:y,x2:s+this.width,y2:y+this.height};this.ctx.textBaseline="top"}};ka(La, T);La.prototype.render=Ga.prototype.render;ka(Ha,T);y={addTheme:function(q,x){va[q]=x},addColorSet:function(q,x){xa[q]=x},addCultureInfo:function(q,x){Ia[q]=x},formatNumber:function(q,x,s){s=s||"en";if(Ia[s])return X(q,x||"#,##0.##",new Ha(s));throw"Unknown Culture Name";},formatDate:function(q,x,s){s=s||"en";if(Ia[s])return ya(q,x||"DD MMM YYYY",new Ha(s));throw"Unknown Culture Name";}};window.CanvasJS=y;y.Chart=function(){function q(a,f){return a.x-f.x}function v(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<k.length;n++)l[n]=k.charCodeAt(n);f=new Blob([l.buffer],{type:"image/"+f});try{window.navigator.msSaveBlob(f,b),d=!0}catch(h){g.dataset.downloadurl=[c,g.download,g.href].join(":"),g.href=window.URL.createObjectURL(f)}}if(!d)try{event=document.createEvent("MouseEvents"), event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),g.dispatchEvent?g.dispatchEvent(event):g.fireEvent&&g.fireEvent("onclick")}catch(r){f=window.open(),f.document.write("<img src='"+a+"'></img><div>Please right click on the image and save it to your device</div>"),f.document.close()}}}function s(a,f){f=f||{};this.theme=w(f.theme)||w(va[f.theme])?"light1":f.theme;s.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:0<this.container.clientWidth?this.container.clientWidth:this.width,d=this.options.height?this.height:0<this.container.clientHeight?this.container.clientHeight:this.height;this.width=c;this.height=d;this.x1=this.y1=0;this.x2=this.width;this.y2=this.height;this._selectedColorSet="undefined"!==typeof xa[this.colorSet]?xa[this.colorSet]:xa.colorSet1;this._canvasJSContainer=document.createElement("div");this._canvasJSContainer.setAttribute("class","canvasjs-chart-container");this._canvasJSContainer.style.position= "relative";this._canvasJSContainer.style.textAlign="left";this._canvasJSContainer.style.cursor="auto";x||(this._canvasJSContainer.style.height="0px");this.container.appendChild(this._canvasJSContainer);this.canvas=ra(c,d);this._preRenderCanvas=ra(c,d);this.canvas.style.position="absolute";this.canvas.getContext&&(this._canvasJSContainer.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.textBaseline="top",Aa(this.ctx),this._preRenderCtx=this._preRenderCanvas.getContext("2d"), this._preRenderCtx.textBaseline="top",Aa(this._preRenderCtx),x?this.plotArea.ctx=this.ctx:(this.plotArea.canvas=ra(c,d),this.plotArea.canvas.style.position="absolute",this.plotArea.canvas.setAttribute("class","plotAreaCanvas"),this._canvasJSContainer.appendChild(this.plotArea.canvas),this.plotArea.ctx=this.plotArea.canvas.getContext("2d")),this.overlaidCanvas=ra(c,d),this.overlaidCanvas.style.position="absolute",this.overlaidCanvas.getContext&&(this._canvasJSContainer.appendChild(this.overlaidCanvas), this.overlaidCanvasCtx=this.overlaidCanvas.getContext("2d"),this.overlaidCanvasCtx.textBaseline="top",Aa(this.overlaidCanvasCtx)),this._eventManager=new fa(this),this.windowResizeHandler=U(window,"resize",function(){b._updateSize()&&b.render()}),this._toolBar=document.createElement("div"),this._toolBar.setAttribute("class","canvasjs-chart-toolbar"),this._toolBar.style.cssText="position: absolute; right: 1px; top: 1px;",this._canvasJSContainer.appendChild(this._toolBar),this.bounds={x1:0,y1:0,x2:this.width, y2:this.height},U(this.overlaidCanvas,"click",function(a){b._mouseEventHandler(a)}),U(this.overlaidCanvas,"mousemove",function(a){b._mouseEventHandler(a)}),U(this.overlaidCanvas,"mouseup",function(a){b._mouseEventHandler(a)}),U(this.overlaidCanvas,"mousedown",function(a){b._mouseEventHandler(a);ta(b._dropdownMenu)}),U(this.overlaidCanvas,"mouseout",function(a){b._mouseEventHandler(a)}),U(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",function(a){b._touchEventHandler(a)}), U(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",function(a){b._touchEventHandler(a)}),U(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerUp":"touchend",function(a){b._touchEventHandler(a)}),U(this.overlaidCanvas,window.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){b._touchEventHandler(a)}),this.toolTip=new Z(this,this.options.toolTip),this.data=null,this.axisX=[],this.axisX2=[],this.axisY=[],this.axisY2=[],this.sessionVariables= {axisX:[],axisX2:[],axisY:[],axisY2:[]})}else window.console&&window.console.log('CanvasJS Error: Chart Container with id "'+this._containerId+'" was not found')}function y(a,f){for(var b=[],c,d=0;d<a.length;d++)if(0==d)b.push(a[0]);else{var g,k,l;l=d-1;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[k].x-a[l].x?0.01:a[k].x-a[l].x))*(f-1)/2+1;var 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&&0<n||a[l].x<a[g].x&&0>n?{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&&0<n||a[l].x<a[g].x&&0>n?{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=0<k.trimLength?Math.abs(r*k.trimLength/100):Math.abs(r-k.length);n?(b+=r/2,d-=r/2):(f+=r/2,c-=r/2); var r=1===Math.round(k.thickness)%2?0.5:0,p=1===Math.round(l.thickness)%2?0.5:0;a.save();a.globalAlpha=h;a.strokeStyle=l.color||g;a.lineWidth=l.thickness||2;a.setLineDash&&a.setLineDash(F(l.dashType,l.thickness));a.beginPath();n&&0<l.thickness?(a.moveTo(c-k.thickness/2,Math.round((b+d)/2)-p),a.lineTo(f+k.thickness/2,Math.round((b+d)/2)-p)):0<l.thickness&&(a.moveTo(Math.round((f+c)/2)-p,b+k.thickness/2),a.lineTo(Math.round((f+c)/2)-p,d-k.thickness/2));a.stroke();a.strokeStyle=k.color||g;a.lineWidth= k.thickness||2;a.setLineDash&&a.setLineDash(F(k.dashType,k.thickness));a.beginPath();n&&0<k.thickness?(a.moveTo(c-r,b),a.lineTo(c-r,d),a.moveTo(f+r,b),a.lineTo(f+r,d)):0<k.thickness&&(a.moveTo(f,b+r),a.lineTo(c,b+r),a.moveTo(f,d-r),a.lineTo(c,d-r));a.stroke();a.restore()}function J(a,f,b,c,d){if(null===a||"undefined"===typeof a)return"undefined"===typeof b?f:b;a=parseFloat(a.toString())*(0<=a.toString().indexOf("%")?f/100:1);"undefined"!==typeof c&&(a=Math.min(c,a),"undefined"!==typeof d&&(a=Math.max(d, a)));return!isNaN(a)&&a<=f&&0<=a?a:"undefined"===typeof b?f:b}function V(a,f){V.base.constructor.call(this,"Legend","legend",f,null,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.ghostCtx=this.chart._eventManager.ghostCtx;this.items=[];this.optionsName="legend";this.height=this.width=0;this.orientation=null;this.dataSeries=[];this.bounds={x1:null,y1:null,x2:null,y2:null};"undefined"===typeof this.options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.lineHeight= Sa(this.fontFamily,this.fontSize,this.fontWeight);this.horizontalSpacing=this.fontSize}function R(a,f,b,c){R.base.constructor.call(this,"DataSeries","data",f,b,a);this.chart=a;this.canvas=a.canvas;this._ctx=a.canvas.ctx;this.index=b;this.noDataPointsInPlotArea=0;this.id=c;this.chart._eventManager.objectMap[c]={id:c,objectType:"dataSeries",dataSeriesIndex:b};a=f.dataPoints?f.dataPoints.length:0;this.dataPointEOs=[];for(f=0;f<a;f++)this.dataPointEOs[f]={};this.dataPointIds=[];this.plotUnit=[];this.axisY= this.axisX=null;this.optionsName="data";this.isOptionsInArray=!0;null===this.fillOpacity&&(this.type.match(/area/i)?this.fillOpacity=0.7:this.fillOpacity=1);this.axisPlacement=this.getDefaultAxisPlacement();"undefined"===typeof this.options.indexLabelFontSize&&(this.indexLabelFontSize=this.chart.getAutoFontSize(this.indexLabelFontSize))}function B(a,f,b,c,d,g){B.base.constructor.call(this,"Axis",f,b,c,a);this.chart=a;this.canvas=a.canvas;this.ctx=a.ctx;this.intervalStartPosition=this.maxHeight=this.maxWidth= 0;this.labels=[];this.dataSeries=[];this._stripLineLabels=this._ticks=this._labels=null;this.dataInfo={min:Infinity,max:-Infinity,viewPortMin:Infinity,viewPortMax:-Infinity,minDiff:Infinity};this.isOptionsInArray=!0;"axisX"===d?("left"===g||"bottom"===g?(this.optionsName="axisX",w(this.chart.sessionVariables.axisX[c])&&(this.chart.sessionVariables.axisX[c]={}),this.sessionVariables=this.chart.sessionVariables.axisX[c]):(this.optionsName="axisX2",w(this.chart.sessionVariables.axisX2[c])&&(this.chart.sessionVariables.axisX2[c]= {}),this.sessionVariables=this.chart.sessionVariables.axisX2[c]),this.options.interval||(this.intervalType=null)):"left"===g||"top"===g?(this.optionsName="axisY",w(this.chart.sessionVariables.axisY[c])&&(this.chart.sessionVariables.axisY[c]={}),this.sessionVariables=this.chart.sessionVariables.axisY[c]):(this.optionsName="axisY2",w(this.chart.sessionVariables.axisY2[c])&&(this.chart.sessionVariables.axisY2[c]={}),this.sessionVariables=this.chart.sessionVariables.axisY2[c]);"undefined"===typeof this.options.titleFontSize&& (this.titleFontSize=this.chart.getAutoFontSize(this.titleFontSize));"undefined"===typeof this.options.labelFontSize&&(this.labelFontSize=this.chart.getAutoFontSize(this.labelFontSize));this.type=d;"axisX"!==d||b&&"undefined"!==typeof b.gridThickness||(this.gridThickness=0);this._position=g;this.lineCoordinates={x1:null,y1:null,x2:null,y2:null,width:null};this.labelAngle=(this.labelAngle%360+360)%360;90<this.labelAngle&&270>this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&& (this.labelAngle-=360);this.options.scaleBreaks&&(this.scaleBreaks=new O(this.chart,this.options.scaleBreaks,++this.chart._eventManager.lastObjectId,this));this.stripLines=[];if(this.options.stripLines&&0<this.options.stripLines.length)for(a=0;a<this.options.stripLines.length;a++)this.stripLines.push(new ba(this.chart,this.options.stripLines[a],a,++this.chart._eventManager.lastObjectId,this));this.options.crosshair&&(this.crosshair=new ga(this.chart,this.options.crosshair,this));this._titleTextBlock= null;this.hasOptionChanged("viewportMinimum")&&null===this.viewportMinimum&&(this.options.viewportMinimum=void 0,this.sessionVariables.viewportMinimum=null);this.hasOptionChanged("viewportMinimum")||isNaN(this.sessionVariables.newViewportMinimum)||null===this.sessionVariables.newViewportMinimum?this.sessionVariables.newViewportMinimum=null:this.viewportMinimum=this.sessionVariables.newViewportMinimum;this.hasOptionChanged("viewportMaximum")&&null===this.viewportMaximum&&(this.options.viewportMaximum= void 0,this.sessionVariables.viewportMaximum=null);this.hasOptionChanged("viewportMaximum")||isNaN(this.sessionVariables.newViewportMaximum)||null===this.sessionVariables.newViewportMaximum?this.sessionVariables.newViewportMaximum=null:this.viewportMaximum=this.sessionVariables.newViewportMaximum;null!==this.minimum&&null!==this.viewportMinimum&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));null!==this.maximum&&null!==this.viewportMaximum&&(this.viewportMaximum=Math.min(this.viewportMaximum, this.maximum));this.trackChanges("viewportMinimum");this.trackChanges("viewportMaximum")}function O(a,f,b,c){O.base.constructor.call(this,"ScaleBreaks","scaleBreaks",f,null,c);this.id=b;this.chart=a;this.ctx=this.chart.ctx;this.axis=c;this.optionsName="scaleBreaks";this.isOptionsInArray=!1;this._appliedBreaks=[];this.customBreaks=[];this.autoBreaks=[];"string"===typeof this.spacing?(this.spacing=parseFloat(this.spacing),this.spacing=isNaN(this.spacing)?8:(10<this.spacing?10:this.spacing)+"%"):"number"!== typeof this.spacing&&(this.spacing=8);this.autoCalculate&&(this.maxNumberOfAutoBreaks=Math.min(this.maxNumberOfAutoBreaks,5));if(this.options.customBreaks&&0<this.options.customBreaks.length){for(a=0;a<this.options.customBreaks.length;a++)this.customBreaks.push(new da(this.chart,"customBreaks",this.options.customBreaks[a],a,++this.chart._eventManager.lastObjectId,this)),"number"===typeof this.customBreaks[a].startValue&&("number"===typeof this.customBreaks[a].endValue&&this.customBreaks[a].endValue!== this.customBreaks[a].startValue)&&this._appliedBreaks.push(this.customBreaks[a]);this._appliedBreaks.sort(function(a,c){return a.startValue-c.startValue});for(a=0;a<this._appliedBreaks.length-1;a++)this._appliedBreaks[a].endValue>=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 da(a,f,b,c,d,g){da.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=w(b.fillOpacity)?g.fillOpacity:this.fillOpacity;this.lineThickness=w(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;!w(this.startValue)&&this.startValue.getTime&&(this.startValue=this.startValue.getTime());!w(this.endValue)&&this.endValue.getTime&&(this.endValue=this.endValue.getTime());"number"===typeof this.startValue&&("number"===typeof this.endValue&&this.endValue<this.startValue)&&(a=this.startValue,this.startValue=this.endValue,this.endValue=a);this.spacing="undefined"===typeof b.spacing?g.spacing:b.spacing;"string"===typeof this.options.spacing?(this.spacing=parseFloat(this.spacing),this.spacing= isNaN(this.spacing)?0:(10<this.spacing?10:this.spacing)+"%"):"number"!==typeof this.options.spacing&&(this.spacing=g.spacing);this.size=g.parent.logarithmic?1:0}function ba(a,f,b,c,d){ba.base.constructor.call(this,"StripLine","stripLines",f,b,d);this.id=c;this.chart=a;this.ctx=this.chart.ctx;this.label=this.label;this.axis=d;this.optionsName="stripLines";this.isOptionsInArray=!0;this._thicknessType="pixel";null!==this.startValue&&null!==this.endValue&&(this.value=d.logarithmic?Math.sqrt((this.startValue.getTime? this.startValue.getTime():this.startValue)*(this.endValue.getTime?this.endValue.getTime():this.endValue)):((this.startValue.getTime?this.startValue.getTime():this.startValue)+(this.endValue.getTime?this.endValue.getTime():this.endValue))/2,this._thicknessType=null)}function ga(a,f,b){ga.base.constructor.call(this,"Crosshair","crosshair",f,null,b);this.chart=a;this.ctx=this.chart.ctx;this.axis=b;this.optionsName="crosshair";this._thicknessType="pixel"}function Z(a,f){Z.base.constructor.call(this,"ToolTip", "toolTip",f,null,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.currentDataPointIndex=this.currentSeriesIndex=-1;this._timerId=0;this._prevY=this._prevX=NaN;this.containerTransitionDuration=0.1;this.mozContainerTransition=this.getContainerTransition(this.containerTransitionDuration);this.optionsName="toolTip";this._initialize()}function fa(a){this.chart=a;this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=[];this.previousDataPointEventObject=null;this.ghostCanvas= ra(this.chart.width,this.chart.height);this.ghostCtx=this.ghostCanvas.getContext("2d");this.mouseoveredObjectMaps=[]}function oa(a){this.chart=a;this.ctx=this.chart.plotArea.ctx;this.animations=[];this.animationRequestId=null}ka(s,T);s.prototype.destroy=function(){var a=window,f=this.windowResizeHandler;a.removeEventListener?a.removeEventListener("resize",f):a.detachEvent&&a.detachEvent("onresize",f)};s.prototype._updateOptions=function(){var a=this;this.updateOption("width");this.updateOption("height"); this.updateOption("dataPointWidth");this.updateOption("dataPointMinWidth");this.updateOption("dataPointMaxWidth");this.updateOption("interactivityEnabled");this.updateOption("theme");this.updateOption("colorSet")&&(this._selectedColorSet="undefined"!==typeof xa[this.colorSet]?xa[this.colorSet]:xa.colorSet1);this.updateOption("backgroundColor");this.backgroundColor||(this.backgroundColor="rgba(0,0,0,0)");this.updateOption("culture");this._cultureInfo=new Ha(this.options.culture);this.updateOption("animationEnabled"); this.animationEnabled=this.animationEnabled&&x;this.updateOption("animationDuration");this.updateOption("rangeChanging");this.updateOption("rangeChanged");this.updateOption("exportEnabled");this.updateOption("exportFileName");this.updateOption("zoomType");this.options.zoomEnabled?(this._zoomButton||(ta(this._zoomButton=document.createElement("button")),sa(this,this._zoomButton,"pan"),this._toolBar.appendChild(this._zoomButton),this._zoomButton.style.borderRight=this.toolbar.borderThickness+"px solid "+ this.toolbar.borderColor,U(this._zoomButton,"click",function(){a.zoomEnabled?(a.zoomEnabled=!1,a.panEnabled=!0,sa(a,a._zoomButton,"zoom")):(a.zoomEnabled=!0,a.panEnabled=!1,sa(a,a._zoomButton,"pan"));a.render()}),U(this._zoomButton,"mouseover",function(){ma(a,a._zoomButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.fontColorOnHover,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&ma(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(100%)", filter:"invert(100%)"})}),U(this._zoomButton,"mouseout",function(){ma(a,a._zoomButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&ma(a,a._zoomButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})})),this._resetButton||(ta(this._resetButton=document.createElement("button")),sa(this,this._resetButton,"reset"),this._resetButton.style.borderRight=(this.exportEnabled?this.toolbar.borderThickness: 0)+"px solid "+this.toolbar.borderColor,this._toolBar.appendChild(this._resetButton),U(this._resetButton,"click",function(){a.toolTip.hide();a.zoomEnabled||a.panEnabled?(a.zoomEnabled=!0,a.panEnabled=!1,sa(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<a.sessionVariables.axisX.length;c++)a.sessionVariables.axisX[c].newViewportMinimum=null,a.sessionVariables.axisX[c].newViewportMaximum= null;if(a.sessionVariables.axisX2)for(c=0;c<a.sessionVariables.axisX2.length;c++)a.sessionVariables.axisX2[c].newViewportMinimum=null,a.sessionVariables.axisX2[c].newViewportMaximum=null;if(a.sessionVariables.axisY)for(c=0;c<a.sessionVariables.axisY.length;c++)a.sessionVariables.axisY[c].newViewportMinimum=null,a.sessionVariables.axisY[c].newViewportMaximum=null;if(a.sessionVariables.axisY2)for(c=0;c<a.sessionVariables.axisY2.length;c++)a.sessionVariables.axisY2[c].newViewportMinimum=null,a.sessionVariables.axisY2[c].newViewportMaximum= null;a.resetOverlayedCanvas();ta(a._zoomButton,a._resetButton);a._dispatchRangeEvent("rangeChanging","reset");a.render();a._dispatchRangeEvent("rangeChanged","reset")}),U(this._resetButton,"mouseover",function(){ma(a,a._resetButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.hoverFfontColorOnHoverontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&ma(a,a._resetButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"})}), U(this._resetButton,"mouseout",function(){ma(a,a._resetButton,{backgroundColor:a.toolbar.backgroundColor,color:a.toolbar.fontColor,transition:"0.4s",WebkitTransition:"0.4s"});0>=navigator.userAgent.search("MSIE")&&ma(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):ta(this._menuButton):this.exportEnabled&&x&&(this._menuButton=document.createElement("button"),sa(this,this._menuButton,"menu"),this._toolBar.appendChild(this._menuButton),U(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),U(this._menuButton,"mouseover",function(){ma(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColorOnHover,color:a.toolbar.fontColorOnHover});0>=navigator.userAgent.search("MSIE")&&ma(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(100%)",filter:"invert(100%)"})},!0),U(this._menuButton,"mouseout",function(){ma(a,a._menuButton,{backgroundColor:a.toolbar.backgroundColor, color:a.toolbar.fontColor});0>=navigator.userAgent.search("MSIE")&&ma(a,a._menuButton.childNodes[0],{WebkitFilter:"invert(0%)",filter:"invert(0%)"})},!0));if(!this._dropdownMenu&&this.exportEnabled&&x){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);U(this._dropdownMenu,"blur",function(){ta(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);U(f,"mouseover",function(){this.style.backgroundColor= a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);U(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);U(f,"click",function(){a.print();ta(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); U(f,"mouseover",function(){this.style.backgroundColor=a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);U(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);U(f,"click",function(){v(a.canvas,"jpeg",a.exportFileName);ta(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);U(f,"mouseover",function(){this.style.backgroundColor=a.toolbar.backgroundColorOnHover;this.style.color=a.toolbar.fontColorOnHover},!0);U(f,"mouseout",function(){this.style.backgroundColor=a.toolbar.backgroundColor;this.style.color=a.toolbar.fontColor},!0);U(f,"click",function(){v(a.canvas,"png",a.exportFileName);ta(a._dropdownMenu)},!0)}"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?sa(a,a._zoomButton, "zoom"):sa(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&sa(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)};s.prototype._updateSize=function(){var a=0,f=0;this.options.width?a=this.width:this.width=a=0<this.container.clientWidth?this.container.clientWidth:this.width; this.options.height?f=this.height:this.height=f=0<this.container.clientHeight?this.container.clientHeight:this.height;return this.canvas.width!==a*aa||this.canvas.height!==f*aa?(Fa(this.canvas,a,f),Fa(this._preRenderCanvas,a,f),Fa(this.overlaidCanvas,a,f),Fa(this._eventManager.ghostCanvas,a,f),this.bounds={x1:0,y1:0,x2:this.width,y2:this.height},!0):!1};s.prototype._initialize=function(){this.toolbar=new Pa(this,this.options.toolbar);this._animator?this._animator.cancelAllAnimations():this._animator= new oa(this);this.removeAllEventListeners();this.disableToolTip=!1;this._axes=[];this.funnelPyramidClickHandler=this.pieDoughnutClickHandler=null;this.animationRequestId&&this.cancelRequestAnimFrame.call(window,this.animationRequestId);this._updateOptions();this.animatedRender=x&&this.animationEnabled&&0===this.renderCount;this._updateSize();this.clearCanvas();this.ctx.beginPath();this.axisX=[];this.axisX2=[];this.axisY=[];this.axisY2=[];this._indexLabels=[];this._dataInRenderedOrder=[];this._events= [];this._eventManager&&this._eventManager.reset();this.plotInfo={axisPlacement:null,axisXValueType:null,plotTypes:[]};this.layoutManager=new Ba(0,0,this.width,this.height,2);this.plotArea.layoutManager&&this.plotArea.layoutManager.reset();this.data=[];var a=0,f=null;if(this.options.data){for(var b=0;b<this.options.data.length;b++)if(a++,!this.options.data[b].type||0<=s._supportedChartTypes.indexOf(this.options.data[b].type)){var c=new R(this,this.options.data[b],a-1,++this._eventManager.lastObjectId); "error"===c.type&&(c.linkedDataSeriesIndex=w(this.options.data[b].linkedDataSeriesIndex)?b-1:this.options.data[b].linkedDataSeriesIndex,0>c.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?1<this.options.data.length?(c._colorSet=[this._selectedColorSet[c.index%this._selectedColorSet.length]], c.color=this._selectedColorSet[c.index%this._selectedColorSet.length]):c._colorSet="line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"candlestick"===c.type||"ohlc"===c.type||"waterfall"===c.type||"boxAndWhisker"===c.type?[this._selectedColorSet[0]]:this._selectedColorSet:c._colorSet=[c.color];null===c.markerSize&&(("line"===c.type|| "stepLine"===c.type||"spline"===c.type||0<=c.type.toLowerCase().indexOf("area"))&&c.dataPoints&&c.dataPoints.length<this.width/16||"scatter"===c.type)&&(c.markerSize=8);"bubble"!==c.type&&"scatter"!==c.type||!c.dataPoints||(c.dataPoints.some?c.dataPoints.some(function(a){return a.x})&&c.dataPoints.sort(q):c.dataPoints.sort(q));this.data.push(c);var d=c.axisPlacement,f=f||d,g;"normal"===d?"xySwapped"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with bar chart':"none"===this.plotInfo.axisPlacement? g='You cannot combine "'+c.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="normal"):"xySwapped"===d?"normal"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with line, area, column or pie chart':"none"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="xySwapped"):"none"===d?"normal"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+ '" with line, area, column or bar chart':"xySwapped"===this.plotInfo.axisPlacement?g='You cannot combine "'+c.type+'" with bar chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="none"):null===d&&"none"===this.plotInfo.axisPlacement&&(g='You cannot combine "'+c.type+'" with pie chart');if(g&&window.console){window.console.log(g);return}}for(b=0;b<this.data.length;b++){if("none"==f&&"error"===this.data[b].type&&window.console){window.console.log('You cannot combine "'+c.type+'" with error chart'); return}"error"===this.data[b].type&&(this.data[b].axisPlacement=this.plotInfo.axisPlacement=f||"normal",this.data[b]._linkedSeries=null===this.data[b].linkedDataSeriesIndex?null:this.data[this.data[b].linkedDataSeriesIndex])}}var k=this;this.addEventListener("dataAnimationIterationEnd",function(){na.fSWm&&na.fSWm(k);0!==k.axisX.length&&na.fBWm&&na.fBWm(k)});Wa(this);this._objectsInitialized=!0};s._supportedChartTypes=Ea("line stepLine spline column area stepArea splineArea bar bubble scatter stackedColumn stackedColumn100 stackedBar stackedBar100 stackedArea stackedArea100 candlestick ohlc boxAndWhisker rangeColumn error rangeBar rangeArea rangeSplineArea pie doughnut funnel pyramid waterfall".split(" ")); s.prototype.render=function(a){a&&(this.options=a);this._initialize();$a(this);Wa(this);var f=[];for(a=0;a<this.data.length;a++)if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement){if(!this.data[a].axisYType||"primary"===this.data[a].axisYType)if(this.options.axisY&&0<this.options.axisY.length){if(!this.axisY.length)for(var b=0;b<this.options.axisY.length;b++)"normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY[b]=new B(this,"axisY",this.options.axisY[b], b,"axisY","left")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY[b]=new B(this,"axisY",this.options.axisY[b],b,"axisY","bottom"));this.data[a].axisY=this.axisY[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY.length?this.data[a].axisYIndex:0];this.axisY[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY.length?this.data[a].axisYIndex:0].dataSeries.push(this.data[a])}else this.axisY.length||("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY[0]= new B(this,"axisY",this.options.axisY,0,"axisY","left")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY[0]=new B(this,"axisY",this.options.axisY,0,"axisY","bottom"))),this.data[a].axisY=this.axisY[0],this.axisY[0].dataSeries.push(this.data[a]);if("secondary"===this.data[a].axisYType)if(this.options.axisY2&&0<this.options.axisY2.length){if(!this.axisY2.length)for(b=0;b<this.options.axisY2.length;b++)"normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisY2[b]=new B(this, "axisY2",this.options.axisY2[b],b,"axisY","right")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY2[b]=new B(this,"axisY2",this.options.axisY2[b],b,"axisY","top"));this.data[a].axisY=this.axisY2[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY2.length?this.data[a].axisYIndex:0];this.axisY2[0<=this.data[a].axisYIndex&&this.data[a].axisYIndex<this.axisY2.length?this.data[a].axisYIndex:0].dataSeries.push(this.data[a])}else this.axisY2.length||("normal"===this.plotInfo.axisPlacement? this._axes.push(this.axisY2[0]=new B(this,"axisY2",this.options.axisY2,0,"axisY","right")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisY2[0]=new B(this,"axisY2",this.options.axisY2,0,"axisY","top"))),this.data[a].axisY=this.axisY2[0],this.axisY2[0].dataSeries.push(this.data[a]);if(!this.data[a].axisXType||"primary"===this.data[a].axisXType)if(this.options.axisX&&0<this.options.axisX.length){if(!this.axisX.length)for(b=0;b<this.options.axisX.length;b++)"normal"===this.plotInfo.axisPlacement? this._axes.push(this.axisX[b]=new B(this,"axisX",this.options.axisX[b],b,"axisX","bottom")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX[b]=new B(this,"axisX",this.options.axisX[b],b,"axisX","left"));this.data[a].axisX=this.axisX[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX.length?this.data[a].axisXIndex:0];this.axisX[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX.length?this.data[a].axisXIndex:0].dataSeries.push(this.data[a])}else this.axisX.length|| ("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX[0]=new B(this,"axisX",this.options.axisX,0,"axisX","bottom")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX[0]=new B(this,"axisX",this.options.axisX,0,"axisX","left"))),this.data[a].axisX=this.axisX[0],this.axisX[0].dataSeries.push(this.data[a]);if("secondary"===this.data[a].axisXType)if(this.options.axisX2&&0<this.options.axisX2.length){if(!this.axisX2.length)for(b=0;b<this.options.axisX2.length;b++)"normal"=== this.plotInfo.axisPlacement?this._axes.push(this.axisX2[b]=new B(this,"axisX2",this.options.axisX2[b],b,"axisX","top")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX2[b]=new B(this,"axisX2",this.options.axisX2[b],b,"axisX","right"));this.data[a].axisX=this.axisX2[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX2.length?this.data[a].axisXIndex:0];this.axisX2[0<=this.data[a].axisXIndex&&this.data[a].axisXIndex<this.axisX2.length?this.data[a].axisXIndex:0].dataSeries.push(this.data[a])}else this.axisX2.length|| ("normal"===this.plotInfo.axisPlacement?this._axes.push(this.axisX2[0]=new B(this,"axisX2",this.options.axisX2,0,"axisX","top")):"xySwapped"===this.plotInfo.axisPlacement&&this._axes.push(this.axisX2[0]=new B(this,"axisX2",this.options.axisX2,0,"axisX","right"))),this.data[a].axisX=this.axisX2[0],this.axisX2[0].dataSeries.push(this.data[a])}if(this.axisY){for(b=1;b<this.axisY.length;b++)"undefined"===typeof this.axisY[b].options.gridThickness&&(this.axisY[b].gridThickness=0);for(b=0;b<this.axisY.length- 1;b++)"undefined"===typeof this.axisY[b].options.margin&&(this.axisY[b].margin=10)}if(this.axisY2){for(b=1;b<this.axisY2.length;b++)"undefined"===typeof this.axisY2[b].options.gridThickness&&(this.axisY2[b].gridThickness=0);for(b=0;b<this.axisY2.length-1;b++)"undefined"===typeof this.axisY2[b].options.margin&&(this.axisY2[b].margin=10)}this.axisY&&0<this.axisY.length&&(this.axisY2&&0<this.axisY2.length)&&(0<this.axisY[0].gridThickness&&"undefined"===typeof this.axisY2[0].options.gridThickness?this.axisY2[0].gridThickness= 0:0<this.axisY2[0].gridThickness&&"undefined"===typeof this.axisY[0].options.gridThickness&&(this.axisY[0].gridThickness=0));if(this.axisX)for(b=0;b<this.axisX.length;b++)"undefined"===typeof this.axisX[b].options.gridThickness&&(this.axisX[b].gridThickness=0);if(this.axisX2)for(b=0;b<this.axisX2.length;b++)"undefined"===typeof this.axisX2[b].options.gridThickness&&(this.axisX2[b].gridThickness=0);this.axisX&&0<this.axisX.length&&(this.axisX2&&0<this.axisX2.length)&&(0<this.axisX[0].gridThickness&& "undefined"===typeof this.axisX2[0].options.gridThickness?this.axisX2[0].gridThickness=0:0<this.axisX2[0].gridThickness&&"undefined"===typeof this.axisX[0].options.gridThickness&&(this.axisX[0].gridThickness=0));b=!1;if(0<this._axes.length&&(this.zoomEnabled||this.panEnabled))for(a=0;a<this._axes.length;a++)if(null!==this._axes[a].viewportMinimum||null!==this._axes[a].viewportMaximum){b=!0;break}b?(Ka(this._zoomButton,this._resetButton),this._toolBar.style.border=this.toolbar.borderThickness+"px solid "+ this.toolbar.borderColor,this._zoomButton.style.borderRight=this.toolbar.borderThickness+"px solid "+this.toolbar.borderColor,this._resetButton.style.borderRight=(this.exportEnabled?this.toolbar.borderThickness:0)+"px solid "+this.toolbar.borderColor):(ta(this._zoomButton,this._resetButton),this._toolBar.style.border=this.toolbar.borderThickness+"px solid transparent",this.options.zoomEnabled&&(this.zoomEnabled=!0,this.panEnabled=!1));this._processData();this.options.title&&(this.title=new Ga(this, this.options.title),this.title.dockInsidePlotArea?f.push(this.title):this.title.render());if(this.options.subtitles)for(this.subtitles=[],a=0;a<this.options.subtitles.length;a++)b=new La(this,this.options.subtitles[a],a),this.subtitles.push(b),b.dockInsidePlotArea?f.push(b):b.render();this.legend=new V(this,this.options.legend);for(a=0;a<this.data.length;a++)(this.data[a].showInLegend||"pie"===this.data[a].type||"doughnut"===this.data[a].type||"funnel"===this.data[a].type||"pyramid"===this.data[a].type)&& this.legend.dataSeries.push(this.data[a]);this.legend.dockInsidePlotArea?f.push(this.legend):this.legend.render();for(a=0;a<this._axes.length;a++)if(this._axes[a].scaleBreaks&&this._axes[a].scaleBreaks._appliedBreaks.length){x?(this._breaksCanvas=ra(this.width,this.height,!0),this._breaksCanvasCtx=this._breaksCanvas.getContext("2d")):(this._breaksCanvas=this.canvas,this._breaksCanvasCtx=this.ctx);break}this._preRenderCanvas=ra(this.width,this.height);this._preRenderCtx=this._preRenderCanvas.getContext("2d"); if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)B.setLayoutAndRender(this.axisX,this.axisX2,this.axisY,this.axisY2,this.plotInfo.axisPlacement,this.layoutManager.getFreeSpace());else if("none"===this.plotInfo.axisPlacement)this.preparePlotArea();else return;for(a=0;a<f.length;a++)f[a].render();var c=[];if(this.animatedRender){var d=ra(this.width,this.height);d.getContext("2d").drawImage(this.canvas,0,0,this.width,this.height)}var f=this.ctx.miterLimit,g;this.ctx.miterLimit= 3;x&&this._breaksCanvas&&(this._preRenderCtx.drawImage(this.canvas,0,0,this.width,this.height),this._preRenderCtx.drawImage(this._breaksCanvas,0,0,this.width,this.height),this._breaksCanvasCtx.globalCompositeOperation="source-atop",this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),this._preRenderCtx.clearRect(0,0,this.width,this.height));for(a=0;a<this.plotInfo.plotTypes.length;a++)for(var k=this.plotInfo.plotTypes[a],l=0;l<k.plotUnits.length;l++){var n=k.plotUnits[l], h=null;n.targetCanvas=null;this.animatedRender&&(n.targetCanvas=ra(this.width,this.height),n.targetCanvasCtx=n.targetCanvas.getContext("2d"),g=n.targetCanvasCtx.miterLimit,n.targetCanvasCtx.miterLimit=3);"line"===n.type?h=this.renderLine(n):"stepLine"===n.type?h=this.renderStepLine(n):"spline"===n.type?h=this.renderSpline(n):"column"===n.type?h=this.renderColumn(n):"bar"===n.type?h=this.renderBar(n):"area"===n.type?h=this.renderArea(n):"stepArea"===n.type?h=this.renderStepArea(n):"splineArea"===n.type? h=this.renderSplineArea(n):"stackedColumn"===n.type?h=this.renderStackedColumn(n):"stackedColumn100"===n.type?h=this.renderStackedColumn100(n):"stackedBar"===n.type?h=this.renderStackedBar(n):"stackedBar100"===n.type?h=this.renderStackedBar100(n):"stackedArea"===n.type?h=this.renderStackedArea(n):"stackedArea100"===n.type?h=this.renderStackedArea100(n):"bubble"===n.type?h=h=this.renderBubble(n):"scatter"===n.type?h=this.renderScatter(n):"pie"===n.type?this.renderPie(n):"doughnut"===n.type?this.renderPie(n): "funnel"===n.type?h=this.renderFunnel(n):"pyramid"===n.type?h=this.renderFunnel(n):"candlestick"===n.type?h=this.renderCandlestick(n):"ohlc"===n.type?h=this.renderCandlestick(n):"rangeColumn"===n.type?h=this.renderRangeColumn(n):"error"===n.type?h=this.renderError(n):"rangeBar"===n.type?h=this.renderRangeBar(n):"rangeArea"===n.type?h=this.renderRangeArea(n):"rangeSplineArea"===n.type?h=this.renderRangeSplineArea(n):"waterfall"===n.type?h=this.renderWaterfall(n):"boxAndWhisker"===n.type&&(h=this.renderBoxAndWhisker(n)); for(b=0;b<n.dataSeriesIndexes.length;b++)this._dataInRenderedOrder.push(this.data[n.dataSeriesIndexes[b]]);this.animatedRender&&(n.targetCanvasCtx.miterLimit=g,h&&c.push(h))}this.ctx.miterLimit=f;this.animatedRender&&this._breaksCanvasCtx&&c.push({source:this._breaksCanvasCtx,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0,startTimePercent:0.7});this.animatedRender&&0<this._indexLabels.length&&(g=ra(this.width,this.height).getContext("2d"), c.push(this.renderIndexLabels(g)));var r=this;if(0<c.length)r.disableToolTip=!0,r._animator.animate(200,r.animationDuration,function(a){r.ctx.clearRect(0,0,r.width,r.height);r.ctx.drawImage(d,0,0,Math.floor(r.width*aa),Math.floor(r.height*aa),0,0,r.width,r.height);for(var b=0;b<c.length;b++)h=c[b],1>a&&"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;a<r.plotInfo.plotTypes.length;a++)for(var b=r.plotInfo.plotTypes[a],e=0;e<b.plotUnits.length;e++)b.plotUnits[e].targetCanvas=null;d=null;r.disableToolTip=!1});else{if(r._breaksCanvas)if(x)r.plotArea.ctx.drawImage(r._breaksCanvas,0,0,this.width,this.height);else for(b=0;b<r._axes.length;b++)r._axes[b].createMask();0<r._indexLabels.length&&r.renderIndexLabels();r.dispatchEvent("dataAnimationIterationEnd",{chart:r})}this.attachPlotAreaEventHandlers(); this.zoomEnabled||(this.panEnabled||!this._zoomButton||"none"===this._zoomButton.style.display)||ta(this._zoomButton,this._resetButton);this.toolTip._updateToolTip();this.renderCount++;this._breaksCanvas&&(delete this._breaksCanvas,delete this._breaksCanvasCtx);for(b=0;b<this._axes.length;b++)this._axes[b].maskCanvas&&(delete this._axes[b].maskCanvas,delete this._axes[b].maskCtx)};s.prototype.attachPlotAreaEventHandlers=function(){this.attachEvent({context:this,chart:this,mousedown:this._plotAreaMouseDown, mouseup:this._plotAreaMouseUp,mousemove:this._plotAreaMouseMove,cursor:this.panEnabled?"move":"default",capture:!0,bounds:this.plotArea})};s.prototype.categoriseDataSeries=function(){for(var a="",f=0;f<this.data.length;f++)if(a=this.data[f],a.dataPoints&&(0!==a.dataPoints.length&&a.visible)&&0<=s._supportedChartTypes.indexOf(a.type)){for(var b=null,c=!1,d=null,g=!1,k=0;k<this.plotInfo.plotTypes.length;k++)if(this.plotInfo.plotTypes[k].type===a.type){c=!0;b=this.plotInfo.plotTypes[k];break}c||(b={type:a.type, totalDataSeries:0,plotUnits:[]},this.plotInfo.plotTypes.push(b));for(k=0;k<b.plotUnits.length;k++)if(b.plotUnits[k].axisYType===a.axisYType&&b.plotUnits[k].axisXType===a.axisXType&&b.plotUnits[k].axisYIndex===a.axisYIndex&&b.plotUnits[k].axisXIndex===a.axisXIndex){g=!0;d=b.plotUnits[k];break}g||(d={type:a.type,previousDataSeriesCount:0,index:b.plotUnits.length,plotType:b,axisXType:a.axisXType,axisYType:a.axisYType,axisYIndex:a.axisYIndex,axisXIndex:a.axisXIndex,axisY:"primary"===a.axisYType?this.axisY[0<= a.axisYIndex&&a.axisYIndex<this.axisY.length?a.axisYIndex:0]:this.axisY2[0<=a.axisYIndex&&a.axisYIndex<this.axisY2.length?a.axisYIndex:0],axisX:"primary"===a.axisXType?this.axisX[0<=a.axisXIndex&&a.axisXIndex<this.axisX.length?a.axisXIndex:0]:this.axisX2[0<=a.axisXIndex&&a.axisXIndex<this.axisX2.length?a.axisXIndex:0],dataSeriesIndexes:[],yTotals:[]},b.plotUnits.push(d));b.totalDataSeries++;d.dataSeriesIndexes.push(f);a.plotUnit=d}for(f=0;f<this.plotInfo.plotTypes.length;f++)for(b=this.plotInfo.plotTypes[f], k=a=0;k<b.plotUnits.length;k++)b.plotUnits[k].previousDataSeriesCount=a,a+=b.plotUnits[k].dataSeriesIndexes.length};s.prototype.assignIdToDataPoints=function(){for(var a=0;a<this.data.length;a++){var f=this.data[a];if(f.dataPoints)for(var b=f.dataPoints.length,c=0;c<b;c++)f.dataPointIds[c]=++this._eventManager.lastObjectId}};s.prototype._processData=function(){this.assignIdToDataPoints();this.categoriseDataSeries();for(var a=0;a<this.plotInfo.plotTypes.length;a++)for(var f=this.plotInfo.plotTypes[a], b=0;b<f.plotUnits.length;b++){var c=f.plotUnits[b];"line"===c.type||"stepLine"===c.type||"spline"===c.type||"column"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"bar"===c.type||"bubble"===c.type||"scatter"===c.type?this._processMultiseriesPlotUnit(c):"stackedColumn"===c.type||"stackedBar"===c.type||"stackedArea"===c.type?this._processStackedPlotUnit(c):"stackedColumn100"===c.type||"stackedBar100"===c.type||"stackedArea100"===c.type?this._processStacked100PlotUnit(c):"candlestick"=== c.type||"ohlc"===c.type||"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"error"===c.type||"boxAndWhisker"===c.type?this._processMultiYPlotUnit(c):"waterfall"===c.type&&this._processSpecificPlotUnit(c)}this.calculateAutoBreaks()};s.prototype._processMultiseriesPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var f=a.axisY.dataInfo,b=a.axisX.dataInfo,c,d,g=!1,k=0;k<a.dataSeriesIndexes.length;k++){var l=this.data[a.dataSeriesIndexes[k]], n=0,h=!1,r=!1,p;if("normal"===l.axisPlacement||"xySwapped"===l.axisPlacement)var m=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:a.axisX.logarithmic?0:-Infinity,e=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum? this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(l.dataPoints[n].x&&l.dataPoints[n].x.getTime||"dateTime"===l.xValueType)g=!0;for(n=0;n<l.dataPoints.length;n++){"undefined"===typeof l.dataPoints[n].x&&(l.dataPoints[n].x=n+(a.axisX.logarithmic?1:0));l.dataPoints[n].x.getTime?(g=!0,c=l.dataPoints[n].x.getTime()):c=l.dataPoints[n].x;d=l.dataPoints[n].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);d<f.min&&"number"===typeof d&&(f.min=d); d>f.max&&"number"===typeof d&&(f.max=d);if(0<n){if(a.axisX.logarithmic){var t=c/l.dataPoints[n-1].x;1>t&&(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(c<m&&!h)null!==d&&(p=c);else{if(!h&&(h=!0,0<n)){n-=2;continue}if(c>e&& !r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&p<c&&(b.viewPortMin=p):(d<f.viewPortMin&&"number"===typeof d&&(f.viewPortMin=d),d>f.viewPortMax&&"number"===typeof d&&(f.viewPortMax=d))}}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":"number"}};s.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;r<a.dataSeriesIndexes.length;r++){var p=this.data[a.dataSeriesIndexes[r]],m=0,e=!1,t=!1,wa;if("normal"===p.axisPlacement||"xySwapped"===p.axisPlacement)var C=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:-Infinity, u=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(p.dataPoints[m].x&&p.dataPoints[m].x.getTime||"dateTime"===p.xValueType)g=!0;for(m=0;m<p.dataPoints.length;m++){"undefined"===typeof p.dataPoints[m].x&&(p.dataPoints[m].x=m+(a.axisX.logarithmic?1:0));p.dataPoints[m].x.getTime?(g= !0,c=p.dataPoints[m].x.getTime()):c=p.dataPoints[m].x;d=w(p.dataPoints[m].y)?0:p.dataPoints[m].y;c<b.min&&(b.min=c);c>b.max&&(b.max=c);if(0<m){if(a.axisX.logarithmic){var E=c/p.dataPoints[m-1].x;1>E&&(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?0<d&&(E=d/p.dataPoints[m-1].y,1>E&&(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(c<C&&!e)null!==p.dataPoints[m].y&&(wa=c);else{if(!e&&(e=!0,0<m)){m-=2;continue}if(c>u&&!t)t=!0;else if(c>u&&t)continue;p.dataPoints[m].label&&(a.axisX.labels[c]=p.dataPoints[m].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);null===p.dataPoints[m].y?b.viewPortMin===c&&wa<c&&(b.viewPortMin=wa):(a.yTotals[c]=(a.yTotals[c]?a.yTotals[c]:0)+d,0<=d?k[c]?k[c]+=d:(k[c]=d,n=Math.min(d,n)):l[c]?l[c]+=d:(l[c]=d,h=Math.max(d,h)))}}a.axisY.scaleBreaks&& (a.axisY.scaleBreaks.autoCalculate&&1<=a.axisY.scaleBreaks.maxNumberOfAutoBreaks)&&(f.dataPointYPositiveSums?(f.dataPointYPositiveSums.push.apply(f.dataPointYPositiveSums,k),f.dataPointYNegativeSums.push.apply(f.dataPointYPositiveSums,l)):(f.dataPointYPositiveSums=k,f.dataPointYNegativeSums=l));this.plotInfo.axisXValueType=p.xValueType=g?"dateTime":"number"}for(m in k)k.hasOwnProperty(m)&&!isNaN(m)&&(a=k[m],a<f.min&&(f.min=Math.min(a,n)),a>f.max&&(f.max=a),m<b.viewPortMin||m>b.viewPortMax||(a<f.viewPortMin&& (f.viewPortMin=Math.min(a,n)),a>f.viewPortMax&&(f.viewPortMax=a)));for(m in l)l.hasOwnProperty(m)&&!isNaN(m)&&(a=l[m],a<f.min&&(f.min=a),a>f.max&&(f.max=Math.max(a,h)),m<b.viewPortMin||m>b.viewPortMax||(a<f.viewPortMin&&(f.viewPortMin=a),a>f.viewPortMax&&(f.viewPortMax=Math.max(a,h))))}};s.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;h<a.dataSeriesIndexes.length;h++){var r= this.data[a.dataSeriesIndexes[h]],p=0,m=!1,e=!1,t;if("normal"===r.axisPlacement||"xySwapped"===r.axisPlacement)var wa=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:-Infinity,C=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&& this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(r.dataPoints[p].x&&r.dataPoints[p].x.getTime||"dateTime"===r.xValueType)g=!0;for(p=0;p<r.dataPoints.length;p++){"undefined"===typeof r.dataPoints[p].x&&(r.dataPoints[p].x=p+(a.axisX.logarithmic?1:0));r.dataPoints[p].x.getTime?(g=!0,c=r.dataPoints[p].x.getTime()):c=r.dataPoints[p].x;d=w(r.dataPoints[p].y)?null:r.dataPoints[p].y;c<b.min&&(b.min= c);c>b.max&&(b.max=c);if(0<p){if(a.axisX.logarithmic){var u=c/r.dataPoints[p-1].x;1>u&&(u=1/u);b.minDiff>u&&1!==u&&(b.minDiff=u)}else u=c-r.dataPoints[p-1].x,0>u&&(u*=-1),b.minDiff>u&&0!==u&&(b.minDiff=u);w(d)||null===r.dataPoints[p-1].y||(a.axisY.logarithmic?0<d&&(u=d/r.dataPoints[p-1].y,1>u&&(u=1/u),f.minDiff>u&&1!==u&&(f.minDiff=u)):(u=d-r.dataPoints[p-1].y,0>u&&(u*=-1),f.minDiff>u&&0!==u&&(f.minDiff=u)))}if(c<wa&&!m)null!==d&&(t=c);else{if(!m&&(m=!0,0<p)){p-=2;continue}if(c>C&&!e)e=!0;else if(c> C&&e)continue;r.dataPoints[p].label&&(a.axisX.labels[c]=r.dataPoints[p].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);null===d?b.viewPortMin===c&&t<c&&(b.viewPortMin=t):(a.yTotals[c]=(a.yTotals[c]?a.yTotals[c]:0)+d,0<=d?k=!0:0>d&&(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=w(f.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(f.viewPortMax,99*Math.pow(a.axisY.logarithmBase, -0.05)),f.min=w(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&!l?(f.max=w(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=w(f.viewPortMin)?1:Math.min(f.viewPortMin,1)):k&&l?(f.max=w(f.viewPortMax)?99:Math.max(f.viewPortMax,99),f.min=w(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99)):!k&&l&&(f.max=w(f.viewPortMax)?-1:Math.max(f.viewPortMax,-1),f.min=w(f.viewPortMin)?-99:Math.min(f.viewPortMin,-99));f.viewPortMin=f.min;f.viewPortMax=f.max;a.dataPointYSums=n}};s.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;n<a.dataSeriesIndexes.length;n++){var h=this.data[a.dataSeriesIndexes[n]],r=0,p=!1,m=!1,e,t,wa;if("normal"===h.axisPlacement||"xySwapped"===h.axisPlacement)var C=this.sessionVariables.axisX.newViewportMinimum?this.sessionVariables.axisX.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum: -Infinity,u=this.sessionVariables.axisX.newViewportMaximum?this.sessionVariables.axisX.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&&this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(h.dataPoints[r].x&&h.dataPoints[r].x.getTime||"dateTime"===h.xValueType)l=!0;for(r=0;r<h.dataPoints.length;r++){"undefined"===typeof h.dataPoints[r].x&&(h.dataPoints[r].x=r+(a.axisX.logarithmic?1:0));h.dataPoints[r].x.getTime? (l=!0,c=h.dataPoints[r].x.getTime()):c=h.dataPoints[r].x;if((d=h.dataPoints[r].y)&&d.length){g=Math.min.apply(null,d);k=Math.max.apply(null,d);t=!0;for(var E=0;E<d.length;E++)null===d.k&&(t=!1);t&&(p||(wa=e),e=c)}c<b.min&&(b.min=c);c>b.max&&(b.max=c);g<f.min&&(f.min=g);k>f.max&&(f.max=k);0<r&&(a.axisX.logarithmic?(t=c/h.dataPoints[r-1].x,1>t&&(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(!(c<C)||p){if(!p&&(p=!0,0<r)){r-=2;e=wa;continue}if(c>u&&!m)m=!0;else if(c>u&&m)continue;h.dataPoints[r].label&&(a.axisX.labels[c]=h.dataPoints[r].label);c<b.viewPortMin&&(b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&d)for(E=0;E<d.length;E++)if(null===d[E]&&e<c){b.viewPortMin= e;break}null===d?b.viewPortMin===c&&e<c&&(b.viewPortMin=e):(g<f.viewPortMin&&(f.viewPortMin=g),k>f.viewPortMax&&(f.viewPortMax=k))}}this.plotInfo.axisXValueType=h.xValueType=l?"dateTime":"number"}};s.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;k<a.dataSeriesIndexes.length;k++){var l=this.data[a.dataSeriesIndexes[k]],n=0,h=!1,r=!1,p=c=0;if("normal"===l.axisPlacement|| "xySwapped"===l.axisPlacement)var m=a.axisX.sessionVariables.newViewportMinimum?a.axisX.sessionVariables.newViewportMinimum:this.options.axisX&&this.options.axisX.viewportMinimum?this.options.axisX.viewportMinimum:this.options.axisX&&this.options.axisX.minimum?this.options.axisX.minimum:a.axisX.logarithmic?0:-Infinity,e=a.axisX.sessionVariables.newViewportMaximum?a.axisX.sessionVariables.newViewportMaximum:this.options.axisX&&this.options.axisX.viewportMaximum?this.options.axisX.viewportMaximum:this.options.axisX&& this.options.axisX.maximum?this.options.axisX.maximum:Infinity;if(l.dataPoints[n].x&&l.dataPoints[n].x.getTime||"dateTime"===l.xValueType)g=!0;for(n=0;n<l.dataPoints.length;n++)"undefined"!==typeof l.dataPoints[n].isCumulativeSum&&!0===l.dataPoints[n].isCumulativeSum?(l.dataPointEOs[n].cumulativeSumYStartValue=0,l.dataPointEOs[n].cumulativeSum=0===n?0:l.dataPointEOs[n-1].cumulativeSum,l.dataPoints[n].y=0===n?0:l.dataPointEOs[n-1].cumulativeSum):"undefined"!==typeof l.dataPoints[n].isIntermediateSum&& !0===l.dataPoints[n].isIntermediateSum?(l.dataPointEOs[n].cumulativeSumYStartValue=p,l.dataPointEOs[n].cumulativeSum=0===n?0:l.dataPointEOs[n-1].cumulativeSum,l.dataPoints[n].y=0===n?0:c,p=0===n?0:l.dataPointEOs[n-1].cumulativeSum,c=0):(d="number"!==typeof l.dataPoints[n].y?0:l.dataPoints[n].y,l.dataPointEOs[n].cumulativeSumYStartValue=0===n?0:l.dataPointEOs[n-1].cumulativeSum,l.dataPointEOs[n].cumulativeSum=0===n?d:l.dataPointEOs[n-1].cumulativeSum+d,c+=d);for(n=0;n<l.dataPoints.length;n++)if("undefined"=== typeof l.dataPoints[n].x&&(l.dataPoints[n].x=n+(a.axisX.logarithmic?1:0)),l.dataPoints[n].x.getTime?(g=!0,c=l.dataPoints[n].x.getTime()):c=l.dataPoints[n].x,d=l.dataPoints[n].y,c<b.min&&(b.min=c),c>b.max&&(b.max=c),l.dataPointEOs[n].cumulativeSum<f.min&&(f.min=l.dataPointEOs[n].cumulativeSum),l.dataPointEOs[n].cumulativeSum>f.max&&(f.max=l.dataPointEOs[n].cumulativeSum),0<n&&(a.axisX.logarithmic?(p=c/l.dataPoints[n-1].x,1>p&&(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)))),!(c<m)||h){if(!h&&(h=!0,0<n)){n-=2;continue}if(c>e&&!r)r=!0;else if(c>e&&r)continue;l.dataPoints[n].label&&(a.axisX.labels[c]=l.dataPoints[n].label);c<b.viewPortMin&& (b.viewPortMin=c);c>b.viewPortMax&&(b.viewPortMax=c);0<n&&(l.dataPointEOs[n-1].cumulativeSum<f.viewPortMin&&(f.viewPortMin=l.dataPointEOs[n-1].cumulativeSum),l.dataPointEOs[n-1].cumulativeSum>f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n-1].cumulativeSum));l.dataPointEOs[n].cumulativeSum<f.viewPortMin&&(f.viewPortMin=l.dataPointEOs[n].cumulativeSum);l.dataPointEOs[n].cumulativeSum>f.viewPortMax&&(f.viewPortMax=l.dataPointEOs[n].cumulativeSum)}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime": "number"}};s.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;f<d?(g=Math.ceil(a*(0<a?1.01:0.99)/f)*f,h=Math.floor(c*(0<c?0.99:1.01)/f)*f):(g=Math.ceil(a*(0<a?1.01:0.99)/d)*d,h=Math.floor(c*(0<c?0.99:1.01)/d)*d);g>h&&(h=Math.pow(0.1,Number((Math.log(d)/Math.LN10+1).toFixed(2))>>1),0.01>h?(g=Math.ceil(a*(1+(0<a?h:-1*h))/d)*d,h=Math.floor(c*(1+(0<c?-1*h:h))/d)*d):(d/= 10,g=Math.ceil((a+(0<a?d:-1*d))/d)*d,h=Math.floor((c+(0<c?-1*d:d))/d)*d));var k=g-a,m=c-h;if(m>0.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,x=0;x<a.dataSeriesIndexes.length;x++){var q=d.data[a.dataSeriesIndexes[x]];if(!(4>q.dataPoints.length))for(r=0;r<q.dataPoints.length;r++)if(c&&(p=(m+1-k)*Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold)||10,10)/100,h=q.dataPoints[r].x.getTime?q.dataPoints[r].x.getTime():q.dataPoints[r].x,p=Math.floor((h-k)/p),h<g[p].min&& (g[p].min=h),h>g[p].max&&(g[p].max=h)),b){var s=(n+1-l)*Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold)||10,10)/100;if((h="waterfall"===a.type?q.dataPointEOs[r].cumulativeSum:q.dataPoints[r].y)&&h.length)for(var v=0;v<h.length;v++)p=Math.floor((h[v]-l)/s),h[v]<f[p].min&&(f[p].min=h[v]),h[v]>f[p].max&&(f[p].max=h[v]);else w(h)||(p=Math.floor((h-l)/s),h<f[p].min&&(f[p].min=h),h>f[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;m<a.dataSeriesIndexes.length;m++){var l=d.data[a.dataSeriesIndexes[m]];if(!(4>l.dataPoints.length))for(k=0;k<l.dataPoints.length;k++)h=(f+1-b)*Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold)||10,10)/100,c=l.dataPoints[k].x.getTime?l.dataPoints[k].x.getTime():l.dataPoints[k].x,h=Math.floor((c-b)/h),c<g[h].min&&(g[h].min=c),c>g[h].max&&(g[h].max= c)}}for(var c,d=this,g=!1,k=0;k<this._axes.length;k++)if(this._axes[k].scaleBreaks&&this._axes[k].scaleBreaks.autoCalculate&&1<=this._axes[k].scaleBreaks.maxNumberOfAutoBreaks){g=!0;this._axes[k].dataInfo._dataRanges=[];for(var l=0;l<100/Math.max(parseFloat(this._axes[k].scaleBreaks.collapsibleThreshold)||10,10);l++)this._axes[k].dataInfo._dataRanges.push({min:Infinity,max:-Infinity})}if(g){for(k=0;k<this.plotInfo.plotTypes.length;k++)for(g=this.plotInfo.plotTypes[k],l=0;l<g.plotUnits.length;l++)c= g.plotUnits[l],"line"===c.type||"stepLine"===c.type||"spline"===c.type||"column"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"bar"===c.type||"bubble"===c.type||"scatter"===c.type||"candlestick"===c.type||"ohlc"===c.type||"rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type||"waterfall"===c.type||"error"===c.type||"boxAndWhisker"===c.type?f(c):0<=c.type.indexOf("stacked")&&b(c);for(k=0;k<this._axes.length;k++)if(this._axes[k].dataInfo._dataRanges){var n= this._axes[k].dataInfo.min;c=(this._axes[k].dataInfo.max+1-n)*Math.max(parseFloat(this._axes[k].scaleBreaks.collapsibleThreshold)||10,10)/100;var h=this._axes[k].dataInfo._dataRanges,r,p,g=[];if(this._axes[k].dataInfo.dataPointYPositiveSums){var m=this._axes[k].dataInfo.dataPointYPositiveSums;r=h;for(l in m)m.hasOwnProperty(l)&&!isNaN(l)&&(p=m[l],w(p)||(index=Math.floor((p-n)/c),p<r[index].min&&(r[index].min=p),p>r[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],w(p)||(index=Math.floor((p-n)/c),p<r[index].min&&(r[index].min=p),p>r[index].max&&(r[index].max=p)));delete this._axes[k].dataInfo.dataPointYNegativeSums}for(l=0;l<h.length-1;l++)if(r=h[l].max,isFinite(r))for(;l<h.length-1;)if(n=h[l+1].min,isFinite(n)){p=n-r;p>c&&g.push({diff:p,start:r,end:n});break}else l++;if(this._axes[k].scaleBreaks.customBreaks)for(l=0;l<this._axes[k].scaleBreaks.customBreaks.length;l++)for(c= 0;c<g.length;c++)if(this._axes[k].scaleBreaks.customBreaks[l].startValue<=g[c].start&&g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].endValue||this._axes[k].scaleBreaks.customBreaks[l].startValue<=g[c].start&&g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].endValue||g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].startValue&&this._axes[k].scaleBreaks.customBreaks[l].startValue<=g[c].end||g[c].start<=this._axes[k].scaleBreaks.customBreaks[l].endValue&&this._axes[k].scaleBreaks.customBreaks[l].endValue<= g[c].end)g.splice(c,1),c--;g.sort(function(a,c){return c.diff-a.diff});for(l=0;l<Math.min(g.length,this._axes[k].scaleBreaks.maxNumberOfAutoBreaks);l++)c=a(g[l].start,g[l].end),this._axes[k].scaleBreaks.autoBreaks.push(new da(this,"autoBreaks",c,l,++this._eventManager.lastObjectId,this._axes[k].scaleBreaks)),this._axes[k].scaleBreaks._appliedBreaks.push(this._axes[k].scaleBreaks.autoBreaks[this._axes[k].scaleBreaks.autoBreaks.length-1]);this._axes[k].scaleBreaks._appliedBreaks.sort(function(a,c){return a.startValue- c.startValue})}}};s.prototype.getDataPointAtXY=function(a,f,b){b=b||!1;for(var c=[],d=this._dataInRenderedOrder.length-1;0<=d;d--){var g=null;(g=this._dataInRenderedOrder[d].getDataPointAtXY(a,f,b))&&c.push(g)}a=null;f=!1;for(b=0;b<c.length;b++)if("line"===c[b].dataSeries.type||"stepLine"===c[b].dataSeries.type||"area"===c[b].dataSeries.type||"stepArea"===c[b].dataSeries.type)if(d=ia("markerSize",c[b].dataPoint,c[b].dataSeries)||8,c[b].distance<=d/2){f=!0;break}for(b=0;b<c.length;b++)f&&"line"!== c[b].dataSeries.type&&"stepLine"!==c[b].dataSeries.type&&"area"!==c[b].dataSeries.type&&"stepArea"!==c[b].dataSeries.type||(a?c[b].distance<=a.distance&&(a=c[b]):a=c[b]);return a};s.prototype.getObjectAtXY=function(a,f,b){var c=null;if(b=this.getDataPointAtXY(a,f,b||!1))c=b.dataSeries.dataPointIds[b.dataPointIndex];else if(x)c=Ua(a,f,this._eventManager.ghostCtx);else for(b=0;b<this.legend.items.length;b++){var d=this.legend.items[b];a>=d.x1&&(a<=d.x2&&f>=d.y1&&f<=d.y2)&&(c=d.id)}return c};s.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)))};s.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};s.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))};s.prototype.attachEvent=function(a){this._events.push(a)};s.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<b.length)){d= Ma(c);d.time=new Date;try{var g=d.y-this._lastTouchData.y;if(15<Math.abs(g)&&this._lastTouchData.scroll){this._lastTouchData.scroll=!0;var k=window.parent||window;k&&k.scrollBy&&k.scrollBy(0,-g)}}catch(l){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(b=0;b<f.length;b++)d=f[b],g=document.createEvent("MouseEvent"),g.initMouseEvent(d,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0, null),c.target.dispatchEvent(g),a.preventManipulation&&a.preventManipulation()}}};s.prototype._dispatchRangeEvent=function(a,f){var b={chart:this};b.type=a;b.trigger=f;var c=[];this.axisX&&0<this.axisX.length&&c.push("axisX");this.axisX2&&0<this.axisX2.length&&c.push("axisX2");this.axisY&&0<this.axisY.length&&c.push("axisY");this.axisY2&&0<this.axisY2.length&&c.push("axisY2");for(var d=0;d<c.length;d++)if(w(b[c[d]])&&(b[c[d]]=[]),"axisY"===c[d])for(var g=0;g<this.axisY.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum, viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});else if("axisY2"===c[d])for(g=0;g<this.axisY2.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});else if("axisX"===c[d])for(g=0;g<this.axisX.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});else if("axisX2"===c[d])for(g= 0;g<this.axisX2.length;g++)b[c[d]].push({viewportMinimum:this[c[d]][g].sessionVariables.newViewportMinimum,viewportMaximum:this[c[d]][g].sessionVariables.newViewportMaximum});this.dispatchEvent(a,b,this)};s.prototype._mouseEventHandler=function(a){"undefined"===typeof a.target&&a.srcElement&&(a.target=a.srcElement);var f=Ma(a),b=a.type,c,d;a.which?d=3==a.which:a.button&&(d=2==a.button);s.capturedEventParam&&(c=s.capturedEventParam,"mouseup"===b&&(s.capturedEventParam=null,c.chart.overlaidCanvas.releaseCapture? c.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",c.chart._mouseEventHandler,!1)),c.hasOwnProperty(b)&&("mouseup"!==b||c.chart.overlaidCanvas.releaseCapture?a.target!==c.chart.overlaidCanvas&&x||c[b].call(c.context,f.x,f.y):a.target!==c.chart.overlaidCanvas&&(c.chart.isDrag=!1)));if(this.interactivityEnabled)if(this._ignoreNextEvent)this._ignoreNextEvent=!1;else if(a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.preventDefault(),!d){if(!s.capturedEventParam&& this._events){for(var g=0;g<this._events.length;g++)if(this._events[g].hasOwnProperty(b))if(c=this._events[g],d=c.bounds,f.x>=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?(s.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.x<b.x1||f.x>b.x2||f.y<b.y1||f.y>b.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};s.prototype._plotAreaMouseDown=function(a,f){this.isDrag=!0;this.dragStartPoint={x:a,y:f}};s.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;d<this._axes.length;d++)b=this._axes[d],b.logarithmic?b.viewportMinimum<b.minimum?(g=b.minimum/b.viewportMinimum,b.sessionVariables.newViewportMinimum=b.viewportMinimum* g,b.sessionVariables.newViewportMaximum=b.viewportMaximum*g,k=!0):b.viewportMaximum>b.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,k=!0):b.viewportMinimum<b.minimum?(g=b.minimum-b.viewportMinimum,b.sessionVariables.newViewportMinimum=b.viewportMinimum+g,b.sessionVariables.newViewportMaximum=b.viewportMaximum+g,k=!0):b.viewportMaximum>b.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum= b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,k=!0);else if((!d||2<Math.abs(c))&&(!g||2<Math.abs(b))&&this.zoomEnabled){if(!this.dragStartPoint)return;b=d?this.dragStartPoint.x:this.plotArea.x1;c=g?this.dragStartPoint.y:this.plotArea.y1;d=d?a:this.plotArea.x2;g=g?f:this.plotArea.y2;2<Math.abs(b-d)&&2<Math.abs(c-g)&&this._zoomPanToSelectedRegion(b,c,d,g)&&(k=!0)}k&&(this._ignoreNextEvent=!0,this._dispatchRangeEvent("rangeChanging","zoom"),this.render(),this._dispatchRangeEvent("rangeChanged", "zoom"),k&&(this.zoomEnabled&&"none"===this._zoomButton.style.display)&&(Ka(this._zoomButton,this._resetButton),sa(this,this._zoomButton,"pan"),sa(this,this._resetButton,"reset")))}}this.isDrag=!1;if("none"!==this.plotInfo.axisPlacement){this.resetOverlayedCanvas();if(this.axisX&&0<this.axisX.length)for(k=0;k<this.axisX.length;k++)this.axisX[k].crosshair&&this.axisX[k].crosshair.enabled&&this.axisX[k].renderCrosshair(a,f);if(this.axisX2&&0<this.axisX2.length)for(k=0;k<this.axisX2.length;k++)this.axisX2[k].crosshair&& this.axisX2[k].crosshair.enabled&&this.axisX2[k].renderCrosshair(a,f);if(this.axisY&&0<this.axisY.length)for(k=0;k<this.axisY.length;k++)this.axisY[k].crosshair&&this.axisY[k].crosshair.enabled&&this.axisY[k].renderCrosshair(a,f);if(this.axisY2&&0<this.axisY2.length)for(k=0;k<this.axisY2.length;k++)this.axisY2[k].crosshair&&this.axisY2[k].crosshair.enabled&&this.axisY2[k].renderCrosshair(a,f)}};s.prototype._plotAreaMouseMove=function(a,f){if(this.isDrag&&"none"!==this.plotInfo.axisPlacement){var b= 0,c=0,d=b=null,d=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),k=this;"xySwapped"===this.plotInfo.axisPlacement&&(b=g,g=d,d=b);b=this.dragStartPoint.x-a;c=this.dragStartPoint.y-f;2<Math.abs(b)&&8>Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,f);if((!d||2<Math.abs(b)||!g||2<Math.abs(c))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)d={x1:d?this.plotArea.x1+b:this.plotArea.x1,y1:g?this.plotArea.y1+ c:this.plotArea.y1,x2:d?this.plotArea.x2+b:this.plotArea.x2,y2:g?this.plotArea.y2+c:this.plotArea.y2},clearTimeout(k._panTimerId),k._panTimerId=setTimeout(function(c,b,d,e){return function(){k._zoomPanToSelectedRegion(c,b,d,e,!0)&&(k._dispatchRangeEvent("rangeChanging","pan"),k.render(),k._dispatchRangeEvent("rangeChanged","pan"),k.dragStartPoint.x=a,k.dragStartPoint.y=f)}}(d.x1,d.y1,d.x2,d.y2),0);else if(this.zoomEnabled){this.resetOverlayedCanvas();b=this.overlaidCanvasCtx.globalAlpha;this.overlaidCanvasCtx.fillStyle= "#A89896";var c=d?this.dragStartPoint.x:this.plotArea.x1,l=g?this.dragStartPoint.y:this.plotArea.y1,n=d?a-this.dragStartPoint.x:this.plotArea.x2-this.plotArea.x1,h=g?f-this.dragStartPoint.y:this.plotArea.y2-this.plotArea.y1;this.validateRegion(c,l,d?a:this.plotArea.x2-this.plotArea.x1,g?f:this.plotArea.y2-this.plotArea.y1,"xy"!==this.zoomType).isValid&&(this.resetOverlayedCanvas(),this.overlaidCanvasCtx.fillStyle="#99B2B5");this.overlaidCanvasCtx.globalAlpha=0.7;this.overlaidCanvasCtx.fillRect(c, l,n,h);this.overlaidCanvasCtx.globalAlpha=b}}else if(this.toolTip.mouseMoveHandler(a,f),"none"!==this.plotInfo.axisPlacement){if(this.axisX&&0<this.axisX.length)for(d=0;d<this.axisX.length;d++)this.axisX[d].crosshair&&this.axisX[d].crosshair.enabled&&this.axisX[d].renderCrosshair(a,f);if(this.axisX2&&0<this.axisX2.length)for(d=0;d<this.axisX2.length;d++)this.axisX2[d].crosshair&&this.axisX2[d].crosshair.enabled&&this.axisX2[d].renderCrosshair(a,f);if(this.axisY&&0<this.axisY.length)for(d=0;d<this.axisY.length;d++)this.axisY[d].crosshair&& this.axisY[d].crosshair.enabled&&this.axisY[d].renderCrosshair(a,f);if(this.axisY2&&0<this.axisY2.length)for(d=0;d<this.axisY2.length;d++)this.axisY2[d].crosshair&&this.axisY2[d].crosshair.enabled&&this.axisY2[d].renderCrosshair(a,f)}};s.prototype._zoomPanToSelectedRegion=function(a,f,b,c,d){a=this.validateRegion(a,f,b,c,d);f=a.axesWithValidRange;b=a.axesRanges;if(a.isValid)for(c=0;c<f.length;c++)d=b[c],f[c].setViewPortRange(d.val1,d.val2);return a.isValid};s.prototype.validateRegion=function(a,f, b,c,d){d=d||!1;for(var g=0<=this.zoomType.indexOf("x"),k=0<=this.zoomType.indexOf("y"),l=!1,n=[],h=[],r=[],p=0;p<this._axes.length;p++)("axisX"===this._axes[p].type&&g||"axisY"===this._axes[p].type&&k)&&h.push(this._axes[p]);for(k=0;k<h.length;k++){var p=h[k],g=!1,m=p.convertPixelToValue({x:a,y:f}),e=p.convertPixelToValue({x:b,y:c});if(m>e)var t=e,e=m,m=t;if(p.scaleBreaks)for(t=0;!g&&t<p.scaleBreaks._appliedBreaks.length;t++)g=p.scaleBreaks._appliedBreaks[t].startValue<=m&&p.scaleBreaks._appliedBreaks[t].endValue>= 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&&t<Math.pow(p.dataInfo.minDiff,3)||!p.logarithmic&&t<3*Math.abs(p.dataInfo.minDiff))||m<p.minimum||e>p.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}};s.prototype.preparePlotArea=function(){var a=this.plotArea;!x&&(0<a.x1||0<a.y1)&&a.ctx.translate(a.x1, a.y1);if((this.axisX[0]||this.axisX2[0])&&(this.axisY[0]||this.axisY2[0])){var f=this.axisX[0]?this.axisX[0].lineCoordinates:this.axisX2[0].lineCoordinates;if(this.axisY&&0<this.axisY.length&&this.axisY[0]){var b=this.axisY[0];a.x1=f.x1<f.x2?f.x1:b.lineCoordinates.x1;a.y1=f.y1<b.lineCoordinates.y1?f.y1:b.lineCoordinates.y1;a.x2=f.x2>b.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&&0<this.axisY2.length&&this.axisY2[0]&& (b=this.axisY2[0],a.x1=f.x1<f.x2?f.x1:b.lineCoordinates.x1,a.y1=f.y1<b.lineCoordinates.y1?f.y1:b.lineCoordinates.y1,a.x2=f.x2>b.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;x||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1, -a.y1));a.layoutManager=new Ba(a.x1,a.y1,a.x2,a.y2,2)};s.prototype.renderIndexLabels=function(a){var f=a||this.plotArea.ctx,b=this.plotArea,c=0,d=0,g=0,k=0,l=c=k=d=g=0,n=0;for(a=0;a<this._indexLabels.length;a++){var h=this._indexLabels[a],r=h.chartType.toLowerCase(),p,m,l=ia("indexLabelFontColor",h.dataPoint,h.dataSeries),n=ia("indexLabelFontSize",h.dataPoint,h.dataSeries);p=ia("indexLabelFontFamily",h.dataPoint,h.dataSeries);m=ia("indexLabelFontStyle",h.dataPoint,h.dataSeries);var k=ia("indexLabelFontWeight", h.dataPoint,h.dataSeries),e=ia("indexLabelBackgroundColor",h.dataPoint,h.dataSeries),d=ia("indexLabelMaxWidth",h.dataPoint,h.dataSeries),g=ia("indexLabelWrap",h.dataPoint,h.dataSeries),t=ia("indexLabelLineDashType",h.dataPoint,h.dataSeries),q=ia("indexLabelLineColor",h.dataPoint,h.dataSeries),C=w(h.dataPoint.indexLabelLineThickness)?w(h.dataSeries.options.indexLabelLineThickness)?0:h.dataSeries.options.indexLabelLineThickness:h.dataPoint.indexLabelLineThickness,c=0<C?Math.min(10,("normal"===this.plotInfo.axisPlacement? this.plotArea.height:this.plotArea.width)<<0):0,u={percent:null,total:null},E=null;if(0<=h.dataSeries.type.indexOf("stacked")||"pie"===h.dataSeries.type||"doughnut"===h.dataSeries.type)u=this.getPercentAndTotal(h.dataSeries,h.dataPoint);if(h.dataSeries.indexLabelFormatter||h.dataPoint.indexLabelFormatter)E={chart:this,dataSeries:h.dataSeries,dataPoint:h.dataPoint,index:h.indexKeyword,total:u.total,percent:u.percent};var G=h.dataPoint.indexLabelFormatter?h.dataPoint.indexLabelFormatter(E):h.dataPoint.indexLabel? this.replaceKeywordsWithValue(h.dataPoint.indexLabel,h.dataPoint,h.dataSeries,null,h.indexKeyword):h.dataSeries.indexLabelFormatter?h.dataSeries.indexLabelFormatter(E):h.dataSeries.indexLabel?this.replaceKeywordsWithValue(h.dataSeries.indexLabel,h.dataPoint,h.dataSeries,null,h.indexKeyword):null;if(null!==G&&""!==G){var u=ia("indexLabelPlacement",h.dataPoint,h.dataSeries),E=ia("indexLabelOrientation",h.dataPoint,h.dataSeries),s=h.direction,D=h.dataSeries.axisX,A=h.dataSeries.axisY,v=!1,e=new ja(f, {x:0,y:0,maxWidth:d?d:0.5*this.width,maxHeight:g?5*n:1.5*n,angle:"horizontal"===E?0:-90,text:G,padding:0,backgroundColor:e,horizontalAlign:"left",fontSize:n,fontFamily:p,fontWeight:k,fontColor:l,fontStyle:m,textBaseline:"top"});e.measureText();h.dataSeries.indexLabelMaxWidth=e.maxWidth;if("stackedarea100"===r){if(h.point.x<b.x1||h.point.x>b.x2||h.point.y<b.y1-1||h.point.y>b.y2+1)continue}else if("rangearea"===r||"rangesplinearea"===r){if(h.dataPoint.x<D.viewportMinimum||h.dataPoint.x>D.viewportMaximum|| Math.max.apply(null,h.dataPoint.y)<A.viewportMinimum||Math.min.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.x<D.viewportMinimum||h.dataPoint.x>D.viewportMaximum||h.dataPoint.y<A.viewportMinimum||h.dataPoint.y>A.viewportMaximum)continue}else if(0<=r.indexOf("column")||"waterfall"===r||"error"===r&&!h.axisSwapped){if(h.dataPoint.x<D.viewportMinimum||h.dataPoint.x>D.viewportMaximum|| h.bounds.y1>b.y2||h.bounds.y2<b.y1)continue}else if(0<=r.indexOf("bar")||"error"===r){if(h.dataPoint.x<D.viewportMinimum||h.dataPoint.x>D.viewportMaximum||h.bounds.x1>b.x2||h.bounds.x2<b.x1)continue}else if("candlestick"===r||"ohlc"===r){if(h.dataPoint.x<D.viewportMinimum||h.dataPoint.x>D.viewportMaximum||Math.max.apply(null,h.dataPoint.y)<A.viewportMinimum||Math.min.apply(null,h.dataPoint.y)>A.viewportMaximum)continue}else if(h.dataPoint.x<D.viewportMinimum||h.dataPoint.x>D.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"))u="auto",k=4;else if(0<=r.indexOf("stacked"))"auto"===u&&(u="inside");else if("bubble"===r||"scatter"===r)u="inside";p=h.point.x-l/2;"inside"!==u?(d=b.y1,g=b.y2,0<s?(m=h.point.y-n-k-c,m<d&&(m="auto"===u?Math.max(h.point.y,d)+k+c:d+k+c,v=m+n>h.point.y)):(m=h.point.y+k+c,m>g-n-k-c&&(m="auto"===u?Math.min(h.point.y,g)-n-k-c:g-n-k-c,v=m<h.point.y))): (d=Math.max(h.bounds.y1,b.y1),g=Math.min(h.bounds.y2,b.y2),c=0<=r.indexOf("range")||"error"===r?0<s?Math.max(h.bounds.y1,b.y1)+n/2+k:Math.min(h.bounds.y2,b.y2)-n/2-k:(Math.max(h.bounds.y1,b.y1)+Math.min(h.bounds.y2,b.y2))/2,0<s?(m=Math.max(h.point.y,c)-n/2,m<d&&("bubble"===r||"scatter"===r)&&(m=Math.max(h.point.y-n-k,b.y1+k))):(m=Math.min(h.point.y,c)-n/2,m>g-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")?(u="auto",d=4):0<=r.indexOf("stacked")?"auto"===u&&(u="inside"):"bubble"===r&&(u="inside"),m=h.point.y-n/2,"inside"!==u?(k=b.x1,g=b.x2,0>s?(p=h.point.x-l-d-c,p<k&&(p="auto"===u?Math.max(h.point.x,k)+d+c:k+d+c,v=p+l>h.point.x)):(p=h.point.x+d+c,p>g-l-d-c&&(p="auto"===u?Math.min(h.point.x,g)-l-d-c:g-l-d-c,v=p<h.point.x))):(k=Math.max(h.bounds.x1,b.x1),Math.min(h.bounds.x2,b.x2),c=0<=r.indexOf("range")||"error"===r?0>s?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>s?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"!==u&&(0>r.indexOf("bar")&&("error"!==r||!h.axisSwapped)&&h.point.x>b.x1&&h.point.x<b.x2||!v)&&(0>r.indexOf("column")&&("error"!==r||h.axisSwapped)&&h.point.y>b.y1&&h.point.y<b.y2||!v))&&(f.lineWidth=C,f.strokeStyle=q?q:"gray",f.setLineDash&&f.setLineDash(F(t,C)),f.beginPath(),f.moveTo(h.point.x,h.point.y), 0<=r.indexOf("bar")||"error"===r&&h.axisSwapped?f.lineTo(p+(0<h.direction?0:l),m+("horizontal"===E?n:-n)/2):0<=r.indexOf("column")||"error"===r&&!h.axisSwapped?f.lineTo(p+l/2,m+((0<h.direction?n:-n)+("horizontal"===E?n:-n))/2):f.lineTo(p+l/2,m+((m<h.point.y?n:-n)+("horizontal"===E?n:-n))/2),f.stroke())}}f={source:f,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0,startTimePercent:0.7};for(a=0;a<this._indexLabels.length;a++)h=this._indexLabels[a], e=ia("indexLabelBackgroundColor",h.dataPoint,h.dataSeries),h.dataSeries.indexLabelBackgroundColor=w(e)?x?"transparent":null:e;return f};s.prototype.renderLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n];b.lineWidth= h.lineThickness;var r=h.dataPoints,p="solid";if(b.setLineDash){var m=F(h.nullDataLineDashType,h.lineThickness),p=h.lineDashType,e=F(p,h.lineThickness);b.setLineDash(e)}var t=h.id;this._eventManager.objectMap[t]={objectType:"dataSeries",dataSeriesIndex:n};t=P(t);c.strokeStyle=t;c.lineWidth=0<h.lineThickness?Math.max(h.lineThickness,4):0;var t=h._colorSet,q=t=h.lineColor=h.options.lineColor?h.options.lineColor:t[0];b.strokeStyle=t;var C=!0,u=0,E,G;b.beginPath();if(0<r.length){for(var s=!1,u=0;u<r.length;u++)if(E= r[u].x.getTime?r[u].x.getTime():r[u].x,!(E<a.axisX.dataInfo.viewPortMin||E>a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!s)))if("number"!==typeof r[u].y)0<u&&!(h.connectNullData||s||C)&&(b.stroke(),x&&c.stroke()),s=!0;else{E=a.axisX.convertValueToPixel(E);G=a.axisY.convertValueToPixel(r[u].y);var w=h.dataPointIds[u];this._eventManager.objectMap[w]={id:w,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:u,x1:E,y1:G};C||s?(!C&&h.connectNullData?(b.setLineDash&&(h.options.nullDataLineDashType|| p===h.lineDashType&&h.lineDashType!==h.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(k.x,k.y),p=h.nullDataLineDashType,b.setLineDash(m)),b.lineTo(E,G),x&&c.lineTo(E,G)):(b.beginPath(),b.moveTo(E,G),x&&(c.beginPath(),c.moveTo(E,G))),s=C=!1):(b.lineTo(E,G),x&&c.lineTo(E,G),0==u%500&&(b.stroke(),b.beginPath(),b.moveTo(E,G),x&&(c.stroke(),c.beginPath(),c.moveTo(E,G))));k={x:E,y:G};u<r.length-1&&(q!==(r[u].lineColor||t)||p!==(r[u].lineDashType||h.lineDashType))&&(b.stroke(),b.beginPath(),b.moveTo(E, G),q=r[u].lineColor||t,b.strokeStyle=q,b.setLineDash&&(r[u].lineDashType?(p=r[u].lineDashType,b.setLineDash(F(p,h.lineThickness))):(p=h.lineDashType,b.setLineDash(e))));if(0<r[u].markerSize||0<h.markerSize){var A=h.getMarkerProperties(u,E,G,b);g.push(A);w=P(w);x&&g.push({x:E,y:G,ctx:c,type:A.type,size:A.size,color:w,borderColor:w,borderThickness:A.borderThickness})}(r[u].indexLabel||h.indexLabel||r[u].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:r[u], dataSeries:h,point:{x:E,y:G},direction:0>r[u].y===a.axisY.reversed?1:-1,color:t})}b.stroke();x&&c.stroke()}}ea.drawMarkers(g);x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderStepLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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;l<a.dataSeriesIndexes.length;l++){var n= a.dataSeriesIndexes[l],h=this.data[n];b.lineWidth=h.lineThickness;var r=h.dataPoints,p="solid";if(b.setLineDash){var m=F(h.nullDataLineDashType,h.lineThickness),p=h.lineDashType,e=F(p,h.lineThickness);b.setLineDash(e)}var t=h.id;this._eventManager.objectMap[t]={objectType:"dataSeries",dataSeriesIndex:n};t=P(t);c.strokeStyle=t;c.lineWidth=0<h.lineThickness?Math.max(h.lineThickness,4):0;var t=h._colorSet,q=t=h.lineColor=h.options.lineColor?h.options.lineColor:t[0];b.strokeStyle=t;var C=!0,u=0,E,G;b.beginPath(); if(0<r.length){for(var s=!1,u=0;u<r.length;u++)if(E=r[u].getTime?r[u].x.getTime():r[u].x,!(E<a.axisX.dataInfo.viewPortMin||E>a.axisX.dataInfo.viewPortMax&&(!h.connectNullData||!s)))if("number"!==typeof r[u].y)0<u&&!(h.connectNullData||s||C)&&(b.stroke(),x&&c.stroke()),s=!0;else{var w=G;E=a.axisX.convertValueToPixel(E);G=a.axisY.convertValueToPixel(r[u].y);var A=h.dataPointIds[u];this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:u,x1:E,y1:G};C||s?(!C&&h.connectNullData? (b.setLineDash&&(h.options.nullDataLineDashType||p===h.lineDashType&&h.lineDashType!==h.nullDataLineDashType)&&(b.stroke(),b.beginPath(),b.moveTo(k.x,k.y),p=h.nullDataLineDashType,b.setLineDash(m)),b.lineTo(E,w),b.lineTo(E,G),x&&(c.lineTo(E,w),c.lineTo(E,G))):(b.beginPath(),b.moveTo(E,G),x&&(c.beginPath(),c.moveTo(E,G))),s=C=!1):(b.lineTo(E,w),x&&c.lineTo(E,w),b.lineTo(E,G),x&&c.lineTo(E,G),0==u%500&&(b.stroke(),b.beginPath(),b.moveTo(E,G),x&&(c.stroke(),c.beginPath(),c.moveTo(E,G))));k={x:E,y:G}; u<r.length-1&&(q!==(r[u].lineColor||t)||p!==(r[u].lineDashType||h.lineDashType))&&(b.stroke(),b.beginPath(),b.moveTo(E,G),q=r[u].lineColor||t,b.strokeStyle=q,b.setLineDash&&(r[u].lineDashType?(p=r[u].lineDashType,b.setLineDash(F(p,h.lineThickness))):(p=h.lineDashType,b.setLineDash(e))));if(0<r[u].markerSize||0<h.markerSize)w=h.getMarkerProperties(u,E,G,b),g.push(w),A=P(A),x&&g.push({x:E,y:G,ctx:c,type:w.type,size:w.size,color:A,borderColor:A,borderThickness:w.borderThickness});(r[u].indexLabel||h.indexLabel|| r[u].indexLabelFormatter||h.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:r[u],dataSeries:h,point:{x:E,y:G},direction:0>r[u].y===a.axisY.reversed?1:-1,color:t})}b.stroke();x&&c.stroke()}}ea.drawMarkers(g);x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderSpline=function(a){function f(a){a=y(a,2);if(0<a.length){c.beginPath();x&&d.beginPath();c.moveTo(a[0].x,a[0].y);a[0].newStrokeStyle&&(c.strokeStyle=a[0].newStrokeStyle);a[0].newLineDashArray&& c.setLineDash(a[0].newLineDashArray);x&&d.moveTo(a[0].x,a[0].y);for(var b=0;b<a.length-3;b+=3)if(c.bezierCurveTo(a[b+1].x,a[b+1].y,a[b+2].x,a[b+2].y,a[b+3].x,a[b+3].y),x&&d.bezierCurveTo(a[b+1].x,a[b+1].y,a[b+2].x,a[b+2].y,a[b+3].x,a[b+3].y),0<b&&0===b%3E3||a[b+3].newStrokeStyle||a[b+3].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(a[b+3].x,a[b+3].y),a[b+3].newStrokeStyle&&(c.strokeStyle=a[b+3].newStrokeStyle),a[b+3].newLineDashArray&&c.setLineDash(a[b+3].newLineDashArray),x&&(d.stroke(),d.beginPath(), d.moveTo(a[b+3].x,a[b+3].y));c.stroke();x&&d.stroke()}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=x?this._preRenderCtx:b;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;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n];c.lineWidth=h.lineThickness;var r=h.dataPoints,p="solid";if(c.setLineDash){var m=F(h.nullDataLineDashType,h.lineThickness),p= h.lineDashType,e=F(p,h.lineThickness);c.setLineDash(e)}var t=h.id;this._eventManager.objectMap[t]={objectType:"dataSeries",dataSeriesIndex:n};t=P(t);d.strokeStyle=t;d.lineWidth=0<h.lineThickness?Math.max(h.lineThickness,4):0;var t=h._colorSet,q=t=h.lineColor=h.options.lineColor?h.options.lineColor:t[0];c.strokeStyle=t;var C=0,u,E,G=[];c.beginPath();if(0<r.length)for(E=!1,C=0;C<r.length;C++)if(u=r[C].getTime?r[C].x.getTime():r[C].x,!(u<a.axisX.dataInfo.viewPortMin||u>a.axisX.dataInfo.viewPortMax&& (!h.connectNullData||!E)))if("number"!==typeof r[C].y)0<C&&!E&&(h.connectNullData?c.setLineDash&&(0<G.length&&(h.options.nullDataLineDashType||!r[C-1].lineDashType))&&(G[G.length-1].newLineDashArray=m,p=h.nullDataLineDashType):(f(G),G=[])),E=!0;else{u=a.axisX.convertValueToPixel(u);E=a.axisY.convertValueToPixel(r[C].y);var s=h.dataPointIds[C];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:C,x1:u,y1:E};G[G.length]={x:u,y:E};C<r.length-1&&(q!==(r[C].lineColor|| t)||p!==(r[C].lineDashType||h.lineDashType))&&(q=r[C].lineColor||t,G[G.length-1].newStrokeStyle=q,c.setLineDash&&(r[C].lineDashType?(p=r[C].lineDashType,G[G.length-1].newLineDashArray=F(p,h.lineThickness)):(p=h.lineDashType,G[G.length-1].newLineDashArray=e)));if(0<r[C].markerSize||0<h.markerSize){var w=h.getMarkerProperties(C,u,E,c);k.push(w);s=P(s);x&&k.push({x:u,y:E,ctx:d,type:w.type,size:w.size,color:s,borderColor:s,borderThickness:w.borderThickness})}(r[C].indexLabel||h.indexLabel||r[C].indexLabelFormatter|| h.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:r[C],dataSeries:h,point:{x:u,y:E},direction:0>r[C].y===a.axisY.reversed?1:-1,color:t});E=!1}f(G)}ea.drawMarkers(k);x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};var W=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<c-f&&15<d-b?8:0.35*Math.min(c-f,d-b);a.beginPath();a.moveTo(f,b);a.save();a.fillStyle=g;a.globalAlpha=m;a.fillRect(f,b,c-f,d-b);a.globalAlpha=1;0<k&&(m=0===k%2?0:0.5,a.beginPath(), a.lineWidth=k,a.strokeStyle=l,a.moveTo(f,b),a.rect(f-m,b-m,c-f+2*m,d-b+2*m),a.stroke());a.restore();!0===n&&(a.save(),a.beginPath(),a.moveTo(f,b),a.lineTo(f+e,b+e),a.lineTo(c-e,b+e),a.lineTo(c,b),a.closePath(),k=a.createLinearGradient((c+f)/2,b+e,(c+f)/2,b),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, .4)"),a.fillStyle=k,a.fill(),a.restore());!0===h&&(a.save(),a.beginPath(),a.moveTo(f,d),a.lineTo(f+e,d-e),a.lineTo(c-e,d-e),a.lineTo(c,d),a.closePath(),k=a.createLinearGradient((c+f)/2, d-e,(c+f)/2,d),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, .4)"),a.fillStyle=k,a.fill(),a.restore());!0===r&&(a.save(),a.beginPath(),a.moveTo(f,b),a.lineTo(f+e,b+e),a.lineTo(f+e,d-e),a.lineTo(f,d),a.closePath(),k=a.createLinearGradient(f+e,(d+b)/2,f,(d+b)/2),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, 0.1)"),a.fillStyle=k,a.fill(),a.restore());!0===p&&(a.save(),a.beginPath(),a.moveTo(c,b),a.lineTo(c-e,b+e),a.lineTo(c-e,d-e),a.lineTo(c,d),k=a.createLinearGradient(c-e,(d+ b)/2,c,(d+b)/2),k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, 0.1)"),a.fillStyle=k,k.addColorStop(0,g),k.addColorStop(1,"rgba(255, 255, 255, 0.1)"),a.fillStyle=k,a.fill(),a.closePath(),a.restore())};s.prototype.renderColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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.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&&r<g)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));p<g&&(p=g);p>r&&(p=r);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(r=0;r<a.dataSeriesIndexes.length;r++){var m= a.dataSeriesIndexes[r],e=this.data[m],t=e.dataPoints;if(0<t.length)for(var q=5<p&&e.bevelEnabled?!0:!1,g=0;g<t.length;g++)if(t[g].getTime?n=t[g].x.getTime():n=t[g].x,!(n<a.axisX.dataInfo.viewPortMin||n>a.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,u;0<=t[g].y?u=h:(u=l,l=h);l>u&&(c=l,l=u,u=c);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];W(b,k,l,C,u,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:u};c=P(c);x&&W(this._eventManager.ghostCtx,k,l,C,u,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:u},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:k,y1:Math.min(l,u),x2:C,y2:Math.max(l,u)},color:c})}}x&&(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:L.yScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:h<a.axisY.bounds.y1?a.axisY.bounds.y1:h>a.axisY.bounds.y2?a.axisY.bounds.y2:h}}};s.prototype.renderStackedColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&r<h)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>r&&(e=r);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height), this._eventManager.ghostCtx.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],u=C.dataPoints;if(0<u.length){var E=5<e&&C.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(h=0;h<u.length;h++)if(c=u[h].x.getTime?u[h].x.getTime():u[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[h].y){r=a.axisX.convertValueToPixel(c);var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=G+e<<0,w;if(a.axisY.logarithmic||a.axisY.scaleBreaks&& 0<a.axisY.scaleBreaks._appliedBreaks.length&&0<u[h].y)l[c]=u[h].y+(l[c]?l[c]:0),0<l[c]&&(p=a.axisY.convertValueToPixel(l[c]),w="undefined"!==typeof g[c]?g[c]:m,g[c]=p);else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=u[h].y)n[c]=u[h].y+(n[c]?n[c]:0),w=a.axisY.convertValueToPixel(n[c]),p="undefined"!==typeof k[c]?k[c]:m,k[c]=w;else if(p=a.axisY.convertValueToPixel(u[h].y),0<=u[h].y){var A="undefined"!==typeof g[c]?g[c]:0;p-=A;w=m-A;g[c]=A+(w-p)}else A=k[c]?k[c]:0,w=p+A, p=m+A,k[c]=A+(w-p);c=u[h].color?u[h].color:C._colorSet[h%C._colorSet.length];W(b,G,p,s,w,c,0,null,E&&0<=u[h].y,0>u[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:w};c=P(c);x&&W(this._eventManager.ghostCtx,G,p,s,w,c,0,null,!1,!1,!1,!1);(u[h].indexLabel||C.indexLabel||u[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:u[h],dataSeries:C, point:{x:r,y:0<=u[h].y?p:w},direction:0>u[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,w),x2:s,y2:Math.max(p,w)},color:c})}}}x&&(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:L.yScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:m<a.axisY.bounds.y1?a.axisY.bounds.y1:m>a.axisY.bounds.y2?a.axisY.bounds.y2:m}}};s.prototype.renderStackedColumn100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&r<h)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>r&&(e=r);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip()); for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],u=C.dataPoints;if(0<u.length)for(var E=5<e&&C.bevelEnabled?!0:!1,h=0;h<u.length;h++)if(c=u[h].x.getTime?u[h].x.getTime():u[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[h].y){r=a.axisX.convertValueToPixel(c);p=0!==a.dataPointYSums[c]?100*(u[h].y/a.dataPointYSums[c]):0;var G=r-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=G+e<<0,w;if(a.axisY.logarithmic||a.axisY.scaleBreaks&& 0<a.axisY.scaleBreaks._appliedBreaks.length&&0<u[h].y){l[c]=p+("undefined"!==typeof l[c]?l[c]:0);if(0>=l[c])continue;p=a.axisY.convertValueToPixel(l[c]);w=g[c]?g[c]:m;g[c]=p}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=u[h].y)n[c]=p+("undefined"!==typeof n[c]?n[c]:0),w=a.axisY.convertValueToPixel(n[c]),p=k[c]?k[c]:m,k[c]=w;else if(p=a.axisY.convertValueToPixel(p),0<=u[h].y){var A="undefined"!==typeof g[c]?g[c]:0;p-=A;w=m-A;g[c]=A+(w-p)}else A="undefined"!==typeof k[c]? k[c]:0,w=p+A,p=m+A,k[c]=A+(w-p);c=u[h].color?u[h].color:C._colorSet[h%C._colorSet.length];W(b,G,p,s,w,c,0,null,E&&0<=u[h].y,0>u[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:w};c=P(c);x&&W(this._eventManager.ghostCtx,G,p,s,w,c,0,null,!1,!1,!1,!1);(u[h].indexLabel||C.indexLabel||u[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:u[h], dataSeries:C,point:{x:r,y:0<=u[h].y?p:w},direction:0>u[h].y===a.axisY.reversed?1:-1,bounds:{x1:G,y1:Math.min(p,w),x2:s,y2:Math.max(p,w)},color:c})}}x&&(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:L.yScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:m<a.axisY.bounds.y1?a.axisY.bounds.y1:m>a.axisY.bounds.y2?a.axisY.bounds.y2:m}}};s.prototype.renderBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&r<g)&&(r=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));p<g&&(p=g);p>r&&(p=r);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip()); for(r=0;r<a.dataSeriesIndexes.length;r++){var m=a.dataSeriesIndexes[r],e=this.data[m],t=e.dataPoints;if(0<t.length){var q=5<p&&e.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(g=0;g<t.length;g++)if(t[g].getTime?n=t[g].x.getTime():n=t[g].x,!(n<a.axisX.dataInfo.viewPortMin||n>a.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,u;0<=t[g].y?u=h:(u=k,k=h);c=t[g].color?t[g].color:e._colorSet[g%e._colorSet.length];W(b,u,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:u,y1:l,x2:k,y2:C};c=P(c);x&&W(this._eventManager.ghostCtx,u,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:u,y:l+(C-l)/2},direction:0>t[g].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,k),y1:l,x2:Math.max(u,k),y2:C},color:c})}}}x&&(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:L.xScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:h<a.axisY.bounds.x1?a.axisY.bounds.x1:h>a.axisY.bounds.x2?a.axisY.bounds.x2:h}}};s.prototype.renderStackedBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&p<h)&&(p=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>p&&(e=p);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height), this._eventManager.ghostCtx.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],u=C.dataPoints;if(0<u.length){var E=5<e&&C.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(h=0;h<u.length;h++)if(c=u[h].x.getTime?u[h].x.getTime():u[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[h].y){p=a.axisX.convertValueToPixel(c);var w=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,s=w+e<<0,v;if(a.axisY.logarithmic||a.axisY.scaleBreaks&& 0<a.axisY.scaleBreaks._appliedBreaks.length&&0<u[h].y)l[c]=u[h].y+(l[c]?l[c]:0),0<l[c]&&(v=g[c]?g[c]:m,g[c]=r=a.axisY.convertValueToPixel(l[c]));else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=u[h].y)n[c]=u[h].y+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=v=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(u[h].y),0<=u[h].y){var A=g[c]?g[c]:0;v=m+A;r+=A;g[c]=A+(r-v)}else A=k[c]?k[c]:0,v=r-A,r=m-A,k[c]=A+(r-v);c=u[h].color?u[h].color:C._colorSet[h%C._colorSet.length]; W(b,v,w,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:v,y1:w,x2:r,y2:s};c=P(c);x&&W(this._eventManager.ghostCtx,v,w,r,s,c,0,null,!1,!1,!1,!1);(u[h].indexLabel||C.indexLabel||u[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:u[h],dataSeries:C,point:{x:0<=u[h].y?r:v,y:p},direction:0>u[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v, r),y1:w,x2:Math.max(v,r),y2:s},color:c})}}}x&&(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:L.xScaleAnimation,easingFunction:L.easing.easeOutQuart,animationBase:m<a.axisY.bounds.x1?a.axisY.bounds.x1:m>a.axisY.bounds.x2?a.axisY.bounds.x2:m}}};s.prototype.renderStackedBar100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&p<h)&&(p=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,h));e<h&&(e=h);e>p&&(e=p);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var q=a.dataSeriesIndexes[t],C=this.data[q],u=C.dataPoints; if(0<u.length){var E=5<e&&C.bevelEnabled?!0:!1;b.strokeStyle="#4572A7 ";for(h=0;h<u.length;h++)if(c=u[h].x.getTime?u[h].x.getTime():u[h].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof u[h].y){p=a.axisX.convertValueToPixel(c);var w;w=0!==a.dataPointYSums[c]?100*(u[h].y/a.dataPointYSums[c]):0;var s=p-a.plotType.plotUnits.length*e/2+a.index*e<<0,v=s+e<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0<u[h].y){l[c]=w+ (l[c]?l[c]:0);if(0>=l[c])continue;w=g[c]?g[c]:m;g[c]=r=a.axisY.convertValueToPixel(l[c])}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=u[h].y)n[c]=w+(n[c]?n[c]:0),r=k[c]?k[c]:m,k[c]=w=a.axisY.convertValueToPixel(n[c]);else if(r=a.axisY.convertValueToPixel(w),0<=u[h].y){var A=g[c]?g[c]:0;w=m+A;r+=A;g[c]=A+(r-w)}else A=k[c]?k[c]:0,w=r-A,r=m-A,k[c]=A+(r-w);c=u[h].color?u[h].color:C._colorSet[h%C._colorSet.length];W(b,w,s,r,v,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:w,y1:s,x2:r,y2:v};c=P(c);x&&W(this._eventManager.ghostCtx,w,s,r,v,c,0,null,!1,!1,!1,!1);(u[h].indexLabel||C.indexLabel||u[h].indexLabelFormatter||C.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",dataPoint:u[h],dataSeries:C,point:{x:0<=u[h].y?r:w,y:p},direction:0>u[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(w,r),y1:s,x2:Math.max(w,r),y2:v},color:c})}}}x&&(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:L.xScaleAnimation,easingFunction:L.easing.easeOutQuart, animationBase:m<a.axisY.bounds.x1?a.axisY.bounds.x1:m>a.axisY.bounds.x2?a.axisY.bounds.x2:m}}};s.prototype.renderArea=function(a){var f,b;function c(){A&&(0<t.lineThickness&&g.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=s:0>a.axisY.viewportMaximum?v=n.y1:0<a.axisY.viewportMinimum&&(v=l.y2),g.lineTo(u,v),g.lineTo(A.x,v),g.closePath(),g.globalAlpha=t.fillOpacity,g.fill(),g.globalAlpha=1,x&&(k.lineTo(u,v),k.lineTo(A.x,v),k.closePath(),k.fill()),g.beginPath(), g.moveTo(u,E),k.beginPath(),k.moveTo(u,E),A={x:u,y:E})}var d=a.targetCanvasCtx||this.plotArea.ctx,g=x?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();x&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();x&&(k.beginPath(),k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;m<a.dataSeriesIndexes.length;m++){var e=a.dataSeriesIndexes[m],t=this.data[e], q=t.dataPoints,h=t.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:e};h=P(h);k.fillStyle=h;h=[];f=!0;var C=0,u,E,w,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v,A=null;if(0<q.length){var y=t._colorSet[C%t._colorSet.length],z=t.lineColor=t.options.lineColor||y,S=z;g.fillStyle=y;g.strokeStyle=z;g.lineWidth=t.lineThickness;b="solid";if(g.setLineDash){var Y=F(t.nullDataLineDashType,t.lineThickness);b=t.lineDashType;var ca=F(b,t.lineThickness); g.setLineDash(ca)}for(var $=!0;C<q.length;C++)if(w=q[C].x.getTime?q[C].x.getTime():q[C].x,!(w<a.axisX.dataInfo.viewPortMin||w>a.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!$)))if("number"!==typeof q[C].y)t.connectNullData||($||f)||c(),$=!0;else{u=a.axisX.convertValueToPixel(w);E=a.axisY.convertValueToPixel(q[C].y);f||$?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType||b===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=u,b=E,u=p.x,E=p.y,c(),g.moveTo(p.x,p.y), u=f,E=b,A=p,b=t.nullDataLineDashType,g.setLineDash(Y)),g.lineTo(u,E),x&&k.lineTo(u,E)):(g.beginPath(),g.moveTo(u,E),x&&(k.beginPath(),k.moveTo(u,E)),A={x:u,y:E}),$=f=!1):(g.lineTo(u,E),x&&k.lineTo(u,E),0==C%250&&c());p={x:u,y:E};C<q.length-1&&(S!==(q[C].lineColor||z)||b!==(q[C].lineDashType||t.lineDashType))&&(c(),S=q[C].lineColor||z,g.strokeStyle=S,g.setLineDash&&(q[C].lineDashType?(b=q[C].lineDashType,g.setLineDash(F(b,t.lineThickness))):(b=t.lineDashType,g.setLineDash(ca))));var N=t.dataPointIds[C]; this._eventManager.objectMap[N]={id:N,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:C,x1:u,y1:E};0!==q[C].markerSize&&(0<q[C].markerSize||0<t.markerSize)&&(w=t.getMarkerProperties(C,u,E,g),h.push(w),N=P(N),x&&h.push({x:u,y:E,ctx:k,type:w.type,size:w.size,color:N,borderColor:N,borderThickness:w.borderThickness}));(q[C].indexLabel||t.indexLabel||q[C].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:"area",dataPoint:q[C],dataSeries:t,point:{x:u,y:E},direction:0> q[C].y===a.axisY.reversed?1:-1,color:y})}c();ea.drawMarkers(h)}}x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderSplineArea=function(a){function f(){var b=y(w,2);if(0<b.length){if(0<p.lineThickness){c.beginPath();c.moveTo(b[0].x,b[0].y);b[0].newStrokeStyle&&(c.strokeStyle=b[0].newStrokeStyle);b[0].newLineDashArray&&c.setLineDash(b[0].newLineDashArray);for(var e=0;e<b.length-3;e+=3)if(c.bezierCurveTo(b[e+1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y),x&& d.bezierCurveTo(b[e+1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y),b[e+3].newStrokeStyle||b[e+3].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(b[e+3].x,b[e+3].y),b[e+3].newStrokeStyle&&(c.strokeStyle=b[e+3].newStrokeStyle),b[e+3].newLineDashArray&&c.setLineDash(b[e+3].newLineDashArray);c.stroke()}c.beginPath();c.moveTo(b[0].x,b[0].y);x&&(d.beginPath(),d.moveTo(b[0].x,b[0].y));for(e=0;e<b.length-3;e+=3)c.bezierCurveTo(b[e+1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y),x&&d.bezierCurveTo(b[e+ 1].x,b[e+1].y,b[e+2].x,b[e+2].y,b[e+3].x,b[e+3].y);a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?u=C:0>a.axisY.viewportMaximum?u=k.y1:0<a.axisY.viewportMinimum&&(u=g.y2);E={x:b[0].x,y:b[0].y};c.lineTo(b[b.length-1].x,u);c.lineTo(E.x,u);c.closePath();c.globalAlpha=p.fillOpacity;c.fill();c.globalAlpha=1;x&&(d.lineTo(b[b.length-1].x,u),d.lineTo(E.x,u),d.closePath(),d.fill())}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=x?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d= this._eventManager.ghostCtx,g=a.axisX.lineCoordinates,k=a.axisY.lineCoordinates,l=[],n=this.plotArea;c.save();x&&d.save();c.beginPath();c.rect(n.x1,n.y1,n.width,n.height);c.clip();x&&(d.beginPath(),d.rect(n.x1,n.y1,n.width,n.height),d.clip());for(var h=0;h<a.dataSeriesIndexes.length;h++){var r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,l=p.id;this._eventManager.objectMap[l]={objectType:"dataSeries",dataSeriesIndex:r};l=P(l);d.fillStyle=l;var l=[],e=0,t,q,C=a.axisY.convertValueToPixel(a.axisY.logarithmic? a.axisY.viewportMinimum:0),u,E=null,w=[];if(0<m.length){var s=p._colorSet[e%p._colorSet.length],v=p.lineColor=p.options.lineColor||s,A=v;c.fillStyle=s;c.strokeStyle=v;c.lineWidth=p.lineThickness;var za="solid";if(c.setLineDash){var z=F(p.nullDataLineDashType,p.lineThickness),za=p.lineDashType,S=F(za,p.lineThickness);c.setLineDash(S)}for(q=!1;e<m.length;e++)if(t=m[e].x.getTime?m[e].x.getTime():m[e].x,!(t<a.axisX.dataInfo.viewPortMin||t>a.axisX.dataInfo.viewPortMax&&(!p.connectNullData||!q)))if("number"!== typeof m[e].y)0<e&&!q&&(p.connectNullData?c.setLineDash&&(0<w.length&&(p.options.nullDataLineDashType||!m[e-1].lineDashType))&&(w[w.length-1].newLineDashArray=z,za=p.nullDataLineDashType):(f(),w=[])),q=!0;else{t=a.axisX.convertValueToPixel(t);q=a.axisY.convertValueToPixel(m[e].y);var Y=p.dataPointIds[e];this._eventManager.objectMap[Y]={id:Y,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:e,x1:t,y1:q};w[w.length]={x:t,y:q};e<m.length-1&&(A!==(m[e].lineColor||v)||za!==(m[e].lineDashType||p.lineDashType))&& (A=m[e].lineColor||v,w[w.length-1].newStrokeStyle=A,c.setLineDash&&(m[e].lineDashType?(za=m[e].lineDashType,w[w.length-1].newLineDashArray=F(za,p.lineThickness)):(za=p.lineDashType,w[w.length-1].newLineDashArray=S)));if(0!==m[e].markerSize&&(0<m[e].markerSize||0<p.markerSize)){var ca=p.getMarkerProperties(e,t,q,c);l.push(ca);Y=P(Y);x&&l.push({x:t,y:q,ctx:d,type:ca.type,size:ca.size,color:Y,borderColor:Y,borderThickness:ca.borderThickness})}(m[e].indexLabel||p.indexLabel||m[e].indexLabelFormatter|| p.indexLabelFormatter)&&this._indexLabels.push({chartType:"splineArea",dataPoint:m[e],dataSeries:p,point:{x:t,y:q},direction:0>m[e].y===a.axisY.reversed?1:-1,color:s});q=!1}f();ea.drawMarkers(l)}}x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderStepArea=function(a){var f,b;function c(){A&&(0<t.lineThickness&&g.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?D=v:0>a.axisY.viewportMaximum?D=n.y1:0<a.axisY.viewportMinimum&&(D=l.y2),g.lineTo(u,D),g.lineTo(A.x, D),g.closePath(),g.globalAlpha=t.fillOpacity,g.fill(),g.globalAlpha=1,x&&(k.lineTo(u,D),k.lineTo(A.x,D),k.closePath(),k.fill()),g.beginPath(),g.moveTo(u,w),k.beginPath(),k.moveTo(u,w),A={x:u,y:w})}var d=a.targetCanvasCtx||this.plotArea.ctx,g=x?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var k=this._eventManager.ghostCtx,l=a.axisX.lineCoordinates,n=a.axisY.lineCoordinates,h=[],r=this.plotArea,p;g.save();x&&k.save();g.beginPath();g.rect(r.x1,r.y1,r.width,r.height);g.clip();x&&(k.beginPath(), k.rect(r.x1,r.y1,r.width,r.height),k.clip());for(var m=0;m<a.dataSeriesIndexes.length;m++){var e=a.dataSeriesIndexes[m],t=this.data[e],q=t.dataPoints,h=t.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:e};h=P(h);k.fillStyle=h;h=[];f=!0;var C=0,u,w,s,v=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),D,A=null;b=!1;if(0<q.length){var y=t._colorSet[C%t._colorSet.length],z=t.lineColor=t.options.lineColor||y,S=z;g.fillStyle=y;g.strokeStyle=z;g.lineWidth= t.lineThickness;var Y="solid";if(g.setLineDash){var ca=F(t.nullDataLineDashType,t.lineThickness),Y=t.lineDashType,$=F(Y,t.lineThickness);g.setLineDash($)}for(;C<q.length;C++)if(s=q[C].x.getTime?q[C].x.getTime():q[C].x,!(s<a.axisX.dataInfo.viewPortMin||s>a.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!b))){var N=w;"number"!==typeof q[C].y?(t.connectNullData||(b||f)||c(),b=!0):(u=a.axisX.convertValueToPixel(s),w=a.axisY.convertValueToPixel(q[C].y),f||b?(!f&&t.connectNullData?(g.setLineDash&&(t.options.nullDataLineDashType|| Y===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(f=u,b=w,u=p.x,w=p.y,c(),g.moveTo(p.x,p.y),u=f,w=b,A=p,Y=t.nullDataLineDashType,g.setLineDash(ca)),g.lineTo(u,N),g.lineTo(u,w),x&&(k.lineTo(u,N),k.lineTo(u,w))):(g.beginPath(),g.moveTo(u,w),x&&(k.beginPath(),k.moveTo(u,w)),A={x:u,y:w}),b=f=!1):(g.lineTo(u,N),x&&k.lineTo(u,N),g.lineTo(u,w),x&&k.lineTo(u,w),0==C%250&&c()),p={x:u,y:w},C<q.length-1&&(S!==(q[C].lineColor||z)||Y!==(q[C].lineDashType||t.lineDashType))&&(c(),S=q[C].lineColor|| z,g.strokeStyle=S,g.setLineDash&&(q[C].lineDashType?(Y=q[C].lineDashType,g.setLineDash(F(Y,t.lineThickness))):(Y=t.lineDashType,g.setLineDash($)))),s=t.dataPointIds[C],this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:C,x1:u,y1:w},0!==q[C].markerSize&&(0<q[C].markerSize||0<t.markerSize)&&(N=t.getMarkerProperties(C,u,w,g),h.push(N),s=P(s),x&&h.push({x:u,y:w,ctx:k,type:N.type,size:N.size,color:s,borderColor:s,borderThickness:N.borderThickness})),(q[C].indexLabel|| t.indexLabel||q[C].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:q[C],dataSeries:t,point:{x:u,y:w},direction:0>q[C].y===a.axisY.reversed?1:-1,color:y}))}c();ea.drawMarkers(h)}}x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderStackedArea=function(a){function f(){if(!(1>n.length)){for(0<A.lineThickness&&c.stroke();0<n.length;){var a=n.pop();c.lineTo(a.x,a.y);x&&C.lineTo(a.x,a.y)}c.closePath();c.globalAlpha=A.fillOpacity; c.fill();c.globalAlpha=1;c.beginPath();x&&(C.closePath(),C.fill(),C.beginPath());n=[]}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=x?this._preRenderCtx:b;if(!(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,u,w,s;x&&C.beginPath();c.save();x&&C.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();x&&(C.beginPath(),C.rect(k.x1,k.y1,k.width, k.height),C.clip());for(var d=[],v=0;v<a.dataSeriesIndexes.length;v++){var D=a.dataSeriesIndexes[v],A=this.data[D],y=A.dataPoints;A.dataPointIndexes=[];for(p=0;p<y.length;p++)D=y[p].x.getTime?y[p].x.getTime():y[p].x,A.dataPointIndexes[D]=p,d[D]||(h.push(D),d[D]=!0);h.sort(Na)}for(v=0;v<a.dataSeriesIndexes.length;v++){D=a.dataSeriesIndexes[v];A=this.data[D];y=A.dataPoints;w=!0;n=[];p=A.id;this._eventManager.objectMap[p]={objectType:"dataSeries",dataSeriesIndex:D};p=P(p);C.fillStyle=p;if(0<h.length){var d= A._colorSet[0],z=A.lineColor=A.options.lineColor||d,S=z;c.fillStyle=d;c.strokeStyle=z;c.lineWidth=A.lineThickness;s="solid";if(c.setLineDash){var Y=F(A.nullDataLineDashType,A.lineThickness);s=A.lineDashType;var ca=F(s,A.lineThickness);c.setLineDash(ca)}for(var $=!0,p=0;p<h.length;p++){t=h[p];var N=null,N=0<=A.dataPointIndexes[t]?y[A.dataPointIndexes[t]]:{x:t,y:null};if(!(t<a.axisX.dataInfo.viewPortMin||t>a.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!$)))if("number"!==typeof N.y)A.connectNullData|| ($||w)||f(),$=!0;else{m=a.axisX.convertValueToPixel(t);var I=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){r[t]=N.y+(r[t]?r[t]:0);if(0>=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(N.y),e-=I;n.push({x:m,y:q-I});l[t]=q-e;w||$?(!w&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||s===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(w=n.pop(),s=n[n.length-1], f(),c.moveTo(u.x,u.y),n.push(s),n.push(w),s=A.nullDataLineDashType,c.setLineDash(Y)),c.lineTo(m,e),x&&C.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),x&&(C.beginPath(),C.moveTo(m,e))),$=w=!1):(c.lineTo(m,e),x&&C.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),x&&C.moveTo(m,e),n.push({x:m,y:q-I})));u={x:m,y:e};p<y.length-1&&(S!==(y[p].lineColor||z)||s!==(y[p].lineDashType||A.lineDashType))&&(f(),c.beginPath(),c.moveTo(m,e),n.push({x:m,y:q-I}),S=y[p].lineColor||z,c.strokeStyle=S,c.setLineDash&&(y[p].lineDashType? (s=y[p].lineDashType,c.setLineDash(F(s,A.lineThickness))):(s=A.lineDashType,c.setLineDash(ca))));if(0<=A.dataPointIndexes[t]){var la=A.dataPointIds[A.dataPointIndexes[t]];this._eventManager.objectMap[la]={id:la,objectType:"dataPoint",dataSeriesIndex:D,dataPointIndex:A.dataPointIndexes[t],x1:m,y1:e}}0<=A.dataPointIndexes[t]&&0!==N.markerSize&&(0<N.markerSize||0<A.markerSize)&&(t=A.getMarkerProperties(A.dataPointIndexes[t],m,e,c),g.push(t),markerColor=P(la),x&&g.push({x:m,y:e,ctx:C,type:t.type,size:t.size, color:markerColor,borderColor:markerColor,borderThickness:t.borderThickness}));(N.indexLabel||A.indexLabel||N.indexLabelFormatter||A.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:N,dataSeries:A,point:{x:m,y:e},direction:0>y[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);x&&C.moveTo(m,e)}delete A.dataPointIndexes}ea.drawMarkers(g);x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderStackedArea100=function(a){function f(){for(0<A.lineThickness&& c.stroke();0<n.length;){var a=n.pop();c.lineTo(a.x,a.y);x&&v.lineTo(a.x,a.y)}c.closePath();c.globalAlpha=A.fillOpacity;c.fill();c.globalAlpha=1;c.beginPath();x&&(v.closePath(),v.fill(),v.beginPath());n=[]}var b=a.targetCanvasCtx||this.plotArea.ctx,c=x?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d=null,g=this.plotArea,k=[],l=[],n=[],h=[],r=[],p=0,m,e,t,q,w,u,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;c.save();x&&v.save(); c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();x&&(v.beginPath(),v.rect(g.x1,g.y1,g.width,g.height),v.clip());for(var d=[],y=0;y<a.dataSeriesIndexes.length;y++){var D=a.dataSeriesIndexes[y],A=this.data[D],z=A.dataPoints;A.dataPointIndexes=[];for(p=0;p<z.length;p++)D=z[p].x.getTime?z[p].x.getTime():z[p].x,A.dataPointIndexes[D]=p,d[D]||(h.push(D),d[D]=!0);h.sort(Na)}for(y=0;y<a.dataSeriesIndexes.length;y++){D=a.dataSeriesIndexes[y];A=this.data[D];z=A.dataPoints;w=!0;d=A.id;this._eventManager.objectMap[d]= {objectType:"dataSeries",dataSeriesIndex:D};d=P(d);v.fillStyle=d;n=[];if(0<h.length){var d=A._colorSet[p%A._colorSet.length],B=A.lineColor=A.options.lineColor||d,S=B;c.fillStyle=d;c.strokeStyle=B;c.lineWidth=A.lineThickness;u="solid";if(c.setLineDash){var Y=F(A.nullDataLineDashType,A.lineThickness);u=A.lineDashType;var ca=F(u,A.lineThickness);c.setLineDash(ca)}for(var $=!0,p=0;p<h.length;p++){t=h[p];var N=null,N=0<=A.dataPointIndexes[t]?z[A.dataPointIndexes[t]]:{x:t,y:null};if(!(t<a.axisX.dataInfo.viewPortMin|| t>a.axisX.dataInfo.viewPortMax&&(!A.connectNullData||!$)))if("number"!==typeof N.y)A.connectNullData||($||w)||f(),$=!0;else{var I;I=0!==a.dataPointYSums[t]?100*(N.y/a.dataPointYSums[t]):0;m=a.axisX.convertValueToPixel(t);var la=l[t]?l[t]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){r[t]=I+(r[t]?r[t]:0);if(0>=r[t]&&a.axisY.logarithmic)continue;e=a.axisY.convertValueToPixel(r[t])}else e=a.axisY.convertValueToPixel(I),e-=la;n.push({x:m,y:s-la});l[t]=s-e; w||$?(!w&&A.connectNullData?(c.setLineDash&&(A.options.nullDataLineDashType||u===A.lineDashType&&A.lineDashType!==A.nullDataLineDashType)&&(w=n.pop(),u=n[n.length-1],f(),c.moveTo(q.x,q.y),n.push(u),n.push(w),u=A.nullDataLineDashType,c.setLineDash(Y)),c.lineTo(m,e),x&&v.lineTo(m,e)):(c.beginPath(),c.moveTo(m,e),x&&(v.beginPath(),v.moveTo(m,e))),$=w=!1):(c.lineTo(m,e),x&&v.lineTo(m,e),0==p%250&&(f(),c.moveTo(m,e),x&&v.moveTo(m,e),n.push({x:m,y:s-la})));q={x:m,y:e};p<z.length-1&&(S!==(z[p].lineColor|| B)||u!==(z[p].lineDashType||A.lineDashType))&&(f(),c.beginPath(),c.moveTo(m,e),n.push({x:m,y:s-la}),S=z[p].lineColor||B,c.strokeStyle=S,c.setLineDash&&(z[p].lineDashType?(u=z[p].lineDashType,c.setLineDash(F(u,A.lineThickness))):(u=A.lineDashType,c.setLineDash(ca))));if(0<=A.dataPointIndexes[t]){var pa=A.dataPointIds[A.dataPointIndexes[t]];this._eventManager.objectMap[pa]={id:pa,objectType:"dataPoint",dataSeriesIndex:D,dataPointIndex:A.dataPointIndexes[t],x1:m,y1:e}}0<=A.dataPointIndexes[t]&&0!==N.markerSize&& (0<N.markerSize||0<A.markerSize)&&(t=A.getMarkerProperties(p,m,e,c),k.push(t),markerColor=P(pa),x&&k.push({x:m,y:e,ctx:v,type:t.type,size:t.size,color:markerColor,borderColor:markerColor,borderThickness:t.borderThickness}));(N.indexLabel||A.indexLabel||N.indexLabelFormatter||A.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea100",dataPoint:N,dataSeries:A,point:{x:m,y:e},direction:0>z[p].y===a.axisY.reversed?1:-1,color:d})}}f();c.moveTo(m,e);x&&v.moveTo(m,e)}delete A.dataPointIndexes}ea.drawMarkers(k); x&&(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),v.restore());c.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:L.xClipAnimation, easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderBubble=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();x&&(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;d<m.length;d++)g=m[d].getTime?g=m[d].x.getTime():g=m[d].x,g<a.axisX.dataInfo.viewPortMin||g>a.axisX.dataInfo.viewPortMax||"undefined"===typeof m[d].z||(e=m[d].z,e>l&&(l=e),e<n&&(n=e));for(var t=25*Math.PI,q=Math.max(Math.pow(0.25*Math.min(c.height,c.width)/2,2)*Math.PI,t),h=0;h<a.dataSeriesIndexes.length;h++)if(r=a.dataSeriesIndexes[h],p=this.data[r],m=p.dataPoints,0<m.length)for(b.strokeStyle="#4572A7 ", d=0;d<m.length;d++)if(g=m[d].getTime?g=m[d].x.getTime():g=m[d].x,!(g<a.axisX.dataInfo.viewPortMin||g>a.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,w=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=w;b.globalAlpha=p.fillOpacity;ea.drawMarker(g,k,b,e.type,e.size,e.color,e.borderColor,e.borderThickness);b.globalAlpha=1;var u=p.dataPointIds[d];this._eventManager.objectMap[u]= {id:u,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:d,x1:g,y1:k,size:w};w=P(u);x&&ea.drawMarker(g,k,this._eventManager.ghostCtx,e.type,e.size,w,w,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})}x&&(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:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderScatter= function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var c=this.plotArea,d=0,g,k;b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(c.x1,c.y1,c.width,c.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n],r=h.dataPoints;if(0< r.length){b.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(c.height,c.width)/2,2);for(var p=0,m=0,d=0;d<r.length;d++)if(g=r[d].getTime?g=r[d].x.getTime():g=r[d].x,!(g<a.axisX.dataInfo.viewPortMin||g>a.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;ea.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(e.size,5)&&r.length>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=P(p),x&&ea.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)}}}x&&(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:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderCandlestick=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&g<d)&&(g=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,d));t<d&& (t=d);t>g&&(t=g);b.save();x&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();x&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(var q=0;q<a.dataSeriesIndexes.length;q++){var C=a.dataSeriesIndexes[q],u=this.data[C],s=u.dataPoints;if(0<s.length)for(var v=5<t&&u.bevelEnabled?!0:!1,l=0;l<s.length;l++)if(s[l].getTime?e=s[l].x.getTime():e=s[l].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&!w(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=u.options.fallingColor?u.fallingColor:u._colorSet[0],d=s[l].color?s[l].color:u._colorSet[0],A=Math.round(Math.max(1,0.15*t)),z=0===A%2?0:0.5,B=u.dataPointIds[l];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint", dataSeriesIndex:C,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"===u.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(),W(b,y,Math.min(h,m),D,Math.max(h,m),s[l].y[0]<=s[l].y[3]?u.risingColor:g,A,d,v,v,!1,!1,u.fillOpacity),x&&(d=P(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(),W(c,y,Math.min(h,m),D,Math.max(h,m),d,0,null,!1,!1,!1,!1))):"ohlc"===u.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(),x&&(d=P(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||u.indexLabel||s[l].indexLabelFormatter|| u.indexLabelFormatter)&&this._indexLabels.push({chartType:u.type,dataPoint:s[l],dataSeries:u,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})}}x&&(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:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderBoxAndWhisker=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&&k<d)&&(k= Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,d));t<d&&(t=d);t>k&&(t=k);b.save();x&&c.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();x&&(c.beginPath(),c.rect(g.x1,g.y1,g.width,g.height),c.clip());for(var q=!1,q=!!a.axisY.reversed,s=0;s<a.dataSeriesIndexes.length;s++){var u=a.dataSeriesIndexes[s],v=this.data[u],G=v.dataPoints;if(0<G.length)for(var y=5<t&&v.bevelEnabled?!0:!1,k=0;k<G.length;k++)if(G[k].getTime?e=G[k].x.getTime():e=G[k].x,!(e<a.axisX.dataInfo.viewPortMin|| e>a.axisX.dataInfo.viewPortMax)&&!w(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:v._colorSet[0],z=Math.round(Math.max(1,0.15*t)),B=0===z%2?0:0.5,S=G[k].whiskerColor?G[k].whiskerColor:G[k].color?v.whiskerColor?v.whiskerColor:G[k].color:v.whiskerColor?v.whiskerColor:d,Y="number"===typeof G[k].whiskerThickness?G[k].whiskerThickness:"number"===typeof v.options.whiskerThickness?v.whiskerThickness:z,ca=G[k].whiskerDashType?G[k].whiskerDashType:v.whiskerDashType,$=w(G[k].whiskerLength)?w(v.options.whiskerLength)?t:v.whiskerLength:G[k].whiskerLength,$="number"===typeof $?0>= $?0:$>=t?t:$:"string"===typeof $?parseInt($)*t/100>t?t:parseInt($)*t/100:t,N=1===Math.round(Y)%2?0.5:0,I=G[k].stemColor?G[k].stemColor:G[k].color?v.stemColor?v.stemColor:G[k].color:v.stemColor?v.stemColor:d,la="number"===typeof G[k].stemThickness?G[k].stemThickness:"number"===typeof v.options.stemThickness?v.stemThickness:z,pa=1===Math.round(la)%2?0.5:0,cb=G[k].stemDashType?G[k].stemDashType:v.stemDashType,O=G[k].lineColor?G[k].lineColor:G[k].color?v.lineColor?v.lineColor:G[k].color:v.lineColor?v.lineColor: d,J="number"===typeof G[k].lineThickness?G[k].lineThickness:"number"===typeof v.options.lineThickness?v.lineThickness:z,R=G[k].lineDashType?G[k].lineDashType:v.lineDashType,K=1===Math.round(J)%2?0.5:0,U=v.upperBoxColor,db=v.lowerBoxColor,M=w(v.options.fillOpacity)?1:v.fillOpacity,ha=v.dataPointIds[k];this._eventManager.objectMap[ha]={id:ha,objectType:"dataPoint",dataSeriesIndex:u,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:la,stemColor:I,whiskerThickness:Y, whiskerLength:$,whiskerColor:S,lineThickness:J,lineColor:O};b.save();0<la&&(b.beginPath(),b.strokeStyle=I,b.lineWidth=la,b.setLineDash&&b.setLineDash(F(cb,la)),b.moveTo(l-pa,h),b.lineTo(l-pa,n),b.stroke(),b.moveTo(l-pa,p),b.lineTo(l-pa,r),b.stroke());b.restore();c.lineWidth=Math.max(z,4);b.beginPath();W(b,D,Math.min(m,h),A,Math.max(h,m),db,0,d,q?y:!1,q?!1:y,!1,!1,M);b.beginPath();W(b,D,Math.min(r,m),A,Math.max(m,r),U,0,d,q?!1:y,q?y:!1,!1,!1,M);b.beginPath();b.lineWidth=z;b.strokeStyle=d;b.rect(D- B,Math.min(h,r)-B,A-D+2*B,Math.max(h,r)-Math.min(h,r)+2*B);b.stroke();b.save();0<J&&(b.beginPath(),b.globalAlpha=1,b.setLineDash&&b.setLineDash(F(R,J)),b.strokeStyle=O,b.lineWidth=J,b.moveTo(D,m-K),b.lineTo(A,m-K),b.stroke());b.restore();b.save();0<Y&&(b.beginPath(),b.setLineDash&&b.setLineDash(F(ca,Y)),b.strokeStyle=S,b.lineWidth=Y,b.moveTo(l-$/2<<0,p-N),b.lineTo(l+$/2<<0,p-N),b.stroke(),b.moveTo(l-$/2<<0,n+N),b.lineTo(l+$/2<<0,n+N),b.stroke());b.restore();x&&(d=P(ha),c.strokeStyle=d,c.lineWidth= la,0<la&&(c.moveTo(l-B-pa,h),c.lineTo(l-B-pa,Math.max(n,p)),c.stroke(),c.moveTo(l-B-pa,Math.min(n,p)),c.lineTo(l-B-pa,r),c.stroke()),W(c,D,Math.max(h,r),A,Math.min(h,r),d,0,null,!1,!1,!1,!1),0<Y&&(c.beginPath(),c.lineWidth=Y,c.moveTo(l+$/2,p-N),c.lineTo(l-$/2,p-N),c.stroke(),c.moveTo(l+$/2,n+N),c.lineTo(l-$/2,n+N),c.stroke()));(G[k].indexLabel||v.indexLabel||G[k].indexLabelFormatter||v.indexLabelFormatter)&&this._indexLabels.push({chartType:v.type,dataPoint:G[k],dataSeries:v,point:{x:D+(A-D)/2,y:a.axisY.reversed? n:p},direction:1,bounds:{x1:D,y1:Math.min(n,p),x2:A,y2:Math.max(n,p)},color:d})}}x&&(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),c.restore()); b.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderRangeColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?this._preRenderCtx:f;if(!(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<g)&&(k=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));h<g&&(h=g);h> k&&(h=k);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var r=0;r<a.dataSeriesIndexes.length;r++){var p=a.dataSeriesIndexes[r],m=this.data[p],e=m.dataPoints;if(0<e.length)for(var t=5<h&&m.bevelEnabled?!0:!1,g=0;g<e.length;g++)if(e[g].getTime?n=e[g].x.getTime():n=e[g].x,!(n<a.axisX.dataInfo.viewPortMin|| n>a.axisX.dataInfo.viewPortMax)&&!w(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 u=k;k= l;l=u}u=m.dataPointIds[g];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:g,x1:q,y1:k,x2:s,y2:l};W(b,q,k,s,l,c,0,c,t,t,!1,!1,m.fillOpacity);c=P(u);x&&W(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})}}x&&(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:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderError=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(k.x1,k.y1,k.width,k.height),this._eventManager.ghostCtx.clip());for(var s=0,u=0;u<this.data.length;u++)!this.data[u].type.match(/(bar|column)/ig)|| !this.data[u].visible||this.data[u].type.match(/(stacked)/ig)&&s||s++;for(var v=0;v<a.dataSeriesIndexes.length;v++){var G=a.dataSeriesIndexes[v],y=this.data[G],D=y.dataPoints,A=w(y._linkedSeries)?!1:y._linkedSeries.type.match(/(bar|column)/ig)&&y._linkedSeries.visible?!0:!1,B=0;if(A)for(d=y._linkedSeries.id,u=0;u<d;u++)!this.data[u].type.match(/(bar|column)/ig)||!this.data[u].visible||this.data[u].type.match(/(stacked)/ig)&&B||(this.data[u].type.match(/(range)/ig)&&(g=!0),B++);d=this.dataPointMinWidth? this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;l=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:c?Math.min(0.15*this.height,0.9*(this.plotArea.height/(A?s:1)))<<0:0.3*this.width;g&&(l=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:c?Math.min(0.15*this.height,0.9*(this.plotArea.height/(A?s:1)))<<0:0.03*this.width);u=this.options.dataPointWidth?this.dataPointWidth:0.9*((c?k.height:k.width)*(a.axisX.logarithmic? Math.log(q)/Math.log(a.axisX.range):Math.abs(q)/Math.abs(a.axisX.range))/(A?s:1))<<0;this.dataPointMaxWidth&&d>l&&(d=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l<d)&&(l=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,d));u<d&&(u=d);u>l&&(u=l);if(0<D.length)for(var F=y._colorSet,l=0;l<D.length;l++){var d=y.lineColor=y.options.color?y.options.color:F[0],S={color:D[l].whiskerColor?D[l].whiskerColor:D[l].color?y.whiskerColor? y.whiskerColor:D[l].color:y.whiskerColor?y.whiskerColor:d,thickness:w(D[l].whiskerThickness)?y.whiskerThickness:D[l].whiskerThickness,dashType:D[l].whiskerDashType?D[l].whiskerDashType:y.whiskerDashType,length:w(D[l].whiskerLength)?w(y.options.whiskerLength)?u:y.options.whiskerLength:D[l].whiskerLength,trimLength:w(D[l].whiskerLength)?w(y.options.whiskerLength)?50:0:0};S.length="number"===typeof S.length?0>=S.length?0:S.length>=u?u:S.length:"string"===typeof S.length?parseInt(S.length)*u/100>u?u: parseInt(S.length)*u/100>u:u;S.thickness="number"===typeof S.thickness?0>S.thickness?0:Math.round(S.thickness):2;var Y={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};Y.thickness="number"===typeof Y.thickness?0>Y.thickness?0:Math.round(Y.thickness):2;D[l].getTime?t=D[l].x.getTime():t=D[l].x;if(!(t<a.axisX.dataInfo.viewPortMin|| t>a.axisX.dataInfo.viewPortMax)&&!w(D[l].y)&&D[l].y.length&&"number"===typeof D[l].y[0]&&"number"===typeof D[l].y[1]){var ca=a.axisX.convertValueToPixel(t);c?h=ca:n=ca;ca=a.axisY.convertValueToPixel(D[l].y[0]);c?r=ca:m=ca;ca=a.axisY.convertValueToPixel(D[l].y[1]);c?p=ca:e=ca;c?(m=a.axisX.reversed?h+(A?s:1)*u/2-(A?B-1:0)*u<<0:h-(A?s:1)*u/2+(A?B-1:0)*u<<0,e=a.axisX.reversed?m-u<<0:m+u<<0):(r=a.axisX.reversed?n+(A?s:1)*u/2-(A?B-1:0)*u<<0:n-(A?s:1)*u/2+(A?B-1:0)*u<<0,p=a.axisX.reversed?r-u<<0:r+u<<0); !c&&m>e&&(ca=m,m=e,e=ca);c&&r>p&&(ca=r,r=p,p=ca);ca=y.dataPointIds[l];this._eventManager.objectMap[ca]={id:ca,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:Y,whiskerProperties:S};z(b,Math.min(r,p),Math.min(m,e),Math.max(p,r),Math.max(e,m),d,S,Y,c);x&&z(this._eventManager.ghostCtx,r,m,p,e,d,S,Y,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})}}}x&&(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:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderRangeBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?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&& k<g)&&(k=Math.max(this.dataPointWidth?this.dataPointWidth:-Infinity,g));r<g&&(r=g);r>k&&(r=k);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var m=a.dataSeriesIndexes[p],e=this.data[m],t=e.dataPoints;if(0<t.length){var q=5<r&&e.bevelEnabled?!0:!1;b.strokeStyle= "#4572A7 ";for(g=0;g<t.length;g++)if(t[g].getTime?h=t[g].x.getTime():h=t[g].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&!w(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];W(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=P(c);x&&W(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})}}}x&&(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:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}};s.prototype.renderRangeArea= function(a){function f(){if(w){var a=null;0<r.lineThickness&&c.stroke();for(var b=n.length-1;0<=b;b--)a=n[b],c.lineTo(a.x,a.y),d.lineTo(a.x,a.y);c.closePath();c.globalAlpha=r.fillOpacity;c.fill();c.globalAlpha=1;d.fill();if(0<r.lineThickness){c.beginPath();c.moveTo(a.x,a.y);for(b=0;b<n.length;b++)a=n[b],c.lineTo(a.x,a.y);c.stroke()}c.beginPath();c.moveTo(t,q);d.beginPath();d.moveTo(t,q);w={x:t,y:q};n=[];n.push({x:t,y:s})}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=x?this._preRenderCtx:b;if(!(0>= a.dataSeriesIndexes.length)){var d=this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();x&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();x&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=[],h=a.dataSeriesIndexes[l],r=this.data[h],p=r.dataPoints,g=r.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:h};g=P(g);d.fillStyle=g;var g=[],m=!0,e=0,t,q,s,u,w=null;if(0<p.length){var v=r._colorSet[e% r._colorSet.length],y=r.lineColor=r.options.lineColor||v,D=y;c.fillStyle=v;c.strokeStyle=y;c.lineWidth=r.lineThickness;var A="solid";if(c.setLineDash){var z=F(r.nullDataLineDashType,r.lineThickness),A=r.lineDashType,B=F(A,r.lineThickness);c.setLineDash(B)}for(var S=!0;e<p.length;e++)if(u=p[e].x.getTime?p[e].x.getTime():p[e].x,!(u<a.axisX.dataInfo.viewPortMin||u>a.axisX.dataInfo.viewPortMax&&(!r.connectNullData||!S)))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(u);q=a.axisY.convertValueToPixel(p[e].y[0]);s=a.axisY.convertValueToPixel(p[e].y[1]);m||S?(r.connectNullData&&!m?(c.setLineDash&&(r.options.nullDataLineDashType||A===r.lineDashType&&r.lineDashType!==r.nullDataLineDashType)&&(n[n.length-1].newLineDashArray=B,A=r.nullDataLineDashType,c.setLineDash(z)),c.lineTo(t,q),x&&d.lineTo(t,q),n.push({x:t,y:s})):(c.beginPath(),c.moveTo(t,q),w={x:t,y:q},n=[],n.push({x:t,y:s}),x&&(d.beginPath(),d.moveTo(t,q))),S=m=!1):(c.lineTo(t,q),n.push({x:t, y:s}),x&&d.lineTo(t,q),0==e%250&&f());u=r.dataPointIds[e];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:h,dataPointIndex:e,x1:t,y1:q,y2:s};e<p.length-1&&(D!==(p[e].lineColor||y)||A!==(p[e].lineDashType||r.lineDashType))&&(f(),D=p[e].lineColor||y,n[n.length-1].newStrokeStyle=D,c.strokeStyle=D,c.setLineDash&&(p[e].lineDashType?(A=p[e].lineDashType,n[n.length-1].newLineDashArray=F(A,r.lineThickness),c.setLineDash(n[n.length-1].newLineDashArray)):(A=r.lineDashType,n[n.length- 1].newLineDashArray=B,c.setLineDash(B))));if(0!==p[e].markerSize&&(0<p[e].markerSize||0<r.markerSize)){var Y=r.getMarkerProperties(e,t,s,c);g.push(Y);var ca=P(u);x&&g.push({x:t,y:s,ctx:d,type:Y.type,size:Y.size,color:ca,borderColor:ca,borderThickness:Y.borderThickness});Y=r.getMarkerProperties(e,t,q,c);g.push(Y);ca=P(u);x&&g.push({x:t,y:q,ctx:d,type:Y.type,size:Y.size,color:ca,borderColor:ca,borderThickness:Y.borderThickness})}if(p[e].indexLabel||r.indexLabel||p[e].indexLabelFormatter||r.indexLabelFormatter)this._indexLabels.push({chartType:"rangeArea", dataPoint:p[e],dataSeries:r,indexKeyword:0,point:{x:t,y:q},direction:p[e].y[0]>p[e].y[1]===a.axisY.reversed?-1:1,color:v}),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:v})}else S||m||f(),S=!0;f();ea.drawMarkers(g)}}x&&(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:L.xClipAnimation,easingFunction:L.easing.linear,animationBase:0}}};s.prototype.renderRangeSplineArea=function(a){function f(a,b){var e=y(q,2);if(0<e.length){if(0< h.lineThickness){c.strokeStyle=b;c.setLineDash&&c.setLineDash(a);c.beginPath();c.moveTo(e[0].x,e[0].y);for(var f=0;f<e.length-3;f+=3){if(e[f].newStrokeStyle||e[f].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(e[f].x,e[f].y),e[f].newStrokeStyle&&(c.strokeStyle=e[f].newStrokeStyle),e[f].newLineDashArray&&c.setLineDash(e[f].newLineDashArray);c.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y)}c.stroke()}c.beginPath();c.moveTo(e[0].x,e[0].y);x&&(d.beginPath(),d.moveTo(e[0].x,e[0].y)); for(f=0;f<e.length-3;f+=3)c.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y),x&&d.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y);e=y(s,2);c.lineTo(s[s.length-1].x,s[s.length-1].y);for(f=e.length-1;2<f;f-=3)c.bezierCurveTo(e[f-1].x,e[f-1].y,e[f-2].x,e[f-2].y,e[f-3].x,e[f-3].y),x&&d.bezierCurveTo(e[f-1].x,e[f-1].y,e[f-2].x,e[f-2].y,e[f-3].x,e[f-3].y);c.closePath();c.globalAlpha=h.fillOpacity;c.fill();x&&(d.closePath(),d.fill());c.globalAlpha=1;if(0<h.lineThickness){c.strokeStyle= b;c.setLineDash&&c.setLineDash(a);c.beginPath();c.moveTo(e[0].x,e[0].y);for(var g=f=0;f<e.length-3;f+=3,g++){if(q[g].newStrokeStyle||q[g].newLineDashArray)c.stroke(),c.beginPath(),c.moveTo(e[f].x,e[f].y),q[g].newStrokeStyle&&(c.strokeStyle=q[g].newStrokeStyle),q[g].newLineDashArray&&c.setLineDash(q[g].newLineDashArray);c.bezierCurveTo(e[f+1].x,e[f+1].y,e[f+2].x,e[f+2].y,e[f+3].x,e[f+3].y)}c.stroke()}c.beginPath()}}var b=a.targetCanvasCtx||this.plotArea.ctx,c=x?this._preRenderCtx:b;if(!(0>=a.dataSeriesIndexes.length)){var d= this._eventManager.ghostCtx,g=[],k=this.plotArea;c.save();x&&d.save();c.beginPath();c.rect(k.x1,k.y1,k.width,k.height);c.clip();x&&(d.beginPath(),d.rect(k.x1,k.y1,k.width,k.height),d.clip());for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],h=this.data[n],r=h.dataPoints,g=h.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:n};g=P(g);d.fillStyle=g;var g=[],p=0,m,e,t,q=[],s=[];if(0<r.length){var u=h._colorSet[p%h._colorSet.length],w=h.lineColor=h.options.lineColor|| u,v=w;c.fillStyle=u;c.lineWidth=h.lineThickness;var z="solid",D;if(c.setLineDash){var A=F(h.nullDataLineDashType,h.lineThickness),z=h.lineDashType;D=F(z,h.lineThickness)}for(e=!1;p<r.length;p++)if(m=r[p].x.getTime?r[p].x.getTime():r[p].x,!(m<a.axisX.dataInfo.viewPortMin||m>a.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<r.length-1&&(v!==(r[p].lineColor||w)||z!==(r[p].lineDashType||h.lineDashType))&&(v=r[p].lineColor||w,q[q.length-1].newStrokeStyle=v,c.setLineDash&&(r[p].lineDashType?(z=r[p].lineDashType,q[q.length-1].newLineDashArray=F(z,h.lineThickness)):(z=h.lineDashType,q[q.length-1].newLineDashArray=D)));if(0!==r[p].markerSize&&(0< r[p].markerSize||0<h.markerSize)){var J=h.getMarkerProperties(p,m,e,c);g.push(J);var S=P(B);x&&g.push({x:m,y:e,ctx:d,type:J.type,size:J.size,color:S,borderColor:S,borderThickness:J.borderThickness});J=h.getMarkerProperties(p,m,t,c);g.push(J);S=P(B);x&&g.push({x:m,y:t,ctx:d,type:J.type,size:J.size,color:S,borderColor:S,borderThickness:J.borderThickness})}if(r[p].indexLabel||h.indexLabel||r[p].indexLabelFormatter||h.indexLabelFormatter)this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:r[p], dataSeries:h,indexKeyword:0,point:{x:m,y:e},direction:r[p].y[0]<=r[p].y[1]?-1:1,color:u}),this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:r[p],dataSeries:h,indexKeyword:1,point:{x:m,y:t},direction:r[p].y[0]<=r[p].y[1]?1:-1,color:u});e=!1}else 0<p&&!e&&(h.connectNullData?c.setLineDash&&(0<q.length&&(h.options.nullDataLineDashType||!r[p-1].lineDashType))&&(q[q.length-1].newLineDashArray=A,z=h.nullDataLineDashType):(f(D,w),q=[],s=[])),e=!0;f(D,w);ea.drawMarkers(g)}}x&&(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:L.xClipAnimation,easingFunction:L.easing.linear, animationBase:0}}};s.prototype.renderWaterfall=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,b=x?this._preRenderCtx:f;if(!(0>=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&&n<k)&&(n=Math.max(this.dataPointWidth? this.dataPointWidth:-Infinity,k));m<k&&(m=k);m>n&&(m=n);b.save();x&&this._eventManager.ghostCtx.save();b.beginPath();b.rect(g.x1,g.y1,g.width,g.height);b.clip();x&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var e=0;e<a.dataSeriesIndexes.length;e++){var t=a.dataSeriesIndexes[e],q=this.data[t],s=q.dataPoints,d=q._colorSet[0];q.risingColor=q.options.risingColor?q.options.risingColor:d;q.fallingColor=q.options.fallingColor? q.options.fallingColor:"#e40a0a";var u="number"===typeof q.options.lineThickness?Math.round(q.lineThickness):1,w=1===Math.round(u)%2?-0.5:0;if(0<s.length)for(var v=5<m&&q.bevelEnabled?!0:!1,y=!1,z=null,A=null,k=0;k<s.length;k++)if(s[k].getTime?r=s[k].x.getTime():r=s[k].x,"number"!==typeof s[k].y){if(0<k&&!y&&q.connectNullData)var B=q.options.nullDataLineDashType||!s[k-1].lineDashType?q.nullDataLineDashType:s[k-1].lineDashType;y=!0}else{l=a.axisX.convertValueToPixel(r);n=0===q.dataPointEOs[k].cumulativeSum? p:a.axisY.convertValueToPixel(q.dataPointEOs[k].cumulativeSum);h=0===q.dataPointEOs[k].cumulativeSumYStartValue?p:a.axisY.convertValueToPixel(q.dataPointEOs[k].cumulativeSumYStartValue);l=a.axisX.reversed?l+a.plotType.totalDataSeries*m/2-(a.previousDataSeriesCount+e)*m<<0:l-a.plotType.totalDataSeries*m/2+(a.previousDataSeriesCount+e)*m<<0;var J=a.axisX.reversed?l-m<<0:l+m<<0;n>h&&(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 S=s[k].color?s[k].color:-1<s[k].y?q.risingColor:q.fallingColor;W(b,l,n,J,h,S,0,S,v,v,!1,!1,q.fillOpacity);d=P(d);x&&W(this._eventManager.ghostCtx,l,n,J,h,d,0,null,!1,!1,!1,!1);var Y,S=l;Y="undefined"!==typeof s[k].isIntermediateSum&&!0===s[k].isIntermediateSum||"undefined"!==typeof s[k].isCumulativeSum&&!0===s[k].isCumulativeSum?-1<s[k].y?n:h:-1<s[k].y?h:n;0<k&&z&&(!y||q.connectNullData)&&(y&&b.setLineDash&&b.setLineDash(F(B,u)),b.beginPath(), b.moveTo(z,A-w),b.lineTo(S,Y-w),0<u&&b.stroke(),x&&(c.beginPath(),c.moveTo(z,A-w),c.lineTo(S,Y-w),0<u&&c.stroke()));y=!1;z=J;A=-1<s[k].y?n:h;S=s[k].lineDashType?s[k].lineDashType:q.options.lineDashType?q.options.lineDashType:"shortDash";b.strokeStyle=s[k].lineColor?s[k].lineColor:q.options.lineColor?q.options.lineColor:"#9e9e9e";b.lineWidth=u;b.setLineDash&&(S=F(S,u),b.setLineDash(S));(s[k].indexLabel||q.indexLabel||s[k].indexLabelFormatter||q.indexLabelFormatter)&&this._indexLabels.push({chartType:"waterfall", dataPoint:s[k],dataSeries:q,point:{x:l+(J-l)/2,y:0<=s[k].y?n:h},direction:0>s[k].y===a.axisY.reversed?1:-1,bounds:{x1:l,y1:Math.min(n,h),x2:J,y2:Math.max(n,h)},color:d})}}x&&(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:L.fadeInAnimation,easingFunction:L.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(!x){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()}};s.prototype.renderPie=function(a){function f(){if(h&&r){for(var a=0,b=0,c=0,d=0,f=0;f<r.length;f++){var g=r[f],k=h.dataPointIds[f];e[f].id=k;e[f].objectType="dataPoint";e[f].dataPointIndex=f;e[f].dataSeriesIndex=0;var l=e[f],p= {percent:null,total:null},t=null,p=n.getPercentAndTotal(h,g);if(h.indexLabelFormatter||g.indexLabelFormatter)t={chart:n.options,dataSeries:h,dataPoint:g,total:p.total,percent:p.percent};p=g.indexLabelFormatter?g.indexLabelFormatter(t):g.indexLabel?n.replaceKeywordsWithValue(g.indexLabel,g,h,f):h.indexLabelFormatter?h.indexLabelFormatter(t):h.indexLabel?n.replaceKeywordsWithValue(h.indexLabel,g,h,f):g.label?g.label:"";n._eventManager.objectMap[k]=l;l.center={x:v.x,y:v.y};l.y=g.y;l.radius=A;l.percentInnerRadius= L;l.indexLabelText=p;l.indexLabelPlacement=h.indexLabelPlacement;l.indexLabelLineColor=g.indexLabelLineColor?g.indexLabelLineColor:h.options.indexLabelLineColor?h.options.indexLabelLineColor:g.color?g.color:h._colorSet[f%h._colorSet.length];l.indexLabelLineThickness=w(g.indexLabelLineThickness)?h.indexLabelLineThickness:g.indexLabelLineThickness;l.indexLabelLineDashType=g.indexLabelLineDashType?g.indexLabelLineDashType:h.indexLabelLineDashType;l.indexLabelFontColor=g.indexLabelFontColor?g.indexLabelFontColor: h.indexLabelFontColor;l.indexLabelFontStyle=g.indexLabelFontStyle?g.indexLabelFontStyle:h.indexLabelFontStyle;l.indexLabelFontWeight=g.indexLabelFontWeight?g.indexLabelFontWeight:h.indexLabelFontWeight;l.indexLabelFontSize=w(g.indexLabelFontSize)?h.indexLabelFontSize:g.indexLabelFontSize;l.indexLabelFontFamily=g.indexLabelFontFamily?g.indexLabelFontFamily:h.indexLabelFontFamily;l.indexLabelBackgroundColor=g.indexLabelBackgroundColor?g.indexLabelBackgroundColor:h.options.indexLabelBackgroundColor? h.options.indexLabelBackgroundColor:h.indexLabelBackgroundColor;l.indexLabelMaxWidth=g.indexLabelMaxWidth?g.indexLabelMaxWidth:h.indexLabelMaxWidth?h.indexLabelMaxWidth:0.33*m.width;l.indexLabelWrap="undefined"!==typeof g.indexLabelWrap?g.indexLabelWrap:h.indexLabelWrap;l.startAngle=0===f?h.startAngle?h.startAngle/180*Math.PI:0:e[f-1].endAngle;l.startAngle=(l.startAngle+2*Math.PI)%(2*Math.PI);l.endAngle=l.startAngle+2*Math.PI/y*Math.abs(g.y);g=(l.endAngle+l.startAngle)/2;g=(g+2*Math.PI)%(2*Math.PI); l.midAngle=g;if(l.midAngle>Math.PI/2-u&&l.midAngle<Math.PI/2+u){if(0===a||e[c].midAngle>l.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-u&&l.midAngle<3*Math.PI/2+u){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 ja(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;f<r.length;f++)l=e[(c+f)%r.length],1<a&&(l.midAngle>Math.PI/2-u&&l.midAngle<Math.PI/2+u)&&(g<=a/2&&!p?(l.hemisphere="right",g++):(l.hemisphere="left",p=!0));p=!1;for(f=0;f<r.length;f++)l=e[(d+f)%r.length],1<b&&(l.midAngle>3*Math.PI/2-u&&l.midAngle<3*Math.PI/2+u)&&(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;b<r.length;b++){var c=e[b].startAngle,d=e[b].endAngle;if(d>c){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-9<Math.abs(e[b].center.x-(v.x+f))||1E-9<Math.abs(e[b].center.y-(v.y+g)))e[b].center.x=v.x+f*a,e[b].center.y=v.y+g*a,k=!0}else if(0<Math.abs(e[b].center.x- v.x)||0<Math.abs(e[b].center.y-v.y))e[b].center.x=v.x+f*(1-a),e[b].center.y=v.y+g*(1-a),k=!0;k&&(f={},f.dataSeries=h,f.dataPoint=h.dataPoints[b],f.index=b,n.toolTip.highlightObjects([f]));qa(n.plotArea.ctx,e[b].center,e[b].radius,r[b].color?r[b].color:h._colorSet[b%h._colorSet.length],h.type,c,d,h.fillOpacity,e[b].percentInnerRadius)}}a=n.plotArea.ctx;a.save();a.fillStyle="black";a.strokeStyle="grey";a.textBaseline="middle";a.lineJoin="round";for(b=b=0;b<r.length;b++)c=e[b],c.indexLabelText&&(c.indexLabelTextBlock.y-= c.indexLabelTextBlock.height/2,d=0,d="left"===c.hemisphere?"inside"!==h.indexLabelPlacement?-(c.indexLabelTextBlock.width+p):-c.indexLabelTextBlock.width/2:"inside"!==h.indexLabelPlacement?p:-c.indexLabelTextBlock.width/2,c.indexLabelTextBlock.x+=d,c.indexLabelTextBlock.render(!0),c.indexLabelTextBlock.x-=d,c.indexLabelTextBlock.y+=c.indexLabelTextBlock.height/2,"inside"!==c.indexLabelPlacement&&0<c.indexLabelLineThickness&&(d=c.center.x+A*Math.cos(c.midAngle),f=c.center.y+A*Math.sin(c.midAngle), a.strokeStyle=c.indexLabelLineColor,a.lineWidth=c.indexLabelLineThickness,a.setLineDash&&a.setLineDash(F(c.indexLabelLineDashType,c.indexLabelLineThickness)),a.beginPath(),a.moveTo(d,f),a.lineTo(c.indexLabelTextBlock.x,c.indexLabelTextBlock.y),a.lineTo(c.indexLabelTextBlock.x+("left"===c.hemisphere?-p:p),c.indexLabelTextBlock.y),a.stroke()),a.lineJoin="miter");a.save()}function c(a,b){var c=0,c=a.indexLabelTextBlock.y-a.indexLabelTextBlock.height/2,d=a.indexLabelTextBlock.y+a.indexLabelTextBlock.height/ 2,e=b.indexLabelTextBlock.y-b.indexLabelTextBlock.height/2,f=b.indexLabelTextBlock.y+b.indexLabelTextBlock.height/2;return c=b.indexLabelTextBlock.y>a.indexLabelTextBlock.y?e-d:c-f}function d(a){for(var b=null,d=1;d<r.length;d++)if(b=(a+d+e.length)%e.length,e[b].hemisphere!==e[a].hemisphere){b=null;break}else if(e[b].indexLabelText&&b!==a&&(0>c(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(1E3<f)return 0;b=b||0;var h=0,k=v.y-1*q,m=v.y+1*q;if(0<=a&&a<r.length){var l=e[a];if(0>b&&l.indexLabelTextBlock.y<k||0<b&&l.indexLabelTextBlock.y>m)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+b<k&&(b=-(k-(l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2+b))):l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2<k&&l.indexLabelTextBlock.y+ l.indexLabelTextBlock.height/2+b>m&&(b=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+b-m);b=l.indexLabelTextBlock.y+b;k=0;k="right"===l.hemisphere?v.x+Math.sqrt(Math.pow(q,2)-Math.pow(b-v.y,2)):v.x-Math.sqrt(Math.pow(q,2)-Math.pow(b-v.y,2));p=v.x+A*Math.cos(l.midAngle);n=v.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=n<p?b-l.indexLabelTextBlock.y:0;k=null;for(m=1;m<r.length;m++)if(k=(a-m+e.length)%e.length,e[k].hemisphere!== e[a].hemisphere){k=null;break}else if(e[k].indexLabelText&&e[k].hemisphere===e[a].hemisphere&&k!==a&&(0>c(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<t&&(k=-p,m=g(m,k,f+1),+m.toFixed(x)> +k.toFixed(x)&&(h=b>t?-(b-t):-(p-(m-k)))))):0<b&&(m="right"===l.hemisphere?n:p,h=b,null!==m&&(p=b,b=e[m].indexLabelTextBlock.y-e[m].indexLabelTextBlock.height/2-(l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2),b-p<t&&(k=p,m=g(m,k,f+1),+m.toFixed(x)<+k.toFixed(x)&&(h=b>t?b-t:p-(k-m)))));h&&(f=l.indexLabelTextBlock.y+h,b=0,b="right"===l.hemisphere?v.x+Math.sqrt(Math.pow(q,2)-Math.pow(f-v.y,2)):v.x-Math.sqrt(Math.pow(q,2)-Math.pow(f-v.y,2)),l.midAngle>Math.PI/2-u&&l.midAngle<Math.PI/2+u?(k=(a- 1+e.length)%e.length,k=e[k],a=e[(a+1+e.length)%e.length],"left"===l.hemisphere&&"right"===k.hemisphere&&b>k.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===l.hemisphere&&("left"===a.hemisphere&&b<a.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x+15)):l.midAngle>3*Math.PI/2-u&&l.midAngle<3*Math.PI/2+u&&(k=(a-1+e.length)%e.length,k=e[k],a=e[(a+1+e.length)%e.length],"right"===l.hemisphere&&"left"===k.hemisphere&&b<k.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x+15:"left"===l.hemisphere&& ("right"===a.hemisphere&&b>a.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),l.indexLabelTextBlock.y=f,l.indexLabelTextBlock.x=b,l.indexLabelAngle=Math.atan2(l.indexLabelTextBlock.y-v.y,l.indexLabelTextBlock.x-v.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||0<f);b++){if(h.radius||!h.radius&&"undefined"!==typeof h.innerRadius&&null!==h.innerRadius&&A-f<=B)k=!1;k&&(A-= f);f=0;if("inside"!==h.indexLabelPlacement){q=A*s;for(a=0;a<r.length;a++){var l=e[a];l.indexLabelTextBlock.x=v.x+q*Math.cos(l.midAngle);l.indexLabelTextBlock.y=v.y+q*Math.sin(l.midAngle);l.indexLabelAngle=l.midAngle;l.radius=A;l.percentInnerRadius=L}for(var u,w,a=0;a<r.length;a++){var l=e[a],y=d(a);if(null!==y){u=e[a];w=e[y];var z=0,z=c(u,w)-t;if(0>z){for(var D=w=0,F=0;F<r.length;F++)F!==a&&e[F].hemisphere===l.hemisphere&&(e[F].indexLabelTextBlock.y<l.indexLabelTextBlock.y?w++:D++);w=z/(w+D||1)*D; var D=-1*(z-w),Ca=F=0;"right"===l.hemisphere?(F=g(a,w),D=-1*(z-F),Ca=g(y,D),+Ca.toFixed(x)<+D.toFixed(x)&&+F.toFixed(x)<=+w.toFixed(x)&&g(a,-(D-Ca))):(F=g(y,w),D=-1*(z-F),Ca=g(a,D),+Ca.toFixed(x)<+D.toFixed(x)&&+F.toFixed(x)<=+w.toFixed(x)&&g(y,-(D-Ca)))}}}}else for(a=0;a<r.length;a++)l=e[a],q="pie"===h.type?0.7*A:0.8*A,y=v.x+q*Math.cos(l.midAngle),w=v.y+q*Math.sin(l.midAngle),l.indexLabelTextBlock.x=y,l.indexLabelTextBlock.y=w;for(a=0;a<r.length;a++)if(l=e[a],y=l.indexLabelTextBlock.measureText(), 0!==y.height&&0!==y.width)y=y=0,"right"===l.hemisphere?(y=m.x2-(l.indexLabelTextBlock.x+l.indexLabelTextBlock.width+p),y*=-1):y=m.x1-(l.indexLabelTextBlock.x-l.indexLabelTextBlock.width-p),0<y&&(!k&&l.indexLabelText&&(w="right"===l.hemisphere?m.x2-l.indexLabelTextBlock.x:l.indexLabelTextBlock.x-m.x1,0.3*l.indexLabelTextBlock.maxWidth>w?l.indexLabelText="":l.indexLabelTextBlock.maxWidth=0.85*w,0.3*l.indexLabelTextBlock.maxWidth<w&&(l.indexLabelTextBlock.x-="right"===l.hemisphere?2:-2)),Math.abs(l.indexLabelTextBlock.y- l.indexLabelTextBlock.height/2-v.y)<A||Math.abs(l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2-v.y)<A)&&(y/=Math.abs(Math.cos(l.indexLabelAngle)),9<y&&(y*=0.3),y>f&&(f=y)),y=y=0,0<l.indexLabelAngle&&l.indexLabelAngle<Math.PI?(y=m.y2-(l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2+5),y*=-1):y=m.y1-(l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2-5),0<y&&(!k&&l.indexLabelText&&(w=0<l.indexLabelAngle&&l.indexLabelAngle<Math.PI?-1:1,0===g(a,y*w)&&g(a,2*w)),Math.abs(l.indexLabelTextBlock.x- v.x)<A&&(y/=Math.abs(Math.sin(l.indexLabelAngle)),9<y&&(y*=0.3),y>f&&(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;b<d.length;b++)if(c=d[b],f<0.7*a)f+=c.indexLabelTextBlock.height,c.indexLabelTextBlock.text="",c.indexLabelText="",c.indexLabelTextBlock.measureText();else break};(function(){for(var a=-1,b=-1,f=0,g=!1,k=0;k<r.length;k++)if(g=!1,u=e[k],u.indexLabelText){var h=d(k);if(null!==h){var l=e[h];z=0; z=c(u,l);var m;if(m=0>z){m=u.indexLabelTextBlock.x;var n=u.indexLabelTextBlock.y-u.indexLabelTextBlock.height/2,t=u.indexLabelTextBlock.y+u.indexLabelTextBlock.height/2,q=l.indexLabelTextBlock.y-l.indexLabelTextBlock.height/2,s=l.indexLabelTextBlock.x+l.indexLabelTextBlock.width,w=l.indexLabelTextBlock.y+l.indexLabelTextBlock.height/2;m=u.indexLabelTextBlock.x+u.indexLabelTextBlock.width<l.indexLabelTextBlock.x-p||m>s+p||n>w+p||t<q-p?!1:!0}m?(0>a&&(a=k),h!==a&&(b=h,f+=-z),0===k%Math.max(r.length/ 10,3)&&(g=!0)):g=!0;g&&(0<f&&0<=a&&0<=b)&&(K(f,a,b),b=a=-1,f=0)}}0<f&&K(f,a,b)})()}}function l(){n.plotArea.layoutManager.reset();n.title&&(n.title.dockInsidePlotArea||"center"===n.title.horizontalAlign&&"center"===n.title.verticalAlign)&&n.title.render();if(n.subtitles)for(var a=0;a<n.subtitles.length;a++){var b=n.subtitles[a];(b.dockInsidePlotArea||"center"===b.horizontalAlign&&"center"===b.verticalAlign)&&b.render()}n.legend&&(n.legend.dockInsidePlotArea||"center"===n.legend.horizontalAlign&&"center"=== n.legend.verticalAlign)&&n.legend.render();na.fBWm&&na.fBWm(n)}var n=this;if(!(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,u=20/180*Math.PI,x=6,v={x:(m.x2+m.x1)/2,y:(m.y2+m.y1)/2},y=0;a=!1;for(var z=0;z<r.length;z++)y+=Math.abs(r[z].y),!a&&("undefined"!==typeof r[z].indexLabel&&null!==r[z].indexLabel&&0<r[z].indexLabel.toString().length)&&(a=!0),!a&&("undefined"!==typeof r[z].label&&null!==r[z].label&&0<r[z].label.toString().length)&& (a=!0);if(0!==y){a=a||"undefined"!==typeof h.indexLabel&&null!==h.indexLabel&&0<h.indexLabel.toString().length;var A="inside"!==h.indexLabelPlacement&&a?0.75*Math.min(m.width,m.height)/2:0.92*Math.min(m.width,m.height)/2;h.radius&&(A=J(h.radius,A));var B="undefined"!==typeof h.innerRadius&&null!==h.innerRadius?J(h.innerRadius,A):0.7*A;h.radius=A;"doughnut"===h.type&&(h.innerRadius=B);var L=Math.min(B/A,(A-1)/A);this.pieDoughnutClickHandler=function(a){n.isAnimating||!w(a.dataSeries.explodeOnClick)&& !a.dataSeries.explodeOnClick||(a=a.dataPoint,a.exploded=a.exploded?!1:!0,1<this.dataPoints.length&&n._animator.animate(0,500,function(a){b(a);l()}))};f();k();k();k();k();this.disableToolTip=!0;this._animator.animate(0,this.animatedRender?this.animationDuration:0,function(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);a=e[0].startAngle+2*Math.PI*a;for(b=0;b<r.length;b++){var c=0===b?e[b].startAngle:d,d=c+(e[b].endAngle- e[b].startAngle),f=!1;d>a&&(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 ua=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())};s.prototype.renderFunnel=function(a){function f(){for(var a=0,b=[],c=0;c<v.length;c++){if("undefined"===typeof v[c].y)return-1;v[c].y="number"===typeof v[c].y?v[c].y:0;a+=Math.abs(v[c].y)}if(0===a)return-1;for(c= b[0]=0;c<v.length;c++)b.push(Math.abs(v[c].y)*O/a);return b}function b(){var a=U,b=V,c=W,d=K,e,f;e=S;f=Y-N;headArea=(f-e)*(b-a+(d-c))/2;headArea=Math.abs(headArea);c=K-W;e=f-e;f=c*(f-Y);f=Math.abs(f);f=headArea+f;for(var d=[],g=0,k=0;k<v.length;k++){if("undefined"===typeof v[k].y)return-1;v[k].y="number"===typeof v[k].y?v[k].y:0;g+=Math.abs(v[k].y)}if(0===g)return-1;for(var h=d[0]=0,l=0,m,b=b-a,n=!1,k=0;k<v.length;k++)a=Math.abs(v[k].y)*f/g,n?h=0==Number(c.toFixed(3))?0:a/c:(sqrt=ba*ba*b*b-4*Math.abs(ba)* a,0>sqrt?(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(ba)*b-Math.sqrt(sqrt))/2,m=b-2*h/Math.abs(ba),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(u&&v){for(var a,b,c,d,f,g,h,k,l,m,n,p,r,t,q=[],w=[],y={percent:null,total:null},A=null,z=0;z<v.length;z++)t=M[z],t="undefined"!==typeof t.x5?(t.y2+t.y4)/2:(t.y2+t.y3)/2,t=e(t).x2+1,q[z]=J-t-R;t=0.5*R;for(var z=0,D=v.length-1;z<v.length||0<=D;z++,D--){b= u.reversed?v[D]:v[z];a=b.color?b.color:u.reversed?u._colorSet[(v.length-1-z)%u._colorSet.length]:u._colorSet[z%u._colorSet.length];c=b.indexLabelPlacement||u.indexLabelPlacement||"outside";d=b.indexLabelBackgroundColor||u.indexLabelBackgroundColor||(x?"transparent":null);f=b.indexLabelFontColor||u.indexLabelFontColor||"#979797";g=b.indexLabelFontSize||u.indexLabelFontSize||12;h=b.indexLabelFontStyle||u.indexLabelFontStyle||"normal";k=b.indexLabelFontFamily||u.indexLabelFontFamily||"arial";l=b.indexLabelFontWeight|| u.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||u.options.indexLabelLineColor||a;m="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof u.indexLabelLineThickness?u.indexLabelLineThickness:2;n=b.indexLabelLineDashType||u.indexLabelLineDashType||"solid";p="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof u.indexLabelWrap?u.indexLabelWrap:!0;r=u.dataPointIds[z];s._eventManager.objectMap[r]={id:r,objectType:"dataPoint",dataPointIndex:z, dataSeriesIndex:0,funnelSection:M[u.reversed?v.length-1-z:z]};"inside"===u.indexLabelPlacement&&(q[z]=z!==da?u.reversed?M[z].x2-M[z].x1:M[z].x3-M[z].x4:M[z].x3-M[z].x6,20>q[z]&&(q[z]=z!==da?u.reversed?M[z].x3-M[z].x4:M[z].x2-M[z].x1:M[z].x2-M[z].x1,q[z]/=2));r=b.indexLabelMaxWidth||u.indexLabelMaxWidth||q[z];if(r>q[z]||0>r)r=q[z];w[z]="inside"===u.indexLabelPlacement?M[z].height:!1;y=s.getPercentAndTotal(u,b);if(u.indexLabelFormatter||b.indexLabelFormatter)A={chart:s.options,dataSeries:u,dataPoint:b, total:y.total,percent:y.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(A):b.indexLabel?s.replaceKeywordsWithValue(b.indexLabel,b,u,z):u.indexLabelFormatter?u.indexLabelFormatter(A):u.indexLabel?s.replaceKeywordsWithValue(u.indexLabel,b,u,z):b.label?b.label:"";0>=m&&(m=0);1E3>r&&1E3-r<t&&(r+=1E3-r);$.roundRect||Aa($);c=new ja($,{fontSize:g,fontFamily:k,fontColor:f,fontStyle:h,fontWeight:l,horizontalAlign:c,backgroundColor:d,maxWidth:r,maxHeight:!1===w[z]?p?4.28571429*g:1.5*g:w[z],text:b,padding:ea}); c.measureText();H.push({textBlock:c,id:u.reversed?D:z,isDirty:!1,lineColor:a,lineThickness:m,lineDashType:n,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<c.maxWidth?c.width:c.maxWidth})}}}function d(){var a,b,c,d,e,f=[];e=!1;c=0;for(var g=J-V-R/2,g=u.options.indexLabelMaxWidth?u.indexLabelMaxWidth>g?g:u.indexLabelMaxWidth:g,h=H.length-1;0<=h;h--){dataPoint=v[H[h].id];c=H[h];d=c.textBlock;b=(a=m(h)<M.length?H[m(h)]:null)?a.textBlock:null;c=c.height;a&&d.y+c+ea>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=M[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<H[h].textBlock.maxHeight?H[h].textBlock.height:H[h].textBlock.maxHeight,e=H[h].textBlock.width<H[h].textBlock.maxWidth?H[h].textBlock.width:H[h].textBlock.maxWidth,H[h].height=c,H[h].width=e,c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,H[h].textBlock.y=c-H[h].height/2,u.reversed?(H[h].textBlock.y+H[h].height> Q+z&&(H[h].textBlock.y=Q+z-H[h].height),H[h].textBlock.y<Z-z&&(H[h].textBlock.y=Z-z)):(H[h].textBlock.y<Q-z&&(H[h].textBlock.y=Q-z),H[h].textBlock.y+H[h].height>Z+z&&(H[h].textBlock.y=Z+z-H[h].height))}function g(){var a,b,c,d;if("inside"!==u.indexLabelPlacement)for(var f=0;f<M.length;f++)0==H[f].textBlock.text.length?H[f].isDirty=!0:(a=M[f],c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=u.reversed?"undefined"!==typeof a.x5?c>T?e(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5? c<T?e(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,H[f].textBlock.x=b+R,H[f].textBlock.y=c-H[f].height/2,u.reversed?(H[f].textBlock.y+H[f].height>Q+z&&(H[f].textBlock.y=Q+z-H[f].height),H[f].textBlock.y<Z-z&&(H[f].textBlock.y=Z-z)):(H[f].textBlock.y<Q-z&&(H[f].textBlock.y=Q-z),H[f].textBlock.y+H[f].height>Z+z&&(H[f].textBlock.y=Z+z-H[f].height)));else for(f=0;f<M.length;f++)0==H[f].textBlock.text.length?H[f].isDirty=!0:(a=M[f],b=a.height,c=H[f].height,d=H[f].width,b>=c?(b=f!=da?(a.x4+a.x3)/2-d/2:(a.x5+ a.x4)/2-d/2,c=f!=da?(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<d&&(f.y-=d),d;d+=a(e,-(c-d));0<d&&(f.y-=d);return d}e=m(b);d=l(b,e);if(d>=c)return f.y+=c,c;if(b==M.length-1)return 0<d&&(f.y+=d),d;d+=a(e,c-d);0<d&&(f.y+=d);return d}function b(){var a,d,e,f,g=0,h;f=(Y-S+2*z)/n;h=n;for(var k,l=1;l< h;l++){e=l*f;for(var r=H.length-1;0<=r;r--)!H[r].isDirty&&(H[r].textBlock.y<e&&H[r].textBlock.y+H[r].height>e)&&(k=m(r),!(k>=H.length-1)&&H[r].textBlock.y+H[r].height+ea>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=M.length-1;0<k;k--)if(!H[k].isDirty){e=p(k);if(0>e&&(e=0,H[e].isDirty))break;if(H[k].textBlock.y<H[e].textBlock.y+H[e].height){d=d||k;f=k;for(h=0;H[f].textBlock.y<H[e].textBlock.y+H[e].height+ea;){a=a||H[f].textBlock.y+ H[f].height;h+=H[f].height;h+=ea;f=e;if(0>=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(M[d]);e.sort(function(a,b){return a.height-b.height});for(d=0;d<e.length;d++)if(b=e[d],f<a)g++,f+=H[b.id].height+ea,H[b.id].textBlock.text="",H[b.id].indexLabelText="",H[b.id].isDirty=!0,H[b.id].textBlock.measureText();else break;return g}for(var d,e,f, g,h,k,n=1,r=0;r<2*n;r++){for(var t=H.length-1;0<=t&&!(previousTextBlock=(previousLabel=0<=p(t)?H[p(t)]:null)?previousLabel.textBlock:null,f=H[t],g=f.textBlock,k=(h=m(t)<M.length?H[m(t)]:null)?h.textBlock:null,d=+f.height.toFixed(6),e=+g.y.toFixed(6),!f.isDirty&&(h&&e+d+ea>+k.y.toFixed(6))&&(d=g.y+d+ea-k.y,e=a(t,-d),e<d&&(0<e&&(d-=e),e=a(m(t),d),e!=d)));t--);b()}}function l(a,b){return(b<M.length?H[b].textBlock.y:u.reversed?Q+z:Z+z)-(0>a?u.reversed?Z-z:Q-z:H[a].textBlock.y+H[a].height+ea)}function n(a, b,c){function d(b,c,f,h){ga=!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=u;l.dataPoint=u.reversed?u.dataPoints[v.length-1-b]:u.dataPoints[b];l.index=u.reversed?v.length-1-b:b;a.toolTip.highlightObjects([l]);for(l=0;l<M.length;l++)ua(c,M[l],u.fillOpacity);q(c);A&&("inside"!==u.indexLabelPlacement?r(c):g(),t(c));1==k?(ga=!1,h.cancelRequestAnimFrame.call(window,n)):n=h.requestAnimFrame.call(window, function(){d(b,c,f,h)})}function e(b){b.clearRect(y.x1,y.y1,y.x2-y.x1,y.y2-y.y1);b.fillStyle=a.backgroundColor;b.fillRect(y.x1,y.y1,y.width,y.height)}var f=[],k,l,m=z,n,p,s=[];-1!==b&&(0<=aa.indexOf(b)?(l=aa.indexOf(b),aa.splice(l,1)):(aa.push(b),aa=aa.sort(function(a,b){return a-b})));if(0===aa.length)f=ia;else{l=z*(1!=aa.length||0!=aa[0]&&aa[0]!=M.length-1?2:1)/h();for(var w=0;w<M.length;w++){if(1==aa.length&&0==aa[0]){if(0===w){f.push(ia[w]);k=m;continue}}else 0===w&&(k=-1*m);f.push(ia[w]+k);if(0<= aa.indexOf(w)||w<M.length&&0<=aa.indexOf(w+1))k+=l}}p=function(){for(var a=[],b=0;b<M.length;b++)a.push(f[b]-M[b].y1);return a}();c={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,d){return L.easing.easeOutQuart(a,b,c,d)},changeSection:function(a){for(var b,c,d=0;d<M.length;d++)b=p[d],c=M[d],newY=b*a,"undefined"===typeof s[d]&&(s[d]=0),0>s&&(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;b<M.length-1;b++)(0<=aa.indexOf(b)||0<=aa.indexOf(b+1))&&a++;return a}function r(a){for(var b,c,d,f,g=0;g<M.length;g++)f=1===H[g].lineThickness%2?0.5:0,c=((M[g].y2+M[g].y4)/2<<0)+f,b=e(c).x2-1,d=H[g].textBlock.x,f=(H[g].textBlock.y+H[g].height/2<<0)+f,H[g].isDirty||0==H[g].lineThickness||(a.strokeStyle=H[g].lineColor,a.lineWidth=H[g].lineThickness,a.setLineDash&&a.setLineDash(F(H[g].lineDashType,H[g].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(d,f), a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&H[a].isDirty;a--);return a}function m(a){for(a+=1;a<=M.length&&a!=M.length&&H[a].isDirty;a++);return a}function e(a){for(var b,c=0;c<v.length;c++)if(M[c].y1<a&&M[c].y4>a){b=M[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function t(a){for(var b=0;b<M.length;b++)H[b].isDirty||(a&&(H[b].textBlock.ctx=a),H[b].textBlock.render(!0))}function q(a){s.plotArea.layoutManager.reset(); a.roundRect||Aa(a);s.title&&(s.title.dockInsidePlotArea||"center"===s.title.horizontalAlign&&"center"===s.title.verticalAlign)&&(s.title.ctx=a,s.title.render());if(s.subtitles)for(var b=0;b<s.subtitles.length;b++){var c=s.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)s.subtitles.ctx=a,c.render()}s.legend&&(s.legend.dockInsidePlotArea||"center"===s.legend.horizontalAlign&&"center"===s.legend.verticalAlign)&&(s.legend.ctx=a,s.legend.render());na.fNg&& na.fNg(s)}var s=this;if(!(0>=a.dataSeriesIndexes.length)){for(var u=this.data[a.dataSeriesIndexes[0]],v=u.dataPoints,y=this.plotArea,z=0.025*y.width,D=0.01*y.width,A=!1,B=0;B<v.length;B++)if(!A&&("undefined"!==typeof v[B].indexLabel&&null!==v[B].indexLabel&&0<v[B].indexLabel.toString().length)&&(A=!0),!A&&("undefined"!==typeof v[B].label&&null!==v[B].label&&0<v[B].label.toString().length)&&(A=!0),!A&&"function"===typeof u.indexLabelFormatter||"function"===typeof v[B].indexLabelFormatter)A=!0;A=A|| "undefined"!==typeof u.indexLabel&&null!==u.indexLabel&&0<u.indexLabel.toString().length;"inside"!==u.indexLabelPlacement&&A||(D=12.5*y.width/100);var B=y.x1+D,J=y.x2-D,S=y.y1+z,Y=y.y2-z,O=y.height-2*z,D=y.width,$=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=u.length&&(u.dataPoints&&u.visible)&&0!==v.length){var N,I,D=75*D/100,R=30*(J-D)/100;"funnel"===u.type?(N=u.neckHeight,I=u.neckWidth,"string"===typeof N&&N.match(/%$/)?(N=parseInt(N),N=N*O/100):N=parseInt(N),"string"===typeof I&&I.match(/%$/)? (I=parseInt(I),I=I*D/100):I=parseInt(I),N>O?N=O:0>=N&&(N=!0),I>D?I=D-0.5:0>=I&&(I=!0)):"pyramid"===u.type&&(I=N=!0,u.reversed=u.reversed?!1:!0);N=N?"number"===typeof N?N:0:0.35*O;I=I?"number"===typeof I?I:0:0.25*D;var P=B+D/2,U=B,V=B+D,Q=u.reversed?Y:S,W=P-I/2,K=P+I/2,T=u.reversed?S+N:Y-N,Z=u.reversed?S:Y,D=[],P=[],M=[],ha=[],X=S,da,ba=(T-Q)/(W-U),fa=-ba,B="area"===(u.valueRepresents?u.valueRepresents:"height")?b():f();if(-1!==B){if(u.reversed)for(ha.push(X),I=B.length-1;0<I;I--)X+=B[I],ha.push(X); else for(I=0;I<B.length;I++)X+=B[I],ha.push(X);if(u.reversed)for(I=0;I<B.length;I++)ha[I]<T?(D.push(W),P.push(K),da=I):(D.push((ha[I]-Q+ba*U)/ba),P.push((ha[I]-Q+fa*V)/fa));else for(I=0;I<B.length;I++)ha[I]<T?(D.push((ha[I]-Q+ba*U)/ba),P.push((ha[I]-Q+fa*V)/fa),da=I):(D.push(W),P.push(K));for(I=0;I<B.length-1;I++)X=u.reversed?v[v.length-1-I].color?v[v.length-1-I].color:u._colorSet[(v.length-1-I)%u._colorSet.length]:v[I].color?v[I].color:u._colorSet[I%u._colorSet.length],I===da?M.push({x1:D[I],y1:ha[I], x2:P[I],y2:ha[I],x3:K,y3:T,x4:P[I+1],y4:ha[I+1],x5:D[I+1],y5:ha[I+1],x6:W,y6:T,id:I,height:ha[I+1]-ha[I],color:X}):M.push({x1:D[I],y1:ha[I],x2:P[I],y2:ha[I],x3:P[I+1],y3:ha[I+1],x4:D[I+1],y4:ha[I+1],id:I,height:ha[I+1]-ha[I],color:X});var ea=2,H=[],ga=!1,aa=[],ia=[],ka=!1;for(I=0;I<v.length;I++)v[I].exploded&&(ka=!0,u.reversed?aa.push(v.length-1-I):aa.push(I));$.clearRect(y.x1,y.y1,y.width,y.height);$.fillStyle=s.backgroundColor;$.fillRect(y.x1,y.y1,y.width,y.height);for(I=0;I<M.length;I++)B=M[I], ua($,B,u.fillOpacity),ia.push(B.y1);q($);A&&u.visible&&(c(),g(),d(),"inside"!==u.indexLabelPlacement&&(k(),s.animationEnabled||r($)),s.animationEnabled||t());if(!A)for(I=0;I<v.length;I++)B=u.dataPointIds[I],D={id:B,objectType:"dataPoint",dataPointIndex:I,dataSeriesIndex:0,funnelSection:M[u.reversed?v.length-1-I:I]},s._eventManager.objectMap[B]=D;s.animationEnabled&&s.animatedRender?setTimeout(function(){ka&&n(s,-1);A&&(t(),"inside"!==u.indexLabelPlacement&&r($));a.targetCtx=null},s.animationDuration): ka?(n(s,-1,1),A&&(t(),"inside"!==u.indexLabelPlacement&&r($))):s.animationEnabled&&A&&(t(),"inside"!==u.indexLabelPlacement&&r($));this.funnelPyramidClickHandler=function(a){var b=-1;if(!ga&&!s.isAnimating&&(w(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=u.reversed?v.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===u.type||"pyramid"===u.type)u.reversed?v[v.length-1-a].exploded=v[v.length-1-a].exploded?!1:!0:v[a].exploded=v[a].exploded?!1:!0;n(s,b)}};return{source:$, dest:this.plotArea.ctx,animationCallback:L.fadeInAnimation,easingFunction:L.easing.easeInQuad,animationBase:0}}}}};s.prototype.animationRequestId=null;s.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();s.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame|| window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;s.prototype.set=function(a,f,b){b="undefined"===typeof b?!0:b;"options"===a?(this.options=f,b&&this.render()):s.base.set.call(this,a,f,b)};s.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var f=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+f);v(this.canvas,f,b)};s.prototype.print=function(){var a= this.exportChart({toDataURL:!0}),f=document.createElement("iframe");f.setAttribute("class","canvasjs-chart-print-frame");f.setAttribute("style","position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;");f.style.height=this.height+"px";this._canvasJSContainer.appendChild(f);var b=this,c=f.contentWindow||f.contentDocument.document||f.contentDocument;c.document.open();c.document.write('<!DOCTYPE HTML>\n<html><body style="margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;"><img src="'+ a+'"/><body/></html>');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(f)},1E3)},500)};s.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<a.dataPoints.length;i++)isNaN(a.dataPoints[i].y)|| (c+=a.dataPoints[i].y);d=isNaN(f.y)?0:100*(f.y/c)}return{percent:d,total:c}};s.prototype.replaceKeywordsWithValue=function(a,f,b,c,d){var g=this;d="undefined"===typeof d?0:d;if((0<=b.type.indexOf("stacked")||"pie"===b.type||"doughnut"===b.type||"funnel"===b.type||"pyramid"===b.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var k="#percent",l="#total",n=this.getPercentAndTotal(b,f),l=isNaN(n.total)?l:n.total,k=isNaN(n.percent)?k:n.percent;do{n="";if(b.percentFormatString)n=b.percentFormatString; else{var n="#,##0.",h=Math.max(Math.ceil(Math.log(1/Math.abs(k))/Math.LN10),2);if(isNaN(h)||!isFinite(h))h=2;for(var r=0;r<h;r++)n+="#";b.percentFormatString=n}a=a.replace("#percent",X(k,n,g._cultureInfo));a=a.replace("#total",X(l,b.yValueFormatString?b.yValueFormatString:"#,##0.########",g._cultureInfo))}while(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))}return a.replace(/\{.*?\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1, a.length-1);a=Da(a.slice(1,a.length-1));a=a.replace("#index",d);var h=null;try{var e=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);e&&0<e.length&&(h=Da(e[2]),a=Da(e[1]))}catch(k){}e=null;if("color"===a)return"waterfall"===b.type?f.color?f.color:-1<f.y?b.risingColor:b.fallingColor:"error"===b.type?b.color?b.color:b._colorSet[h%b._colorSet.length]:f.color?f.color:b.color?b.color:b._colorSet[c%b._colorSet.length];if(f.hasOwnProperty(a))e=f;else if(b.hasOwnProperty(a))e=b;else return"";e=e[a];null!==h&&(e=e[h]); if("x"===a)if("dateTime"===g.plotInfo.axisXValueType||"dateTime"===b.xValueType||f.x&&f.x.getTime){if(g.plotInfo.plotTypes[0].plotUnits[0].axisX&&!g.plotInfo.plotTypes[0].plotUnits[0].axisX.logarithmic)return ya(e,f.xValueFormatString?f.xValueFormatString:b.xValueFormatString?b.xValueFormatString:b.xValueFormatString=g.axisX&&g.axisX.autoValueFormatString?g.axisX.autoValueFormatString:"DD MMM YY",g._cultureInfo)}else return X(e,f.xValueFormatString?f.xValueFormatString:b.xValueFormatString?b.xValueFormatString: b.xValueFormatString="#,##0.########",g._cultureInfo);else return"y"===a?X(e,f.yValueFormatString?f.yValueFormatString:b.yValueFormatString?b.yValueFormatString:b.yValueFormatString="#,##0.########",g._cultureInfo):"z"===a?X(e,f.zValueFormatString?f.zValueFormatString:b.zValueFormatString?b.zValueFormatString:b.zValueFormatString="#,##0.########",g._cultureInfo):e})};ka(V,T);V.prototype.render=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,f=a.layoutManager.getFreeSpace(), b=null,c=0,d=0,g=0,k=0,l=this.markerMargin=this.chart.options.legend&&!w(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var n=[],h=[];"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",b=this.verticalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:f.width,k=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*f.height):"center"===this.verticalAlign&&(this.orientation="vertical",b=this.horizontalAlign, g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*f.width,k=this.maxHeight=null!==this.maxHeight?this.maxHeight:f.height);for(var r=[],p=0;p<this.dataSeries.length;p++){var m=this.dataSeries[p];if(m.dataPoints&&m.dataPoints.length)if("pie"!==m.type&&"doughnut"!==m.type&&"funnel"!==m.type&&"pyramid"!==m.type){var e=m.legendMarkerType=m.legendMarkerType?m.legendMarkerType:"line"!==m.type&&"stepLine"!==m.type&&"spline"!==m.type&&"scatter"!==m.type&&"bubble"!==m.type||!m.markerType?"error"===m.type&& m._linkedSeries?m._linkedSeries.legendMarkerType?m._linkedSeries.legendMarkerType:R.getDefaultLegendMarker(m._linkedSeries.type):R.getDefaultLegendMarker(m.type):m.markerType,t=m.legendText?m.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:m,dataPoint:null}):m.name,q=m.legendMarkerColor=m.legendMarkerColor?m.legendMarkerColor:m.markerColor?m.markerColor:"error"===m.type?w(m.whiskerColor)?m._colorSet[0]:m.whiskerColor:m._colorSet[0],s=m.markerSize|| "line"!==m.type&&"stepLine"!==m.type&&"spline"!==m.type?0.75*this.lineHeight:0,u=m.legendMarkerBorderColor?m.legendMarkerBorderColor:m.markerBorderColor,v=m.legendMarkerBorderThickness?m.legendMarkerBorderThickness:m.markerBorderThickness?Math.max(1,Math.round(0.2*s)):0;"error"===m.type&&r.push(q);t=this.chart.replaceKeywordsWithValue(t,m.dataPoints[0],m,p);e={markerType:e,markerColor:q,text:t,textBlock:null,chartType:m.type,markerSize:s,lineColor:m._colorSet[0],dataSeriesIndex:m.index,dataPointIndex:null, markerBorderColor:u,markerBorderThickness:v};n.push(e)}else for(var x=0;x<m.dataPoints.length;x++){var y=m.dataPoints[x],e=y.legendMarkerType?y.legendMarkerType:m.legendMarkerType?m.legendMarkerType:R.getDefaultLegendMarker(m.type),t=y.legendText?y.legendText:m.legendText?m.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:m,dataPoint:y}):y.name?y.name:"DataPoint: "+(x+1),q=y.legendMarkerColor?y.legendMarkerColor:m.legendMarkerColor?m.legendMarkerColor: y.color?y.color:m.color?m.color:m._colorSet[x%m._colorSet.length],s=0.75*this.lineHeight,u=y.legendMarkerBorderColor?y.legendMarkerBorderColor:m.legendMarkerBorderColor?m.legendMarkerBorderColor:y.markerBorderColor?y.markerBorderColor:m.markerBorderColor,v=y.legendMarkerBorderThickness?y.legendMarkerBorderThickness:m.legendMarkerBorderThickness?m.legendMarkerBorderThickness:y.markerBorderThickness||m.markerBorderThickness?Math.max(1,Math.round(0.2*s)):0,t=this.chart.replaceKeywordsWithValue(t,y,m, x),e={markerType:e,markerColor:q,text:t,textBlock:null,chartType:m.type,markerSize:s,dataSeriesIndex:p,dataPointIndex:x,markerBorderColor:u,markerBorderThickness:v};(y.showInLegend||m.showInLegend&&!1!==y.showInLegend)&&n.push(e)}}!0===this.reversed&&n.reverse();if(0<n.length){m=null;t=x=y=v=0;y=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,g):this.itemMaxWidth=Math.min(this.itemWidth,g):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,g):this.itemMaxWidth= g;s=0===s?0.75*this.lineHeight:s;y-=s+l;for(p=0;p<n.length;p++){e=n[p];if("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType)y-=2*0.1*this.lineHeight;if(!(0>=k||"undefined"===typeof k||0>=y||"undefined"===typeof y)){if("horizontal"===this.orientation){e.textBlock=new ja(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+=x,x=0;x=Math.max(x,e.textBlock.height)}else e.textBlock= new ja(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<k-this.lineHeight?(m={items:[], width:0},h.push(m)):(m=h[v],v=(v+1)%h.length),this.height+=e.textBlock.height;e.textBlock.x=m.width;e.textBlock.y=0;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));m.items.push(e);this.width=Math.max(m.width,this.width);t=e.textBlock.width+(s+l+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))}}this.itemWidth=t;this.height= !1===this.itemWrap?h.length*this.lineHeight:this.height+x;this.height=Math.min(k,this.height);this.width=Math.min(g,this.width)}"top"===this.verticalAlign?(d="left"===this.horizontalAlign?f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,c=f.y1):"center"===this.verticalAlign?(d="left"===this.horizontalAlign?f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,c=f.y1+f.height/2-this.height/2):"bottom"===this.verticalAlign&&(d="left"===this.horizontalAlign? f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,c=f.y2-this.height);this.items=n;for(p=0;p<this.items.length;p++)e=n[p],e.id=++this.chart._eventManager.lastObjectId,this.chart._eventManager.objectMap[e.id]={id:e.id,objectType:"legendItem",legendItemIndex:p,dataSeriesIndex:e.dataSeriesIndex,dataPointIndex:e.dataPointIndex};(0<this.borderThickness&&this.borderColor||this.backgroundColor)&&this.ctx.roundRect(d,c,this.width,this.height,this.cornerRadius,this.borderThickness, this.backgroundColor,this.borderColor);for(p=f=0;p<h.length;p++){m=h[p];for(y=x=0;y<m.items.length;y++){e=m.items[y];q=e.textBlock.x+d+(0===y?0.2*s:this.horizontalSpacing);u=c+f;t=q;this.chart.data[e.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(d,c,g,Math.max(k-k%this.lineHeight,0));this.ctx.clip();if("line"===e.chartType||"stepLine"===e.chartType||"spline"===e.chartType)this.ctx.strokeStyle=e.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHeight/ 8),this.ctx.beginPath(),this.ctx.moveTo(q-0.1*this.lineHeight,u+this.lineHeight/2),this.ctx.lineTo(q+0.85*this.lineHeight,u+this.lineHeight/2),this.ctx.stroke(),t-=0.1*this.lineHeight;if("error"===e.chartType){this.ctx.strokeStyle=r[0];v=s/8;this.ctx.lineWidth=v;this.ctx.beginPath();var v=q-0.08*this.lineHeight+0.1*this.lineHeight,z=u+0.15*this.lineHeight,A=0.7*this.lineHeight,B=A+0.02*this.lineHeight;this.ctx.moveTo(v,z);this.ctx.lineTo(v+A,z);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(v+ A/2,z);this.ctx.lineTo(v+A/2,z+B);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(v,z+B);this.ctx.lineTo(v+A,z+B);this.ctx.stroke();r.shift()}ea.drawMarker(q+s/2,u+this.lineHeight/2,this.ctx,e.markerType,"error"===e.chartType||"line"===e.chartType||"spline"===e.chartType?e.markerSize/2:e.markerSize,e.markerColor,e.markerBorderColor,e.markerBorderThickness);e.textBlock.x=q+l+s;if("line"===e.chartType||"stepLine"===e.chartType||"spline"===e.chartType)e.textBlock.x+=0.1*this.lineHeight;e.textBlock.y= Math.round(u+this.lineHeight/2);e.textBlock.render(!0);this.ctx.restore();x=0<y?Math.max(x,e.textBlock.height):e.textBlock.height;this.chart.data[e.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);v=P(e.id);this.ghostCtx.fillStyle=v;this.ghostCtx.beginPath();this.ghostCtx.fillRect(t,e.textBlock.y-this.lineHeight/2,e.textBlock.x+e.textBlock.width-t,e.textBlock.height);e.x1=this.chart._eventManager.objectMap[e.id].x1=t;e.y1=this.chart._eventManager.objectMap[e.id].y1=e.textBlock.y-this.lineHeight/ 2;e.x2=this.chart._eventManager.objectMap[e.id].x2=e.textBlock.x+e.textBlock.width;e.y2=this.chart._eventManager.objectMap[e.id].y2=e.textBlock.y+e.textBlock.height-this.lineHeight/2}f+=x}0<n.length&&a.layoutManager.registerSpace(b,{width:this.width+2+2,height:this.height+5+5});this.bounds={x1:d,y1:c,x2:d+this.width,y2:c+this.height}};ka(R,T);R.prototype.getDefaultAxisPlacement=function(){var a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===a||"area"===a||"stepArea"===a||"splineArea"=== a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===a||"stackedLine100"===a||"stackedArea100"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"normal";if("bar"===a||"stackedBar"===a||"stackedBar100"===a||"rangeBar"===a)return"xySwapped";if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";"error"!==a&&window.console.log("Unknown Chart Type: "+ a);return null};R.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"=== a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};R.prototype.getDataPointAtX=function(a,f){if(!this.dataPoints||0===this.dataPoints.length)return null;var b={dataPoint:null,distance:Infinity,index:NaN},c=null,d=0,g=0,k=1,l=Infinity,n=0,h=0,r=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?(r=Math.log(this.dataPoints[this.dataPoints.length- 1].x/this.dataPoints[0].x),r=1<r?Math.min(Math.max((this.dataPoints.length-1)/r*Math.log(a/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(r=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,r=0<r?Math.min(Math.max((this.dataPoints.length-1)/r*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){g=0<k?r+d:r-d;if(0<=g&&g<this.dataPoints.length){var c=this.dataPoints[g],p=this.axisX.logarithmic?c.x>a?c.x/a:a/c.x:Math.abs(c.x-a);p<b.distance&&(b.dataPoint=c,b.distance= p,b.index=g);c=p;c<=l?l=c:0<k?n++:h++;if(1E3<n&&1E3<h)break}else if(0>r-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||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||f<this.chart.plotArea.y1||f>this.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<m?Math.min(Math.max((this.dataPoints.length-1)/m*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else m=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0<m?Math.min(Math.max((this.dataPoints.length-1)/m*(p-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){g=0< k?p+d:p-d;if(0<=g&&g<this.dataPoints.length){var m=this.chart._eventManager.objectMap[this.dataPointIds[g]],e=this.dataPoints[g],t=null;if(m){switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case "bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case "rangeBar":case "waterfall":case "error":a>=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=ia("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:0<k?h++:r++;t<=q/2&&(l=!0);break;case "rangeArea":case "rangeSplineArea":q=ia("markerSize",e,this)||4;s=b?20:q;t=Math.min(Math.sqrt(Math.pow(m.x1- a,2)+Math.pow(m.y1-f,2)),Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y2-f,2)));t<=s&&c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t});m=Math.abs(m.x1-a);m<=n?n=m:0<k?h++:r++;t<=q/2&&(l=!0);break;case "bubble":q=m.size;t=Math.sqrt(Math.pow(m.x1-a,2)+Math.pow(m.y1-f,2));t<=q/2&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:t}),l=!0);break;case "pie":case "doughnut":q=m.center;s="doughnut"===this.type?m.percentInnerRadius*m.radius:0;t=Math.sqrt(Math.pow(q.x-a,2)+Math.pow(q.y- f,2));t<m.radius&&t>s&&(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<m.endAngle&&(s=360),q>=s&&0!==e.y&&(s+=360,t<q&&(t+=360)),t>q&&t<s&&(c.push({dataPoint:e,dataPointIndex:g,dataSeries:this,distance:0}),l=!0));break;case "funnel":case "pyramid":t=m.funnelSection;f>t.y1&&f<t.y4&&(t.y6?f>t.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<t&&(c.push({dataPoint:e,dataPointIndex:m.dataPointIndex,dataSeries:this,distance:0}),l=!0));break;case "boxAndWhisker":if(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.borderThickness&& f>=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.borderThickness&&f>=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.borderThickness&&f>=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||1E3<h&&1E3<r)break}}else if(0>p-d&&p+d>=this.dataPoints.length)break;-1===k?(d++,k=1): k=-1}a=null;for(f=0;f<c.length;f++)a?c[f].distance<=a.distance&&(a=c[f]):a=c[f];return a};R.prototype.getMarkerProperties=function(a,f,b,c){var d=this.dataPoints;return{x:f,y:b,ctx:c,type:d[a].markerType?d[a].markerType:this.markerType,size:d[a].markerSize?d[a].markerSize:this.markerSize,color:d[a].markerColor?d[a].markerColor:this.markerColor?this.markerColor:d[a].color?d[a].color:this.color?this.color:this._colorSet[a%this._colorSet.length],borderColor:d[a].markerBorderColor?d[a].markerBorderColor: this.markerBorderColor?this.markerBorderColor:null,borderThickness:d[a].markerBorderThickness?d[a].markerBorderThickness:this.markerBorderThickness?this.markerBorderThickness:null}};ka(B,T);B.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var f=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/Math.log(f/this.viewportMinimum)<this.noTicks-1){for(var b=B.getNiceNumber((f-this.viewportMinimum)/Math.min(Math.max(2,this.noTicks-this.logLabelValues.length), 3),!0),c=Math.ceil(this.viewportMinimum/b)*b;c<f;c+=b)c<this.viewportMinimum||this.logLabelValues.push(c);this.logLabelValues.sort(Na);this.createExtraLabelsForLog(a)}}};B.prototype.createLabels=function(){var a,f,b=0,c=0,d,g=0,k=0,c=0,l=this.interval,n=0,h,r=0.6*this.chart.height,b=!1,p;a=!1;var m=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],e=m.length?w(this.scaleBreaks.firstBreakIndex)?0:this.scaleBreaks.firstBreakIndex:0;if(this.dataSeries&&0<this.dataSeries.length)for(c=0;c<this.dataSeries.length;c++)"dateTime"=== this.dataSeries[c].xValueType&&(b=!0);if("axisX"===this.type&&b&&!this.logarithmic){this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),this.intervalType,this.interval);d=Ra(new Date(this.viewportMaximum),this.interval,this.intervalType);for(var t=e,b=this.intervalStartPosition;b<d;Ra(b,l,this.intervalType)){for(a=b.getTime();t<m.length&&a>m[t].endValue;t++);p=a;a=t<m.length&&a>=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]:ya(p,this.valueFormatString,this.chart._cultureInfo),a=new ja(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;b<this.viewportMaximum;b+=a)if(this.labels[b])t=!0;else{t=!1;break}t&&(this.interval=a,this.intervalStartPosition=c)}if(this.logarithmic&&!this.equidistantInterval)for(this.logLabelValues|| (this.logLabelValues=[],this.createExtraLabelsForLog()),c=0,t=e;c<this.logLabelValues.length;c++)if(b=this.logLabelValues[c],b<this.viewportMinimum)c++;else{for(;t<m.length&&b>m[t].endValue;t++);a=t<m.length&&b>=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]:X(p,this.valueFormatString,this.chart._cultureInfo),a=new ja(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(;t<m.length&&b>m[t].endValue;t++);a=t<m.length&&b>=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]:X(p,this.valueFormatString,this.chart._cultureInfo), a=new ja(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))*Q[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))*Q[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;c<this._labels.length;c++)a= this._labels[c].textBlock,a.maxWidth=g,a.maxHeight=k,p=a.measureText(),h=p.height;m=[];e=d=0;if(this.labelAutoFit||this.options.labelAutoFit)if(w(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&270>this.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;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=this._labels[b].textBlock;for(var q,t=a.text.split(" "),c=0;c<t.length;c++)l=t[c],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,l=this.ctx.measureText(l),l.width>e&&(q=b,e=l.width)}b=0;for(b=this.intervalStartPosition<this.viewportMinimum? 1:0;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=this._labels[b].textBlock;p=a.measureText();for(t=b+1;t<this._labels.length;t++)if(!this._labels[t].breaksLabelType){f=this._labels[t].textBlock;f=f.measureText();break}m.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,m);Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));c=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(k-a.fontSize/2)*Math.cos(Math.PI/180* Math.abs(this.labelAngle));if(w(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(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=(r-(h+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!w(this.options.labelWrap))this.labelWrap?w(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=Math.min(Math.max(g, e),l),this.sessionVariables.labelWrap=this.labelWrap,p.width+f.width>>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):w(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(w(this.options.labelWrap))if(!w(this.options.labelMaxWidth))this.options.labelMaxWidth<g?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth, this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=k);else if(!w(f))if(c=p.width+f.width>>0,t=this.labelFontSize,e<g)c-2*g>d&&(d=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth=g,w(this.options.labelFontSize)&&12<t&&(t=Math.floor(12/13*t),a.measureText()),this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelAngle= this.labelAngle):c>=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,w(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelAngle= this.labelAngle):c>=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?(w(this.options.labelFontSize)&&12<t&&(t=Math.floor(12/13*t),a.measureText()),this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=l): c>5*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||0<q&&q<this._labels.length-1&&e+this._labels[q+1].textBlock.measureText().width-2*g>d&&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=w(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=w(this.options.labelFontSize)?t:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,c=0;c<this._labels.length;c++)a= this._labels[c].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,e),l),p=a.measureText(),c<this._labels.length-1&&(t=c+1,f=this._labels[t].textBlock,f.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(g,e),l),f=f.measureText(),p.width+f.width>>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,w(this.options.labelWrap))?w(this.options.labelWrap)&&(this.labelWrap&&!w(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): (w(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<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight= this.sessionVariables.labelMaxHeight,a.measureText()}else for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=w(this.options.labelMaxWidth)?this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=w(this.options.labelFontSize)?this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=w(this.options.labelAngle)?this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=w(this.options.labelWrap)? this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText();else if("left"===this._position||"right"===this._position)if(g=w(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,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth= g;this.sessionVariables.labelMaxHeight=k;this.sessionVariables.labelAngle=w(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b<this._labels.length;b++)if(!this._labels[b].breaksLabelType){a=this._labels[b].textBlock;p=a.measureText();for(t=b+1;t<this._labels.length;t++)if(!this._labels[t].breaksLabelType){f=this._labels[t].textBlock;f=f.measureText();break}m.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math, m);c=g*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(k-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));w(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle?w(this.options.labelWrap)?w(this.options.labelWrap)&&(w(this.options.labelMaxWidth)?w(f)||(n=p.height+f.height>>0,n-2*k>e&&(e=n-2*k,n>=2*k&&n<2.4*k?(w(this.options.labelFontSize)&&12<this.labelFontSize&& (this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize):n>=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,w(this.options.labelFontSize)&&12< this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=w(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?(w(this.options.labelFontSize)&& 12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelAngle=w(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):n>10*k&&n<50*k&&(w(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize), a.measureText()),this.sessionVariables.labelFontSize=w(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelAngle=w(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle))):(this.sessionVariables.labelMaxHeight=k,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth)):(this.sessionVariables.labelMaxWidth= this.labelWrap?this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:this.labelMaxWidth?this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:g,this.sessionVariables.labelMaxHeight=k):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=0===this.labelAngle?g:Math.min((c-k*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)),k),w(this.options.labelWrap))? w(this.options.labelWrap)&&(this.labelWrap&&!w(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth>this.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,w(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,w(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap)}for(c=0;c<this._labels.length;c++)a= this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.labelFontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=w(this.options.labelMaxWidth)?this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth, a.fontSize=this.labelFontSize=w(this.options.labelFontSize)?this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=w(this.options.labelAngle)?this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=w(this.options.labelWrap)?this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText();for(b=0;b<this.stripLines.length;b++){var g=this.stripLines[b],s;if("outside"===g.labelPlacement){k=this.sessionVariables.labelMaxWidth; if("bottom"===this._position||"top"===this._position)s=w(g.options.labelWrap)?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)s=w(g.options.labelWrap)?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;w(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=w(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,w(g.labelBackgroundColor)&&(w(g.startValue)&&0!==g.startValue?g.labelBackgroundColor=x?"transparent":null:g.labelBackgroundColor="#EEEEEE");a=new ja(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;f<this._labels.length;f++){var b= this._labels[f].textBlock,c=b.measureText(),d=0,d=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(c.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<d&&(a=d);this._labels[f].effectiveWidth=d}for(f=0;f<this._stripLineLabels.length;f++)"outside"===this._stripLineLabels[f].stripLine.labelPlacement&&(this._stripLineLabels[f].stripLine.value>this.viewportMinimum&&this._stripLineLabels[f].stripLine.value<this.viewportMaximum)&&(b=this._stripLineLabels[f].textBlock, c=b.measureText(),d=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(c.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle)),a<d&&(a=d),this._stripLineLabels[f].effectiveWidth=d)}f=this.title?this._titleTextBlock.measureText().height+2:0;return b="inside"===this.labelPlacement?b=f+5:f+a+this.tickLength+5};B.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];this._stripLineLabels=[];var f,b=0;this.createLabels();if("bottom"=== this._position||"top"===this._position){for(b=0;b<this._labels.length;b++){f=this._labels[b].textBlock;var c=f.measureText(),d=0,d=0===this.labelAngle?c.height:c.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(c.height-f.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<d&&(a=d);this._labels[b].effectiveHeight=d}for(b=0;b<this._stripLineLabels.length;b++)"outside"===this._stripLineLabels[b].stripLine.labelPlacement&&(f=this._stripLineLabels[b].textBlock,c=f.measureText(),d=0=== this.labelAngle?c.height:c.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(c.height-f.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),a<d&&(a=d),this._stripLineLabels[b].effectiveHeight=d)}f=this.title?this._titleTextBlock.measureText().height+2:0;return b="inside"===this.labelPlacement?b=f+5:f+a+this.tickLength+5};B.setLayoutAndRender=function(a,f,b,c,d,g){var k,l,n,h,r=a[0]?a[0].chart:f[0].chart,p=r.ctx,m=r._axes;if(a&&0<a.length)for(var e=0;e<a.length;e++)a[e]&&a[e].calculateAxisParameters(); if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateAxisParameters();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateAxisParameters();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].calculateAxisParameters();for(e=0;e<m.length;e++)if(m[e]&&m[e].scaleBreaks&&m[e].scaleBreaks._appliedBreaks.length)for(var t=m[e].scaleBreaks._appliedBreaks,q=0;q<t.length&&!(t[q].startValue>m[e].viewportMaximum);q++)t[q].endValue<m[e].viewportMinimum||(w(m[e].scaleBreaks.firstBreakIndex)&&(m[e].scaleBreaks.firstBreakIndex= q),t[q].startValue>=m[e].viewPortMinimum&&(m[e].scaleBreaks.lastBreakIndex=q));for(var s=q=0,u=0,v=0,y=0,z=0,D=0,A,B,F=l=0,J,L,O,t=J=L=O=!1,e=0;e<m.length;e++)m[e]&&m[e].title&&(m[e]._titleTextBlock=new ja(m[e].ctx,{text:m[e].title,horizontalAlign:"center",fontSize:m[e].titleFontSize,fontFamily:m[e].titleFontFamily,fontWeight:m[e].titleFontWeight,fontColor:m[e].titleFontColor,fontStyle:m[e].titleFontStyle,borderColor:m[e].titleBorderColor,borderThickness:m[e].titleBorderThickness,backgroundColor:m[e].titleBackgroundColor, cornerRadius:m[e].titleCornerRadius,textBaseline:"top"}));for(e=0;e<m.length;e++)if(m[e].title)switch(m[e]._position){case "left":m[e]._titleTextBlock.maxWidth=m[e].titleMaxWidth||g.height;m[e]._titleTextBlock.maxHeight=m[e].titleWrap?0.8*g.width:1.5*m[e].titleFontSize;m[e]._titleTextBlock.angle=-90;break;case "right":m[e]._titleTextBlock.maxWidth=m[e].titleMaxWidth||g.height;m[e]._titleTextBlock.maxHeight=m[e].titleWrap?0.8*g.width:1.5*m[e].titleFontSize;m[e]._titleTextBlock.angle=90;break;default:m[e]._titleTextBlock.maxWidth= m[e].titleMaxWidth||g.width,m[e]._titleTextBlock.maxHeight=m[e].titleWrap?0.8*g.height:1.5*m[e].titleFontSize,m[e]._titleTextBlock.angle=0}if("normal"===d){for(var v=[],y=[],z=[],D=[],P=[],N=[],I=[],R=[];4>q;){var Q=0,U=0,V=0,W=0,T=d=0,K=0,Z=0,X=0,M=0,aa=0,ba=0;if(b&&0<b.length)for(z=[],e=aa=0;e<b.length;e++)z.push(Math.ceil(b[e]?b[e].createLabelsAndCalculateWidth():0)),aa+=z[e],K+=b[e]?b[e].margin:0;else z.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateWidth():0));I.push(z);if(c&&0<c.length)for(D= [],e=ba=0;e<c.length;e++)D.push(Math.ceil(c[e]?c[e].createLabelsAndCalculateWidth():0)),ba+=D[e],Z+=c[e]?c[e].margin:0;else D.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));R.push(D);k=Math.round(g.x1+aa+K);n=Math.round(g.x2-ba-Z>r.width-10?r.width-10:g.x2-ba-Z);if(a&&0<a.length)for(v=[],e=X=0;e<a.length;e++)a[e]&&(a[e].lineCoordinates={}),a[e].lineCoordinates.width=Math.abs(n-k),a[e].title&&(a[e]._titleTextBlock.maxWidth=0<a[e].titleMaxWidth&&a[e].titleMaxWidth<a[e].lineCoordinates.width? a[e].titleMaxWidth:a[e].lineCoordinates.width),v.push(Math.ceil(a[e]?a[e].createLabelsAndCalculateHeight():0)),X+=v[e],d+=a[e]?a[e].margin:0;else v.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));P.push(v);if(f&&0<f.length)for(y=[],e=M=0;e<f.length;e++)f[e]&&(f[e].lineCoordinates={}),f[e].lineCoordinates.width=Math.abs(n-k),f[e].title&&(f[e]._titleTextBlock.maxWidth=0<f[e].titleMaxWidth&&f[e].titleMaxWidth<f[e].lineCoordinates.width?f[e].titleMaxWidth:f[e].lineCoordinates.width),y.push(Math.ceil(f[e]? f[e].createLabelsAndCalculateHeight():0)),M+=y[e],T+=f[e]?f[e].margin:0;else y.push(Math.ceil(f[0]?f[0].createLabelsAndCalculateHeight():0));N.push(y);if(a&&0<a.length)for(e=0;e<a.length;e++)a[e]&&(a[e].lineCoordinates.x1=k,n=Math.round(g.x2-ba-Z>r.width-10?r.width-10:g.x2-ba-Z),a[e]._labels&&1<a[e]._labels.length&&(l=h=0,h=a[e]._labels[1],l="dateTime"===a[e].chart.plotInfo.axisXValueType?a[e]._labels[a[e]._labels.length-2]:a[e]._labels[a[e]._labels.length-1],s=h.textBlock.width*Math.cos(Math.PI/ 180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),u=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle))),a[e]&&(a[e].labelAutoFit&&!w(A)&&!w(B))&&(l=0,0<a[e].labelAngle?B+u>n&&(l+=0<a[e].labelAngle?B+u-n-ba:0):0>a[e].labelAngle?A-s<k&&A-s<a[e].viewportMinimum&&(F=k-(K+a[e].tickLength+z+A-s+a[e].labelFontSize/2)): 0===a[e].labelAngle&&(B+u>n&&(l=B+u/2-n-ba),A-s<k&&A-s<a[e].viewportMinimum&&(F=k-K-a[e].tickLength-z-A+s/2)),a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&&0<a[e].labelAngle&&0<l?n-=l:a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&&0>a[e].labelAngle&&0<F?k+=F:a[e].viewportMaximum===a[e].maximum&&a[e].viewportMinimum===a[e].minimum&&0===a[e].labelAngle&&(0<F&&(k+=F),0<l&&(n-=l))),r.panEnabled?X=r.sessionVariables.axisX.height:r.sessionVariables.axisX.height= X,l=Math.round(g.y2-X-d+Q),h=Math.round(g.y2),a[e].lineCoordinates.x2=n,a[e].lineCoordinates.width=n-k,a[e].lineCoordinates.y1=l,a[e].lineCoordinates.y2=l,a[e].bounds={x1:k,y1:l,x2:n,y2:h-(X+d-v[e]-Q),width:n-k,height:h-l}),Q+=v[e]+a[e].margin;if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].lineCoordinates.x1=Math.round(g.x1+aa+K),f[e].lineCoordinates.x2=Math.round(g.x2-ba-Z>r.width-10?r.width-10:g.x2-ba-Z),f[e].lineCoordinates.width=Math.abs(n-k),f[e]._labels&&1<f[e]._labels.length&&(h=f[e]._labels[1], l="dateTime"===f[e].chart.plotInfo.axisXValueType?f[e]._labels[f[e]._labels.length-2]:f[e]._labels[f[e]._labels.length-1],s=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),u=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle))),r.panEnabled?M=r.sessionVariables.axisX2.height:r.sessionVariables.axisX2.height= M,l=Math.round(g.y1),h=Math.round(g.y2+f[e].margin),f[e].lineCoordinates.y1=l+M+T-U,f[e].lineCoordinates.y2=l,f[e].bounds={x1:k,y1:l+(M+T-y[e]-U),x2:n,y2:h,width:n-k,height:h-l},U+=y[e]+f[e].margin;if(b&&0<b.length)for(e=0;e<b.length;e++)K=10,b[e]&&(k=Math.round(a[0]?a[0].lineCoordinates.x1:f[0].lineCoordinates.x1),K=b[e]._labels&&0<b[e]._labels.length?b[e]._labels[b[e]._labels.length-1].textBlock.height/2:10,l=Math.round(g.y1+M+T<Math.max(K,10)?Math.max(K,10):g.y1+M+T),n=Math.round(a[0]?a[0].lineCoordinates.x1: f[0].lineCoordinates.x1),K=0<a.length?0:b[e]._labels&&0<b[e]._labels.length?b[e]._labels[0].textBlock.height/2:10,h=Math.round(g.y2-X-d-K),b[e].lineCoordinates={x1:n-V,y1:l,x2:n-V,y2:h,height:Math.abs(h-l)},b[e].bounds={x1:k-(z[e]+V),y1:l,x2:n,y2:h,width:n-k,height:h-l},b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidth<b[e].lineCoordinates.height?b[e].titleMaxWidth:b[e].lineCoordinates.height),V+=z[e]+b[e].margin);if(c&&0<c.length)for(e=0;e<c.length;e++)c[e]&&(k= Math.round(a[0]?a[0].lineCoordinates.x2:f[0].lineCoordinates.x2),n=Math.round(k),K=c[e]._labels&&0<c[e]._labels.length?c[e]._labels[c[e]._labels.length-1].textBlock.height/2:0,l=Math.round(g.y1+M+T<Math.max(K,10)?Math.max(K,10):g.y1+M+T),K=0<a.length?0:c[e]._labels&&0<c[e]._labels.length?c[e]._labels[0].textBlock.height/2:0,h=Math.round(g.y2-(X+d+K)),c[e].lineCoordinates={x1:k+W,y1:l,x2:k+W,y2:h,height:Math.abs(h-l)},c[e].bounds={x1:k,y1:l,x2:n+(D[e]+W),y2:h,width:n-k,height:h-l},c[e].title&&(c[e]._titleTextBlock.maxWidth= 0<c[e].titleMaxWidth&&c[e].titleMaxWidth<c[e].lineCoordinates.height?c[e].titleMaxWidth:c[e].lineCoordinates.height),W+=D[e]+c[e].margin);if(a&&0<a.length)for(e=0;e<a.length;e++)a[e]&&(a[e].calculateValueToPixelConversionParameters(),a[e].calculateBreaksSizeInValues(),a[e]._labels&&1<a[e]._labels.length&&(A=(a[e].logarithmic?Math.log(a[e]._labels[1].position/a[e].viewportMinimum)/a[e].conversionParameters.lnLogarithmBase:a[e]._labels[1].position-a[e].viewportMinimum)*Math.abs(a[e].conversionParameters.pixelPerUnit)+ a[e].lineCoordinates.x1,k=a[e]._labels[a[e]._labels.length-("dateTime"===a[e].chart.plotInfo.axisXValueType?2:1)].position,k=a[e].getAppearentDifferceReplacingBreaksToSize(a[e].viewportMinimum,k),B=a[e].logarithmic?(1<k?Math.log(k)/a[e].conversionParameters.lnLogarithmBase*Math.abs(a[e].conversionParameters.pixelPerUnit):0)+a[e].lineCoordinates.x1:(0<k?k*Math.abs(a[e].conversionParameters.pixelPerUnit):0)+a[e].lineCoordinates.x1));if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateValueToPixelConversionParameters(), f[e].calculateBreaksSizeInValues(),f[e]._labels&&1<f[e]._labels.length&&(A=(f[e].logarithmic?Math.log(f[e]._labels[1].position/f[e].viewportMinimum)/f[e].conversionParameters.lnLogarithmBase:f[e]._labels[1].position-f[e].viewportMinimum)*Math.abs(f[e].conversionParameters.pixelPerUnit)+f[e].lineCoordinates.x1,k=f[e]._labels[f[e]._labels.length-("dateTime"===f[e].chart.plotInfo.axisX2ValueType?2:1)].position,k=f[e].getAppearentDifferceReplacingBreaksToSize(f[e].viewportMinimum,k),B=f[e].logarithmic? (1<k?Math.log(k)/f[e].conversionParameters.lnLogarithmBase*Math.abs(f[e].conversionParameters.pixelPerUnit):0)+f[e].lineCoordinates.x1:(0<k?k*Math.abs(f[e].conversionParameters.pixelPerUnit):0)+f[e].lineCoordinates.x1);for(e=0;e<m.length;e++)"axisY"===m[e].type&&(m[e].calculateValueToPixelConversionParameters(),m[e].calculateBreaksSizeInValues());if(0<q){if(a&&0<a.length)for(e=0;e<a.length;e++)t=P[q-1][e]===P[q][e]?!0:!1;else t=!0;if(f&&0<f.length)for(e=0;e<f.length;e++)J=N[q-1][e]===N[q][e]?!0:!1; else J=!0;if(b&&0<b.length)for(e=0;e<b.length;e++)L=I[q-1][e]===I[q][e]?!0:!1;else L=!0;if(c&&0<c.length)for(e=0;e<c.length;e++)O=R[q-1][e]===R[q][e]?!0:!1;else O=!0}if(t&&J&&L&&O)break;q++}p.save();p.beginPath();a[0]&&p.rect(5,a[0].bounds.y1,a[0].chart.width-10,a[0].bounds.height);f[0]&&p.rect(5,f[f.length-1].bounds.y1,f[0].chart.width-10,f[0].bounds.height);p.clip();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].calculateStripLinesThicknessInValues(),a[e].calculateBreaksInPixels(),a[e].renderLabelsTicksAndTitle(); if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateStripLinesThicknessInValues(),f[e].calculateBreaksInPixels(),f[e].renderLabelsTicksAndTitle();p.restore();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateStripLinesThicknessInValues(),b[e].calculateBreaksInPixels(),b[e].renderLabelsTicksAndTitle();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].calculateStripLinesThicknessInValues(),c[e].calculateBreaksInPixels(),c[e].renderLabelsTicksAndTitle()}else{A=[];F=[];s=[];B=[];u=[];P=[];N=[];for(I= [];4>q;){M=X=aa=W=Z=K=T=d=V=R=U=Q=0;if(a&&0<a.length)for(s=[],e=X=0;e<a.length;e++)s.push(Math.ceil(a[e]?a[e].createLabelsAndCalculateWidth():0)),X+=s[e],d+=a[e]?a[e].margin:0;else s.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateWidth():0));N.push(s);if(f&&0<f.length)for(B=[],e=M=0;e<f.length;e++)B.push(Math.ceil(f[e]?f[e].createLabelsAndCalculateWidth():0)),M+=B[e],T+=f[e]?f[e].margin:0;else B.push(Math.ceil(f[0]?f[0].createLabelsAndCalculateWidth():0));I.push(B);if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].lineCoordinates= {},k=Math.round(g.x1+X+d),n=Math.round(g.x2-M-T>r.width-10?r.width-10:g.x2-M-T),b[e].labelAutoFit&&!w(v)&&(0<!a.length&&(k=0>b[e].labelAngle?Math.max(k,v):0===b[e].labelAngle?Math.max(k,v/2):k),0<!f.length&&(n=0<b[e].labelAngle?n-y/2:0===b[e].labelAngle?n-y/2:n)),b[e].lineCoordinates.x1=k,b[e].lineCoordinates.x2=n,b[e].lineCoordinates.width=Math.abs(n-k),b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidth<b[e].lineCoordinates.width?b[e].titleMaxWidth:b[e].lineCoordinates.width); if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].lineCoordinates={},k=Math.round(g.x1+X+d),n=Math.round(g.x2-M-T>c[e].chart.width-10?c[e].chart.width-10:g.x2-M-T),c[e]&&c[e].labelAutoFit&&!w(z)&&(0<!a.length&&(k=0<c[e].labelAngle?Math.max(k,z):0===c[e].labelAngle?Math.max(k,z/2):k),0<!f.length&&(n-=D/2)),c[e].lineCoordinates.x1=k,c[e].lineCoordinates.x2=n,c[e].lineCoordinates.width=Math.abs(n-k),c[e].title&&(c[e]._titleTextBlock.maxWidth=0<c[e].titleMaxWidth&&c[e].titleMaxWidth<c[e].lineCoordinates.width? c[e].titleMaxWidth:c[e].lineCoordinates.width);if(b&&0<b.length)for(A=[],e=W=0;e<b.length;e++)A.push(Math.ceil(b[e]?b[e].createLabelsAndCalculateHeight():0)),W+=A[e]+b[e].margin,K+=b[e].margin;else A.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():0));u.push(A);if(c&&0<c.length)for(F=[],e=aa=0;e<c.length;e++)F.push(Math.ceil(c[e]?c[e].createLabelsAndCalculateHeight():0)),aa+=F[e],Z+=c[e].margin;else F.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateHeight():0));P.push(F);if(b&&0<b.length)for(e= 0;e<b.length;e++)0<b[e]._labels.length&&(h=b[e]._labels[0],l=b[e]._labels[b[e]._labels.length-1],v=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),y=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle)));if(c&&0<c.length)for(e=0;e<c.length;e++)c[e]&&0<c[e]._labels.length&&(h=c[e]._labels[0], l=c[e]._labels[c[e]._labels.length-1],z=h.textBlock.width*Math.cos(Math.PI/180*Math.abs(h.textBlock.angle))+(h.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(h.textBlock.angle)),D=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle)));if(r.panEnabled)for(e=0;e<b.length;e++)A[e]=r.sessionVariables.axisY.height;else for(e=0;e<b.length;e++)r.sessionVariables.axisY.height= A[e];if(b&&0<b.length)for(e=b.length-1;0<=e;e--)l=Math.round(g.y2),h=Math.round(g.y2>b[e].chart.height-10?b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=l-(A[e]+b[e].margin+Q),b[e].lineCoordinates.y2=l-(A[e]+b[e].margin+Q),b[e].bounds={x1:k,y1:l-(A[e]+Q+b[e].margin),x2:n,y2:h-(Q+b[e].margin),width:n-k,height:A[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0<b[e].titleMaxWidth&&b[e].titleMaxWidth<b[e].lineCoordinates.width?b[e].titleMaxWidth:b[e].lineCoordinates.width),Q+=A[e]+b[e].margin;if(c&& 0<c.length)for(e=c.length-1;0<=e;e--)c[e]&&(l=Math.round(g.y1),h=Math.round(g.y1+(F[e]+c[e].margin+U)),c[e].lineCoordinates.y1=h,c[e].lineCoordinates.y2=h,c[e].bounds={x1:k,y1:l+(c[e].margin+U),x2:n,y2:h,width:n-k,height:aa},c[e].title&&(c[e]._titleTextBlock.maxWidth=0<c[e].titleMaxWidth&&c[e].titleMaxWidth<c[e].lineCoordinates.width?c[e].titleMaxWidth:c[e].lineCoordinates.width),U+=F[e]+c[e].margin);if(a&&0<a.length)for(e=0;e<a.length;e++){K=a[e]._labels&&0<a[e]._labels.length?a[e]._labels[0].textBlock.fontSize/ 2:0;k=Math.round(g.x1+d);l=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:g.y1<Math.max(K,10)?Math.max(K,10):g.y1):g.y1<Math.max(K,10)?Math.max(K,10):g.y1;n=Math.round(g.x1+X+d);h=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:g.y2-W>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2-W):g.y2>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2;if(b&&0<b.length)for(K=0;K<b.length;K++)b[K]&&b[K].labelAutoFit&&(n=0>b[K].labelAngle?Math.max(n,v):0===b[K].labelAngle?Math.max(n,v/2):n,k= 0>b[K].labelAngle||0===b[K].labelAngle?n-X:k);if(c&&0<c.length)for(K=0;K<c.length;K++)c[K]&&c[K].labelAutoFit&&(n=c[K].lineCoordinates.x1,k=n-X);a[e].lineCoordinates={x1:n-R,y1:l,x2:n-R,y2:h,height:Math.abs(h-l)};a[e].bounds={x1:n-(s[e]+R),y1:l,x2:n,y2:h,width:n-k,height:h-l};a[e].title&&(a[e]._titleTextBlock.maxWidth=0<a[e].titleMaxWidth&&a[e].titleMaxWidth<a[e].lineCoordinates.height?a[e].titleMaxWidth:a[e].lineCoordinates.height);a[e].calculateValueToPixelConversionParameters();a[e].calculateBreaksSizeInValues(); R+=s[e]+a[e].margin}if(f&&0<f.length)for(e=0;e<f.length;e++){K=f[e]._labels&&0<f[e]._labels.length?f[e]._labels[0].textBlock.fontSize/2:0;k=Math.round(g.x1-d);l=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y2:g.y1<Math.max(K,10)?Math.max(K,10):g.y1):g.y1<Math.max(K,10)?Math.max(K,10):g.y1;n=Math.round(g.x2-M-T);h=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y1:g.y2-W>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2-W):g.y2>r.height-Math.max(K,10)?r.height-Math.max(K,10):g.y2;if(b&& 0<b.length)for(K=0;K<b.length;K++)b[K]&&b[K].labelAutoFit&&(n=0>b[K].labelAngle?Math.max(n,v):0===b[K].labelAngle?Math.max(n,v/2):n,k=0>b[K].labelAngle||0===b[K].labelAngle?n-M:k);if(c&&0<c.length)for(K=0;K<c.length;K++)c[K]&&c[K].labelAutoFit&&(n=c[K].lineCoordinates.x2,k=n-M);f[e].lineCoordinates={x1:n+V,y1:l,x2:n+V,y2:h,height:Math.abs(h-l)};f[e].bounds={x1:k,y1:l,x2:n+B[e]+V,y2:h,width:n-k,height:h-l};f[e].title&&(f[e]._titleTextBlock.maxWidth=0<f[e].titleMaxWidth&&f[e].titleMaxWidth<f[e].lineCoordinates.height? f[e].titleMaxWidth:f[e].lineCoordinates.height);f[e].calculateValueToPixelConversionParameters();f[e].calculateBreaksSizeInValues();V+=B[e]+f[e].margin}for(e=0;e<m.length;e++)"axisY"===m[e].type&&(m[e].calculateValueToPixelConversionParameters(),m[e].calculateBreaksSizeInValues());if(0<q){if(a&&0<a.length)for(e=0;e<a.length;e++)t=N[q-1][e]===N[q][e]?!0:!1;else t=!0;if(f&&0<f.length)for(e=0;e<f.length;e++)J=I[q-1][e]===I[q][e]?!0:!1;else J=!0;if(b&&0<b.length)for(e=0;e<b.length;e++)L=u[q-1][e]===u[q][e]? !0:!1;else L=!0;if(c&&0<c.length)for(e=0;e<c.length;e++)O=P[q-1][e]===P[q][e]?!0:!1;else O=!0}if(t&&J&&L&&O)break;q++}if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].calculateBreaksInPixels(),b[e].renderLabelsTicksAndTitle();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].calculateBreaksInPixels(),c[e].renderLabelsTicksAndTitle();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].calculateBreaksInPixels(),a[e].renderLabelsTicksAndTitle();if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].calculateBreaksInPixels(), f[e].renderLabelsTicksAndTitle()}r.preparePlotArea();g=r.plotArea;p.save();p.beginPath();p.rect(g.x1,g.y1,Math.abs(g.x2-g.x1),Math.abs(g.y2-g.y1));p.clip();if(a&&0<a.length)for(e=0;e<m.length;e++)m[e].renderStripLinesOfThicknessType("value");if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderStripLinesOfThicknessType("value");if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderStripLinesOfThicknessType("value");if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderStripLinesOfThicknessType("value");if(a&& 0<a.length)for(e=0;e<a.length;e++)a[e].renderInterlacedColors();if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderInterlacedColors();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderInterlacedColors();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderInterlacedColors();p.restore();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderGrid(),x&&(a[e].createMask(),a[e].renderBreaksBackground());if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderGrid(),x&&(f[e].createMask(),f[e].renderBreaksBackground()); if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderGrid(),x&&(b[e].createMask(),b[e].renderBreaksBackground());if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderGrid(),x&&(c[e].createMask(),c[e].renderBreaksBackground());if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderAxisLine();if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderAxisLine();if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderAxisLine();if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderAxisLine();if(a&&0<a.length)for(e=0;e<a.length;e++)a[e].renderStripLinesOfThicknessType("pixel"); if(f&&0<f.length)for(e=0;e<f.length;e++)f[e].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(e=0;e<b.length;e++)b[e].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(e=0;e<c.length;e++)c[e].renderStripLinesOfThicknessType("pixel")};B.prototype.calculateStripLinesThicknessInValues=function(){for(var a=0;a<this.stripLines.length;a++)if(null!==this.stripLines[a].startValue&&null!==this.stripLines[a].endValue){var f=Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue), b=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),f=this.getAppearentDifferceReplacingBreaksToSize(f,b);this.stripLines[a].value=this.logarithmic?this.stripLines[a].value*Math.sqrt(Math.log(this.stripLines[a].endValue/this.stripLines[a].startValue)/Math.log(f)):this.stripLines[a].value+(Math.abs(this.stripLines[a].endValue-this.stripLines[a].startValue)-f)/2;this.stripLines[a].thickness=f;this.stripLines[a]._thicknessType="value"}};B.prototype.calculateBreaksSizeInValues=function(){for(var a= "left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,f=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],b=this.conversionParameters.pixelPerUnit||a/(this.logarithmic?this.conversionParameters.maximum/this.conversionParameters.minimum:this.conversionParameters.maximum-this.conversionParameters.minimum),c=this.scaleBreaks&&!w(this.scaleBreaks.options.spacing),d,g=0;g<f.length;g++)d=c||!w(f[g].options.spacing), f[g].spacing=J(f[g].spacing,a,8,d?0.1*a:8,d?0:3)<<0,f[g].size=0>f[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;f<a.length&&!(a[f].startValue>this.conversionParameters.maximum);f++)a[f].endValue< this.conversionParameters.minimum||(w(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.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(h===this._labels.length-1||k<Math.log(l/p.position)*n/d)||(b.push(p),l=p.position,k= p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=b}else{for(h=0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(k=p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),b+=k);b>this.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.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(h===this._labels.length-1||r<Math.log(l/p.position)*n)||(b.push(p),l=p.position,r=p.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=b}else{for(h= 0;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(r=p.textBlock.height*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.width*Math.abs(Math.sin(Math.PI/180*this.labelAngle)),c+=r);c>this.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;h<this._labels.length;h++)p=this._labels[h], p.position<this.viewportMinimum||(p.position>this.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;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.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;h<this._labels.length;h++)p=this._labels[h], p.position<this.viewportMinimum||(p.position>this.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?0<this.labelAngle?m.x:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):m.x+(p.textBlock.height-this.tickLength-this.labelFontSize)*Math.sin(Math.PI/180*this.labelAngle)-(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-p.textBlock.width*Math.sin(Math.PI/ 180*this.labelAngle)+this.tickLength+5:m.y-(this.tickLength+((p.textBlock.height-p.textBlock.fontSize/2)*Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?p.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)))),p.textBlock.x=m.x,p.textBlock.y=m.y);"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.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;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(p.position>this.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:0<this.labelAngle?m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)- this.tickLength-5:m.x-p.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(p.textBlock.height-p.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-this.tickLength));"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.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;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(p.position>this.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:0<this.labelAngle?m.x-(p.textBlock.height- p.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:m.x+this.tickLength+5));"inside"===this.labelPlacement&&this.chart.addEventListener("dataAnimationIterationEnd",function(){for(h=0;h<a._labels.length;h++)if(p=a._labels[h],!(p.position<a.viewportMinimum||p.position>a.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;h<a._labels.length;h++)p=a._labels[h],p.position<a.viewportMinimum||(p.position>a.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;h<this._labels.length;h++)p=this._labels[h],p.position<this.viewportMinimum||(p.position>this.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;d<this._labels.length;d++)f?(f=this.getPixelCoordinatesOnAxis(this._labels[d].position),b=d+1>this._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;d<this._labels.length;d++)f?(b=this.getPixelCoordinatesOnAxis(this._labels[d].position),f=d+1>this._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&&0<this.stripLines.length&& a){for(var f=this,b,c=0,d=0,g=!1,k=!1,l=[],n=[],k=!1,c=0;c<this.stripLines.length;c++){var h=this.stripLines[c];h._thicknessType===a&&("pixel"===a&&(h.value<this.viewportMinimum||h.value>this.viewportMaximum||w(h.value)||isNaN(this.range))||l.push(h))}for(c=0;c<this._stripLineLabels.length;c++)if(h=this.stripLines[c],b=this._stripLineLabels[c],!(b.position<this.viewportMinimum||b.position>this.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)-(0<this.labelAngle?b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0),a.y-=this.tickLength+ (b.textBlock.height*Math.cos(Math.PI/180*this.labelAngle)+(0<this.labelAngle?b.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)))):"left"===this._position?(r=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,this.ctx.beginPath(),this.ctx.moveTo(a.x<<0,r),this.ctx.lineTo(a.x-this.tickLength<<0,r),this.ctx.stroke(),0===this.labelAngle?a.x=a.x-b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:(a.y-=b.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),a.x=0<this.labelAngle? a.x-b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5:a.x-b.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)-this.tickLength)):"right"===this._position&&(r=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,this.ctx.beginPath(),this.ctx.moveTo(a.x<<0,r),this.ctx.lineTo(a.x+this.tickLength<<0,r),this.ctx.stroke(),0===this.labelAngle?a.x=a.x+this.tickLength+5:(a.y=0>this.labelAngle?a.y:a.y-(b.textBlock.height- b.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0<this.labelAngle?a.x+(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.sin(Math.PI/180*this.labelAngle)+this.tickLength:a.x+this.tickLength+5));else b.textBlock.angle=-90,"bottom"===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?w(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,w(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?w(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,w(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?w(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.height<this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:w(h.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/ 2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-b.textBlock.width/2:this.chart.plotArea.x2-b.textBlock.width-3):"right"===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? w(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.height<this.chart.plotArea.y2?a.y+=b.textBlock.fontSize/2+3:w(h.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize/2+3,a.x="near"===b.stripLine.labelAlign?this.chart.plotArea.x2-b.textBlock.width-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.x2+this.chart.plotArea.x1)/2-b.textBlock.width/2:this.chart.plotArea.x1+ 3);b.textBlock.x=a.x;b.textBlock.y=a.y;n.push(b)}if(!k){k=!1;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();for(c=0;c<l.length;c++)h=l[c],h.showOnTop?g||(g=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip(); for(d=0;d<l.length;d++)h=l[d],h.showOnTop&&h.render();this.ctx.restore()},h)):h.render();for(c=0;c<n.length;c++)b=n[c],b.stripLine.showOnTop?k||(k=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){for(d=0;d<n.length;d++)b=n[d],"inside"===b.stripLine.labelPlacement&&b.stripLine.showOnTop&&(f.ctx.save(),f.ctx.beginPath(),f.ctx.rect(f.chart.plotArea.x1,f.chart.plotArea.y1,f.chart.plotArea.width,f.chart.plotArea.height),f.ctx.clip(),b.textBlock.render(!0),f.ctx.restore())},b.textBlock)): "inside"===b.stripLine.labelPlacement&&b.textBlock.render(!0);this.ctx.restore();k=!0}if(k)for(k=!1,c=0;c<n.length;c++)b=n[c],b.stripLine.showOnTop?k||(k=!0,this.chart.addEventListener("dataAnimationIterationEnd",function(){for(d=0;d<n.length;d++)b=n[d],"outside"===b.stripLine.labelPlacement&&b.stripLine.showOnTop&&b.textBlock.render(!0)},b.textBlock)):"outside"===b.stripLine.labelPlacement&&b.textBlock.render(!0)}};B.prototype.renderBreaksBackground=function(){this.chart._breaksCanvas&&(this.scaleBreaks&& 0<this.scaleBreaks._appliedBreaks.length&&this.maskCanvas)&&(this.chart._breaksCanvasCtx.save(),this.chart._breaksCanvasCtx.beginPath(),this.chart._breaksCanvasCtx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height),this.chart._breaksCanvasCtx.clip(),this.chart._breaksCanvasCtx.drawImage(this.maskCanvas,0,0,this.chart.width,this.chart.height),this.chart._breaksCanvasCtx.restore())};B.prototype.createMask=function(){if(this.scaleBreaks&&0<this.scaleBreaks._appliedBreaks.length){var a= this.scaleBreaks._appliedBreaks;x?(this.maskCanvas=ra(this.chart.width,this.chart.height),this.maskCtx=this.maskCanvas.getContext("2d")):(this.maskCanvas=this.chart.plotArea.canvas,this.maskCtx=this.chart.plotArea.ctx);this.maskCtx.save();this.maskCtx.beginPath();this.maskCtx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.maskCtx.clip();for(var f=0;f<a.length;f++)a[f].endValue<this.viewportMinimum||(a[f].startValue>this.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&&0<this.gridThickness){var a=this.chart.ctx;a.save();var f,b=this.chart.plotArea;a.lineWidth=this.gridThickness;a.strokeStyle=this.gridColor;a.setLineDash&&a.setLineDash(F(this.gridDashType,this.gridThickness));if("bottom"===this._position||"top"===this._position)for(c=0;c<this._labels.length;c++)this._labels[c].position< this.viewportMinimum||(this._labels[c].position>this.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;c<this._labels.length;c++)this._labels[c].position<this.viewportMinimum||(this._labels[c].position>this.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=x?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&&!w(this.scaleBreaks.firstBreakIndex))if(w(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&&!w(this.scaleBreaks.firstBreakIndex))if(w(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()}x&&(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;b<d.length;b++){if(!(d[b].endValue<this.conversionParameters.minimum))if(f)if(d[b].startValue<this.conversionParameters.minimum){if(1<d[b].size&&this.conversionParameters.minimum*Math.pow(d[b].endValue/d[b].startValue,Math.log(c)/Math.log(d[b].size))<d[b].endValue){a=Math.pow(d[b].endValue/d[b].startValue,Math.log(c)/Math.log(d[b].size));break}else a*=d[b].endValue/this.conversionParameters.minimum/ Math.pow(d[b].size,Math.log(d[b].endValue/this.conversionParameters.minimum)/Math.log(d[b].endValue/d[b].startValue)),c/=Math.pow(d[b].size,Math.log(d[b].endValue/this.conversionParameters.minimum)/Math.log(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(c<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(c>d[b].startValue/d[b-1].endValue){c/=d[b].startValue/d[b-1].endValue;if(c<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}else for(b=d.length-1;0<=b;b--)if(!(d[b].startValue>this.conversionParameters.minimum))if(f)if(d[b].endValue>this.conversionParameters.minimum){if(1<d[b].size&&this.conversionParameters.minimum*Math.pow(d[b].endValue/ d[b].startValue,Math.log(c)/Math.log(d[b].size))>d[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(c<d[b].endValue/this.conversionParameters.minimum){c/= d[b].endValue/this.conversionParameters.minimum;if(c>1/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(c<d[b].endValue/d[b+1].startValue){c/=d[b].endValue/d[b+1].startValue;if(c>1/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.length;b++){if(!(d[b].endValue<this.conversionParameters.minimum))if(f)if(d[b].startValue<this.conversionParameters.minimum){if(d[b].size&&this.conversionParameters.minimum+c*(d[b].endValue-d[b].startValue)/d[b].size<d[b].endValue){a=0>=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(c<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>d[b].startValue-d[b-1].endValue){c-=d[b].startValue-d[b-1].endValue;if(c<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}else for(b=d.length-1;0<=b;b--)if(!(d[b].startValue>this.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<d[b].endValue-this.conversionParameters.minimum){c-=d[b].endValue-this.conversionParameters.minimum;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<d[b].endValue-d[b+1].startValue){c-=d[b].endValue-d[b+1].startValue;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=w(b)?f/a:b;for(var g=0;g<d.length&& !(f<d[g].startValue);g++)a>d[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&&f<d[g].endValue)&&(b=a*Math.pow(d[g].size,Math.log(f/a)/Math.log(d[g].endValue/ d[g].startValue))))}else for(b=w(b)?Math.abs(f-a):b,g=0;g<d.length&&!(f<d[g].startValue);g++)a>d[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&&f<d[g].endValue?b=b-f+d[g].startValue+d[g].size*(f-d[g].startValue)/(d[g].endValue-d[g].startValue):!c&&(a>d[g].startValue&&f<d[g].endValue)&&(b=a+d[g].size*(f-a)/(d[g].endValue- d[g].startValue)));return b};B.prototype.setViewPortRange=function(a,f){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,f);this.sessionVariables.newViewportMaximum=this.viewportMaximum=Math.max(a,f)};B.prototype.getXValueAt=function(a){if(!a)return null;var f=null;"left"===this._position?f=this.convertPixelToValue(a.y):"bottom"===this._position&&(f=this.convertPixelToValue(a.x));return f};B.prototype.calculateValueToPixelConversionParameters=function(a){a=this.scaleBreaks? this.scaleBreaks._appliedBreaks:[];var f={pixelPerUnit:null,minimum:null,reference:null},b=this.lineCoordinates.width,c=this.lineCoordinates.height,b="bottom"===this._position||"top"===this._position?b:c,c=Math.abs(this.range);if(this.logarithmic)for(var d=0;d<a.length&&!(this.viewportMaximum<a[d].startValue);d++)this.viewportMinimum>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=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100):b-Math.min(a[d].spacing,0.1*b)):this.viewportMinimum>a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c/a[d].endValue*this.viewportMinimum,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*Math.log(a[d].endValue/this.viewportMinimum)/Math.log(a[d].endValue/a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*Math.log(a[d].endValue/this.viewportMinimum)/Math.log(a[d].endValue/ a[d].startValue)):this.viewportMinimum<=a[d].startValue&&this.viewportMaximum<a[d].endValue&&(c=c/this.viewportMaximum*a[d].startValue,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*Math.log(this.viewportMaximum/a[d].startValue)/Math.log(a[d].endValue/a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*Math.log(this.viewportMaximum/a[d].startValue)/Math.log(a[d].endValue/a[d].startValue)));else for(d=0;d<a.length&&!(this.viewportMaximum<a[d].startValue);d++)this.viewportMinimum> 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=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100):b-Math.min(a[d].spacing,0.1*b)):this.viewportMinimum>a[d].startValue&&this.viewportMaximum>=a[d].endValue?(c=c-a[d].endValue+this.viewportMinimum,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100* (a[d].endValue-this.viewportMinimum)/(a[d].endValue-a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*(a[d].endValue-this.viewportMinimum)/(a[d].endValue-a[d].startValue)):this.viewportMinimum<=a[d].startValue&&this.viewportMaximum<a[d].endValue&&(c=c-this.viewportMaximum+a[d].startValue,b=0<a[d].spacing.toString().indexOf("%")?b*(1-parseFloat(a[d].spacing)/100*(this.viewportMaximum-a[d].startValue)/(a[d].endValue-a[d].startValue)):b-Math.min(a[d].spacing,0.1*b)*(this.viewportMaximum-a[d].startValue)/ (a[d].endValue-a[d].startValue)));f.minimum=this.viewportMinimum;f.maximum=this.viewportMaximum;f.range=c;if("bottom"===this._position||"top"===this._position)this.logarithmic?(f.lnLogarithmBase=Math.log(this.logarithmBase),f.pixelPerUnit=(this.reversed?-1:1)*b*f.lnLogarithmBase/Math.log(Math.abs(c))):f.pixelPerUnit=(this.reversed?-1:1)*b/Math.abs(c),f.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(f.lnLogarithmBase= Math.log(this.logarithmBase),f.pixelPerUnit=(this.reversed?1:-1)*b*f.lnLogarithmBase/Math.log(Math.abs(c))):f.pixelPerUnit=(this.reversed?1:-1)*b/Math.abs(c),f.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;this.conversionParameters=f};B.prototype.calculateAxisParameters=function(){if(this.logarithmic)this.calculateLogarithmicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),f=!1,b=!1;"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?"xySwapped"===this.chart.plotInfo.axisPlacement?62:70:"xySwapped"===this.chart.plotInfo.axisPlacement?50:40,c=4;"axisX"===this.type&&(c=600>this.maxWidth?8:6);var a=Math.max(c,Math.floor(this.maxWidth/a)),d,g,k,c=0;!w(this.options.viewportMinimum)&&(!w(this.options.viewportMaximum)&&this.options.viewportMinimum>=this.options.viewportMaximum)&&(this.viewportMinimum=this.viewportMaximum=null);if(w(this.options.viewportMinimum)&& !w(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(w(this.options.viewportMaximum)&&!w(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.length;c++)if((!w(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[c].startValue||!w(this.options.minimum)&&this.options.minimum>=this.scaleBreaks._appliedBreaks[c].startValue||!w(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[c].startValue)&&(!w(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<= this.scaleBreaks._appliedBreaks[c].endValue||!w(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[c].endValue||!w(this.options.viewportMaximum)&&this.viewportMaximum<=this.scaleBreaks._appliedBreaks[c].endValue)){this.scaleBreaks._appliedBreaks.splice(c,1);break}if("axisX"===this.type){if(this.dataSeries&&0<this.dataSeries.length)for(d=0;d<this.dataSeries.length;d++)"dateTime"===this.dataSeries[d].xValueType&&(b=!0);d=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin; g=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax;0===g-d&&(c="undefined"===typeof this.options.interval?0.4:this.options.interval,g+=c,d-=c);Infinity!==this.dataInfo.minDiff?k=this.dataInfo.minDiff:1<g-d?k=0.5*Math.abs(g-d):(k=1,b&&(f=!0))}else"axisY"===this.type&&(d=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,g=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,isFinite(d)||isFinite(g)?isFinite(d)?isFinite(g)||(g= d):d=g:(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,d="undefined"!==typeof this.options.interval||isFinite(this.dataInfo.minDiff)?0:Infinity),0===d&&0===g?(g+=9,d=0):0===g-d?(c=Math.min(Math.abs(0.01*Math.abs(g)),5),g+=c,d-=c):d>g?(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:1<g-d?0.5*Math.abs(g-d):1,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&0<d&&(d=0),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&0>g&&(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*Q.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*Q.secondDuration)<=a?(this.interval=2,this.intervalType="second"):c/(5*Q.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*Q.secondDuration)<=a?(this.interval=10,this.intervalType= "second"):c/(15*Q.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*Q.secondDuration)<=a?(this.interval=20,this.intervalType="second"):c/(30*Q.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*Q.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*Q.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):c/(5*Q.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*Q.minuteDuration)<=a?(this.interval=10,this.intervalType= "minute"):c/(15*Q.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*Q.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):c/(30*Q.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*Q.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*Q.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):c/(3*Q.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*Q.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1* Q.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*Q.dayDuration)<=a?(this.interval=2,this.intervalType="day"):c/(4*Q.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*Q.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*Q.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*Q.weekDuration)<=a?(this.interval=3,this.intervalType="week"):c/(1*Q.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*Q.monthDuration)<=a?(this.interval=2, this.intervalType="month"):c/(3*Q.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*Q.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=c/(1*Q.yearDuration)<=a?1:c/(2*Q.yearDuration)<=a?2:c/(4*Q.yearDuration)<=a?4:Math.floor(B.getNiceNumber(c/(a-1),!0)/Q.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&&0<this.options.interval?this.options.interval:B.getNiceNumber(c/(a-1),!0);if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?d-k/2:Math.floor(d/this.interval)*this.interval;if(null===this.viewportMaximum|| isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?g+k/2:Math.ceil(g/this.interval)*this.interval;0===this.viewportMaximum&&0===this.viewportMinimum&&(0===this.options.viewportMinimum?this.viewportMaximum+=10:0===this.options.viewportMaximum&&(this.viewportMinimum-=10),this.options&&"undefined"===typeof this.options.interval&&(this.interval=B.getNiceNumber((this.viewportMaximum-this.viewportMinimum)/(a-1),!0)))}if(null===this.minimum||null===this.maximum)if("axisX"===this.type?(d= null!==this.minimum?this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dataInfo.max,0===g-d&&(c="undefined"===typeof this.options.interval?0.4:this.options.interval,g+=c,d-=c),k=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1<g-d?0.5*Math.abs(g-d):1):"axisY"===this.type&&(d=null!==this.minimum?this.minimum:this.dataInfo.min,g=null!==this.maximum?this.maximum:this.dataInfo.max,isFinite(d)||isFinite(g)?0===d&&0===g?(g+=9,d=0):0===g-d?(c=Math.min(Math.abs(0.01*Math.abs(g)), 5),g+=c,d-=c):d>g?(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:1<g-d?0.5*Math.abs(g- d):1,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&0<d&&(d=0),this.includeZero&&(null===this.maximum||isNaN(this.maximum))&&0>g&&(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));w(this.sessionVariables.newViewportMinimum)&&(this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum));w(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.length;k++)if((!w(this.sessionVariables.newViewportMinimum)&&this.sessionVariables.newViewportMinimum>=this.scaleBreaks._appliedBreaks[k].startValue||!w(this.options.minimum)&&this.options.minimum>= this.scaleBreaks._appliedBreaks[k].startValue||!w(this.options.viewportMinimum)&&this.viewportMinimum>=this.scaleBreaks._appliedBreaks[k].startValue)&&(!w(this.sessionVariables.newViewportMaximum)&&this.sessionVariables.newViewportMaximum<=this.scaleBreaks._appliedBreaks[k].endValue||!w(this.options.maximum)&&this.options.maximum<=this.scaleBreaks._appliedBreaks[k].endValue||!w(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))&&1<c&&(c=1),this.includeZero&&(null===this.viewportMaximum||isNaN(this.viewportMaximum))&&1>d&&(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&&0<this.options.interval?this.interval=this.options.interval:(this.interval=B.getNiceExponent(Math.log(k)/f/(a-1),!0),b=B.getNiceNumber(linearRange/(a-1),!0)); if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum="axisX"===this.type?c/Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.floor(Math.log(c)/f/this.interval));if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum="axisX"===this.type?d*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(d)/f/this.interval));1===this.viewportMaximum&&1===this.viewportMinimum&&(1===this.options.viewportMinimum?this.viewportMaximum*= this.logarithmBase-1/this.logarithmBase:1===this.options.viewportMaximum&&(this.viewportMinimum/=this.logarithmBase-1/this.logarithmBase),this.options&&"undefined"===typeof this.options.interval&&(this.interval=B.getNiceExponent(Math.ceil(Math.log(k)/f)/(a-1)),b=B.getNiceNumber((this.viewportMaximum-this.viewportMinimum)/(a-1),!0)));if(null===this.minimum||null===this.maximum)"axisX"===this.type?(c=null!==this.minimum?this.minimum:this.dataInfo.min,d=null!==this.maximum?this.maximum:this.dataInfo.max, 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.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))&&1<c&&(c=1),this.includeZero&&(null===this.maximum|| isNaN(this.maximum))&&1>d&&(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.range<Math.pow(this.logarithmBase,8>this.viewportMaximum||3>a?2:3)){for(f=Math.floor(this.viewportMinimum/ b+0.5)*b;f<this.viewportMinimum;)f+=b;this.equidistantInterval=!1;this.intervalStartPosition=f;this.interval=b}else this.options.interval||(b=Math.ceil(this.interval),this.range>this.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(2<f)for(k=0;k<f-2;k++)this.valueFormatString+="#"}};B.generateValueFormatString=function(a,f){var b="#,##0.",c=f;1>a&&(c+=Math.floor(Math.abs(Math.log(a)/Math.LN10)),isNaN(c)||!isFinite(c))&&(c=f);for(var d=0;d<c;d++)b+="#";return b};B.getNiceExponent=function(a,f){var b=Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b),c=0>b?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=Q[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0<a.getMilliseconds()&&(a.setSeconds(a.getSeconds()+1),a.setMilliseconds(0));else if("minute"===this.intervalType){if(0<a.getSeconds()||0<a.getMilliseconds())a.setMinutes(a.getMinutes()+ 1),a.setSeconds(0),a.setMilliseconds(0)}else if("hour"===this.intervalType){if(0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setHours(a.getHours()+1),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("day"===this.intervalType){if(0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("week"===this.intervalType){if(0<a.getDay()||0<a.getHours()||0<a.getMinutes()|| 0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+(7-a.getDay())),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("month"===this.intervalType){if(1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else"year"===this.intervalType&&(0<a.getMonth()||1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())&& (a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0));return a};ka(O,T);ka(da,T);da.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var f=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Ea(this.parent[this.optionsName]),f=this.parent.options[this.optionsName].indexOf(this.options));this.options="undefined"===typeof a?{}:a;this.parent.options[this.optionsName][f]= this.options}};da.prototype.render=function(a){if(0!==this.spacing||0!==this.options.lineThickness&&("undefined"!==typeof this.options.lineThickness||0!==this.parent.lineThickness)){var f=this.ctx,b=this.ctx.globalAlpha;this.ctx=a||this.ctx;this.ctx.save();this.ctx.beginPath();this.ctx.rect(this.chart.plotArea.x1,this.chart.plotArea.y1,this.chart.plotArea.width,this.chart.plotArea.height);this.ctx.clip();var c=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.startValue),d=this.scaleBreaks.parent.getPixelCoordinatesOnAxis(this.endValue); this.ctx.strokeStyle=this.lineColor;this.ctx.fillStyle=this.color;this.ctx.beginPath();this.ctx.globalAlpha=1;P(this.id);var g,k,l,n,h,r;a=Math.max(this.spacing,3);var p=Math.max(0,this.lineThickness);this.ctx.lineWidth=p;this.ctx.setLineDash&&this.ctx.setLineDash(F(this.lineDashType,p));if("bottom"===this.scaleBreaks.parent._position||"top"===this.scaleBreaks.parent._position)if(c=1===p%2?(c.x<<0)+0.5:c.x<<0,k=1===p%2?(d.x<<0)+0.5:d.x<<0,"top"===this.scaleBreaks.parent._position?(d=this.chart.plotArea.y1, l=this.chart.plotArea.y2+p/2+0.5<<0):(d=this.chart.plotArea.y2,l=this.chart.plotArea.y1-p/2+0.5<<0,a*=-1),this.bounds={x1:c-p/2,y1:d,x2:k+p/2,y2:l},this.ctx.moveTo(c,d),"straight"===this.type||"top"===this.scaleBreaks.parent._position&&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<r;m++)this.ctx.bezierCurveTo(n+g*a,h+a,n+g*a,h+2*a,n,h+3*a),h+=3*a,g*=-1;this.ctx.bezierCurveTo(n+ g*a,h+a,n+g*a,h+2*a,n,h+3*a);n=k;g*=-1;this.ctx.lineTo(n,h);for(m=0;m<r;m++)this.ctx.bezierCurveTo(n+g*a,h-a,n+g*a,h-2*a,n,h-3*a),h-=3*a,g*=-1}else{if("zigzag"===this.type){g=-1;h=d+a;n=c+a;r=(l-h)/a/2;for(m=0;m<r;m++)this.ctx.lineTo(n,h),n+=2*g*a,h+=2*a,g*=-1;this.ctx.lineTo(n,h);n+=k-c;for(m=0;m<r+1;m++)this.ctx.lineTo(n,h),n+=2*g*a,h-=2*a,g*=-1;this.ctx.lineTo(n+g*a,h+a)}}else if("left"===this.scaleBreaks.parent._position||"right"===this.scaleBreaks.parent._position)if(d=1===p%2?(d.y<<0)+0.5:d.y<< 0,l=1===p%2?(c.y<<0)+0.5:c.y<<0,"left"===this.scaleBreaks.parent._position?(c=this.chart.plotArea.x1,k=this.chart.plotArea.x2+p/2+0.5<<0):(c=this.chart.plotArea.x2,k=this.chart.plotArea.x1-p/2+0.5<<0,a*=-1),this.bounds={x1:c,y1:d-p/2,x2:k,y2:l+p/2},this.ctx.moveTo(c,d),"straight"===this.type||"left"===this.scaleBreaks.parent._position&&0>=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;m<r;m++)this.ctx.bezierCurveTo(n+a,h+g*a,n+2*a,h+g*a,n+3*a,h),n+=3*a,g*=-1;this.ctx.bezierCurveTo(n+a,h+g*a,n+2*a,h+g*a,n+3*a,h);h=l;g*=-1;this.ctx.lineTo(n,h);for(m=0;m<r;m++)this.ctx.bezierCurveTo(n-a,h+g*a,n-2*a,h+g*a,n-3*a,h),n-=3*a,g*=-1}else if("zigzag"===this.type){g=1;h=d-a;n=c+a;r=(k-n)/a/2;for(m=0;m<r;m++)this.ctx.lineTo(n,h),h+=2*g*a,n+=2*a,g*=-1;this.ctx.lineTo(n,h);h+=l-d;for(m=0;m<r+1;m++)this.ctx.lineTo(n,h),h+=2*g*a,n-=2*a,g*=-1;this.ctx.lineTo(n+a,h+g*a)}0<p&&this.ctx.stroke(); this.ctx.closePath();this.ctx.globalAlpha=this.fillOpacity;this.ctx.globalCompositeOperation="destination-over";this.ctx.fill();this.ctx.restore();this.ctx.globalAlpha=b;this.ctx=f}};ka(ba,T);ba.prototype.createUserOptions=function(a){if("undefined"!==typeof a||this.options._isPlaceholder){var f=0;this.parent.options._isPlaceholder&&this.parent.createUserOptions();this.options._isPlaceholder||(Ea(this.parent.stripLines),f=this.parent.options.stripLines.indexOf(this.options));this.options="undefined"=== typeof a?{}:a;this.parent.options.stripLines[f]=this.options}};ba.prototype.render=function(){this.ctx.save();var a=this.parent.getPixelCoordinatesOnAxis(this.value),f=Math.abs("pixel"===this._thicknessType?this.thickness:this.parent.conversionParameters.pixelPerUnit*this.thickness);if(0<f){var b=null===this.opacity?1:this.opacity;this.ctx.strokeStyle=this.color;this.ctx.beginPath();var c=this.ctx.globalAlpha;this.ctx.globalAlpha=b;P(this.id);var d,g,k,l;this.ctx.lineWidth=f;this.ctx.setLineDash&& this.ctx.setLineDash(F(this.lineDashType,f));if("bottom"===this.parent._position||"top"===this.parent._position)d=g=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,k=this.chart.plotArea.y1,l=this.chart.plotArea.y2,this.bounds={x1:d-f/2,y1:k,x2:g+f/2,y2:l};else if("left"===this.parent._position||"right"===this.parent._position)k=l=1===this.ctx.lineWidth%2?(a.y<<0)+0.5:a.y<<0,d=this.chart.plotArea.x1,g=this.chart.plotArea.x2,this.bounds={x1:d,y1:k-f/2,x2:g,y2:l+f/2};this.ctx.moveTo(d,k);this.ctx.lineTo(g, l);this.ctx.stroke();this.ctx.globalAlpha=c}this.ctx.restore()};ka(ga,T);ga.prototype.render=function(a,f){var b,c,d,g,k=null,l=k=null,n="";if(!this.valueFormatString)if(!w(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType)this.valueFormatString=this.parent.valueFormatString;else{var h=0,h="xySwapped"===this.chart.plotInfo.axisPlacement?50<this.parent.range?0:500<this.chart.width&&25>this.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):50<this.parent.range?0:Math.floor(Math.abs(Math.log(this.parent.range)/Math.LN10))+(5>this.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=w(this.options.labelFontSize)?this.parent.labelFontSize:this.labelFontSize;if("left"===this.parent._position||"right"===this.parent._position)this.labelMaxWidth=w(this.options.labelMaxWidth)?this.parent.bounds.x2-this.parent.bounds.x1:this.labelMaxWidth,this.labelMaxHeight=w(this.options.labelWrap)||this.labelWrap?3*this.chart.height:2*this.labelFontSize;else if("top"===this.parent._position||"bottom"===this.parent._position)this.labelMaxWidth= w(this.options.labelMaxWidth)?3*this.chart.width:this.labelMaxWidth,this.labelMaxHeight=w(this.options.labelWrap)||this.labelWrap?this.parent.bounds.height:2*this.labelFontSize;0<h&&r.setLineDash&&r.setLineDash(F(this.lineDashType,h));l=new ja(r,{x:0,y:0,padding:{top:2,right:3,bottom:2,left:4},backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxWidth:this.labelMaxWidth,maxHeight:this.labelMaxHeight, angle:this.labelAngle,text:n,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"});if(this.snapToDataPoint){var m=0,k=[];if("xySwapped"===this.chart.plotInfo.axisPlacement){var e=null;if("bottom"===this.parent._position||"top"===this.parent._position)m=this.parent.dataSeries[0].axisX.convertPixelToValue({y:f});else if("left"===this.parent._position||"right"=== this.parent._position)m=this.parent.convertPixelToValue({y:f});for(var q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(e.dataSeries=this.parent.dataSeries[q],null!==e.dataPoint.y&&k.push(e));e=null;if(0===k.length)return;k.sort(function(a,b){return a.distance-b.distance});e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y));q=0;if("rangeBar"===k[0].dataSeries.type||"error"===k[0].dataSeries.type)for(var e=Math.abs(a-this.parent.convertValueToPixel(k[q].dataPoint.y[0])), s=0,m=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,q=m);else if("stackedBar"===k[0].dataSeries.type)for(var e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y)),v=s=0,m=q=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a- this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else v+=k[m].dataPoint.y,s=Math.abs(a-this.parent.convertValueToPixel(v)),s<e&&(e=s,q=m);else if("stackedBar100"===k[0].dataSeries.type)for(var e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y)),u=v=s=0,m=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else v+=k[m].dataPoint.y,u=k[m].dataPoint.x.getTime? k[m].dataPoint.x.getTime():k[m].dataPoint.x,u=100*(v/k[m].dataSeries.plotUnit.dataPointYSums[u]),s=Math.abs(a-this.parent.convertValueToPixel(u)),s<e&&(e=s,q=m);else for(e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=q=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(a-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s, q=m);n=k[q];if("bottom"===this.parent._position||"top"===this.parent._position){b=0;if("rangeBar"===this.parent.dataSeries[q].type||"error"===this.parent.dataSeries[q].type){e=Math.abs(a-this.parent.convertValueToPixel(n.dataPoint.y[0]));for(m=s=0;m<n.dataPoint.y.length;m++)s=Math.abs(a-this.parent.convertValueToPixel(n.dataPoint.y[m])),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.y[b])<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y[b])<<0;l.text=this.labelFormatter? this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y[b]}):w(this.options.label)?X(n.dataPoint.y[b],this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedBar"===this.parent.dataSeries[q].type){e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y));v=s=0;for(m=q;0<=m;m--)v+=k[m].dataPoint.y,s=Math.abs(a-this.parent.convertValueToPixel(v)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(v)<<0)+0.5: this.parent.convertValueToPixel(v)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):w(this.options.label)?X(n.dataPoint.y,this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedBar100"===this.parent.dataSeries[q].type){e=Math.abs(a-this.parent.convertValueToPixel(k[0].dataPoint.y));u=v=s=0;for(m=q;0<=m;m--)v+=k[m].dataPoint.y,u=k[m].dataPoint.x.getTime?k[m].dataPoint.x.getTime():k[m].dataPoint.x, u=100*(v/k[m].dataSeries.plotUnit.dataPointYSums[u]),s=Math.abs(a-this.parent.convertValueToPixel(u)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(u)<<0)+0.5:this.parent.convertValueToPixel(u)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:u}):w(this.options.label)?X(u,this.valueFormatString,this.chart._cultureInfo):this.label}else k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.y)<< 0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y)<<0,l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):w(this.options.label)?X(n.dataPoint.y,this.valueFormatString,this.chart._cultureInfo):this.label;b=c=k;d=this.chart.plotArea.y1;g=this.chart.plotArea.y2;this.bounds={x1:b-h/2,y1:d,x2:c+h/2,y2:g};l.x=b-l.measureText().width/2;l.x+l.width>this.chart.bounds.x2?l.x=this.chart.bounds.x2-l.width:l.x<this.chart.bounds.x1&& (l.x=this.chart.bounds.x1);l.y=this.parent.lineCoordinates.y2+l.fontSize/2+2}else if("left"===this.parent._position||"right"===this.parent._position){d=g=k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.x)<<0;b=this.chart.plotArea.x1;c=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-h/2,x2:c,y2:g+h/2};u=!1;if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])u= !0;else{u=!1;break}if(u){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({y:f}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):w(this.options.label)?e.dataPoint.label:this.label)}else!w(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType? l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):w(this.options.label)?ya(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label:!w(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):w(this.options.label)? X(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label);l.y=g+l.fontSize/2-l.measureText().height/2+2;l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.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;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(e.dataSeries=this.parent.dataSeries[q],null!==e.dataPoint.y&&k.push(e));if(0===k.length)return;k.sort(function(a,b){return a.distance-b.distance});n=k[0];b=c=k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.x)<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.x)<<0;d=this.chart.plotArea.y1; g=this.chart.plotArea.y2;this.bounds={x1:b-h/2,y1:d,x2:c+h/2,y2:g};u=!1;if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])u=!0;else{u=!1;break}if(u){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({x:a}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options, crosshair:this.options,value:n.dataPoint.x}):w(this.options.label)?e.dataPoint.label:this.label)}else!w(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):w(this.options.label)?ya(n.dataPoint.x,this.valueFormatString,this.chart._cultureInfo):this.label:!w(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&& "number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.x}):w(this.options.label)?X(n.dataPoint.x,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.x<this.chart.bounds.x1&&(l.x=this.chart.bounds.x1);"bottom"===this.parent._position?l.y=this.parent.lineCoordinates.y2+ l.fontSize/2+2:"top"===this.parent._position&&(l.y=this.parent.lineCoordinates.y1-l.height+l.fontSize/2+2)}else if("left"===this.parent._position||"right"===this.parent._position){!w(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&(m=this.parent.dataSeries[0].axisX.convertPixelToValue({x:a}));for(q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(e.dataSeries=this.parent.dataSeries[q],null!==e.dataPoint.y&&k.push(e));if(0===k.length)return; k.sort(function(a,b){return a.distance-b.distance});q=0;if("rangeColumn"===k[0].dataSeries.type||"rangeArea"===k[0].dataSeries.type||"error"===k[0].dataSeries.type||"rangeSplineArea"===k[0].dataSeries.type||"candlestick"===k[0].dataSeries.type||"ohlc"===k[0].dataSeries.type||"boxAndWhisker"===k[0].dataSeries.type)for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y[0])),m=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f- this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,q=m);else if("stackedColumn"===k[0].dataSeries.type||"stackedArea"===k[0].dataSeries.type)for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=v=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else v+= k[m].dataPoint.y,s=Math.abs(f-this.parent.convertValueToPixel(v)),s<e&&(e=s,q=m);else if("stackedColumn100"===k[0].dataSeries.type||"stackedArea100"===k[0].dataSeries.type)for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=u=v=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else v+=k[m].dataPoint.y,u=k[m].dataPoint.x.getTime?k[m].dataPoint.x.getTime(): k[m].dataPoint.x,u=100*(v/k[m].dataSeries.plotUnit.dataPointYSums[u]),s=Math.abs(f-this.parent.convertValueToPixel(u)),s<e&&(e=s,q=m);else for(e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)),m=s=0;m<k.length;m++)if(k[m].dataPoint.y&&k[m].dataPoint.y.length)for(n=0;n<k[m].dataPoint.y.length;n++)s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y[n])),s<e&&(e=s,q=m);else s=Math.abs(f-this.parent.convertValueToPixel(k[m].dataPoint.y)),s<e&&(e=s,q=m);n=k[q];b=0;if("rangeColumn"=== this.parent.dataSeries[q].type||"rangeArea"===this.parent.dataSeries[q].type||"error"===this.parent.dataSeries[q].type||"rangeSplineArea"===this.parent.dataSeries[q].type||"candlestick"===this.parent.dataSeries[q].type||"ohlc"===this.parent.dataSeries[q].type||"boxAndWhisker"===this.parent.dataSeries[q].type){e=Math.abs(f-this.parent.convertValueToPixel(n.dataPoint.y[0]));for(m=s=0;m<n.dataPoint.y.length;m++)s=Math.abs(f-this.parent.convertValueToPixel(n.dataPoint.y[m])),s<e&&(e=s,b=m);k=1===r.lineWidth% 2?(this.parent.convertValueToPixel(n.dataPoint.y[b])<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y[b])<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y[b]}):w(this.options.label)?X(n.dataPoint.y[b],this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedColumn"===this.parent.dataSeries[q].type||"stackedArea"===this.parent.dataSeries[q].type){e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y)); v=s=0;for(m=q;0<=m;m--)v+=k[m].dataPoint.y,s=Math.abs(f-this.parent.convertValueToPixel(v)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(v)<<0)+0.5:this.parent.convertValueToPixel(v)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):w(this.options.label)?X(n.dataPoint.y,this.valueFormatString,this.chart._cultureInfo):this.label}else if("stackedColumn100"===this.parent.dataSeries[q].type|| "stackedArea100"===this.parent.dataSeries[q].type){e=Math.abs(f-this.parent.convertValueToPixel(k[0].dataPoint.y));v=s=0;for(m=q;0<=m;m--)v+=k[m].dataPoint.y,u=k[m].dataPoint.x.getTime?k[m].dataPoint.x.getTime():k[m].dataPoint.x,u=100*(v/k[m].dataSeries.plotUnit.dataPointYSums[u]),s=Math.abs(f-this.parent.convertValueToPixel(u)),s<e&&(e=s,b=m);k=1===r.lineWidth%2?(this.parent.convertValueToPixel(u)<<0)+0.5:this.parent.convertValueToPixel(u)<<0;l.text=this.labelFormatter?this.labelFormatter({chart:this.chart, axis:this.parent.options,crosshair:this.options,value:u}):w(this.options.label)?X(u,this.valueFormatString,this.chart._cultureInfo):this.label}else"waterfall"===this.parent.dataSeries[q].type?(k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataSeries.dataPointEOs[n.index].cumulativeSum)<<0)+0.5:this.parent.convertValueToPixel(n.dataSeries.dataPointEOs[n.index].cumulativeSum)<<0,l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options, value:n.dataSeries.dataPointEOs[n.index].cumulativeSum}):w(this.options.label)?X(n.dataSeries.dataPointEOs[n.index].cumulativeSum,this.valueFormatString,this.chart._cultureInfo):this.label):(k=1===r.lineWidth%2?(this.parent.convertValueToPixel(n.dataPoint.y)<<0)+0.5:this.parent.convertValueToPixel(n.dataPoint.y)<<0,l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:n.dataPoint.y}):w(this.options.label)?X(n.dataPoint.y,this.valueFormatString, this.chart._cultureInfo):this.label);d=g=k;b=this.chart.plotArea.x1;c=this.chart.plotArea.x2;this.bounds={x1:b,y1:d-h/2,x2:c,y2:g+h/2};l.y=g+l.fontSize/2-l.measureText().height/2+2;l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.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<h&&(r.moveTo(b,d),r.lineTo(c,g),r.stroke()),r.restore(),!w(l.text)&&("number"===typeof l.text.valueOf()||0<l.text.length)&&l.render(!0));("left"===this.parent._position||"right"===this.parent._position)&&(g>=this.parent.convertValueToPixel(this.parent.viewportMaximum)&& d<=this.parent.convertValueToPixel(this.parent.viewportMinimum))&&(0<h&&(r.moveTo(b,d),r.lineTo(c,g),r.stroke()),r.restore(),!w(l.text)&&("number"===typeof l.text.valueOf()||0<l.text.length)&&l.render(!0))}else{if("bottom"===this.parent._position||"top"===this.parent._position)b=c=k=1===r.lineWidth%2?(a<<0)+0.5:a<<0,d=this.chart.plotArea.y1,g=this.chart.plotArea.y2,this.bounds={x1:b-h/2,y1:d,x2:c+h/2,y2:g};else if("left"===this.parent._position||"right"===this.parent._position)d=g=k=1===r.lineWidth% 2?(f<<0)+0.5:f<<0,b=this.chart.plotArea.x1,c=this.chart.plotArea.x2,this.bounds={x1:b,y1:d-h/2,x2:c,y2:g+h/2};if("xySwapped"===this.chart.plotInfo.axisPlacement)if("left"===this.parent._position||"right"===this.parent._position){u=!1;if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])u=!0;else{u=!1;break}if(u){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({y:f}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e= this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):w(this.options.label)?e.dataPoint.label:this.label)}else!w(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(f)}): w(this.options.label)?ya(this.parent.convertPixelToValue(f),this.valueFormatString,this.chart._cultureInfo):this.label:!w(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(f)}):w(this.options.label)?X(this.parent.convertPixelToValue(f),this.valueFormatString,this.chart._cultureInfo):this.label); l.y=f+l.fontSize/2-l.measureText().height/2+2;l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.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)}):w(this.options.label)?X(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.x<this.chart.bounds.x1&&(l.x=this.chart.bounds.x1),"bottom"===this.parent._position&&(l.y=this.parent.lineCoordinates.y2+l.fontSize/2+2),"top"===this.parent._position&& (l.y=this.parent.lineCoordinates.y1-l.height+l.fontSize/2+2)}else if("bottom"===this.parent._position||"top"===this.parent._position){u=!1;n="";if(this.parent.labels)for(k=Math.ceil(this.parent.interval),m=0;m<this.parent.viewportMaximum;m+=k)if(this.parent.labels[m])u=!0;else{u=!1;break}if(u){if("axisX"===this.parent.type)for(m=this.parent.convertPixelToValue({x:a}),e=null,q=0;q<this.parent.dataSeries.length;q++)(e=this.parent.dataSeries[q].getDataPointAtX(m,!0))&&0<=e.index&&(l.text=this.labelFormatter? this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):w(this.options.label)?e.dataPoint.label:this.label)}else!w(this.parent.dataSeries)&&0<this.parent.dataSeries.length&&"dateTime"===this.parent.dataSeries[0].xValueType?l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(a)}):w(this.options.label)?ya(this.parent.convertPixelToValue(a), this.valueFormatString,this.chart._cultureInfo):this.label:!w(this.parent.dataSeries)&&(0<this.parent.dataSeries.length&&"number"===this.parent.dataSeries[0].xValueType)&&(l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:0<this.parent.dataSeries.length?this.parent.convertPixelToValue(a):""}):w(this.options.label)?X(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.x<this.chart.bounds.x1&&(l.x=this.chart.bounds.x1);"bottom"===this.parent._position?l.y=this.parent.lineCoordinates.y2+l.fontSize/2+2:"top"===this.parent._position&&(l.y=this.parent.lineCoordinates.y1-l.height+l.fontSize/2+2)}else if("left"===this.parent._position||"right"===this.parent._position)l.text=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.parent.options,crosshair:this.options,value:this.parent.convertPixelToValue(f)}): w(this.options.label)?X(this.parent.convertPixelToValue(f),this.valueFormatString,this.chart._cultureInfo):this.label,l.y=f+l.fontSize/2-l.measureText().height/2+2,l.y-l.fontSize/2<this.chart.bounds.y1?l.y=this.chart.bounds.y1+l.fontSize/2+2:l.y+l.measureText().height-l.fontSize/2>this.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<h&&(r.moveTo(b,d),r.lineTo(c,g),r.stroke());r.restore();!w(l.text)&&("number"===typeof l.text.valueOf()||0<l.text.length)&&l.render(!0)}r.globalAlpha=p};ka(Z,T);Z.prototype._initialize=function(){if(this.enabled){this.container=document.createElement("div");this.container.setAttribute("class","canvasjs-chart-tooltip");this.container.style.position="absolute";this.container.style.height="auto";this.container.style.boxShadow="1px 1px 2px 2px rgba(0,0,0,0.1)";this.container.style.zIndex="1000";this.container.style.pointerEvents= "none";this.container.style.display="none";var a;a='<div style=" width: auto;height: auto;min-width: 50px;';a+="line-height: auto;";a+="margin: 0px 0px 0px 0px;";a+="padding: 5px;";a+="font-family: Calibri, Arial, Georgia, serif;";a+="font-weight: normal;";a+="font-style: "+(x?"italic;":"normal;");a+="font-size: 14px;";a+="color: #000000;";a+="text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);";a+="text-align: left;";a+="border: 2px solid gray;";a+=x?"background: rgba(255,255,255,.9);":"background: rgb(255,255,255);"; a+="text-indent: 0px;";a+="white-space: nowrap;";a+="border-radius: 5px;";a+="-moz-user-select:none;";a+="-khtml-user-select: none;";a+="-webkit-user-select: none;";a+="-ms-user-select: none;";a+="user-select: none;";x||(a+="filter: alpha(opacity = 90);",a+="filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=135, Color='#666666');");a+='} "> Sample Tooltip</div>';this.container.innerHTML=a;this.contentDiv=this.container.firstChild;this.container.style.borderRadius=this.contentDiv.style.borderRadius; this.chart._canvasJSContainer.appendChild(this.container)}};Z.prototype.mouseMoveHandler=function(a,f){this._lastUpdated&&4>(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this.chart.resetOverlayedCanvas(),this._updateToolTip(a,f))};Z.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;n<this.chart.axisX.length;n++){for(var k=this.chart.axisX[n].convertPixelToValue({y:f}),h=null,c=0;c<this.chart.axisX[n].dataSeries.length;c++)(h=this.chart.axisX[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries= this.chart.axisX[n].dataSeries[c],null!==h.dataPoint.y&&l.push(h));h=null}if(this.chart.axisX2)for(n=0;n<this.chart.axisX2.length;n++){k=this.chart.axisX2[n].convertPixelToValue({y:f});h=null;for(c=0;c<this.chart.axisX2[n].dataSeries.length;c++)(h=this.chart.axisX2[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=this.chart.axisX2[n].dataSeries[c],null!==h.dataPoint.y&&l.push(h));h=null}}else{l=[];if(this.chart.axisX)for(n=0;n<this.chart.axisX.length;n++)for(k=this.chart.axisX[n].convertPixelToValue({x:a}), h=null,c=0;c<this.chart.axisX[n].dataSeries.length;c++)(h=this.chart.axisX[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=this.chart.axisX[n].dataSeries[c],null!==h.dataPoint.y&&l.push(h));if(this.chart.axisX2)for(n=0;n<this.chart.axisX2.length;n++)for(k=this.chart.axisX2[n].convertPixelToValue({x:a}),h=null,c=0;c<this.chart.axisX2[n].dataSeries.length;c++)(h=this.chart.axisX2[n].dataSeries[c].getDataPointAtX(k,b))&&0<=h.index&&(h.dataSeries=this.chart.axisX2[n].dataSeries[c],null!== h.dataPoint.y&&l.push(h))}if(0===l.length)return;l.sort(function(a,b){return a.distance-b.distance});b=l[0];for(c=0;c<l.length;c++)l[c].dataPoint.x.valueOf()===b.dataPoint.x.valueOf()&&g.push(l[c]);l=null}else{if(h=this.chart.getDataPointAtXY(a,f,b))this.currentDataPointIndex=h.dataPointIndex,this.currentSeriesIndex=h.dataSeries.index;else if(x)if(h=Ua(a,f,this.chart._eventManager.ghostCtx),0<h&&"undefined"!==typeof this.chart._eventManager.objectMap[h]){h=this.chart._eventManager.objectMap[h];if("legendItem"=== h.objectType)return;this.currentSeriesIndex=h.dataSeriesIndex;this.currentDataPointIndex=0<=h.dataPointIndex?h.dataPointIndex:-1}else this.currentDataPointIndex=-1;else this.currentDataPointIndex=-1;if(0<=this.currentSeriesIndex){d=this.chart.data[this.currentSeriesIndex];h={};if(0<=this.currentDataPointIndex)c=d.dataPoints[this.currentDataPointIndex],h.dataSeries=d,h.dataPoint=c,h.index=this.currentDataPointIndex,h.distance=Math.abs(c.x-k),"waterfall"===d.type&&(h.cumulativeSumYStartValue=d.dataPointEOs[this.currentDataPointIndex].cumulativeSumYStartValue, h.cumulativeSum=d.dataPointEOs[this.currentDataPointIndex].cumulativeSum);else{if(!this.enabled||"line"!==d.type&&"stepLine"!==d.type&&"spline"!==d.type&&"area"!==d.type&&"stepArea"!==d.type&&"splineArea"!==d.type&&"stackedArea"!==d.type&&"stackedArea100"!==d.type&&"rangeArea"!==d.type&&"rangeSplineArea"!==d.type&&"candlestick"!==d.type&&"ohlc"!==d.type&&"boxAndWhisker"!==d.type)return;k=d.axisX.convertPixelToValue({x:a});h=d.getDataPointAtX(k,b);h.dataSeries=d;this.currentDataPointIndex=h.index; c=h.dataPoint}if(!w(h.dataPoint.y))if(h.dataSeries.axisY)if(0<h.dataPoint.y.length){for(c=b=0;c<h.dataPoint.y.length;c++)h.dataPoint.y[c]<h.dataSeries.axisY.viewportMinimum?b--:h.dataPoint.y[c]>h.dataSeries.axisY.viewportMaximum&&b++;b<h.dataPoint.y.length&&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.cumulativeSumYStartValue<h.dataSeries.axisY.viewportMinimum?b--:h.cumulativeSumYStartValue>h.dataSeries.axisY.viewportMaximum&&b++,h.cumulativeSum<h.dataSeries.axisY.viewportMinimum?b--:h.cumulativeSum>h.dataSeries.axisY.viewportMaximum&&b++,2>b&&-2<b&&g.push(h)): (0<=h.dataSeries.type.indexOf("100")||"stackedColumn"===d.type||"stackedBar"===d.type||h.dataPoint.y>=h.dataSeries.axisY.viewportMinimum&&h.dataPoint.y<=h.dataSeries.axisY.viewportMaximum)&&g.push(h);else g.push(h)}}if(0<g.length&&(this.highlightObjects(g),this.enabled))if(b="",b=this.getToolTipInnerHTML({entries:g}),null!==b){this.contentDiv.innerHTML=b;b=!1;"none"===this.container.style.display&&(b=!0,this.container.style.display="block");try{this.contentDiv.style.background=this.backgroundColor? this.backgroundColor:x?"rgba(255,255,255,.9)":"rgb(255,255,255)",this.borderColor="waterfall"===g[0].dataSeries.type?this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:g[0].dataPoint.color?g[0].dataPoint.color:-1<g[0].dataPoint.y?g[0].dataSeries.risingColor:g[0].dataSeries.fallingColor:"error"===g[0].dataSeries.type?this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor= this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:g[0].dataSeries.color?g[0].dataSeries.color:g[0].dataSeries._colorSet[d.index%g[0].dataSeries._colorSet.length]:this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.options.borderColor?this.options.borderColor:g[0].dataPoint.color?g[0].dataPoint.color:g[0].dataSeries.color?g[0].dataSeries.color:g[0].dataSeries._colorSet[g[0].index%g[0].dataSeries._colorSet.length], this.contentDiv.style.borderWidth=this.borderThickness||0===this.borderThickness?this.borderThickness+"px":"2px",this.contentDiv.style.borderRadius=this.cornerRadius||0===this.cornerRadius?this.cornerRadius+"px":"5px",this.container.style.borderRadius=this.contentDiv.style.borderRadius,this.contentDiv.style.fontSize=this.fontSize||0===this.fontSize?this.fontSize+"px":"14px",this.contentDiv.style.color=this.fontColor?this.fontColor:"#000000",this.contentDiv.style.fontFamily=this.fontFamily?this.fontFamily: "Calibri, Arial, Georgia, serif;",this.contentDiv.style.fontWeight=this.fontWeight?this.fontWeight:"normal",this.contentDiv.style.fontStyle=this.fontStyle?this.fontStyle:x?"italic":"normal"}catch(q){}"pie"===g[0].dataSeries.type||"doughnut"===g[0].dataSeries.type||"funnel"===g[0].dataSeries.type||"pyramid"===g[0].dataSeries.type||"bar"===g[0].dataSeries.type||"rangeBar"===g[0].dataSeries.type||"stackedBar"===g[0].dataSeries.type||"stackedBar100"===g[0].dataSeries.type?a=a-10-this.container.clientWidth: (a=g[0].dataSeries.axisX.convertValueToPixel(g[0].dataPoint.x)-this.container.clientWidth<<0,a-=10);0>a&&(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<f+this.container.clientHeight+5&&(f-=f+this.container.clientHeight+5-0);this.fixMozTransitionDelay(a,f);!this.animationEnabled||b?this.disableAnimation():(this.enableAnimation(), this.container.style.MozTransition=this.mozContainerTransition);this.container.style.left=a+"px";this.container.style.bottom=f+"px"}else this.hide(!1)}};Z.prototype.highlightObjects=function(a){var f=this.chart.overlaidCanvasCtx;this.chart.resetOverlayedCanvas();f.clearRect(0,0,this.chart.width,this.chart.height);f.save();var b=this.chart.plotArea,c=0;f.beginPath();f.rect(b.x1,b.y1,b.x2-b.x1,b.y2-b.y1);f.clip();for(b=0;b<a.length;b++){var d=a[b];if((d=this.chart._eventManager.objectMap[d.dataSeries.dataPointIds[d.index]])&& d.objectType&&"dataPoint"===d.objectType){var c=this.chart.data[d.dataSeriesIndex],g=c.dataPoints[d.dataPointIndex],k=d.dataPointIndex;!1===g.highlightEnabled||!0!==c.highlightEnabled&&!0!==g.highlightEnabled||("line"===c.type||"stepLine"===c.type||"spline"===c.type||"scatter"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"stackedArea"===c.type||"stackedArea100"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type?(g=c.getMarkerProperties(k,d.x1,d.y1,this.chart.overlaidCanvasCtx), g.size=Math.max(1.5*g.size<<0,10),g.borderColor=g.borderColor||"#FFFFFF",g.borderThickness=g.borderThickness||Math.ceil(0.1*g.size),ea.drawMarkers([g]),"undefined"!==typeof d.y2&&(g=c.getMarkerProperties(k,d.x1,d.y2,this.chart.overlaidCanvasCtx),g.size=Math.max(1.5*g.size<<0,10),g.borderColor=g.borderColor||"#FFFFFF",g.borderThickness=g.borderThickness||Math.ceil(0.1*g.size),ea.drawMarkers([g]))):"bubble"===c.type?(g=c.getMarkerProperties(k,d.x1,d.y1,this.chart.overlaidCanvasCtx),g.size=d.size,g.color= "white",g.borderColor="white",f.globalAlpha=0.3,ea.drawMarkers([g]),f.globalAlpha=1):"column"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"bar"===c.type||"rangeBar"===c.type||"stackedBar"===c.type||"stackedBar100"===c.type||"rangeColumn"===c.type||"waterfall"===c.type?W(f,d.x1,d.y1,d.x2,d.y2,"white",0,null,!1,!1,!1,!1,0.3):"pie"===c.type||"doughnut"===c.type?qa(f,d.center,d.radius,"white",c.type,d.startAngle,d.endAngle,0.3,d.percentInnerRadius):"funnel"===c.type||"pyramid"=== c.type?ua(f,d.funnelSection,0.3,"white"):"candlestick"===c.type?(f.globalAlpha=1,f.strokeStyle=d.color,f.lineWidth=2*d.borderThickness,c=0===f.lineWidth%2?0:0.5,f.beginPath(),f.moveTo(d.x3-c,Math.min(d.y2,d.y3)),f.lineTo(d.x3-c,Math.min(d.y1,d.y4)),f.stroke(),f.beginPath(),f.moveTo(d.x3-c,Math.max(d.y1,d.y4)),f.lineTo(d.x3-c,Math.max(d.y2,d.y3)),f.stroke(),W(f,d.x1,Math.min(d.y1,d.y4),d.x2,Math.max(d.y1,d.y4),"transparent",2*d.borderThickness,d.color,!1,!1,!1,!1),f.globalAlpha=1):"ohlc"===c.type? (f.globalAlpha=1,f.strokeStyle=d.color,f.lineWidth=2*d.borderThickness,c=0===f.lineWidth%2?0:0.5,f.beginPath(),f.moveTo(d.x3-c,d.y2),f.lineTo(d.x3-c,d.y3),f.stroke(),f.beginPath(),f.moveTo(d.x3,d.y1),f.lineTo(d.x1,d.y1),f.stroke(),f.beginPath(),f.moveTo(d.x3,d.y4),f.lineTo(d.x2,d.y4),f.stroke(),f.globalAlpha=1):"boxAndWhisker"===c.type?(f.save(),f.globalAlpha=1,f.strokeStyle=d.stemColor,f.lineWidth=2*d.stemThickness,0<d.stemThickness&&(f.beginPath(),f.moveTo(d.x3,d.y2+d.borderThickness/2),f.lineTo(d.x3, d.y1+d.whiskerThickness/2),f.stroke(),f.beginPath(),f.moveTo(d.x3,d.y4-d.whiskerThickness/2),f.lineTo(d.x3,d.y3-d.borderThickness/2),f.stroke()),f.beginPath(),W(f,d.x1-d.borderThickness/2,Math.max(d.y2+d.borderThickness/2,d.y3+d.borderThickness/2),d.x2+d.borderThickness/2,Math.min(d.y2-d.borderThickness/2,d.y3-d.borderThickness/2),"transparent",d.borderThickness,d.color,!1,!1,!1,!1),f.globalAlpha=1,f.strokeStyle=d.whiskerColor,f.lineWidth=2*d.whiskerThickness,0<d.whiskerThickness&&(f.beginPath(), f.moveTo(Math.floor(d.x3-d.whiskerLength/2),d.y4),f.lineTo(Math.ceil(d.x3+d.whiskerLength/2),d.y4),f.stroke(),f.beginPath(),f.moveTo(Math.floor(d.x3-d.whiskerLength/2),d.y1),f.lineTo(Math.ceil(d.x3+d.whiskerLength/2),d.y1),f.stroke()),f.globalAlpha=1,f.strokeStyle=d.lineColor,f.lineWidth=2*d.lineThickness,0<d.lineThickness&&(f.beginPath(),f.moveTo(d.x1,d.y5),f.lineTo(d.x2,d.y5),f.stroke()),f.restore(),f.globalAlpha=1):"error"===c.type&&z(f,d.x1,d.y1,d.x2,d.y2,"white",d.whiskerProperties,d.stemProperties, d.isXYSwapped,0.3))}}f.restore();f.globalAlpha=1;f.beginPath()};Z.prototype.getToolTipInnerHTML=function(a){a=a.entries;for(var f=null,b=null,c=null,d=0,g="",k=!0,l=0;l<a.length;l++)if(a[l].dataSeries.toolTipContent||a[l].dataPoint.toolTipContent){k=!1;break}if(k&&(this.content&&"function"===typeof this.content||this.contentFormatter))a={chart:this.chart,toolTip:this.options,entries:a},f=this.contentFormatter?this.contentFormatter(a):this.content(a);else if(this.shared&&"none"!==this.chart.plotInfo.axisPlacement){for(var n= null,h="",l=0;l<a.length;l++)b=a[l].dataSeries,c=a[l].dataPoint,d=a[l].index,g="",0===l&&(k&&!this.content)&&(this.chart.axisX&&0<this.chart.axisX.length?h+="undefined"!==typeof this.chart.axisX[0].labels[c.x]?this.chart.axisX[0].labels[c.x]:"{x}":this.chart.axisX2&&0<this.chart.axisX2.length&&(h+="undefined"!==typeof this.chart.axisX2[0].labels[c.x]?this.chart.axisX2[0].labels[c.x]:"{x}"),h+="</br>",h=this.chart.replaceKeywordsWithValue(h,c,b,d)),null===c.toolTipContent||"undefined"===typeof c.toolTipContent&& null===b.options.toolTipContent||("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?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>": ""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span> {y}",n=b.axisXIndex):"bubble"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content? this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span> {y}, {z}"):"rangeColumn"===b.type||"rangeBar"===b.type||"rangeArea"===b.type||"rangeSplineArea"===b.type||"error"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content: "<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span> {y[0]}, {y[1]}"):"candlestick"===b.type||"ohlc"===b.type?(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span><br/>Open: {y[0]}<br/>High: {y[1]}<br/>Low: {y[2]}<br/>Close: {y[3]}"): "boxAndWhisker"===b.type&&(this.chart.axisX&&1<this.chart.axisX.length&&(g+=n!=b.axisXIndex?b.axisX.title?b.axisX.title+"<br/>":"X:{axisXIndex}<br/>":""),g+=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>{name}:</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}"), null===f&&(f=""),!0===this.reversed?(f=this.chart.replaceKeywordsWithValue(g,c,b,d)+f,l<a.length-1&&(f="</br>"+f)):(f+=this.chart.replaceKeywordsWithValue(g,c,b,d),l<a.length-1&&(f+="</br>")));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:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+":</span> {y}":"bubble"===b.type?g=c.toolTipContent? c.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+":</span> {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:"<span style='\""+(this.options.fontColor?"": "'color:{color};'")+"\"'>"+(c.name?"{name}:</span> ":c.label?"{label}:</span> ":"</span>")+"{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:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+" :</span> {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:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+"</span><br/>Open: {y[0]}<br/>High: {y[1]}<br/>Low: {y[2]}<br/>Close: {y[3]}":"boxAndWhisker"===b.type&&(g=c.toolTipContent?c.toolTipContent:b.toolTipContent?b.toolTipContent: this.content&&"function"!==typeof this.content?this.content:"<span style='\""+(this.options.fontColor?"":"'color:{color};'")+"\"'>"+(c.label?"{label}":"{x}")+"</span><br/>Minimum: {y[0]}<br/>Q1: {y[1]}<br/>Q2: {y[4]}<br/>Q3: {y[2]}<br/>Maximum: {y[3]}"); null===f&&(f="");f+=this.chart.replaceKeywordsWithValue(g,c,b,d)}return f};Z.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}};Z.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition= "",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};Z.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())};Z.prototype.show=function(a,f,b){this._updateToolTip(a,f,"undefined"===typeof b?!1:b)};Z.prototype.fixMozTransitionDelay=function(a,f){if(20<this.chart._eventManager.lastObjectId)this.mozContainerTransition= this.getContainerTransition(0);else{var b=parseFloat(this.container.style.left),b=isNaN(b)?0:b,c=parseFloat(this.container.style.bottom),c=isNaN(c)?0:c;10<Math.sqrt(Math.pow(b-a,2)+Math.pow(c-f,2))?this.mozContainerTransition=this.getContainerTransition(0.1):this.mozContainerTransition=this.getContainerTransition(0)}};Z.prototype.getContainerTransition=function(a){return"left "+a+"s ease-out 0s, bottom "+a+"s ease-out 0s"};fa.prototype.reset=function(){this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions= [];this.previousDataPointEventObject=null;this.eventObjects=[];x&&(this.ghostCtx.clearRect(0,0,this.chart.width,this.chart.height),this.ghostCtx.beginPath())};fa.prototype.getNewObjectTrackingId=function(){return++this.lastObjectId};fa.prototype.mouseEventHandler=function(a){if("mousemove"===a.type||"click"===a.type){var f=[],b=Ma(a),c=null;if((c=this.chart.getObjectAtXY(b.x,b.y,!1))&&"undefined"!==typeof this.objectMap[c])if(c=this.objectMap[c],"dataPoint"===c.objectType){var d=this.chart.data[c.dataSeriesIndex], g=d.dataPoints[c.dataPointIndex],k=c.dataPointIndex;c.eventParameter={x:b.x,y:b.y,dataPoint:g,dataSeries:d.options,dataPointIndex:k,dataSeriesIndex:d.index,chart:this.chart};c.eventContext={context:g,userContext:g,mouseover:"mouseover",mousemove:"mousemove",mouseout:"mouseout",click:"click"};f.push(c);c=this.objectMap[d.id];c.eventParameter={x:b.x,y:b.y,dataPoint:g,dataSeries:d.options,dataPointIndex:k,dataSeriesIndex:d.index,chart:this.chart};c.eventContext={context:d,userContext:d.options,mouseover:"mouseover", mousemove:"mousemove",mouseout:"mouseout",click:"click"};f.push(this.objectMap[d.id])}else"legendItem"===c.objectType&&(d=this.chart.data[c.dataSeriesIndex],g=null!==c.dataPointIndex?d.dataPoints[c.dataPointIndex]:null,c.eventParameter={x:b.x,y:b.y,dataSeries:d.options,dataPoint:g,dataPointIndex:c.dataPointIndex,dataSeriesIndex:c.dataSeriesIndex,chart:this.chart},c.eventContext={context:this.chart.legend,userContext:this.chart.legend.options,mouseover:"itemmouseover",mousemove:"itemmousemove",mouseout:"itemmouseout", click:"itemclick"},f.push(c));d=[];for(b=0;b<this.mouseoveredObjectMaps.length;b++){g=!0;for(c=0;c<f.length;c++)if(f[c].id===this.mouseoveredObjectMaps[b].id){g=!1;break}g?this.fireEvent(this.mouseoveredObjectMaps[b],"mouseout",a):d.push(this.mouseoveredObjectMaps[b])}this.mouseoveredObjectMaps=d;for(b=0;b<f.length;b++){d=!1;for(c=0;c<this.mouseoveredObjectMaps.length;c++)if(f[b].id===this.mouseoveredObjectMaps[c].id){d=!0;break}d||(this.fireEvent(f[b],"mouseover",a),this.mouseoveredObjectMaps.push(f[b])); "click"===a.type?this.fireEvent(f[b],"click",a):"mousemove"===a.type&&this.fireEvent(f[b],"mousemove",a)}}};fa.prototype.fireEvent=function(a,f,b){if(a&&f){var c=a.eventParameter,d=a.eventContext,g=a.eventContext.userContext;g&&(d&&g[d[f]])&&g[d[f]].call(g,c);"mouseout"!==f?g.cursor&&g.cursor!==b.target.style.cursor&&(b.target.style.cursor=g.cursor):(b.target.style.cursor=this.chart._defaultCursor,delete a.eventParameter,delete a.eventContext);"click"===f&&("dataPoint"===a.objectType&&this.chart.pieDoughnutClickHandler)&& this.chart.pieDoughnutClickHandler.call(this.chart.data[a.dataSeriesIndex],c);"click"===f&&("dataPoint"===a.objectType&&this.chart.funnelPyramidClickHandler)&&this.chart.funnelPyramidClickHandler.call(this.chart.data[a.dataSeriesIndex],c)}};oa.prototype.animate=function(a,f,b,c,d){var g=this;this.chart.isAnimating=!0;d=d||L.easing.linear;b&&this.animations.push({startTime:(new Date).getTime()+(a?a:0),duration:f,animationCallback:b,onComplete:c});for(a=[];0<this.animations.length;)if(f=this.animations.shift(), b=(new Date).getTime(),c=0,f.startTime<=b&&(c=d(Math.min(b-f.startTime,f.duration),0,1,f.duration),c=Math.min(c,1),isNaN(c)||!isFinite(c))&&(c=1),1>c&&a.push(f),f.animationCallback(c),1<=c&&f.onComplete)f.onComplete();this.animations=a;0<this.animations.length?this.animationRequestId=this.chart.requestAnimFrame.call(window,function(){g.animate.call(g)}):this.chart.isAnimating=!1};oa.prototype.cancelAllAnimations=function(){this.animations=[];this.animationRequestId&&this.chart.cancelRequestAnimFrame.call(window, this.animationRequestId);this.animationRequestId=null;this.chart.isAnimating=!1};var L={yScaleAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas,d=f.animationBase;b.drawImage(c,0,0,c.width,c.height,0,d-d*a,b.canvas.width/aa,a*b.canvas.height/aa)}},xScaleAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas,d=f.animationBase;b.drawImage(c,0,0,c.width,c.height,d-d*a,0,a*b.canvas.width/aa,b.canvas.height/aa)}},xClipAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas; b.save();0<a&&b.drawImage(c,0,0,c.width*a,c.height,0,0,c.width*a/aa,c.height/aa);b.restore()}},fadeInAnimation:function(a,f){if(0!==a){var b=f.dest,c=f.source.canvas;b.save();b.globalAlpha=a;b.drawImage(c,0,0,c.width,c.height,0,0,b.canvas.width/aa,b.canvas.height/aa);b.restore()}},easing:{linear:function(a,f,b,c){return b*a/c+f},easeOutQuad:function(a,f,b,c){return-b*(a/=c)*(a-2)+f},easeOutQuart:function(a,f,b,c){return-b*((a=a/c-1)*a*a*a-1)+f},easeInQuad:function(a,f,b,c){return b*(a/=c)*a+f},easeInQuart:function(a, f,b,c){return b*(a/=c)*a*a*a+f}}},ea={drawMarker:function(a,f,b,c,d,g,k,l){if(b){var n=1;b.fillStyle=g?g:"#000000";b.strokeStyle=k?k:"#000000";b.lineWidth=l?l:0;"circle"===c?(b.moveTo(a,f),b.beginPath(),b.arc(a,f,d/2,0,2*Math.PI,!1),g&&b.fill(),l&&(k?b.stroke():(n=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=n))):"square"===c?(b.beginPath(),b.rect(a-d/2,f-d/2,d,d),g&&b.fill(),l&&(k?b.stroke():(n=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha= n))):"triangle"===c?(b.beginPath(),b.moveTo(a-d/2,f+d/2),b.lineTo(a+d/2,f+d/2),b.lineTo(a,f-d/2),b.closePath(),g&&b.fill(),l&&(k?b.stroke():(n=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=n)),b.beginPath()):"cross"===c&&(b.strokeStyle=g,b.lineWidth=d/4,b.beginPath(),b.moveTo(a-d/2,f-d/2),b.lineTo(a+d/2,f+d/2),b.stroke(),b.moveTo(a+d/2,f-d/2),b.lineTo(a-d/2,f+d/2),b.stroke())}},drawMarkers:function(a){for(var f=0;f<a.length;f++){var b=a[f];ea.drawMarker(b.x,b.y,b.ctx, b.type,b.size,b.color,b.borderColor,b.borderThickness)}}};return s}();y.Chart.version="v2.0 Beta 2"})(); /* excanvas is used to support IE678 which do not implement HTML5 Canvas Element. You can safely remove the following excanvas code if you don't need to support older browsers. Copyright 2006 Google Inc. https://code.google.com/p/explorercanvas/ Licensed under the Apache License, Version 2.0 */ document.createElement("canvas").getContext||function(){function V(){return this.context_||(this.context_=new C(this))}function W(a,b,c){var g=M.call(arguments,2);return function(){return a.apply(b,g.concat(M.call(arguments)))}}function N(a){return String(a).replace(/&/g,"&").replace(/"/g,""")}function O(a){a.namespaces.g_vml_||a.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");a.namespaces.g_o_||a.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML"); a.styleSheets.ex_canvas_||(a=a.createStyleSheet(),a.owningElement.id="ex_canvas_",a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}")}function X(a){var b=a.srcElement;switch(a.propertyName){case "width":b.getContext().clearRect();b.style.width=b.attributes.width.nodeValue+"px";b.firstChild.style.width=b.clientWidth+"px";break;case "height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+ "px"}}function Y(a){a=a.srcElement;a.firstChild&&(a.firstChild.style.width=a.clientWidth+"px",a.firstChild.style.height=a.clientHeight+"px")}function D(){return[[1,0,0],[0,1,0],[0,0,1]]}function t(a,b){for(var c=D(),g=0;3>g;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++;1<c&&c--;return 1>6*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("<g_vml_:stroke", ' opacity="',c,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',$[a.lineCap]||"square",'"',' weight="',e,'px"',' color="',g,'" />')}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<d;r++){var t=f[r];n.push(t.offset*m+u+" "+t.color)}b.push('<g_vml_:fill type="',e.type_,'"',' method="none" focus="100%"',' color="',p,'"',' color2="',c,'"',' colors="',n.join(","),'"',' opacity="',a,'"',' g_o_:opacity2="',k,'"',' angle="',h,'"',' focusposition="',g,",",l,'" />')}else e instanceof I?k&&n&&b.push("<g_vml_:fill",' position="',-c.x/k*f*f,",",-c.y/n*d*d,'"',' type="tile"',' src="',e.src_,'" />'):(e=G(a.fillStyle),b.push('<g_vml_:fill color="',e.color,'" opacity="',e.alpha*a.globalAlpha,'" />'))}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;b<a.length;b++)this.initElement(a[b])},initElement:function(a){if(!a.getContext){a.getContext= V;O(a.ownerDocument);a.innerHTML="";a.attachEvent("onpropertychange",X);a.attachEvent("onresize",Y);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth;b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};U.init();for(var v=[],d=0;16>d;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(" <g_vml_:group",' coordsize="',10*q,",",10*q,'"',' coordorigin="0,0"',' style="width:', 10,"px;height:",10,"px;position:absolute;");if(1!=this.m_[0][0]||this.m_[0][1]||1!=this.m_[1][1]||this.m_[1][0]){var t=[];t.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",k(m.x/q),",","Dy=",k(m.y/q),"");var v=s(this,c+e,g),w=s(this,c,g+d);c=s(this,c+e,g+d);m.x=x.max(m.x,v.x,w.x,c.x);m.y=x.max(m.y,v.y,w.y,c.y);p.push("padding:0 ",k(m.x/q),"px ",k(m.y/q),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",t.join(""),", sizingmethod='clip');")}else p.push("top:", k(m.y/q),"px;left:",k(m.x/q),"px;");p.push(' ">','<g_vml_:image src="',a.src,'"',' style="width:',q*e,"px;"," height:",q*d,'px"',' cropleft="',r/l,'"',' croptop="',y/u,'"',' cropright="',(l-r-n)/l,'"',' cropbottom="',(u-y-h)/u,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stroke=function(a){var b=[];b.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"',' coordsize="',10*q,",",10*q,'"', ' stroked="',!a,'"',' path="');for(var c={x:null,y:null},d={x:null,y:null},e=0;e<this.currentPath_.length;e++){var f=this.currentPath_[e];switch(f.type){case "moveTo":b.push(" m ",k(f.x),",",k(f.y));break;case "lineTo":b.push(" l ",k(f.x),",",k(f.y));break;case "close":b.push(" x ");f=null;break;case "bezierCurveTo":b.push(" c ",k(f.cp1x),",",k(f.cp1y),",",k(f.cp2x),",",k(f.cp2y),",",k(f.x),",",k(f.y));break;case "at":case "wa":b.push(" ",f.type," ",k(f.x-this.arcScaleX_*f.radius),",",k(f.y-this.arcScaleY_* f.radius)," ",k(f.x+this.arcScaleX_*f.radius),",",k(f.y+this.arcScaleY_*f.radius)," ",k(f.xStart),",",k(f.yStart)," ",k(f.xEnd),",",k(f.yEnd))}if(f){if(null==c.x||f.x<c.x)c.x=f.x;if(null==d.x||f.x>d.x)d.x=f.x;if(null==c.y||f.y<c.y)c.y=f.y;if(null==d.y||f.y>d.y)d.y=f.y}}b.push(' ">');a?T(this,b,c,d):S(this,b);b.push("</g_vml_:shape>");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('<g_vml_:line from="',-d,' 0" to="',r,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!e,'" stroked="',!!e,'" style="position:absolute;width:1px;height:1px;">');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('<g_vml_:skew on="t" matrix="',e,'" ',' offset="',b,'" origin="',d,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',N(a),'" style="v-text-align:',l,";font:",N(p),'" /></g_vml_:line>');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",'<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>'),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}(); /* CanvasJS jQuery Charting Plugin - 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(b,c,d,e){b.fn.CanvasJSChart=function(a){if(a){var b=this.first();a=new CanvasJS.Chart(this[0],a);b.children(".canvasjs-chart-container").data("canvasjsChartRef",a);a.render();return this}return this.first().children(".canvasjs-chart-container").data("canvasjsChartRef")}})(jQuery,window,document);Save