Registry / web-framework / streamlit-echarts

streamlit-echarts

JSON →
library0.7.0pypypiunverified

Streamlit ECharts is a Streamlit component that enables the display of highly interactive ECharts visualizations directly within Streamlit applications. The library is actively maintained, with its latest version being 0.6.0, and has a cadence of several major releases per year, often introducing significant updates and breaking changes.

pip install streamlit-echarts
INSTALL
IMPORT
SIG · STREAMLIT-ECHARTS
S
streamlit-echarts
web-frameworkpythonv0.7.0
Install
16.1s avg
Import
1219ms
Disk
445MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.318s · 456.9MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 16.1s · import 0.170s · 426MB
445MB installed
● package 445MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

st_echarts
from streamlit_echarts import st_echarts
from streamlit_echarts import st_echarts

This quickstart demonstrates how to render a basic ECharts bar chart using `st_echarts`. It also shows how to use the `key` parameter for stable component identity and `on_select='rerun'` for basic interactivity, capturing selection events in the Streamlit app state. An optional commented section illustrates usage with PyEcharts, which requires an extra installation.

import streamlit as st from streamlit_echarts import st_echarts import json # For PyEcharts conversion # import pyecharts.options as opts # Optional: if using pyecharts # from pyecharts.charts import Bar # Optional: if using pyecharts st.set_page_config(layout='wide') st.title('Streamlit ECharts Basic Bar Chart') # ECharts option as a Python dictionary options = { 'xAxis': { 'type': 'category', 'data': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, 'yAxis': { 'type': 'value' }, 'series': [{ 'data': [820, 932, 901, 934, 1290, 1330, 1320], 'type': 'bar' }] } st.header('Basic ECharts Bar Chart') result = st_echarts( options=options, height='400px', key='basic_bar_chart', # Essential for stable animations/interactions on_select='rerun' # Example: trigger rerun on selection ) if result and result.get('selection'): st.write(f"Selected data point: {result['selection']}") # Example with PyEcharts (requires `pip install streamlit-echarts[pyecharts]`) # if st.checkbox("Show PyEcharts Example (requires pyecharts extra)"): # b = ( # Bar() # .add_xaxis(["Microsoft", "Amazon", "IBM", "Oracle", "Google"]) # .add_yaxis("2018 Revenue (billion $)", [21.2, 20.4, 10.3, 6.08, 4]) # .set_global_opts( # title_opts=opts.TitleOpts(title="Top Cloud Providers", subtitle="2018 Revenue") # ) # ) # st.header('PyEcharts Bar Chart (via st_pyecharts)') # st_pyecharts(b, height="400px", key='pyecharts_chart')
Debug
Known issues
breakingVersion 0.5.0 migrated to Streamlit Components v2 API, which might require adjustments in advanced component interactions or custom event handling.
fix
Review your component interactions and event callbacks against the latest `streamlit-echarts` and Streamlit component documentation. The `key` parameter is now crucial for animations and stable component identity.
affects: >=0.5.0
breakingThe `st_pyecharts` wrapper was initially removed in v0.5.0, advising users to manually convert PyECharts options to JSON (`json.loads(chart.dump_options())`) and pass them to `st_echarts`. It was later reintroduced as part of an optional extra.
fix
To use `st_pyecharts`, install with `pip install streamlit-echarts[pyecharts]`. Alternatively, use `import json` and `json.loads(chart.dump_options())` when passing PyEcharts chart instances to `st_echarts`.
affects: >=0.5.0
breaking`pyecharts` and `simplejson` are no longer direct package dependencies of `streamlit-echarts` as of v0.5.0. Users need to install them explicitly if they intend to use `st_pyecharts` or other functionalities relying on these packages.
fix
If you rely on `pyecharts` or `simplejson`, install them explicitly: `pip install pyecharts simplejson` (or `pip install streamlit-echarts[pyecharts]` for the wrapper).
affects: >=0.5.0
breakingThe structure of event return values changed in v0.5.0. Instead of direct return, events now populate `result.chart_event` or `result['selection']` for `on_select`.
fix
Access event data via `result.chart_event` for general events or `result['selection']` when `on_select` is used, as demonstrated in the quickstart example and official documentation.
affects: >=0.5.0
breakingECharts was upgraded from v5 to v6 in v0.5.0. This might introduce subtle changes in default themes, component positions, or rendering behavior due to ECharts' own breaking changes.
fix
Review your charts for unexpected visual changes. Consult the ECharts v6 changelog for details. You might need to adjust specific ECharts options or provide a custom theme to restore previous appearances.
affects: >=0.5.0
gotchaECharts plots might not display correctly or update when placed inside `st.tabs` components, with only the first tab's chart rendering reliably. This can lead to blank charts on other tabs.
fix
Explicitly assign a unique `key` parameter to each `st_echarts` call within tabs. Sometimes recreating charts outside tabs or using `st.expander` can serve as a workaround, though recent versions with stable `key`s should mitigate this.
affects: all
gotchaCharts may exhibit flickering or unexpected re-rendering behavior when their options or data are dynamically updated without a stable component identity.
fix
Always provide a unique `key` parameter to `st_echarts` (e.g., `key='my_chart'`). This ensures Streamlit can correctly identify and update the component rather than re-mounting it, preserving animations and state.
affects: all
Upgrade
Version history
0.7.0latest on PyPI · released Jun 8, 2026
Audit
Dependencies
streamlitrequiredCore dependency for Streamlit components.
pyechartsoptionalOptional dependency for using st_pyecharts wrapper. Must be installed separately after v0.5.0.
simplejsonoptionalOptional dependency, no longer directly required by the package after v0.5.0. PyECharts might still use it.
Agent activity
27 hits · last 30 days
node
26
Resources