https://github.com/sebbekarlsson/chartserver
A chartserver
https://github.com/sebbekarlsson/chartserver
charts flask graphs python
Last synced: 2 months ago
JSON representation
A chartserver
- Host: GitHub
- URL: https://github.com/sebbekarlsson/chartserver
- Owner: sebbekarlsson
- Created: 2018-05-31T08:24:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-01T07:33:11.000Z (about 8 years ago)
- Last Synced: 2025-03-25T20:46:16.635Z (over 1 year ago)
- Topics: charts, flask, graphs, python
- Language: Python
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chartserver
> A server that serves charts over HTTP/HTTPS using Python & Flask.
## Usage
### Bar chart
> To retrieve a bar chart:
GET /chart/bar//
> Example:
GET /chart/bar/a,b,c,g/10,0,30,10
> Will give you this image:

> You can also choose a size on the image by adding these arguments to the
> request:
GET ...?w=&h=
> You can also choose the color on your bars by adding these arguments:
GET ...?c=blue,green,black,yellow
> You can also put labels on your chart, like this:
GET ...?title=Mytitle&ylabel=points&xlabel=elements
> Will look like this:

### Line chart
> You can use the exact same arguments for the line chart, the route is:
GET /chart/line//
> Example:
GET /chart/line/a,b,c/10,10,20
> It will look something like this:

### Pie chart
> To retrieve a pie chart:
GET /chart/pie//
> Example:
GET /chart/pie/python,javascript,golang/10,10,20
> Will give you this image:

> You can also change `width`, `height`, `color`, `shadow`:
GET ...?w=&h=&color=red,green,blue&shadow=1
## Cache
> Everything is cached, to disable cache; add this argument:
GET ...?no_cache=1
## Installing & Running
### Development mode
> First run the setup:
python setup.py develop
> Then start the program:
python __main__.py
> The server is now up and running at: `http://localhost:5000`
### Production mode
> coming soon
## Unit tests
> To run the unit tests, first install pytest:
pip install pytest
> Then run:
py.test