Google Chart Tools API is a tool for developers to facilitate the use of Google Chart Tools and the Google Visualization API within the context of a Drupal site. It provides PHP and Javascript wrappers for all features of the Visualization API, and is built to reduce the common limitations of using a wrapper class.
Note: the following is only a brief summary of available classes and methods. In truth, the API is much larger than this as it aims to integrate as many features of the Visualization API as possible. Please see the module code for more information.
Creating a chart
Create a chart using new GoogleChartsChartWrapper([array $options])
.
$chart_wrapper = new GoogleChartsChartWrapper(array(
// Note that chart type must match a chart class available
// in the google.visualization object.
'chartType' => 'BarChart',
'chartName' => 'bar_1',
'containerId' => 'bar-1',
'options' => array(
'chartArea' => array(
'width' => 600,
'height' => 600,
),
),
));
Here's the Javascript API equivalent of the preceeding:
var chart_wrapper = new Drupal.GoogleCharts.Chart('BarChart', 'bar-1', {chartArea: {width: 600, height: 600}});