Having posted the original request I thought I had better follow up with what I actually did...

It looked like plotkit would do what I want, and was easy to generate data for within the main web page (so don't need 2 http round trips and carrying state between them). However plotkit does not support legends on graphs - and since I was generating some with lots of lines, this was pretty much a must have.

I found that WebFX Chart ( http://webfx.eae.net/dhtml/chart/ chart.html ) had support for a legend. It generally works well although a few things are a bit "lumpy" - handling of axes etc.

The implementation is a little bit of a hack, but basically I have a graph method in each of the graphable controllers, this passes a DBIx::Class resultset to a build_graph method in a common superclass, which pushes a graph structure into the stash (containing a set of lines, each with an array of values, a min and a max value). A TT fragment in the view converts this into a set of js calls for WebFX Chart.

This works acceptably - it has a few performance issues for large graphs, which appear to be down to the overhead in pulling out and building into objects the several hundred rows of data - I suspect that if I just took the values from a dbh rather than letting DBIC create a new row object the whole thing would speed up rather dramatically.

        Nigel.
--
[ Nigel Metheringham           [EMAIL PROTECTED] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]





_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to