Skip to content

How to sort stacked bar chart for total value (length of stacked bar) #16158

@ChamilaLiyanage

Description

@ChamilaLiyanage

Version

5.2.2

Link to minimal reproduction

No response

Steps To Reproduce

When drawing stacked bar graph in echarts it is not possible to sort the axis based on total value (length of stacked bar). The data set is already sorted according the total value before given to echart options. This works when it is not stacked (with single series) but once stacked the sorting is not proper. How can the bars be sorted for the total value based on the length of total of stacked bar?

chart json attached.

chart-json.txt

Current Behavior

image

Stacked bars are sorted incorrectly.

Expected Behavior

The bars should be sorted with the highest to the lowest based on the total of the stack.
Once the legend is clicked and some values are hidden, still the sorting should be applicable.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in EnglishstaleInactive for a long time. Will be closed in 7 days.supportwaiting-for: author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions