I have tried to implement this but didn't found success. Please help me in implementation of this. Thanks in advance
1. This is my Controller code.
public function dashboard()
{
$project2 = DB::select("SELECT sector, COUNT(id) AS T_PROJ`enter code here`
FROM project_tbl
GROUP BY sector
ORDER BY sector");
$Users = Lava::DataTable();
$Users->addStringColumn('Sector');
$Users->addNumberColumn('Total Projects');
foreach($project2 as $ROW_PIE)
{
$Users->addRow([$ROW_PIE->sector,$ROW_PIE->T_PROJ]);
}
Lava::PieChart('sector_wise', $Users, [
'title' => 'Sector Wise Projects',
'is3D' => true,
'width' => 450,
'height' => 290,
'pieSliceText' => 'value',
'slices' => [
['offset' => 0.2],
['offset' => 0.3]
]
]);
}
2. This is my View's code
<div>
<div id="sector_wise"></div>
<?= Lava::render('PieChart', 'sector_wise', 'sector_wise') ?>
</div>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire