<?php

namespace {{ namespace }};

use ArielMejiaDev\LarapexCharts\LarapexChart;

class {{ class }}
{
    protected $chart;

    public function __construct(LarapexChart $chart)
    {
        $this->chart = $chart;
    }

    public function build(): \Illuminate\Http\JsonResponse
    {
        return $this->chart->donutChart()
            ->setTitle('Top 3 scorers of the team.')
            ->setSubtitle('Season 2021.')
            ->addData([20, 24, 30])
            ->setLabels(['Player 7', 'Player 10', 'Player 9'])
            ->toJson();
    }
}
