More Graphing with Perl

barbie on 2008-04-14T13:46:54

Following some good suggestions for improving the graphs on the CPAN Testers Statistics site, I looked into the Google Chart API. I was looking for something that was fairly simple to drop into what I already had with GD::Graph, and although a slight code edit was required, pretty much everything just worked. However, it wasn't without it's frustration. The data set that I pass is quite large with 6 sets of 100+ points each, such that the GET request fails, I assume because it gets truncated. As such I've had to reorganise the graphs, reducing the characters in the URL, and simplifying the presentation, although I wonder whether there is a way to POST the data. I didn't see anything on the site, but seeing as it's a free service, they may not want to be overloaded with complex graphing requirements.

On the plus side there is so much more I feel I can do with the API and the quality is heads and shoulders above anything I did with GD::Graph. There was a suggestion that I use SVG, and on searching CPAN I see Leo has SVG-TT-Graph, which might be good for local graph generation. The only downside at the moment for me with the Google API, is that I need to be connected to the internet. When generating the stats I'm sometimes offline, so Leo's distribution might be a better solution in the long run. Though, if you're looking to produce some nice fancy graphs and don't get too a high hit rate on your site, you would do well to investigate the Google Chart API.

It's been such a good experience I'm thinking of creating a talk about it now for the Perl dates on our World Tour. I've done the Selenium talk to death, so it would be fun to have something else in my repetoire :)