The answer depends on what you are using to draw the charts. Are they all
part of a single
Dashboard<https://developers.google.com/chart/interactive/docs/gallery/controls#dashboardobject>object?
If so, then you just need to hook up a "ready" event listener on
the dashboard and you're all set:
google.visualization.events.addListener(dash, 'ready', function () {
// all done!
});
If your charts are separate, then you have to create an object to track
their ready states of each chart individually and test the state of that
object in a "ready" event listener for each chart:
var chartsReady = {
chart1: false,
chart2: false,
chart3: false
};
function allChartsReady () {
for (var x in chartsReady) {
if (!chartsReady[x]) {
// at least one chart isn't ready, so quit
return false;
}
}
// all charts are ready,
}
google.visualization.events.addListener(chart1, 'ready', function () {
chartsReady['chart1'] = true;
allChartsReady();
});
google.visualization.events.addListener(chart2, 'ready', function () {
chartsReady['chart2'] = true;
allChartsReady();
});
google.visualization.events.addListener(chart3, 'ready', function () {
chartsReady['chart3'] = true;
allChartsReady();
});
On Saturday, March 9, 2013 6:36:18 AM UTC-5, Daniel K wrote:
>
> Hey there,
>
> I'm working on a webpage that uses a lot of diferent Google charts.
> Consequently it takes a few seconds until all the visualizations are drawn.
> That delay doesn't look great and therefore I just wanted to open a
> "loading" dialog. For closing that dialog when the visualization is ready I
> need
> to know when every chart is drawn. Is there an event for that? How can I
> access the "building status" of my visualizaions?
>
> Thanks in advance!
>
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.