Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build files for gallery-patch-350-charts-numericaxis

  • Loading branch information...
commit d958fa9f53166bf93a8b42d8023a76b385ce3a30 1 parent cd8edc1
@tripp authored
View
287 build/gallery-patch-350-charts-numericaxis/gallery-patch-350-charts-numericaxis-debug.js
@@ -0,0 +1,287 @@
+YUI.add('gallery-patch-350-charts-numericaxis', function(Y) {
+
+ Y.NumericAxis.prototype._roundMinAndMax = function(min, max, setMin, setMax)
+ {
+ var roundingUnit,
+ minimumRange,
+ minGreaterThanZero = min >= 0,
+ maxGreaterThanZero = max > 0,
+ dataRangeGreater,
+ maxRound,
+ minRound,
+ topTicks,
+ botTicks,
+ tempMax,
+ tempMin,
+ units = this.getTotalMajorUnits() - 1,
+ alwaysShowZero = this.get("alwaysShowZero"),
+ roundingMethod = this.get("roundingMethod"),
+ useIntegers = (max - min)/units >= 1;
+ if(roundingMethod)
+ {
+ if(roundingMethod == "niceNumber")
+ {
+ roundingUnit = this._getMinimumUnit(max, min, units);
+ if(minGreaterThanZero && maxGreaterThanZero)
+ {
+ if((alwaysShowZero || min < roundingUnit) && !setMin)
+ {
+ min = 0;
+ roundingUnit = this._getMinimumUnit(max, min, units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ }
+ if(setMax)
+ {
+ if(!alwaysShowZero)
+ {
+ min = max - (roundingUnit * units);
+ }
+ }
+ else if(setMin)
+ {
+ max = min + (roundingUnit * units);
+ }
+ else
+ {
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ else if(maxGreaterThanZero && !minGreaterThanZero)
+ {
+ if(alwaysShowZero)
+ {
+ topTicks = Math.round(units/((-1 * min)/max + 1));
+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);
+ botTicks = units - topTicks;
+ tempMax = Math.ceil( max/topTicks );
+ tempMin = Math.floor( min/botTicks ) * -1;
+
+ if(setMin)
+ {
+ while(tempMin < tempMax && botTicks >= 0)
+ {
+ botTicks--;
+ topTicks++;
+ tempMax = Math.ceil( max/topTicks );
+ tempMin = Math.floor( min/botTicks ) * -1;
+ }
+ //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value
+ //if not, it's impossible to ensure that a zero is shown. skip it
+ if(botTicks > 0)
+ {
+ max = tempMin * topTicks;
+ }
+ else
+ {
+ max = min + (roundingUnit * units);
+ }
+ }
+ else if(setMax)
+ {
+ while(tempMax < tempMin && topTicks >= 0)
+ {
+ botTicks++;
+ topTicks--;
+ tempMin = Math.floor( min/botTicks ) * -1;
+ tempMax = Math.ceil( max/topTicks );
+ }
+ //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value
+ //if not, it's impossible to ensure that a zero is shown. skip it
+ if(topTicks > 0)
+ {
+ min = tempMax * botTicks * -1;
+ }
+ else
+ {
+ min = max - (roundingUnit * units);
+ }
+ }
+ else
+ {
+ roundingUnit = Math.max(tempMax, tempMin);
+ roundingUnit = this._getNiceNumber(roundingUnit);
+ max = roundingUnit * topTicks;
+ min = roundingUnit * botTicks * -1;
+ }
+ }
+ else
+ {
+ if(setMax)
+ {
+ min = max - (roundingUnit * units);
+ }
+ else if(setMin)
+ {
+ max = min + (roundingUnit * units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ }
+ else
+ {
+ if(setMin)
+ {
+ if(alwaysShowZero)
+ {
+ max = 0;
+ }
+ else
+ {
+ max = min + (roundingUnit * units);
+ }
+ }
+ else if(!setMax)
+ {
+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)
+ {
+ max = 0;
+ roundingUnit = this._getMinimumUnit(max, min, units);
+ min = max - (roundingUnit * units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ else
+ {
+ min = max - (roundingUnit * units);
+ }
+ }
+ }
+ else if(roundingMethod == "auto")
+ {
+ if(minGreaterThanZero && maxGreaterThanZero)
+ {
+ if((alwaysShowZero || min < (max-min)/units) && !setMin)
+ {
+ min = 0;
+ }
+
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ roundingUnit = Math.ceil(roundingUnit);
+ }
+ max = min + (roundingUnit * units);
+ }
+ else if(maxGreaterThanZero && !minGreaterThanZero)
+ {
+ if(alwaysShowZero)
+ {
+ topTicks = Math.round( units / ( (-1 * min) /max + 1) );
+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);
+ botTicks = units - topTicks;
+
+ if(useIntegers)
+ {
+ tempMax = Math.ceil( max/topTicks );
+ tempMin = Math.floor( min/botTicks ) * -1;
+ }
+ else
+ {
+ tempMax = max/topTicks;
+ tempMin = min/botTicks * -1;
+ }
+ roundingUnit = Math.max(tempMax, tempMin);
+ max = roundingUnit * topTicks;
+ min = roundingUnit * botTicks * -1;
+ }
+ else
+ {
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ roundingUnit = Math.ceil(roundingUnit);
+ }
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ else
+ {
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ roundingUnit = Math.ceil(roundingUnit);
+ }
+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)
+ {
+ max = 0;
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ Math.ceil(roundingUnit);
+ }
+ min = max - (roundingUnit * units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+
+ }
+ }
+ else if(!isNaN(roundingMethod) && isFinite(roundingMethod))
+ {
+ roundingUnit = roundingMethod;
+ minimumRange = roundingUnit * units;
+ dataRangeGreater = (max - min) > minimumRange;
+ minRound = this._roundDownToNearest(min, roundingUnit);
+ maxRound = this._roundUpToNearest(max, roundingUnit);
+ if(setMax)
+ {
+ min = max - minimumRange;
+ }
+ else if(setMin)
+ {
+ max = min + minimumRange;
+ }
+ else if(minGreaterThanZero && maxGreaterThanZero)
+ {
+ if(alwaysShowZero || minRound <= 0)
+ {
+ min = 0;
+ }
+ else
+ {
+ min = minRound;
+ }
+ max = min + minimumRange;
+ }
+ else if(maxGreaterThanZero && !minGreaterThanZero)
+ {
+ min = minRound;
+ max = maxRound;
+ }
+ else
+ {
+ if(alwaysShowZero || maxRound >= 0)
+ {
+ max = 0;
+ }
+ else
+ {
+ max = maxRound;
+ }
+ min = max - minimumRange;
+ }
+ }
+ }
+ this._dataMaximum = max;
+ this._dataMinimum = min;
+ };
+
+
+
+
+}, '@VERSION@' ,{skinnable:false, requires:['charts-base']});
View
1  build/gallery-patch-350-charts-numericaxis/gallery-patch-350-charts-numericaxis-min.js
@@ -0,0 +1 @@
+YUI.add("gallery-patch-350-charts-numericaxis",function(a){a.NumericAxis.prototype._roundMinAndMax=function(h,k,i,n){var c,t,q=h>=0,e=k>0,s,b,p,j,l,r,o,g=this.getTotalMajorUnits()-1,m=this.get("alwaysShowZero"),d=this.get("roundingMethod"),f=(k-h)/g>=1;if(d){if(d=="niceNumber"){c=this._getMinimumUnit(k,h,g);if(q&&e){if((m||h<c)&&!i){h=0;c=this._getMinimumUnit(k,h,g);}else{h=this._roundDownToNearest(h,c);}if(n){if(!m){h=k-(c*g);}}else{if(i){k=h+(c*g);}else{k=this._roundUpToNearest(k,c);}}}else{if(e&&!q){if(m){j=Math.round(g/((-1*h)/k+1));j=Math.max(Math.min(j,g-1),1);l=g-j;r=Math.ceil(k/j);o=Math.floor(h/l)*-1;if(i){while(o<r&&l>=0){l--;j++;r=Math.ceil(k/j);o=Math.floor(h/l)*-1;}if(l>0){k=o*j;}else{k=h+(c*g);}}else{if(n){while(r<o&&j>=0){l++;j--;o=Math.floor(h/l)*-1;r=Math.ceil(k/j);}if(j>0){h=r*l*-1;}else{h=k-(c*g);}}else{c=Math.max(r,o);c=this._getNiceNumber(c);k=c*j;h=c*l*-1;}}}else{if(n){h=k-(c*g);}else{if(i){k=h+(c*g);}else{h=this._roundDownToNearest(h,c);k=this._roundUpToNearest(k,c);}}}}else{if(i){if(m){k=0;}else{k=h+(c*g);}}else{if(!n){if(m||k===0||k+c>0){k=0;c=this._getMinimumUnit(k,h,g);h=k-(c*g);}else{h=this._roundDownToNearest(h,c);k=this._roundUpToNearest(k,c);}}else{h=k-(c*g);}}}}}else{if(d=="auto"){if(q&&e){if((m||h<(k-h)/g)&&!i){h=0;}c=(k-h)/g;if(f){c=Math.ceil(c);}k=h+(c*g);}else{if(e&&!q){if(m){j=Math.round(g/((-1*h)/k+1));j=Math.max(Math.min(j,g-1),1);l=g-j;if(f){r=Math.ceil(k/j);o=Math.floor(h/l)*-1;}else{r=k/j;o=h/l*-1;}c=Math.max(r,o);k=c*j;h=c*l*-1;}else{c=(k-h)/g;if(f){c=Math.ceil(c);}h=this._roundDownToNearest(h,c);k=this._roundUpToNearest(k,c);}}else{c=(k-h)/g;if(f){c=Math.ceil(c);}if(m||k===0||k+c>0){k=0;c=(k-h)/g;if(f){Math.ceil(c);}h=k-(c*g);}else{h=this._roundDownToNearest(h,c);k=this._roundUpToNearest(k,c);}}}}else{if(!isNaN(d)&&isFinite(d)){c=d;t=c*g;s=(k-h)>t;p=this._roundDownToNearest(h,c);b=this._roundUpToNearest(k,c);if(n){h=k-t;}else{if(i){k=h+t;}else{if(q&&e){if(m||p<=0){h=0;}else{h=p;}k=h+t;}else{if(e&&!q){h=p;k=b;}else{if(m||b>=0){k=0;}else{k=b;}h=k-t;}}}}}}}}this._dataMaximum=k;this._dataMinimum=h;};},"@VERSION@",{skinnable:false,requires:["charts-base"]});
View
287 build/gallery-patch-350-charts-numericaxis/gallery-patch-350-charts-numericaxis.js
@@ -0,0 +1,287 @@
+YUI.add('gallery-patch-350-charts-numericaxis', function(Y) {
+
+ Y.NumericAxis.prototype._roundMinAndMax = function(min, max, setMin, setMax)
+ {
+ var roundingUnit,
+ minimumRange,
+ minGreaterThanZero = min >= 0,
+ maxGreaterThanZero = max > 0,
+ dataRangeGreater,
+ maxRound,
+ minRound,
+ topTicks,
+ botTicks,
+ tempMax,
+ tempMin,
+ units = this.getTotalMajorUnits() - 1,
+ alwaysShowZero = this.get("alwaysShowZero"),
+ roundingMethod = this.get("roundingMethod"),
+ useIntegers = (max - min)/units >= 1;
+ if(roundingMethod)
+ {
+ if(roundingMethod == "niceNumber")
+ {
+ roundingUnit = this._getMinimumUnit(max, min, units);
+ if(minGreaterThanZero && maxGreaterThanZero)
+ {
+ if((alwaysShowZero || min < roundingUnit) && !setMin)
+ {
+ min = 0;
+ roundingUnit = this._getMinimumUnit(max, min, units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ }
+ if(setMax)
+ {
+ if(!alwaysShowZero)
+ {
+ min = max - (roundingUnit * units);
+ }
+ }
+ else if(setMin)
+ {
+ max = min + (roundingUnit * units);
+ }
+ else
+ {
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ else if(maxGreaterThanZero && !minGreaterThanZero)
+ {
+ if(alwaysShowZero)
+ {
+ topTicks = Math.round(units/((-1 * min)/max + 1));
+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);
+ botTicks = units - topTicks;
+ tempMax = Math.ceil( max/topTicks );
+ tempMin = Math.floor( min/botTicks ) * -1;
+
+ if(setMin)
+ {
+ while(tempMin < tempMax && botTicks >= 0)
+ {
+ botTicks--;
+ topTicks++;
+ tempMax = Math.ceil( max/topTicks );
+ tempMin = Math.floor( min/botTicks ) * -1;
+ }
+ //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value
+ //if not, it's impossible to ensure that a zero is shown. skip it
+ if(botTicks > 0)
+ {
+ max = tempMin * topTicks;
+ }
+ else
+ {
+ max = min + (roundingUnit * units);
+ }
+ }
+ else if(setMax)
+ {
+ while(tempMax < tempMin && topTicks >= 0)
+ {
+ botTicks++;
+ topTicks--;
+ tempMin = Math.floor( min/botTicks ) * -1;
+ tempMax = Math.ceil( max/topTicks );
+ }
+ //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value
+ //if not, it's impossible to ensure that a zero is shown. skip it
+ if(topTicks > 0)
+ {
+ min = tempMax * botTicks * -1;
+ }
+ else
+ {
+ min = max - (roundingUnit * units);
+ }
+ }
+ else
+ {
+ roundingUnit = Math.max(tempMax, tempMin);
+ roundingUnit = this._getNiceNumber(roundingUnit);
+ max = roundingUnit * topTicks;
+ min = roundingUnit * botTicks * -1;
+ }
+ }
+ else
+ {
+ if(setMax)
+ {
+ min = max - (roundingUnit * units);
+ }
+ else if(setMin)
+ {
+ max = min + (roundingUnit * units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ }
+ else
+ {
+ if(setMin)
+ {
+ if(alwaysShowZero)
+ {
+ max = 0;
+ }
+ else
+ {
+ max = min + (roundingUnit * units);
+ }
+ }
+ else if(!setMax)
+ {
+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)
+ {
+ max = 0;
+ roundingUnit = this._getMinimumUnit(max, min, units);
+ min = max - (roundingUnit * units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ else
+ {
+ min = max - (roundingUnit * units);
+ }
+ }
+ }
+ else if(roundingMethod == "auto")
+ {
+ if(minGreaterThanZero && maxGreaterThanZero)
+ {
+ if((alwaysShowZero || min < (max-min)/units) && !setMin)
+ {
+ min = 0;
+ }
+
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ roundingUnit = Math.ceil(roundingUnit);
+ }
+ max = min + (roundingUnit * units);
+ }
+ else if(maxGreaterThanZero && !minGreaterThanZero)
+ {
+ if(alwaysShowZero)
+ {
+ topTicks = Math.round( units / ( (-1 * min) /max + 1) );
+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);
+ botTicks = units - topTicks;
+
+ if(useIntegers)
+ {
+ tempMax = Math.ceil( max/topTicks );
+ tempMin = Math.floor( min/botTicks ) * -1;
+ }
+ else
+ {
+ tempMax = max/topTicks;
+ tempMin = min/botTicks * -1;
+ }
+ roundingUnit = Math.max(tempMax, tempMin);
+ max = roundingUnit * topTicks;
+ min = roundingUnit * botTicks * -1;
+ }
+ else
+ {
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ roundingUnit = Math.ceil(roundingUnit);
+ }
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+ }
+ else
+ {
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ roundingUnit = Math.ceil(roundingUnit);
+ }
+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)
+ {
+ max = 0;
+ roundingUnit = (max - min)/units;
+ if(useIntegers)
+ {
+ Math.ceil(roundingUnit);
+ }
+ min = max - (roundingUnit * units);
+ }
+ else
+ {
+ min = this._roundDownToNearest(min, roundingUnit);
+ max = this._roundUpToNearest(max, roundingUnit);
+ }
+
+ }
+ }
+ else if(!isNaN(roundingMethod) && isFinite(roundingMethod))
+ {
+ roundingUnit = roundingMethod;
+ minimumRange = roundingUnit * units;
+ dataRangeGreater = (max - min) > minimumRange;
+ minRound = this._roundDownToNearest(min, roundingUnit);
+ maxRound = this._roundUpToNearest(max, roundingUnit);
+ if(setMax)
+ {
+ min = max - minimumRange;
+ }
+ else if(setMin)
+ {
+ max = min + minimumRange;
+ }
+ else if(minGreaterThanZero && maxGreaterThanZero)
+ {
+ if(alwaysShowZero || minRound <= 0)
+ {
+ min = 0;
+ }
+ else
+ {
+ min = minRound;
+ }
+ max = min + minimumRange;
+ }
+ else if(maxGreaterThanZero && !minGreaterThanZero)
+ {
+ min = minRound;
+ max = maxRound;
+ }
+ else
+ {
+ if(alwaysShowZero || maxRound >= 0)
+ {
+ max = 0;
+ }
+ else
+ {
+ max = maxRound;
+ }
+ min = max - minimumRange;
+ }
+ }
+ }
+ this._dataMaximum = max;
+ this._dataMinimum = min;
+ };
+
+
+
+
+}, '@VERSION@' ,{skinnable:false, requires:['charts-base']});
Please sign in to comment.
Something went wrong with that request. Please try again.