Skip to content

Commit 056b3c4

Browse files
Merge pull request #268 from contactashish13/issue-267
Provide the PNG URL of the rendered chart in the console #267
2 parents 72cb2fa + 4d6ffd7 commit 056b3c4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

js/render.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/* global google */
22
/* global visualizer */
33
/* global console */
4+
5+
// this will store the images for each chart rendered.
6+
var __visualizer_chart_images = [];
7+
48
(function(v, g) {
59
var gv;
610

@@ -201,6 +205,15 @@
201205

202206
v.override(settings);
203207

208+
g.visualization.events.addListener(render, 'ready', function () {
209+
var arr = id.split('-');
210+
try{
211+
__visualizer_chart_images[ arr[0] + '-' + arr[1] ] = render.getImageURI();
212+
}catch(error){
213+
console.warn('render.getImageURI not defined for ' + arr[0] + '-' + arr[1]);
214+
}
215+
});
216+
204217
render.draw(table, settings);
205218
};
206219

0 commit comments

Comments
 (0)