I am trying to create a dashboard to represent some data I have in a google 
spreadsheet and I have followed the charts guides the best I know how since 
I am no programmer. I have come up with the script below which is not 
working and I would like some help in getting it to work.

The link to my speadsheet:
https://docs.google.com/spreadsheets/d/1L2wjSj0IYSrA-dwYYly6rjmtw_zMCB6l7FB5B-rcvZc/edit#gid=1303777890

The data I am trying to show as a column chart is in Sheet2 (Data2) columns 
D and E (highlighted), and I added that range to the url query "range=D:E"

The code that I have come up with is below. I just want to get it to show 
the chart. Any help is appreciated.

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script>
    <script type="text/javascript">

      // Load the Visualization API and the corechart package.
      google.charts.load('current', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.charts.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      
function drawSheetName() {
      var queryString = encodeURIComponent('SELECT D, E');

      var query = new google.visualization.Query(
          
'https://docs.google.com/spreadsheets/d/1L2wjSj0IYSrA-dwYYly6rjmtw_zMCB6l7FB5B-rcvZc/edit#gid=1303777890range=D:E');
      query.send(handleSampleDataQueryResponse);
    }

    function handleSampleDataQueryResponse(response) {
      if (response.isError()) {
        alert('Error in query: ' + response.getMessage() + ' ' + 
response.getDetailedMessage());
        return;
      }

      var data = response.getDataTable();
      var chart = new 
google.visualization.ColumnChart(document.getElementById('chart_div'));
      chart.draw(data, { height: 400 });
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/38759d72-0972-494c-96a3-36f3730ff2cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to