[Chicago-talk] Looking for browser-based charting through Perl

David Young davidy at nationalcycle.com
Thu Aug 26 08:10:26 PDT 2010


I just finished a project creating bar and line charts.  I tried and liked
"flot" alot, but it couldn't exactly do what I wanted.  So I abandoned it
and ended up using jqplot.  jqplot uses a hugely popular and powerful
javascript library called jquery.  With jqplot, you have perl create a JSON
formatted string of your data, axis labels, title, etc, and give it to
jqplot.  jqplot then uses javascript to plot it by inserting the
plot/chart/graph in an empty <div> on your webpage.  Pretty slick.

I've attached a test HTML file that shows output generated from perl code.
 You would use something like this in your perl after creating $json &

   # TrendChart
    $JQPLOT  = qq(
        \$(document).ready(function () {

           var graph = $json;
           \$.jqplot('chart3', graph.data, $opts)

You'll need to download and install jquery and jqplot and adjust the
<script> tag paths to make it work.


On Thu, Aug 26, 2010 at 9:19 AM, Sean Blanton <sean at blanton.com> wrote:

> I followed this month's exchange on Google Visualizations, but that's out
> for me since it requires internet connectivity. What other packages would
> people recommend? I assume a JavaScript based package is the modern way to
> go. What about Protovis?
> I basically want to pull data from a database and chart it with Perl - time
> series, scatter plots, bar graphs - simple things on a local network. Chrome
> browser. It's possible I might want to do something more interesting later
> down the road.
> Not being a web guy, what general approach would you recommend? I breathe
> Moose, DBI, XML and infrastructure every day, but not so much JavaScript,
> though I'm always up for new things!.
> Thanks,
> Sean
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20100826/f3138bdd/attachment.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20100826/f3138bdd/attachment-0001.html>

More information about the Chicago-talk mailing list