title: Uncaught TypeError: Cannot set property 'data' of undefined
body: <p>I am currently writing an application that displays some graphical user information in pie charts. To parse the pie chart data I return this to an JSON array</p>
  
  <pre><code>$result = array(); while($obj = sqlsrv_fetch_array($stmt)) { $row[] = $series[0]; $row[] = $obj[0]; $row1[] = $series[1]; $row1[] = $obj[1]; $row2[] = $series[2]; $row2[] = $obj[2]; $row3[] = $series[3]; $row3[] = $obj[3]; $row4[] = $series[4]; $row4[]
  = $obj[4]; $row5[] = $series[5]; $row5[] = $obj[5]; } array_push($result,$row); array_push($result,$row1); array_push($result,$row2); array_push($result,$row3); array_push($result,$row4); array_push($result,$row5); echo json_encode($result);}else{ //
  Fallback behaviour goes here echo "No Data\n"; }
  </code></pre>
  
  <p>This pushes all my result to the array, I am then using Highcharts to display this information in the chart,</p>
  
  <pre><code>$.getJSON(url, function(json) {
      for ($x = 0; $x &lt;= 5; $x++) {
          options.series[$x].data = json;
          chart = new Highcharts.Chart(options);
       }
  });
  </code></pre>
  
  <p>When I run a Chrome inspector on this it returns the error, </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot set property 'data' of undefined</p>
  </blockquote>
  
  <p>This is then throwing some of my testing of as it is giving a false positive failure. The information is returning correctly so there does not seem to be an issue with the code.</p>
  
  <p>Is there anyway to get rid of this error.</p>
  
  <p>Thanks,</p>