Altair Chart not supported in streamlit for inline slider

i am trying to replicate example mentioned in : US Population Pyramid Over Time β€” Altair 4.1.0 documentation

it works fine in jupyter but breaks down in streamlit.
Can someone please guide me, how can i run it in streamlit.

Basically the inline slider embedded in altair does not result in realtime chart refresh as expected.

Hi @Sumit_Pandey, welcome to the Streamlit community!! :wave: :partying_face:

To get your linked example to work, all you need to do is wrap the last line with st.altair_chart(), like so:

st.altair_chart(alt.concat(left, middle, right, spacing=5), use_container_width=True)

Output:

altair-slider

Happy Streamlit’ing! :balloon:
Snehan

1 Like