Skip to main content

A Dash Component library for ChartJs.

Project description

Dash Chartjs Component

Chart.js is one the most popular javascript charting library. Dash Chartjs Component is a Dash component library that renders ChartJs React component inside Dash App.

Installation

pip install dash-chartjs

Basic Usage

from dash import dash,html
import pandas as pd
from dash_chartjs import ChartJs

app = dash.Dash(__name__,meta_tags=[{"name": "viewport", "content": "width=device-width, initial-scale=1"}])

df = pd.read_csv('https://raw.githubusercontent.com/JetBlack101/visitors-to-georgia-ts-analysis/main/Data/VisitorsToGeorgia_2011-2019.csv')

df['Date'] = pd.to_datetime(df['Date'])

x = df['Date']
y = df['Visitors']

data = {
    'labels': x,
    'datasets': [{
        'label': 'Visitors to Georgia',
        'data': y,
        'fill':'false',
        'borderColor': 'rgb(75, 192, 192)',
        'tension': 0.1
    }]
}
options = {
    'scales': {
        'x': {
            'type':'time'
        }
    },
    'plugins':{
        'zoom':{
            'zoom':{
                'wheel':{
                    'enabled': True
                },
            'mode':'xy'
            }
        }
    } 
}


app.layout = html.Div(
    [
        ChartJs(type='line',data=data,options=options)
    ]
)

if __name__ == '__main__':
    app.run_server(debug=False)

Demo

https://user-images.githubusercontent.com/31138706/192035295-0a10eb80-0881-443b-8ea8-7dfd98eb77f3.mp4

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

dash_chartjs-0.0.5.tar.gz (159.2 kB view details)

Uploaded Source

File details

Details for the file dash_chartjs-0.0.5.tar.gz.

File metadata

  • Download URL: dash_chartjs-0.0.5.tar.gz
  • Upload date:
  • Size: 159.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for dash_chartjs-0.0.5.tar.gz
Algorithm Hash digest
SHA256 e6e697607f1a1bf9270fe22470d80ade3d65ac51f2e760be82d778b0a47ef862
MD5 5ae33cec16c2616dd4c1c9a4f5e66084
BLAKE2b-256 8716d3f9448323c2ae91ed00762bfadcc7507b484dcaed663626ce2d460c8336

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