title: Google charts Uncaught error: Not an array
body: <p>I am getting Uncaught error Not an array. 
  here is my .html file</p>
  
  <pre><code> &lt;html&gt;
      &lt;head&gt;
          &lt;!-- Load jQuery --&gt;
          &lt;script language="javascript" type="text/javascript" 
              src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"&gt;
          &lt;/script&gt;
          &lt;!-- Load Google JSAPI --&gt;
          &lt;script type="text/javascript" src="https://www.google.com/jsapi"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              google.load("visualization", "1", { packages: ["corechart"] });
              google.setOnLoadCallback(drawChart);
  
              function drawChart() {
                  var jsonData = $.ajax({
                      url: "json.php",
                      dataType: "json",
                      async: false
                  }).responseText;
  
  
                  var data = google.visualization.arrayToDataTable($parse.jsonData(jsonData));
  
  
                  var chart = new google.visualization.LineChart(
                              document.getElementById('chart_div'));
                  chart.draw(data, options);
              }
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="chart_div" style="width: 900px; height: 500px;"&gt;
          &lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Here is my json file.php
      
  
  <pre><code>include("dbconfig.inc.php");
  $main= array();
  $rows=array();
  $cols=array();
  
  $main['cols']=array(
      array('label' =&gt; 'id', 'type' =&gt; 'string'),
      array('label' =&gt; 'Q1', 'type' =&gt; 'string')
      );
  $main['rows']=array();
  $sel = "SELECT * FROM mak";
  try {
      foreach($dbh-&gt;query($sel) as $r) {
          $idd=$r['oid'];
          $select = "SELECT * FROM pol WHERE id='".$idd."' "; 
          foreach($dbh-&gt;query($select) as $row) {
              array_push($main['rows'],array('c' =&gt; array(
                                                              array('v' =&gt; $row['id']), 
                                                              array('v' =&gt; $row['pol']), 
                                                              ))  );
  
          }
  
      }
  }
  
  catch(PDOException $e) {
      echo $e-&gt;getMessage();
      die();
  }
  echo json_encode($main);
  
  
  ?&gt;
  </code></pre>
  
  <p>this files output is :
  It is same as the one google charts need, I don't understand where is the problem.
  on doing console.log($parse.JSON(jsonData)); the json object is getting displayed on the console.</p>
  
  <pre><code>{
  "cols":
  [
  {"label":"id","type":"string"},
  {"label":"Q1","type":"string"}
  ],
  "rows":
  [
  {"c":[{"v":"1"},{"v":"123.0000"}]},
  {"c":[{"v":"2"},{"v":"456.0000"}]}
  ]
  }
  </code></pre>