{"id":19003490,"url":"https://github.com/acseo/graphicbundle","last_synced_at":"2025-04-22T18:13:53.868Z","repository":{"id":22581617,"uuid":"25923203","full_name":"acseo/GraphicBundle","owner":"acseo","description":"Bundle used to manage and display graphics","archived":false,"fork":false,"pushed_at":"2017-01-14T11:01:04.000Z","size":73,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T17:35:43.514Z","etag":null,"topics":["bundle","graph","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acseo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-29T13:55:09.000Z","updated_at":"2017-03-08T05:54:01.000Z","dependencies_parsed_at":"2022-07-25T09:17:18.280Z","dependency_job_id":null,"html_url":"https://github.com/acseo/GraphicBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acseo%2FGraphicBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acseo%2FGraphicBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acseo%2FGraphicBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acseo%2FGraphicBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acseo","download_url":"https://codeload.github.com/acseo/GraphicBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249283074,"owners_count":21243670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","graph","php","symfony","symfony-bundle"],"created_at":"2024-11-08T18:19:16.602Z","updated_at":"2025-04-16T22:32:13.732Z","avatar_url":"https://github.com/acseo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ACSEO GraphicBundle\n\n----\n\nThis bundle can be usefull when you want to easyly manipulate your data and generate nice graphics such as BarCharts, PieChart, Timelines, etc.\n\n## Installation\n\nAdd the bundle in your composer.json:\n\n```json\n{\n    \"require\": {\n        \"acseo/graphic-bundle\": \"dev-master\"\n    }\n}\n```\n\nNow tell composer to download the bundle by running the command:\n\n```bash\n$ php composer.phar update acseo/graphic-bundle\n```\nComposer will install the bundle to your project's ```vendor/ACSEO``` directory.\n\n\nEnable the bundle in your project\n\n```php\n\u003c?php \n//app/AppKernel.php\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n        //...\n        new ACSEO\\Bundle\\GraphicBundle\\ACSEOGraphicBundle(),\n\t\t//...\n        );\n//..\n```\n\n## Usage with jQuery Flot\n### In Controller\n```php\n\u003c?php\n\nnamespace MyProjet\\MyBundle\\Controller;\n\nuse ACSEO\\Bundle\\GraphicBundle\\Graphic\\Flot\\Type\\TimeLine; \nuse ACSEO\\Bundle\\GraphicBundle\\Graphic\\Flot\\Type\\Pie;\n\nclass MyController extends Controller\n{\n    public function indexAction()\n    {\n        // Construct data and timeline chart\n        $followers = array(\n            array(strtotime(\"01/01/2014\") * 1000, 3),\n            array(strtotime(\"02/01/2014\") * 1000, 18),\n            array(strtotime(\"03/01/2014\") * 1000, 56),\n            array(strtotime(\"04/01/2014\") * 1000, 60)\n        );\n        $timeline = new TimeLine(\"#domIdFollowers\", $followers); \n\n        // Construct data and pie chart\n        $cities = array(\n            (object) array(\"label\" =\u003e \"Marseille\", \"data\" =\u003e 100),\n            (object) array(\"label\" =\u003e \"Lyon\",      \"data\" =\u003e 50),\n            (object) array(\"label\" =\u003e \"Paris\",     \"data\" =\u003e  1),\n        );\n        $pie = new Pie(\"#cities\", $cities); \n\n        return $this-\u003erender('MyProjectMyBundle:Default:index.html.twig', array(\n                'timeline' =\u003e $timeline,\n                'pie' =\u003e $pie\n        ));\n```\n### In View\nOnce you have created the graphs in your Controller, the hardest is done. Simply call the Twig Extension ```flot_graph``` to generate the graphs.\n\n```twig\n{# MyBundle:MyController:index.html.twig #}\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003c!-- include jQuery and jQuery Flot Javascript form CDN or from your project --\u003e\n        \u003cscript src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js\"\u003e\u003c/script\u003e\n        \u003cscript src=\"http://cdnjs.cloudflare.com/ajax/libs/flot/0.8.2/jquery.flot.min.js\"\u003e\u003c/script\u003e\n        \u003cscript src=\"http://cdnjs.cloudflare.com/ajax/libs/flot/0.8.2/jquery.flot.pie.min.js\"\u003e\u003c/script\u003e\n        \u003cscript src=\"http://cdnjs.cloudflare.com/ajax/libs/flot/0.8.2/jquery.flot.time.min.js\"\u003e\u003c/script\u003e\n\n        \u003cscript type=\"text/javascript\"\u003e\n            $(document).ready(function() {\n                {{ flot_graph(timeline) }}\n                {{ flot_graph(pie) }}\n            });\n        \u003c/script\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003c!-- remember to give width and height to your graph containers --\u003e\n        \u003cdiv id=\"domIdFollowers\" style=\"width:100%;height:50%\"\u003e\u003c/div\u003e\n        \u003cdiv id=\"cities\" style=\"width:100%;height:50%\"\u003e\u003c/div\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n## TODO\n\n* write tests\n* use other grah providers, such as [Google Charts](https://developers.google.com/chart/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facseo%2Fgraphicbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facseo%2Fgraphicbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facseo%2Fgraphicbundle/lists"}