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
Metadata
Release files for streamlit-highcharts 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| streamlit-highcharts-0.2.0.tar.gz | 14.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlit_highcharts-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / streamlit-highcharts-0.2.0.tar.gz
| Download URL | streamlit-highcharts-0.2.0.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3a3acff8cbcdd6f611d51ef83b73cde3c6b4522ae05345d97440971479d81a2
|
|
BLAKE2b-256 checksum How to use checksums |
7b201f64ea77c7e4ce90e11fb0c71395275f68dacfd32fa5d6fad54a0e4a8255
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / streamlit_highcharts-0.2.0-py3-none-any.whl
| Download URL | streamlit_highcharts-0.2.0-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f799461a05ad673a3d59d7e51e6b323671958c94bbcc186f4d3e46baea029ad3
|
|
BLAKE2b-256 checksum How to use checksums |
9f21f9bbbe069c7dfb8cf5710d36dc088f64bd5cac9152941ebc627256b36fc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|