I managed to sort it out!!
On Tuesday, 18 March 2014 16:39:26 UTC, OM G wrote:
>
> Hi
>
> I have managed connect the pie chart to mysql and I am trying to get the
> chart to show how many task is completed and incomplete.
> Right now it just shows me 3 complete and 3 incomplete which is not
> correct. I will really grateful if someone can help me out on this. Thanks
>
> This is my table
> task_id status
> 1 complete
> 2 complete
> 3 incomplete
>
> Here is my code
> <?php
> $query = "SELECT COUNT(status) FROM goal WHERE account_id =$account_id";
> $result = mysqli_query($con,$query) or die(mysqli_error());
> list($row) = mysqli_fetch_array($result);
> ?>
>
> function drawChart() {
> var data = google.visualization.arrayToDataTable([
> ['', ''],
> ['complete', <?php echo $row; ?>],
> ['Incomplete', <?php echo $row; ?>]
> ]);
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.