Skip to content

[Feature] Sort bar chart by series weight #19596

@AntidotUser

Description

@AntidotUser

What problem does this feature solve?

Version
5.4.3

Link to minimal reproduction
No response

Steps To Reproduce
When drawing stacked bar graph in echarts the series in each stacked bar are sorted randomly.

Current Behavior

weird order

Stacked bars are sorted incorrectly.

Expected Behavior
The series in each bar should be sorted with the highest (at the left / bottom) to the lowest (at the right / top) based on the value of the series.
Please take into account vertical and horizontal bar charts.
On the example above, on the right bar the blue series should be between the yellow and the red ones

Here is a dos and don'ts image:

dosdonts

Environment

- OS:
- Browser:
- Framework:

Any additional comments?
Any configurations/options in echarts that can be done to achieve this would be helpful.

What does the proposed API look like?

Ideally, a "sort" boolean parameter on the "xAxis" and "yAxis" options should be enough, which default value would be "false" in order not to break anything already existing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishnew-featurependingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions