How to graph a Grouped Bar Chart on streamlit?

How can I group the bars side by side? I have a dataframe of actual and predicted prices as the columns, when I plot using: st.bar_chart(data), it stacks the first column on the second thereby making it difficult for comparing.

Can you provide a screeshot ?

Hi @AnefuIII -

Please note that st.bar_chart is a convenience function, which often can do what you want but sometimes doesn’t. st.bar_chart is a wrapper around st.altair_chart, and when you need more control over the functionality, you can use Altair to do exactly what you want…here’s an example:

After the chart is created, you would do st.altair_chart(chart).

Best,
Randy

1 Like

This worked. thank you

1 Like

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