Laravel 5.6 using laracharts. Chart wont render

Posted 1 year ago by andremac96


I'm trying to test out laracharts using laravel 5.6. The chart doesn't print out in the view, only the code in text form.



namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Khill\Lavacharts\Lavacharts;

class HomeController extends Controller

    public function index()

        $votes  = Lava::DataTable();

        $votes->addStringColumn('Food Poll')
              ->addRow(['Tacos',  rand(1000,5000)])
              ->addRow(['Salad',  rand(1000,5000)])
              ->addRow(['Pizza',  rand(1000,5000)])
              ->addRow(['Apples', rand(1000,5000)])
              ->addRow(['Fish',   rand(1000,5000)]);
        Lava::BarChart('Votes', $votes);
        $data['votes'] = Lava::BarChart('Votes', $votes);

        return view('pages/home', $data);



@barchart('Votes', 'poll_div')


This is the output in my view. No chart only code.

enter image description here

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.