question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reverse stacking order for line charts

See original GitHub issue

What 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pissangcommented, Apr 25, 2021

Hi @Bilge legend.data can be given in any order.

legend: {
  data: ['Positive reviews', 'Negative reviews']
}
1reaction
Oviliacommented, Apr 23, 2021

@Bilge Could you give some pictures on what is expected? By now, I’m a little confused about the expected behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the plotting order of categories, values, or data series
In the Axis Options category, under Axis Options, select the Series in reverse order check box. Top of page. Change the plotting order...
Read more >
Excel Charts - How to reverse the order of data in the chart
Today I will show reverse the order of data in a chart. This movie is a part of my online course Data Visualization...
Read more >
How to Reverse the Order of the Categories in Your Excel ...
How to Reverse the Order of the Categories in Your Excel Charts. 89K views 9 years ago. Ann ...
Read more >
How to reverse order of items in an Excel chart legend?
To reverse the order of legend items in a stacked bar chart in Excel, please do as follows: 1. Right click the chart,...
Read more >
How to reverse the order of a stacked bar chart in Excel - Quora
You can reverse the order of the stacked bar chart in Excel with the following steps; * Right Click on the Axis title...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found