How can I populate data from Google Spreadsheet?

Step 1

Go to your Google Drive and create a new spreadsheet document.

Step 2

The first line of the spreadsheet should contain the series titles. The second line of the spreadsheet must contain the type of series’ data. You may use one of six data types: string, number, boolean, date, time date, and time of day. The other lines need to contain data values according to the data type chosen.

Step 3

After you enter your data, save the spreadsheet and click on "File" > "Publish to the Web…" menu item.

Step 4

In the new dialog, you need to click the "Start publishing" button. A link to the published item appears in the publishing dialog.

Choose "CSV (comma-separated values)" type and select the box below "Get a link to published data" sub header and copy link to the published spreadsheet at the text area below.

Step 5

After you've published your spreadsheet, create a new chart or edit existing one and go to the second step, which allows you to upload your CSV file. Expand the "Import data from URL" sidebar menu and click on the "One time import" menu. Then enter the published link into the URL field and click "Import". After you have entered the link, it will be automatically uploaded and a chart preview with the data will be updated.

  

Use a subset of the spreadsheet

Let's say you have a document with many columns but you only want to use a subset of the data. You can fetch a subset of the data using the Google Query Language. Let's assume you have the following columns in the sheet and want to extract only columns AC and E from it.

Step 1

Click on "File" > "Publish to the Web…" menu item.

Step 2

In the new dialog, you need to click the "Start publishing" button. A link to the published item appears in the publishing dialog. Do not choose Choose "CSV (comma-separated values)" type.

Step 3

Using Google Query Language write down the query that most accurately fetches the subset of data. In this example, the query would be

select A,C,E

Use the encoder as below to get the correctly encoded query and copy it.

To test whether this fetches the subset of data, add the following to the end of the URL that is displaying your spreadsheet.

gviz/tq?tq=<QUERY>&tqx=out:csv

as below

This will download the subset in CSV form. This is the URL you will provide in the plugin as in Step 5 above.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.