Ant Design Charts is AntV React component library, Simple and easy to use React chart library.
This project was created to allow us to render charts in streamlit, live demo.
pip3 install streamlit-charts
import streamlit as st
from streamlit_charts import charts
options = {
"height": 400,
"data": [
{ "genre": "Sports", "sold": 275 },
{ "genre": "Strategy", "sold": 115 },
{ "genre": "Action", "sold": 120 },
{ "genre": "Shooter", "sold": 350 },
{ "genre": "Other", "sold": 150 },
],
"xField": 'genre',
"yField": 'sold',
"colorField": "genre",
"style": {
"radiusTopLeft": 10,
"radiusTopRight": 10,
},
}
charts(type="Column", options=options, key="streamlit-charts")
Now, There is only one API for streamlit-charts
, named charts
, see the type | options
in Ant Design Charts.
Property | Description | Type | Default |
---|---|---|---|
type | the chart type of the charts, eg: Line、Column、Bar、Pie... |
Str |
Column |
options | the options for the visualization | Options |
- |
- Building frontend code by running
npm run start
in foldstreamlit_charts/frontend
. - Run the example by running
streamlit run streamlit_charts/__init__.py
with_RELEASE = False
.
MIT@lxfu1.