Chart API + Embed API (Analytics)

405 views
Skip to first unread message

Francesco Moglia

unread,
Feb 16, 2017, 9:27:24 AM2/16/17
to Google Visualization API
I was wondering how to implement both api's in the same document. 

I have a dashboard where i need both chart to display some data and embed api to display data directly from google analytics. 



since trying to do this is throwing thi error:

Uncaught TypeError: window.google.load is not a function
    at g (cb=gapi.loaded_0:890)
    at fV (cb=gapi.loaded_0:890)
    at IP._.k.iba (cb=gapi.loaded_0:906)
    at _.fp._.k.q0 (cb=gapi.loaded_0:491)
    at _.du.Vh (cb=gapi.loaded_0:734)
    at cb=gapi.loaded_0:896
    at h.r2 (cb=gapi.loaded_0:79)
    at xs (cb=gapi.loaded_0:82)
    at Wq (cb=gapi.loaded_0:82)
    at _.C.uea (cb=gapi.loaded_0:81)


Thanks in advance

Daniel LaLiberte

unread,
Feb 16, 2017, 9:36:25 AM2/16/17
to Google Visualization API
Since the Embed API appears to still be depending on the old loader, I wonder what would happen if you just add the following to your code, after loading the new loader.

    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
   
<script type="text/javascript">
google.load = google.load || google.charts.load;
      google.setOnLoadCallback = google.setOnLoadCallback || google.charts.setOnLoadCallback;
      ...
That way, google.load will be defined.  In recent versions of the loader, I made it work with the old loader arguments as well.


--
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-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/dfa85c1d-b386-44d1-b109-9c25db47392a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Francesco Moglia

unread,
Feb 16, 2017, 9:39:59 AM2/16/17
to Google Visualization API
It works like a charm, thank you!
To post to this group, send email to google-visua...@googlegroups.com.



--

Ganesh Chinnappaiyan

unread,
Feb 18, 2017, 4:54:42 AM2/18/17
to Google Visualization API
change tooltip name(current & previous) in google diff chart

drew adams

unread,
Apr 4, 2017, 4:36:53 PM4/4/17
to Google Visualization API
I seriously can't help you enough for posting this. I've been searching how to fix this for 3 days.
To post to this group, send email to google-visua...@googlegroups.com.



--
Reply all
Reply to author
Forward
0 new messages