In Laravel, you can create a Google bar chart using the “laravel-gcharts” package.
composer require consoletvs/charts
.use ConsoleTVs\Charts\Facades\Charts;
class MyController extends Controller {
public function index() {
$chart = Charts::create('bar', 'google')
->title('My Chart')
->elementLabel('Total')
->values([5,10,20,8,12,3])
->dimensions(1000,500)
->responsive(true);
return view('chart', compact('chart'));
}
}
3. In your view, display the chart by calling the chart variable:
<div class="container">
{!! $chart->html() !!}
</div>
You can also customize the chart by passing options like title, labels, colors and more.
Note: Make sure you have enabled the Google Chart API and also have the API key, if you are using Google charts.
भक्तपुरमा नौ दिन आठ रातसम्म परम्परागत विधिअनुसार मनाइने विश्वप्रसिद्ध बिस्का: जात्रा आज चैत २७ गते…
The Woman Who Invented WI-FI. The most beautiful woman in the world in cinema and…
“यस क्षण” कुनै सोच होइन । यो एक मात्र वास्तविकता हो तपाईं आफूलाई अरूसँग तुलना…
Dear SEE Students: तपाईंको नतिजाको Grading system यस्तो रहनेछ ! कुनै पनि विद्यार्थी फेल हुने…
10 essential prompts to boost your productivity: 1. Summarize: "Summarize the text below into 500…
15 powerful ChatGPT prompts to save you 15 hours a week: 1. Use the 80/20…
This website uses cookies.