Is there any way to force the items (the data points that are stacked and shown in the legend) in a stacked chart to be in a custom order? Right now it looks like the items are sorted alphabetically but I need them to be in a different order. I couldn't find any way to do this. I also am not sure what term to use to describe the items in the legend for me to do a thorough search.
8 Answers, 1 is accepted
By design the legend items' order matches the series' order and presently this behavior cannot be changed. Please excuse us for the inconvenience caused.
Thanks for the response. How do I change the series order? I couldn't figure out how to do that, if it is even possible.
I'm still a little fuzzy about the terminology as well. Especially in the case of stacked charts. I thought the series would be the full bars and this does seems to display in the order that the DataSource reports them in. But the stacked sections appear to be in alphabetical order and the DataSource is NOT reporting them this order. It looks to me like something in the Charting code is sorting these internally.
The series will be ordered depending on their definition order. I.e. the first series in the Chart's configuration will be at the most bottom of the stack.
Regarding the terminology - series are separate parts of the stack, not the full bars (it is the same as in case they are not stacked).
I am not quite sure if I understand you correctly. Are you using a grouped chart (like in this online demo)? If yes - the series are not sorted by default. Could you please provide a simple runnable example which demonstrates your current implementation and which I can test locally? This way I would be able to advice you further and provide concrete recommendations. Thank you in advance for your time and cooperation.
When I try to accomplish this using the sort methods on the datasource it sorts the individual data elements, not the grouped series.
I want to order of the displayed series (which are groups). Is there a way to accomplish this?
Instead of this...
... do this: