Hi i have a project where am making pie chart in my dashboard.the problem am facing is that i have one column that accepts multiple checkbox value.
I have attached an image on how it appears Pie chart So i was asking if somebody would help me so the values can be presented individually not as group.` This is my source code
include("fusioncharts.php");
$hostdb = "localhost"; // MySQl host
$userdb = "root"; // MySQL username
$passdb = ""; // MySQL password
$namedb = "school"; // MySQL database name
$dbhandle = new mysqli($hostdb, $userdb, $passdb, $namedb);
if ($dbhandle->connect_error) {
exit("There was an error with your connection: ".$dbhandle->connect_error);
}
$strQuery = "SELECT combination, COUNT(combination) FROM schools GROUP BY combination order by COUNT(combination)";
$result = $dbhandle->query($strQuery) or exit("Error code ({$dbhandle->errno}): {$dbhandle->error}");
if ($result) {
$arrData = array(
"chart" => array(
"caption" => "Numbers of Schools Based on Different Combination",
"theme" => "fusion",
"caption" => "",
"showPercentInTooltip" => "0",
"enableMultiSlicing" =>"1",
)
);
$data = array();
$arrData["data"] = array();
while($row = mysqli_fetch_array($result)) {
array_push($arrData["data"], array(
"label" =>$row["combination"] ,
"value" => $row["COUNT(combination)"]
)
);
}
$jsonEncodedData = json_encode($arrData);
$columnChart = new FusionCharts("pie3D", "myFirstChart" , 900, 500, "chart-1", "json", $jsonEncodedData);
$columnChart->render();
$dbhandle->close();
}