Results display using pygooglechart
Once
we've decided we want to create pie charts, the next question is: how do we do that? Chart creation is not built into the Python language. There are, however, several add-on libraries that provide this function. We'll start by experimenting with one of the simplest alternatives, pygooglechart
, which is a Python wrapper around the Google chart API.
The pygooglechart
package is available on the Python Package Index site, http://pypi.python.org/pypi/pygooglechart. Information on the underlying Google chart API can be found at http://code.google.com/apis/chart/. The version of pygooglechart
used in this chapter is 0.2.0.
One reason using pygooglechart
is very simple, for a web application, is that the result of constructing a chart is simply a URL that can be used to fetch the chart image. There is no need to generate or serve an image file from our application. Rather, all of the work can be pushed off to the Google chart API, and our application simply...