Hi
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.
Controller.
<?php 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') ->addNumberColumn('Votes') ->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); } }
view
@section('content') @barchart('Votes', 'poll_div') @endsection
This is the output in my view. No chart only code.
Please sign in or create an account to participate in this conversation.
Reply to
Use Markdown with GitHub-flavored code blocks.
There's no shortage of content at Laracasts. In fact, you could watch nonstop for days upon days, and still not see everything!
Get Started
Laravel 5.6 using laracharts. Chart wont render
Hi
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.
Controller.
view
This is the output in my view. No chart only code.