Skip to content

Commit

Permalink
Add support for setting labels and lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBernskiold committed Aug 30, 2024
1 parent 786d2cd commit a29ff65
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Data/ChartExtras.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,50 @@ class ChartExtras implements Arrayable, Jsonable
*/
public array $quadrants = [];

/**
* @param array<ChartLabel> $labels
*/
public function labels(array $labels = []): self
{
$this->labels = $labels;

return $this;
}

public function addLabel(ChartLabel $label): self
{
$this->labels[] = $label;

return $this;
}

/**
* @param array<ChartLine> $lines
*/
public function lines(array $lines = []): self
{
$this->lines = $lines;

return $this;
}

public function addLine(ChartLine $line): self
{
$this->lines[] = $line;

return $this;
}

/**
* @param array<ChartQuadrant> $quadrants
*/
public function quadrants(array $quadrants = []): self
{
$this->quadrants = $quadrants;

return $this;
}

public function addQuadrant(ChartQuadrant $quadrant): self
{
$this->quadrants[] = $quadrant;
Expand Down

0 comments on commit a29ff65

Please sign in to comment.