title: Inserting dynamic data into Google Pie Chart
body: <p>I have task to insert dynamic data to <code>Google PieChart</code>.</p>
  
  <p><a href="http://code.google.com/apis/ajax/playground/?type=visualization#pie_chart">Playground</a></p>
  
  <p>In that link I insert this code:</p>
  
  <pre><code>function drawVisualization() {
  // Create and populate the data table.
  var data = google.visualization.DataTable();
  
  var mycars=["Saab","Volvo","BMW"];
  var mypoints=[4,12,45];
  
  data.addColumn('string', 'Cars');
  data.addColumn('number', 'Numbers'); 
  data.addRows(mycars.length);
  for  (var i = 0; i &lt; mycars.length; i++){
    data.setCell(i,0,mycars[i]);
    data.setCell(i,1,mypoints[i]);
  }
  // Create and draw the visualization.
  new google.visualization.PieChart(document.getElementById('visualization')).
  draw(data, {title:"So, how was your day?"});
  }
  </code></pre>
  
  <p>​</p>
  
  <p>In the following example I get dynamic arrays <code>mycars</code> and <code>mypoints</code>, then I try to insert those arrays to chart within <code>for loop</code>. </p>
  
  <p>PieChart isn't displaying. What's wrong with that?</p>