Getting Started with Infographics

Important: While the dynamic and interactive Google Charts are actively maintained, we officially deprecated the static Google Image Charts way back in 2012. It was turned off on March 18, 2019.

This page describes the basics of using the infographics server to make images.

Infographics Usage Policy

There's no limit to the number of requests per day you can make for infographics. However, we reserve the right to block any use that we regard as abusive.

  1. Getting Started
  2. Optimizations
    1. Improving load time
    2. Using POST

Getting Started

The infographics server returns an image in response to a URL GET or POST request. All the data required to create the graphic is included in the URL, including the image type and size. For example, copy and paste the following URL in your browser:

https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=Hello%20world

The image you see is a QR code representation of the phrase "Hello World". Try changing the phrase to your own name and refresh your browser. That's all it takes!

Here's a little more explanation of the URL:

https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=Hello%20world

  • https://chart.googleapis.com/chart? - All infographic URLs start with this root URL, followed by one or more parameter/value pairs. The required and optional parameters are specific to each image; read your image documentation.
  • chs - Size of the image in pixels, in the format <width>x<height>
  • cht - Type of image: 'qr' means QR code.
  • chl - The data to encode. Must be URL-encoded.

Optimizations

Here are a few optimizations for your images:

Improving load time on pages with many images

If you have just a few images on your page, the standard base URL https://chart.googleapis.com/chart should be fine. However, if you have many images, you can add a number 0-9 and a dot just before chart.apis.google.com. If you specify a different number for each image on your page, the browser will try to load more images simultaneously, rather than waiting to load them in sequence. However, you should only need this if you're loading perhaps five or more images on a page. For example:

  • http://0.chart.apis.google.com/chart?cht=...
  • http://1.chart.apis.google.com/chart?cht=...
  • http://2.chart.apis.google.com/chart?cht=...
  • ...

Using POST

URLs are limited to 2K in length, so if your images has more data than that, you'll have to use POST instead of GET. (GET is when you type your image URL into your browser URL bar, or use it as the source of an <img> element in a web page. POST requires additional programming in another language, such as PHP or PERL).

You can also use POST when generating a page programmatically.

Read about using POST to request an image.