Package Data | |
---|---|
Maintainer Username: | ArielMejiaDev |
Maintainer Contact: | arielmejiadev@gmail.com (ArielMejiaDev) |
Package Create Date: | 2020-01-14 |
Package Last Update: | 2024-08-14 |
Home Page: | https://larapex-charts.netlify.app/ |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-31 03:10:03 |
Package Statistics | |
---|---|
Total Downloads: | 294,695 |
Monthly Downloads: | 10,293 |
Daily Downloads: | 462 |
Total Stars: | 293 |
Total Watchers: | 8 |
Total Forks: | 88 |
Total Open Issues: | 19 |
A Laravel wrapper for apex charts library Check the documentation on: Larapex Chart Docs.
Use composer.
composer require arielmejiadev/larapex-charts
In your controller add:
$chart = (new LarapexChart)->setTitle('Posts')
->setDataset([150, 120])
->setLabels(['Published', 'No Published']);
Remember to import the Facade to your controller with
use ArielMejiaDev\LarapexCharts\Facades\LarapexChart;
Or importing the LarapexChart class:
use ArielMejiaDev\LarapexCharts\LarapexChart;
Then in your view (Blade file) add:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Chart Sample</title>
</head>
<body>
{!! $chart->container() !!}
<script src="{{ $chart->cdn() }}"></script>
{{ $chart->script() }}
</body>
</html>
$chart = (new LarapexChart)->setType('area')
->setTitle('Total Users Monthly')
->setSubtitle('From January to March')
->setXAxis([
'Jan', 'Feb', 'Mar'
])
->setDataset([
[
'name' => 'Active Users',
'data' => [250, 700, 1200]
]
]);
You can create a variety of charts including: Line, Area, Bar, Horizontal Bar, Heatmap, pie, donut and Radialbar.
Check the documentation on: Larapex Chart Docs
The author Ariel Mejia Dev.
Hey 👋 thanks for considering making a donation, with these donations I can continue working to contribute to opensource projects.
@apexchartscdn
@script($chart)