Simple wrapper for Highcharts JS libs
Project description
streamlit-highcharts
Simple wrapper for Highcharts JS libs
Installation instructions
pip install streamlit-highcharts
Tips
For chart definition, please refer to https://www.highcharts.com/demo You'll find a lot of samples, just copy the JS definition as JSON and think about the following:
- Convert in pure JSON, all keys must be in double quote, you can use https://jsonformatter.curiousconcept.com/#
- Replace boolean values true or false by Python correct values True or False
- Double quote "null" values
- Remove any JS functions
- Make data dynamic :-)
Sample Streamlit Application
https://aalteirac-streamlit-highcharts-test-app-main-3vgde6.streamlitapp.com/
Usage
import streamlit as st
import streamlit_highcharts as hct
chart_def={
"title":{
"text":"Sales of petroleum products March, Norway",
"align":"left"
},
"xAxis":{
"categories":["Jet fuel","Duty-free diesel"]
},
"yAxis":{
"title":{"text":"Million liter"}
},
"series":[
{"type":"column",
"name":"2020",
"data":[59,83]},
{"type":"column",
"name":"2021",
"data":[24,79]
},
{"type":"column",
"name":"2022",
"data":[58,88]
},
{"type":"spline",
"name":"Average",
"data":[47,83.33],
"marker":{
"lineWidth":2,
"fillColor":"black",
}
}
]
}
hct.streamlit_highcharts(chart_def,640) #640 is the chart height
#The component bundles some sample chart definitions, from SAMPLE1 to ...SAMPLE10
hct.streamlit_highcharts(hct.SAMPLE1,640) #640 is the chart height
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit-highcharts-0.2.0.tar.gz
(14.8 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-highcharts-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3a3acff8cbcdd6f611d51ef83b73cde3c6b4522ae05345d97440971479d81a2 |
|
MD5 | deafabf220647f12213afbb8c9e9d807 |
|
BLAKE2b-256 | 7b201f64ea77c7e4ce90e11fb0c71395275f68dacfd32fa5d6fad54a0e4a8255 |
Close
Hashes for streamlit_highcharts-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f799461a05ad673a3d59d7e51e6b323671958c94bbcc186f4d3e46baea029ad3 |
|
MD5 | 48d82e609f04563089af5c02f17e4e24 |
|
BLAKE2b-256 | 9f21f9bbbe069c7dfb8cf5710d36dc088f64bd5cac9152941ebc627256b36fc4 |