Commit dfd608a1 authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - refactor chart data maanger and series data objects

parent 1b3596b2
......@@ -3,22 +3,22 @@ namespace Ceetrox\Sidekick\Views\Limitless\Linechart\ChartManager;
Class ChartDataManager {
private array $categories;
private Series $series;
private ?int $numberOfCharts;
private array $titles;
private array $colors;
private ?bool $hasBoundaryGap;
private ?bool $isInverted;
private ?bool $hasDataZoom;
private ?int $animationDuration;
private ?string $yAxisLabelValueFormat;
private ?string $rawData;
private ?bool $showPointValues;
private ?bool $isStacked;
private ?bool $isArea;
private ?bool $markLine;
private array $categories;
private Series $series;
private ?int $numberOfCharts;
private array $titles;
private array $colors;
private ?bool $hasBoundaryGap;
private ?bool $isInverted;
private ?bool $hasDataZoom;
private ?int $animationDuration;
private ?string $yAxisLabelValueFormat;
private ?string $rawData;
private ?bool $showPointValues;
private ?bool $isStacked;
private ?bool $isArea;
private ?bool $markLine;
public function __construct()
{
......
......@@ -3,14 +3,14 @@ namespace Ceetrox\Sidekick\Views\Limitless\Linechart\ChartManager;
class SeriesData
{
private string $name;
private array $categoryValues;
private int $index;
private ?string $type;
private ?string $stackName;
private ?bool $showPointValues;
private ?bool $isArea;
private ?string $markLine;
private string $name;
private array $categoryValues;
private int $index;
private ?string $type;
private ?string $stackName;
private ?bool $showPointValues;
private ?bool $isArea;
private ?string $markLine;
public function __construct()
{
......@@ -28,42 +28,6 @@ class SeriesData
return $this->index;
}
private function getName() : string
{
return $this->name;
}
private function getCategoryValues() : array
{
return $this->categoryValues;
}
private function getType() : ?string
{
return $this->type;
}
private function getStackName() : ?string
{
return $this->stackName;
}
private function getShowPointValues() : ?bool
{
return $this->showPointValues;
}
private function getIsArea() : ?bool
{
return $this->isArea;
}
private function getMarkLine() : ?string
{
return $this->markLine;
}
public function setName(string $name) : SeriesData
{
$this->name = $name;
......@@ -121,9 +85,9 @@ class SeriesData
{
$data = [];
$data['name'] = $this->getName();
$data['data'] = $this->getCategoryValues();
$data['index'] = $this->getIndex();
$data['name'] = $this->name;
$data['data'] = $this->categoryValues;
$data['index'] = $this->index;
if(!is_null($this->type)) $data['type'] = $this->type;
if(!is_null($this->stackName)) $data['stacked'] = $this->stackName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment