English | Site Directory

Google Visualization API

Introduction to Using Visualizations

Welcome to the developer guide for embedding visualizations with the Google Visualization API. The Google Visualization API lets you turn structured data into charts, tables, maps, and more on your page.

 

Area ChartPie ChartIntensity mapOrg chart

 

Visualizations are small embedded objects that take structured data from a variety of sources and present them in new and interesting ways. Visualizations can be embedded on any web page by adding some simple Javascript and HTML. Many visualizations have also been wrapped as gadgets, for display on web pages or additional targets. This section of the Google Visualization API documentation describes how to embed both gadget and non-gadget visualizations in a page. If you want to learn how to write your own visualization, see the Creating Visualizations section of the documentation.

Visualizations can capture or fire events, such as mouse clicks, that your page can capture and process, and you can link them together to create rich, interactive pages--for example, combining a map and a table that stay in sync when clicked. A large pool of visualizations exists, written by Google or third-party developers.

This API is new and still developing; we depend on feedback from users like you to help us decide what features to include. Please help us shape the API and features by giving feedback and participating in discussions in the Google Visualization API discussion group.

Audience

This documentation is designed for people familiar with JavaScript programming and object-oriented programming concepts. There are many JavaScript tutorials available on the Web. Some parts of this documentation are designed for people familiar with gadgets.

Topics in This Section

Here is a short description of all the pages in this section. If you are interested in learning more about developing your own visualization, see Creating Visualizations.

Topic Description
Using Visualizations How to embed a non-gadget visualization in your page. Even if you want to use visualization gadgets, this is good background material.
Sending Data Requests How to send a data request to a site that returns data for your visualization.
Handling Events How to handle events (such as mouse clicks).
Using Visualization Gadgets How to embed a visualization gadget in your page.
More Examples More examples of Javascript visualizations.

Visualization or Visualization Gadget?

Visualizations can be provided as raw visualizations, or wrapped by a gadget (some are provided as both). There are advantages to each type:

Visualizations

  • A page owner must edit the HTML of a page to add a raw visualization.
  • More complicated; involves HTML and (basic) Javascript.
  • Greater control of the visualization; a raw visualization exposes methods, events, and properties to the host page, which can manipulate them in Javascript.

Visualization Gadgets

  • If a page supports visualization gadgets, users can add them dynamically, without editing the source code.
  • Simple to embed a visualization (just an iframe).
  • Often expose few methods and events to the host page.

Security and Privacy in Visualizations

Google maintains a gallery of nifty visualizations that you can use. Some of them were created by us, others were created by third-parties. Visualizations depend on Javascript and data queries, and each of these has its own potential ramifications for the user. All Google-authored visualizations are developed with privacy and security considerations in mind. All third-party authors submitting to the gallery agree to the Terms of Service and Program Policy, which includes provisions to respect the privacy and other legal rights of users. Here is a summary of our policies and privacy and security practices:

  • Security   Developers are responsible for ensuring that their visualizations are secure and are prohibited from uploading malicious visualizations. We may scan visualizations for obvious security holes, but it is possible that a visualization could contain malware. For example, visualizations are JavaScript code that run in a browser; as such, they can take advantage of any standard JavaScript vulnerabilities.
  • Privacy   Developers agree to protect the privacy of users. Some visualizations perform all their data manipulation on the browser; others upload their data to Google or third-party sites to analyze data and perform calculations. Google doesn't share the data you've uploaded to the visualization with others, except for very limited exceptions as stipulated by legal requirements, and outlined in Google's Privacy Policy. Google also does not keep the private data stored in a visualization: Visualizations where data is uploaded to Google servers is only done so for the purpose of rendering the charts for you. Visualization data uploaded to Google servers is maintained a short while for debugging purposes, and then discarded. Developers that create visualizations that collect data, agree to maintain a legally adequate privacy policy.

If you're unsure about whether to use a third party visualization, look at the code to see whether it sends your data to—or uses Javascript from—a third-party site.