I ran across another small stacked bars issue: When filling the plot, flot adds the legend entries top-down and stacks the bars bottom-up. This way the legend is ordered exactly reverse from the bars.
The flot API allows for sorting the labels in the order they were added, alphabetically, or by providing a custom sorting function. I've tried providing a sorting function that always returns -1, so that the original sorting would be reversed but for some reason the sorted
option seems not to be evaluated at all when using stacked bars. At least nothing I tried there (ascending
, descending
, false
, function of my own) had any effect on the actual legend.
I've put together a test case at http://jsfiddle.net/YvGZu/1/ that illustrates the problem(s).
Edit: After some more testing ... could it be that legend-sorting is broken all together?