Hello, use lavacharts, very simple documentation and graphics handling
- > link
A practical example:
Controller -
use Illuminate\Support\Facades\DB;
use Khill\Lavacharts\Lavacharts;
public function laudo(Request $request)
{
$id = $request->input('id');
//resultado de consulta no banco usando DB
$data = DB::table('tb_votes')
->join('tb_pessoa', 'tb_votes.fk_vote', '=', 'tb_pessoa.id')
->where('tb_votes.id', '=', $id)
->select('tb_votes.*', 'tb_pessoa.*')
->get();
//se inicia a contrução do grafico
$lava = new Lavacharts;
$votes = $lava->DataTable();
$votes->addStringColumn('Food Poll')
->addNumberColumn('Votes');
foreach ($data as $datas)
{
$lava->addRow([$datas->numero, $datas->voto]);
}
$lava->BarChart('Votes', $votes);
return view('monitoria.laudoOperador')->with(['lava' => $lava,'data' => $data]);
}