Commits

Anonymous committed 5ffd75b

Added some docs.
Gave property correct name on log axis renderer.
Fixed bug in category axis renderer where yaxis or y2axis categories were not rendered correctly.

  • Participants
  • Parent commits af79f6e

Comments (0)

Files changed (3)

File src/jqplot.core.js

         // Wether or not to show minor ticks.  This is renderer dependent.
         // The default <$.jqplot.LinearAxisRenderer> does not have minor ticks.
         this.showMinorTicks = true;
-
+        // minimum and maximum values on the axis.
         this._dataBounds = {min:null, max:null};
-
+        // pixel position from the top left of the min value and max value on the axis.
         this._offsets = {min:null, max:null};
 
         this._plotWidth;

File src/plugins/jqplot.categoryAxisRenderer.js

             var labels = [];
             var numcats = 0;
             var min = 0.5;
-            var max;
+            var max, val;
             for (var i=0; i<this._series.length; i++) {
                 var s = this._series[i];
                 for (var j=0; j<s.data.length; j++) {
-                    var val = s.data[j][0];
+                    if (this.name == 'xaxis' || this.name == 'x2axis') {
+                        val = s.data[j][0];
+                    }
+                    else {
+                        val = s.data[j][1];
+                    }
                     if ($.inArray(val, labels) == -1) {
                         numcats += 1;      
                         labels.push(val);
                     }
-                    // for category axis, force the x values into category bins.
-                    s.data[j][0] = j+1;
+                    // for category axis, force the values into category bins.
+                    if (this.name == 'xaxis' || this.name == 'x2axis') {
+                        s.data[j][0] = j+1;
+                    }
+                    else {
+                        s.data[j][1] = j+1;
+                    }
                 }
             }
         

File src/plugins/jqplot.logAxisRenderer.js

 	*  > {axes:{xaxis:{renderer:$.jqplot.LogAxisRenderer}}}
 	**/	
     $.jqplot.LogAxisRenderer = function() {
-        // prop: seriesDefaults
+        // prop: axisDefaults
         // Default properties which will be applied directly to the series.
         //
         // Group: Properties
         // tickDistribution - 'even' or 'power'.  'even' gives equal pixel
         // spacing of the ticks on the plot.  'power' gives ticks in powers
         // of 10.
-        this.seriesDefaults = {
+        this.axisDefaults = {
             base : 10,
             tickDistribution :'even'
         };
     
     $.jqplot.LogAxisRenderer.prototype.init = function(options) {
         $.extend(true, this.renderer, options);
-        for (var d in this.renderer.seriesDefaults) {
-            if (this[d] == null) this[d] = this.renderer.seriesDefaults[d];
+        for (var d in this.renderer.axisDefaults) {
+            if (this[d] == null) this[d] = this.renderer.axisDefaults[d];
         }
         var db = this._dataBounds;
         // Go through all the series attached to this axis and find