apache / apache/echarts

[Feature] Be able to reverse legend order (stacked bar charts)

Open
#20,779 6 comments 0 reactions 0 assignees View on GitHub
en new-feature pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### What problem does this feature solve?

I am replacing dashboard paid for by companies in maintenance and oil/gas industries, who would have charts like below. See how the legend shows lowest to highest values (or increasing severity). The stacked bar shows the highest values at the bottom, as they tend to be more important and fluctuate less.

This is what I am aiming to achieve.

Image

But I can't find a way to do this in echarts. See below for what I've managed to get done. You can see how bad it looks, having the legend ordered that way is counter intuitive.

Image

### What does the proposed API look like?

I think a simple

`order: null | 'reversed'` property on the `legend` property would be enough.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the legend configuration and stacked bar chart behavior described in the issue, using the provided examples to understand the desired ordering. Define the reversed-order behavior for the proposed legend property and verify that both the legend and stacked bars produce the intended result.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.