- What is the Google Chart API?
-
The Google Chart API is an extremely simple tool that lets you easily create a chart from some data and embed it in a webpage. You embed the data and formatting parameters in an HTTP request, and Google returns a PNG image of the chart. Many types of chart are supported, and by making the request into an image tag you can simply include the chart in a webpage.
- Why is Google offering this service? What's in it for me?
-
We built the service originally as an internal tool to support rapid embedding of charts within our own applications (like Google Finance for example). We figured it would be a useful tool to open up to web developers.
- Is Google logging all my chart data?
-
The chart data included in the HTTP request is saved in temporary logs for no longer than two weeks for internal testing and debugging purposes.
Of course you should understand that if your chart appears in an image tag on a public webpage it could be crawled.
- I think Google should support a new type of chart, or I have a feature request. Where should I send my request?
-
We have a Google Group set up for this and other support requests: http://groups.google.com/group/google-chart-api.
- What kinds of charts are supported?
-
Currently line, bar, pie, and radar charts, as well as venn diagrams, scatter plots, sparklines, maps, google-o-meters, and QR codes.
The full list will always be up to date on the main documentation.
- Can I create a chart programmatically, e.g. from a JavaScript API?
-
Currently we only support creating a chart by sending the request in a URL. Several users have created tools and APIs to assemble the URLs; see http://groups.google.com/group/google-chart-api/web/useful-links-to-api-libraries.
- Is there a limit on the URL length for the Google Chart API? What is the maximum URL length?
-
The maximum length of a URL is not determined by the Google Chart API, but rather by web browser and web server considerations. Currently, URLs that are over 2048 characters in length when URL-encoded (e.g.,
| becomes %7C) are not recommended. As web browsers and servers evolve, this number may change. See http://www.boutell.com/newfaq/misc/urllength.html for a more in-depth discussion.
If URL length is a problem, here are a few suggestions for shortening your URL:
- If you are using a text encoding data format, remove leading zeros from numbers, remove trailing zeros after decimal points, and round or truncate the numbers after decimal points.
- If that does not shorten the URL enough, use simple (1 character) or extended (2 character) encoding.
- Sample data less frequently; i.e., reduce granularity.
- Remove accoutrements and decorations, such as colors, labels, and styles, from your chart.