From: Russ Handorf Date: Tue, 18 Apr 2017 12:35:24 +0000 (-0400) Subject: initial commit X-Git-Url: https://handorf.org/code/?a=commitdiff_plain;p=power-brultech.git initial commit --- 15a89bd5978dbab9f488f1b0d2d99fda464da15e diff --git a/charts/canvas/breaker-live-broken.php b/charts/canvas/breaker-live-broken.php new file mode 100644 index 0000000..096591c --- /dev/null +++ b/charts/canvas/breaker-live-broken.php @@ -0,0 +1,80 @@ + + + + + + + + + +
+
+ + diff --git a/charts/canvas/breaker.php b/charts/canvas/breaker.php new file mode 100644 index 0000000..6b60014 --- /dev/null +++ b/charts/canvas/breaker.php @@ -0,0 +1,81 @@ + + + + + + + + + +
+
+ + diff --git a/charts/canvas/canvasjs.min.js b/charts/canvas/canvasjs.min.js new file mode 100644 index 0000000..1cd5a8c --- /dev/null +++ b/charts/canvas/canvasjs.min.js @@ -0,0 +1,648 @@ +/* + CanvasJS HTML5 & JavaScript Charts - v1.9.8 GA - http://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. + http://canvasjs.com/license-canvasjs/ + +*/ +(function(){function U(a,d){a.prototype=Pa(d.prototype);a.prototype.constructor=a;a.base=d.prototype}function Pa(a){function d(){}d.prototype=a;return new d}function Ha(a,d,b){"millisecond"===b?a.setMilliseconds(a.getMilliseconds()+1*d):"second"===b?a.setSeconds(a.getSeconds()+1*d):"minute"===b?a.setMinutes(a.getMinutes()+1*d):"hour"===b?a.setHours(a.getHours()+1*d):"day"===b?a.setDate(a.getDate()+1*d):"week"===b?a.setDate(a.getDate()+7*d):"month"===b?a.setMonth(a.getMonth()+1*d):"year"===b&&a.setFullYear(a.getFullYear()+ +1*d);return a}function O(a,d){var b=!1;0>a&&(b=!0,a*=-1);a=""+a;for(d=d?d:1;a.length>16).toString(16),b=((a&65280)>>8).toString(16);a=((a&255)>>0).toString(16);d=2>d.length?"0"+d:d;b=2>b.length?"0"+b:b;a=2>a.length?"0"+a:a;return"#"+d+b+a}function Ra(a,d){var b=this.length>>>0,c=Number(d)|| +0,c=0>c?Math.ceil(c):Math.floor(c);for(0>c&&(c+=b);cb;b++)if(a[b]!==a[b+4]|a[b]!==a[b+8]|a[b]!==a[b+12]){d=!1;break}return d?a[0]<< +16|a[1]<<8|a[2]:0}function L(a,d,b){return a in d?d[a]:b[a]}function ra(a,d,b){if(u&&Ma){var c=a.getContext("2d");sa=c.webkitBackingStorePixelRatio||c.mozBackingStorePixelRatio||c.msBackingStorePixelRatio||c.oBackingStorePixelRatio||c.backingStorePixelRatio||1;Q=za/sa;a.width=d*Q;a.height=b*Q;za!==sa&&(a.style.width=d+"px",a.style.height=b+"px",c.scale(Q,Q))}else a.width=d,a.height=b}function Sa(a){if(!Aa){var d=!1,b=!1;"undefined"===typeof ca.Chart.creditHref?(a.creditHref="http://canvasjs.com/", +a.creditText=""):(d=a.updateOption("creditText"),b=a.updateOption("creditHref"));if(a.creditHref&&a.creditText){a._creditLink||(a._creditLink=document.createElement("a"),a._creditLink.setAttribute("class","canvasjs-chart-credit"),a._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:2px;top:"+(a.height-14)+"px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"),a._creditLink.setAttribute("tabIndex", +-1),a._creditLink.setAttribute("target","_blank"));if(0===a.renderCount||d||b)a._creditLink.setAttribute("href",a.creditHref),a._creditLink.innerHTML=a.creditText;a._creditLink&&a.creditHref&&a.creditText?(a._creditLink.parentElement||a._canvasJSContainer.appendChild(a._creditLink),a._creditLink.style.top=a.height-14+"px"):a._creditLink.parentElement&&a._canvasJSContainer.removeChild(a._creditLink)}}}function ga(a,d){var b=document.createElement("canvas");b.setAttribute("class","canvasjs-chart-canvas"); +ra(b,a,d);u||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(b);return b}function Ba(a,d,b){if(a&&d&&b){b=b+"."+d;var c="image/"+d;a=a.toDataURL(c);var f=!1,g=document.createElement("a");g.download=b;g.href=a;g.target="_blank";if("undefined"!==typeof Blob&&new Blob){for(var h=a.replace(/^data:[a-z/]*;base64,/,""),h=atob(h),l=new ArrayBuffer(h.length),l=new Uint8Array(l),k=0;k
Please right click on the image and save it to your device
"),d.document.close()}}}function T(a,d,b){d.getAttribute("state")!== +b&&(d.setAttribute("state",b),d.setAttribute("type","button"),d.style.position="relative",d.style.margin="0px 0px 0px 0px",d.style.padding="3px 4px 0px 4px",d.style.cssFloat="left",d.setAttribute("title",a._cultureInfo[b+"Text"]),d.innerHTML=""+a._cultureInfo[b+"Text"]+"")}function ta(){for(var a=null,d=0;da[g].x&&0k?{x:a[l].x+k/3,y:a[l].y+c/3}:{x:a[l].x,y:a[l].y+c/9};l=f;g=0===l?0:l-1;h=l===a.length-1?l:l+1;c=Math.abs((a[h].x-a[g].x)/(0===a[l].x-a[g].x?0.01:a[l].x-a[g].x))*(d-1)/2+1;k=(a[h].x-a[g].x)/c;c=(a[h].y-a[g].y)/c;b[b.length]=a[l].x>a[g].x&&0k?{x:a[l].x-k/3,y:a[l].y-c/3}:{x:a[l].x,y:a[l].y-c/9};b[b.length]=a[f]}return b}function Na(a,d){if(null===a||"undefined"===typeof a)return d;var b=parseFloat(a.toString())* +(0<=a.toString().indexOf("%")?d/100:1);return!isNaN(b)&&b<=d&&0<=b?b:d}function ja(a,d,b,c,f){"undefined"===typeof f&&(f=0);this._padding=f;this._x1=a;this._y1=d;this._x2=b;this._y2=c;this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding}function W(a,d){W.base.constructor.call(this,"TextBlock",d);this.ctx=a;this._isDirty=!0;this._wrappedText=null}function ma(a,d){ma.base.constructor.call(this,"Title",d,a.theme,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx; +this.optionsName="title";if(x(this.options.margin)&&a.options.subtitles)for(var b=a.options.subtitles,c=0;cthis.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&& +(this.labelAngle-=360);if(this.options.stripLines&&0t?"a":"p";case "tt":return 12>t?"am":"pm";case "T":return 12>t?"A":"P";case "TT":return 12>t?"AM":"PM";case "K":return q?"UTC":(String(l).match(g)|| +[""]).pop().replace(h,"");case "z":return(0a?!0:!1;c&&(a*=-1);var f=b?b.decimalSeparator:".",g=b?b.digitGroupSeparator:",",h="";d=String(d);var h=1,l=b="",k=-1,m=[],n=[],p=0,e=0,r=0,q=!1,s=0,l=d.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g); +d=null;for(var v=0;l&&vk)k=v;else{if("%"===d)h*=100;else if("\u2030"===d){h*=1E3;continue}else if(","===d[0]&&"."===d[d.length-1]){h/=Math.pow(1E3,d.length-1);k=v+d.length-1;continue}else"E"!==d[0]&&"e"!==d[0]||"0"!==d[d.length-1]||(q=!0);0>k?(m.push(d),"#"===d||"0"===d?p++:","===d&&r++):(n.push(d),"#"!==d&&"0"!==d||e++)}q&&(d=Math.floor(a),l=-Math.floor(Math.log(a)/Math.LN10+1),s=0===a?0:0===d?-(p+l):String(d).length-p,h/=Math.pow(10,s));0>k&&(k=v);h=(a*h).toFixed(e); +d=h.split(".");h=(d[0]+"").split("");a=(d[1]+"").split("");h&&"0"===h[0]&&h.shift();for(q=l=v=e=k=0;0s?d.replace("+","").replace("-",""):d.replace("-",""),b+=d.replace(/[0]+/,function(a){return O(s,a.length)}));g="";for(m=!1;0s?d.replace("+","").replace("-",""):d.replace("-",""),g+=d.replace(/[0]+/,function(a){return O(s,a.length)}));b+=(m?f:"")+g;return c?"-"+b:b},xa=function(a){var d=0,b=0;a=a||window.event;a.offsetX||0===a.offsetX?(d=a.offsetX,b=a.offsetY):a.layerX||0==a.layerX?(d=a.layerX,b=a.layerY):(d=a.pageX-a.target.offsetLeft,b=a.pageY-a.target.offsetTop);return{x:d,y:b}},Ma=!0,za=window.devicePixelRatio||1,sa=1,Q=Ma?za/sa:1,Aa=window&&window.location&&window.location.href&& +window.location.href.indexOf&&(-1!==window.location.href.indexOf("canvasjs.com")||-1!==window.location.href.indexOf("fiddle")),Ta={reset:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAKRSURBVEiJrdY/iF1FFMfxzwnZrGISUSR/JLGIhoh/QiRNBLWxMLIWEkwbgiAoFgoW2mhlY6dgpY2IlRBRxBSKhSAKIklWJRYuMZKAhiyopAiaTY7FvRtmZ+/ed9/zHRjezLw5v/O9d86cuZGZpmURAfdn5o9DfdZNLXpjz+LziPgyIl6MiG0jPTJzZBuyDrP4BVm0P/AKbljTb4ToY/gGewYA7KyCl+1b3DUYANvwbiHw0gCAGRzBOzjTAXEOu0cC4Ch+r5x/HrpdrcZmvIDFSucMtnYCYC++6HmNDw8FKDT34ETrf639/azOr5vwRk/g5fbeuABtgC04XWk9VQLciMP4EH/3AFzErRNC7MXlQmsesSoHsGPE23hmEoBW+61K66HMXFmIMvN8myilXS36R01ub+KfYvw43ZXwYDX+AHP4BAci4pFJomfmr/ihmNofESsBImJGk7mlncrM45n5JPbhz0kAWpsv+juxaX21YIPmVJS2uNzJMS6ZNexC0d+I7fUWXLFyz2kSZlpWPvASlmqAf/FXNXf3FAF2F/1LuFifAlionB6dRuSI2IwHi6lzmXmp6xR8XY0fiIh7psAwh+3FuDkRHQVjl+a8lkXjo0kLUKH7XaV5oO86PmZ1FTzyP4K/XGl9v/zwfbW7BriiuETGCP5ch9bc9f97HF/vcFzCa5gdEPgWq+t/4v0V63oE1uF4h0DiFJ7HnSWMppDdh1dxtsPvJ2wcBNAKbsJXa0Ck5opdaBPsRNu/usba09i1KsaAVzmLt3sghrRjuK1Tf4xkegInxwy8gKf7dKMVH2QRsV5zXR/Cftyu+aKaKbbkQrsdH+PTzLzcqzkOQAVzM+7FHdiqqe2/YT4zF/t8S/sPmawyvC974vcAAAAASUVORK5CYII="}, +pan:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAJVSURBVFiFvZe7a1RBGMV/x2hWI4JpfKCIiSBKOoOCkID/wP4BFqIIFkE02ChIiC8QDKlSiI3YqRBsBVGwUNAUdiIEUgjiAzQIIsuKJsfizsXr5t7d+8jmwLDfzHz3nLOzc7+ZxTZlGyDgZiWOCuJ9wH2gCUyuqQFgF/AGcKJNrYkBYBj40CIet+muGQi/96kM4WS7C/Tm5VUg7whJg8BkEGkCR4BDYfodsADUgP6wErO5iCtswsuJb32hdbXy8qzL5TIdmzJinHdZoZIBZcSFkGlAKs1Z3YCketZcBtouuaQNkrblMiBpBrhme7mAgU4wMCvpcFsDkq4C54DFVRTH9h+i6vlE0r5UA5ImgCuh28jB28iIs7BIVCOeStoZD64P4uPAjUTygKSx2FsK2TIwkugfk9Qkfd/E+yMWHQCeSRqx/R3gOp3LazfaS2C4B5gHDgD7U9x3E3uAH7KNpC3AHHAwTL4FHgM9GQ8vAaPA0dB/Abxqk2/gBLA9MXba9r1k/d4LfA3JtwueBeM58ucS+edXnAW23wP10N3advEi9CXizTnyN4bPS7Zn4sH/dq3t18AY4e1YLYSy3g/csj2VnFshZPuOpOeSKHCodUINuGj7YetE6je1PV9QoNPJ9StNHKodx7nRbiWrGHBGXAi5DUiqtQwtpcWK0Jubt8CltA5MEV1IfwO7+VffPwGfia5m34CT4bXujIIX0Qna1/cGMNqV/wUJE2czxD8CQ4X5Sl7Jz7SILwCDpbjKPBRMHAd+EtX4HWV5Spdc2w8kDQGPbH8py/MXMygM69/FKz4AAAAASUVORK5CYII="}, +zoom:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAMqSURBVFiFvdfbj91TFMDxz57U6GUEMS1aYzyMtCSSDhWjCZMInpAI3khE/QHtgzdRkXgSCS8SES9epKLi0oRKNETjRahREq2KS1stdRujtDPtbA97n5zdn9+5zJxTK9k5v3POXmt991p7r71+IcaoGwkhTOIebMRqzOBTvIG3Y4zTXRmqSoyx5cAKbMJOHMFJnMZ8/jyFaXyMR7G6nb1aH22cP4BvcBxziG3GKfyTIR9D6BYg1KUghPBCDveFlb/24Av8iuUYw41YVsz5G7uxKcZ4aMEpwGt5NY3V/YbHsQ6rcAHOw/kYxigewr5CZw4fYGxBKcCLOFEYehXrMdRhr5yLETxVScsOLOkKAPfn1TYMPIvLFrShUlS2FDZm8XRHACzFAWl3R2xbqPMCYhmeLCAOYEMngAczbcTvuHYxzguIy/FesR9e6gSwU/OoPYHBHgHgviIKX2Flq7k34KhmcVnbi/PC8JX4MgMcxb118wZwdz5aISscqx7VRcox7MrPQ7i+btIAJrAkf9+bI9EPmZY2IAxiTSuAldLq4Y9+AcSUh78KP0tbAcwU35cXMD1JCIFUoGiehlqAz6TNB1f1C0DK+0h+nsNPrQC2a4bqGmlD9kOGcWt+Po6pVgDvSxfJaSkFd4UQBvoAsBYbCoB3a2flM7slA0R8iyt6rAFDeDPbm8eOTpVwGD9qVq7nLbIaZnmksPU1JtsCZMXNmpdRxFasWITzh6Xj3LCzra1OxcD2QjHiGVzdpfORnMqZio2PcF23ABdJF1Np4BPptlyPi6WzPYBzpJZtHe7A6xW9cnyP8TqA//SEIYRL8Bxul7rihvwgtVn78WcGGZXa9HGd5TDujDHuOePXNiHdKjWgZX/YbsxLx/ktqbjVzTlcjUSnvI5JrdlUVp6WesZZ6R1hRrpq9+EVTGS9jTjYAuKIouGpbcurEkIYxC051KNSamazsc+xK8b4S0VnEi/j0hqTP+M27O258egQwZuzs7pI7Mf4WQXIEDc5s9sux+5+1Py2EmP8UOq6GvWhIScxfdYjUERiAt9Jd84J6a16zf8JEKT3yCm8g1UxRv8CC4pyRhzR1uUAAAAASUVORK5CYII="}, +menu:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAgCAYAAAAbifjMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMTUvMTTPsvU0AAAAP0lEQVRIie2SMQoAIBDDUvH/X667g8sJJ9KOhYYOkW0qGaU1MPdC0vGSbV19EACo3YMPAFH5BUBUjsqfAPpVXtNgGDfxEDCtAAAAAElFTkSuQmCC"}};(function(){z.fSDec=function(a){for(var d="",b=0;b=(new Date).getTime()-a._dropDownCloseTime.getTime()||(a._dropdownMenu.style.display="block",a._menuButton.blur(),a._dropdownMenu.focus())},!0));if(!this._dropdownMenu&&this.exportEnabled&&u){this._dropdownMenu=document.createElement("div");this._dropdownMenu.setAttribute("tabindex", +-1);this._dropdownMenu.style.cssText="position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer;right: 1px;top: 25px;min-width: 120px;outline: 0;border: 1px solid silver;font-size: 14px;font-family: Calibri, Verdana, sans-serif;padding: 5px 0px 5px 0px;text-align: left;background-color: #fff;line-height: 20px;box-shadow: 2px 2px 10px #888888;";a._dropdownMenu.style.display="none";this._toolBar.appendChild(this._dropdownMenu);K(this._dropdownMenu, +"blur",function(){Y(a._dropdownMenu);a._dropDownCloseTime=new Date},!0);var d=document.createElement("div");d.style.cssText="padding: 2px 15px 2px 10px";d.innerHTML=this._cultureInfo.printText;this._dropdownMenu.appendChild(d);K(d,"mouseover",function(){this.style.backgroundColor="#EEEEEE"},!0);K(d,"mouseout",function(){this.style.backgroundColor="transparent"},!0);K(d,"click",function(){a.print();Y(a._dropdownMenu)},!0);d=document.createElement("div");d.style.cssText="padding: 2px 15px 2px 10px"; +d.innerHTML=this._cultureInfo.saveJPGText;this._dropdownMenu.appendChild(d);K(d,"mouseover",function(){this.style.backgroundColor="#EEEEEE"},!0);K(d,"mouseout",function(){this.style.backgroundColor="transparent"},!0);K(d,"click",function(){Ba(a.canvas,"jpeg",a.exportFileName);Y(a._dropdownMenu)},!0);d=document.createElement("div");d.style.cssText="padding: 2px 15px 2px 10px";d.innerHTML=this._cultureInfo.savePNGText;this._dropdownMenu.appendChild(d);K(d,"mouseover",function(){this.style.backgroundColor= +"#EEEEEE"},!0);K(d,"mouseout",function(){this.style.backgroundColor="transparent"},!0);K(d,"click",function(){Ba(a.canvas,"png",a.exportFileName);Y(a._dropdownMenu)},!0)}"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?T(a,a._zoomButton,"zoom"):T(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&T(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)};A.prototype._updateSize=function(){var a=0,d=0;this.options.width?a=this.width:this.width=a=0a&&"undefined"!==typeof l.startTimePercent?a>=l.startTimePercent&&l.animationCallback(l.easingFunction(a-l.startTimePercent,0,1,1-l.startTimePercent),l):l.animationCallback(l.easingFunction(a,0,1,1),l);k.dispatchEvent("dataAnimationIterationEnd",{chart:k})},function(){c=[];for(var a=0;aa.dataSeriesIndexes.length))for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=0;hb.max&&(b.max=c);fd.max&&(d.max=f);if(0q&&(q=1/q);b.minDiff>q&&1!==q&&(b.minDiff=q)}else q=c-l.dataPoints[k- +1].x,0>q&&(q*=-1),b.minDiff>q&&0!==q&&(b.minDiff=q);null!==f&&null!==l.dataPoints[k-1].y&&(a.axisY.logarithmic?(q=f/l.dataPoints[k-1].y,1>q&&(q=1/q),d.minDiff>q&&1!==q&&(d.minDiff=q)):(q=f-l.dataPoints[k-1].y,0>q&&(q*=-1),d.minDiff>q&&0!==q&&(d.minDiff=q)))}if(cr&&!n)n=!0;else if(c>r&&n)continue;l.dataPoints[k].label&&(a.axisX.labels[c]=l.dataPoints[k].label);cb.viewPortMax&&(b.viewPortMax=c);null=== +f?b.viewPortMin===c&&pd.viewPortMax&&(d.viewPortMax=f))}}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":"number"}};A.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=[],l=[],k=Infinity,m=0;mb.max&&(b.max=c);if(0w&&(w=1/ +w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-n.dataPoints[p-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);null!==f&&null!==n.dataPoints[p-1].y&&(a.axisY.logarithmic?0w&&(w=1/w),d.minDiff>w&&1!==w&&(d.minDiff=w)):(w=f-n.dataPoints[p-1].y,0>w&&(w*=-1),d.minDiff>w&&0!==w&&(d.minDiff=w)))}if(cv&&!r)r=!0;else if(c>v&&r)continue;n.dataPoints[p].label&&(a.axisX.labels[c]=n.dataPoints[p].label); +cb.viewPortMax&&(b.viewPortMax=c);null===n.dataPoints[p].y?b.viewPortMin===c&&qd.max&&(d.max=a),pb.viewPortMax||(ad.viewPortMax&& +(d.viewPortMax=a)));for(p in l)l.hasOwnProperty(p)&&!isNaN(p)&&(a=l[p],ad.max&&(d.max=a),pb.viewPortMax||(ad.viewPortMax&&(d.viewPortMax=a)))}};A.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=!1,l=!1,k=[],m=0;mb.max&&(b.max=c);if(0w&&(w=1/w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-n.dataPoints[p-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);x(f)||null===n.dataPoints[p-1].y||(a.axisY.logarithmic?0w&&(w=1/w),d.minDiff>w&&1!==w&&(d.minDiff=w)):(w=f-n.dataPoints[p-1].y,0>w&&(w*=-1),d.minDiff>w&&0!==w&&(d.minDiff=w)))}if(cv&&!r)r=!0;else if(c>v&&r)continue;n.dataPoints[p].label&&(a.axisX.labels[c]=n.dataPoints[p].label); +cb.viewPortMax&&(b.viewPortMax=c);null===f?b.viewPortMin===c&&qf&&(l=!0),k[c]=k[c]?k[c]+Math.abs(f):Math.abs(f))}}this.plotInfo.axisXValueType=n.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(d.max=x(d.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(d.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),d.min=x(d.viewPortMin)?1:Math.min(d.viewPortMin, +1)):h&&!l?(d.max=x(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=x(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):h&&l?(d.max=x(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=x(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99)):!h&&l&&(d.max=x(d.viewPortMax)?-1:Math.max(d.viewPortMax,-1),d.min=x(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99));d.viewPortMin=d.min;d.viewPortMax=d.max;a.dataPointYSums=k}};A.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d= +a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g,h,l=!1,k=0;kb.max&&(b.max=c);gd.max&&(d.max=h);0q&&(q=1/q),b.minDiff>q&&1!==q&&(b.minDiff=q)):(q=c-m.dataPoints[n-1].x,0>q&&(q*=-1),b.minDiff>q&&0!==q&&(b.minDiff=q)),f&&(null!==f[0]&&m.dataPoints[n-1].y&&null!==m.dataPoints[n-1].y[0])&&(a.axisY.logarithmic?(q=f[0]/ +m.dataPoints[n-1].y[0],1>q&&(q=1/q),d.minDiff>q&&1!==q&&(d.minDiff=q)):(q=f[0]-m.dataPoints[n-1].y[0],0>q&&(q*=-1),d.minDiff>q&&0!==q&&(d.minDiff=q))));if(!(cw&&!e)e=!0;else if(c>w&&e)continue;m.dataPoints[n].label&&(a.axisX.labels[c]=m.dataPoints[n].label);cb.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&f)for(y=0;yd.viewPortMax&&(d.viewPortMax=h))}}this.plotInfo.axisXValueType=m.xValueType=l?"dateTime":"number"}};A.prototype.getDataPointAtXY=function(a,d,b){b=b||!1;for(var c=[],f=this._dataInRenderedOrder.length-1;0<=f;f--){var g=null;(g=this._dataInRenderedOrder[f].getDataPointAtXY(a,d,b))&&c.push(g)}a=null;d=!1;for(b=0;b=f.x1&&(a<=f.x2&&d>=f.y1&&d<=f.y2)&&(c=f.id)}return c};A.prototype.getAutoFontSize=function(a,d,b){a/=400;return Math.max(10,Math.round(Math.min(this.width,this.height)*a))};A.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};A.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))};A.prototype.attachEvent= +function(a){this._events.push(a)};A.prototype._touchEventHandler=function(a){if(a.changedTouches&&this.interactivityEnabled){var d=[],b=a.changedTouches,c=b?b[0]:a,f=null;switch(a.type){case "touchstart":case "MSPointerDown":d=["mousemove","mousedown"];this._lastTouchData=xa(c);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":d=["mousemove"];break;case "touchend":case "MSPointerUp":d="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType?["mouseup", +"click"]:["mouseup"];break;default:return}if(!(b&&1h)){this._lastTouchData.scroll=!0;var l=window.parent||window;l&&l.scrollBy&&l.scrollBy(0,-g)}}catch(k){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(b=0;b=f.x1&&d.x<=f.x2&&d.y>=f.y1&&d.y<=f.y2){c[b].call(c.context,d.x,d.y);"mousedown"===b&&!0===c.capture?(A.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(d.xb.x2||d.yb.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};A.prototype._plotAreaMouseDown= +function(a,d){this.isDrag=!0;this.dragStartPoint={x:a,y:d}};A.prototype._plotAreaMouseUp=function(a,d){if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var b=d-this.dragStartPoint.y,c=a-this.dragStartPoint.x,f=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),h=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=f,f=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(f=g=0;fb.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,h=!0):b.viewportMinimumb.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,h=!0);else if((!f||2Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,d);if((!f||2e)var r=e,e=p,p=r;if(isFinite(h.dataInfo.minDiff))if(!(h.logarithmic&&e/ph.maximum))k.push(h),n.push({val1:p,val2:e}),l=!0;else if(!f){l=!1;break}}return{isValid:l,axesWithValidRange:k,axesRanges:n}};A.prototype.preparePlotArea=function(){var a=this.plotArea;!u&&(0b.lineCoordinates.x2?d.x2:b.lineCoordinates.x2;a.y2=d.y2>d.y1?d.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0b.lineCoordinates.x2?d.x2:b.lineCoordinates.x2,a.y2=d.y2>d.y1?d.y2:b.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else d= +this.layoutManager.getFreeSpace(),a.x1=d.x1,a.x2=d.x2,a.y1=d.y1,a.y2=d.y2,a.width=d.width,a.height=d.height;u||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0Z.viewportMaximum||m.dataPoint.yaa.viewportMaximum)continue}else if(0<=n.indexOf("column")){if(m.dataPoint.xZ.viewportMaximum||m.bounds.y1>b.y2||m.bounds.y2Z.viewportMaximum||m.bounds.x1> +b.x2||m.bounds.x2Z.viewportMaximum)continue;f=h=2;"horizontal"===y?(l=r.width,k=r.height):(k=r.width,l=r.height);if("normal"===this.plotInfo.axisPlacement){if(0<=n.indexOf("line")||0<=n.indexOf("area"))w="auto",h=4;else if(0<=n.indexOf("stacked"))"auto"===w&&(w="inside");else if("bubble"===n||"scatter"===n)w="inside";p=m.point.x-l/2;"inside"!==w?(f=b.y1,g=b.y2,0m.point.y)):(e=m.point.y+h+c,e>g-k-h-c&&(e="auto"===w?Math.min(m.point.y,g)-k-h-c:g-k-h-c,z=eg-k-h&&("bubble"===n||"scatter"===n)&& +(e=Math.min(m.point.y+h,b.y2-k-h))),e=Math.min(e,g-k))}else 0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("scatter")?(w="auto",f=4):0<=n.indexOf("stacked")?"auto"===w&&(w="inside"):"bubble"===n&&(w="inside"),e=m.point.y-k/2,"inside"!==w?(h=b.x1,g=b.x2,0>D?(p=m.point.x-l-f-c,pm.point.x)):(p=m.point.x+f+c,p>g-l-f-c&&(p="auto"===w?Math.min(m.point.x,g)-l-f-c:g-l-f-c,z=pD?Math.max(m.bounds.x1,b.x1)+l/2+f:Math.min(m.bounds.x2,b.x2)-l/2-f:(Math.max(m.bounds.x1,b.x1)+Math.min(m.bounds.x2,b.x2))/2,p=0>D?Math.max(m.point.x,c)-l/2:Math.min(m.point.x,c)-l/2,p=Math.max(p,h));"vertical"===y&&(e+=k);r.x=p;r.y=e;r.render(!0);v&&("inside"!==w&&(0>n.indexOf("bar")&&m.point.x>b.x1&&m.point.xn.indexOf("column")&&m.point.y>b.y1&&m.point.y=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;d.save();var c=this.plotArea;d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();for(var c=[],f=null,g=0;ga.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!y)))if("number"!==typeof k[s].y)0k[s].y===a.axisY.reversed?1:-1,color:e})}d.stroke();u&&b.stroke()}}P.drawMarkers(c); +l.markerColor=f;d.restore();d.beginPath();u&&b.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;d.save();var c=this.plotArea;d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();for(var c=[],f=null,g=0;ga.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!y)))if("number"!==typeof k[s].y)0k[s].y===a.axisY.reversed?1:-1,color:e})}d.stroke();u&&b.stroke()}}P.drawMarkers(c);l.markerColor=f;d.restore();d.beginPath();u&&b.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderSpline=function(a){function d(a){a=ua(a,2);if(0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var f=this.plotArea;b.beginPath();b.rect(f.x1,f.y1,f.width,f.height);b.clip();for(var f=[],g=null,h=0;ha.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!w)))if("number"!==typeof m[s].y)0m[s].y===a.axisY.reversed?1:-1,color:r});w=!1}d(y)}P.drawMarkers(f);k.markerColor=g;b.restore();b.beginPath();u&&c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};var N=function(a,d,b,c,f,g,h,l,k,m,n,p,e){"undefined"===typeof e&&(e=1);h=h||0;l=l||"black"; +var r=15=a.dataSeriesIndexes.length)){var b=null, +c=this.plotArea,f=0,g,h,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.dataPointMinWidth=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=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,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth= +this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>m&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(n=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width, +c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(c=0;ca.axisX.dataInfo.viewPortMax)&&"number"===typeof e[f].y){g=a.axisX.convertValueToPixel(l);h= +a.axisY.convertValueToPixel(e[f].y);g=a.axisX.reversed?g+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+c)*n<<0:g-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+c)*n<<0;var q=a.axisX.reversed?g-n<<0:g+n<<0,s;0<=e[f].y?s=k:(s=h,h=k);h>s&&(b=h,h=s,s=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,g,h,q,s,b,0,null,r&&0<=e[f].y,0>e[f].y&&r,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:f, +x1:g,y1:h,x2:q,y2:s};b=G(b);u&&N(this._eventManager.ghostCtx,g,h,q,s,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:e[f],dataSeries:p,point:{x:g+(q-g)/2,y:0>e[f].y===a.axisY.reversed?h:s},direction:0>e[f].y===a.axisY.reversed?1:-1,bounds:{x1:g,y1:Math.min(h,s),x2:q,y2:Math.max(h,s)},color:b})}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(k,a.axisY.bounds.y2);return{source:d, +dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth: +this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>n&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){var c=a.axisX.convertValueToPixel(b),v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic)h[b]=q[l].y+(h[b]?h[b]:0),0q[l].y&&s,!1,!1,r.fillOpacity);b=r.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:k,x2:w,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,k,w,y,b,0,null,!1,!1,!1,!1);(q[l].indexLabel||r.indexLabel||q[l].indexLabelFormatter||r.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:q[l],dataSeries:r,point:{x:c,y:0<=q[l].y?k:y},direction:0>q[l].y===a.axisY.reversed?1: +-1,bounds:{x1:v,y1:Math.min(k,y),x2:w,y2:Math.max(k,y)},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(m,a.axisY.bounds.y2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedColumn100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic? +a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&& +l>n&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){c=a.axisX.convertValueToPixel(b);k=0!==a.dataPointYSums[b]?100*(q[l].y/a.dataPointYSums[b]):0;var v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic){h[b]=k+(h[b]?h[b]:0);if(0>=h[b])continue;k=a.axisY.convertValueToPixel(h[b]); +y=f[b]?f[b]:m;f[b]=k}else if(k=a.axisY.convertValueToPixel(k),0<=q[l].y){var t=f[b]?f[b]:0;k-=t;y=m-t;f[b]=t+(y-k)}else t=g[b]?g[b]:0,y=k+t,k=m+t,g[b]=t+(y-k);b=q[l].color?q[l].color:r._colorSet[l%r._colorSet.length];N(d,v,k,w,y,b,0,null,s&&0<=q[l].y,0>q[l].y&&s,!1,!1,r.fillOpacity);b=r.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:k,x2:w,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,k,w,y,b,0,null,!1,!1,!1,!1);(q[l].indexLabel|| +r.indexLabel||q[l].indexLabelFormatter||r.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:q[l],dataSeries:r,point:{x:c,y:0<=q[l].y?k:y},direction:0>q[l].y===a.axisY.reversed?1:-1,bounds:{x1:v,y1:Math.min(k,y),x2:w,y2:Math.max(k,y)},color:b})}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(m,a.axisY.bounds.y2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderBar= +function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)|| +(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>m&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(n=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath(); +d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(c=0;ca.axisX.dataInfo.viewPortMax)&&"number"=== +typeof e[f].y){h=a.axisX.convertValueToPixel(l);g=a.axisY.convertValueToPixel(e[f].y);h=a.axisX.reversed?h+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+c)*n<<0:h-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+c)*n<<0;var q=a.axisX.reversed?h-n<<0:h+n<<0,s;0<=e[f].y?s=k:(s=g,g=k);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,s,h,g,q,b,0,null,r,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:m, +dataPointIndex:f,x1:s,y1:h,x2:g,y2:q};b=G(b);u&&N(this._eventManager.ghostCtx,s,h,g,q,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:e[f],dataSeries:p,point:{x:0<=e[f].y?g:s,y:h+(q-h)/2},direction:0>e[f].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(s,g),y1:h,x2:Math.max(s,g),y2:q},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(k,a.axisX.bounds.x2);return{source:d, +dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth? +this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>n&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){var c=a.axisX.convertValueToPixel(b),v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic)h[b]=q[l].y+(h[b]?h[b]:0),0q[l].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(y, +k),y1:v,x2:Math.max(y,k),y2:w},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(m,a.axisX.bounds.x2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedBar100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum: +0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>n&&(l=Math.min(this.dataPointWidth? +this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){var c=a.axisX.convertValueToPixel(b),v;v=0!==a.dataPointYSums[b]?100*(q[l].y/a.dataPointYSums[b]):0;var w=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,y=w+p<<0;if(a.axisY.logarithmic){h[b]=v+(h[b]?h[b]:0);if(0>=h[b])continue;v=f[b]?f[b]:m;f[b]=k=a.axisY.convertValueToPixel(h[b])}else if(k= +a.axisY.convertValueToPixel(v),0<=q[l].y){var t=f[b]?f[b]:0;v=m+t;k+=t;f[b]=t+(k-v)}else t=g[b]?g[b]:0,v=k-t,k=m-t,g[b]=t+(k-v);b=q[l].color?q[l].color:r._colorSet[l%r._colorSet.length];N(d,v,w,k,y,b,0,null,s,!1,!1,!1,r.fillOpacity);b=r.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:w,x2:k,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,w,k,y,b,0,null,!1,!1,!1,!1);(q[l].indexLabel||r.indexLabel||q[l].indexLabelFormatter||r.indexLabelFormatter)&& +this._indexLabels.push({chartType:"stackedBar100",dataPoint:q[l],dataSeries:r,point:{x:0<=q[l].y?k:v,y:c},direction:0>q[l].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v,k),y1:w,x2:Math.max(v,k),y2:y},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(m,a.axisX.bounds.x2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderArea=function(a){function d(){t&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates, +g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!J)))if("number"!==typeof p[r].y)n.connectNullData|| +(J||e)||d(),J=!0;else{q=a.axisX.convertValueToPixel(v);s=a.axisY.convertValueToPixel(p[r].y);e||J?(!e&&n.connectNullData?(b.setLineDash&&(n.options.nullDataLineDashType||z===n.lineDashType&&n.lineDashType!==n.nullDataLineDashType)&&(b.stroke(),z=n.nullDataLineDashType,b.setLineDash(A)),b.lineTo(q,s),u&&c.lineTo(q,s)):(b.beginPath(),b.moveTo(q,s),u&&(c.beginPath(),c.moveTo(q,s)),t={x:q,y:s}),J=e=!1):(b.lineTo(q,s),u&&c.lineTo(q,s),0==r%250&&d());rp[r].y===a.axisY.reversed?1:-1,color:D})}d();P.drawMarkers(h);n.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderSplineArea= +function(a){function d(){var d=ua(y,2);if(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=s:0>a.axisY.viewportMaximum?v= +g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width, +k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!q)))if("number"!==typeof p[e].y)0p[e].y===a.axisY.reversed?1:-1, +color:t});q=!1}d();P.drawMarkers(h);n.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepArea=function(a){function d(){t&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height), +c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!D))){var H=s;"number"!==typeof p[r].y?(n.connectNullData||(D||e)||d(),D=!0):(q=a.axisX.convertValueToPixel(v),s=a.axisY.convertValueToPixel(p[r].y),e||D?(!e&&n.connectNullData?(b.setLineDash&&(n.options.nullDataLineDashType||B===n.lineDashType&&n.lineDashType!== +n.nullDataLineDashType)&&(b.stroke(),B=n.nullDataLineDashType,b.setLineDash(R)),b.lineTo(q,H),b.lineTo(q,s),u&&(c.lineTo(q,H),c.lineTo(q,s))):(b.beginPath(),b.moveTo(q,s),u&&(c.beginPath(),c.moveTo(q,s)),t={x:q,y:s}),D=e=!1):(b.lineTo(q,H),u&&c.lineTo(q,H),b.lineTo(q,s),u&&c.lineTo(q,s),0==r%250&&d()),rp[r].y===a.axisY.reversed?1:-1,color:x}))}d();P.drawMarkers(h);n.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea=function(a){function d(){if(!(1>k.length)){for(0=a.dataSeriesIndexes.length)){var c=null,f=[],g=null,h=this.plotArea,l=[],k=[],m=[],n=[],p=0,e,r,q,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;u&&v.beginPath();b.save();u&&v.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(v.beginPath(),v.rect(h.x1,h.y1,h.width,h.height), +v.clip());for(var w=[],h=0;ha.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!J)))if("number"!==typeof H.y)t.connectNullData||(J||w)||d(), +J=!0;else{e=a.axisX.convertValueToPixel(q);var ea=l[q]?l[q]:0;if(a.axisY.logarithmic){n[q]=H.y+(n[q]?n[q]:0);if(0>=n[q])continue;r=a.axisY.convertValueToPixel(n[q])}else r=a.axisY.convertValueToPixel(H.y),r-=ea;k.push({x:e,y:s-ea});l[q]=s-r;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||A===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(b.stroke(),A=t.nullDataLineDashType,b.setLineDash(B)),b.lineTo(e,r),u&&v.lineTo(e,r)):(b.beginPath(),b.moveTo(e,r),u&&(v.beginPath(), +v.moveTo(e,r))),J=w=!1):(b.lineTo(e,r),u&&v.lineTo(e,r),0==p%250&&(d(),b.moveTo(e,r),u&&v.moveTo(e,r),k.push({x:e,y:s-ea})));pD[p].y===a.axisY.reversed?1:-1,color:c})}}d();b.moveTo(e,r);u&&v.moveTo(e,r)}delete t.dataPointIndexes;t.markerColor=g}P.drawMarkers(f);b.restore();u&&v.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea100=function(a){function d(){for(0=a.dataSeriesIndexes.length)){var c=null,f=this.plotArea,g=[],h=null,l=[],k=[],m=[],n=[],p=0,e,r,q,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;b.save();u&&v.save();b.beginPath();b.rect(f.x1,f.y1,f.width,f.height);b.clip(); +u&&(v.beginPath(),v.rect(f.x1,f.y1,f.width,f.height),v.clip());for(var w=[],f=0;fa.axisX.dataInfo.viewPortMax&& +(!t.connectNullData||!J)))if("number"!==typeof H.y)t.connectNullData||(J||w)||d(),J=!0;else{var ea;ea=0!==a.dataPointYSums[q]?100*(H.y/a.dataPointYSums[q]):0;e=a.axisX.convertValueToPixel(q);var fa=l[q]?l[q]:0;if(a.axisY.logarithmic){n[q]=ea+(n[q]?n[q]:0);if(0>=n[q])continue;r=a.axisY.convertValueToPixel(n[q])}else r=a.axisY.convertValueToPixel(ea),r-=fa;k.push({x:e,y:s-fa});l[q]=s-r;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||B===t.lineDashType&&t.lineDashType!== +t.nullDataLineDashType)&&(b.stroke(),B=t.nullDataLineDashType,b.setLineDash(E)),b.lineTo(e,r),u&&v.lineTo(e,r)):(b.beginPath(),b.moveTo(e,r),u&&(v.beginPath(),v.moveTo(e,r))),J=w=!1):(b.lineTo(e,r),u&&v.lineTo(e,r),0==p%250&&(d(),b.moveTo(e,r),u&&v.moveTo(e,r),k.push({x:e,y:s-fa})));px[p].y===a.axisY.reversed?1:-1,color:c})}}d();b.moveTo(e,r);u&&v.moveTo(e,r)}delete t.dataPointIndexes;t.markerColor=h}P.drawMarkers(g);b.restore();u&&v.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}}; +A.prototype.renderBubble=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,c=0,f,g;d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var h=-Infinity,l=Infinity,k=0;ka.axisX.dataInfo.viewPortMax||"undefined"===typeof p[c].z||(e=p[c].z,e>h&&(h=e),ea.axisX.dataInfo.viewPortMax)&&"number"===typeof p[c].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(p[c].y);var e=p[c].z,q=2*Math.max(Math.sqrt((h===l?b/2:r+(b-r)/(h-l)*(e-l))/Math.PI)<<0,1),e=n.getMarkerProperties(c,d);e.size=q;d.globalAlpha=n.fillOpacity;P.drawMarker(f,g,d,e.type,e.size,e.color,e.borderColor,e.borderThickness);d.globalAlpha=1;var s=n.dataPointIds[c];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:c,x1:f,y1:g,size:q}; +q=G(s);u&&P.drawMarker(f,g,this._eventManager.ghostCtx,e.type,e.size,q,q,e.borderThickness);(p[c].indexLabel||n.indexLabel||p[c].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:p[c],dataSeries:n,point:{x:f,y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null})}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad, +animationBase:0}}};A.prototype.renderScatter=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,c=0,f,g;d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var h=0;ha.axisX.dataInfo.viewPortMax)&&"number"===typeof m[c].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(m[c].y);var e=k.getMarkerProperties(c,f,g,d);d.globalAlpha=k.fillOpacity;P.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderColor,e.borderThickness);d.globalAlpha= +1;Math.sqrt((n-f)*(n-f)+(p-g)*(p-g))Math.min(this.plotArea.width,this.plotArea.height)||(n=k.dataPointIds[c],this._eventManager.objectMap[n]={id:n,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:c,x1:f,y1:g},n=G(n),u&&P.drawMarker(e.x,e.y,this._eventManager.ghostCtx,e.type,e.size,n,n,e.borderThickness),(m[c].indexLabel||k.indexLabel||m[c].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:m[c],dataSeries:k,point:{x:f, +y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null}),n=f,p=g)}}}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderCandlestick=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var c=null,c=this.plotArea,f=0,g,h,l,k,m,n,f=this.dataPointMinWidth? +this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width;var p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.7*c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&& +(this.dataPointMinWidth&&gg&&(p=g);d.save();u&&b.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(b.beginPath(),b.rect(c.x1,c.y1,c.width,c.height),b.clip());for(var e=0;ea.axisX.dataInfo.viewPortMax)&&null!==s[f].y&&s[f].y.length&&"number"===typeof s[f].y[0]&&"number"===typeof s[f].y[1]&&"number"===typeof s[f].y[2]&&"number"===typeof s[f].y[3]){g=a.axisX.convertValueToPixel(n);h=a.axisY.convertValueToPixel(s[f].y[0]);l=a.axisY.convertValueToPixel(s[f].y[1]);k=a.axisY.convertValueToPixel(s[f].y[2]);m=a.axisY.convertValueToPixel(s[f].y[3]);var w=g-p/2<<0,y=w+p<<0,c=s[f].color?s[f].color:q._colorSet[0],t=Math.round(Math.max(1,0.15*p)),x=0===t%2?0:0.5,z=q.dataPointIds[f]; +this._eventManager.objectMap[z]={id:z,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:f,x1:w,y1:h,x2:y,y2:l,x3:g,y3:k,x4:g,y4:m,borderThickness:t,color:c};d.strokeStyle=c;d.beginPath();d.lineWidth=t;b.lineWidth=Math.max(t,4);"candlestick"===q.type?(d.moveTo(g-x,l),d.lineTo(g-x,Math.min(h,m)),d.stroke(),d.moveTo(g-x,Math.max(h,m)),d.lineTo(g-x,k),d.stroke(),N(d,w,Math.min(h,m),y,Math.max(h,m),s[f].y[0]<=s[f].y[3]?q.risingColor:c,t,c,v,v,!1,!1,q.fillOpacity),u&&(c=G(z),b.strokeStyle=c,b.moveTo(g- +x,l),b.lineTo(g-x,Math.min(h,m)),b.stroke(),b.moveTo(g-x,Math.max(h,m)),b.lineTo(g-x,k),b.stroke(),N(b,w,Math.min(h,m),y,Math.max(h,m),c,0,null,!1,!1,!1,!1))):"ohlc"===q.type&&(d.moveTo(g-x,l),d.lineTo(g-x,k),d.stroke(),d.beginPath(),d.moveTo(g,h),d.lineTo(w,h),d.stroke(),d.beginPath(),d.moveTo(g,m),d.lineTo(y,m),d.stroke(),u&&(c=G(z),b.strokeStyle=c,b.moveTo(g-x,l),b.lineTo(g-x,k),b.stroke(),b.beginPath(),b.moveTo(g,h),b.lineTo(w,h),b.stroke(),b.beginPath(),b.moveTo(g,m),b.lineTo(y,m),b.stroke())); +(s[f].indexLabel||q.indexLabel||s[f].indexLabelFormatter||q.indexLabelFormatter)&&this._indexLabels.push({chartType:q.type,dataPoint:s[f],dataSeries:q,point:{x:w+(y-w)/2,y:a.axisY.reversed?k:l},direction:1,bounds:{x1:w,y1:Math.min(l,k),x2:y,y2:Math.max(l,k)},color:c})}}d.restore();u&&b.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx; +if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.03*this.width;var l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(l)/Math.log(a.axisX.range):Math.abs(l)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<< +0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(l=g);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var k=0;ka.axisX.dataInfo.viewPortMax)&&null!==p[f].y&&p[f].y.length&&"number"===typeof p[f].y[0]&&"number"===typeof p[f].y[1]){b=a.axisX.convertValueToPixel(h);c=a.axisY.convertValueToPixel(p[f].y[0]);g=a.axisY.convertValueToPixel(p[f].y[1]);var r=a.axisX.reversed?b+a.plotType.totalDataSeries*l/2-(a.previousDataSeriesCount+ +k)*l<<0:b-a.plotType.totalDataSeries*l/2+(a.previousDataSeriesCount+k)*l<<0,q=a.axisX.reversed?r-l<<0:r+l<<0,b=p[f].color?p[f].color:n._colorSet[f%n._colorSet.length];if(c>g){var s=c,c=g;g=s}s=n.dataPointIds[f];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:f,x1:r,y1:c,x2:q,y2:g};N(d,r,c,q,g,b,0,b,e,e,!1,!1,n.fillOpacity);b=G(s);u&&N(this._eventManager.ghostCtx,r,c,q,g,b,0,null,!1,!1,!1,!1);if(p[f].indexLabel||n.indexLabel||p[f].indexLabelFormatter|| +n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:p[f],dataSeries:n,indexKeyword:0,point:{x:r+(q-r)/2,y:p[f].y[1]>=p[f].y[0]?g:c},direction:p[f].y[1]>=p[f].y[0]?-1:1,bounds:{x1:r,y1:Math.min(c,g),x2:q,y2:Math.max(c,g)},color:b}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:p[f],dataSeries:n,indexKeyword:1,point:{x:r+(q-r)/2,y:p[f].y[1]>=p[f].y[0]?c:g},direction:p[f].y[1]>=p[f].y[0]?1:-1,bounds:{x1:r,y1:Math.min(c,g),x2:q,y2:Math.max(c,g)},color:b})}}d.restore(); +u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,l,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth: +Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range):Math.abs(k)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(k=g);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax)&&null!==e[f].y&&e[f].y.length&&"number"===typeof e[f].y[0]&&"number"===typeof e[f].y[1]){c=a.axisY.convertValueToPixel(e[f].y[0]);g=a.axisY.convertValueToPixel(e[f].y[1]);h=a.axisX.convertValueToPixel(l);h=a.axisX.reversed?h+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+m)*k<<0:h-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+m)*k<<0;var q=a.axisX.reversed?h-k<<0:h+k<<0;c>g&&(b=c,c= +g,g=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,c,h,g,q,b,0,null,r,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:c,y1:h,x2:g,y2:q};b=G(b);u&&N(this._eventManager.ghostCtx,c,h,g,q,b,0,null,!1,!1,!1,!1);if(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:0,point:{x:e[f].y[1]>= +e[f].y[0]?c:g,y:h+(q-h)/2},direction:e[f].y[1]>=e[f].y[0]?-1:1,bounds:{x1:Math.min(c,g),y1:h,x2:Math.max(c,g),y2:q},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:1,point:{x:e[f].y[1]>=e[f].y[0]?g:c,y:h+(q-h)/2},direction:e[f].y[1]>=e[f].y[0]?1:-1,bounds:{x1:Math.min(c,g),y1:h,x2:Math.max(c,g),y2:q},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad, +animationBase:0}}};A.prototype.renderRangeArea=function(a){function d(){if(w){var a=null;0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(h=0;ha.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!E)))if(null!==n[e].y&&n[e].y.length&&"number"===typeof n[e].y[0]&&"number"=== +typeof n[e].y[1]){r=a.axisX.convertValueToPixel(v);q=a.axisY.convertValueToPixel(n[e].y[0]);s=a.axisY.convertValueToPixel(n[e].y[1]);p||E?(m.connectNullData&&!p?(b.setLineDash&&(m.options.nullDataLineDashType||z===m.lineDashType&&m.lineDashType!==m.nullDataLineDashType)&&(l[l.length-1].newLineDashArray=B,z=m.nullDataLineDashType,b.setLineDash(A)),b.lineTo(r,q),u&&c.lineTo(r,q),l.push({x:r,y:s})):(b.beginPath(),b.moveTo(r,q),w={x:r,y:q},l=[],l.push({x:r,y:s}),u&&(c.beginPath(),c.moveTo(r,q))),E=p= +!1):(b.lineTo(r,q),l.push({x:r,y:s}),u&&c.lineTo(r,q),0==e%250&&d());v=m.dataPointIds[e];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:e,x1:r,y1:q,y2:s};en[e].y[1]===a.axisY.reversed?-1:1,color:y}),this._indexLabels.push({chartType:"rangeArea",dataPoint:n[e],dataSeries:m,indexKeyword:1,point:{x:r,y:s},direction:n[e].y[0]>n[e].y[1]===a.axisY.reversed?1:-1,color:y})}else E||p||d(),E=!0;d();P.drawMarkers(f);m.markerColor=g}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx, +animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderRangeSplineArea=function(a){function d(a,d){var e=ua(q,2);if(0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(h=0;ha.axisX.dataInfo.viewPortMax&&(!k.connectNullData|| +!e)))if(null!==m[n].y&&m[n].y.length&&"number"===typeof m[n].y[0]&&"number"===typeof m[n].y[1]){p=a.axisX.convertValueToPixel(p);e=a.axisY.convertValueToPixel(m[n].y[0]);r=a.axisY.convertValueToPixel(m[n].y[1]);var A=k.dataPointIds[n];this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:n,x1:p,y1:e,y2:r};q[q.length]={x:p,y:e};s[s.length]={x:p,y:r};nb)){"undefined"===typeof l&&(l=1);if(!u){var m=Number((h%(2*Math.PI)).toFixed(8));Number((g% +(2*Math.PI)).toFixed(8))===m&&(h-=1E-4)}a.save();a.globalAlpha=l;"pie"===f?(a.beginPath(),a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,g,h,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===f&&(a.beginPath(),a.arc(d.x,d.y,b,g,h,!1),0<=k&&a.arc(d.x,d.y,k*b,h,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};A.prototype.renderPie=function(a){function d(){if(m&&n){for(var a=0,b=0,c=0,d=0,f=0;fMath.PI/2-w&&l.midAnglel.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-w&&l.midAngle<3*Math.PI/2+w){if(0===b||r[d].midAngle>l.midAngle)d=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new W(k.plotArea.ctx,{fontSize:l.indexLabelFontSize,fontFamily:l.indexLabelFontFamily,fontColor:l.indexLabelFontColor,fontStyle:l.indexLabelFontStyle, +fontWeight:l.indexLabelFontWeight,horizontalAlign:"left",backgroundColor:l.indexLabelBackgroundColor,maxWidth:l.indexLabelMaxWidth,maxHeight:l.indexLabelWrap?5*l.indexLabelFontSize:1.5*l.indexLabelFontSize,text:l.indexLabelText,padding:0,textBaseline:"top"});l.indexLabelTextBlock.measureText()}h=g=0;p=!1;for(f=0;fMath.PI/2-w&&l.midAngle3*Math.PI/2-w&&l.midAngle<3*Math.PI/2+w)&&(h<=b/2&&!p?(l.hemisphere="left",h++):(l.hemisphere="right",p=!0))}}function b(a){var b=k.plotArea.ctx;b.clearRect(e.x1,e.y1,e.width,e.height);b.fillStyle=k.backgroundColor;b.fillRect(e.x1,e.y1,e.width,e.height);for(b=0;bc){var f=0.07*B*Math.cos(r[b].midAngle),g=0.07*B*Math.sin(r[b].midAngle),l=!1;if(n[b].exploded){if(1E-9a.indexLabelTextBlock.y?e-d:c-f}function f(a){for(var b=null,d=1;dc(r[b],r[a])||("right"===r[a].hemisphere?r[b].indexLabelTextBlock.y>=r[a].indexLabelTextBlock.y: +r[b].indexLabelTextBlock.y<=r[a].indexLabelTextBlock.y)))break;else b=null;return b}function g(a,b,d){d=(d||0)+1;if(1E3b&&h.indexLabelTextBlock.yl)return 0;var p=0,m=0,m=p=p=0;0>b?h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2>k&&h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2+bl&&(b=h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2+b-l);b=h.indexLabelTextBlock.y+b;k=0;k="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2)):t.x-Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2));m=t.x+B*Math.cos(h.midAngle);p=t.y+B*Math.sin(h.midAngle);p=Math.sqrt(Math.pow(k-m,2)+Math.pow(b-p,2));m=Math.acos(B/s);p=Math.acos((s*s+B*B-p*p)/(2*B*s));b=pc(r[k],r[a])||("right"===r[a].hemisphere?r[k].indexLabelTextBlock.y<=r[a].indexLabelTextBlock.y:r[k].indexLabelTextBlock.y>=r[a].indexLabelTextBlock.y)))break;else k=null;m=k;p=f(a);l=k=0;0>b?(l="right"===h.hemisphere?m:p,e=b,null!==l&&(m=-b,b=h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-(r[l].indexLabelTextBlock.y+ +r[l].indexLabelTextBlock.height/2),b-m+k.toFixed(y)&&(e=b>q?-(b-q):-(m-(l-k)))))):0q?b-q:m-(k-l)))));e&&(d=h.indexLabelTextBlock.y+e,b=0,b="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(d-t.y,2)):t.x-Math.sqrt(Math.pow(s, +2)-Math.pow(d-t.y,2)),h.midAngle>Math.PI/2-w&&h.midAnglek.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===h.hemisphere&&("left"===a.hemisphere&&b3*Math.PI/2-w&&h.midAngle<3*Math.PI/2+w&&(k=(a-1+r.length)%r.length,k=r[k],a=r[(a+1+r.length)%r.length],"right"===h.hemisphere&&"left"===k.hemisphere&& +ba.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),h.indexLabelTextBlock.y=d,h.indexLabelTextBlock.x=b,h.indexLabelAngle=Math.atan2(h.indexLabelTextBlock.y-t.y,h.indexLabelTextBlock.x-t.x))}return e}function h(){var a=k.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,d=0,l=!0,b=0;10>b&&(1>b||0z){for(var A=u=0,D=0;Du?h.indexLabelText="":h.indexLabelTextBlock.maxWidth=0.85*u,0.3*h.indexLabelTextBlock.maxWidth< +u&&(h.indexLabelTextBlock.x-="right"===h.hemisphere?2:-2)),Math.abs(h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-t.y)d&&(d=x)),x=x=0,0d&&(d=x)));var G=function(a,b,c){for(var d=[],e=0;d.push(r[b]),b!==c;b=(b+1+n.length)%n.length);d.sort(function(a,b){return a.y-b.y});for(b=0;bz){l=w.indexLabelTextBlock.x;var m=w.indexLabelTextBlock.y-w.indexLabelTextBlock.height/2,q=w.indexLabelTextBlock.y+w.indexLabelTextBlock.height/2,s=k.indexLabelTextBlock.y-k.indexLabelTextBlock.height/2,t=k.indexLabelTextBlock.x+k.indexLabelTextBlock.width,v=k.indexLabelTextBlock.y+k.indexLabelTextBlock.height/2;l=w.indexLabelTextBlock.x+w.indexLabelTextBlock.widtht+p||m>v+p||qa&&(a=g),h!==a&&(b=h,d+=-z),0===g%Math.max(n.length/10,3)&&(e=!0)):e=!0;e&&(0=a.dataSeriesIndexes.length)){var m=this.data[a.dataSeriesIndexes[0]],n=m.dataPoints,p=10,e=this.plotArea,r=[],q=2,s,v=1.3,w=20/180*Math.PI,y=6,t={x:(e.x2+e.x1)/2,y:(e.y2+e.y1)/2},u=0;a=!1;for(var A=0;Aa&&(d=a,f=!0);var g=n[b].color?n[b].color:m._colorSet[b%m._colorSet.length];d>c&&Ga(k.plotArea.ctx,r[b].center,r[b].radius,g,m.type,c,d,m.fillOpacity,r[b].percentInnerRadius);if(f)break}l()},function(){k.disableToolTip=!1;k._animator.animate(0,k.animatedRender?500:0,function(a){b(a);l()})})}}};A.prototype.animationRequestId=null;A.prototype.requestAnimFrame=function(){return window.requestAnimationFrame|| +window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();A.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;A.prototype.set=function(a,d,b){b="undefined"===typeof b?!0:b;"options"===a?(this.options=d, +b&&this.render()):A.base.set.call(this,a,d,b)};A.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var d=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+d);Ba(this.canvas,d,b)};A.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),d=document.createElement("iframe");d.setAttribute("class","canvasjs-chart-print-frame");d.setAttribute("style","position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;"); +d.style.height=this.height+"px";this._canvasJSContainer.appendChild(d);var b=this,c=d.contentWindow||d.contentDocument.document||d.contentDocument;c.document.open();c.document.write('\n');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(d)},1E3)},500)};ja.prototype.registerSpace=function(a,d){"top"===a?this._topOccupied+= +d.height:"bottom"===a?this._bottomOccupied+=d.height:"left"===a?this._leftOccupied+=d.width:"right"===a&&(this._rightOccupied+=d.width)};ja.prototype.unRegisterSpace=function(a,d){"top"===a?this._topOccupied-=d.height:"bottom"===a?this._bottomOccupied-=d.height:"left"===a?this._leftOccupied-=d.width:"right"===a&&(this._rightOccupied-=d.width)};ja.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}};ja.prototype.reset=function(){this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding};U(W,M);W.prototype.render=function(a){a&&this.ctx.save();var d=this.ctx.font;this.ctx.textBaseline=this.textBaseline;var b=0;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y+b);"middle"===this.textBaseline&&(b=-this._lineHeight/ +2);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var c=0,f=this.padding,g=null;(0d)f=g-1;else break}b>d&&1g&&(h=d.pop(),c-=h.height,f=l)}this._wrappedText={lines:d,width:f,height:c};this.width=f+2*this.padding; +this.height=c+2*this.padding;this.ctx.font=b};W.prototype._getFontString=function(){var a;a=""+(this.fontStyle?this.fontStyle+" ":"");a+=this.fontWeight?this.fontWeight+" ":"";a+=this.fontSize?this.fontSize+"px ":"";var d=this.fontFamily?this.fontFamily+"":"";!u&&d&&(d=d.split(",")[0],"'"!==d[0]&&'"'!==d[0]&&(d="'"+d+"'"));return a+=d};U(ma,M);ma.prototype.render=function(){if(this.text){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),b=d.x1,c=d.y1,f= +0,g=0,h=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,l,k;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=d.width-4-h*("center"===this.horizontalAlign?2:1)),g=0.5*d.height-this.margin-2,f=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=d.height-4),g=0.5*d.width-this.margin-2):"center"===this.horizontalAlign&&(null===this.maxWidth&& +(this.maxWidth=d.width-4),g=0.5*d.height-4));this.wrap||(g=Math.min(g,Math.max(1.5*this.fontSize,this.fontSize+2.5*this.padding)));var g=new W(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,fontStyle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThickness,backgroundColor:this.backgroundColor,maxWidth:this.maxWidth,maxHeight:g,cornerRadius:this.cornerRadius, +text:this.text,padding:this.padding,textBaseline:"top"}),m=g.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(c=d.y1+2,k="top"):"bottom"===this.verticalAlign&&(c=d.y2-2-m.height,k="bottom"),"left"===this.horizontalAlign?b=d.x1+2:"center"===this.horizontalAlign?b=d.x1+d.width/2-m.width/2:"right"===this.horizontalAlign&&(b=d.x2-2-m.width-h),l=this.horizontalAlign,this.width=m.width,this.height=m.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign? +(b=d.x1+2,c=d.y2-2-(this.maxWidth/2-m.width/2),f=-90,k="left",this.width=m.height,this.height=m.width):"right"===this.horizontalAlign?(b=d.x2-2,c=d.y1+2+(this.maxWidth/2-m.width/2),f=90,k="right",this.width=m.height,this.height=m.width):"center"===this.horizontalAlign&&(c=a.y1+(a.height/2-m.height/2),b=a.x1+(a.width/2-m.width/2),k="center",this.width=m.width,this.height=m.height),l="center");g.x=b;g.y=c;g.angle=f;g.horizontalAlign=l;g.render(!0);a.layoutManager.registerSpace(k,{width:this.width+("left"=== +k||"right"===k?this.margin+2:0),height:this.height+("top"===k||"bottom"===k?this.margin+2:0)});this.bounds={x1:b,y1:c,x2:b+this.width,y2:c+this.height};this.ctx.textBaseline="top"}};U(va,M);va.prototype.render=ma.prototype.render;U(wa,M);wa.prototype.render=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),b=null,c=0,f=0,g=0,h=0,l=this.markerMargin=this.chart.options.legend&&!x(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin: +0.3*this.fontSize;this.height=0;var k=[],m=[];"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",b=this.verticalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:d.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*d.height):"center"===this.verticalAlign&&(this.orientation="vertical",b=this.horizontalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*d.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:d.height);for(var n= +0;n=h||"undefined"===typeof h||0>=r||"undefined"===typeof r)){if("horizontal"===this.orientation){e.textBlock=new W(this.ctx,{x:0,y:0,maxWidth:r,maxHeight:this.itemWrap?h: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(!p||p.width+Math.round(e.textBlock.width+s+l+(0===p.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)p= +{items:[],width:0},m.push(p),this.height+=u,u=0;u=Math.max(u,e.textBlock.height)}else e.textBlock=new W(this.ctx,{x:0,y:0,maxWidth:r,maxHeight:!0===this.itemWrap?h:1.5*this.fontSize,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),e.textBlock.measureText(),null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType|| +"stepLine"===e.chartType?2*0.1*this.lineHeight:0))),this.height>0,0),this.dataPoints.length):0):(n=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0>0,0),this.dataPoints.length):0));for(;;){g=0a?c.x/a:a/c.x:Math.abs(c.x- +a);pn-f&&n+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-1}return d||b.dataPoint.x!==a?d&&null!==b.dataPoint?b:null:b};$.prototype.getDataPointAtXY=function(a,d,b){if(!this.dataPoints||0===this.dataPoints.length||athis.chart.plotArea.x2||dthis.chart.plotArea.y2)return null;b=b||!1;var c=[],f=0,g=0,h=1,l=!1,k=Infinity,m=0,n=0,p=0;"none"!== +this.chart.plotInfo.axisPlacement&&(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:d}),this.axisX.logarithmic?(g=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1>0,0),this.dataPoints.length):0):(g=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0>0,0),this.dataPoints.length): +0));for(;;){g=0=e.x1&&(a<=e.x2&&d>=e.y1&&d<=e.y2)&&(c.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y1-d),Math.abs(e.y2-d))}), +l=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var s=L("markerSize",r,this)||4,v=b?20:s,q=Math.sqrt(Math.pow(e.x1-a,2)+Math.pow(e.y1-d,2));q<=v&&c.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:q});g=Math.abs(e.x1-a);g<=k?k=g:0v&&(q=Math.atan2(d-s.y,a-s.x),0>q&&(q+=2*Math.PI),q=Number(((180*(q/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(e.startAngle/Math.PI)%360+360)%360).toFixed(12)),v=Number(((180*(e.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===v&&1=v&&0!==r.y&&(v+=360,qs&&q=e.x1-e.borderThickness/2&&a<=e.x2+e.borderThickness/2&&d>=e.y2-e.borderThickness/2&&d<= +e.y3+e.borderThickness/2||Math.abs(e.x2-a+e.x1-a)=e.y1&&d<=e.y4)c.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-d),Math.abs(e.y3-d))}),l=!0;break;case "ohlc":if(Math.abs(e.x2-a+e.x1-a)=e.y2&&d<=e.y3||a>=e.x1&&a<=(e.x2+e.x1)/2&&d>=e.y1-e.borderThickness/2&&d<=e.y1+e.borderThickness/2||a>=(e.x1+e.x2)/2&&a<=e.x2&&d>=e.y4-e.borderThickness/2&&d<=e.y4+e.borderThickness/2)c.push({dataPoint:r, +dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-d),Math.abs(e.y3-d))}),l=!0}if(l||1E3p-f&&p+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-1}a=null;for(d=0;d>0:this.options.labelMaxWidth,this.chart.panEnabled||(h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize); +else if("left"===this._position||"right"===this._position)k=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))*E[this.intervalType+ +"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(c=0;cthis.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*k>>0,p=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;bp&&(q=b,p=e.width)}b=0;for(b=this.intervalStartPosition>0>2*g&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g? +-25:this.sessionVariables.labelAngle):x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=g,r.width+d.width>>0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=s)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight= +h,this.sessionVariables.labelWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth))this.options.labelMaxWidth>0,e=this.labelFontSize,pl&&(l=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth= +g,x(this.options.labelFontSize)&&12=2.2*g&&c<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelFontSize=e):c>=2.8*g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,p),this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*g&&c<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelFontSize=this.labelFontSize):c>3.6*g&&c<5*g?(x(this.options.labelFontSize)&&125*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=e,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelAngle=this.labelAngle));else if(q===b&&(0===q&&p+this._labels[q+1].textBlock.measureText().width-2*g>l||q===this._labels.length-1&&p+this._labels[q- +1].textBlock.measureText().width-2*g>l||0l&&p+this._labels[q-1].textBlock.measureText().width-2*g>l))l=0===q?p+this._labels[q+1].textBlock.measureText().width-2*g:p+this._labels[q-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth= +s;else if(0===l)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,c=0;c>0>2*g&&(this.sessionVariables.labelAngle= +-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),s=0!=this.labelAngle?(n-(m+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):g,this.sessionVariables.labelMaxHeight=h=this.labelWrap?(n-s*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180* +Math.abs(this.labelAngle)):1.5*this.labelFontSize,x(this.options.labelWrap))?x(this.options.labelWrap)&&(this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelMaxHeight=c<0.9*k?0.9*k:c,this.sessionVariables.labelWrap= +this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s):(x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=h);for(c=0;c>0:this.options.labelMaxWidth,h="undefined"===typeof this.options.labelWrap||this.labelWrap? +0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b> +0,k-2*h>p&&(p=k-2*h,k>=2*h&&k<2.4*h?(x(this.options.labelFontSize)&&12=2.4*h&&k<2.8*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):k>=2.8*h&&k<3.2*h?(this.sessionVariables.labelMaxHeight= +h,this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*h&&k<3.6*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize= +this.labelFontSize):k>3.6*h&&k<10*h?(x(this.options.labelFontSize)&&1210*h&&k<50*h&&(x(this.options.labelFontSize)&& +12this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:g,this.sessionVariables.labelMaxHeight= +0===this.labelAngle?h:c,x(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMaxHeight=h,x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap= +this.labelWrap);for(c=0;c>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)v="undefined"===typeof g.options.labelWrap?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;d=x(g.options.labelBackgroundColor)?"#EEEEEE": +g.options.labelBackgroundColor}else h="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,v="undefined"===typeof 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,d=x(g.options.labelBackgroundColor)?x(g.startValue)&&0!==g.startValue?u?"transparent":null:"#EEEEEE":g.options.labelBackgroundColor;a=new W(this.ctx,{x:0,y:0,backgroundColor:d,borderColor:g.labelBorderColor, +borderThickness:g.labelBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?g.options.labelMaxWidth:h,maxHeight:v,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.options.labelFontSize:this.labelFontSize:g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.options.labelFontFamily:this.labelFontFamily: +g.labelFontFamily,fontWeight:"outside"===g.labelPlacement?g.options.fontWeight?g.options.fontWeight:this.fontWeight:g.fontWeight,fontColor:g.options.labelFontColor||g.color,fontStyle:"outside"===g.labelPlacement?g.options.fontStyle?g.options.fontStyle:this.fontWeight:g.fontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:g.value,textBlock:a,effectiveHeight:null,stripLine:g})}};B.prototype.createLabelsAndCalculateWidth=function(){var a=0,d=0;this._labels=[];this._stripLineLabels= +[];if("left"===this._position||"right"===this._position){this.createLabels();for(d=0;d +this.viewportMinimum&&this._stripLineLabels[d].stripLine.valuer;){var N=0,Q=0,P=0,O=0,L=f=0,C=0,S=0,X=0,V=0,U=0,T=0;if(b&&0n.width-10?n.width-10:g.x2-T-S);if(a&&0n.width-10?n.width-10:g.x2-T-S),a[e]._labels&&1k&&(l+=0a[e].labelAngle?z-qk&&(l=A+s/2-k-T),z-qa[e].labelAngle&&0n.width-10?n.width-10:g.x2-T-S),d[e].lineCoordinates.width=Math.abs(k-h),d[e]._labels&&1r;){V=X=U=O=S=C=L=f=P=K=Q=N=0;if(a&&0n.width-10?n.width-10:g.x2-V-L),b[e].labelAutoFit&&!x(v)&&(0b[e].labelAngle?Math.max(h,v):0===b[e].labelAngle?Math.max(h,v/2):h),0c[e].chart.width-10?c[e].chart.width-10:g.x2-V-L),c[e]&&c[e].labelAutoFit&&!x(u)&&(0b[e].chart.height-10?b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=l-(z[e]+b[e].margin+N),b[e].lineCoordinates.y2=l-(z[e]+b[e].margin+N),b[e].bounds={x1:h,y1:l-(z[e]+N+b[e].margin), +x2:k,y2:m-(N+b[e].margin),width:k-h,height:z[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0n.height- +Math.max(C,10)?n.height-Math.max(C,10):g.y2-O):g.y2>n.height-Math.max(C,10)?n.height-Math.max(C,10):g.y2;if(b&&0b[C].labelAngle?Math.max(k,v):0===b[C].labelAngle?Math.max(k,v/2):k,h=0>b[C].labelAngle||0===b[C].labelAngle?k-X:h);if(c&&0n.height-Math.max(C,10)?n.height-Math.max(C,10):g.y2-O):g.y2>n.height-Math.max(C,10)?n.height-Math.max(C,10):g.y2;if(b&&0b[C].labelAngle?Math.max(k,v):0===b[e].labelAngle?Math.max(k,v/2):k,h=0>b[C].labelAngle||0===b[C].labelAngle?k-V:h);if(c&&0this.viewportMaximum||!(k===this._labels.length-1||gthis.lineCoordinates.width*c&&this.labelAutoFit&&(a=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var d=[],m,h=this.viewportMaximum,l=this.lineCoordinates.height/Math.log(this.range),k=this._labels.length-1;0<=k;k--){n=this._labels[k]; +if(n.positionthis.viewportMaximum||!(k===this._labels.length-1||mthis.lineCoordinates.height*c&&this.labelAutoFit&&(a=!0)}}if("bottom"===this._position){for(var n,k=0;kthis.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c, +b.y<<0),this.ctx.lineTo(c,b.y+this.tickLength<<0),this.ctx.stroke()),0===n.textBlock.angle?(b.x-=n.textBlock.width/2,b.y+=this.tickLength+n.textBlock.fontSize/2):(b.x-=0>this.labelAngle?n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,b.y+=this.tickLength+Math.abs(0>this.labelAngle?n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:5)),n.textBlock.x=b.x,n.textBlock.y=b.y,n.textBlock.render(!0)));this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+ +this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y2-this._titleTextBlock.height-3,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("top"===this._position){for(k=0;kthis.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle= +this.tickColor,c=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,b.y<<0),this.ctx.lineTo(c,b.y-this.tickLength<<0),this.ctx.stroke()),0===n.textBlock.angle?(b.x-=n.textBlock.width/2,b.y-=this.tickLength+n.textBlock.height/2):(b.x+=(n.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,c),this.ctx.lineTo(b.x-this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(n.textBlock.y=b.y,n.textBlock.x=b.x-n.textBlock.width*Math.cos(Math.PI/ +180*this.labelAngle)-this.tickLength-5):(n.textBlock.y=b.y-n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),n.textBlock.x=0this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth% +2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,c),this.ctx.lineTo(b.x+this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(n.textBlock.y=b.y,n.textBlock.x=b.x+this.tickLength+5):(n.textBlock.y=0>this.labelAngle?b.y:b.y-(n.textBlock.height-n.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),n.textBlock.x=0this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[f+1].position),a.fillRect(Math.min(b.x,d.x),c.y1,Math.abs(b.x-d.x),Math.abs(c.y1-c.y2)),d=!1):d=!0;else if(("left"===this._position||"right"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,f=0;fthis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[f+1].position),a.fillRect(c.x1,Math.min(b.y,d.y),Math.abs(c.x1-c.x2),Math.abs(d.y-b.y)),d=!1):d=!0;a.beginPath()};B.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0this.viewportMaximum||x(m.value)||isNaN(this.range))||l.push(m))}for(c=0;cthis.viewportMaximum||isNaN(this.range))){a=this.getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(m&&(this.ctx.strokeStyle=m.color,"pixel"===m._thicknessType&&(this.ctx.lineWidth=m.thickness)),"bottom"===this._position){var n=1===this.ctx.lineWidth%2?(a.x<< +0)+0.5:a.x<<0;this.ctx.beginPath();this.ctx.moveTo(n,a.y<<0);this.ctx.lineTo(n,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?(n=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,this.ctx.beginPath(),this.ctx.moveTo(n, +a.y<<0),this.ctx.lineTo(n,a.y-this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y-=this.tickLength+b.textBlock.height):(a.x+=(b.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.labelAngle?a.y:a.y-(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0this.chart.plotArea.x1?x(m.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(m.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/ +2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y1+b.textBlock.width+3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-b.textBlock.width-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position? +(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.height-3,b.textBlock.measureText(),a.x-b.textBlock.height>this.chart.plotArea.x1?x(m.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(m.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign? +this.chart.plotArea.y1+b.textBlock.width+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y2-3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y2-b.textBlock.width-3):"left"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth: +this.chart.plotArea.width-3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-b.textBlock.height>this.chart.plotArea.y1?x(m.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3:a.y-b.textBlock.heightthis.chart.plotArea.y1?x(m.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:x(m.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;k.push(b)}if(!h){h=!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;cthis.viewportMaximum||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=1===a.lineWidth%2?(d.x<<0)+0.5:d.x<<0,a.moveTo(d,b.y1<<0),a.lineTo(d,b.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var c=0;cthis.viewportMaximum||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=1===a.lineWidth%2?(d.y<<0)+0.5:d.y<<0,a.moveTo(b.x1<<0,d),a.lineTo(b.x2<<0,d),a.stroke());a.restore()}};B.prototype.renderAxisLine=function(){var a=this.chart.ctx;a.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){a.lineWidth=this.lineThickness;a.strokeStyle=this.lineColor?this.lineColor:"black";a.setLineDash&&a.setLineDash(I(this.lineDashType, +this.lineThickness));var d=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;a.beginPath();a.moveTo(this.lineCoordinates.x1,d);a.lineTo(this.lineCoordinates.x2,d);a.stroke()}}else"left"!==this._position&&"right"!==this._position||!this.lineThickness||(a.lineWidth=this.lineThickness,a.strokeStyle=this.lineColor,a.setLineDash&&a.setLineDash(I(this.lineDashType,this.lineThickness)),d=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<< +0,a.beginPath(),a.moveTo(d,this.lineCoordinates.y1),a.lineTo(d,this.lineCoordinates.y2),a.stroke());a.restore()};B.prototype.getPixelCoordinatesOnAxis=function(a){var d={};if("bottom"===this._position||"top"===this._position)d.x=this.convertValueToPixel(a),d.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)d.y=this.convertValueToPixel(a),d.x=this.lineCoordinates.x2;return d};B.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var d=0,d=0, +d="number"===typeof a?a:"left"===this._position||"right"===this._position?a.y:a.x;return d=this.logarithmic?Math.pow(this.logarithmBase,(d-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit)*this.viewportMinimum:this.conversionParameters.minimum+(d-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit};B.prototype.convertValueToPixel=function(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.setViewPortRange=function(a,d){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,d);this.sessionVariables.newViewportMaximum=this.viewportMaximum=Math.max(a,d)};B.prototype.getXValueAt=function(a){if(!a)return null;var d=null;"left"===this._position?d=this.convertPixelToValue(a.y): +"bottom"===this._position&&(d=this.convertPixelToValue(a.x));return d};B.prototype.calculateValueToPixelConversionParameters=function(a){a={pixelPerUnit:null,minimum:null,reference:null};var d=this.lineCoordinates.width,b=this.lineCoordinates.height;a.minimum=this.viewportMinimum;if("bottom"===this._position||"top"===this._position)this.logarithmic?(a.lnLogarithmBase=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?-1:1)*d*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit= +(this.reversed?-1:1)*d/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(a.lnLogarithmBase=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?1:-1)*b*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit=(this.reversed?1:-1)*b/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;this.conversionParameters=a};B.prototype.calculateAxisParameters= +function(){if(this.logarithmic)this.calculateLogarithamicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),d=!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)),f,g,h,c=0;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if("axisX"===this.type){if(this.dataSeries&&0g?(c=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-c:g=f+c):(c=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=c),0!==f&&(f-=c)),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0));c=(isNaN(this.viewportMaximum)|| +null===this.viewportMaximum?g:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?f:this.viewportMinimum);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*E.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*E.secondDuration)<=a?(this.interval=2,this.intervalType= +"second"):c/(5*E.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*E.secondDuration)<=a?(this.interval=10,this.intervalType="second"):c/(15*E.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*E.secondDuration)<=a?(this.interval=20,this.intervalType="second"):c/(30*E.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*E.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*E.minuteDuration)<=a?(this.interval=2,this.intervalType= +"minute"):c/(5*E.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*E.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):c/(15*E.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*E.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):c/(30*E.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*E.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*E.hourDuration)<=a?(this.interval=2,this.intervalType="hour"): +c/(3*E.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*E.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1*E.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*E.dayDuration)<=a?(this.interval=2,this.intervalType="day"):c/(4*E.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*E.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*E.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*E.weekDuration)<=a?(this.interval= +3,this.intervalType="week"):c/(1*E.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*E.monthDuration)<=a?(this.interval=2,this.intervalType="month"):c/(3*E.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*E.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=c/(1*E.yearDuration)<=a?1:c/(2*E.yearDuration)<=a?2:c/(4*E.yearDuration)<=a?4:Math.floor(B.getNiceNumber(c/(a-1),!0)/E.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum|| +isNaN(this.viewportMinimum))this.viewportMinimum=f-h/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=g+h/2;d?this.autoValueFormatString="MMM DD YYYY HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===this.intervalType?this.autoValueFormatString="MMM YYYY":"week"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"hour"===this.intervalType?this.autoValueFormatString= +"hh:mm TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm TT":"second"===this.intervalType?this.autoValueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.valueFormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType="number";c=B.getNiceNumber(c,!1);this.interval=this.options&&0g?(c=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-c:g=f+c):(c=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=c),0!==f&&(f-=c)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,f=0),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0)),"axisX"===this.type&&b){if(null===this.minimum||isNaN(this.minimum))this.minimum=f-h/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+h/2}else this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?f-h/2:Math.floor(f/this.interval)*this.interval,this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)), +null===this.maximum&&(this.maximum="axisX"===this.type?g+h/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimum&&(0===this.options.minimum?this.maximum+=10:0===this.options.maximum&&(this.minimum-=10));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);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;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.range)){d=Math.floor(Math.abs(Math.log(this.range)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;if(2this.maxWidth?7:Math.max(7,Math.floor(this.maxWidth/100)):Math.max(Math.floor(this.maxWidth/50),3),c,f,g,h;h=1;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum= +this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;"axisX"===this.type?(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===f/c&&(h=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),f*=h,c/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase, +0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=c&&!isFinite(f)?(f="undefined"===typeof this.options.interval?0:this.options.interval,c=1):0>=c?c=f:isFinite(f)||(f=c),1===c&&1===f?(f*=this.logarithmBase-1/this.logarithmBase,c=1):1===f/c?(h=Math.min(f*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),f*=h,c/=h):c>f?(h=Math.min(c/ +f*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=f?c=f/h:f=c*h):(h=Math.min(f/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==c&&(c/=h)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&1f&&(f=1));h=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)/(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);linearRange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);this.intervalType="number";h=Math.pow(this.logarithmBase,B.getNiceNumber(Math.abs(Math.log(h)/d),!1));this.options&&0this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.minimum?this.minimum:this.dataInfo.min,f=null!==this.maximum?this.maximum:this.dataInfo.max, +isFinite(c)||isFinite(f)?1===c&&1===f?(f*=this.logarithmBase,c/=this.logarithmBase):1===f/c?(h=Math.pow(this.logarithmBase,this.interval),f*=h,c/=h):c>f?(h=Math.min(0.01*(c/f),5),1<=f?c=f/h:f=c*h):(h=Math.min(f/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==c&&(c/=h)):(f="undefined"===typeof this.options.interval?0:this.options.interval,c=1),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5): +this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1f&&(f=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)/d/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?f*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(f)/d/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)/(d*this.interval)+0.2)*this.interval);this.range=this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&& +this.rangethis.viewportMaximum||3>a?2:3)){for(d=Math.floor(this.viewportMinimum/b+0.5)*b;dthis.interval&&(this.interval=b,c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(d*this.interval)+0.2)*this.interval))),this.equidistantInterval=!0,this.intervalStartPosition=c;if(!this.valueFormatString&& +(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){d=Math.floor(Math.abs(Math.log(this.viewportMinimum)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;if(2b?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,d){var b=Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b);return Number(((d? +1.5>c?1:3>c?2:7>c?5:10:1>=c?1:2>=c?2:5>=c?5:10)*Math.pow(10,b)).toFixed(20))};B.prototype.getLabelStartPoint=function(){var a=E[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this._updateToolTip(a,d))}; +S.prototype._updateToolTip=function(a,d,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 d){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;d=this._prevY}else this._prevX=a,this._prevY=d;var c=null,f=null,g=[],h=0;if(this.shared&&this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){if("xySwapped"===this.chart.plotInfo.axisPlacement){f=[];if(this.chart.axisX)for(var l= +0;lk.dataSeries.axisY.viewportMaximum&&b++;b-k.dataPoint.y.length&&g.push(k)}else"column"===f.type||"bar"===f.type?0>k.dataPoint.y?0>k.dataSeries.axisY.viewportMinimum&&k.dataSeries.axisY.viewportMaximum>=k.dataPoint.y&&g.push(k):k.dataSeries.axisY.viewportMinimum<= +k.dataPoint.y&&0<=k.dataSeries.axisY.viewportMaximum&&g.push(k):"bubble"===f.type?(b=this.chart._eventManager.objectMap[f.dataPointIds[k.index]].size/2,k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum-b&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum+b&&g.push(k)):(0<=k.dataSeries.type.indexOf("100")||"stackedColumn"===f.type||"stackedBar"===f.type||k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum)&&g.push(k);else g.push(k)}}if(0a&&(a+=this.container.clientWidth+20);a+this.container.clientWidth>Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(this.chart.container.clientWidth,this.chart.width)-this.container.clientWidth));a+="px";d=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):d:g[0].dataSeries.axisY.convertValueToPixel(g[0].dataPoint.y);d=-d+10;0":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y}",k=c.axisXIndex;else if("bubble"===c.type)this.chart.axisX&& +1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y},   {z}";else if("rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y[0]}, {y[1]}";else if("candlestick"===c.type||"ohlc"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
": +""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:
Open:   {y[0]}
High:    {y[1]}
Low:   {y[2]}
Close:   {y[3]}";null===b&&(b="");!0===this.reversed?(b=this.chart.replaceKeywordsWithValue(a,f,c,g)+b,l"+b)):(b+=this.chart.replaceKeywordsWithValue(a, +f,c,g),l"));c.toolTipContent=a}null!==b&&(b=m+b)}else{c=d[0].dataSeries;f=d[0].dataPoint;g=d[0].index;if(null===f.toolTipContent||"undefined"===typeof f.toolTipContent&&null===c.options.toolTipContent)return null;if("line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"column"===c.type||"bar"===c.type||"scatter"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"=== +c.type||"stackedArea"===c.type||"stackedArea100"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+":  {y}";else if("bubble"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+":  {y},   {z}";else if("pie"===c.type||"doughnut"===c.type||"funnel"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.name?"{name}:  ":f.label?"{label}:  ":"")+"{y}";else if("rangeColumn"===c.type||"rangeBar"=== +c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+" :  {y[0]},  {y[1]}";else if("candlestick"===c.type||"ohlc"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content: +""+(f.label?"{label}":"{x}")+"
Open:   {y[0]}
High:    {y[1]}
Low:     {y[2]}
Close:   {y[3]}";null===b&&(b="");b+=this.chart.replaceKeywordsWithValue(a,f,c,g)}this.content=a;return b};S.prototype.enableAnimation=function(){this.container.style.WebkitTransition||(this.container.style.WebkitTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.MozTransition= +"left .2s ease-out, bottom .2s ease-out",this.container.style.MsTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.transition="left .2s ease-out, bottom .2s ease-out")};S.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition="",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};S.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())};S.prototype.show=function(a,d,b){this._updateToolTip(a,d,"undefined"===typeof b?!1:b)};A.prototype.getPercentAndTotal=function(a,d){var b=null,c=null,f=null;if(0<=a.type.indexOf("stacked"))c=0,b=d.x.getTime?d.x.getTime():d.x,b in a.plotUnit.yTotals&&(c=a.plotUnit.yTotals[b],f=isNaN(d.y)?0:0===c?0:100*(d.y/c));else if("pie"===a.type||"doughnut"===a.type){for(i=c=0;ic&&a.push(d),d.animationCallback(c),1<=c&&d.onComplete)d.onComplete();this.animations=a;0g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function P(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX= +a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function Q(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function E(a,b,c){return Math.min(c,Math.max(b,a))}function F(a,b,c){0>c&&c++;16*c?a+6*(b-a)*c: +1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function G(a){if(a in H)return H[a];var b,c=1;a=String(a);if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=Q(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=v[E(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=Q(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=E(parseFloat(e[1])/100,0,1);e=E(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=F(d,f,b+1/3);e=F(d,f,b);b=F(d,f,b-1/3)}b="#"+ +v[Math.floor(255*g)]+v[Math.floor(255*e)]+v[Math.floor(255*b)];c=c[3]}else b=Z[a]||a;return H[a]={color:b,alpha:c}}function C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*q;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute", +c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function R(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function S(a,b){var c=G(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("')}function T(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,k=g.x-c.x,n=g.y-c.y;if(e instanceof w){var h=0,l=g=0,u=0,m=1;if("gradient"==e.type_){h=e.x1_/f;c=e.y1_/d;var p=s(a,e.x0_/f,e.y0_/d),h=s(a,h,c),h=180*Math.atan2(h.x-p.x,h.y-p.y)/Math.PI;0>h&&(h+=360);1E-6>h&&(h=0)}else p=s(a,e.x0_,e.y0_),g=(p.x-c.x)/k,l=(p.y-c.y)/n,k/=f*q, +n/=d*q,m=x.max(k,n),u=2*e.r0_/m,m=2*e.r1_/m-u;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});d=f.length;p=f[0].color;c=f[d-1].color;k=f[0].alpha*a.globalAlpha;a=f[d-1].alpha*a.globalAlpha;for(var n=[],r=0;r')}else e instanceof +I?k&&n&&b.push("'):(e=G(a.fillStyle),b.push(''))}function s(a,b,c){a=a.m_;return{x:q*(b*a[0][0]+c*a[1][0]+a[2][0])-r,y:q*(b*a[0][1]+c*a[1][1]+a[2][1])-r}}function z(a,b,c){isFinite(b[0][0])&&(isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1]))&&(a.m_=b,c&&(a.lineScale_=aa(ba(b[0][0]*b[1][1]-b[0][1]* +b[1][0]))))}function w(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function I(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new A("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new A("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new A("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height} +function A(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var x=Math,k=x.round,J=x.sin,K=x.cos,ba=x.abs,aa=x.sqrt,q=10,r=q/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var M=Array.prototype.slice;O(document);var U={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",W(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var b=0;bd;d++)for(var B=0;16>B;B++)v[16*d+B]=d.toString(16)+B.toString(16);var Z={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC", +bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000", +darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082", +ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA", +mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5", +peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"}, +H={},L={},$={butt:"flat",round:"round"},d=C.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo= +function(a,b,c,g,e,f){e=s(this,e,f);a=s(this,a,b);c=s(this,c,g);R(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=s(this,a,b);c=s(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};R(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){c*=q;var d=f?"at":"wa",k=a+K(g)*c-r,n=b+J(g)*c-r;g=a+K(e)*c-r;e=b+J(e)*c-r;k!=g||f||(k+=0.125);a=s(this,a,b);k=s(this,k,n);g=s(this,g,e);this.currentPath_.push({type:d, +x:a.x,y:a.y,radius:c,xStart:k.x,yStart:k.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+ +c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new w("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new w("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,r,y,n,h;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var l=a.width,u=a.height;a.runtimeStyle.width= +e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],r=y=0,n=e=l,h=d=u;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],r=y=0,n=l,h=u;else if(9==arguments.length)r=arguments[1],y=arguments[2],n=arguments[3],h=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var m=s(this,c,g),p=[];p.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stroke=function(a){var b=[];b.push("d.x)d.x=f.x;if(null==c.y||f.yd.y)d.y=f.y}}b.push(' ">');a?T(this,b,c,d):S(this,b);b.push("");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a= +{};P(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=t(D(),this.m_)};d.restore=function(){this.aStack_.length&&(P(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){z(this,t([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=K(a);a=J(a);z(this,t([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(this,t([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){z(this,t([[a, +b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_;d=0;var r=1E3,t=0,n=[],h;h=this.font;if(L[h])h=L[h];else{var l=document.createElement("div").style;try{l.font=h}catch(u){}h=L[h]={style:l.fontStyle||"normal",variant:l.fontVariant||"normal",weight:l.fontWeight||"normal",size:l.fontSize||10,family:l.fontFamily||"sans-serif"}}var l=h,m=this.element_;h={};for(var p in l)h[p]=l[p];p=parseFloat(m.currentStyle.fontSize); +m=parseFloat(l.size);"number"==typeof l.size?h.size=l.size:-1!=l.size.indexOf("px")?h.size=m:-1!=l.size.indexOf("em")?h.size=p*m:-1!=l.size.indexOf("%")?h.size=p/100*m:-1!=l.size.indexOf("pt")?h.size=m/0.75:h.size=p;h.size*=0.981;p=h.style+" "+h.variant+" "+h.weight+" "+h.size+"px "+h.family;m=this.element_.currentStyle;l=this.textAlign.toLowerCase();switch(l){case "left":case "center":case "right":break;case "end":l="ltr"==m.direction?"right":"left";break;case "start":l="rtl"==m.direction?"right": +"left";break;default:l="left"}switch(this.textBaseline){case "hanging":case "top":t=h.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":t=-h.size/2.25}switch(l){case "right":d=1E3;r=0.05;break;case "center":d=r=500}b=s(this,b+0,c+t);n.push('');e?S(this,n):T(this,n,{x:-d,y:0}, +{x:r,y:h.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1].toFixed(3)+",0,0";b=k(b.x/q)+","+k(b.y/q);n.push('','','');this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a, +b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd",''),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){}; +d.arcTo=function(){};d.createPattern=function(a,b){return new I(a,b)};w.prototype.addColorStop=function(a,b){b=G(b);this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};d=A.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR= +13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=U;CanvasRenderingContext2D=C;CanvasGradient=w;CanvasPattern=I;DOMException=A}(); diff --git a/charts/canvas/charts.zip b/charts/canvas/charts.zip new file mode 100644 index 0000000..2f4881f Binary files /dev/null and b/charts/canvas/charts.zip differ diff --git a/charts/canvas/examples/01-line-chart/basic-line-chart.html b/charts/canvas/examples/01-line-chart/basic-line-chart.html new file mode 100644 index 0000000..7639789 --- /dev/null +++ b/charts/canvas/examples/01-line-chart/basic-line-chart.html @@ -0,0 +1,45 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/line-chart-with-date-time-axis.html b/charts/canvas/examples/01-line-chart/line-chart-with-date-time-axis.html new file mode 100644 index 0000000..f617bc3 --- /dev/null +++ b/charts/canvas/examples/01-line-chart/line-chart-with-date-time-axis.html @@ -0,0 +1,44 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/line-chart-with-line-customization.html b/charts/canvas/examples/01-line-chart/line-chart-with-line-customization.html new file mode 100644 index 0000000..f6ef925 --- /dev/null +++ b/charts/canvas/examples/01-line-chart/line-chart-with-line-customization.html @@ -0,0 +1,39 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/line-chart-with-null(empty)-data.html b/charts/canvas/examples/01-line-chart/line-chart-with-null(empty)-data.html new file mode 100644 index 0000000..d3c4ebf --- /dev/null +++ b/charts/canvas/examples/01-line-chart/line-chart-with-null(empty)-data.html @@ -0,0 +1,39 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/line-chart-with-stripline.html b/charts/canvas/examples/01-line-chart/line-chart-with-stripline.html new file mode 100644 index 0000000..f574129 --- /dev/null +++ b/charts/canvas/examples/01-line-chart/line-chart-with-stripline.html @@ -0,0 +1,44 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/line-chart-with-xy-zoom-type.html b/charts/canvas/examples/01-line-chart/line-chart-with-xy-zoom-type.html new file mode 100644 index 0000000..ebf447f --- /dev/null +++ b/charts/canvas/examples/01-line-chart/line-chart-with-xy-zoom-type.html @@ -0,0 +1,52 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/line-chart-with-zooming.html b/charts/canvas/examples/01-line-chart/line-chart-with-zooming.html new file mode 100644 index 0000000..c89e909 --- /dev/null +++ b/charts/canvas/examples/01-line-chart/line-chart-with-zooming.html @@ -0,0 +1,46 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/01-line-chart/multi-series-line-chart.html b/charts/canvas/examples/01-line-chart/multi-series-line-chart.html new file mode 100644 index 0000000..0f5b4ad --- /dev/null +++ b/charts/canvas/examples/01-line-chart/multi-series-line-chart.html @@ -0,0 +1,98 @@ + + + + + + + CanvasJS Example + + +
+
+ + diff --git a/charts/canvas/examples/01-line-chart/multiple-charts-in-one-page.html b/charts/canvas/examples/01-line-chart/multiple-charts-in-one-page.html new file mode 100644 index 0000000..e2e3462 --- /dev/null +++ b/charts/canvas/examples/01-line-chart/multiple-charts-in-one-page.html @@ -0,0 +1,266 @@ + + + + + + CanvasJS Example + + + +
+
+
+
+
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/02-column-chart/basic-column-chart.html b/charts/canvas/examples/02-column-chart/basic-column-chart.html new file mode 100644 index 0000000..945fc5e --- /dev/null +++ b/charts/canvas/examples/02-column-chart/basic-column-chart.html @@ -0,0 +1,42 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/02-column-chart/column-chart-with-index-label-customization.html b/charts/canvas/examples/02-column-chart/column-chart-with-index-label-customization.html new file mode 100644 index 0000000..a5c2c6b --- /dev/null +++ b/charts/canvas/examples/02-column-chart/column-chart-with-index-label-customization.html @@ -0,0 +1,42 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/02-column-chart/multi-series-column-chart.html b/charts/canvas/examples/02-column-chart/multi-series-column-chart.html new file mode 100644 index 0000000..3079cd3 --- /dev/null +++ b/charts/canvas/examples/02-column-chart/multi-series-column-chart.html @@ -0,0 +1,65 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/03-area-chart/area-chart-with-date-time-axis.html b/charts/canvas/examples/03-area-chart/area-chart-with-date-time-axis.html new file mode 100644 index 0000000..8b0951d --- /dev/null +++ b/charts/canvas/examples/03-area-chart/area-chart-with-date-time-axis.html @@ -0,0 +1,41 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/03-area-chart/area-chart-with-line-thickness.html b/charts/canvas/examples/03-area-chart/area-chart-with-line-thickness.html new file mode 100644 index 0000000..d0706b3 --- /dev/null +++ b/charts/canvas/examples/03-area-chart/area-chart-with-line-thickness.html @@ -0,0 +1,40 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/03-area-chart/area-chart-with-opacity.html b/charts/canvas/examples/03-area-chart/area-chart-with-opacity.html new file mode 100644 index 0000000..d7ab1d3 --- /dev/null +++ b/charts/canvas/examples/03-area-chart/area-chart-with-opacity.html @@ -0,0 +1,38 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/03-area-chart/area-chart-with-xy-zoom-type.html b/charts/canvas/examples/03-area-chart/area-chart-with-xy-zoom-type.html new file mode 100644 index 0000000..95f6a83 --- /dev/null +++ b/charts/canvas/examples/03-area-chart/area-chart-with-xy-zoom-type.html @@ -0,0 +1,52 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/03-area-chart/basic-area-chart.html b/charts/canvas/examples/03-area-chart/basic-area-chart.html new file mode 100644 index 0000000..c7bc293 --- /dev/null +++ b/charts/canvas/examples/03-area-chart/basic-area-chart.html @@ -0,0 +1,45 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/04-pie-chart/basic-pie-chart.html b/charts/canvas/examples/04-pie-chart/basic-pie-chart.html new file mode 100644 index 0000000..a5e863a --- /dev/null +++ b/charts/canvas/examples/04-pie-chart/basic-pie-chart.html @@ -0,0 +1,35 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/04-pie-chart/pie-chart-with-index-label.html b/charts/canvas/examples/04-pie-chart/pie-chart-with-index-label.html new file mode 100644 index 0000000..c03936d --- /dev/null +++ b/charts/canvas/examples/04-pie-chart/pie-chart-with-index-label.html @@ -0,0 +1,40 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/05-bar-chart/bar-chart-with-stripline.html b/charts/canvas/examples/05-bar-chart/bar-chart-with-stripline.html new file mode 100644 index 0000000..149666c --- /dev/null +++ b/charts/canvas/examples/05-bar-chart/bar-chart-with-stripline.html @@ -0,0 +1,48 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/05-bar-chart/basic-bar-chart.html b/charts/canvas/examples/05-bar-chart/basic-bar-chart.html new file mode 100644 index 0000000..07bd651 --- /dev/null +++ b/charts/canvas/examples/05-bar-chart/basic-bar-chart.html @@ -0,0 +1,41 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/06-doughnut-chart/basic-doughnut-chart.html b/charts/canvas/examples/06-doughnut-chart/basic-doughnut-chart.html new file mode 100644 index 0000000..815a015 --- /dev/null +++ b/charts/canvas/examples/06-doughnut-chart/basic-doughnut-chart.html @@ -0,0 +1,35 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/06-doughnut-chart/doughnut-chart-with-explode-on-click-disabled.html b/charts/canvas/examples/06-doughnut-chart/doughnut-chart-with-explode-on-click-disabled.html new file mode 100644 index 0000000..571a57b --- /dev/null +++ b/charts/canvas/examples/06-doughnut-chart/doughnut-chart-with-explode-on-click-disabled.html @@ -0,0 +1,37 @@ + + + + + + + CanvasJS Example + + +
+ + diff --git a/charts/canvas/examples/06-doughnut-chart/doughnut-chart-with-index-label.html b/charts/canvas/examples/06-doughnut-chart/doughnut-chart-with-index-label.html new file mode 100644 index 0000000..3551948 --- /dev/null +++ b/charts/canvas/examples/06-doughnut-chart/doughnut-chart-with-index-label.html @@ -0,0 +1,46 @@ + + + + + + + CanvasJS Example + + +
+
+ + diff --git a/charts/canvas/examples/07-spline-chart/basic-spline-chart.html b/charts/canvas/examples/07-spline-chart/basic-spline-chart.html new file mode 100644 index 0000000..56316ed --- /dev/null +++ b/charts/canvas/examples/07-spline-chart/basic-spline-chart.html @@ -0,0 +1,37 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/07-spline-chart/spline-chart-with-marker-customization.html b/charts/canvas/examples/07-spline-chart/spline-chart-with-marker-customization.html new file mode 100644 index 0000000..edcc0b1 --- /dev/null +++ b/charts/canvas/examples/07-spline-chart/spline-chart-with-marker-customization.html @@ -0,0 +1,38 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/08-bubble-chart/basic-bubble-chart.html b/charts/canvas/examples/08-bubble-chart/basic-bubble-chart.html new file mode 100644 index 0000000..80e7086 --- /dev/null +++ b/charts/canvas/examples/08-bubble-chart/basic-bubble-chart.html @@ -0,0 +1,44 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/08-bubble-chart/bubble-chart-with-tooltip-customization.html b/charts/canvas/examples/08-bubble-chart/bubble-chart-with-tooltip-customization.html new file mode 100644 index 0000000..d23b7fc --- /dev/null +++ b/charts/canvas/examples/08-bubble-chart/bubble-chart-with-tooltip-customization.html @@ -0,0 +1,61 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/09-stacked-column-chart/basic-stacked-column-chart.html b/charts/canvas/examples/09-stacked-column-chart/basic-stacked-column-chart.html new file mode 100644 index 0000000..84578db --- /dev/null +++ b/charts/canvas/examples/09-stacked-column-chart/basic-stacked-column-chart.html @@ -0,0 +1,68 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/09-stacked-column-chart/stacked-column-with-total-shown-on-top.html b/charts/canvas/examples/09-stacked-column-chart/stacked-column-with-total-shown-on-top.html new file mode 100644 index 0000000..065243e --- /dev/null +++ b/charts/canvas/examples/09-stacked-column-chart/stacked-column-with-total-shown-on-top.html @@ -0,0 +1,59 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/10-stacked-bar-chart/basic-stacked-bar-chart.html b/charts/canvas/examples/10-stacked-bar-chart/basic-stacked-bar-chart.html new file mode 100644 index 0000000..223180f --- /dev/null +++ b/charts/canvas/examples/10-stacked-bar-chart/basic-stacked-bar-chart.html @@ -0,0 +1,83 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/10-stacked-bar-chart/stacked-bar-chart-with-index-label.html b/charts/canvas/examples/10-stacked-bar-chart/stacked-bar-chart-with-index-label.html new file mode 100644 index 0000000..61c4c55 --- /dev/null +++ b/charts/canvas/examples/10-stacked-bar-chart/stacked-bar-chart-with-index-label.html @@ -0,0 +1,123 @@ + + + + + + + CanvasJS Example + + +
+ + + diff --git a/charts/canvas/examples/11-stacked-area-chart/basic -stacked-area-chart.html b/charts/canvas/examples/11-stacked-area-chart/basic -stacked-area-chart.html new file mode 100644 index 0000000..9e79be5 --- /dev/null +++ b/charts/canvas/examples/11-stacked-area-chart/basic -stacked-area-chart.html @@ -0,0 +1,107 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/11-stacked-area-chart/stacked-area-chart-with-shared-tooltip.html b/charts/canvas/examples/11-stacked-area-chart/stacked-area-chart-with-shared-tooltip.html new file mode 100644 index 0000000..00563bd --- /dev/null +++ b/charts/canvas/examples/11-stacked-area-chart/stacked-area-chart-with-shared-tooltip.html @@ -0,0 +1,134 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/12-scatter-chart/basic-scatter-chart.html b/charts/canvas/examples/12-scatter-chart/basic-scatter-chart.html new file mode 100644 index 0000000..9b54ed4 --- /dev/null +++ b/charts/canvas/examples/12-scatter-chart/basic-scatter-chart.html @@ -0,0 +1,79 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/12-scatter-chart/multi-series-scatter-chart.html b/charts/canvas/examples/12-scatter-chart/multi-series-scatter-chart.html new file mode 100644 index 0000000..39acd07 --- /dev/null +++ b/charts/canvas/examples/12-scatter-chart/multi-series-scatter-chart.html @@ -0,0 +1,106 @@ + + + + + + + CanvasJS Example + + +
+
+ + + diff --git a/charts/canvas/examples/13-candlestick-chart/basic-candle-stick-chart.html b/charts/canvas/examples/13-candlestick-chart/basic-candle-stick-chart.html new file mode 100644 index 0000000..897d13e --- /dev/null +++ b/charts/canvas/examples/13-candlestick-chart/basic-candle-stick-chart.html @@ -0,0 +1,62 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/13-candlestick-chart/candle-stick-chart-with-rising-color-and-tooltip-customization.html b/charts/canvas/examples/13-candlestick-chart/candle-stick-chart-with-rising-color-and-tooltip-customization.html new file mode 100644 index 0000000..dfe1bec --- /dev/null +++ b/charts/canvas/examples/13-candlestick-chart/candle-stick-chart-with-rising-color-and-tooltip-customization.html @@ -0,0 +1,53 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/14-ohlc(stock)-chart/basic-ohlc-chart.html b/charts/canvas/examples/14-ohlc(stock)-chart/basic-ohlc-chart.html new file mode 100644 index 0000000..5864538 --- /dev/null +++ b/charts/canvas/examples/14-ohlc(stock)-chart/basic-ohlc-chart.html @@ -0,0 +1,52 @@ + + + + + + + CanvasJS Example + + +
+ + + + diff --git a/charts/canvas/examples/14-ohlc(stock)-chart/ohlc-chart-with-tooltip-customization.html b/charts/canvas/examples/14-ohlc(stock)-chart/ohlc-chart-with-tooltip-customization.html new file mode 100644 index 0000000..583ebbe --- /dev/null +++ b/charts/canvas/examples/14-ohlc(stock)-chart/ohlc-chart-with-tooltip-customization.html @@ -0,0 +1,83 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/15-step-line-chart/basic-step-line-chart.html b/charts/canvas/examples/15-step-line-chart/basic-step-line-chart.html new file mode 100644 index 0000000..a79af3c --- /dev/null +++ b/charts/canvas/examples/15-step-line-chart/basic-step-line-chart.html @@ -0,0 +1,48 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/15-step-line-chart/multi-series-step-line-chart.html b/charts/canvas/examples/15-step-line-chart/multi-series-step-line-chart.html new file mode 100644 index 0000000..fab0181 --- /dev/null +++ b/charts/canvas/examples/15-step-line-chart/multi-series-step-line-chart.html @@ -0,0 +1,69 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/16-step-area-chart/basic-step-area-chart.html b/charts/canvas/examples/16-step-area-chart/basic-step-area-chart.html new file mode 100644 index 0000000..43de4eb --- /dev/null +++ b/charts/canvas/examples/16-step-area-chart/basic-step-area-chart.html @@ -0,0 +1,49 @@ + + + + + + CanvasJS Example + + + +
+ + + \ No newline at end of file diff --git a/charts/canvas/examples/17-spline-area-chart/basic-spline-area-chart.html b/charts/canvas/examples/17-spline-area-chart/basic-spline-area-chart.html new file mode 100644 index 0000000..74e8387 --- /dev/null +++ b/charts/canvas/examples/17-spline-area-chart/basic-spline-area-chart.html @@ -0,0 +1,47 @@ + + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/17-spline-area-chart/spline-area-chart-with-stripline.html b/charts/canvas/examples/17-spline-area-chart/spline-area-chart-with-stripline.html new file mode 100644 index 0000000..f71fdf2 --- /dev/null +++ b/charts/canvas/examples/17-spline-area-chart/spline-area-chart-with-stripline.html @@ -0,0 +1,45 @@ + + + + + + CanvasJS Example + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/18-range-bar-chart/basic-range-bar-chart.html b/charts/canvas/examples/18-range-bar-chart/basic-range-bar-chart.html new file mode 100644 index 0000000..94d6df4 --- /dev/null +++ b/charts/canvas/examples/18-range-bar-chart/basic-range-bar-chart.html @@ -0,0 +1,46 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/18-range-bar-chart/range-bar-with-index-label.html b/charts/canvas/examples/18-range-bar-chart/range-bar-with-index-label.html new file mode 100644 index 0000000..b79b5dc --- /dev/null +++ b/charts/canvas/examples/18-range-bar-chart/range-bar-with-index-label.html @@ -0,0 +1,49 @@ + + + + + + + CanvasJS Example + + +
+ + + + diff --git a/charts/canvas/examples/19-range-column-chart/basic-range-column-chart.html b/charts/canvas/examples/19-range-column-chart/basic-range-column-chart.html new file mode 100644 index 0000000..281ce44 --- /dev/null +++ b/charts/canvas/examples/19-range-column-chart/basic-range-column-chart.html @@ -0,0 +1,52 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/19-range-column-chart/range-column-with-index-label.html b/charts/canvas/examples/19-range-column-chart/range-column-with-index-label.html new file mode 100644 index 0000000..81ce552 --- /dev/null +++ b/charts/canvas/examples/19-range-column-chart/range-column-with-index-label.html @@ -0,0 +1,83 @@ + + + + + + + CanvasJS Example + + +
+ + + + diff --git a/charts/canvas/examples/20-range-area-chart/basic-range-area-chart.html b/charts/canvas/examples/20-range-area-chart/basic-range-area-chart.html new file mode 100644 index 0000000..631b73a --- /dev/null +++ b/charts/canvas/examples/20-range-area-chart/basic-range-area-chart.html @@ -0,0 +1,40 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/20-range-area-chart/range-area-with-null-data.html b/charts/canvas/examples/20-range-area-chart/range-area-with-null-data.html new file mode 100644 index 0000000..71ec542 --- /dev/null +++ b/charts/canvas/examples/20-range-area-chart/range-area-with-null-data.html @@ -0,0 +1,55 @@ + + + + + + + CanvasJS Example + + +
+ + + + diff --git a/charts/canvas/examples/21-range-spline-area-chart/basic-range-spline-area_-chart.html b/charts/canvas/examples/21-range-spline-area-chart/basic-range-spline-area_-chart.html new file mode 100644 index 0000000..ad9b717 --- /dev/null +++ b/charts/canvas/examples/21-range-spline-area-chart/basic-range-spline-area_-chart.html @@ -0,0 +1,42 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/21-range-spline-area-chart/range-spline-area-with-line-chart.html b/charts/canvas/examples/21-range-spline-area-chart/range-spline-area-with-line-chart.html new file mode 100644 index 0000000..7de940c --- /dev/null +++ b/charts/canvas/examples/21-range-spline-area-chart/range-spline-area-with-line-chart.html @@ -0,0 +1,144 @@ + + + + + + + CanvasJS Example + + +
+
+ + + diff --git a/charts/canvas/examples/22-stacked-area-100-chart/basic-stacked-area-100-chart.html b/charts/canvas/examples/22-stacked-area-100-chart/basic-stacked-area-100-chart.html new file mode 100644 index 0000000..5ec88bd --- /dev/null +++ b/charts/canvas/examples/22-stacked-area-100-chart/basic-stacked-area-100-chart.html @@ -0,0 +1,107 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/22-stacked-area-100-chart/stacked-area-100-with-index-label.html b/charts/canvas/examples/22-stacked-area-100-chart/stacked-area-100-with-index-label.html new file mode 100644 index 0000000..df05566 --- /dev/null +++ b/charts/canvas/examples/22-stacked-area-100-chart/stacked-area-100-with-index-label.html @@ -0,0 +1,82 @@ + + + + + + + CanvasJS Example + + +
+
+ + diff --git a/charts/canvas/examples/23-stacked-bar-100-chart/basic-stacked-bar-100-chart.html b/charts/canvas/examples/23-stacked-bar-100-chart/basic-stacked-bar-100-chart.html new file mode 100644 index 0000000..ad83f96 --- /dev/null +++ b/charts/canvas/examples/23-stacked-bar-100-chart/basic-stacked-bar-100-chart.html @@ -0,0 +1,67 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/23-stacked-bar-100-chart/stacked-bar-100-with-index-label.html b/charts/canvas/examples/23-stacked-bar-100-chart/stacked-bar-100-with-index-label.html new file mode 100644 index 0000000..b78c9c0 --- /dev/null +++ b/charts/canvas/examples/23-stacked-bar-100-chart/stacked-bar-100-with-index-label.html @@ -0,0 +1,188 @@ + + + + + + + + + + CanvasJS Example + + +
+
+ + + + diff --git a/charts/canvas/examples/24-stacked-column-100-chart/basic-stacked-column-100-chart.html b/charts/canvas/examples/24-stacked-column-100-chart/basic-stacked-column-100-chart.html new file mode 100644 index 0000000..c7aee36 --- /dev/null +++ b/charts/canvas/examples/24-stacked-column-100-chart/basic-stacked-column-100-chart.html @@ -0,0 +1,46 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/24-stacked-column-100-chart/stacked-column-100-with-index-label.html b/charts/canvas/examples/24-stacked-column-100-chart/stacked-column-100-with-index-label.html new file mode 100644 index 0000000..fe7cab5 --- /dev/null +++ b/charts/canvas/examples/24-stacked-column-100-chart/stacked-column-100-with-index-label.html @@ -0,0 +1,106 @@ + + + + + + + CanvasJS Example + + +
+
+ + diff --git a/charts/canvas/examples/25 -jquery-plugin/basic-jquery-line-chart.html b/charts/canvas/examples/25 -jquery-plugin/basic-jquery-line-chart.html new file mode 100644 index 0000000..ba73e46 --- /dev/null +++ b/charts/canvas/examples/25 -jquery-plugin/basic-jquery-line-chart.html @@ -0,0 +1,41 @@ + + + + CanvasJS Example - jQuery Line Chart + + + + + + +
+ + \ No newline at end of file diff --git a/charts/canvas/examples/25 -jquery-plugin/multiple-charts-in-one-page.html b/charts/canvas/examples/25 -jquery-plugin/multiple-charts-in-one-page.html new file mode 100644 index 0000000..97e0407 --- /dev/null +++ b/charts/canvas/examples/25 -jquery-plugin/multiple-charts-in-one-page.html @@ -0,0 +1,257 @@ + + + + CanvasJS Example - jQuery Line Chart + + + + + +
+

+
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/26-some-common-options-across-all-chart-types/chart-with-animation.html b/charts/canvas/examples/26-some-common-options-across-all-chart-types/chart-with-animation.html new file mode 100644 index 0000000..8d913c7 --- /dev/null +++ b/charts/canvas/examples/26-some-common-options-across-all-chart-types/chart-with-animation.html @@ -0,0 +1,49 @@ + + + + + + + CanvasJS Example + + +
+ + diff --git a/charts/canvas/examples/26-some-common-options-across-all-chart-types/combination-charts.html b/charts/canvas/examples/26-some-common-options-across-all-chart-types/combination-charts.html new file mode 100644 index 0000000..43d895e --- /dev/null +++ b/charts/canvas/examples/26-some-common-options-across-all-chart-types/combination-charts.html @@ -0,0 +1,93 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/examples/26-some-common-options-across-all-chart-types/culture.html b/charts/canvas/examples/26-some-common-options-across-all-chart-types/culture.html new file mode 100644 index 0000000..d504110 --- /dev/null +++ b/charts/canvas/examples/26-some-common-options-across-all-chart-types/culture.html @@ -0,0 +1,50 @@ + + + + + + CanvasJS Example + + +
+
+ + diff --git a/charts/canvas/examples/26-some-common-options-across-all-chart-types/export-chart.html b/charts/canvas/examples/26-some-common-options-across-all-chart-types/export-chart.html new file mode 100644 index 0000000..9d660e2 --- /dev/null +++ b/charts/canvas/examples/26-some-common-options-across-all-chart-types/export-chart.html @@ -0,0 +1,46 @@ + + + + + + + + CanvasJS Example + + +
+ + + diff --git a/charts/canvas/examples/26-some-common-options-across-all-chart-types/hide-and-unhide-data-series-from-legend.html b/charts/canvas/examples/26-some-common-options-across-all-chart-types/hide-and-unhide-data-series-from-legend.html new file mode 100644 index 0000000..babc91c --- /dev/null +++ b/charts/canvas/examples/26-some-common-options-across-all-chart-types/hide-and-unhide-data-series-from-legend.html @@ -0,0 +1,77 @@ + + + + + + CanvasJS Example + + +
+
+ + \ No newline at end of file diff --git a/charts/canvas/instruction.txt b/charts/canvas/instruction.txt new file mode 100644 index 0000000..93eb448 --- /dev/null +++ b/charts/canvas/instruction.txt @@ -0,0 +1,4 @@ +For standalone version include canvasjs.min.js +For jQuery version include jquery.canvasjs.min.js + +** DO NOT include both the files ** \ No newline at end of file diff --git a/charts/canvas/jquery.canvasjs.min.js b/charts/canvas/jquery.canvasjs.min.js new file mode 100644 index 0000000..e6b7faf --- /dev/null +++ b/charts/canvas/jquery.canvasjs.min.js @@ -0,0 +1,649 @@ +/* + CanvasJS HTML5 & JavaScript Charts - v1.9.8 GA - http://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. + http://canvasjs.com/license-canvasjs/ + +*/ +(function(){function U(a,d){a.prototype=Pa(d.prototype);a.prototype.constructor=a;a.base=d.prototype}function Pa(a){function d(){}d.prototype=a;return new d}function Ha(a,d,b){"millisecond"===b?a.setMilliseconds(a.getMilliseconds()+1*d):"second"===b?a.setSeconds(a.getSeconds()+1*d):"minute"===b?a.setMinutes(a.getMinutes()+1*d):"hour"===b?a.setHours(a.getHours()+1*d):"day"===b?a.setDate(a.getDate()+1*d):"week"===b?a.setDate(a.getDate()+7*d):"month"===b?a.setMonth(a.getMonth()+1*d):"year"===b&&a.setFullYear(a.getFullYear()+ +1*d);return a}function O(a,d){var b=!1;0>a&&(b=!0,a*=-1);a=""+a;for(d=d?d:1;a.length>16).toString(16),b=((a&65280)>>8).toString(16);a=((a&255)>>0).toString(16);d=2>d.length?"0"+d:d;b=2>b.length?"0"+b:b;a=2>a.length?"0"+a:a;return"#"+d+b+a}function Ra(a,d){var b=this.length>>>0,c=Number(d)|| +0,c=0>c?Math.ceil(c):Math.floor(c);for(0>c&&(c+=b);cb;b++)if(a[b]!==a[b+4]|a[b]!==a[b+8]|a[b]!==a[b+12]){d=!1;break}return d?a[0]<< +16|a[1]<<8|a[2]:0}function L(a,d,b){return a in d?d[a]:b[a]}function ra(a,d,b){if(u&&Ma){var c=a.getContext("2d");sa=c.webkitBackingStorePixelRatio||c.mozBackingStorePixelRatio||c.msBackingStorePixelRatio||c.oBackingStorePixelRatio||c.backingStorePixelRatio||1;Q=za/sa;a.width=d*Q;a.height=b*Q;za!==sa&&(a.style.width=d+"px",a.style.height=b+"px",c.scale(Q,Q))}else a.width=d,a.height=b}function Sa(a){if(!Aa){var d=!1,b=!1;"undefined"===typeof ca.Chart.creditHref?(a.creditHref="http://canvasjs.com/", +a.creditText="CanvasJS.com"):(d=a.updateOption("creditText"),b=a.updateOption("creditHref"));if(a.creditHref&&a.creditText){a._creditLink||(a._creditLink=document.createElement("a"),a._creditLink.setAttribute("class","canvasjs-chart-credit"),a._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:2px;top:"+(a.height-14)+"px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"),a._creditLink.setAttribute("tabIndex", +-1),a._creditLink.setAttribute("target","_blank"));if(0===a.renderCount||d||b)a._creditLink.setAttribute("href",a.creditHref),a._creditLink.innerHTML=a.creditText;a._creditLink&&a.creditHref&&a.creditText?(a._creditLink.parentElement||a._canvasJSContainer.appendChild(a._creditLink),a._creditLink.style.top=a.height-14+"px"):a._creditLink.parentElement&&a._canvasJSContainer.removeChild(a._creditLink)}}}function ga(a,d){var b=document.createElement("canvas");b.setAttribute("class","canvasjs-chart-canvas"); +ra(b,a,d);u||"undefined"===typeof G_vmlCanvasManager||G_vmlCanvasManager.initElement(b);return b}function Ba(a,d,b){if(a&&d&&b){b=b+"."+d;var c="image/"+d;a=a.toDataURL(c);var f=!1,g=document.createElement("a");g.download=b;g.href=a;g.target="_blank";if("undefined"!==typeof Blob&&new Blob){for(var h=a.replace(/^data:[a-z/]*;base64,/,""),h=atob(h),l=new ArrayBuffer(h.length),l=new Uint8Array(l),k=0;k
Please right click on the image and save it to your device
"),d.document.close()}}}function T(a,d,b){d.getAttribute("state")!== +b&&(d.setAttribute("state",b),d.setAttribute("type","button"),d.style.position="relative",d.style.margin="0px 0px 0px 0px",d.style.padding="3px 4px 0px 4px",d.style.cssFloat="left",d.setAttribute("title",a._cultureInfo[b+"Text"]),d.innerHTML=""+a._cultureInfo[b+"Text"]+"")}function ta(){for(var a=null,d=0;da[g].x&&0k?{x:a[l].x+k/3,y:a[l].y+c/3}:{x:a[l].x,y:a[l].y+c/9};l=f;g=0===l?0:l-1;h=l===a.length-1?l:l+1;c=Math.abs((a[h].x-a[g].x)/(0===a[l].x-a[g].x?0.01:a[l].x-a[g].x))*(d-1)/2+1;k=(a[h].x-a[g].x)/c;c=(a[h].y-a[g].y)/c;b[b.length]=a[l].x>a[g].x&&0k?{x:a[l].x-k/3,y:a[l].y-c/3}:{x:a[l].x,y:a[l].y-c/9};b[b.length]=a[f]}return b}function Na(a,d){if(null===a||"undefined"===typeof a)return d;var b=parseFloat(a.toString())* +(0<=a.toString().indexOf("%")?d/100:1);return!isNaN(b)&&b<=d&&0<=b?b:d}function ja(a,d,b,c,f){"undefined"===typeof f&&(f=0);this._padding=f;this._x1=a;this._y1=d;this._x2=b;this._y2=c;this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding}function W(a,d){W.base.constructor.call(this,"TextBlock",d);this.ctx=a;this._isDirty=!0;this._wrappedText=null}function ma(a,d){ma.base.constructor.call(this,"Title",d,a.theme,a);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx; +this.optionsName="title";if(x(this.options.margin)&&a.options.subtitles)for(var b=a.options.subtitles,c=0;cthis.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&& +(this.labelAngle-=360);if(this.options.stripLines&&0t?"a":"p";case "tt":return 12>t?"am":"pm";case "T":return 12>t?"A":"P";case "TT":return 12>t?"AM":"PM";case "K":return q?"UTC":(String(l).match(g)|| +[""]).pop().replace(h,"");case "z":return(0a?!0:!1;c&&(a*=-1);var f=b?b.decimalSeparator:".",g=b?b.digitGroupSeparator:",",h="";d=String(d);var h=1,l=b="",k=-1,m=[],n=[],p=0,e=0,r=0,q=!1,s=0,l=d.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g); +d=null;for(var v=0;l&&vk)k=v;else{if("%"===d)h*=100;else if("\u2030"===d){h*=1E3;continue}else if(","===d[0]&&"."===d[d.length-1]){h/=Math.pow(1E3,d.length-1);k=v+d.length-1;continue}else"E"!==d[0]&&"e"!==d[0]||"0"!==d[d.length-1]||(q=!0);0>k?(m.push(d),"#"===d||"0"===d?p++:","===d&&r++):(n.push(d),"#"!==d&&"0"!==d||e++)}q&&(d=Math.floor(a),l=-Math.floor(Math.log(a)/Math.LN10+1),s=0===a?0:0===d?-(p+l):String(d).length-p,h/=Math.pow(10,s));0>k&&(k=v);h=(a*h).toFixed(e); +d=h.split(".");h=(d[0]+"").split("");a=(d[1]+"").split("");h&&"0"===h[0]&&h.shift();for(q=l=v=e=k=0;0s?d.replace("+","").replace("-",""):d.replace("-",""),b+=d.replace(/[0]+/,function(a){return O(s,a.length)}));g="";for(m=!1;0s?d.replace("+","").replace("-",""):d.replace("-",""),g+=d.replace(/[0]+/,function(a){return O(s,a.length)}));b+=(m?f:"")+g;return c?"-"+b:b},xa=function(a){var d=0,b=0;a=a||window.event;a.offsetX||0===a.offsetX?(d=a.offsetX,b=a.offsetY):a.layerX||0==a.layerX?(d=a.layerX,b=a.layerY):(d=a.pageX-a.target.offsetLeft,b=a.pageY-a.target.offsetTop);return{x:d,y:b}},Ma=!0,za=window.devicePixelRatio||1,sa=1,Q=Ma?za/sa:1,Aa=window&&window.location&&window.location.href&& +window.location.href.indexOf&&(-1!==window.location.href.indexOf("canvasjs.com")||-1!==window.location.href.indexOf("fiddle")),Ta={reset:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAKRSURBVEiJrdY/iF1FFMfxzwnZrGISUSR/JLGIhoh/QiRNBLWxMLIWEkwbgiAoFgoW2mhlY6dgpY2IlRBRxBSKhSAKIklWJRYuMZKAhiyopAiaTY7FvRtmZ+/ed9/zHRjezLw5v/O9d86cuZGZpmURAfdn5o9DfdZNLXpjz+LziPgyIl6MiG0jPTJzZBuyDrP4BVm0P/AKbljTb4ToY/gGewYA7KyCl+1b3DUYANvwbiHw0gCAGRzBOzjTAXEOu0cC4Ch+r5x/HrpdrcZmvIDFSucMtnYCYC++6HmNDw8FKDT34ETrf639/azOr5vwRk/g5fbeuABtgC04XWk9VQLciMP4EH/3AFzErRNC7MXlQmsesSoHsGPE23hmEoBW+61K66HMXFmIMvN8myilXS36R01ub+KfYvw43ZXwYDX+AHP4BAci4pFJomfmr/ihmNofESsBImJGk7mlncrM45n5JPbhz0kAWpsv+juxaX21YIPmVJS2uNzJMS6ZNexC0d+I7fUWXLFyz2kSZlpWPvASlmqAf/FXNXf3FAF2F/1LuFifAlionB6dRuSI2IwHi6lzmXmp6xR8XY0fiIh7psAwh+3FuDkRHQVjl+a8lkXjo0kLUKH7XaV5oO86PmZ1FTzyP4K/XGl9v/zwfbW7BriiuETGCP5ch9bc9f97HF/vcFzCa5gdEPgWq+t/4v0V63oE1uF4h0DiFJ7HnSWMppDdh1dxtsPvJ2wcBNAKbsJXa0Ck5opdaBPsRNu/usba09i1KsaAVzmLt3sghrRjuK1Tf4xkegInxwy8gKf7dKMVH2QRsV5zXR/Cftyu+aKaKbbkQrsdH+PTzLzcqzkOQAVzM+7FHdiqqe2/YT4zF/t8S/sPmawyvC974vcAAAAASUVORK5CYII="}, +pan:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAJVSURBVFiFvZe7a1RBGMV/x2hWI4JpfKCIiSBKOoOCkID/wP4BFqIIFkE02ChIiC8QDKlSiI3YqRBsBVGwUNAUdiIEUgjiAzQIIsuKJsfizsXr5t7d+8jmwLDfzHz3nLOzc7+ZxTZlGyDgZiWOCuJ9wH2gCUyuqQFgF/AGcKJNrYkBYBj40CIet+muGQi/96kM4WS7C/Tm5VUg7whJg8BkEGkCR4BDYfodsADUgP6wErO5iCtswsuJb32hdbXy8qzL5TIdmzJinHdZoZIBZcSFkGlAKs1Z3YCketZcBtouuaQNkrblMiBpBrhme7mAgU4wMCvpcFsDkq4C54DFVRTH9h+i6vlE0r5UA5ImgCuh28jB28iIs7BIVCOeStoZD64P4uPAjUTygKSx2FsK2TIwkugfk9Qkfd/E+yMWHQCeSRqx/R3gOp3LazfaS2C4B5gHDgD7U9x3E3uAH7KNpC3AHHAwTL4FHgM9GQ8vAaPA0dB/Abxqk2/gBLA9MXba9r1k/d4LfA3JtwueBeM58ucS+edXnAW23wP10N3advEi9CXizTnyN4bPS7Zn4sH/dq3t18AY4e1YLYSy3g/csj2VnFshZPuOpOeSKHCodUINuGj7YetE6je1PV9QoNPJ9StNHKodx7nRbiWrGHBGXAi5DUiqtQwtpcWK0Jubt8CltA5MEV1IfwO7+VffPwGfia5m34CT4bXujIIX0Qna1/cGMNqV/wUJE2czxD8CQ4X5Sl7Jz7SILwCDpbjKPBRMHAd+EtX4HWV5Spdc2w8kDQGPbH8py/MXMygM69/FKz4AAAAASUVORK5CYII="}, +zoom:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAMqSURBVFiFvdfbj91TFMDxz57U6GUEMS1aYzyMtCSSDhWjCZMInpAI3khE/QHtgzdRkXgSCS8SES9epKLi0oRKNETjRahREq2KS1stdRujtDPtbA97n5zdn9+5zJxTK9k5v3POXmt991p7r71+IcaoGwkhTOIebMRqzOBTvIG3Y4zTXRmqSoyx5cAKbMJOHMFJnMZ8/jyFaXyMR7G6nb1aH22cP4BvcBxziG3GKfyTIR9D6BYg1KUghPBCDveFlb/24Av8iuUYw41YVsz5G7uxKcZ4aMEpwGt5NY3V/YbHsQ6rcAHOw/kYxigewr5CZw4fYGxBKcCLOFEYehXrMdRhr5yLETxVScsOLOkKAPfn1TYMPIvLFrShUlS2FDZm8XRHACzFAWl3R2xbqPMCYhmeLCAOYEMngAczbcTvuHYxzguIy/FesR9e6gSwU/OoPYHBHgHgviIKX2Flq7k34KhmcVnbi/PC8JX4MgMcxb118wZwdz5aISscqx7VRcox7MrPQ7i+btIAJrAkf9+bI9EPmZY2IAxiTSuAldLq4Y9+AcSUh78KP0tbAcwU35cXMD1JCIFUoGiehlqAz6TNB1f1C0DK+0h+nsNPrQC2a4bqGmlD9kOGcWt+Po6pVgDvSxfJaSkFd4UQBvoAsBYbCoB3a2flM7slA0R8iyt6rAFDeDPbm8eOTpVwGD9qVq7nLbIaZnmksPU1JtsCZMXNmpdRxFasWITzh6Xj3LCzra1OxcD2QjHiGVzdpfORnMqZio2PcF23ABdJF1Np4BPptlyPi6WzPYBzpJZtHe7A6xW9cnyP8TqA//SEIYRL8Bxul7rihvwgtVn78WcGGZXa9HGd5TDujDHuOePXNiHdKjWgZX/YbsxLx/ktqbjVzTlcjUSnvI5JrdlUVp6WesZZ6R1hRrpq9+EVTGS9jTjYAuKIouGpbcurEkIYxC051KNSamazsc+xK8b4S0VnEi/j0hqTP+M27O258egQwZuzs7pI7Mf4WQXIEDc5s9sux+5+1Py2EmP8UOq6GvWhIScxfdYjUERiAt9Jd84J6a16zf8JEKT3yCm8g1UxRv8CC4pyRhzR1uUAAAAASUVORK5CYII="}, +menu:{image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAgCAYAAAAbifjMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK6wAACusBgosNWgAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAAWdEVYdENyZWF0aW9uIFRpbWUAMDcvMTUvMTTPsvU0AAAAP0lEQVRIie2SMQoAIBDDUvH/X667g8sJJ9KOhYYOkW0qGaU1MPdC0vGSbV19EACo3YMPAFH5BUBUjsqfAPpVXtNgGDfxEDCtAAAAAElFTkSuQmCC"}};(function(){z.fSDec=function(a){for(var d="",b=0;b=(new Date).getTime()-a._dropDownCloseTime.getTime()||(a._dropdownMenu.style.display="block",a._menuButton.blur(),a._dropdownMenu.focus())},!0));if(!this._dropdownMenu&&this.exportEnabled&&u){this._dropdownMenu=document.createElement("div");this._dropdownMenu.setAttribute("tabindex", +-1);this._dropdownMenu.style.cssText="position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer;right: 1px;top: 25px;min-width: 120px;outline: 0;border: 1px solid silver;font-size: 14px;font-family: Calibri, Verdana, sans-serif;padding: 5px 0px 5px 0px;text-align: left;background-color: #fff;line-height: 20px;box-shadow: 2px 2px 10px #888888;";a._dropdownMenu.style.display="none";this._toolBar.appendChild(this._dropdownMenu);K(this._dropdownMenu, +"blur",function(){Y(a._dropdownMenu);a._dropDownCloseTime=new Date},!0);var d=document.createElement("div");d.style.cssText="padding: 2px 15px 2px 10px";d.innerHTML=this._cultureInfo.printText;this._dropdownMenu.appendChild(d);K(d,"mouseover",function(){this.style.backgroundColor="#EEEEEE"},!0);K(d,"mouseout",function(){this.style.backgroundColor="transparent"},!0);K(d,"click",function(){a.print();Y(a._dropdownMenu)},!0);d=document.createElement("div");d.style.cssText="padding: 2px 15px 2px 10px"; +d.innerHTML=this._cultureInfo.saveJPGText;this._dropdownMenu.appendChild(d);K(d,"mouseover",function(){this.style.backgroundColor="#EEEEEE"},!0);K(d,"mouseout",function(){this.style.backgroundColor="transparent"},!0);K(d,"click",function(){Ba(a.canvas,"jpeg",a.exportFileName);Y(a._dropdownMenu)},!0);d=document.createElement("div");d.style.cssText="padding: 2px 15px 2px 10px";d.innerHTML=this._cultureInfo.savePNGText;this._dropdownMenu.appendChild(d);K(d,"mouseover",function(){this.style.backgroundColor= +"#EEEEEE"},!0);K(d,"mouseout",function(){this.style.backgroundColor="transparent"},!0);K(d,"click",function(){Ba(a.canvas,"png",a.exportFileName);Y(a._dropdownMenu)},!0)}"none"!==this._toolBar.style.display&&this._zoomButton&&(this.panEnabled?T(a,a._zoomButton,"zoom"):T(a,a._zoomButton,"pan"),a._resetButton.getAttribute("state")!==a._cultureInfo.resetText&&T(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)};A.prototype._updateSize=function(){var a=0,d=0;this.options.width?a=this.width:this.width=a=0a&&"undefined"!==typeof l.startTimePercent?a>=l.startTimePercent&&l.animationCallback(l.easingFunction(a-l.startTimePercent,0,1,1-l.startTimePercent),l):l.animationCallback(l.easingFunction(a,0,1,1),l);k.dispatchEvent("dataAnimationIterationEnd",{chart:k})},function(){c=[];for(var a=0;aa.dataSeriesIndexes.length))for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=0;hb.max&&(b.max=c);fd.max&&(d.max=f);if(0q&&(q=1/q);b.minDiff>q&&1!==q&&(b.minDiff=q)}else q=c-l.dataPoints[k- +1].x,0>q&&(q*=-1),b.minDiff>q&&0!==q&&(b.minDiff=q);null!==f&&null!==l.dataPoints[k-1].y&&(a.axisY.logarithmic?(q=f/l.dataPoints[k-1].y,1>q&&(q=1/q),d.minDiff>q&&1!==q&&(d.minDiff=q)):(q=f-l.dataPoints[k-1].y,0>q&&(q*=-1),d.minDiff>q&&0!==q&&(d.minDiff=q)))}if(cr&&!n)n=!0;else if(c>r&&n)continue;l.dataPoints[k].label&&(a.axisX.labels[c]=l.dataPoints[k].label);cb.viewPortMax&&(b.viewPortMax=c);null=== +f?b.viewPortMin===c&&pd.viewPortMax&&(d.viewPortMax=f))}}this.plotInfo.axisXValueType=l.xValueType=g?"dateTime":"number"}};A.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=[],l=[],k=Infinity,m=0;mb.max&&(b.max=c);if(0w&&(w=1/ +w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-n.dataPoints[p-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);null!==f&&null!==n.dataPoints[p-1].y&&(a.axisY.logarithmic?0w&&(w=1/w),d.minDiff>w&&1!==w&&(d.minDiff=w)):(w=f-n.dataPoints[p-1].y,0>w&&(w*=-1),d.minDiff>w&&0!==w&&(d.minDiff=w)))}if(cv&&!r)r=!0;else if(c>v&&r)continue;n.dataPoints[p].label&&(a.axisX.labels[c]=n.dataPoints[p].label); +cb.viewPortMax&&(b.viewPortMax=c);null===n.dataPoints[p].y?b.viewPortMin===c&&qd.max&&(d.max=a),pb.viewPortMax||(ad.viewPortMax&& +(d.viewPortMax=a)));for(p in l)l.hasOwnProperty(p)&&!isNaN(p)&&(a=l[p],ad.max&&(d.max=a),pb.viewPortMax||(ad.viewPortMax&&(d.viewPortMax=a)))}};A.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var d=a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g=!1,h=!1,l=!1,k=[],m=0;mb.max&&(b.max=c);if(0w&&(w=1/w);b.minDiff>w&&1!==w&&(b.minDiff=w)}else w=c-n.dataPoints[p-1].x,0>w&&(w*=-1),b.minDiff>w&&0!==w&&(b.minDiff=w);x(f)||null===n.dataPoints[p-1].y||(a.axisY.logarithmic?0w&&(w=1/w),d.minDiff>w&&1!==w&&(d.minDiff=w)):(w=f-n.dataPoints[p-1].y,0>w&&(w*=-1),d.minDiff>w&&0!==w&&(d.minDiff=w)))}if(cv&&!r)r=!0;else if(c>v&&r)continue;n.dataPoints[p].label&&(a.axisX.labels[c]=n.dataPoints[p].label); +cb.viewPortMax&&(b.viewPortMax=c);null===f?b.viewPortMin===c&&qf&&(l=!0),k[c]=k[c]?k[c]+Math.abs(f):Math.abs(f))}}this.plotInfo.axisXValueType=n.xValueType=g?"dateTime":"number"}a.axisY.logarithmic?(d.max=x(d.viewPortMax)?99*Math.pow(a.axisY.logarithmBase,-0.05):Math.max(d.viewPortMax,99*Math.pow(a.axisY.logarithmBase,-0.05)),d.min=x(d.viewPortMin)?1:Math.min(d.viewPortMin, +1)):h&&!l?(d.max=x(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=x(d.viewPortMin)?1:Math.min(d.viewPortMin,1)):h&&l?(d.max=x(d.viewPortMax)?99:Math.max(d.viewPortMax,99),d.min=x(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99)):!h&&l&&(d.max=x(d.viewPortMax)?-1:Math.max(d.viewPortMax,-1),d.min=x(d.viewPortMin)?-99:Math.min(d.viewPortMin,-99));d.viewPortMin=d.min;d.viewPortMax=d.max;a.dataPointYSums=k}};A.prototype._processMultiYPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var d= +a.axisY.dataInfo,b=a.axisX.dataInfo,c,f,g,h,l=!1,k=0;kb.max&&(b.max=c);gd.max&&(d.max=h);0q&&(q=1/q),b.minDiff>q&&1!==q&&(b.minDiff=q)):(q=c-m.dataPoints[n-1].x,0>q&&(q*=-1),b.minDiff>q&&0!==q&&(b.minDiff=q)),f&&(null!==f[0]&&m.dataPoints[n-1].y&&null!==m.dataPoints[n-1].y[0])&&(a.axisY.logarithmic?(q=f[0]/ +m.dataPoints[n-1].y[0],1>q&&(q=1/q),d.minDiff>q&&1!==q&&(d.minDiff=q)):(q=f[0]-m.dataPoints[n-1].y[0],0>q&&(q*=-1),d.minDiff>q&&0!==q&&(d.minDiff=q))));if(!(cw&&!e)e=!0;else if(c>w&&e)continue;m.dataPoints[n].label&&(a.axisX.labels[c]=m.dataPoints[n].label);cb.viewPortMax&&(b.viewPortMax=c);if(b.viewPortMin===c&&f)for(y=0;yd.viewPortMax&&(d.viewPortMax=h))}}this.plotInfo.axisXValueType=m.xValueType=l?"dateTime":"number"}};A.prototype.getDataPointAtXY=function(a,d,b){b=b||!1;for(var c=[],f=this._dataInRenderedOrder.length-1;0<=f;f--){var g=null;(g=this._dataInRenderedOrder[f].getDataPointAtXY(a,d,b))&&c.push(g)}a=null;d=!1;for(b=0;b=f.x1&&(a<=f.x2&&d>=f.y1&&d<=f.y2)&&(c=f.id)}return c};A.prototype.getAutoFontSize=function(a,d,b){a/=400;return Math.max(10,Math.round(Math.min(this.width,this.height)*a))};A.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};A.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))};A.prototype.attachEvent= +function(a){this._events.push(a)};A.prototype._touchEventHandler=function(a){if(a.changedTouches&&this.interactivityEnabled){var d=[],b=a.changedTouches,c=b?b[0]:a,f=null;switch(a.type){case "touchstart":case "MSPointerDown":d=["mousemove","mousedown"];this._lastTouchData=xa(c);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":d=["mousemove"];break;case "touchend":case "MSPointerUp":d="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType?["mouseup", +"click"]:["mouseup"];break;default:return}if(!(b&&1h)){this._lastTouchData.scroll=!0;var l=window.parent||window;l&&l.scrollBy&&l.scrollBy(0,-g)}}catch(k){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(b=0;b=f.x1&&d.x<=f.x2&&d.y>=f.y1&&d.y<=f.y2){c[b].call(c.context,d.x,d.y);"mousedown"===b&&!0===c.capture?(A.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(d.xb.x2||d.yb.y2)this.toolTip&&this.toolTip.enabled?this.toolTip.hide():this.resetOverlayedCanvas();this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}};A.prototype._plotAreaMouseDown= +function(a,d){this.isDrag=!0;this.dragStartPoint={x:a,y:d}};A.prototype._plotAreaMouseUp=function(a,d){if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var b=d-this.dragStartPoint.y,c=a-this.dragStartPoint.x,f=0<=this.zoomType.indexOf("x"),g=0<=this.zoomType.indexOf("y"),h=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var l=g,g=f,f=l;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(f=g=0;fb.maximum&&(g=b.viewportMaximum/b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum/g,b.sessionVariables.newViewportMaximum=b.viewportMaximum/g,h=!0):b.viewportMinimumb.maximum&&(g=b.viewportMaximum-b.maximum,b.sessionVariables.newViewportMinimum=b.viewportMinimum-g,b.sessionVariables.newViewportMaximum=b.viewportMaximum-g,h=!0);else if((!f||2Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this.toolTip.hide():this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,d);if((!f||2e)var r=e,e=p,p=r;if(isFinite(h.dataInfo.minDiff))if(!(h.logarithmic&&e/ph.maximum))k.push(h),n.push({val1:p,val2:e}),l=!0;else if(!f){l=!1;break}}return{isValid:l,axesWithValidRange:k,axesRanges:n}};A.prototype.preparePlotArea=function(){var a=this.plotArea;!u&&(0b.lineCoordinates.x2?d.x2:b.lineCoordinates.x2;a.y2=d.y2>d.y1?d.y2:b.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0b.lineCoordinates.x2?d.x2:b.lineCoordinates.x2,a.y2=d.y2>d.y1?d.y2:b.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else d= +this.layoutManager.getFreeSpace(),a.x1=d.x1,a.x2=d.x2,a.y1=d.y1,a.y2=d.y2,a.width=d.width,a.height=d.height;u||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0Z.viewportMaximum||m.dataPoint.yaa.viewportMaximum)continue}else if(0<=n.indexOf("column")){if(m.dataPoint.xZ.viewportMaximum||m.bounds.y1>b.y2||m.bounds.y2Z.viewportMaximum||m.bounds.x1> +b.x2||m.bounds.x2Z.viewportMaximum)continue;f=h=2;"horizontal"===y?(l=r.width,k=r.height):(k=r.width,l=r.height);if("normal"===this.plotInfo.axisPlacement){if(0<=n.indexOf("line")||0<=n.indexOf("area"))w="auto",h=4;else if(0<=n.indexOf("stacked"))"auto"===w&&(w="inside");else if("bubble"===n||"scatter"===n)w="inside";p=m.point.x-l/2;"inside"!==w?(f=b.y1,g=b.y2,0m.point.y)):(e=m.point.y+h+c,e>g-k-h-c&&(e="auto"===w?Math.min(m.point.y,g)-k-h-c:g-k-h-c,z=eg-k-h&&("bubble"===n||"scatter"===n)&& +(e=Math.min(m.point.y+h,b.y2-k-h))),e=Math.min(e,g-k))}else 0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("scatter")?(w="auto",f=4):0<=n.indexOf("stacked")?"auto"===w&&(w="inside"):"bubble"===n&&(w="inside"),e=m.point.y-k/2,"inside"!==w?(h=b.x1,g=b.x2,0>D?(p=m.point.x-l-f-c,pm.point.x)):(p=m.point.x+f+c,p>g-l-f-c&&(p="auto"===w?Math.min(m.point.x,g)-l-f-c:g-l-f-c,z=pD?Math.max(m.bounds.x1,b.x1)+l/2+f:Math.min(m.bounds.x2,b.x2)-l/2-f:(Math.max(m.bounds.x1,b.x1)+Math.min(m.bounds.x2,b.x2))/2,p=0>D?Math.max(m.point.x,c)-l/2:Math.min(m.point.x,c)-l/2,p=Math.max(p,h));"vertical"===y&&(e+=k);r.x=p;r.y=e;r.render(!0);v&&("inside"!==w&&(0>n.indexOf("bar")&&m.point.x>b.x1&&m.point.xn.indexOf("column")&&m.point.y>b.y1&&m.point.y=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;d.save();var c=this.plotArea;d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();for(var c=[],f=null,g=0;ga.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!y)))if("number"!==typeof k[s].y)0k[s].y===a.axisY.reversed?1:-1,color:e})}d.stroke();u&&b.stroke()}}P.drawMarkers(c); +l.markerColor=f;d.restore();d.beginPath();u&&b.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;d.save();var c=this.plotArea;d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();for(var c=[],f=null,g=0;ga.axisX.dataInfo.viewPortMax&&(!l.connectNullData||!y)))if("number"!==typeof k[s].y)0k[s].y===a.axisY.reversed?1:-1,color:e})}d.stroke();u&&b.stroke()}}P.drawMarkers(c);l.markerColor=f;d.restore();d.beginPath();u&&b.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderSpline=function(a){function d(a){a=ua(a,2);if(0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;b.save();var f=this.plotArea;b.beginPath();b.rect(f.x1,f.y1,f.width,f.height);b.clip();for(var f=[],g=null,h=0;ha.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!w)))if("number"!==typeof m[s].y)0m[s].y===a.axisY.reversed?1:-1,color:r});w=!1}d(y)}P.drawMarkers(f);k.markerColor=g;b.restore();b.beginPath();u&&c.beginPath();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};var N=function(a,d,b,c,f,g,h,l,k,m,n,p,e){"undefined"===typeof e&&(e=1);h=h||0;l=l||"black"; +var r=15=a.dataSeriesIndexes.length)){var b=null, +c=this.plotArea,f=0,g,h,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.dataPointMinWidth=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=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,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth= +this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>m&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(n=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width, +c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(c=0;ca.axisX.dataInfo.viewPortMax)&&"number"===typeof e[f].y){g=a.axisX.convertValueToPixel(l);h= +a.axisY.convertValueToPixel(e[f].y);g=a.axisX.reversed?g+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+c)*n<<0:g-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+c)*n<<0;var q=a.axisX.reversed?g-n<<0:g+n<<0,s;0<=e[f].y?s=k:(s=h,h=k);h>s&&(b=h,h=s,s=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,g,h,q,s,b,0,null,r&&0<=e[f].y,0>e[f].y&&r,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:f, +x1:g,y1:h,x2:q,y2:s};b=G(b);u&&N(this._eventManager.ghostCtx,g,h,q,s,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:e[f],dataSeries:p,point:{x:g+(q-g)/2,y:0>e[f].y===a.axisY.reversed?h:s},direction:0>e[f].y===a.axisY.reversed?1:-1,bounds:{x1:g,y1:Math.min(h,s),x2:q,y2:Math.max(h,s)},color:b})}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(k,a.axisY.bounds.y2);return{source:d, +dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth: +this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>n&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){var c=a.axisX.convertValueToPixel(b),v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic)h[b]=q[l].y+(h[b]?h[b]:0),0q[l].y&&s,!1,!1,r.fillOpacity);b=r.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:k,x2:w,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,k,w,y,b,0,null,!1,!1,!1,!1);(q[l].indexLabel||r.indexLabel||q[l].indexLabelFormatter||r.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:q[l],dataSeries:r,point:{x:c,y:0<=q[l].y?k:y},direction:0>q[l].y===a.axisY.reversed?1: +-1,bounds:{x1:v,y1:Math.min(k,y),x2:w,y2:Math.max(k,y)},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(m,a.axisY.bounds.y2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedColumn100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic? +a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&& +l>n&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){c=a.axisX.convertValueToPixel(b);k=0!==a.dataPointYSums[b]?100*(q[l].y/a.dataPointYSums[b]):0;var v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic){h[b]=k+(h[b]?h[b]:0);if(0>=h[b])continue;k=a.axisY.convertValueToPixel(h[b]); +y=f[b]?f[b]:m;f[b]=k}else if(k=a.axisY.convertValueToPixel(k),0<=q[l].y){var t=f[b]?f[b]:0;k-=t;y=m-t;f[b]=t+(y-k)}else t=g[b]?g[b]:0,y=k+t,k=m+t,g[b]=t+(y-k);b=q[l].color?q[l].color:r._colorSet[l%r._colorSet.length];N(d,v,k,w,y,b,0,null,s&&0<=q[l].y,0>q[l].y&&s,!1,!1,r.fillOpacity);b=r.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:k,x2:w,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,k,w,y,b,0,null,!1,!1,!1,!1);(q[l].indexLabel|| +r.indexLabel||q[l].indexLabelFormatter||r.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:q[l],dataSeries:r,point:{x:c,y:0<=q[l].y?k:y},direction:0>q[l].y===a.axisY.reversed?1:-1,bounds:{x1:v,y1:Math.min(k,y),x2:w,y2:Math.max(k,y)},color:b})}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.min(m,a.axisY.bounds.y2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.yScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderBar= +function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,m=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)|| +(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>m&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&mm&&(n=m);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath(); +d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(c=0;ca.axisX.dataInfo.viewPortMax)&&"number"=== +typeof e[f].y){h=a.axisX.convertValueToPixel(l);g=a.axisY.convertValueToPixel(e[f].y);h=a.axisX.reversed?h+a.plotType.totalDataSeries*n/2-(a.previousDataSeriesCount+c)*n<<0:h-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+c)*n<<0;var q=a.axisX.reversed?h-n<<0:h+n<<0,s;0<=e[f].y?s=k:(s=g,g=k);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,s,h,g,q,b,0,null,r,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:m, +dataPointIndex:f,x1:s,y1:h,x2:g,y2:q};b=G(b);u&&N(this._eventManager.ghostCtx,s,h,g,q,b,0,null,!1,!1,!1,!1);(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:e[f],dataSeries:p,point:{x:0<=e[f].y?g:s,y:h+(q-h)/2},direction:0>e[f].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(s,g),y1:h,x2:Math.max(s,g),y2:q},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(k,a.axisX.bounds.x2);return{source:d, +dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth? +this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>n&&(l=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){var c=a.axisX.convertValueToPixel(b),v=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,w=v+p<<0,y;if(a.axisY.logarithmic)h[b]=q[l].y+(h[b]?h[b]:0),0q[l].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(y, +k),y1:v,x2:Math.max(y,k),y2:w},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(m,a.axisX.bounds.x2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderStackedBar100=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=[],g=[],h=[],l=0,k,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum: +0),l=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1,n=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&l>n&&(l=Math.min(this.dataPointWidth? +this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&nn&&(p=n);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(n=0;na.axisX.dataInfo.viewPortMax)&&"number"===typeof q[l].y){var c=a.axisX.convertValueToPixel(b),v;v=0!==a.dataPointYSums[b]?100*(q[l].y/a.dataPointYSums[b]):0;var w=c-a.plotType.plotUnits.length*p/2+a.index*p<<0,y=w+p<<0;if(a.axisY.logarithmic){h[b]=v+(h[b]?h[b]:0);if(0>=h[b])continue;v=f[b]?f[b]:m;f[b]=k=a.axisY.convertValueToPixel(h[b])}else if(k= +a.axisY.convertValueToPixel(v),0<=q[l].y){var t=f[b]?f[b]:0;v=m+t;k+=t;f[b]=t+(k-v)}else t=g[b]?g[b]:0,v=k-t,k=m-t,g[b]=t+(k-v);b=q[l].color?q[l].color:r._colorSet[l%r._colorSet.length];N(d,v,w,k,y,b,0,null,s,!1,!1,!1,r.fillOpacity);b=r.dataPointIds[l];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:l,x1:v,y1:w,x2:k,y2:y};b=G(b);u&&N(this._eventManager.ghostCtx,v,w,k,y,b,0,null,!1,!1,!1,!1);(q[l].indexLabel||r.indexLabel||q[l].indexLabelFormatter||r.indexLabelFormatter)&& +this._indexLabels.push({chartType:"stackedBar100",dataPoint:q[l],dataSeries:r,point:{x:0<=q[l].y?k:v,y:c},direction:0>q[l].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(v,k),y1:w,x2:Math.max(v,k),y2:y},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();a=Math.max(m,a.axisX.bounds.x2);return{source:d,dest:this.plotArea.ctx,animationCallback:F.xScaleAnimation,easingFunction:F.easing.easeOutQuart,animationBase:a}}};A.prototype.renderArea=function(a){function d(){t&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates, +g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!J)))if("number"!==typeof p[r].y)n.connectNullData|| +(J||e)||d(),J=!0;else{q=a.axisX.convertValueToPixel(v);s=a.axisY.convertValueToPixel(p[r].y);e||J?(!e&&n.connectNullData?(b.setLineDash&&(n.options.nullDataLineDashType||z===n.lineDashType&&n.lineDashType!==n.nullDataLineDashType)&&(b.stroke(),z=n.nullDataLineDashType,b.setLineDash(A)),b.lineTo(q,s),u&&c.lineTo(q,s)):(b.beginPath(),b.moveTo(q,s),u&&(c.beginPath(),c.moveTo(q,s)),t={x:q,y:s}),J=e=!1):(b.lineTo(q,s),u&&c.lineTo(q,s),0==r%250&&d());rp[r].y===a.axisY.reversed?1:-1,color:D})}d();P.drawMarkers(h);n.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderSplineArea= +function(a){function d(){var d=ua(y,2);if(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=s:0>a.axisY.viewportMaximum?v= +g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width, +k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height),c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!q)))if("number"!==typeof p[e].y)0p[e].y===a.axisY.reversed?1:-1, +color:t});q=!1}d();P.drawMarkers(h);n.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStepArea=function(a){function d(){t&&(0=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?y=w:0>a.axisY.viewportMaximum?y=g.y1:0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=a.axisX.lineCoordinates,g=a.axisY.lineCoordinates,h=[],l=null,k=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(k.x1,k.y1,k.width,k.height);b.clip();u&&(c.beginPath(),c.rect(k.x1,k.y1,k.width,k.height), +c.clip());for(k=0;ka.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!D))){var H=s;"number"!==typeof p[r].y?(n.connectNullData||(D||e)||d(),D=!0):(q=a.axisX.convertValueToPixel(v),s=a.axisY.convertValueToPixel(p[r].y),e||D?(!e&&n.connectNullData?(b.setLineDash&&(n.options.nullDataLineDashType||B===n.lineDashType&&n.lineDashType!== +n.nullDataLineDashType)&&(b.stroke(),B=n.nullDataLineDashType,b.setLineDash(R)),b.lineTo(q,H),b.lineTo(q,s),u&&(c.lineTo(q,H),c.lineTo(q,s))):(b.beginPath(),b.moveTo(q,s),u&&(c.beginPath(),c.moveTo(q,s)),t={x:q,y:s}),D=e=!1):(b.lineTo(q,H),u&&c.lineTo(q,H),b.lineTo(q,s),u&&c.lineTo(q,s),0==r%250&&d()),rp[r].y===a.axisY.reversed?1:-1,color:x}))}d();P.drawMarkers(h);n.markerColor=l}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea=function(a){function d(){if(!(1>k.length)){for(0=a.dataSeriesIndexes.length)){var c=null,f=[],g=null,h=this.plotArea,l=[],k=[],m=[],n=[],p=0,e,r,q,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;u&&v.beginPath();b.save();u&&v.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(v.beginPath(),v.rect(h.x1,h.y1,h.width,h.height), +v.clip());for(var w=[],h=0;ha.axisX.dataInfo.viewPortMax&&(!t.connectNullData||!J)))if("number"!==typeof H.y)t.connectNullData||(J||w)||d(), +J=!0;else{e=a.axisX.convertValueToPixel(q);var ea=l[q]?l[q]:0;if(a.axisY.logarithmic){n[q]=H.y+(n[q]?n[q]:0);if(0>=n[q])continue;r=a.axisY.convertValueToPixel(n[q])}else r=a.axisY.convertValueToPixel(H.y),r-=ea;k.push({x:e,y:s-ea});l[q]=s-r;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||A===t.lineDashType&&t.lineDashType!==t.nullDataLineDashType)&&(b.stroke(),A=t.nullDataLineDashType,b.setLineDash(B)),b.lineTo(e,r),u&&v.lineTo(e,r)):(b.beginPath(),b.moveTo(e,r),u&&(v.beginPath(), +v.moveTo(e,r))),J=w=!1):(b.lineTo(e,r),u&&v.lineTo(e,r),0==p%250&&(d(),b.moveTo(e,r),u&&v.moveTo(e,r),k.push({x:e,y:s-ea})));pD[p].y===a.axisY.reversed?1:-1,color:c})}}d();b.moveTo(e,r);u&&v.moveTo(e,r)}delete t.dataPointIndexes;t.markerColor=g}P.drawMarkers(f);b.restore();u&&v.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderStackedArea100=function(a){function d(){for(0=a.dataSeriesIndexes.length)){var c=null,f=this.plotArea,g=[],h=null,l=[],k=[],m=[],n=[],p=0,e,r,q,s=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v=this._eventManager.ghostCtx;b.save();u&&v.save();b.beginPath();b.rect(f.x1,f.y1,f.width,f.height);b.clip(); +u&&(v.beginPath(),v.rect(f.x1,f.y1,f.width,f.height),v.clip());for(var w=[],f=0;fa.axisX.dataInfo.viewPortMax&& +(!t.connectNullData||!J)))if("number"!==typeof H.y)t.connectNullData||(J||w)||d(),J=!0;else{var ea;ea=0!==a.dataPointYSums[q]?100*(H.y/a.dataPointYSums[q]):0;e=a.axisX.convertValueToPixel(q);var fa=l[q]?l[q]:0;if(a.axisY.logarithmic){n[q]=ea+(n[q]?n[q]:0);if(0>=n[q])continue;r=a.axisY.convertValueToPixel(n[q])}else r=a.axisY.convertValueToPixel(ea),r-=fa;k.push({x:e,y:s-fa});l[q]=s-r;w||J?(!w&&t.connectNullData?(b.setLineDash&&(t.options.nullDataLineDashType||B===t.lineDashType&&t.lineDashType!== +t.nullDataLineDashType)&&(b.stroke(),B=t.nullDataLineDashType,b.setLineDash(E)),b.lineTo(e,r),u&&v.lineTo(e,r)):(b.beginPath(),b.moveTo(e,r),u&&(v.beginPath(),v.moveTo(e,r))),J=w=!1):(b.lineTo(e,r),u&&v.lineTo(e,r),0==p%250&&(d(),b.moveTo(e,r),u&&v.moveTo(e,r),k.push({x:e,y:s-fa})));px[p].y===a.axisY.reversed?1:-1,color:c})}}d();b.moveTo(e,r);u&&v.moveTo(e,r)}delete t.dataPointIndexes;t.markerColor=h}P.drawMarkers(g);b.restore();u&&v.restore();return{source:b,dest:this.plotArea.ctx,animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}}; +A.prototype.renderBubble=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,c=0,f,g;d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var h=-Infinity,l=Infinity,k=0;ka.axisX.dataInfo.viewPortMax||"undefined"===typeof p[c].z||(e=p[c].z,e>h&&(h=e),ea.axisX.dataInfo.viewPortMax)&&"number"===typeof p[c].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(p[c].y);var e=p[c].z,q=2*Math.max(Math.sqrt((h===l?b/2:r+(b-r)/(h-l)*(e-l))/Math.PI)<<0,1),e=n.getMarkerProperties(c,d);e.size=q;d.globalAlpha=n.fillOpacity;P.drawMarker(f,g,d,e.type,e.size,e.color,e.borderColor,e.borderThickness);d.globalAlpha=1;var s=n.dataPointIds[c];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:c,x1:f,y1:g,size:q}; +q=G(s);u&&P.drawMarker(f,g,this._eventManager.ghostCtx,e.type,e.size,q,q,e.borderThickness);(p[c].indexLabel||n.indexLabel||p[c].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:p[c],dataSeries:n,point:{x:f,y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null})}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad, +animationBase:0}}};A.prototype.renderScatter=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,c=0,f,g;d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(b.x1,b.y1,b.width,b.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var h=0;ha.axisX.dataInfo.viewPortMax)&&"number"===typeof m[c].y){f=a.axisX.convertValueToPixel(f);g=a.axisY.convertValueToPixel(m[c].y);var e=k.getMarkerProperties(c,f,g,d);d.globalAlpha=k.fillOpacity;P.drawMarker(e.x,e.y,e.ctx,e.type,e.size,e.color,e.borderColor,e.borderThickness);d.globalAlpha= +1;Math.sqrt((n-f)*(n-f)+(p-g)*(p-g))Math.min(this.plotArea.width,this.plotArea.height)||(n=k.dataPointIds[c],this._eventManager.objectMap[n]={id:n,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:c,x1:f,y1:g},n=G(n),u&&P.drawMarker(e.x,e.y,this._eventManager.ghostCtx,e.type,e.size,n,n,e.borderThickness),(m[c].indexLabel||k.indexLabel||m[c].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:m[c],dataSeries:k,point:{x:f, +y:g},direction:1,bounds:{x1:f-e.size/2,y1:g-e.size/2,x2:f+e.size/2,y2:g+e.size/2},color:null}),n=f,p=g)}}}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderCandlestick=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var c=null,c=this.plotArea,f=0,g,h,l,k,m,n,f=this.dataPointMinWidth? +this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.015*this.width;var p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth?this.dataPointWidth:0.7*c.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&& +(this.dataPointMinWidth&&gg&&(p=g);d.save();u&&b.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(b.beginPath(),b.rect(c.x1,c.y1,c.width,c.height),b.clip());for(var e=0;ea.axisX.dataInfo.viewPortMax)&&null!==s[f].y&&s[f].y.length&&"number"===typeof s[f].y[0]&&"number"===typeof s[f].y[1]&&"number"===typeof s[f].y[2]&&"number"===typeof s[f].y[3]){g=a.axisX.convertValueToPixel(n);h=a.axisY.convertValueToPixel(s[f].y[0]);l=a.axisY.convertValueToPixel(s[f].y[1]);k=a.axisY.convertValueToPixel(s[f].y[2]);m=a.axisY.convertValueToPixel(s[f].y[3]);var w=g-p/2<<0,y=w+p<<0,c=s[f].color?s[f].color:q._colorSet[0],t=Math.round(Math.max(1,0.15*p)),x=0===t%2?0:0.5,z=q.dataPointIds[f]; +this._eventManager.objectMap[z]={id:z,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:f,x1:w,y1:h,x2:y,y2:l,x3:g,y3:k,x4:g,y4:m,borderThickness:t,color:c};d.strokeStyle=c;d.beginPath();d.lineWidth=t;b.lineWidth=Math.max(t,4);"candlestick"===q.type?(d.moveTo(g-x,l),d.lineTo(g-x,Math.min(h,m)),d.stroke(),d.moveTo(g-x,Math.max(h,m)),d.lineTo(g-x,k),d.stroke(),N(d,w,Math.min(h,m),y,Math.max(h,m),s[f].y[0]<=s[f].y[3]?q.risingColor:c,t,c,v,v,!1,!1,q.fillOpacity),u&&(c=G(z),b.strokeStyle=c,b.moveTo(g- +x,l),b.lineTo(g-x,Math.min(h,m)),b.stroke(),b.moveTo(g-x,Math.max(h,m)),b.lineTo(g-x,k),b.stroke(),N(b,w,Math.min(h,m),y,Math.max(h,m),c,0,null,!1,!1,!1,!1))):"ohlc"===q.type&&(d.moveTo(g-x,l),d.lineTo(g-x,k),d.stroke(),d.beginPath(),d.moveTo(g,h),d.lineTo(w,h),d.stroke(),d.beginPath(),d.moveTo(g,m),d.lineTo(y,m),d.stroke(),u&&(c=G(z),b.strokeStyle=c,b.moveTo(g-x,l),b.lineTo(g-x,k),b.stroke(),b.beginPath(),b.moveTo(g,h),b.lineTo(w,h),b.stroke(),b.beginPath(),b.moveTo(g,m),b.lineTo(y,m),b.stroke())); +(s[f].indexLabel||q.indexLabel||s[f].indexLabelFormatter||q.indexLabelFormatter)&&this._indexLabels.push({chartType:q.type,dataPoint:s[f],dataSeries:q,point:{x:w+(y-w)/2,y:a.axisY.reversed?k:l},direction:1,bounds:{x1:w,y1:Math.min(l,k),x2:y,y2:Math.max(l,k)},color:c})}}d.restore();u&&b.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx; +if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth:0.03*this.width;var l=a.axisX.dataInfo.minDiff;isFinite(l)||(l=0.3*Math.abs(a.axisX.range));l=this.dataPointWidth?this.dataPointWidth:0.9*(c.width*(a.axisX.logarithmic?Math.log(l)/Math.log(a.axisX.range):Math.abs(l)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<< +0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(l=g);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var k=0;ka.axisX.dataInfo.viewPortMax)&&null!==p[f].y&&p[f].y.length&&"number"===typeof p[f].y[0]&&"number"===typeof p[f].y[1]){b=a.axisX.convertValueToPixel(h);c=a.axisY.convertValueToPixel(p[f].y[0]);g=a.axisY.convertValueToPixel(p[f].y[1]);var r=a.axisX.reversed?b+a.plotType.totalDataSeries*l/2-(a.previousDataSeriesCount+ +k)*l<<0:b-a.plotType.totalDataSeries*l/2+(a.previousDataSeriesCount+k)*l<<0,q=a.axisX.reversed?r-l<<0:r+l<<0,b=p[f].color?p[f].color:n._colorSet[f%n._colorSet.length];if(c>g){var s=c,c=g;g=s}s=n.dataPointIds[f];this._eventManager.objectMap[s]={id:s,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:f,x1:r,y1:c,x2:q,y2:g};N(d,r,c,q,g,b,0,b,e,e,!1,!1,n.fillOpacity);b=G(s);u&&N(this._eventManager.ghostCtx,r,c,q,g,b,0,null,!1,!1,!1,!1);if(p[f].indexLabel||n.indexLabel||p[f].indexLabelFormatter|| +n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:p[f],dataSeries:n,indexKeyword:0,point:{x:r+(q-r)/2,y:p[f].y[1]>=p[f].y[0]?g:c},direction:p[f].y[1]>=p[f].y[0]?-1:1,bounds:{x1:r,y1:Math.min(c,g),x2:q,y2:Math.max(c,g)},color:b}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:p[f],dataSeries:n,indexKeyword:1,point:{x:r+(q-r)/2,y:p[f].y[1]>=p[f].y[0]?c:g},direction:p[f].y[1]>=p[f].y[0]?1:-1,bounds:{x1:r,y1:Math.min(c,g),x2:q,y2:Math.max(c,g)},color:b})}}d.restore(); +u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad,animationBase:0}}};A.prototype.renderRangeBar=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx;if(!(0>=a.dataSeriesIndexes.length)){var b=null,c=this.plotArea,f=0,g,h,l,f=this.dataPointMinWidth?this.dataPointMinWidth:this.dataPointWidth?this.dataPointWidth:1;g=this.dataPointMaxWidth?this.dataPointMaxWidth:this.dataPointWidth?this.dataPointWidth: +Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var k=a.axisX.dataInfo.minDiff;isFinite(k)||(k=0.3*Math.abs(a.axisX.range));k=this.dataPointWidth?this.dataPointWidth:0.9*(c.height*(a.axisX.logarithmic?Math.log(k)/Math.log(a.axisX.range):Math.abs(k)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&f>g&&(f=Math.min(this.dataPointWidth?this.dataPointWidth:Infinity,g));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&gg&&(k=g);d.save();u&&this._eventManager.ghostCtx.save();d.beginPath();d.rect(c.x1,c.y1,c.width,c.height);d.clip();u&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(c.x1,c.y1,c.width,c.height),this._eventManager.ghostCtx.clip());for(var m=0;ma.axisX.dataInfo.viewPortMax)&&null!==e[f].y&&e[f].y.length&&"number"===typeof e[f].y[0]&&"number"===typeof e[f].y[1]){c=a.axisY.convertValueToPixel(e[f].y[0]);g=a.axisY.convertValueToPixel(e[f].y[1]);h=a.axisX.convertValueToPixel(l);h=a.axisX.reversed?h+a.plotType.totalDataSeries*k/2-(a.previousDataSeriesCount+m)*k<<0:h-a.plotType.totalDataSeries*k/2+(a.previousDataSeriesCount+m)*k<<0;var q=a.axisX.reversed?h-k<<0:h+k<<0;c>g&&(b=c,c= +g,g=b);b=e[f].color?e[f].color:p._colorSet[f%p._colorSet.length];N(d,c,h,g,q,b,0,null,r,!1,!1,!1,p.fillOpacity);b=p.dataPointIds[f];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:c,y1:h,x2:g,y2:q};b=G(b);u&&N(this._eventManager.ghostCtx,c,h,g,q,b,0,null,!1,!1,!1,!1);if(e[f].indexLabel||p.indexLabel||e[f].indexLabelFormatter||p.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:0,point:{x:e[f].y[1]>= +e[f].y[0]?c:g,y:h+(q-h)/2},direction:e[f].y[1]>=e[f].y[0]?-1:1,bounds:{x1:Math.min(c,g),y1:h,x2:Math.max(c,g),y2:q},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:e[f],dataSeries:p,indexKeyword:1,point:{x:e[f].y[1]>=e[f].y[0]?g:c,y:h+(q-h)/2},direction:e[f].y[1]>=e[f].y[0]?1:-1,bounds:{x1:Math.min(c,g),y1:h,x2:Math.max(c,g),y2:q},color:b})}}}d.restore();u&&this._eventManager.ghostCtx.restore();return{source:d,dest:this.plotArea.ctx,animationCallback:F.fadeInAnimation,easingFunction:F.easing.easeInQuad, +animationBase:0}}};A.prototype.renderRangeArea=function(a){function d(){if(w){var a=null;0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(h=0;ha.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!E)))if(null!==n[e].y&&n[e].y.length&&"number"===typeof n[e].y[0]&&"number"=== +typeof n[e].y[1]){r=a.axisX.convertValueToPixel(v);q=a.axisY.convertValueToPixel(n[e].y[0]);s=a.axisY.convertValueToPixel(n[e].y[1]);p||E?(m.connectNullData&&!p?(b.setLineDash&&(m.options.nullDataLineDashType||z===m.lineDashType&&m.lineDashType!==m.nullDataLineDashType)&&(l[l.length-1].newLineDashArray=B,z=m.nullDataLineDashType,b.setLineDash(A)),b.lineTo(r,q),u&&c.lineTo(r,q),l.push({x:r,y:s})):(b.beginPath(),b.moveTo(r,q),w={x:r,y:q},l=[],l.push({x:r,y:s}),u&&(c.beginPath(),c.moveTo(r,q))),E=p= +!1):(b.lineTo(r,q),l.push({x:r,y:s}),u&&c.lineTo(r,q),0==e%250&&d());v=m.dataPointIds[e];this._eventManager.objectMap[v]={id:v,objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:e,x1:r,y1:q,y2:s};en[e].y[1]===a.axisY.reversed?-1:1,color:y}),this._indexLabels.push({chartType:"rangeArea",dataPoint:n[e],dataSeries:m,indexKeyword:1,point:{x:r,y:s},direction:n[e].y[0]>n[e].y[1]===a.axisY.reversed?1:-1,color:y})}else E||p||d(),E=!0;d();P.drawMarkers(f);m.markerColor=g}}b.restore();u&&this._eventManager.ghostCtx.restore();return{source:b,dest:this.plotArea.ctx, +animationCallback:F.xClipAnimation,easingFunction:F.easing.linear,animationBase:0}}};A.prototype.renderRangeSplineArea=function(a){function d(a,d){var e=ua(q,2);if(0=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,f=[],g=null,h=this.plotArea;b.save();u&&c.save();b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();u&&(c.beginPath(),c.rect(h.x1,h.y1,h.width,h.height),c.clip());for(h=0;ha.axisX.dataInfo.viewPortMax&&(!k.connectNullData|| +!e)))if(null!==m[n].y&&m[n].y.length&&"number"===typeof m[n].y[0]&&"number"===typeof m[n].y[1]){p=a.axisX.convertValueToPixel(p);e=a.axisY.convertValueToPixel(m[n].y[0]);r=a.axisY.convertValueToPixel(m[n].y[1]);var A=k.dataPointIds[n];this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:n,x1:p,y1:e,y2:r};q[q.length]={x:p,y:e};s[s.length]={x:p,y:r};nb)){"undefined"===typeof l&&(l=1);if(!u){var m=Number((h%(2*Math.PI)).toFixed(8));Number((g% +(2*Math.PI)).toFixed(8))===m&&(h-=1E-4)}a.save();a.globalAlpha=l;"pie"===f?(a.beginPath(),a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,g,h,!1),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===f&&(a.beginPath(),a.arc(d.x,d.y,b,g,h,!1),0<=k&&a.arc(d.x,d.y,k*b,h,g,!0),a.closePath(),a.fillStyle=c,a.strokeStyle="white",a.lineWidth=2,a.fill());a.globalAlpha=1;a.restore()}};A.prototype.renderPie=function(a){function d(){if(m&&n){for(var a=0,b=0,c=0,d=0,f=0;fMath.PI/2-w&&l.midAnglel.midAngle)c=f;a++}else if(l.midAngle>3*Math.PI/2-w&&l.midAngle<3*Math.PI/2+w){if(0===b||r[d].midAngle>l.midAngle)d=f;b++}l.hemisphere=g>Math.PI/2&&g<=3*Math.PI/2?"left":"right";l.indexLabelTextBlock=new W(k.plotArea.ctx,{fontSize:l.indexLabelFontSize,fontFamily:l.indexLabelFontFamily,fontColor:l.indexLabelFontColor,fontStyle:l.indexLabelFontStyle, +fontWeight:l.indexLabelFontWeight,horizontalAlign:"left",backgroundColor:l.indexLabelBackgroundColor,maxWidth:l.indexLabelMaxWidth,maxHeight:l.indexLabelWrap?5*l.indexLabelFontSize:1.5*l.indexLabelFontSize,text:l.indexLabelText,padding:0,textBaseline:"top"});l.indexLabelTextBlock.measureText()}h=g=0;p=!1;for(f=0;fMath.PI/2-w&&l.midAngle3*Math.PI/2-w&&l.midAngle<3*Math.PI/2+w)&&(h<=b/2&&!p?(l.hemisphere="left",h++):(l.hemisphere="right",p=!0))}}function b(a){var b=k.plotArea.ctx;b.clearRect(e.x1,e.y1,e.width,e.height);b.fillStyle=k.backgroundColor;b.fillRect(e.x1,e.y1,e.width,e.height);for(b=0;bc){var f=0.07*B*Math.cos(r[b].midAngle),g=0.07*B*Math.sin(r[b].midAngle),l=!1;if(n[b].exploded){if(1E-9a.indexLabelTextBlock.y?e-d:c-f}function f(a){for(var b=null,d=1;dc(r[b],r[a])||("right"===r[a].hemisphere?r[b].indexLabelTextBlock.y>=r[a].indexLabelTextBlock.y: +r[b].indexLabelTextBlock.y<=r[a].indexLabelTextBlock.y)))break;else b=null;return b}function g(a,b,d){d=(d||0)+1;if(1E3b&&h.indexLabelTextBlock.yl)return 0;var p=0,m=0,m=p=p=0;0>b?h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2>k&&h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2+bl&&(b=h.indexLabelTextBlock.y+h.indexLabelTextBlock.height/2+b-l);b=h.indexLabelTextBlock.y+b;k=0;k="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2)):t.x-Math.sqrt(Math.pow(s,2)-Math.pow(b-t.y,2));m=t.x+B*Math.cos(h.midAngle);p=t.y+B*Math.sin(h.midAngle);p=Math.sqrt(Math.pow(k-m,2)+Math.pow(b-p,2));m=Math.acos(B/s);p=Math.acos((s*s+B*B-p*p)/(2*B*s));b=pc(r[k],r[a])||("right"===r[a].hemisphere?r[k].indexLabelTextBlock.y<=r[a].indexLabelTextBlock.y:r[k].indexLabelTextBlock.y>=r[a].indexLabelTextBlock.y)))break;else k=null;m=k;p=f(a);l=k=0;0>b?(l="right"===h.hemisphere?m:p,e=b,null!==l&&(m=-b,b=h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-(r[l].indexLabelTextBlock.y+ +r[l].indexLabelTextBlock.height/2),b-m+k.toFixed(y)&&(e=b>q?-(b-q):-(m-(l-k)))))):0q?b-q:m-(k-l)))));e&&(d=h.indexLabelTextBlock.y+e,b=0,b="right"===h.hemisphere?t.x+Math.sqrt(Math.pow(s,2)-Math.pow(d-t.y,2)):t.x-Math.sqrt(Math.pow(s, +2)-Math.pow(d-t.y,2)),h.midAngle>Math.PI/2-w&&h.midAnglek.indexLabelTextBlock.x?b=k.indexLabelTextBlock.x-15:"right"===h.hemisphere&&("left"===a.hemisphere&&b3*Math.PI/2-w&&h.midAngle<3*Math.PI/2+w&&(k=(a-1+r.length)%r.length,k=r[k],a=r[(a+1+r.length)%r.length],"right"===h.hemisphere&&"left"===k.hemisphere&& +ba.indexLabelTextBlock.x)&&(b=a.indexLabelTextBlock.x-15)),h.indexLabelTextBlock.y=d,h.indexLabelTextBlock.x=b,h.indexLabelAngle=Math.atan2(h.indexLabelTextBlock.y-t.y,h.indexLabelTextBlock.x-t.x))}return e}function h(){var a=k.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var b=a=0,d=0,l=!0,b=0;10>b&&(1>b||0z){for(var A=u=0,D=0;Du?h.indexLabelText="":h.indexLabelTextBlock.maxWidth=0.85*u,0.3*h.indexLabelTextBlock.maxWidth< +u&&(h.indexLabelTextBlock.x-="right"===h.hemisphere?2:-2)),Math.abs(h.indexLabelTextBlock.y-h.indexLabelTextBlock.height/2-t.y)d&&(d=x)),x=x=0,0d&&(d=x)));var G=function(a,b,c){for(var d=[],e=0;d.push(r[b]),b!==c;b=(b+1+n.length)%n.length);d.sort(function(a,b){return a.y-b.y});for(b=0;bz){l=w.indexLabelTextBlock.x;var m=w.indexLabelTextBlock.y-w.indexLabelTextBlock.height/2,q=w.indexLabelTextBlock.y+w.indexLabelTextBlock.height/2,s=k.indexLabelTextBlock.y-k.indexLabelTextBlock.height/2,t=k.indexLabelTextBlock.x+k.indexLabelTextBlock.width,v=k.indexLabelTextBlock.y+k.indexLabelTextBlock.height/2;l=w.indexLabelTextBlock.x+w.indexLabelTextBlock.widtht+p||m>v+p||qa&&(a=g),h!==a&&(b=h,d+=-z),0===g%Math.max(n.length/10,3)&&(e=!0)):e=!0;e&&(0=a.dataSeriesIndexes.length)){var m=this.data[a.dataSeriesIndexes[0]],n=m.dataPoints,p=10,e=this.plotArea,r=[],q=2,s,v=1.3,w=20/180*Math.PI,y=6,t={x:(e.x2+e.x1)/2,y:(e.y2+e.y1)/2},u=0;a=!1;for(var A=0;Aa&&(d=a,f=!0);var g=n[b].color?n[b].color:m._colorSet[b%m._colorSet.length];d>c&&Ga(k.plotArea.ctx,r[b].center,r[b].radius,g,m.type,c,d,m.fillOpacity,r[b].percentInnerRadius);if(f)break}l()},function(){k.disableToolTip=!1;k._animator.animate(0,k.animatedRender?500:0,function(a){b(a);l()})})}}};A.prototype.animationRequestId=null;A.prototype.requestAnimFrame=function(){return window.requestAnimationFrame|| +window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();A.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;A.prototype.set=function(a,d,b){b="undefined"===typeof b?!0:b;"options"===a?(this.options=d, +b&&this.render()):A.base.set.call(this,a,d,b)};A.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var d=a.format?a.format:"png",b=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+d);Ba(this.canvas,d,b)};A.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),d=document.createElement("iframe");d.setAttribute("class","canvasjs-chart-print-frame");d.setAttribute("style","position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;"); +d.style.height=this.height+"px";this._canvasJSContainer.appendChild(d);var b=this,c=d.contentWindow||d.contentDocument.document||d.contentDocument;c.document.open();c.document.write('\n');c.document.close();setTimeout(function(){c.focus();c.print();setTimeout(function(){b._canvasJSContainer.removeChild(d)},1E3)},500)};ja.prototype.registerSpace=function(a,d){"top"===a?this._topOccupied+= +d.height:"bottom"===a?this._bottomOccupied+=d.height:"left"===a?this._leftOccupied+=d.width:"right"===a&&(this._rightOccupied+=d.width)};ja.prototype.unRegisterSpace=function(a,d){"top"===a?this._topOccupied-=d.height:"bottom"===a?this._bottomOccupied-=d.height:"left"===a?this._leftOccupied-=d.width:"right"===a&&(this._rightOccupied-=d.width)};ja.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}};ja.prototype.reset=function(){this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=this._padding};U(W,M);W.prototype.render=function(a){a&&this.ctx.save();var d=this.ctx.font;this.ctx.textBaseline=this.textBaseline;var b=0;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y+b);"middle"===this.textBaseline&&(b=-this._lineHeight/ +2);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var c=0,f=this.padding,g=null;(0d)f=g-1;else break}b>d&&1g&&(h=d.pop(),c-=h.height,f=l)}this._wrappedText={lines:d,width:f,height:c};this.width=f+2*this.padding; +this.height=c+2*this.padding;this.ctx.font=b};W.prototype._getFontString=function(){var a;a=""+(this.fontStyle?this.fontStyle+" ":"");a+=this.fontWeight?this.fontWeight+" ":"";a+=this.fontSize?this.fontSize+"px ":"";var d=this.fontFamily?this.fontFamily+"":"";!u&&d&&(d=d.split(",")[0],"'"!==d[0]&&'"'!==d[0]&&(d="'"+d+"'"));return a+=d};U(ma,M);ma.prototype.render=function(){if(this.text){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),b=d.x1,c=d.y1,f= +0,g=0,h=this.chart._menuButton&&this.chart.exportEnabled&&"top"===this.verticalAlign?22:0,l,k;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(null===this.maxWidth&&(this.maxWidth=d.width-4-h*("center"===this.horizontalAlign?2:1)),g=0.5*d.height-this.margin-2,f=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(null===this.maxWidth&&(this.maxWidth=d.height-4),g=0.5*d.width-this.margin-2):"center"===this.horizontalAlign&&(null===this.maxWidth&& +(this.maxWidth=d.width-4),g=0.5*d.height-4));this.wrap||(g=Math.min(g,Math.max(1.5*this.fontSize,this.fontSize+2.5*this.padding)));var g=new W(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,fontStyle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThickness,backgroundColor:this.backgroundColor,maxWidth:this.maxWidth,maxHeight:g,cornerRadius:this.cornerRadius, +text:this.text,padding:this.padding,textBaseline:"top"}),m=g.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(c=d.y1+2,k="top"):"bottom"===this.verticalAlign&&(c=d.y2-2-m.height,k="bottom"),"left"===this.horizontalAlign?b=d.x1+2:"center"===this.horizontalAlign?b=d.x1+d.width/2-m.width/2:"right"===this.horizontalAlign&&(b=d.x2-2-m.width-h),l=this.horizontalAlign,this.width=m.width,this.height=m.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign? +(b=d.x1+2,c=d.y2-2-(this.maxWidth/2-m.width/2),f=-90,k="left",this.width=m.height,this.height=m.width):"right"===this.horizontalAlign?(b=d.x2-2,c=d.y1+2+(this.maxWidth/2-m.width/2),f=90,k="right",this.width=m.height,this.height=m.width):"center"===this.horizontalAlign&&(c=a.y1+(a.height/2-m.height/2),b=a.x1+(a.width/2-m.width/2),k="center",this.width=m.width,this.height=m.height),l="center");g.x=b;g.y=c;g.angle=f;g.horizontalAlign=l;g.render(!0);a.layoutManager.registerSpace(k,{width:this.width+("left"=== +k||"right"===k?this.margin+2:0),height:this.height+("top"===k||"bottom"===k?this.margin+2:0)});this.bounds={x1:b,y1:c,x2:b+this.width,y2:c+this.height};this.ctx.textBaseline="top"}};U(va,M);va.prototype.render=ma.prototype.render;U(wa,M);wa.prototype.render=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,d=a.layoutManager.getFreeSpace(),b=null,c=0,f=0,g=0,h=0,l=this.markerMargin=this.chart.options.legend&&!x(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin: +0.3*this.fontSize;this.height=0;var k=[],m=[];"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",b=this.verticalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:d.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*d.height):"center"===this.verticalAlign&&(this.orientation="vertical",b=this.horizontalAlign,g=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*d.width,h=this.maxHeight=null!==this.maxHeight?this.maxHeight:d.height);for(var n= +0;n=h||"undefined"===typeof h||0>=r||"undefined"===typeof r)){if("horizontal"===this.orientation){e.textBlock=new W(this.ctx,{x:0,y:0,maxWidth:r,maxHeight:this.itemWrap?h: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(!p||p.width+Math.round(e.textBlock.width+s+l+(0===p.width?0:this.horizontalSpacing)+("line"===e.chartType||"spline"===e.chartType||"stepLine"===e.chartType?2*0.1*this.lineHeight:0))>g)p= +{items:[],width:0},m.push(p),this.height+=u,u=0;u=Math.max(u,e.textBlock.height)}else e.textBlock=new W(this.ctx,{x:0,y:0,maxWidth:r,maxHeight:!0===this.itemWrap?h:1.5*this.fontSize,angle:0,text:e.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),e.textBlock.measureText(),null!==this.itemWidth&&(e.textBlock.width=this.itemWidth-(s+l+("line"===e.chartType||"spline"===e.chartType|| +"stepLine"===e.chartType?2*0.1*this.lineHeight:0))),this.height>0,0),this.dataPoints.length):0):(n=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0>0,0),this.dataPoints.length):0));for(;;){g=0a?c.x/a:a/c.x:Math.abs(c.x- +a);pn-f&&n+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-1}return d||b.dataPoint.x!==a?d&&null!==b.dataPoint?b:null:b};$.prototype.getDataPointAtXY=function(a,d,b){if(!this.dataPoints||0===this.dataPoints.length||athis.chart.plotArea.x2||dthis.chart.plotArea.y2)return null;b=b||!1;var c=[],f=0,g=0,h=1,l=!1,k=Infinity,m=0,n=0,p=0;"none"!== +this.chart.plotInfo.axisPlacement&&(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:d}),this.axisX.logarithmic?(g=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1>0,0),this.dataPoints.length):0):(g=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0>0,0),this.dataPoints.length): +0));for(;;){g=0=e.x1&&(a<=e.x2&&d>=e.y1&&d<=e.y2)&&(c.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y1-d),Math.abs(e.y2-d))}), +l=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var s=L("markerSize",r,this)||4,v=b?20:s,q=Math.sqrt(Math.pow(e.x1-a,2)+Math.pow(e.y1-d,2));q<=v&&c.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:q});g=Math.abs(e.x1-a);g<=k?k=g:0v&&(q=Math.atan2(d-s.y,a-s.x),0>q&&(q+=2*Math.PI),q=Number(((180*(q/Math.PI)%360+360)%360).toFixed(12)),s=Number(((180*(e.startAngle/Math.PI)%360+360)%360).toFixed(12)),v=Number(((180*(e.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===v&&1=v&&0!==r.y&&(v+=360,qs&&q=e.x1-e.borderThickness/2&&a<=e.x2+e.borderThickness/2&&d>=e.y2-e.borderThickness/2&&d<= +e.y3+e.borderThickness/2||Math.abs(e.x2-a+e.x1-a)=e.y1&&d<=e.y4)c.push({dataPoint:r,dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-d),Math.abs(e.y3-d))}),l=!0;break;case "ohlc":if(Math.abs(e.x2-a+e.x1-a)=e.y2&&d<=e.y3||a>=e.x1&&a<=(e.x2+e.x1)/2&&d>=e.y1-e.borderThickness/2&&d<=e.y1+e.borderThickness/2||a>=(e.x1+e.x2)/2&&a<=e.x2&&d>=e.y4-e.borderThickness/2&&d<=e.y4+e.borderThickness/2)c.push({dataPoint:r, +dataPointIndex:g,dataSeries:this,distance:Math.min(Math.abs(e.x1-a),Math.abs(e.x2-a),Math.abs(e.y2-d),Math.abs(e.y3-d))}),l=!0}if(l||1E3p-f&&p+f>=this.dataPoints.length)break;-1===h?(f++,h=1):h=-1}a=null;for(d=0;d>0:this.options.labelMaxWidth,this.chart.panEnabled||(h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize); +else if("left"===this._position||"right"===this._position)k=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))*E[this.intervalType+ +"Duration"]*this.interval,this.chart.panEnabled||(g="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),h="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize;for(c=0;cthis.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(g=0.9*k>>0,p=0,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;bp&&(q=b,p=e.width)}b=0;for(b=this.intervalStartPosition>0>2*g&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g? +-25:this.sessionVariables.labelAngle):x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelMaxWidth=g,r.width+d.width>>0>2*g&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=s)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>g?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight= +h,this.sessionVariables.labelWrap=this.labelWrap);else{if(x(this.options.labelWrap))if(!x(this.options.labelMaxWidth))this.options.labelMaxWidth>0,e=this.labelFontSize,pl&&(l=c-2*g,c>=2*g&&c<2.2*g?(this.sessionVariables.labelMaxWidth= +g,x(this.options.labelFontSize)&&12=2.2*g&&c<2.8*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelFontSize=e):c>=2.8*g&&c<3.2*g?(this.sessionVariables.labelMaxWidth=Math.max(g,p),this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*g&&c<3.6*g?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelFontSize=this.labelFontSize):c>3.6*g&&c<5*g?(x(this.options.labelFontSize)&&125*g&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=g,this.sessionVariables.labelFontSize=e,this.sessionVariables.labelMaxHeight=h,this.sessionVariables.labelAngle=this.labelAngle));else if(q===b&&(0===q&&p+this._labels[q+1].textBlock.measureText().width-2*g>l||q===this._labels.length-1&&p+this._labels[q- +1].textBlock.measureText().width-2*g>l||0l&&p+this._labels[q-1].textBlock.measureText().width-2*g>l))l=0===q?p+this._labels[q+1].textBlock.measureText().width-2*g:p+this._labels[q-1].textBlock.measureText().width-2*g,this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth= +s;else if(0===l)for(this.sessionVariables.labelFontSize=x(this.options.labelFontSize)?e:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,c=0;c>0>2*g&&(this.sessionVariables.labelAngle= +-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:Math.min((c-g*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),c),s=0!=this.labelAngle?(n-(m+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):g,this.sessionVariables.labelMaxHeight=h=this.labelWrap?(n-s*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180* +Math.abs(this.labelAngle)):1.5*this.labelFontSize,x(this.options.labelWrap))?x(this.options.labelWrap)&&(this.labelWrap&&!x(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s,this.sessionVariables.labelMaxHeight=h):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=s,this.sessionVariables.labelMaxHeight=c<0.9*k?0.9*k:c,this.sessionVariables.labelWrap= +this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s):(x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:s,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=h);for(c=0;c>0:this.options.labelMaxWidth,h="undefined"===typeof this.options.labelWrap||this.labelWrap? +0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=g;this.sessionVariables.labelMaxHeight=h;this.sessionVariables.labelAngle=x(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(b=0;b> +0,k-2*h>p&&(p=k-2*h,k>=2*h&&k<2.4*h?(x(this.options.labelFontSize)&&12=2.4*h&&k<2.8*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):k>=2.8*h&&k<3.2*h?(this.sessionVariables.labelMaxHeight= +h,this.sessionVariables.labelWrap=!0,x(this.options.labelFontSize)&&12=3.2*h&&k<3.6*h?(this.sessionVariables.labelMaxHeight=c,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize= +this.labelFontSize):k>3.6*h&&k<10*h?(x(this.options.labelFontSize)&&1210*h&&k<50*h&&(x(this.options.labelFontSize)&& +12this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=c):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:g,this.sessionVariables.labelMaxHeight= +0===this.labelAngle?h:c,x(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?h:c,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=g):(this.sessionVariables.labelMaxHeight=h,x(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap= +this.labelWrap);for(c=0;c>0:1.5*this.labelFontSize;if("left"===this._position||"right"===this._position)v="undefined"===typeof g.options.labelWrap?this.sessionVariables.labelMaxHeight:g.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;d=x(g.options.labelBackgroundColor)?"#EEEEEE": +g.options.labelBackgroundColor}else h="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,v="undefined"===typeof 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,d=x(g.options.labelBackgroundColor)?x(g.startValue)&&0!==g.startValue?u?"transparent":null:"#EEEEEE":g.options.labelBackgroundColor;a=new W(this.ctx,{x:0,y:0,backgroundColor:d,borderColor:g.labelBorderColor, +borderThickness:g.labelBorderThickness,cornerRadius:g.labelCornerRadius,maxWidth:g.options.labelMaxWidth?g.options.labelMaxWidth:h,maxHeight:v,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.options.labelFontSize:this.labelFontSize:g.labelFontSize,fontFamily:"outside"===g.labelPlacement?g.options.labelFontFamily?g.options.labelFontFamily:this.labelFontFamily: +g.labelFontFamily,fontWeight:"outside"===g.labelPlacement?g.options.fontWeight?g.options.fontWeight:this.fontWeight:g.fontWeight,fontColor:g.options.labelFontColor||g.color,fontStyle:"outside"===g.labelPlacement?g.options.fontStyle?g.options.fontStyle:this.fontWeight:g.fontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:g.value,textBlock:a,effectiveHeight:null,stripLine:g})}};B.prototype.createLabelsAndCalculateWidth=function(){var a=0,d=0;this._labels=[];this._stripLineLabels= +[];if("left"===this._position||"right"===this._position){this.createLabels();for(d=0;d +this.viewportMinimum&&this._stripLineLabels[d].stripLine.valuer;){var N=0,Q=0,P=0,O=0,L=f=0,C=0,S=0,X=0,V=0,U=0,T=0;if(b&&0n.width-10?n.width-10:g.x2-T-S);if(a&&0n.width-10?n.width-10:g.x2-T-S),a[e]._labels&&1k&&(l+=0a[e].labelAngle?z-qk&&(l=A+s/2-k-T),z-qa[e].labelAngle&&0n.width-10?n.width-10:g.x2-T-S),d[e].lineCoordinates.width=Math.abs(k-h),d[e]._labels&&1r;){V=X=U=O=S=C=L=f=P=K=Q=N=0;if(a&&0n.width-10?n.width-10:g.x2-V-L),b[e].labelAutoFit&&!x(v)&&(0b[e].labelAngle?Math.max(h,v):0===b[e].labelAngle?Math.max(h,v/2):h),0c[e].chart.width-10?c[e].chart.width-10:g.x2-V-L),c[e]&&c[e].labelAutoFit&&!x(u)&&(0b[e].chart.height-10?b[e].chart.height-10:g.y2),b[e].lineCoordinates.y1=l-(z[e]+b[e].margin+N),b[e].lineCoordinates.y2=l-(z[e]+b[e].margin+N),b[e].bounds={x1:h,y1:l-(z[e]+N+b[e].margin), +x2:k,y2:m-(N+b[e].margin),width:k-h,height:z[e]},b[e].title&&(b[e]._titleTextBlock.maxWidth=0n.height- +Math.max(C,10)?n.height-Math.max(C,10):g.y2-O):g.y2>n.height-Math.max(C,10)?n.height-Math.max(C,10):g.y2;if(b&&0b[C].labelAngle?Math.max(k,v):0===b[C].labelAngle?Math.max(k,v/2):k,h=0>b[C].labelAngle||0===b[C].labelAngle?k-X:h);if(c&&0n.height-Math.max(C,10)?n.height-Math.max(C,10):g.y2-O):g.y2>n.height-Math.max(C,10)?n.height-Math.max(C,10):g.y2;if(b&&0b[C].labelAngle?Math.max(k,v):0===b[e].labelAngle?Math.max(k,v/2):k,h=0>b[C].labelAngle||0===b[C].labelAngle?k-V:h);if(c&&0this.viewportMaximum||!(k===this._labels.length-1||gthis.lineCoordinates.width*c&&this.labelAutoFit&&(a=!0)}if("left"===this._position||"right"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var d=[],m,h=this.viewportMaximum,l=this.lineCoordinates.height/Math.log(this.range),k=this._labels.length-1;0<=k;k--){n=this._labels[k]; +if(n.positionthis.viewportMaximum||!(k===this._labels.length-1||mthis.lineCoordinates.height*c&&this.labelAutoFit&&(a=!0)}}if("bottom"===this._position){for(var n,k=0;kthis.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c, +b.y<<0),this.ctx.lineTo(c,b.y+this.tickLength<<0),this.ctx.stroke()),0===n.textBlock.angle?(b.x-=n.textBlock.width/2,b.y+=this.tickLength+n.textBlock.fontSize/2):(b.x-=0>this.labelAngle?n.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,b.y+=this.tickLength+Math.abs(0>this.labelAngle?n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)-5:5)),n.textBlock.x=b.x,n.textBlock.y=b.y,n.textBlock.render(!0)));this.title&&(this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+ +this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.y=this.bounds.y2-this._titleTextBlock.height-3,this.titleMaxWidth=this._titleTextBlock.maxWidth,this._titleTextBlock.render(!0))}else if("top"===this._position){for(k=0;kthis.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle= +this.tickColor,c=1===this.ctx.lineWidth%2?(b.x<<0)+0.5:b.x<<0,this.ctx.beginPath(),this.ctx.moveTo(c,b.y<<0),this.ctx.lineTo(c,b.y-this.tickLength<<0),this.ctx.stroke()),0===n.textBlock.angle?(b.x-=n.textBlock.width/2,b.y-=this.tickLength+n.textBlock.height/2):(b.x+=(n.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth%2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,c),this.ctx.lineTo(b.x-this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(n.textBlock.y=b.y,n.textBlock.x=b.x-n.textBlock.width*Math.cos(Math.PI/ +180*this.labelAngle)-this.tickLength-5):(n.textBlock.y=b.y-n.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),n.textBlock.x=0this.viewportMaximum||(b=this.getPixelCoordinatesOnAxis(n.position),a&&0!==f++%2&&this.labelAutoFit||(this.tickThickness&&(this.ctx.lineWidth=this.tickThickness,this.ctx.strokeStyle=this.tickColor,c=1===this.ctx.lineWidth% +2?(b.y<<0)+0.5:b.y<<0,this.ctx.beginPath(),this.ctx.moveTo(b.x<<0,c),this.ctx.lineTo(b.x+this.tickLength<<0,c),this.ctx.stroke()),0===this.labelAngle?(n.textBlock.y=b.y,n.textBlock.x=b.x+this.tickLength+5):(n.textBlock.y=0>this.labelAngle?b.y:b.y-(n.textBlock.height-n.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),n.textBlock.x=0this._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[f+1].position),a.fillRect(Math.min(b.x,d.x),c.y1,Math.abs(b.x-d.x),Math.abs(c.y1-c.y2)),d=!1):d=!0;else if(("left"===this._position||"right"===this._position)&&this.interlacedColor)for(a.fillStyle=this.interlacedColor,f=0;fthis._labels.length-1?this.getPixelCoordinatesOnAxis(this.viewportMaximum):this.getPixelCoordinatesOnAxis(this._labels[f+1].position),a.fillRect(c.x1,Math.min(b.y,d.y),Math.abs(c.x1-c.x2),Math.abs(d.y-b.y)),d=!1):d=!0;a.beginPath()};B.prototype.renderStripLinesOfThicknessType=function(a){if(this.stripLines&&0this.viewportMaximum||x(m.value)||isNaN(this.range))||l.push(m))}for(c=0;cthis.viewportMaximum||isNaN(this.range))){a=this.getPixelCoordinatesOnAxis(b.position);if("outside"===b.stripLine.labelPlacement)if(m&&(this.ctx.strokeStyle=m.color,"pixel"===m._thicknessType&&(this.ctx.lineWidth=m.thickness)),"bottom"===this._position){var n=1===this.ctx.lineWidth%2?(a.x<< +0)+0.5:a.x<<0;this.ctx.beginPath();this.ctx.moveTo(n,a.y<<0);this.ctx.lineTo(n,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?(n=1===this.ctx.lineWidth%2?(a.x<<0)+0.5:a.x<<0,this.ctx.beginPath(),this.ctx.moveTo(n, +a.y<<0),this.ctx.lineTo(n,a.y-this.tickLength<<0),this.ctx.stroke(),0===this.labelAngle?(a.x-=b.textBlock.width/2,a.y-=this.tickLength+b.textBlock.height):(a.x+=(b.textBlock.height-this.tickLength-this.labelFontSize/2)*Math.sin(Math.PI/180*this.labelAngle)-(0this.labelAngle?a.y:a.y-(b.textBlock.height-b.textBlock.fontSize/2-5)*Math.cos(Math.PI/180*this.labelAngle),a.x=0this.chart.plotArea.x1?x(m.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(m.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/ +2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y1+b.textBlock.width+3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y2-b.textBlock.width-3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y1+3):"top"===this._position? +(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth:this.chart.plotArea.height-3,b.textBlock.measureText(),a.x-b.textBlock.height>this.chart.plotArea.x1?x(m.startValue)?a.x-=b.textBlock.height-b.textBlock.fontSize/2:a.x-=b.textBlock.height/2-b.textBlock.fontSize/2+3:(b.textBlock.angle=90,x(m.startValue)?a.x+=b.textBlock.height-b.textBlock.fontSize/2:a.x+=b.textBlock.height/2-b.textBlock.fontSize/2+3),a.y=-90===b.textBlock.angle?"near"===b.stripLine.labelAlign? +this.chart.plotArea.y1+b.textBlock.width+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1+b.textBlock.width)/2:this.chart.plotArea.y2-3:"near"===b.stripLine.labelAlign?this.chart.plotArea.y1+3:"center"===b.stripLine.labelAlign?(this.chart.plotArea.y2+this.chart.plotArea.y1-b.textBlock.width)/2:this.chart.plotArea.y2-b.textBlock.width-3):"left"===this._position?(b.textBlock.maxWidth=this.options.stripLines[c].labelMaxWidth?this.options.stripLines[c].labelMaxWidth: +this.chart.plotArea.width-3,b.textBlock.angle=0,b.textBlock.measureText(),a.y-b.textBlock.height>this.chart.plotArea.y1?x(m.startValue)?a.y-=b.textBlock.height-b.textBlock.fontSize/2:a.y-=b.textBlock.height/2-b.textBlock.fontSize+3:a.y-b.textBlock.heightthis.chart.plotArea.y1?x(m.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:x(m.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;k.push(b)}if(!h){h=!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;cthis.viewportMaximum||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=1===a.lineWidth%2?(d.x<<0)+0.5:d.x<<0,a.moveTo(d,b.y1<<0),a.lineTo(d,b.y2<<0),a.stroke());else if("left"===this._position||"right"===this._position)for(var c=0;cthis.viewportMaximum||(a.beginPath(),d=this.getPixelCoordinatesOnAxis(this._labels[c].position),d=1===a.lineWidth%2?(d.y<<0)+0.5:d.y<<0,a.moveTo(b.x1<<0,d),a.lineTo(b.x2<<0,d),a.stroke());a.restore()}};B.prototype.renderAxisLine=function(){var a=this.chart.ctx;a.save();if("bottom"===this._position||"top"===this._position){if(this.lineThickness){a.lineWidth=this.lineThickness;a.strokeStyle=this.lineColor?this.lineColor:"black";a.setLineDash&&a.setLineDash(I(this.lineDashType, +this.lineThickness));var d=1===this.lineThickness%2?(this.lineCoordinates.y1<<0)+0.5:this.lineCoordinates.y1<<0;a.beginPath();a.moveTo(this.lineCoordinates.x1,d);a.lineTo(this.lineCoordinates.x2,d);a.stroke()}}else"left"!==this._position&&"right"!==this._position||!this.lineThickness||(a.lineWidth=this.lineThickness,a.strokeStyle=this.lineColor,a.setLineDash&&a.setLineDash(I(this.lineDashType,this.lineThickness)),d=1===this.lineThickness%2?(this.lineCoordinates.x1<<0)+0.5:this.lineCoordinates.x1<< +0,a.beginPath(),a.moveTo(d,this.lineCoordinates.y1),a.lineTo(d,this.lineCoordinates.y2),a.stroke());a.restore()};B.prototype.getPixelCoordinatesOnAxis=function(a){var d={};if("bottom"===this._position||"top"===this._position)d.x=this.convertValueToPixel(a),d.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)d.y=this.convertValueToPixel(a),d.x=this.lineCoordinates.x2;return d};B.prototype.convertPixelToValue=function(a){if("undefined"===typeof a)return null;var d=0,d=0, +d="number"===typeof a?a:"left"===this._position||"right"===this._position?a.y:a.x;return d=this.logarithmic?Math.pow(this.logarithmBase,(d-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit)*this.viewportMinimum:this.conversionParameters.minimum+(d-this.conversionParameters.reference)/this.conversionParameters.pixelPerUnit};B.prototype.convertValueToPixel=function(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.setViewPortRange=function(a,d){this.sessionVariables.newViewportMinimum=this.viewportMinimum=Math.min(a,d);this.sessionVariables.newViewportMaximum=this.viewportMaximum=Math.max(a,d)};B.prototype.getXValueAt=function(a){if(!a)return null;var d=null;"left"===this._position?d=this.convertPixelToValue(a.y): +"bottom"===this._position&&(d=this.convertPixelToValue(a.x));return d};B.prototype.calculateValueToPixelConversionParameters=function(a){a={pixelPerUnit:null,minimum:null,reference:null};var d=this.lineCoordinates.width,b=this.lineCoordinates.height;a.minimum=this.viewportMinimum;if("bottom"===this._position||"top"===this._position)this.logarithmic?(a.lnLogarithmBase=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?-1:1)*d*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit= +(this.reversed?-1:1)*d/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.x2:this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)this.logarithmic?(a.lnLogarithmBase=Math.log(this.logarithmBase),a.pixelPerUnit=(this.reversed?1:-1)*b*a.lnLogarithmBase/Math.log(Math.abs(this.range))):a.pixelPerUnit=(this.reversed?1:-1)*b/Math.abs(this.range),a.reference=this.reversed?this.lineCoordinates.y1:this.lineCoordinates.y2;this.conversionParameters=a};B.prototype.calculateAxisParameters= +function(){if(this.logarithmic)this.calculateLogarithamicAxisParameters();else{var a=this.chart.layoutManager.getFreeSpace(),d=!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)),f,g,h,c=0;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum=this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;if("axisX"===this.type){if(this.dataSeries&&0g?(c=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-c:g=f+c):(c=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=c),0!==f&&(f-=c)),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0));c=(isNaN(this.viewportMaximum)|| +null===this.viewportMaximum?g:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?f:this.viewportMinimum);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*E.secondDuration)<=a?(this.interval=1,this.intervalType="second"):c/(2*E.secondDuration)<=a?(this.interval=2,this.intervalType= +"second"):c/(5*E.secondDuration)<=a?(this.interval=5,this.intervalType="second"):c/(10*E.secondDuration)<=a?(this.interval=10,this.intervalType="second"):c/(15*E.secondDuration)<=a?(this.interval=15,this.intervalType="second"):c/(20*E.secondDuration)<=a?(this.interval=20,this.intervalType="second"):c/(30*E.secondDuration)<=a?(this.interval=30,this.intervalType="second"):c/(1*E.minuteDuration)<=a?(this.interval=1,this.intervalType="minute"):c/(2*E.minuteDuration)<=a?(this.interval=2,this.intervalType= +"minute"):c/(5*E.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):c/(10*E.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):c/(15*E.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):c/(20*E.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):c/(30*E.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):c/(1*E.hourDuration)<=a?(this.interval=1,this.intervalType="hour"):c/(2*E.hourDuration)<=a?(this.interval=2,this.intervalType="hour"): +c/(3*E.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):c/(6*E.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):c/(1*E.dayDuration)<=a?(this.interval=1,this.intervalType="day"):c/(2*E.dayDuration)<=a?(this.interval=2,this.intervalType="day"):c/(4*E.dayDuration)<=a?(this.interval=4,this.intervalType="day"):c/(1*E.weekDuration)<=a?(this.interval=1,this.intervalType="week"):c/(2*E.weekDuration)<=a?(this.interval=2,this.intervalType="week"):c/(3*E.weekDuration)<=a?(this.interval= +3,this.intervalType="week"):c/(1*E.monthDuration)<=a?(this.interval=1,this.intervalType="month"):c/(2*E.monthDuration)<=a?(this.interval=2,this.intervalType="month"):c/(3*E.monthDuration)<=a?(this.interval=3,this.intervalType="month"):c/(6*E.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=c/(1*E.yearDuration)<=a?1:c/(2*E.yearDuration)<=a?2:c/(4*E.yearDuration)<=a?4:Math.floor(B.getNiceNumber(c/(a-1),!0)/E.yearDuration),this.intervalType="year"));if(null===this.viewportMinimum|| +isNaN(this.viewportMinimum))this.viewportMinimum=f-h/2;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=g+h/2;d?this.autoValueFormatString="MMM DD YYYY HH:mm":"year"===this.intervalType?this.autoValueFormatString="YYYY":"month"===this.intervalType?this.autoValueFormatString="MMM YYYY":"week"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"day"===this.intervalType?this.autoValueFormatString="MMM DD YYYY":"hour"===this.intervalType?this.autoValueFormatString= +"hh:mm TT":"minute"===this.intervalType?this.autoValueFormatString="hh:mm TT":"second"===this.intervalType?this.autoValueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&(this.autoValueFormatString="fff'ms'");this.valueFormatString||(this.valueFormatString=this.autoValueFormatString)}else{this.intervalType="number";c=B.getNiceNumber(c,!1);this.interval=this.options&&0g?(c=Math.min(Math.abs(0.01*Math.abs(g-f)),5),0<=g?f=g-c:g=f+c):(c=Math.min(Math.abs(0.01*Math.abs(g-f)),0.05),0!==g&&(g+=c),0!==f&&(f-=c)):(g="undefined"===typeof this.options.interval?-Infinity:this.options.interval,f=0),h=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1g&&(g=0)),"axisX"===this.type&&b){if(null===this.minimum||isNaN(this.minimum))this.minimum=f-h/2;if(null===this.maximum||isNaN(this.maximum))this.maximum=g+h/2}else this.intervalType="number",null===this.minimum&&(this.minimum="axisX"===this.type?f-h/2:Math.floor(f/this.interval)*this.interval,this.minimum=Math.min(this.minimum,null===this.sessionVariables.viewportMinimum||isNaN(this.sessionVariables.viewportMinimum)?Infinity:this.sessionVariables.viewportMinimum)), +null===this.maximum&&(this.maximum="axisX"===this.type?g+h/2:Math.ceil(g/this.interval)*this.interval,this.maximum=Math.max(this.maximum,null===this.sessionVariables.viewportMaximum||isNaN(this.sessionVariables.viewportMaximum)?-Infinity:this.sessionVariables.viewportMaximum)),0===this.maximum&&0===this.minimum&&(0===this.options.minimum?this.maximum+=10:0===this.options.maximum&&(this.minimum-=10));this.viewportMinimum=Math.max(this.viewportMinimum,this.minimum);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;if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",1>this.range)){d=Math.floor(Math.abs(Math.log(this.range)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;if(2this.maxWidth?7:Math.max(7,Math.floor(this.maxWidth/100)):Math.max(Math.floor(this.maxWidth/50),3),c,f,g,h;h=1;if(null===this.viewportMinimum||isNaN(this.viewportMinimum))this.viewportMinimum= +this.minimum;if(null===this.viewportMaximum||isNaN(this.viewportMaximum))this.viewportMaximum=this.maximum;"axisX"===this.type?(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,1===f/c&&(h=Math.pow(this.logarithmBase,"undefined"===typeof this.options.interval?0.4:this.options.interval),f*=h,c/=h),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase, +0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.viewportMinimum?this.viewportMinimum:this.dataInfo.viewPortMin,f=null!==this.viewportMaximum?this.viewportMaximum:this.dataInfo.viewPortMax,0>=c&&!isFinite(f)?(f="undefined"===typeof this.options.interval?0:this.options.interval,c=1):0>=c?c=f:isFinite(f)||(f=c),1===c&&1===f?(f*=this.logarithmBase-1/this.logarithmBase,c=1):1===f/c?(h=Math.min(f*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),f*=h,c/=h):c>f?(h=Math.min(c/ +f*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,5)),1<=f?c=f/h:f=c*h):(h=Math.min(f/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==c&&(c/=h)),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase,this.includeZero&&(null===this.viewportMinimum||isNaN(this.viewportMinimum))&&1f&&(f=1));h=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)/(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);linearRange=(isNaN(this.viewportMaximum)||null===this.viewportMaximum?f:this.viewportMaximum)-(isNaN(this.viewportMinimum)||null===this.viewportMinimum?c:this.viewportMinimum);this.intervalType="number";h=Math.pow(this.logarithmBase,B.getNiceNumber(Math.abs(Math.log(h)/d),!1));this.options&&0this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5):this.logarithmBase):"axisY"===this.type&&(c=null!==this.minimum?this.minimum:this.dataInfo.min,f=null!==this.maximum?this.maximum:this.dataInfo.max, +isFinite(c)||isFinite(f)?1===c&&1===f?(f*=this.logarithmBase,c/=this.logarithmBase):1===f/c?(h=Math.pow(this.logarithmBase,this.interval),f*=h,c/=h):c>f?(h=Math.min(0.01*(c/f),5),1<=f?c=f/h:f=c*h):(h=Math.min(f/c*Math.pow(this.logarithmBase,0.01),Math.pow(this.logarithmBase,0.04)),1!==f&&(f*=h),1!==c&&(c/=h)):(f="undefined"===typeof this.options.interval?0:this.options.interval,c=1),g=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:f/c>this.logarithmBase?f/c*Math.pow(this.logarithmBase,0.5): +this.logarithmBase,this.includeZero&&(null===this.minimum||isNaN(this.minimum))&&1f&&(f=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)/d/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?f*Math.sqrt(g):Math.pow(this.logarithmBase,this.interval*Math.ceil(Math.log(f)/d/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)/(d*this.interval)+0.2)*this.interval);this.range=this.viewportMaximum/this.viewportMinimum;this.noTicks=a;if(!this.options.interval&& +this.rangethis.viewportMaximum||3>a?2:3)){for(d=Math.floor(this.viewportMinimum/b+0.5)*b;dthis.interval&&(this.interval=b,c=Math.pow(this.logarithmBase,Math.floor(Math.log(this.viewportMinimum)/(d*this.interval)+0.2)*this.interval))),this.equidistantInterval=!0,this.intervalStartPosition=c;if(!this.valueFormatString&& +(this.valueFormatString="#,##0.##",1>this.viewportMinimum)){d=Math.floor(Math.abs(Math.log(this.viewportMinimum)/Math.LN10))+2;if(isNaN(d)||!isFinite(d))d=2;if(2b?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,d){var b=Math.floor(Math.log(a)/Math.LN10),c=a/Math.pow(10,b);return Number(((d? +1.5>c?1:3>c?2:7>c?5:10:1>=c?1:2>=c?2:5>=c?5:10)*Math.pow(10,b)).toFixed(20))};B.prototype.getLabelStartPoint=function(){var a=E[this.intervalType+"Duration"]*this.interval,a=new Date(Math.floor(this.viewportMinimum/a)*a);if("millisecond"!==this.intervalType)if("second"===this.intervalType)0(new Date).getTime()-this._lastUpdated||(this._lastUpdated=(new Date).getTime(),this._updateToolTip(a,d))}; +S.prototype._updateToolTip=function(a,d,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 d){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;d=this._prevY}else this._prevX=a,this._prevY=d;var c=null,f=null,g=[],h=0;if(this.shared&&this.enabled&&"none"!==this.chart.plotInfo.axisPlacement){if("xySwapped"===this.chart.plotInfo.axisPlacement){f=[];if(this.chart.axisX)for(var l= +0;lk.dataSeries.axisY.viewportMaximum&&b++;b-k.dataPoint.y.length&&g.push(k)}else"column"===f.type||"bar"===f.type?0>k.dataPoint.y?0>k.dataSeries.axisY.viewportMinimum&&k.dataSeries.axisY.viewportMaximum>=k.dataPoint.y&&g.push(k):k.dataSeries.axisY.viewportMinimum<= +k.dataPoint.y&&0<=k.dataSeries.axisY.viewportMaximum&&g.push(k):"bubble"===f.type?(b=this.chart._eventManager.objectMap[f.dataPointIds[k.index]].size/2,k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum-b&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum+b&&g.push(k)):(0<=k.dataSeries.type.indexOf("100")||"stackedColumn"===f.type||"stackedBar"===f.type||k.dataPoint.y>=k.dataSeries.axisY.viewportMinimum&&k.dataPoint.y<=k.dataSeries.axisY.viewportMaximum)&&g.push(k);else g.push(k)}}if(0a&&(a+=this.container.clientWidth+20);a+this.container.clientWidth>Math.max(this.chart.container.clientWidth,this.chart.width)&&(a=Math.max(0,Math.max(this.chart.container.clientWidth,this.chart.width)-this.container.clientWidth));a+="px";d=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):d:g[0].dataSeries.axisY.convertValueToPixel(g[0].dataPoint.y);d=-d+10;0":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y}",k=c.axisXIndex;else if("bubble"===c.type)this.chart.axisX&& +1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y},   {z}";else if("rangeColumn"===c.type||"rangeBar"===c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
":""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:  {y[0]}, {y[1]}";else if("candlestick"===c.type||"ohlc"===c.type)this.chart.axisX&&1":"X:{axisXIndex}
": +""),a+=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"{name}:
Open:   {y[0]}
High:    {y[1]}
Low:   {y[2]}
Close:   {y[3]}";null===b&&(b="");!0===this.reversed?(b=this.chart.replaceKeywordsWithValue(a,f,c,g)+b,l"+b)):(b+=this.chart.replaceKeywordsWithValue(a, +f,c,g),l"));c.toolTipContent=a}null!==b&&(b=m+b)}else{c=d[0].dataSeries;f=d[0].dataPoint;g=d[0].index;if(null===f.toolTipContent||"undefined"===typeof f.toolTipContent&&null===c.options.toolTipContent)return null;if("line"===c.type||"stepLine"===c.type||"spline"===c.type||"area"===c.type||"stepArea"===c.type||"splineArea"===c.type||"column"===c.type||"bar"===c.type||"scatter"===c.type||"stackedColumn"===c.type||"stackedColumn100"===c.type||"stackedBar"===c.type||"stackedBar100"=== +c.type||"stackedArea"===c.type||"stackedArea100"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+":  {y}";else if("bubble"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+":  {y},   {z}";else if("pie"===c.type||"doughnut"===c.type||"funnel"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.name?"{name}:  ":f.label?"{label}:  ":"")+"{y}";else if("rangeColumn"===c.type||"rangeBar"=== +c.type||"rangeArea"===c.type||"rangeSplineArea"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content:""+(f.label?"{label}":"{x}")+" :  {y[0]},  {y[1]}";else if("candlestick"===c.type||"ohlc"===c.type)a=f.toolTipContent?f.toolTipContent:c.toolTipContent?c.toolTipContent:this.content&&"function"!==typeof this.content?this.content: +""+(f.label?"{label}":"{x}")+"
Open:   {y[0]}
High:    {y[1]}
Low:     {y[2]}
Close:   {y[3]}";null===b&&(b="");b+=this.chart.replaceKeywordsWithValue(a,f,c,g)}this.content=a;return b};S.prototype.enableAnimation=function(){this.container.style.WebkitTransition||(this.container.style.WebkitTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.MozTransition= +"left .2s ease-out, bottom .2s ease-out",this.container.style.MsTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.transition="left .2s ease-out, bottom .2s ease-out")};S.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition="",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};S.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())};S.prototype.show=function(a,d,b){this._updateToolTip(a,d,"undefined"===typeof b?!1:b)};A.prototype.getPercentAndTotal=function(a,d){var b=null,c=null,f=null;if(0<=a.type.indexOf("stacked"))c=0,b=d.x.getTime?d.x.getTime():d.x,b in a.plotUnit.yTotals&&(c=a.plotUnit.yTotals[b],f=isNaN(d.y)?0:0===c?0:100*(d.y/c));else if("pie"===a.type||"doughnut"===a.type){for(i=c=0;ic&&a.push(d),d.animationCallback(c),1<=c&&d.onComplete)d.onComplete();this.animations=a;0g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function P(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX= +a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function Q(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function E(a,b,c){return Math.min(c,Math.max(b,a))}function F(a,b,c){0>c&&c++;16*c?a+6*(b-a)*c: +1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function G(a){if(a in H)return H[a];var b,c=1;a=String(a);if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=Q(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=v[E(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=Q(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=E(parseFloat(e[1])/100,0,1);e=E(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=F(d,f,b+1/3);e=F(d,f,b);b=F(d,f,b-1/3)}b="#"+ +v[Math.floor(255*g)]+v[Math.floor(255*e)]+v[Math.floor(255*b)];c=c[3]}else b=Z[a]||a;return H[a]={color:b,alpha:c}}function C(a){this.m_=D();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*q;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute", +c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function R(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function S(a,b){var c=G(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("')}function T(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,k=g.x-c.x,n=g.y-c.y;if(e instanceof w){var h=0,l=g=0,u=0,m=1;if("gradient"==e.type_){h=e.x1_/f;c=e.y1_/d;var p=s(a,e.x0_/f,e.y0_/d),h=s(a,h,c),h=180*Math.atan2(h.x-p.x,h.y-p.y)/Math.PI;0>h&&(h+=360);1E-6>h&&(h=0)}else p=s(a,e.x0_,e.y0_),g=(p.x-c.x)/k,l=(p.y-c.y)/n,k/=f*q, +n/=d*q,m=x.max(k,n),u=2*e.r0_/m,m=2*e.r1_/m-u;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});d=f.length;p=f[0].color;c=f[d-1].color;k=f[0].alpha*a.globalAlpha;a=f[d-1].alpha*a.globalAlpha;for(var n=[],r=0;r')}else e instanceof +I?k&&n&&b.push("'):(e=G(a.fillStyle),b.push(''))}function s(a,b,c){a=a.m_;return{x:q*(b*a[0][0]+c*a[1][0]+a[2][0])-r,y:q*(b*a[0][1]+c*a[1][1]+a[2][1])-r}}function z(a,b,c){isFinite(b[0][0])&&(isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1]))&&(a.m_=b,c&&(a.lineScale_=aa(ba(b[0][0]*b[1][1]-b[0][1]* +b[1][0]))))}function w(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function I(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new A("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new A("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new A("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height} +function A(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var x=Math,k=x.round,J=x.sin,K=x.cos,ba=x.abs,aa=x.sqrt,q=10,r=q/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var M=Array.prototype.slice;O(document);var U={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",W(this.init_,this,a))},init_:function(a){a=a.getElementsByTagName("canvas");for(var b=0;bd;d++)for(var B=0;16>B;B++)v[16*d+B]=d.toString(16)+B.toString(16);var Z={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC", +bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000", +darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082", +ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA", +mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5", +peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"}, +H={},L={},$={butt:"flat",round:"round"},d=C.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=s(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo= +function(a,b,c,g,e,f){e=s(this,e,f);a=s(this,a,b);c=s(this,c,g);R(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=s(this,a,b);c=s(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};R(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){c*=q;var d=f?"at":"wa",k=a+K(g)*c-r,n=b+J(g)*c-r;g=a+K(e)*c-r;e=b+J(e)*c-r;k!=g||f||(k+=0.125);a=s(this,a,b);k=s(this,k,n);g=s(this,g,e);this.currentPath_.push({type:d, +x:a.x,y:a.y,radius:c,xStart:k.x,yStart:k.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+ +c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new w("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new w("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,r,y,n,h;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var l=a.width,u=a.height;a.runtimeStyle.width= +e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],r=y=0,n=e=l,h=d=u;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],r=y=0,n=l,h=u;else if(9==arguments.length)r=arguments[1],y=arguments[2],n=arguments[3],h=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var m=s(this,c,g),p=[];p.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))};d.stroke=function(a){var b=[];b.push("d.x)d.x=f.x;if(null==c.y||f.yd.y)d.y=f.y}}b.push(' ">');a?T(this,b,c,d):S(this,b);b.push("");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a= +{};P(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=t(D(),this.m_)};d.restore=function(){this.aStack_.length&&(P(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){z(this,t([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=K(a);a=J(a);z(this,t([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;z(this,t([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){z(this,t([[a, +b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){z(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_;d=0;var r=1E3,t=0,n=[],h;h=this.font;if(L[h])h=L[h];else{var l=document.createElement("div").style;try{l.font=h}catch(u){}h=L[h]={style:l.fontStyle||"normal",variant:l.fontVariant||"normal",weight:l.fontWeight||"normal",size:l.fontSize||10,family:l.fontFamily||"sans-serif"}}var l=h,m=this.element_;h={};for(var p in l)h[p]=l[p];p=parseFloat(m.currentStyle.fontSize); +m=parseFloat(l.size);"number"==typeof l.size?h.size=l.size:-1!=l.size.indexOf("px")?h.size=m:-1!=l.size.indexOf("em")?h.size=p*m:-1!=l.size.indexOf("%")?h.size=p/100*m:-1!=l.size.indexOf("pt")?h.size=m/0.75:h.size=p;h.size*=0.981;p=h.style+" "+h.variant+" "+h.weight+" "+h.size+"px "+h.family;m=this.element_.currentStyle;l=this.textAlign.toLowerCase();switch(l){case "left":case "center":case "right":break;case "end":l="ltr"==m.direction?"right":"left";break;case "start":l="rtl"==m.direction?"right": +"left";break;default:l="left"}switch(this.textBaseline){case "hanging":case "top":t=h.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":t=-h.size/2.25}switch(l){case "right":d=1E3;r=0.05;break;case "center":d=r=500}b=s(this,b+0,c+t);n.push('');e?S(this,n):T(this,n,{x:-d,y:0}, +{x:r,y:h.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+","+f[1][1].toFixed(3)+",0,0";b=k(b.x/q)+","+k(b.y/q);n.push('','','');this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a, +b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd",''),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){}; +d.arcTo=function(){};d.createPattern=function(a,b){return new I(a,b)};w.prototype.addColorStop=function(a,b){b=G(b);this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};d=A.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR= +13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=U;CanvasRenderingContext2D=C;CanvasGradient=w;CanvasPattern=I;DOMException=A}(); +/* + CanvasJS jQuery Charting Plugin - http://canvasjs.com/ + Copyright 2013 fenopix +*/ +(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); diff --git a/charts/canvas/license.txt b/charts/canvas/license.txt new file mode 100644 index 0000000..597edb2 --- /dev/null +++ b/charts/canvas/license.txt @@ -0,0 +1,9 @@ +/** +* CanvasJS HTML5 & JavaScript Charts - v1.9.0 GA - http://canvasjs.com/ +* Copyright 2016 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. +* http://canvasjs.com/license-canvasjs/ +* +*/ \ No newline at end of file diff --git a/css/power.css b/css/power.css new file mode 100644 index 0000000..035a843 --- /dev/null +++ b/css/power.css @@ -0,0 +1,61 @@ +body { + margin: 0; + padding: 0; +} + +#power { + table-layout: fixed; + text-align: center; + margin: 0 auto; + border-collapse: collapse; + border: 1px solid black; +} + +#power td { + width: 25%; + overflow: hidden; + height: 44px; +} + +#power tr div { + height: 20px; +} + +#double { + border-spacing: 0px; + text-align: center; + margin: 0; + height: 40px; + width: 100%; + overflow: hidden; +} + +#double td { + height: 20px; +} + +#tooltip { + border: 2px solid red; + display: none; +} + +#popup { + width:600px; + height:600px; + position:absolute; + top:5%; + text-align: center; + #left:5%; + #margin:-50px 0 0 -100px; /* [-(height/2)px 0 0 -(width/2)px] */ + display:none; +} + +#popup2 { + width:600px; + height:600px; + position:absolute; + top:5%; + right:1%; + #margin:-50px 0 0 -100px; /* [-(height/2)px 0 0 -(width/2)px] */ + display:none; +} diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..25f918c --- /dev/null +++ b/footer.html @@ -0,0 +1,8 @@ + +
+
+ +
+ + + diff --git a/header.html b/header.html new file mode 100644 index 0000000..43f79bf --- /dev/null +++ b/header.html @@ -0,0 +1,120 @@ + + + + + + + + +]", "i"), + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /\/(java|ecma)script/i, + rcleanScript = /^\s*", "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "
+ + + diff --git a/index.php b/index.php new file mode 100644 index 0000000..8094528 --- /dev/null +++ b/index.php @@ -0,0 +1,82 @@ +connect_errno) { + echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; + } + + $result=$mysqli->query($sqlquery); + return($result); +} + + +$oldi=0; +$qstring=$_SERVER['QUERY_STRING']; +parse_str($qstring, $gem); +if(strlen($_SERVER['HTTP_USER_AGENT']) >2) { + include("header.html"); + $r=open_database("power", "select * from devices where SN='01100476'"); + $gem = mysqli_fetch_assoc($r); + echo ""; + echo ""; + echo ""; + for ($i=1; $i<41; $i++) { + $r=open_database("power", "select name,alias from circuits where alias='$i' or alias='".$i."A' or alias='".$i."B'"); + if ($i % 2 != 0) { + echo ""; + } + + if (mysqli_num_rows($r) == 0) { + echo ""; + } else { + while ($row = mysqli_fetch_assoc($r)) { + if ((strpos(($row["alias"]), "A") == TRUE) or (strpos(($row["alias"]), "B") == TRUE)) { + if ($oldi != $i) { + echo ""; + $oldi=$i; + } + } else { + echo ""; + } + } + } + + if ($i % 2 == 0) { + echo ""; + } + + } + + $r=open_database("power", "select name,alias from circuits where alias is NULL"); + echo ""; + while ($row = mysqli_fetch_assoc($r)) { + echo ""; + } + echo "
Serial Number: " .$gem['SN']."
Line Voltage: " .($gem['V']/10)."
Breaker Position $i$i"; + if (($oldi != $i) and (strpos(($row["alias"]), "B") == TRUE)) { + echo ""; + } else { + $r2=open_database("power", "select name,alias from circuits where alias='".$i."A' or alias='".$i."B'"); + $a = mysqli_fetch_array($r2); + mysqli_data_seek($r2, 1); + $b = mysqli_fetch_array($r2); + echo ""; + } + echo "
".$i."A
".$i."B
".$i."A
".$i."B
".$row["alias"]."Breaker Position $i
Available Monitoring Inputs
".$row["name"]."
"; + include("footer.html"); +} else { + $r=open_database("power", "select device_id from devices where SN='".$gem['SN']."'"); + if ($r->num_rows > 0) { + $r=open_database("power", "update devices set V='" . $gem['V'] . "', c1 = '". $gem['c1'] . "', c2 = '". $gem['c2'] . "', c3 = '". $gem['c3'] . "', c4 = '". $gem['c4'] . "', c5 = '". $gem['c5'] . "', c6 = '". $gem['c6'] . "', c7 = '". $gem['c7'] . "', c8 = '". $gem['c8'] . "', c9 = '". $gem['c9'] . "', c10 = '". $gem['c10'] . "', c11 = '". $gem['c11'] . "', c12 = '". $gem['c12'] . "', c13 = '". $gem['c13'] . "', c14 = '". $gem['c14'] . "', c15 = '". $gem['c15'] . "', c16 = '". $gem['c16'] . "', c17 = '". $gem['c17'] . "', c18 = '". $gem['c18'] . "', c19 = '". $gem['c19'] . "', c20 = '". $gem['c20'] . "', c21 = '". $gem['c21'] . "', c22 = '". $gem['c22'] . "', c23 = '". $gem['c23'] . "', c24 = '". $gem['c24'] . "', c25 = '". $gem['c25'] . "', c26 = '". $gem['c26'] . "', c27 = '". $gem['c27'] . "', c28 = '". $gem['c28'] . "', c29 = '". $gem['c29'] . "', c30 = '". $gem['c30'] . "', c31 = '". $gem['c31'] . "', c32 = '". $gem['c32'] . "' where SN='".$gem['SN']."'"); + } else { + $r=open_database("power", "insert devices set V='" . $gem['V'] . "', c1 = '". $gem['c1'] . "', c2 = '". $gem['c2'] . "', c3 = '". $gem['c3'] . "', c4 = '". $gem['c4'] . "', c5 = '". $gem['c5'] . "', c6 = '". $gem['c6'] . "', c7 = '". $gem['c7'] . "', c8 = '". $gem['c8'] . "', c9 = '". $gem['c9'] . "', c10 = '". $gem['c10'] . "', c11 = '". $gem['c11'] . "', c12 = '". $gem['c12'] . "', c13 = '". $gem['c13'] . "', c14 = '". $gem['c14'] . "', c15 = '". $gem['c15'] . "', c16 = '". $gem['c16'] . "', c17 = '". $gem['c17'] . "', c18 = '". $gem['c18'] . "', c19 = '". $gem['c19'] . "', c20 = '". $gem['c20'] . "', c21 = '". $gem['c21'] . "', c22 = '". $gem['c22'] . "', c23 = '". $gem['c23'] . "', c24 = '". $gem['c24'] . "', c25 = '". $gem['c25'] . "', c26 = '". $gem['c26'] . "', c27 = '". $gem['c27'] . "', c28 = '". $gem['c28'] . "', c29 = '". $gem['c29'] . "', c30 = '". $gem['c30'] . "', c31 = '". $gem['c31'] . "', c32 = '". $gem['c32'] . "', SN='".$gem['SN']."'"); + } +} +?> + + + diff --git a/js/jquery-1.7.2.js b/js/jquery-1.7.2.js new file mode 100644 index 0000000..3774ff9 --- /dev/null +++ b/js/jquery-1.7.2.js @@ -0,0 +1,9404 @@ +/*! + * jQuery JavaScript Library v1.7.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Wed Mar 21 12:46:34 2012 -0700 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Matches dashed string for camelizing + rdashAlpha = /-([a-z]|[0-9])/ig, + rmsPrefix = /^-ms-/, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = ( context ? context.ownerDocument || context : document ); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.7.2", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.add( fn ); + + return this; + }, + + eq: function( i ) { + i = +i; + return i === -1 ? + this.slice( i ) : + this.slice( i, i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.fireWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).off( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery.Callbacks( "once memory" ); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + var xml, tmp; + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array, i ) { + var len; + + if ( array ) { + if ( indexOf ) { + return indexOf.call( array, elem, i ); + } + + len = array.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in array && array[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can optionally be executed if it's a function + access: function( elems, fn, key, value, chainable, emptyGet, pass ) { + var exec, + bulk = key == null, + i = 0, + length = elems.length; + + // Sets many values + if ( key && typeof key === "object" ) { + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); + } + chainable = 1; + + // Sets one value + } else if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = pass === undefined && jQuery.isFunction( value ); + + if ( bulk ) { + // Bulk operations only iterate when executing function values + if ( exec ) { + exec = fn; + fn = function( elem, key, value ) { + return exec.call( jQuery( elem ), value ); + }; + + // Otherwise they run against the entire set + } else { + fn.call( elems, value ); + fn = null; + } + } + + if ( fn ) { + for (; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + } + + chainable = 1; + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; + }, + + now: function() { + return ( new Date() ).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +return jQuery; + +})(); + + +// String to Object flags format cache +var flagsCache = {}; + +// Convert String-formatted flags into Object-formatted ones and store in cache +function createFlags( flags ) { + var object = flagsCache[ flags ] = {}, + i, length; + flags = flags.split( /\s+/ ); + for ( i = 0, length = flags.length; i < length; i++ ) { + object[ flags[i] ] = true; + } + return object; +} + +/* + * Create a callback list using the following parameters: + * + * flags: an optional list of space-separated flags that will change how + * the callback list behaves + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible flags: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( flags ) { + + // Convert flags from String-formatted to Object-formatted + // (we check in cache first) + flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + + var // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = [], + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Add one or several callbacks to the list + add = function( args ) { + var i, + length, + elem, + type, + actual; + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + // Inspect recursively + add( elem ); + } else if ( type === "function" ) { + // Add if not in unique mode and callback is not in + if ( !flags.unique || !self.has( elem ) ) { + list.push( elem ); + } + } + } + }, + // Fire callbacks + fire = function( context, args ) { + args = args || []; + memory = !flags.memory || [ context, args ]; + fired = true; + firing = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { + memory = true; // Mark as halted + break; + } + } + firing = false; + if ( list ) { + if ( !flags.once ) { + if ( stack && stack.length ) { + memory = stack.shift(); + self.fireWith( memory[ 0 ], memory[ 1 ] ); + } + } else if ( memory === true ) { + self.disable(); + } else { + list = []; + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + var length = list.length; + add( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away, unless previous + // firing was halted (stopOnFalse) + } else if ( memory && memory !== true ) { + firingStart = length; + fire( memory[ 0 ], memory[ 1 ] ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + var args = arguments, + argIndex = 0, + argLength = args.length; + for ( ; argIndex < argLength ; argIndex++ ) { + for ( var i = 0; i < list.length; i++ ) { + if ( args[ argIndex ] === list[ i ] ) { + // Handle firingIndex and firingLength + if ( firing ) { + if ( i <= firingLength ) { + firingLength--; + if ( i <= firingIndex ) { + firingIndex--; + } + } + } + // Remove the element + list.splice( i--, 1 ); + // If we have some unicity property then + // we only need to do this once + if ( flags.unique ) { + break; + } + } + } + } + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + if ( list ) { + var i = 0, + length = list.length; + for ( ; i < length; i++ ) { + if ( fn === list[ i ] ) { + return true; + } + } + } + return false; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory || memory === true ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( stack ) { + if ( firing ) { + if ( !flags.once ) { + stack.push( [ context, args ] ); + } + } else if ( !( flags.once && memory ) ) { + fire( context, args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + + + +var // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + + Deferred: function( func ) { + var doneList = jQuery.Callbacks( "once memory" ), + failList = jQuery.Callbacks( "once memory" ), + progressList = jQuery.Callbacks( "memory" ), + state = "pending", + lists = { + resolve: doneList, + reject: failList, + notify: progressList + }, + promise = { + done: doneList.add, + fail: failList.add, + progress: progressList.add, + + state: function() { + return state; + }, + + // Deprecated + isResolved: doneList.fired, + isRejected: failList.fired, + + then: function( doneCallbacks, failCallbacks, progressCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); + return this; + }, + always: function() { + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + return this; + }, + pipe: function( fnDone, fnFail, fnProgress ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ], + progress: [ fnProgress, "notify" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + obj = promise; + } else { + for ( var key in promise ) { + obj[ key ] = promise[ key ]; + } + } + return obj; + } + }, + deferred = promise.promise({}), + key; + + for ( key in lists ) { + deferred[ key ] = lists[ key ].fire; + deferred[ key + "With" ] = lists[ key ].fireWith; + } + + // Handle state + deferred.done( function() { + state = "resolved"; + }, failList.disable, progressList.lock ).fail( function() { + state = "rejected"; + }, doneList.disable, progressList.lock ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = sliceDeferred.call( arguments, 0 ), + i = 0, + length = args.length, + pValues = new Array( length ), + count = length, + pCount = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(), + promise = deferred.promise(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + deferred.resolveWith( deferred, args ); + } + }; + } + function progressFunc( i ) { + return function( value ) { + pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + deferred.notifyWith( promise, pValues ); + }; + } + if ( length > 1 ) { + for ( ; i < length; i++ ) { + if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return promise; + } +}); + + + + +jQuery.support = (function() { + + var support, + all, + a, + select, + opt, + input, + fragment, + tds, + events, + eventName, + i, + isSupported, + div = document.createElement( "div" ), + documentElement = document.documentElement; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
a"; + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute("href") === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Tests for enctype support on a form(#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true, + pixelMargin: true + }; + + // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead + jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains its value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + + // #11217 - WebKit loses check when the name is after the checked attribute + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.lastChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + fragment.removeChild( input ); + fragment.appendChild( div ); + + // Technique from Juriy Zaytsev + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for ( i in { + submit: 1, + change: 1, + focusin: 1 + }) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + fragment.removeChild( div ); + + // Null elements to avoid leaks in IE + fragment = select = opt = div = input = null; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, outer, inner, table, td, offsetSupport, + marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, + paddingMarginBorderVisibility, paddingMarginBorder, + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + conMarginTop = 1; + paddingMarginBorder = "padding:0;margin:0;border:"; + positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; + paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; + style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; + html = "
" + + "" + + "
"; + + container = document.createElement("div"); + container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; + body.insertBefore( container, body.firstChild ); + + // Construct the test element + div = document.createElement("div"); + container.appendChild( div ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = "
t
"; + tds = div.getElementsByTagName( "td" ); + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE <= 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( window.getComputedStyle ) { + div.innerHTML = ""; + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.style.width = "2px"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + if ( typeof div.style.zoom !== "undefined" ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.innerHTML = ""; + div.style.width = div.style.padding = "1px"; + div.style.border = 0; + div.style.overflow = "hidden"; + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = "block"; + div.style.overflow = "visible"; + div.innerHTML = "
"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); + } + + div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; + div.innerHTML = html; + + outer = div.firstChild; + inner = outer.firstChild; + td = outer.nextSibling.firstChild.firstChild; + + offsetSupport = { + doesNotAddBorder: ( inner.offsetTop !== 5 ), + doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) + }; + + inner.style.position = "fixed"; + inner.style.top = "20px"; + + // safari subtracts parent border width here which is 5px + offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); + inner.style.position = inner.style.top = ""; + + outer.style.overflow = "hidden"; + outer.style.position = "relative"; + + offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); + offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); + + if ( window.getComputedStyle ) { + div.style.marginTop = "1%"; + support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; + } + + if ( typeof container.style.zoom !== "undefined" ) { + container.style.zoom = 1; + } + + body.removeChild( container ); + marginDiv = div = container = null; + + jQuery.extend( support, offsetSupport ); + }); + + return support; +})(); + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var privateCache, thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, + isEvents = name === "events"; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = ++jQuery.uuid; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + privateCache = thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Users should not attempt to inspect the internal events object using jQuery.data, + // it is undocumented and subject to change. But does anyone listen? No. + if ( isEvents && !thisCache[ name ] ) { + return privateCache.events; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + // Reference to internal data cache key + internalKey = jQuery.expando, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ internalKey ] : internalKey; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + // Ensure that `cache` is not a window object #10080 + if ( jQuery.support.deleteExpando || !cache.setInterval ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the cache and need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ internalKey ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + } else { + elem[ internalKey ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var parts, part, attr, name, l, + elem = this[0], + i = 0, + data = null; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + attr = elem.attributes; + for ( l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + parts = key.split( ".", 2 ); + parts[1] = parts[1] ? "." + parts[1] : ""; + part = parts[1] + "!"; + + return jQuery.access( this, function( value ) { + + if ( value === undefined ) { + data = this.triggerHandler( "getData" + part, [ parts[0] ] ); + + // Try to fetch any internally stored data first + if ( data === undefined && elem ) { + data = jQuery.data( elem, key ); + data = dataAttr( elem, key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + } + + parts[1] = value; + this.each(function() { + var self = jQuery( this ); + + self.triggerHandler( "setData" + part, parts ); + jQuery.data( this, key, value ); + self.triggerHandler( "changeData" + part, parts ); + }); + }, null, value, arguments.length > 1, null, false ); + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + jQuery.isNumeric( data ) ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery._data( elem, deferDataKey ); + if ( defer && + ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && + ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery._data( elem, queueDataKey ) && + !jQuery._data( elem, markDataKey ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.fire(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = ( type || "fx" ) + "mark"; + jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); + if ( count ) { + jQuery._data( elem, key, count ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + var q; + if ( elem ) { + type = ( type || "fx" ) + "queue"; + q = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + hooks = {}; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + jQuery._data( elem, type + ".run", hooks ); + fn.call( elem, function() { + jQuery.dequeue( elem, type ); + }, hooks ); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue " + type + ".run", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { + count++; + tmp.add( resolve ); + } + } + resolve(); + return defer.promise( object ); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + nodeHook, boolHook, fixSpecified; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classNames, i, l, elem, className, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + classNames = ( value || "" ).split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + className = (" " + elem.className + " ").replace( rclass, " " ); + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[ c ] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, i, max, option, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + i = one ? index : 0; + max = one ? index + 1 : options.length; + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var propName, attrNames, name, l, isBool, + i = 0; + + if ( value && elem.nodeType === 1 ) { + attrNames = value.toLowerCase().split( rspace ); + l = attrNames.length; + + for ( ; i < l; i++ ) { + name = attrNames[ i ]; + + if ( name ) { + propName = jQuery.propFix[ name ] || name; + isBool = rboolean.test( name ); + + // See #9699 for explanation of this approach (setting first, then removal) + // Do not do this for boolean attributes (see #10870) + if ( !isBool ) { + jQuery.attr( elem, name, "" ); + } + elem.removeAttribute( getSetAttribute ? name : propName ); + + // Set corresponding property to false for boolean attributes + if ( isBool && propName in elem ) { + elem[ propName ] = false; + } + } + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) +jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode, + property = jQuery.prop( elem, name ); + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + fixSpecified = { + name: true, + id: true, + coords: true + }; + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return ( ret.nodeValue = value + "" ); + } + }; + + // Apply the nodeHook to tabindex + jQuery.attrHooks.tabindex.set = nodeHook.set; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + if ( value === "" ) { + value = "false"; + } + nodeHook.set( elem, value, name ); + } + }; +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = "" + value ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); + + + + +var rformElems = /^(?:textarea|input|select)$/i, + rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, + rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, + quickParse = function( selector ) { + var quick = rquickIs.exec( selector ); + if ( quick ) { + // 0 1 2 3 + // [ _, tag, id, class ] + quick[1] = ( quick[1] || "" ).toLowerCase(); + quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); + } + return quick; + }, + quickIs = function( elem, m ) { + var attrs = elem.attributes || {}; + return ( + (!m[1] || elem.nodeName.toLowerCase() === m[1]) && + (!m[2] || (attrs.id || {}).value === m[2]) && + (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) + ); + }, + hoverHack = function( events ) { + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); + }; + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + add: function( elem, types, handler, data, selector ) { + + var elemData, eventHandle, events, + t, tns, type, namespaces, handleObj, + handleObjIn, quick, handlers, special; + + // Don't attach events to noData or text/comment nodes (allow plain objects tho) + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + events = elemData.events; + if ( !events ) { + elemData.events = events = {}; + } + eventHandle = elemData.handle; + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = jQuery.trim( hoverHack(types) ).split( " " ); + for ( t = 0; t < types.length; t++ ) { + + tns = rtypenamespace.exec( types[t] ) || []; + type = tns[1]; + namespaces = ( tns[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: tns[1], + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + quick: selector && quickParse( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + handlers = events[ type ]; + if ( !handlers ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + t, tns, type, origType, namespaces, origCount, + j, events, special, handle, eventType, handleObj; + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = jQuery.trim( hoverHack( types || "" ) ).split(" "); + for ( t = 0; t < types.length; t++ ) { + tns = rtypenamespace.exec( types[t] ) || []; + type = origType = tns[1]; + namespaces = tns[2]; + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector? special.delegateType : special.bindType ) || type; + eventType = events[ type ] || []; + origCount = eventType.length; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + + // Remove matching events + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !namespaces || namespaces.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + eventType.splice( j--, 1 ); + + if ( handleObj.selector ) { + eventType.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( eventType.length === 0 && origCount !== eventType.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery.removeData( elem, [ "events", "handle" ], true ); + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Don't do events on text and comment nodes + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { + return; + } + + // Event object or event type + var type = event.type || event, + namespaces = [], + cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "!" ) >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf( "." ) >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.isTrigger = true; + event.exclusive = exclusive; + event.namespace = namespaces.join( "." ); + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; + + // Handle a global trigger + if ( !elem ) { + + // TODO: Stop taunting the data cache; remove global events and always attach to document + cache = jQuery.cache; + for ( i in cache ) { + if ( cache[ i ].events && cache[ i ].events[ type ] ) { + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); + } + } + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + eventPath = [[ elem, special.bindType || type ]]; + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; + old = null; + for ( ; cur; cur = cur.parentNode ) { + eventPath.push([ cur, bubbleType ]); + old = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( old && old === elem.ownerDocument ) { + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); + } + } + + // Fire handlers on the event path + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { + + cur = eventPath[i][0]; + event.type = eventPath[i][1]; + + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + // Note that this is a bare JS function and not a jQuery handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + // IE<9 dies on focus/blur to hidden element (#1486) + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( old ) { + elem[ ontype ] = old; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event || window.event ); + + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + delegateCount = handlers.delegateCount, + args = [].slice.call( arguments, 0 ), + run_all = !event.exclusive && !event.namespace, + special = jQuery.event.special[ event.type ] || {}, + handlerQueue = [], + i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers that should run if there are delegated events + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && !(event.button && event.type === "click") ) { + + // Pregenerate a single jQuery object for reuse with .is() + jqcur = jQuery(this); + jqcur.context = this.ownerDocument || this; + + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { + + // Don't process events on disabled elements (#6911, #8165) + if ( cur.disabled !== true ) { + selMatch = {}; + matches = []; + jqcur[0] = cur; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + sel = handleObj.selector; + + if ( selMatch[ sel ] === undefined ) { + selMatch[ sel ] = ( + handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) + ); + } + if ( selMatch[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, matches: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( handlers.length > delegateCount ) { + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); + } + + // Run delegates first; they may want to stop propagation beneath us + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { + matched = handlerQueue[ i ]; + event.currentTarget = matched.elem; + + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { + handleObj = matched.matches[ j ]; + + // Triggered event must either 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { + + event.data = handleObj.data; + event.handleObj = handleObj; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = jQuery.Event( originalEvent ); + + for ( i = copy.length; i; ) { + prop = copy[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Target should not be a text node (#504, Safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) + if ( event.metaKey === undefined ) { + event.metaKey = event.ctrlKey; + } + + return fixHook.filter? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady + }, + + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + + focus: { + delegateType: "focusin" + }, + blur: { + delegateType: "focusout" + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +// Some plugins are using, but it's undocumented/deprecated and will be removed. +// The 1.7 special event interface should provide all the hooks needed now. +jQuery.event.handle = jQuery.event.dispatch; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var target = this, + related = event.relatedTarget, + handleObj = event.handleObj, + selector = handleObj.selector, + ret; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !form._submit_attached ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + form._submit_attached = true; + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + jQuery.event.simulate( "change", this, event, true ); + } + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + elem._change_attached = true; + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { // && selector != null + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + var handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( var type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + live: function( types, data, fn ) { + jQuery( this.context ).on( types, this.selector, data, fn ); + return this; + }, + die: function( types, fn ) { + jQuery( this.context ).off( types, this.selector || "**", fn ); + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + expando = "sizcache" + (Math.random() + '').replace('.', ''), + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rReturn = /\r\n/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context, seed ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set, seed ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set, i, len, match, type, left; + + if ( !expr ) { + return []; + } + + for ( i = 0, len = Expr.order.length; i < len; i++ ) { + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + type, found, item, filter, left, + i, pass, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + filter = Expr.filter[ type ]; + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + pass = not ^ found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Utility function for retreiving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +var getText = Sizzle.getText = function( elem ) { + var i, node, + nodeType = elem.nodeType, + ret = ""; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent || innerText for elements + if ( typeof elem.textContent === 'string' ) { + return elem.textContent; + } else if ( typeof elem.innerText === 'string' ) { + // Replace IE's carriage returns + return elem.innerText.replace( rReturn, '' ); + } else { + // Traverse it's children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + } else { + + // If no nodeType, this is expected to be an array + for ( i = 0; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + if ( node.nodeType !== 8 ) { + ret += getText( node ); + } + } + } + return ret; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var first, last, + doneName, parent, cache, + count, diff, + type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + /* falls through */ + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + first = match[2]; + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + doneName = match[0]; + parent = elem.parentNode; + + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { + count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent[ expando ] = doneName; + } + + diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Sizzle.attr ? + Sizzle.attr( elem, name ) : + Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + !type && Sizzle.attr ? + result != null : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} +// Expose origPOS +// "global" as in regardless of relation to brackets/parens +Expr.match.globalPOS = origPOS; + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context, seed ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet, seed ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +Sizzle.selectors.attrMap = {}; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.globalPOS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + POS.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array (deprecated as of jQuery 1.7) + if ( jQuery.isArray( selectors ) ) { + var level = 1; + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( i = 0; i < selectors.length; i++ ) { + + if ( jQuery( cur ).is( selectors[ i ] ) ) { + ret.push({ selector: selectors[ i ], elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call( arguments ).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} + + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /
", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }, + safeFragment = createSafeFragment( document ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and