Hi
I am trying to plot a pie chart using echarts library. But I have my data stored in a form of a dataframe. Can anyone please help how to plot the graph?
Thank you
Hi
I am trying to plot a pie chart using echarts library. But I have my data stored in a form of a dataframe. Can anyone please help how to plot the graph?
Thank you
you can try to use plotly or other packages that originally support by streamlit official.
I think streamlit echarts component is developed by some individual and surely it could be less supported in the forum or anywhere else.
but in your case you can try the sample code here :
to transform your dataframe to two seperated lists, one list use as xaxis value, another use as yaxis value. replace the data part in the following code
from streamlit_echarts import st_echarts
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": "line"}
],
}
st_echarts(options=options)
andfanilo/streamlit-echarts: A Streamlit component to render ECharts. (github.com)
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.