Bar Chart: How to switch the order of segments

Hey Community,

I am using a bar chart in my app.
Is it possible to change the order of the segments per bar, so that the dark blue elements are below and the bright blue elements are on top.

Thats the code:

data_peryear = {
“Zusätzlicher Bruttoertrag”: [bestand_equity_delta_y1, bestand_equity_delta_y2, bestand_equity_delta_y3, bestand_equity_delta_y4, bestand_equity_delta_y5, bestand_equity_delta_y6, bestand_equity_delta_y7, bestand_equity_delta_y8, bestand_equity_delta_y9, bestand_equity_delta_y10],
“Bruttoertrag V&S - Abwanderung”: [bestand_equity_churn_y1, bestand_equity_churn_y2, bestand_equity_churn_y3, bestand_equity_churn_y4, bestand_equity_churn_y5, bestand_equity_churn_y6, bestand_equity_churn_y7, bestand_equity_churn_y8, bestand_equity_churn_y9, bestand_equity_churn_y10],

st.bar_chart(data=data_peryear, color=[“#002B5E”, “#00AAD2”])

Thanx in advance!

Hi @Florian_Fuchs_RLTN

Perhaps, instead of specifying data, you can directly specify the x and y parameters to the columns of interest.

Hope this helps

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.