ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
XAxis.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26class XAxis extends Axis
27{
28 protected const ALLOWED_POSITIONS = ["bottom", "top"];
29
30 protected string $abbreviation = "x";
31 protected string $position = "bottom";
32
33 public function getAbbreviation(): string
34 {
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 'bottom' or 'top'."
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}
withPosition(string $position)
Should the x-axis be displayed at the bottom or at the top? Default is bottom.
Definition: XAxis.php:44