My favorites | English | Sign in

Google Visualization API

Implementing a Data Source

A visualization data source is a web service that can provide data to a JavaScript or gadgetized visualization. A data source exposes a URL, called a data source URL, to which a visualization can send HTTP GET requests. In response, the data source returns properly formatted data that the visualization can use to render the graphic on the page. This request-response protocol is known as the Google Visualization API wire protocol, see the Request Format and Response Format sections of Writing your own Data Source for details.

The data that is served by a data source can be extracted from various resources, such as a file or database. The only restriction is that the extracted data can be placed in a two dimensional table with typed columns.

Implement a data source by doing one of the following:

  • Use one of the data source libraries listed in the Data Sources and Tools Gallery. All the data source libraries listed on that page implement the wire protocol. You therefore need write only the code needed to make your data available to the library in the form of a data table. Writing your code is made easier by the provision of abstract classes and helper functions. One of these libraries is the Google Visualization Data Source Library, this is described in the Data Source Library Developer's Guide.

  • Write your own data source from scratch, as described in the Writing your own Data Source section.