Reverse stacking order for line charts
See original GitHub issueWhat problem does this feature solve?
The stacking order of a stacked line chart is determined by the order in which the series are defined. However, this definition order also determines the order of other components, such as the legend, tooltip and dataset. When one wants to reverse the stacking order, currently the only option is to redefine the order the series are defined in. Unfortunately, this implies the order show in the legend and tooltip may be the reverse of what we want. Generally, redefining the series order may adversely impact other components and feels like the wrong approach to redeclare the data to suit the presentation.
It is worth noting the tooltip can work around this because it has an order: 'seriesDesc'
option, and also custom formatting option, but the legend does not. Again, in general it feels like the wrong approach to design every component to be “reversible”, when this is just a presentation problem.
What does the proposed API look like?
It would probably be best if there was simply an option to draw the stacked series in reverse order so all the other components will continue to work as normal.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top GitHub Comments
Hi @Bilge
legend.data
can be given in any order.@Bilge Could you give some pictures on what is expected? By now, I’m a little confused about the expected behavior.