Commits

Paul Pritchard committed 4a1fc41

Fix #375 - sortMergedLabels does not sort string labels

  • Participants
  • Parent commits f7cd4d6

Comments (0)

Files changed (1)

File src/plugins/jqplot.categoryAxisRenderer.js

             }
             
             if (isMerged && this.sortMergedLabels) {
-                labels.sort(function(a,b) { return a - b; });
+                if (typeof labels[0] == "string") {
+                    labels.sort();
+                } else {
+                    labels.sort(function(a,b) { return a - b; });
+                }
             }
             
             // keep a reference to these tick labels to use for redrawing plot (see bug #57)
         var offmin = offsets.min;
         var lshow = (this._label == null) ? false : this._label.show;
         var i;
-		
+
         for (var p in pos) {
             this._elem.css(p, pos[p]);
         }