Google Charts connection with Google Sheets

Skip to first unread message

Delsuc Evangelista

Jan 18, 2022, 1:09:20 PMJan 18
to Google Visualization API
I created a spreadsheet in Google Sheets and shared it with everyone, however, I can't connect to it through Google Charts! Below the link: I would appreciate some sample code with this link. Thanks

Delsuc Evangelista

Jan 18, 2022, 2:18:35 PMJan 18
to Google Visualization API
Error:   Request timed out

Ray Thomas

Jan 29, 2022, 3:35:12 AMJan 29
to Google Visualization API
Apart from the loader.js and a div to hold the chart, this will work:

<script type="text/javascript">
  function drawVisualization() {
      "containerId": "chart_div",
      "dataSourceUrl": "",
      "query":"SELECT A,B",
      "chartType": "ColumnChart",

Are you testing the code from a local file on your computer? That will give you a "Request timed out" timed out message and that's due to your browser's CORS (Cross-Origin Resource Sharing) policy. For most browsers you can see what is going on by going onto developer mode by pressing F12 or Ctrl + Shift + i or Ctrl + shift + j.

In Chrome you will see a message similar to this 

Access to XMLHttpRequest at '' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Your HTML file will need to be uploaded to a web server to work.

I use Dreamweaver and the preview in that shows this, so everything else looks fine.


THE API has some help for using Google Sheets as a data source at and more help on the query language at

Reply all
Reply to author
0 new messages