Many, if not most, charts are drawn asynchronously. There are several reasons for this potential asynchrony, but if you need to wait until the chart has been drawn, then you want to listen for the 'ready' event. See how to handle events here:
https://developers.google.com/chart/interactive/docs/events#the-ready-event On Mon, Jun 12, 2017 at 11:22 AM, 'Ray Thomas' via Google Visualization API <[email protected]> wrote: > Just when I thought I was getting ahead with the Visualizations, I find > I'm not. > > https://jsfiddle.net/brisray/qsgewt2d/ - works as far as I have it, but I > have a question about it. > > Once the graphs are drawn, I assumed that control would pass back to > "mainFunction". This is a function that loops through the object array I > made creating the queries, then calls other functions that draws the tables > and charts. I was hoping to add more code to that function to call other > functions for other things I want to do. > > What I find is that it doesn't work that way. A simple JS alert AFTER the > loop shows none of the drawing is done until the alert is acknowledged. > > Am I missing something? Perhaps an event handler that's triggered after > the last of the array is processed and the last of the initial graphs drawn? > > Is there something fundamentally wrong with the code and the way I've > written it? > > Ray > > -- > 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 google-visualization-api@ > googlegroups.com. > Visit this group at https://groups.google.com/ > group/google-visualization-api. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/google-visualization-api/f92a1a4b-9758-454b-9694- > b6f1702bd3a2%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/f92a1a4b-9758-454b-9694-b6f1702bd3a2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge MA -- 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 https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJOrAKLsrob_hHD14Ao020yezAGOL%3DXgDfA2aCGrXKnuPQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
