Google Pie Chart Using Array <p>I have tried to implement the following code using an array of two sets of values but the line graph does not show:</p> <pre><code>function drawChart() { var lineTotalDistance = &lt;?php echo json_encode($DistanceTotalArray) ?&gt;; var lineSpeed = &lt;?php echo json_encode($SpeedArray) ?&gt;; //alert(lineTotalDistance.length); //alert(lineSpeed.length); var data = new google.visualization.DataTable(); data.addColumn('number', 'Total Distance'); data.addColumn('number', 'Speed KM/H'); for(var i=0;i &lt; lineTotalDistance.length; i++) { data.addRows([ [lineTotalDistance, lineSpeed ] ]); } } </code></pre>