Skip to main content

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


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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_highcharts-0.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file streamlit-highcharts-0.2.0.tar.gz.

File metadata

  • Download URL: streamlit-highcharts-0.2.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for streamlit-highcharts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f3a3acff8cbcdd6f611d51ef83b73cde3c6b4522ae05345d97440971479d81a2
MD5 deafabf220647f12213afbb8c9e9d807
BLAKE2b-256 7b201f64ea77c7e4ce90e11fb0c71395275f68dacfd32fa5d6fad54a0e4a8255

See more details on using hashes here.

File details

Details for the file streamlit_highcharts-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_highcharts-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f799461a05ad673a3d59d7e51e6b323671958c94bbcc186f4d3e46baea029ad3
MD5 48d82e609f04563089af5c02f17e4e24
BLAKE2b-256 9f21f9bbbe069c7dfb8cf5710d36dc088f64bd5cac9152941ebc627256b36fc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page