I created a line chart using google visualization. The code queries a google spreadsheet. When I use a normal spreadsheet (line 1), it works. When I use a new google spreadsheet (URL on line 2) I have this error:
Error in query: request time out
I have the following two queries with two different URL: the first working, the second no.
var query = new google.visualization.Query('http://spreadsheets.google.com/tq?key=0AgtmZPWzQ7lldEt2S2VLajBRQVNFLV9pRFY2bTRQLVE&transpose=0&headers=1&merge=COLS&range=E2%3AE64%2CF2%3AJ64&gid=0&pub=1', opts);
var query = new google.visualization.Query('http://spreadsheets.google.com/tq?key=1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o&transpose=0&headers=1&merge=COLS&range=A1%3AA100%2CB1%3AF100&gid=0&pub=1', opts);
I played with the URL to find the right format. I am wondering if I cannot find the right format, or if the new google sheets do not work or work differently with queries. If I just put the URL in a browser:
http://spreadsheets.google.com/tq?key=1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o
It says the file does not exist (in the second case only, with the new google sheet) This is the link to the spreadsheet: new google spreadsheet (second one)
It seems one possible solution (from a google spreadsheet project team member) is to use: "https://docs.google.com/spreadsheets/d/{key}/gviz/tq"
Basically, use "docs" instead of "spreadsheets" and add "/gviz/tq" to the end. In my example, that would be:
https://docs.google.com/spreadsheets/d/1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o/gviz/tq
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With