--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@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/1a96bbd6-a250-42f4-a520-4886b821e157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The callback is the clever way to ensure that non of your charts-dependent javascript runs until the library is loaded. You might want to use the 'callback' property on your google.charts.load() call instead of using the separate setOnLoadCallback method.The library loading has always been asynchronous. If it worked before for you without using the callback, you were just lucky. It could appear to work faster if you have previously loaded the library into your browser where it is cached for faster loading the next time.
On Tue, Jul 5, 2016 at 12:40 PM, Evan Koch <evan...@gmail.com> wrote:
Just recently, we converted our website to use the new library loading procedures outlined in the documentation (from google.load('visualization') to google.charts.load)As soon as the page loads, we have javascript firing that uses the google charts library. We have the call to load the library within the <head> tag.Previously, we never had issues with synchronization. If we did google.load('visualization', '1.0', 'packages': { ['corechart'] }); by the time we go to our javascript, it would execute properly with no exceptions. Now that we're using the current library loading procedure, we're getting errors at runtime which suggest the visualization library is still loading by the time our javascript runs.Is the library loading method asynchronous? I couldn't find anything explicitly in the documentation that said so, though it seems like it is, and that makes sense. I realize there is a feature to use a callback, which is nice as you're waiting for the library to load, but I was curious if there was any way to override that call to make it synchronous?Additionally, if any users have come across a clever way to ensure that none of your charts-dependent javascript runs until that library is loaded, that would be helpful. I'm not quite sure what our best approach is going to be, but I'm trying to blend our already-working code into this new library feature.
--
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 google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@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/1a96bbd6-a250-42f4-a520-4886b821e157%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.