YUI.add("axis-numeric-base",function(i,t){var h=i.Lang;function e(){}e.NAME="numericImpl",e.ATTRS={alwaysShowZero:{value:!0},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}},roundingMethod:{value:"niceNumber"},scaleType:{value:"linear"}},e.prototype={initializer:function(){this.after("alwaysShowZeroChange",this._keyChangeHandler),this.after("roundingMethodChange",this._keyChangeHandler),this.after("scaleTypeChange",this._keyChangeHandler)},formatLabel:function(t,e){return e?i.DataType.Number.format(t,e):t},getTotalByKey:function(t){for(var e,i=0,a=this.getDataByKey(t),n=0,r=a?a.length:0;n<r;++n)e=parseFloat(a[n]),isNaN(e)||(i+=e);return i},getOrigin:function(){var t=this.get("minimum"),e=this.get("maximum"),t=Math.max(0,t);return Math.min(t,e)},_type:"numeric",_getMinimumUnit:function(t,e,i){return this._getNiceNumber(Math.ceil((t-e)/i))},_getNiceNumber:function(t){var e=t,i=Math.ceil(.4342944819032518*Math.log(e)),a=Math.pow(10,i),e=e<=a/2?a/2-Math.floor((a/2-e)/(Math.pow(10,i-1)/2))*Math.pow(10,i-1)/2:a;return isNaN(e)?t:e},_updateMinAndMax:function(){var t,e,i,a,n=this.get("data"),r=0,o=this.get("setMax"),h=this.get("setMin");if(!o||!h){if(n&&n.length&&0<n.length)for(i=n.length;r<i;r++)a=n[r],isNaN(a)?(t=o?this._setMaximum:t,e=h?this._setMinimum:e):(e=h?this._setMinimum:e===undefined?a:Math.min(a,e),t=o?this._setMaximum:t===undefined?a:Math.max(a,t),this._actualMaximum=t,this._actualMinimum=e);"logarithmic"!==this.get("scaleType")?this._roundMinAndMax(e,t,h,o):(this._dataMaximum=t,this._dataMinimum=e)}},_roundMinAndMax:function(t,e,i,a){var n,r,o,h,s,u=0<=t,M=0<e,m=this.getTotalMajorUnits()-1,l=this.get("alwaysShowZero"),c=this.get("roundingMethod"),d=1<=(e-t)/m;if(c)if("niceNumber"===c)if(n=this._getMinimumUnit(e,t,m),u&&M)(l||t<n)&&!i?n=this._getMinimumUnit(e,t=0,m):t=this._roundDownToNearest(t,n),a?l||(t=e-n*m):e=i?t+n*m:this._roundUpToNearest(e,n);else if(M&&!u)if(l)if(r=Math.round(m/(-1*t/e+1)),o=m-(r=Math.max(Math.min(r,m-1),1)),h=Math.ceil(e/r),s=-1*Math.floor(t/o),i){for(;s<h&&0<=o;)o--,r++,h=Math.ceil(e/r),s=-1*Math.floor(t/o);e=0<o?s*r:t+n*m}else if(a){for(;h<s&&0<=r;)o++,r--,s=-1*Math.floor(t/o),h=Math.ceil(e/r);t=0<r?h*o*-1:e-n*m}else n=Math.max(h,s),e=(n=this._getNiceNumber(n))*r,t=n*o*-1;else a?t=e-n*m:e=i?t+n*m:(t=this._roundDownToNearest(t,n),this._roundUpToNearest(e,n));else i?e=l?0:t+n*m:a?t=e-n*m:l||0===e||0<e+n?t=(e=0)-(n=this._getMinimumUnit(e,t,m))*m:(t=this._roundDownToNearest(t,n),e=this._roundUpToNearest(e,n));else"auto"===c?u&&M?(n=(e-(t=(l||t<(e-t)/m)&&!i?0:t))/m,e=d?t+(n=Math.ceil(n))*m:t+Math.ceil(n*m*1e5)/1e5):M&&!u?l?(r=Math.round(m/(-1*t/e+1)),o=m-(r=Math.max(Math.min(r,m-1),1)),t=d?(h=Math.ceil(e/r),s=-1*Math.floor(t/o),e=(n=Math.max(h,s))*r,n*o*-1):(h=e/r,s=t/o*-1,n=Math.max(h,s),e=Math.ceil(n*r*1e5)/1e5,Math.ceil(n*o*1e5)/1e5*-1)):(n=(e-t)/m,d&&(n=Math.ceil(n)),t=Math.round(1e5*this._roundDownToNearest(t,n))/1e5,e=Math.round(1e5*this._roundUpToNearest(e,n))/1e5):(n=(e-t)/m,d&&(n=Math.ceil(n)),l||0===e||0<e+n?(n=((e=0)-t)/m,t=d?(Math.ceil(n),e-n*m):e-Math.ceil(n*m*1e5)/1e5):(t=this._roundDownToNearest(t,n),e=this._roundUpToNearest(e,n))):!isNaN(c)&&isFinite(c)&&(d=(n=c)*m,c=this._roundDownToNearest(t,n),m=this._roundUpToNearest(e,n),a?t=e-d:i?e=t+d:u&&M?e=(t=l||c<=0?0:c)+d:M&&!u?(t=c,e=m):t=(e=l||0<=m?0:m)-d);this._dataMaximum=e,this._dataMinimum=t},_roundToNearest:function(t,e){e=e||1;t=Math.round(this._roundToPrecision(t/e,10))*e;return this._roundToPrecision(t,10)},_roundUpToNearest:function(t,e){return e=e||1,Math.ceil(this._roundToPrecision(t/e,10))*e},_roundDownToNearest:function(t,e){return e=e||1,Math.floor(this._roundToPrecision(t/e,10))*e},_getCoordFromValue:function(t,e,i,a,n,r){var o;return o=(0,h.isNumber)(a=parseFloat(a))?("logarithmic"===this.get("scaleType")&&0<t&&(t=Math.log(t),e=Math.log(e),a=Math.log(a)),o=(a-t)*(i/(e-t)),r?n-o:n+o):NaN},_roundToPrecision:function(t,e){e=e||0;e=Math.pow(10,e);return Math.round(e*t)/e}},i.NumericImpl=e,i.NumericAxisBase=i.Base.create("numericAxisBase",i.AxisBase,[i.NumericImpl])},"patched-v3.18.7",{requires:["axis-base"]});