Embed API + Charts API Error

71 views
Skip to first unread message

Drew Hayward

unread,
Jun 5, 2017, 2:01:35 PM6/5/17
to Google Visualization API
I am trying to make a dashboard with both the Embed API and the Visualization API. I can get both to install and run, but it appears to cause errors on the draw() of charts.
I get a "You called the draw() method with the wrong type of data rather than a DataTable or DataView" when inputting the datatable from the Embed API query.

Some forums have said it was an error from using both the old and new loader.

Currently I load:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
And then in a separate script directly after:
// Load script provided in the Google Analytics Docs
loadGAnalytics();

google.load = google.load || google.charts.load;
google.setOnLoadCallback = google.setOnLoadCallback || google.charts.setOnLoadCallback;

google.charts.load('current', { packages: ['corechart', 'table', 'line', 'geochart'] });

Thank you!

Daniel LaLiberte

unread,
Jun 5, 2017, 3:03:54 PM6/5/17
to Google Visualization API
Hi Drew,

Are you using both the jsapi and gstatic charts/loader.js in the document for a reason?  This is generally not a good idea, and you should probably just switch to the newer gstatic charts/loader.js.

--
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/cc321de9-1875-4d6f-bc9d-caacb52ced42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Drew Hayward

unread,
Jun 5, 2017, 3:23:25 PM6/5/17
to Google Visualization API
I realized that was in there after I posted. That was from failed troubleshooting. I removed it and am still getting the same chart draw error when using the response.datatable from the the Embed API query. I checked the object literal in the console and it appears to match the format detailed here.

Thank you for the reply!


On Monday, June 5, 2017 at 3:03:54 PM UTC-4, Daniel LaLiberte wrote:
Hi Drew,

Are you using both the jsapi and gstatic charts/loader.js in the document for a reason?  This is generally not a good idea, and you should probably just switch to the newer gstatic charts/loader.js.
On Mon, Jun 5, 2017 at 2:01 PM, Drew Hayward <dreww...@gmail.com> wrote:
I am trying to make a dashboard with both the Embed API and the Visualization API. I can get both to install and run, but it appears to cause errors on the draw() of charts.
I get a "You called the draw() method with the wrong type of data rather than a DataTable or DataView" when inputting the datatable from the Embed API query.

Some forums have said it was an error from using both the old and new loader.

Currently I load:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
And then in a separate script directly after:
// Load script provided in the Google Analytics Docs
loadGAnalytics();

google.load = google.load || google.charts.load;
google.setOnLoadCallback = google.setOnLoadCallback || google.charts.setOnLoadCallback;

google.charts.load('current', { packages: ['corechart', 'table', 'line', 'geochart'] });

Thank you!

--
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.



--

Daniel LaLiberte

unread,
Jun 5, 2017, 4:11:02 PM6/5/17
to Google Visualization API
Can you point us at a web page that causes this error, so we can investigate what is happening?

On Mon, Jun 5, 2017 at 3:23 PM, Drew Hayward <dreww...@gmail.com> wrote:
I realized that was in there after I posted. That was from failed troubleshooting. I removed it and am still getting the same chart draw error when using the response.datatable from the the Embed API query. I checked the object literal in the console and it appears to match the format detailed here.

Thank you for the reply!

On Monday, June 5, 2017 at 3:03:54 PM UTC-4, Daniel LaLiberte wrote:
Hi Drew,

Are you using both the jsapi and gstatic charts/loader.js in the document for a reason?  This is generally not a good idea, and you should probably just switch to the newer gstatic charts/loader.js.
On Mon, Jun 5, 2017 at 2:01 PM, Drew Hayward <dreww...@gmail.com> wrote:
I am trying to make a dashboard with both the Embed API and the Visualization API. I can get both to install and run, but it appears to cause errors on the draw() of charts.
I get a "You called the draw() method with the wrong type of data rather than a DataTable or DataView" when inputting the datatable from the Embed API query.

Some forums have said it was an error from using both the old and new loader.

Currently I load:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
And then in a separate script directly after:
// Load script provided in the Google Analytics Docs
loadGAnalytics();

google.load = google.load || google.charts.load;
google.setOnLoadCallback = google.setOnLoadCallback || google.charts.setOnLoadCallback;

google.charts.load('current', { packages: ['corechart', 'table', 'line', 'geochart'] });

Thank you!

--
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+unsubscr...@googlegroups.com.



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Drew H

unread,
Jun 6, 2017, 8:05:45 AM6/6/17
to Google Visualization API
Sadly the site is internal and the changes I'm making are not published. Here is the page controller I'm using. Here is the chart directive. I'm afraid that's all I can give you as far as source.


On Monday, June 5, 2017 at 4:11:02 PM UTC-4, Daniel LaLiberte wrote:
Can you point us at a web page that causes this error, so we can investigate what is happening?
On Mon, Jun 5, 2017 at 3:23 PM, Drew Hayward <dreww...@gmail.com> wrote:
I realized that was in there after I posted. That was from failed troubleshooting. I removed it and am still getting the same chart draw error when using the response.datatable from the the Embed API query. I checked the object literal in the console and it appears to match the format detailed here.

Thank you for the reply!

On Monday, June 5, 2017 at 3:03:54 PM UTC-4, Daniel LaLiberte wrote:
Hi Drew,

Are you using both the jsapi and gstatic charts/loader.js in the document for a reason?  This is generally not a good idea, and you should probably just switch to the newer gstatic charts/loader.js.
On Mon, Jun 5, 2017 at 2:01 PM, Drew Hayward <dreww...@gmail.com> wrote:
I am trying to make a dashboard with both the Embed API and the Visualization API. I can get both to install and run, but it appears to cause errors on the draw() of charts.
I get a "You called the draw() method with the wrong type of data rather than a DataTable or DataView" when inputting the datatable from the Embed API query.

Some forums have said it was an error from using both the old and new loader.

Currently I load:
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
And then in a separate script directly after:
// Load script provided in the Google Analytics Docs
loadGAnalytics();

google.load = google.load || google.charts.load;
google.setOnLoadCallback = google.setOnLoadCallback || google.charts.setOnLoadCallback;

google.charts.load('current', { packages: ['corechart', 'table', 'line', 'geochart'] });

Thank you!

--
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.



--

--
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.



--

Daniel LaLiberte

unread,
Jun 6, 2017, 9:07:47 AM6/6/17
to Google Visualization API
Nothing jumps out as a problem, but that's not saying much.

I think it might be best for you to create a very simple case outside of your intranet, using jsfiddle or similar.  If it works, then you know that much and maybe you can expand it until it breaks. If the simple case doesn't work, then we have something to go on.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.



--

--
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+unsubscr...@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.



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--

Drew H

unread,
Jun 7, 2017, 1:27:31 PM6/7/17
to Google Visualization API
I solved the issue. I needed to pass the datatable object from the embed api query into the viz datatable constructor. Thank you for your help.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

--
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.



--

--
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.



--
Reply all
Reply to author
Forward
0 new messages