douchunrong / flot

Automatically exported from code.google.com/p/flot
0 stars 0 forks source link

Stach charts stack in reverse order from the Labels #529

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Stacked charts appear inverted with reference to the ordering of the labels, 
insofar as which color is "above" another.

The following patch to jquery.flot.stack.js reverses the stacking order to 
match the ordering in the label:

--- a/jquery.flot.stack.js
+++ b/jquery.flot.stack.js
@@ -33,6 +33,7 @@ also adjusted.
     function init(plot) {
         function findMatchingSeries(s, allseries) {
             var res = null
+            allseries.reverse();
             for (var i = 0; i < allseries.length; ++i) {
                 if (s == allseries[i])
                     break;

Original issue reported on code.google.com by mist...@gmail.com on 5 May 2011 at 12:45

GoogleCodeExporter commented 9 years ago

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 9:52