akaunting / laravel-apexcharts by denisdulici

ApexCharts package for Laravel
153,024
71
4
Package Data
Maintainer Username: denisdulici
Maintainer Contact: info@akaunting.com (Cüneyt Şentürk)
Package Create Date: 2022-01-26
Package Last Update: 2024-06-03
Home Page: https://akaunting.com
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:09:07
Package Statistics
Total Downloads: 153,024
Monthly Downloads: 7,355
Daily Downloads: 167
Total Stars: 71
Total Watchers: 4
Total Forks: 10
Total Open Issues: 4

ApexCharts package for Laravel

Downloads Tests StyleCI License

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 ApexCharts library.

Check out the Akaunting project to see it live.

Getting Started

1. Install

Run the following command:

composer require akaunting/laravel-apexcharts

2. Publish

Publish configuration

php artisan vendor:publish --tag=apexcharts

3. Configure

You can change the chart settings of your app from config/apexcharts.php file

Usage

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)->setType('donut')
    ->setWidth('100%')
    ->setHeight(300)
    ->setLabels(['Sales', 'Deposit'])
    ->setDataset('Income by Category', '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() !!}

Testing

composer test

Changelog

Please see Releases for more information what has changed recently.

Contributing

Pull requests are more than welcome. You must follow the PSR coding standards.

Security

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see LICENSE for more information.