OP said he was interested in doing it on the server, but doing it on the client can reduce server load and perhaps that will work for you. You could take the SVG and render it to a canvas and then export the canvas to PNG. Here is a javascript library which does such a thing.
http://www.nihilogic.dk/labs/canvas2image/ Thanks, Derek On Monday, July 2, 2012 3:48:04 AM UTC-7, Martin Felder wrote: > > Hi Andrew, > > I'm currently looking for a good data vis toolkit for web2py. Currently we > are plotting things with matplotlib in the background and display the > generated PNGs, but that feels rather awkward and is not interactive (ok, I > could generate SVGs and fiddle with them using StringIO and XML parsing, > but that seems to convoluted to me). > > Since my MS Office using clientele can't deal with SVGs, I'm very > interested in how the PNG conversion issue turns out. > > Coming back to your offer, could you perhaps post a simple example on how > to integrate web2py and d3.js? For now I'm particularly interested in the > ingenious barcharts example on http://mbostock.github.com/d3/ex/stack.html- > how do I replace the faux data generation functions with a web2py > controller passing a data array? > > Thanks, > Martin > >