You need to wait for the chart's ready event. Replace this code:
var chart = new
google.visualization.ScatterChart(document.getElementById('chart_div'))
chart.draw(data, options);
document.getElementById('png').outerHTML = '<a href="' +
chart.getImageURI() + '">Printable version</a>';
with this:
var chart = new
google.visualization.ScatterChart(document.getElementById('chart_div'));
google.visualization.events.addListener(chart, 'ready', function () {
document.getElementById('png').outerHTML = '<a href="' +
chart.getImageURI() + '">Printable version</a>';
});
chart.draw(data, options);
On Wednesday, February 26, 2014 9:37:18 AM UTC-5, Bastiaan Kars wrote:
>
>
>
> Op woensdag 26 februari 2014 14:47:41 UTC+1 schreef Bastiaan Kars:
>>
>> Hi guys,
>>
>> I have a problem with the getImageURI() function. If I call the following
>> code in html, the vaxis title isn't added to the resulting png.
>>
>> document.getElementById('png').outerHTML = '<a href="' +
>> chart.getImageURI() + '">Printable version</a>';
>>
>> However, the haxis title and the chart title are included in the png.
>>
>> I'll hope you can help me.
>>
>> Bastiaan
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization 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-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.