Commit 51e14f6a authored by David Schnur's avatar David Schnur

Added a 'reverse' sorted option.

This orders the legend entries in reverse order of their series.
parent 410dd7db
...@@ -2315,6 +2315,8 @@ Licensed under the MIT license. ...@@ -2315,6 +2315,8 @@ Licensed under the MIT license.
if (options.legend.sorted) { if (options.legend.sorted) {
if ($.isFunction(options.legend.sorted)) { if ($.isFunction(options.legend.sorted)) {
entries.sort(options.legend.sorted); entries.sort(options.legend.sorted);
} else if (options.legend.sorted == "reverse") {
entries.reverse();
} else { } else {
var ascending = options.legend.sorted != "descending"; var ascending = options.legend.sorted != "descending";
entries.sort(function(a, b) { entries.sort(function(a, b) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment