download google.visualisation charts as an image file

498 views Asked by At

I have access to a html file (stored locally as an output from a program) where in the generated page, it contains pie charts. I want to be able to download these pie charts as .png. LOoking at the page source I find this:

google.visualization.events.addListener(consequences_pie, 'select', function() {
              consequences_table.setSelection(consequences_pie.getSelection());
            });

How to I scrape the pie chart produced? I understand this can be built in using the google API, however I have no control over the generation of page.

thanks very much.

1

There are 1 answers

0
HerrWagner1680 On

You can download a chart as a PNG file.

see project: https://gist.github.com/battlehorse/1333906

demo of script: http://bl.ocks.org/nverba/raw/5411684/

there are two minor updates needed for the code to work: Can Google Visualization: Pie Chart output to a PNG image?

I'm not associated with "battlehorse", but I have played with Google Charts a bit, and these three links helped me out.