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.1.3.tar.gz
(14.8 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-highcharts-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19e73d04c03428a5ca4f45ff4d76483a4df2a0fd5bc81a0f6eebccfde9c3d482 |
|
MD5 | 8bb91c16eaf6cc34ea5880e93ea61896 |
|
BLAKE2b-256 | 425c2d91b97b53d6e21f9ca0d03465880a66a45f7ada4c47a384c210fa585526 |
Close
Hashes for streamlit_highcharts-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e00fa957b899c931ee787413f9d1deaf9b284a746ac45b36761f612ecbe9f733 |
|
MD5 | 904d3c84b7ac5eaf26d7af60c2101797 |
|
BLAKE2b-256 | 11e371ddcf9e918cade2e1782c74248dac48ae407ad2c716e3028f02f2d804d7 |