Display a chart using the Vega-Lite library.
Function signature

st.vega_lite_chart(data=None, spec=None, use_container_width=False, **kwargs)


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

or None Either the data to be plotted or a Vega-Lite spec containing the data (which more closely follows the Vega-Lite API).

spec (dict or None)

The Vega-Lite spec for the chart. If the spec was already passed in the previous argument, this must be set to None. See https://vega.github.io/vega-lite/docs/ for more info.

use_container_width (bool)

If True, set the chart width to the column width. This takes precedence over Vega-Lite's native width value.

**kwargs (any)

Same as spec, but as keywords.

Was this page helpful?

editSuggest edits

Still have questions?

Our forums are full of helpful information and Streamlit experts.