title: Set Query Range Google Charts
body: <p>How would I go about defining the range I want my chart to grab data from. Using this example where do I set query range? I would like to start building some webpages with charts linking to my spreadsheet data. Thank you!</p>
  
  <pre><code>google.load("visualization", "1", {packages:["corechart"]});
  
  function initialize() {
      var opts = {sendMethod: 'auto'};
      // Replace the data source URL on next line with your data source URL.
      var query = new google.visualization.Query('http://spreadsheets.google.com/tq?key=0AnD0SFr9ooPgdG83Wm&amp;transpose=0&amp;headers=1&amp;merge=COLS&amp;range=A1%3AA5%2CB1%3AC5&amp;gid=0&amp;pub=1', opts);         
      -
      // Optional request to return only column C and the sum of column B, grouped by C members.
      //query.setQuery('select C, sum(B) group by C');
  
      // Send the query with a callback function.
      query.send(handleQueryResponse);
  }
  
  function handleQueryResponse(response) {
    if (response.isError()) {
      alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
      return;
    }
  
  var data = response.getDataTable();
  
  var options = {
  title: 'Company Performance'
  };
  
  var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
  chart.draw(data, options);
  }
  
    google.setOnLoadCallback(initialize);
  </code></pre>