<?php

namespace App\Charts\Shop;

use Akaunting\Apexcharts\Chart;
use App\Repositories\Shop\OrderMetrics;

class Order
{
    public static function getMonthly()
    {
        $data = OrderMetrics::getTotalMonthly();

        return (new Chart)->setType('bar')
            ->setWidth('100%')
            ->setHeight(300)
            ->setLabels(array_keys($data))
            ->setDataset('CA', 'bar', array_values($data))
            ->setColor('#334F17')
            ->setStrokeColors(['#527C39']);
    }
}
