PHP Classes
Icontem

Class: QGoogleVisualizationAPI


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  QGoogleVisualizationAPI  >  Download  >  Support forum Support forum (8)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: QGoogleVisualizationAPI Support forum
Base name: qgooglevisualapi
Description: Render charts with Google Visualization API
Related top rated classes: , , ,
Version: 0.2
Required PHP version: 5.0
License: BSD License
All time users: 1016 users
All time rank: 2346
Week users: 10 users
Week rank: 744
 
  Screenshots Screenshots   Author   Group folder image Groups   Detailed description  
  Rate classes User ratings   Trackback   Applications   Related links   Files Files  

Screenshots

UML Layout Part 2
File Role Description
Accessible without login Image file classes_bottom.png Screen UML Layout Part 2
Accessible without login Image file classes_top.png Screen UML Layout Part1

Author

Picture of Tom Schaefer
Name: Tom Schaefer <e-mail contact>
Published packages: 22 Browse this author's classes Browse this author's classes
Country: Germany Germany - PHP jobs in Germany
Home page: http://www.query4u.de/tests/samples/
Age: ???
All time rank: 330
Week rank: 66

Groups

Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Graphics Colors, images, charts and picture formats View top rated classes
Group folder image Web services Web data clipping, SOAP or XML-RPC clients and servers View top rated classes

Detailed description

Attention!
Some files seem to have corrupted file names after downloading. Do not know why this happened. Please check the core files on error regarding following Syntax: Q<charttype>GoogleGraph.class.php


!!!Google Code Blog Recommendation!!!
Google Visualization API now in PHP
Tuesday, August 19, 2008

By Nir Bar-Lev, Product Management

Here at the Google Visualization HQ we focus hard on making the Visualization API the easiest and simplest platform for visualizing and reporting data on the web. We're always excited to see the community uptake and develop our product, making it even more useful and accessible to other developers. One such initiative is the PHP wrapper class that Thomas Schaefer wrote for the Visualization API.

The class wraps the API and enables PHP application developers to quickly integrate visualizations into their code. Thomas even published reference applications that enable you to get started even quicker.

We love your work Thomas, keep it up!


===============================================================


This package can be used to generate structured charts with Google Visualization API.

It provide a base class that can generate the necessary HTML to embed charts rendered by Google Visualization API in Web pages.

It also provides several classes that wrap the configuration of the different types of supported charts like line charts, bar charts and column charts.

Added:
- Area chart
- Gauge chart
- Pie chart
- Intensity Map
- Mashup
- Wordcloud
- Orgchart
- Table
- Scatterchart (for commendation by Jorge Garifuna at Digg)
- Annotated Timeline (for commendation by Jorge Garifuna at Dzone)
- Map
- Motionchart

I released all classes. If you think, something is missing then let me know.

Regards Tom Schaefer


############################
** QVisualisationGoogleGraph Extraction from QLib**
@license BSD
@author Thomas Schäfer
@since 2008-30-06
@version 0.1

== Introduction ==
Google Visualisation API produces javascript code visualising data in different formats.
QVisualisationGoogleGraph provides some wrapper classes to dynamically produces
javascript code using the google jsapi lib.

provided chart types:
* Annotated timeline (Flash)
* Area chart
* Bar chart
* Column chart
* Gauge
* Intensity Map
* Map
* Motion chart (Flash)
* Pie chart
* Scatter chart
* Tables
* Word clouds (user def.)
* Organisation chart

* Mash-Up

Additional classes used by QVisualisationGoogleGraph:
* QInflector (inflecting for namespace)
* QConfig (debug, config properties)
* QTracer (debug trace)
* QTool (context namespace)


== methods ==

=== setColumns ===
This method adds column names to a chart. The method expects an array of arrays.
The first entry of column data array defines the data type.
The second entry holds the value. If you choose an intensity map chart then
a third parameters is required. In this very case the third parameter holds the
country name flag.
You may define columns as many as you want, but you have to structure it as described.

e.g. for intensity map
$chart->addColumns(
array(
array('string', '', 'Country'),
array('number', 'Population (mil)', 'a'),
array('number', 'Area (km2)', 'b'),
)
);

e.g. for other chart types
$chart->addColumns(
array(
array('date', 'Date'),
array('number', 'Sold Pencils'),
array('number', 'Sold Pens'),
array('string', 'title'),
array('string', 'text'),
)
);


=== setValues ===
The setValues method pushes the data into the chart object where
it will be rendered contextually. If a chart type needs the
Google API setCell method it switches automatically.

While setting the values the addRows method will be rendered, too.


e.g. setValue for annotated timeline charts
$chart->setValues(
array(
array(0, 0, 'new Date(2008, 1 ,1)'),
array(0, 1, 30000),
array(0, 2, 40645),
)
);


=== drawProperties ===
The setDrawProperties allows you to change the default chart property values.
You have to visit the Google Visualization Web Api reference for getting an
image of what can be done.

** Contextual Reference Link **
$chart = new QAnnotatedtimelineGoogleGraph();
echo $chart->getReferenceLink();

This command provides a link to the chapter where annotated timelines are explained.

Usually the chart class checks the draw properties against configuration properties.
The configuration property is part of each chart class. Each has an individual repertoire.
This class property holds the supported features with their data types, and optionally value ranges.

=== render ===
The last method you need to know is the render command.
This method collects, merges and returns the script.


== conclusion ==
Making chart types with the Google Visualization API is pretty simple.
You need not to know anything about javascript. PHP does it for you.

If you are mature with both languages you can write your own classes
to enhance the functionality.

User ratings

There are not enough user ratings to display for this class.

Trackback links

Link Description
Amazing Google Visualization API implementation in PHP The QGoogleVisualizationAPI package is the PHP implementation of Google Visualization API...
Google Api - Implementation The QGoogleVisualizationAPI package is the PHP implementation of Google Visualization API...
HTML Tables and the Data Web Some time ago now, I wrote a post about progressive enhancement of HTML web pages, including some examples of how HTML data tables could be enhanced to provide graphical views of the data contained in them...
PHP Wrapper für Google Visualization API Thomas Schaefer hat sich die Mühe gemacht und die Google Visualization API in der PHP-Klasse “QGoogleVisualizationAPI” gekapselt...

Applications that use this class

No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.

Related links

Link Description
Google Recommendation at Google Code Blog That is better than an Innovation Award. Der Ritterschlag! ;-)
QChartBuilder query data and configure values in web interface
HTML Tables and the Data Web QChartBuilder will support such table features.
Sample Implementation @ www.query4u.de The samples can be viewed here and many more...
DZONE QGoogleVisualizationAPI comments and votes at DZONE
Gallery Google Visualization Gallery
Review Review at Hotscripts.com
Sneak Preview v1.0 Some samples using the next minor version.

Files

File Role Description
Plain text file QMapGoogleGraph.class.php Class build maps
Accessible without login Plain text file QVizualisationGoogleGraph.class.php Class Visualization Class
Accessible without login Plain text file QGoogleGraph.class.php Class abstract root class
Plain text file QMagictableGoogleGraph.class.php Class Magic Table Class
Plain text file QMixupGoogleGraph.class.php Class Powerful MixUp Class for combining different charts (Look at the sample site www.query4u.de/vizapi) and see how it works.
Plain text file config.inc.php Conf. loader of classes
Accessible without login Plain text file QAnnotatedtimelineGoogleGraph.class.php Class Annotated timeline for commendation by Jorge Garifuna at Dzone
Plain text file QApikeyGoogleGraph.class.php Class API KEY
Plain text file QAreachartGoogleGraph.class.php Class Area Chart
Plain text file QBarchartGoogleGraph.class.php Class BarChart
Plain text file QColumnchartGoogleGraph.class.php Class Column Chart
Plain text file QConfig.class.php Class Config Class
Plain text file QGaugeGoogleGraph.class.php Class Gauge Class
Plain text file QInflector.class.php Class Inflector class needed by QTool
Accessible without login Plain text file QIntensitymapGoogleGraph.class.php Class Intensity Map
Plain text file QLinechartGoogleGraph.class.php Class Line Chart
Plain text file QMotionchartGoogleGraph.class.php Class Motion Chart
Plain text file QOrgchartGoogleGraph.class.php Class Orgchart
Plain text file QPiechartGoogleGraph.class.php Class Pie chart
Plain text file QScatterchartGoogleGraph.class.php Class Scatter Chart with many thanks for commendation by Jorge Garifuna at Digg
Plain text file QTableGoogleGraph.class.php Class Table Class
Plain text file QTool.class.php Class Utility class
Plain text file QWordcloudGoogleGraph.class.php Class Word Cloud
Accessible without login Plain text file readme.txt Lic. README
Accessible without login Plain text file sample.anno.php Example Annotated timeline for commendation by Jorge Garifuna at Dzone
Accessible without login Plain text file sample.bar.php Example Bar Chart Sample
Plain text file sample.column.php Example Sample Column Chart
Plain text file sample.gauge.php Example Gauge Sample
Plain text file sample.google.areachart.php Example Area Chart Sample
Accessible without login Plain text file sample.intensitymap.php Example Sample intensity map
Plain text file sample.line.php Example Sample Line Chart
Plain text file sample.magictable.php Example Sample for magic table
Plain text file sample.map.php Example Map Sample
Plain text file sample.motion.php Example Motion Chart Sample
Plain text file sample.orgchart.php Example Orgchart for cheers from Jorge Garifuna
Plain text file sample.pie.chart.php Example Pie sample
Plain text file sample.scatter.php Example Scatter Sample for commenation by Jorge Garifuna at Digg
Plain text file sample.table.php Example Table sample
Plain text file sample.wordcloud.php Example Word Cloud Sample
Download all files: qgooglevisualapi.tar.gz qgooglevisualapi.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products