Issue #375 resolved

categoryAxisRenderer sortMergedLabels does not sort string labels

Anonymous created an issue

The given sorting function does not seem to work with strings: https://bitbucket.org/cleonello/jqplot/src/5bc2d7c829ba/src/plugins/jqplot.categoryAxisRenderer.js#cl-212

a simple .sort() instead does a better job.

I changed it to the following, but there might be better solutions:

{{{

!JavaScript

if (isMerged && this.sortMergedLabels) { if (typeof labels[0] == "string") { labels.sort(); } else { labels.sort(function(a,b) { return a - b; }); } } }}}

Comments (2)

  1. Log in to comment