Pirnat.com

On second thought, let’s not go to Camelot; it is a silly place

Pirnat.com header image 2

Google Chart API Released

December 6th, 2007 by Mike
Gravatar

I’ve been looking for a decent chart or graph library lately for a soon-to-be-hatched personal project, and been largely disappointed by the state of what’s available for Python. The freely available choices all felt a bit clunky to me, either in usage or in output (or in some cases, both), and the strongest contender (ChartDirector) was disqualified because of the licensing cost. I’d also looked at a few Javascript libraries, but really didn’t want to be stuck depending on client-side scripting for a variety of reasons (not the least of which is load on the client–it’s amazing what a couple of simple charts in a Google Spreadsheets document will do to the performance of even pretty studly machines).

So I was pretty happy today to see Google announce today that they are making their Google Chart API available for public use. It’s a pretty straightforward, stateless HTTP service: just fire off a properly-formatted GET and receive a PNG image in return. They support line charts, bar charts, pie charts, Venn diagrams, and scatter plots, labels, legends, and a plethora of coloring and styling options. And the output appears fairly pleasing to my eye.

There are a couple of caveats, though…

  • You are limited to 50,000 queries per user per day, which may pose some scalability concerns if you plan to build something big on this.
  • You have to be careful about the number of data points you submit in your request as you can quickly exceed the allowable URL length, and furthermore you might end up with illegibly smooshed-together data points due to the scale of your output.
  • There’s always the “OMG Google will absorb all our data and become sentient, turn evil, and unleash an army of death robots on us all, run for your lives!” paranoia, but that’s really just silly talk.

WIth those hazards in mind, this still seems like it will be very useful for me, at least in the short term. I am of course open to other suggestions and opinions if people would like to share them; if you’ve had good experiences with some charting library that might fit my needs, please let me know!

Tags: geekery  python4 CommentsPrint This Post

Leave A Comment

4 responses so far ↓

  • 1 peterbengtsson Dec 7, 2007 at 6:15 am Gravatar

    First of all, if it’s a serious project surely the cost of ChartDirector is worth it. It’s not a lot more than a night out including champagne :)

    What about PyCha?
    http://www.lorenzogil.com/projects/pycha/
    I haven’t played much with it but it looks simple to use.

  • 2 tplus1 Dec 7, 2007 at 9:54 am Gravatar

    r-project has the awesomeest charting I’ve seen, and projects like rpy and rspython make it possible to drive R from python.

    Also, I did a fair amount of work with reportlab in 2003. They make it easy to work with high-level constructs like pie charts, but you can also get super-specific and draw your stuff pixel-by-pixel if you need to.

    By the way, congratulations on those photos. They’re really good.

  • 3 gak_man Dec 13, 2007 at 3:24 am Gravatar

    “and been largely disappointed by the state of what’s available for Python.”

    Someone made a Python wrapper for Google Chart API. It’s at http://pygooglechart.slowchop.com/.

  • 4 exilejedi Dec 13, 2007 at 9:41 am Gravatar

    Cool. I was thinking about doing exactly that, but figured that by the time I got started someone else would have already done it.

    Hooray for the lazyweb! :-)