1

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']."'],"; } ?> ]); } 

1 Answer 1

1

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']."],"; 
Sign up to request clarification or add additional context in comments.

2 Comments

not working still, this is my query SELECT SUM(CASE WHEN PointsArchieved=0 AND Extrapoints=0 AND Finalpoint=0 THEN 1 ELSE 0 END) AS Pend, SUM(CASE WHEN PointsArchieved=0 AND Extrapoints=0 AND Finalpoint=0 THEN 0 ELSE 1 END) AS Attended FROM performance WHERE DATE(AssignDate) = CURDATE()
are you still having issues with this question? what type of chart are you trying to draw?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.