0

So I'm using Highcharts and I have a stacked bar chart to display some data like so: Image

As you see the columns, their values are all different. What I want to do is have the lowest value at the bottom, the 2nd lowest above that, and the third lowest above that. The line chart is fine.

There are four series in this chart, one for each color you see. And each series has a data array of 7 element, that represents each of the columns.

So how exactly can I group and sort these series and data arrays such that the lowest is always on the bottom? Because as it looks the order of the 4 series determines the order of the columns.

Oscar McCullough
  • 365
  • 4
  • 17
  • 2
    I'm not sure if you are trying to group the series within each bar from lowest to highest value, or trying to group the aggregate stacked bars from lowest aggregate to highest aggregate value. If it's the latter, it's just a matter of making sure they are entered in the correct order to the series array. That being said, seems like a duplicate of this. http://stackoverflow.com/questions/19121637/how-to-sort-the-items-within-each-stacking-column – user2263572 Nov 20 '15 at 21:42
  • It's the former, and according to that question, it's not possible. Thanks! – Oscar McCullough Nov 23 '15 at 19:26
  • @OscarMcCullough Unfortunately there is no such default option that would enable this kind of behavior. You could separate all (worst case scenario) data points into separate series, because sequence can be set only for series and then compare values to establish order. Other option could be to sort data, so in first series you allways have biggest values, etc. and then set color for each point and disable legendItemClick, because series will be different that presented data. – Kacper Madej Nov 26 '15 at 17:00

0 Answers0