Steven, What you are trying to do seems like a long-shot, with several obstacles beyond just getting the SVG string.
But it turns out there is an undocumented 'dump' method on CoreCharts that might work to give you this SVG string, although I believe it depends on first having generated the SVG DOM elements, by calling draw() normally, which requires being in a browser with a visible container element to detect the size of text, and probably several other obstacles. Similar to generating the SVG is generating an image, via a call to getImageURI(). See https://developers.google.com/chart/interactive/docs/printing for details. But you'll note that you get a URI, and this is after you draw the chart normally, so it probably won't help in your server-side application. On Wed, Nov 5, 2014 at 6:54 PM, Steven Noble <[email protected]> wrote: > I would like to patch or replace chart.draw() so that it returns a > "<svg>... </svg>" string to STDOUT instead of finding and updating a DOM > element. > > This will let me generate the SVG on the server side. This is necessary > because I'm sending my HTML document to a PDF generator, not a standard web > browser, and the PDF generator can't cope with the number of > JavaScript-generated charts that are in my document. > > (I've tried embedding a DOM in my server-side JavaScript interpreter using > JSDOM but so far it's not working.) > > Any guidance on how to go about this? > > I'm struggling because I can't see the source code for chart.draw() as > it's currently defined. > > (Also I usually work in Ruby, bringing JavaScript into the mix only when > required.) > > Thanks in advance, > > Steven. > > -- > You received this message because you are subscribed to the Google Groups > "Google Chart API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/google-chart-api. > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 [email protected] <[email protected]> 5CC, Cambridge MA [email protected] <[email protected]> 9 Juniper Ridge Road, Acton MA -- You received this message because you are subscribed to the Google Groups "Google Chart API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-chart-api. For more options, visit https://groups.google.com/d/optout.
