Chart elements

Streamlit supports several charting libraries. The simple chart commands, like st.line_chart and st.bar_chart, give you a chart from a dataframe in one line. For more control, use Vega-Lite through Altair, or Apache ECharts for chart types like sankey diagrams, gauges, and network graphs. Streamlit also supports Plotly, Matplotlib, deck.gl maps, and Mermaid and Graphviz diagrams.

star

Tip

Not sure which command to use? See Choosing and using charts.

screenshot

Simple area charts

Display an area chart.

Python
st.area_chart(my_data_frame)
screenshot

Simple bar charts

Display a bar chart.

Python
st.bar_chart(my_data_frame)
screenshot

Simple line charts

Display a line chart.

Python
st.line_chart(my_data_frame)
screenshot

Simple scatter charts

Display a scatter chart.

Python
st.scatter_chart(my_data_frame)
screenshot

Scatterplots on maps

Display a map with points on it.

Python
st.map(my_data_frame)
screenshot

Altair

Display a chart using the Altair library.

Python
st.altair_chart(my_altair_chart)
screenshot

ECharts

Display an interactive Apache ECharts chart, including sankey, gauge, network, and other chart types.

Python
st.echarts_chart(my_echarts_option)
screenshot

Vega-Lite

Display a chart using the Vega-Lite library.

Python
st.vega_lite_chart(my_vega_lite_chart)
screenshot

Plotly

Display an interactive Plotly chart.

Python
st.plotly_chart(my_plotly_chart)
screenshot

PyDeck

Display a chart using the PyDeck library.

Python
st.pydeck_chart(my_pydeck_chart)
screenshot

Mermaid chart

Display a Mermaid diagram.

Python
st.mermaid_chart("graph LR\n  A --> B")
screenshot

GraphViz

Display a graph using the dagre-d3 library.

Python
st.graphviz_chart(my_graphviz_spec)
screenshot

Matplotlib

Display a matplotlib.pyplot figure.

Python
st.pyplot(my_mpl_figure)
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.