I'm trying to set up a query using a "where" and I don't know what I'm 
doing wrong.

Here is my data 
<https://docs.google.com/spreadsheets/d/1xfb9trifQA5KDPc9Nh5hBL4MJ290Mxcc1Uod2VTPzYI/edit#gid=2117675813>
  
 

If I just do "SELECT B, C" the whole code works but when introducing the 
where is when the problem came up. so the issue is in 'SELECT B, C where B='
Alabama''

Thank you very much

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi";
></script>
    <script type="text/javascript">
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawSheetName);


function drawSheetName() {


    var queryString = encodeURIComponent('SELECT B, C where B='Alabama'');
    var magicIncantation = '/gviz/tq?sheet=Selector&headers=1&tq=';


    var query = new google.visualization.Query(
        
'https://docs.google.com/spreadsheets/d/1xfb9trifQA5KDPc9Nh5hBL4MJ290Mxcc1Uod2VTPzYI'
 
+
        magicIncantation + queryString);
    query.send(handleSampleDataQueryResponse);
}


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

       var optionsColumnChart = {
          height: 400,
          title: 'This is the title On Column Chart',
        };

    var data = response.getDataTable();

    var chart = new google.visualization.ColumnChart(document.getElementById
('Columnchart_div'));
    chart.draw(data, optionsColumnChart);
}


</script>


  </head>
  <body>
        <div id="Columnchart_div" style="width: 100%;"></div>
  </body>
</html>

-- 
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 http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/d8a710ec-0891-4c67-b570-058e4047c416%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to