peopledoc / django-chartjs

Django Class Based Views to generate Ajax charts js parameters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Chartjs

Django Chartjs lets you manage charts in your Django application.

image

image

image

This is compatible with Chart.js and Highcharts JS libraries.

Using a set of predefined Class Based Views you are able to get started after writing just your SQL query.

Getting Started

Install django-chartjs:

pip install django-chartjs

Add it to your INSTALLED_APPS settings:

INSTALLED_APPS = (
    '...',
    'chartjs',
)

Using it

A simple Line Chart example.

1. Create the HTML file

2. Create the view with labels and data definition

3. Update urls.py with the new urls for TemplateView and AJAX call 'line_chart_json' as in chart.html

4. Get a Chart.js Line Chart

image

It is that simple!

For other examples including a HighCharts line chart, don't hesitate to look at the demo project.

Also, feel free to contribute your demo!

About

Django Class Based Views to generate Ajax charts js parameters.

License:Other


Languages

Language:JavaScript 98.7%Language:Python 1.2%Language:Makefile 0.1%Language:Shell 0.0%