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

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

class LineSeriesData extends SeriesData implements ISeriesData
{
    private ?bool     $showPointValues;
    private ?bool     $isArea;

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

        $this->showPointValues = null;
        $this->isArea = null;
    }

    public function setShowPointValues(bool $value)
    {
        $this->showPointValues = $value;
    }

    public function setIsArea(bool $value)
    {
        $this->isArea = $value;
    }

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

        if(!is_null($this->showPointValues)) $data['pointValues']   = $this->showPointValues;
        if(!is_null($this->isArea)) $data['isArea']                 = $this->isArea;

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

        return $data;
    }

}
