Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/acseo/graphicbundle

Bundle used to manage and display graphics
https://github.com/acseo/graphicbundle

bundle graph php symfony symfony-bundle

Last synced: about 2 months ago
JSON representation

Bundle used to manage and display graphics

Awesome Lists containing this project

README

        

# ACSEO GraphicBundle

----

This bundle can be usefull when you want to easyly manipulate your data and generate nice graphics such as BarCharts, PieChart, Timelines, etc.

## Installation

Add the bundle in your composer.json:

```json
{
"require": {
"acseo/graphic-bundle": "dev-master"
}
}
```

Now tell composer to download the bundle by running the command:

```bash
$ php composer.phar update acseo/graphic-bundle
```
Composer will install the bundle to your project's ```vendor/ACSEO``` directory.

Enable the bundle in your project

```php
"Marseille", "data" => 100),
(object) array("label" => "Lyon", "data" => 50),
(object) array("label" => "Paris", "data" => 1),
);
$pie = new Pie("#cities", $cities);

return $this->render('MyProjectMyBundle:Default:index.html.twig', array(
'timeline' => $timeline,
'pie' => $pie
));
```
### In View
Once you have created the graphs in your Controller, the hardest is done. Simply call the Twig Extension ```flot_graph``` to generate the graphs.

```twig
{# MyBundle:MyController:index.html.twig #}







$(document).ready(function() {
{{ flot_graph(timeline) }}
{{ flot_graph(pie) }}
});






```
## TODO

* write tests
* use other grah providers, such as [Google Charts](https://developers.google.com/chart/)