[visualization-api] Google Query link format
Hello, Can someone specify the format that the data source URL is suppose to be in? This is for a Google docs spreadsheet. I've tried the one shown on the API Language Reference page, but I still get a 'Request timed out' error. I'll paste the html code, and if the URL is correct, can anyone see what is wrong with the code? !DOCTYPE html html head script type=text/javascript src=https://www.google.com/jsapi;/script script type=text/javascript google.load(visualization, 1, {packages:[table]}); function initialize() { var query = new google.visualization.Query('https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/pubhtml'); var string = prompt('Enter query:'); query.setQuery(string); query.send(queryResponse); } function queryResponse(response) { if (response.isError()) { alert(response.getMessage() + response.getDetailedMessage()); return; } var data = response.getDataTable(); var table = new google.visualization.Table(document.getElementById('table_div')); alert(data); table.draw(data); } /script /head body button id='query' onclick='initialize()'Enter Query/button div id=table_div/div /body /html -- 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-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
Re: [visualization-api] Google Query link format
Hi Doreen, Your URL is the problem. As the documentation page at https://developers.google.com/chart/interactive/docs/querylanguage says, you need to add '/gviz/tq?tq=' to your URL, without the pubhtml, like this: ' https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/gviz/tq?tq= ' Here is a working version of your code: http://jsfiddle.net/dlaliberte/Ltwe7p1b/ On Wed, Jul 1, 2015 at 9:35 AM, doreent...@gmail.com wrote: Hello, Can someone specify the format that the data source URL is suppose to be in? This is for a Google docs spreadsheet. I've tried the one shown on the API Language Reference page, but I still get a 'Request timed out' error. I'll paste the html code, and if the URL is correct, can anyone see what is wrong with the code? !DOCTYPE html html head script type=text/javascript src= https://www.google.com/jsapi;/script script type=text/javascript google.load(visualization, 1, {packages:[table]}); function initialize() { var query = new google.visualization.Query(' https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/pubhtml' ); var string = prompt('Enter query:'); query.setQuery(string); query.send(queryResponse); } function queryResponse(response) { if (response.isError()) { alert(response.getMessage() + response.getDetailedMessage()); return; } var data = response.getDataTable(); var table = new google.visualization.Table(document.getElementById('table_div')); alert(data); table.draw(data); } /script /head body button id='query' onclick='initialize()'Enter Query/button div id=table_div/div /body /html -- 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-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout. -- Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 - 978-394-1058 dlalibe...@google.com dlalibe...@google.com 5CC, Cambridge MA daniel.lalibe...@gmail.com daniel.lalibe...@gmail.com 9 Juniper Ridge Road, Acton 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
Re: [visualization-api] Google Query link format
Thank you very much. On Wednesday, July 1, 2015 at 10:12:29 AM UTC-4, Daniel LaLiberte wrote: Hi Doreen, Your URL is the problem. As the documentation page at https://developers.google.com/chart/interactive/docs/querylanguage says, you need to add '/gviz/tq?tq=' to your URL, without the pubhtml, like this: ' https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/gviz/tq?tq= ' Here is a working version of your code: http://jsfiddle.net/dlaliberte/Ltwe7p1b/ On Wed, Jul 1, 2015 at 9:35 AM, doree...@gmail.com javascript: wrote: Hello, Can someone specify the format that the data source URL is suppose to be in? This is for a Google docs spreadsheet. I've tried the one shown on the API Language Reference page, but I still get a 'Request timed out' error. I'll paste the html code, and if the URL is correct, can anyone see what is wrong with the code? !DOCTYPE html html head script type=text/javascript src= https://www.google.com/jsapi;/script script type=text/javascript google.load(visualization, 1, {packages:[table]}); function initialize() { var query = new google.visualization.Query(' https://docs.google.com/spreadsheets/d/1CrLw83xkUvISKTwE-etZkwUvLc_To_97af-0Sqr6RKQ/pubhtml' ); var string = prompt('Enter query:'); query.setQuery(string); query.send(queryResponse); } function queryResponse(response) { if (response.isError()) { alert(response.getMessage() + response.getDetailedMessage()); return; } var data = response.getDataTable(); var table = new google.visualization.Table(document.getElementById('table_div')); alert(data); table.draw(data); } /script /head body button id='query' onclick='initialize()'Enter Query/button div id=table_div/div /body /html -- 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 javascript:. To post to this group, send email to google-visua...@googlegroups.com javascript:. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout. -- Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 - 978-394-1058 dlali...@google.com javascript: 5CC, Cambridge MA daniel.l...@gmail.com javascript: 9 Juniper Ridge Road, Acton 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.