Hi There,
The Google Visualization API has a data table format which all
visualizations are built on top of :
http://code.google.com/apis/visualization/documentation/reference.html
Currently the data format of the GA API data feed is different from
the Google Viz dataTable so your program will need to convert the feed
format to the dataTable.
Using PHP you have 2 options:
1 - You can implement a Google Visualization data source (similar to
the grail example above). This will allow an HTML page with JavaScript
to use the Google Visualization's native query operation to pull data
from your script. There's a PHP library to implement a Google Viz data
source here :
http://code.google.com/p/google-visualization-php-api/
The only drawback I see here is if you want to keep your data secure,
you'll need to implement some sort of authentication so only
authorized JavaScripts can access your data source. But the benefit is
that the solution is quite scalable if you want other people to
implement client side apps without touching the PHP.
2 - Your PHP code can go through the GA data feed and directly write a
JSON dataTable object to the page, then in the browser, the
visualization that you want to use can directly reference the JSON
object. Here are the details of the JSON dataTable object :
http://code.google.com/apis/visualization/documentation/reference.html#dataparam
The benefit with this is your data can be sent across HTTPS and not
have to implement another auth routine. Though if you want to modify
your code later, you'll have to also modify the PHP script.
Good Luck!
-Nick
On Jun 12, 9:43 am, Dev wrote:
> Here is an example of what I want to do, but this is built in grails.
> I would like to build in PHP.
http://mrhaki.blogspot.com/2009/03/display-google-visualization-chart...