add graphs for stats

This commit is contained in:
ludo
2024-01-29 22:39:57 +01:00
parent 349204307f
commit 72f5da4555
7 changed files with 202 additions and 73 deletions

23
app/Charts/Shop/Order.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
namespace App\Charts\Shop;
use Akaunting\Apexcharts\Chart;
use App\Repositories\Shop\OrderStatistics;
class Order
{
public static function getMonthly()
{
$data = OrderStatistics::getTotalMonthly();
return (new Chart)->setType('bar')
->setWidth('100%')
->setHeight(300)
->setLabels(array_keys($data))
->setDataset('CA', 'bar', array_values($data))
->setColor('#334F17')
->setStrokeColors(['#527C39'])
;
}
}