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.4.tar.gz
(14.8 kB
view hashes)
Built Distribution
Close
Hashes for streamlit-highcharts-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebde84a84d51717c55e1b3b0bec2bc6a858c8f5227c43571bf3ff5f415455a7d |
|
MD5 | a143d1e7d31ce42a1cd3fe3ed9655ed7 |
|
BLAKE2b-256 | 723207b639c2740a3edfd5ae64b42242594a71400869dc6b33131b9b4867a45e |
Close
Hashes for streamlit_highcharts-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 847cc6c1f02fa9bb552e25e3c67644b764797fd0eca515695ff5a5e30aafc10e |
|
MD5 | 0cda810088b98427de99d0b861c9c322 |
|
BLAKE2b-256 | 657f095a97316ef3d93e7588ef1c11c4485526e7e8f65cf544d173304948f725 |