I have completed my work till gets the SQL table data in excel but I also want to convert data into a Bar chart using PHPEXCEL. Anyone have any idea? how to do that? My PHPEXCEL code is below,
$sql = "SELECT sum(Ticket) AS count, Applications FROM Temp_table GROUP BY Apps";
$result = $conn->query($sql);
if($result->num_rows > 0)
{
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);
$rownumber = 2;
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Applications');
$objPHPExcel->getActiveSheet()->setCellValue('B1', 'Count');
while($row = $result->fetch_assoc())
{
$objPHPExcel->getActiveSheet()->setCellValue('A'.$rownumber, $row["Applications"]);
$objPHPExcel->getActiveSheet()->setCellValue('B'.$rownumber, $row["count"]);
$rownumber++;
}
$objPHPExcel->getActiveSheet()->setTitle('Sheet1');
}
Here is the code for bar chart