title: Cannot read property google charts
body: <p>I want to setup google charts via JSON but currently it's not working. The webpage its saying cannot read property of '1' undefined. How to fix this ? Thanks in advance here's my code:</p>
  
  <p>Testing purposes : (Model)</p>
  
  <pre><code>    $table = array();
      $table['cols'] = array(
          array('label' =&gt; 'Name', 'type' =&gt; 'string'),
          array('label' =&gt; 'Value', 'type' =&gt; 'number')
      );
  
      $PR = $CO = $IN = $SP = $SC = 5;
  
  
      $temp[] = array('v' =&gt; 'PR'); 
      $temp[] = array('v' =&gt; $PR);
      $temp[] = array('v' =&gt; 'CO'); 
      $temp[] = array('v' =&gt; $CO);
      $temp[] = array('v' =&gt; 'SCC'); 
      $temp[] = array('v' =&gt; $SC);
      $temp[] = array('v' =&gt; 'IN'); 
      $temp[] = array('v' =&gt; $IN);
      $temp[] = array('v' =&gt; 'SP'); 
      $temp[] = array('v' =&gt; $SP);
  
      $table['rows'] = $temp;
  
      return $table;
  </code></pre>
  
  <p>Controller :</p>
  
  <pre><code>    public function getProjects(){
      $this-&gt;load-&gt;model('mreport');
      $results = $this-&gt;mreport-&gt;getBilling();
      echo json_encode($results);
  
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;?php ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="&lt;?php echo base_url() . 'resources/js/jquery-1.9.1.js' ?&gt;"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="&lt;?php echo base_url() . 'resources/js/jquery-ui-1.10.3.custom.js' ?&gt;"&gt;&lt;/script&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: "&lt;?php echo site_url('report/getProjects'); ?&gt;",
                  dataType: "json",
                  async: false
              }).responseText;
  
              // Create our data table out of JSON data loaded from server.
              var data = new google.visualization.DataTable(jsonData);
  
              // Instantiate and draw our chart, passing in some options.
              var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
              chart.draw(data, {width: 400, height: 240});
          }
  
          var options = {
              title: 'Pie chart',
              is3D: true,
          };
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="chart_div"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>