Reference Error google is not defined - Following tutorial - Embedding a Chart in a Spreadsheet

893 views
Skip to first unread message

Sayth Renshaw

unread,
Feb 23, 2016, 6:36:57 AM2/23/16
to Google Visualization API
Evening

I hesitate to ask this as I can see its asked everywhere, however there never appears an answer to those questions or they refer to a html response. My end goal is to use this gantt chart embedded in google sheets so I can update change and use it as needed https://developers.google.com/chart/interactive/docs/gallery/ganttchart

Referenced top results.


I am following the guide for Embedding a Chart in a Spreadsheet https://developers.google.com/chart/interactive/docs/spreadsheets#sheet-name and have basically copied the code as such and created a basic 2 column table to test it out.

So my code is in the Sheets Script editor:

function drawChart() {
  query.send(handleQueryResponse);
}

function handleQueryResponse(response) {
  var data = response.getDataTable();
  var chart = new google.visualization.ColumnChart(document.getElementById('columnchart'));
  chart.draw(data, null);
}

Are you able to help me with this?

Thanks

Sayth

Sayth Renshaw

unread,
Feb 23, 2016, 5:55:36 PM2/23/16
to Google Visualization API
How do this work?

Sayth Renshaw

unread,
Feb 23, 2016, 11:45:57 PM2/23/16
to Google Visualization API
Or is this a bug?

Should i report it?

Daniel LaLiberte

unread,
Feb 24, 2016, 9:28:37 AM2/24/16
to Google Visualization API
If you are using the Sheets Script editor, then you need to go through that AppsScripts api to make charts:  https://developers.google.com/apps-script/reference/charts/
I don't see that they support the Gantt chart, however, so you may be out of luck until they do support it.

On Tue, Feb 23, 2016 at 11:45 PM, Sayth Renshaw <flebbe...@gmail.com> wrote:
Or is this a bug?

Should i report it?

--
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/801e78c3-1357-4c13-91e1-46f10d3eccd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages