Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 8 days ago
JSON representation
Bundle used to manage and display graphics
- Host: GitHub
- URL: https://github.com/acseo/graphicbundle
- Owner: acseo
- License: mit
- Created: 2014-10-29T13:55:09.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-14T11:01:04.000Z (almost 8 years ago)
- Last Synced: 2024-04-01T19:06:33.261Z (8 months ago)
- Topics: bundle, graph, php, symfony, symfony-bundle
- Language: JavaScript
- Size: 71.3 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/)