<?php
namespace Ceetrox\Sidekick\Views\Limitless\Barchart\Attachments;

use Ceetrox\Managers\ChartManager\ISeriesData;
use Ceetrox\Managers\ChartManager\SeriesData;

class BarSeriesData extends SeriesData implements ISeriesData
{
    private ?bool   $showBarValues;

    public function __construct()
    {
        parent::__construct();

        $this->showBarValues = null;
    }

    public function setShowBarValues(bool $value)
    {
        $this->showBarValues = $value;
    }

    public function toArray(): array
    {
        $data = [];

        if(!is_null($this->showBarValues)) $data['showBarValues']   = $this->showBarValues;

        $data = array_merge($data, $this->getParentData());

        return $data;
    }

}
