ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
YAxis.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
26 class YAxis extends Axis
27 {
28  protected const ALLOWED_POSITIONS = ["left", "right"];
29 
30  protected string $abbreviation = "y";
31  protected string $position = "left";
32 
33  public function getAbbreviation(): string
34  {
35  return $this->abbreviation;
36  }
37 
44  public function withPosition(string $position): self
45  {
46  if (!in_array($position, self::ALLOWED_POSITIONS)) {
47  throw new \InvalidArgumentException(
48  "Position must be 'left' or 'right'."
49  );
50  }
51  $clone = clone $this;
52  $clone->position = $position;
53  return $clone;
54  }
55 
56  public function getPosition(): string
57  {
58  return $this->position;
59  }
60 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Axis.php:21
withPosition(string $position)
Should the y-axis be displayed left or right? Default is left.
Definition: YAxis.php:44