Current version
 is 0.6

Google Chart PHP Library is a open-source (MIT License) and free to use wrapper for the awesome Google Chart API, a tool provided by Google to create PNG charts using a simple HTTP request. Google Chart PHP Library aims to to simplify the request generation by offering a high-level object-oriented PHP interface.

What's the difference with other charting libraries?

The main difference is that Google Chart PHP Library doesn't generate any image, but instead generate an HTTP request (GET or POST) to call Google Chart API.

  • Generation of the chart is blazing fast.
  • It doesn't require any additional PHP modules (like GD or imagemagick).
  • You can use the generated URL in a img HTML tag and save bandwith.
  • Or, you can fetch the PNG image and cache it locally.

Of course, there is one drawback: you rely on an external tool to generate your charts. Hence you might want to consider other libraries to create charts with highly confidential data (Charts are cached into Google's servers for 2 weeks), or if you create an internal application with no internet access.

See it in action!

Line Chart

Bar Chart

Map Chart

All examples are powered by Google Chart PHP Library. This is only a small excerpt of all the different charts offered by Google Chart API. If you want to know more, take a look at the Chart Gallery from the official documentation.

Care to help?

Google Chart PHP Library is an open-source project. I've created it originally for Last.fm Event Charts, but it's now a project of its own. I'm working on it during my free time, and if you want to help, you're very welcome!

There is a lot to do. Here are some ideas:

  • Use it, test it and open an issue if something is broken.
  • Implement missing features and charts (Todo list).
  • Implement missing unit tests (with PHPUnit).
  • Write/improve examples, tutorials and documentation on the Wiki.
  • Send feedbacks, comments and criticism, you'll make my day. :-)