https://github.com/zostera/django-charting
Charts for Django made simple
https://github.com/zostera/django-charting
Last synced: 10 months ago
JSON representation
Charts for Django made simple
- Host: GitHub
- URL: https://github.com/zostera/django-charting
- Owner: zostera
- License: bsd-3-clause
- Created: 2014-12-19T08:24:02.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2023-04-06T05:57:40.000Z (almost 3 years ago)
- Last Synced: 2025-04-06T07:39:02.118Z (10 months ago)
- Language: Python
- Size: 141 KB
- Stars: 8
- Watchers: 6
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# django-charting
[](https://github.com/zostera/django-charting/actions?workflow=CI)
[](https://coveralls.io/github/zostera/django-icons?branch=main)
[](https://pypi.python.org/pypi/django-icons)
[](https://github.com/ambv/black)
Charts for Django using Google Charts API.
## Installation
Install `django-charting` using `pip`
```shell
pip install django-charting
```
## Quickstart
1. Add "django_charting" to your INSTALLED_APPS setting like this::
```python
INSTALLED_APPS = (
# ...
"django_charting",
# ...
)
```
2. Create a basic chart like this:
```python
from django_charting import Chart, NumberColumn, StringColumn
class DemoChart(Chart):
queryset = [
{"project": "Project 1", "count": 75},
{"project": "Project 2", "count": 25},
]
type = "PieChart"
title = "My demo"
project = StringColumn()
count = NumberColumn(accessor="count")
```
3. Render the chart in a template like this:
```
{% load django_charting %}
{% render_chart chart %}
```