Skip to content

How to sort stacked bar chart in descending order? #3388

Answered by d-trigo
levinaanora asked this question in Q&A
Discussion options

You must be logged in to vote

So not entirely sure about the underlying causes of how it occurred, but I think there was a conflict between the two datasets created (the first one being the per-variant sales per-country and the other being the all-variant sales per country) where Altair got confused when merging them for the image output in terms of getting the sorting; running the chart and text graphs separately the countries do appear in descending order in either case, but the incorrect sorting order only occurs when you combine the graph and text elements into one. Assuming I'm interpreting your request to get the countries sorted by their Total Units in descending order, I used this in order to see if I could ge…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@levinaanora
Comment options

@levinaanora
Comment options

@d-trigo
Comment options

@levinaanora
Comment options

Answer selected by levinaanora
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants