This package allows you to generate modern and interactive charts using the ApexCharts library directly from Laravel
without interacting with JavaScript, CSS, etc.
It covers all of the chart types and options available within the ApexChart
library.
Run the following command:
composer require akaunting/laravel-apexcharts
Publish configuration
php artisan vendor:publish --tag=apexcharts
You can change the chart settings of your app from config/apexcharts.php
file
First of all, create an instance of the Chart
class and set the data and options according to your needs.
use Akaunting\Apexcharts\Chart;
...
$chart = new Chart();
$chart->setType('donut')
->setWidth('100%')
->setHeight(300)
->setLabels(['Sales', 'Deposit']);
$chart->setDataset('Name', 'donut', [1907, 1923]);
Then, include the JavaScript (on every page using charts).
...
</head>
<body>
...
@apexchartsScripts
</body>
Finally, call the container
and script
method wherever you want to display the chart.
{!! $chart->container() !!}
{!! $chart->script() !!}
Please see Releases for more information what has changed recently.
Pull requests are more than welcome. You must follow the PSR coding standards.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see LICENSE for more information.