#d3.gsheet(key [, sheet], callback)
Retrieves data from the Google Spreadsheet associated with the spreadsheet key. The optional sheet is a string that corresponds to the name of the desired sheet in the spreadsheet. The default is to read the first sheet. The callback is invoked with an array of objects as the argument, consistent with d3.csv().
To adapt this demo to another spreadsheet, you must:
- Share the spreadsheet so that "Anyone with the link can view" it.
- Obtain the unique spreadsheet key (a long alphanumeric string) from either the "shareable link" or from the URL in the address bar when you edit the spreadsheet in a browser. For example, here is the google spreadsheet used in this demo.
The plugin uses Google's Chart Tools Datasource Protocol.
Note: The plugin uses JSONP. In general, it's a good idea to avoid JSONP because of security issues. The simpler approach uses Google's CORS-enabled servers. But as of Dec 2014, URLs beginning with https://docs.google.com/spreadsheets are not CORS enabled.
The D3 plugin is experimental and has no error checking.