Eplot from PyEcharts doesn't seem to work in Streamlit - Is it the case?

Hi guys,

I can’t seem to be able to use Eplot (a helper which eases data manipulation between PyEcharts and Pandas) in Streamlit.

https://blog.csdn.net/PIPIXIU/article/details/86421980 (note that the page is in Chinese yet can be translated via Google translate):

Happy to report the errors I’m getting but first of all I was wondering whether Eplot was actually compatible at all?

Thanks,
Charly

Yeah sometimes I have trouble navigating the echarts docs, but here are two ways of rendering eplot:

import pandas as pd
from eplot import eplot
from streamlit_echarts import st_pyecharts
import streamlit.components.v1 as components

eplot.set_config(return_type='CHART') # this is important to retrieve the Dict spec of your chart

df = pd.Series([4,2,6],index=[1,2,3])
chart = df.eplot.bar(title='柱形图')

st_pyecharts(chart) # with my little https://github.com/andfanilo/streamlit-echarts
components.html(chart.render_embed(), width=800, height=500) # using components.html, though you need to specify size of chart so it doesn't break

2 Likes

Nice one Fanilo. Thank you very much :slight_smile: