A McGraw Hill Book Plug-in PHP: 100 Power Solutions
By Robin Nixon (McGraw Hill 2010, ISBN 978-0071666596)

Home | About | Buy It | Download | Contact

Select Chapter: 1  2  3  4  5  6  7  8  9 10 11 12

Chapter 10: Plug-in 71 - Create Google Chart

Google Charts is a great API that not too many people seem to know about yet. With it you can create a huge variety of charts to display on your website or incorporate in your documents, and so on. However, it is quite complex and requires using a number of different command strings, which is where this plug-in comes in. With it you only have to supply the data to be charted and (optionally), various widths, heights, colors and other details. The plug-in then interfaces with Google Charts and returns a ready-made image (as a GD object) containing the chart. You can then display the image straight away or save it to disk for future use.

The Figure shows a 3D pie chart created from seven items of data, representing types of cheese.