Commits

Chris Leonello committed 04af39d

Some clean up minor refactoring.

Comments (0)

Files changed (2)

src/jqplot.core.js

         var db = this._dataBounds;
         db.min = null;
         db.max = null;
+        var l, s, d;
         // check for when to force min 0 on bar series plots.
         var doforce = (this.show) ? true : false;
         for (var i=0; i<this._series.length; i++) {
-            var s = this._series[i];
-            var d = s._plotData;
-            if (s._type === 'line' && s.renderer.bands.show && this.name !== 'xaxis' && this.name !== 'x2axis') {
+            s = this._series[i];
+            d = s._plotData;
+            l = d.length;
+            if (s._type === 'line' && s.renderer.bands.show && this.name.charAt(0) !== 'x') {
                 d = [[0, s.renderer.bands._min], [1, s.renderer.bands._max]];
             }
 
                 maxyidx = 2;
             }
             
-            for (var j=0; j<d.length; j++) { 
+            for (var j=0; j<l; j++) { 
                 if (this.name == 'xaxis' || this.name == 'x2axis') {
                     if ((d[j][0] != null && d[j][0] < db.min) || db.min == null) {
                         db.min = d[j][0];

src/jqplot.linearTickGenerator.js

     // returned is an array containing [min, max, nTicks, format]
     $.jqplot.LinearTickGenerator = function(axis_min, axis_max, scalefact) {
         // if endpoints are equal try to include zero otherwise include one
-        if (axis_min == axis_max) {
-        axis_max = (axis_max) ? 0 : 1;
+        if (axis_min === axis_max) {
+            axis_max = (axis_max) ? 0 : 1;
         }
 
         scalefact = scalefact || 1.0;
 
         // make sure range is positive
         if (axis_max < axis_min) {
-        var a = axis_max;
-        axis_max = axis_min;
-        axis_min = a;
+            var a = axis_max;
+            axis_max = axis_min;
+            axis_min = a;
         }
 
         var ss = bestLinearInterval(axis_max - axis_min, scalefact);
         return r;
     };
 
+    $.jqplot.LinearTickGenerator.bestLinearInterval = bestLinearInterval;
+
 })(jQuery);