Simon,

Regarding how you load the Google Charts library, you must not mix the old
google.load and google.setOnLoadCallback methods with the new
google.charts.load and google.charts.setOnLoadCallback methods.  It is best
to use only the new methods.  So you will have to load
https://www.gstatic.com/charts/loader.js.

But, since you are doing a Map chart, you need to do one more thing, until
we fix this limitation.  And that is, you ALSO need to load "
https://www.google.com/jsapi";, but don't do any autoloading.  This is
because the Map chart still uses the old loader to load map data.  So, like
this...

<script type="text/javascript" src="https://www.google.com/jsapi";></script>
<script type="text/javascript" src="https://www.gstatic.com
<https://www.google.com/jsapi>/charts/loader.js"></script>
        <script type="text/javascript">
            *google.charts*.load("current", {packages:["map"]});
            *google.charts*.setOnLoadCallback(drawVisualization);


On Tue, Mar 15, 2016 at 7:12 PM, 'Simon Banton' via Google Visualization
API <[email protected]> wrote:

> Further to this, I have eliminated the "req id" error in Chrome by
> replacing the jsapi autoload:
>
>         <script type="text/javascript" src='
> https://www.google.com/jsapi?autoload={
>             "modules":[{
>                 "name":"visualization",
>                 "version":"1"
>             }]
>         }'></script>
>
>         <script type="text/javascript">
>             google.charts.load("current", {packages:["map"]});
>             google.setOnLoadCallback(drawVisualization);
>             var wrap;
>
> with the following:
>
> <script type="text/javascript" src="https://www.google.com/jsapi";
> ></script>
>
>         <script type="text/javascript">
>             google.load("visualization", "1");
>             google.charts.load("current", {packages:["map"]});
>             google.setOnLoadCallback(drawVisualization);
>             var wrap;
>
>
>
> However, this now causes the intermittent occurrence of the error : "You
> called the draw() method with the wrong type of data rather than a
> DataTable or DataView".
>
> This seems to be entirely down to network response time - reloading (or
> shift reloading) will result in the map appearing rather than the error.
> This is completely reproducible.
>
> Here is a link to the page using the new code that doesn't trigger the
> Chrome console warning about missing req id but instead has the
> intermittent new error:
>
> http://web.org.uk/tmp/barrowmap/v13.html
>
> From this I surmise that the Chrome "req id" error is related to the
> autoload mechanism for jsapi
>
> So I have swapped one error (req id) for a different, intermittent, one
> (wrong type of data). Is there a way to correct this new error?
>
> If there is, perhaps we can return to my original query :-)
>
> Regards
> Simon
>
> --
> 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/84cebc91-b127-47f0-b7cf-d6d937d5bec8%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/84cebc91-b127-47f0-b7cf-d6d937d5bec8%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/CAOtcSJNXqyzUq29sgZe3LvuwtE%2BseqPhQDhQO7z4eH7cjqb1FQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • Re: [visualization-api] C... 'Daniel LaLiberte' via Google Visualization API
    • Re: [visualization-a... 'Simon Banton' via Google Visualization API
      • Re: [visualizati... 'Daniel LaLiberte' via Google Visualization API
        • Re: [visuali... 'Simon Banton' via Google Visualization API
          • Re: [vis... 'Simon Banton' via Google Visualization API
            • Re:... 'Daniel LaLiberte' via Google Visualization API
              • ... 'Simon Banton' via Google Visualization API
                • ... 'Simon Banton' via Google Visualization API
                • ... 'Sergey Grabkovsky' via Google Visualization API

Reply via email to