Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 2.57 KB

readme.md

File metadata and controls

75 lines (51 loc) · 2.57 KB

Streamlit Charts

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.

examples npm Version npm Download GitHub stars npm License

Installation

pip3 install streamlit-charts

Usage

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")

example

API

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 -

Development

  • Building frontend code by running npm run start in fold streamlit_charts/frontend.
  • Run the example by running streamlit run streamlit_charts/__init__.py with _RELEASE = False.

License

MIT@lxfu1.