About GChart
What is GChart
GChart is an object-oriented PHP library for drawing data charts using Google Chart APIs. You can use GChart to generate line charts, bar charts, scatter plot charts, pie charts, etc. GChart implements most of Google Chart APIs.
What is Google Chart API
Google Chart API lets you dynamically generate charts just using URLs. All the data and the arguments are in the URLs. For example, the following URL will produce a 3D-Pie chart with “hello” and “world” labels:
http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250×100&chl=Hello|World
If you want to learn more about Google Chart APIs, please see the official document.
GChart Makes it Easier
As you see, drawing a chart using URL directly is inconvenient and complex. For most of practical data charts, there is no surprise that its URL contains more than 100 characters. However, GChart can make it easier. Since GChart is an object-oriented PHP library, it is easy to learn and use. For the people with some PHP experience, the code is easy to understand and to write. For example, with GChart, the chart above can be generated by the following code:
<?php $p=new GChart_Pie3D(250,100); $p->add(60,'Hello'); $p->add(40,'World'); ?> <img src="<?php echo $p->get_image_string(); ?>" />
Start to Use GChart
See the brief tutorial to start. Or if you want to get the complete GChart API document, see the API document.