查询新的谷歌电子表格 [英] query to new google spreadsheets
问题描述
我使用google可视化创建了折线图。
代码查询谷歌电子表格。
当我使用普通电子表格(第1行)时,它可以工作。
当我使用新的Google电子表格(第二行的URL)时,我有这个错误:
$ b
查询中的错误:请求超时
我有以下两个不同的URL查询:第一个工作,第二个。
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);
我使用网址来查找正确的格式。我想知道我是否找不到合适的格式,或者新的Google表格不起作用,或者查询的工作方式不同。
如果我只是把URL放在浏览器中:
http://spreadsheets.google.com/tq? key = 1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o
它表示文件不存在(仅在第二种情况下,表格)
这是指向电子表格的链接:
新的Google电子表格(第二个)
)将使用:
https://docs.google.com/spreadsheets/d/ {key} / gviz / tq
基本上,使用docs而不是spreadsheets并添加/ gviz / tq到最后。
在我的示例中,这将是:
https://docs.google.com/spreadsheets/d/1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o/gviz/tq
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
这篇关于查询新的谷歌电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!