Scale y-axis

How to define upper and lower bound of y-axis in st.line_chart function?

my python script is here.

Hi @kaizhang, welcome to the Streamlit community!

st.line_chart is a convenience wrapper around st.altair_chart, so that you can quickly get something created. If you need more customization options, you should use st.altair_chart or another visualization library to customize your chart:

st.altair_chart docs: API reference — Streamlit 0.75.0 documentation
Altair docs: https://altair-viz.github.io/

Best,
Randy

@kaizhang : Here is the specific documentation on how to set axis limits in Altair.

Once you jump from st.line_chart to st.altair_chart you find an incredible wealth of customization options. Altair is truly an amazing visualization library (it’s a front-end for D3) and it’s capable of creating stunningly beautiful charts! :slight_smile:

1 Like