Skip to content
This repository

Standalone library for easy chart generating using Google Chart API

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 src
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 phpunit.xml.dist

GoogleChartGenerator v0.1.4 - dev

Standalone library for easy implementation of Google Chart API.

How does it look like


For deeper information about this library visit full GoogleChartGenerator documentation on my blog.


Download the Source Code

From GitHub repository

git clone _your_project_lib/GoogleChartGenerator

or download and unzip latest version from:

Quick Tutorial

defining a line chart:

$chart = new LineChart(array('title' => 'Chart with default settings'));
$chart->addLine(new Line(array(83,32,56,38,50,65,18,50,65,54,40,100,22,4,41,7)));

rendering in a Twig view:

{# render <img> tag #}
{{ chart.render }}

{# or just get image url #}
{{ chart.renderUrl }}

or in a PHP view:

<!-- render <img> tag -->
<?php echo $chart->render(); ?>

<!-- or just get image url -->
<?php echo $chart->renderUrl(); ?>

Generated HTML output is:

<!-- render <img> tag -->
<img src="|83,32,56,38,50,65,18,50,65,54,40,100,22,4,41,7&chtt=Chart+with+default+settings&chxt=x,y&chxr=0,0,19|1,0,100&chco=ffa909&chg=25,33.33,3,3" width="300" height="200" alt="GoogleChartBundle with default settings" />

<!-- or just get image url -->|83,32,56,38,50,65,18,50,65,54,40,100,22,4,41,7&chtt=Chart+with+default+settings&chxt=x,y&chxr=0,0,19|1,0,100&chco=ffa909&chg=25,33.33,3,3

and finally the image:

show generated chart

Something went wrong with that request. Please try again.