Library to render chart using chartjs
Project description
Documentation
The full documentation is at https://django-charts.readthedocs.io/en/latest/
Quickstart
Install dj-chartjs:
pip install dj-chartjs
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'dj_chartjs',
...
)
How to render chart as a View:
in views.py import type chart to want use:
from django.views.generic.base import TemplateView
from django_charts.views import BarChartView
class ExampleChart(BarChartView, TemplateView):
...
title = "Index of ..."
id_chart = "barchart_example" #any value
def generate_labels(self):
return ["Africa","Brazil","Japan","EUA"]
def generate_values(self):
return [1,10,15,8]
in your template that you want render chart, use this tag:
{% load dj_chartjs %}
{% render_chart chart %}
Features
TODO
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
History
0.1.0 (2020-03-30)
First release on PyPI.
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
dj-chartjs-0.1.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for dj_chartjs-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb2997ba15216295306ffa6bfe018575c45db4866c5e6b0deab947b7790b688 |
|
MD5 | b2080437df377e0d5198d840860699f2 |
|
BLAKE2b-256 | e015a47d12aa0e89db3e0c8a6df7c3dd906593626e7c551893ea2d9eda20b545 |