Reputation: 53
I am able to see only one option ['Pend']
but ['Attend']
option is not showing from the chart, what is the issue from my code:
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Pend', 'Attended'],
<?php
while($row = mysqli_fetch_array($result))
{
echo "['".$row['Pend']."', '".$row['Attended']."'],";
}
?>
]);
}
Upvotes: 1
Views: 41
Reputation: 61232
the second value in the array should be a number, not a string.
remove the single quotes...
change...
echo "['".$row['Pend']."', '".$row['Attended']."'],";
to...
echo "['".$row['Pend']."', ".$row['Attended']."],";
Upvotes: 1