fixed sub category issues

This commit is contained in:
Denis Duliçi
2022-07-21 11:46:18 +03:00
parent e5a68d8450
commit b93a5fcd49
10 changed files with 149 additions and 121 deletions

View File

@ -3,10 +3,13 @@
namespace App\Traits;
use Akaunting\Apexcharts\Chart;
use App\Traits\Tailwind;
use Balping\JsonRaw\Raw;
trait Charts
{
use Tailwind;
public $bar = [
'colors' => [],
'labels' => [],
@ -34,6 +37,8 @@ trait Charts
$label .= ' - ' . $description;
}
$color = $this->getHexCodeOfTailwindClass($color);
$this->addToDonut($color, $label, $amount);
}
@ -69,6 +74,8 @@ trait Charts
public function addToBar($color, $label, $value)
{
$color = $this->getHexCodeOfTailwindClass($color);
$this->bar['colors'][] = $color;
$this->bar['labels'][] = $label;
$this->bar['values'][] = (int) $value;