Well it’s been almost a full two weeks since google charts API came out. A really nice service but it’s only going to be useful with a high-level programming API. Enter PyGoogleChart .. a python interface to generate google chart urls.

Taking one of my previous example datasets, here’s the 10-second howto:

<blockquote>from pygooglechart import SimpleLineChart
chart = SimpleLineChart(400,200)
data = [32.5,35.2,39.9,40.8,43.9,48.2,50.5,51.9,53.1,55.9,60.7,64.4]
chart.add_data(data)
url = chart.get_url()
print url
</blockquote>

which gives us:

http://chart.apis.google.com/chart?cht=lc&chs;=400x200&chd;=t:32.5,35.2,39.9,40.8,43.9,48.2,50.5,51.9,53.1,55.9,60.7,64.4

and our chart image:



blog comments powered by Disqus

Published

19 December 2007