Google Chart API

{{Short description|Online data charting service}}

{{primary sources|date=January 2009}}

{{Infobox Software

| name = Google Chart API

| logo =

| screenshot =

| caption =

| author = Google

| developer =

| released = 2007

| latest release version = February 2010

| latest release date =

| latest preview version =

| latest preview date =

| programming language =

| operating system =

| platform =

| language = HTTP requests

| discontinued = yes

| genre =

| license =

| website = {{URL|https://developers.google.com/chart/image/}}

}}

The Google Chart API is a non-interactive Web service (now deprecated) that creates graphical charts from user-supplied data. Google servers create a PNG image of a chart from data and formatting parameters specified by a user's HTTP request. The service supports a wide variety of chart information and formatting. Users may conveniently embed these charts in a Web page by using a simple image tag.

Originally the API was Google's internal tool to support rapid embedding of charts within Google's own applications (like Google Finance for example). Google figured it would be a useful tool to open up to web developers. It officially launched on December 6, 2007.

Currently, line, bar, pie, and radar charts, as well as Venn diagrams, scatter plots, sparklines, maps, google-o-meters, and QR codes are supported.

Google deprecated the API in 2012{{Cite web |title=Changes to deprecation policies and API spring cleaning |url=https://developers.googleblog.com/2012/04/changes-to-deprecation-policies-and-api.html |access-date=2022-03-14 |language=en}}{{cite web|url=https://developers.google.com/chart/terms|title=Google Charts: Terms of Service: Deprecation Policy}} with guaranteed availability until April 2015. On March 18, 2019 Google turned off the API.{{Cite web |title=Image Charts |url=https://developers.google.com/chart/image |access-date=2022-03-14 |website=Google Developers |language=en}} Google recommends the successor service Google Charts.{{cite web|url=https://developers.google.com/chart/|title=Google Charts: Interactive charts for browsers and mobile devices.}}

Example

The following URL creates the pie chart below:

[http://chart.apis.google.com/chart?chs=200x200&chdlp=b&chtt=Uberman&chdl=Asleep|Awake&chd=t:1,11,1,11,1,11,1,11,1,11,1,11&cht=p&chco=586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F http://chart.apis.google.com/chart?
chs=200x200
&chdlp=b
&chtt=Uberman
&chdl=Asleep|Awake
&chd=t:1,11,1,11,1,11,1,11,1,11,1,11
&cht=p
&chco=586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F,586F8E,7D858F]

Image:Uberman.png

External Libraries

Instead of creating the URL request manually, there are many open source libraries available for most programming languages.

class="wikitable"
PlatformNameWebsite
JavaGoogle Chart API wrapper{{Cite web |title=Google Code Archive - Long-term storage for Google Code Project Hosting. |url=https://code.google.com/archive/p/googlechartwrapper |access-date=2022-03-14 |website=code.google.com}}https://code.google.com/p/googlechartwrapper/
Javacharts4j{{Cite web |title=Google Code Archive - Long-term storage for Google Code Project Hosting. |url=https://code.google.com/archive/p/charts4j |access-date=2022-03-14 |website=code.google.com}}https://code.google.com/p/charts4j/
C#/.NETngcharthttps://code.google.com/p/ngchart/
Rubygcharthttps://web.archive.org/web/20100618222849/http://rubyforge.org/projects/gchart/
Pythongoogle-chartwrapperhttps://code.google.com/p/google-chartwrapper/
PHPgchartphphttps://github.com/pacbard/gChartPhp

See also

References

{{reflist}}