Display a line chart.

This is syntax-sugar around st.altair_chart. The main difference is this command uses the data's own column and indices to figure out the chart's spec. As a result this is easier to use for many "just plot this" scenarios, while being less customizable.

If st.line_chart does not guess the data specification correctly, try specifying your desired chart using st.altair_chart.

Function signature

st.line_chart(data=None, width=0, height=0, use_container_width=True)

Parameters

data (pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict)

or None Data to be plotted.

width (int)

The chart width in pixels. If 0, selects the width automatically.

height (int)

The chart width in pixels. If 0, selects the height automatically.

use_container_width (bool)

If True, set the chart width to the column width. This takes precedence over the width argument.

Was this page helpful?

editSuggest edits
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.