| @@ 6-49 (lines=44) @@ | ||
| 3 | ||
| 4 | use rtens\domin\parameters\Color; |
|
| 5 | ||
| 6 | class DataPoint { |
|
| 7 | ||
| 8 | /** @var null|string */ |
|
| 9 | private $label; |
|
| 10 | ||
| 11 | /** @var int */ |
|
| 12 | private $value; |
|
| 13 | ||
| 14 | /** @var null|Color */ |
|
| 15 | private $color; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @param int $value |
|
| 19 | * @param null|string $label |
|
| 20 | * @param Color|null $color |
|
| 21 | */ |
|
| 22 | public function __construct($value, $label = null, Color $color = null) { |
|
| 23 | $this->label = $label; |
|
| 24 | $this->value = $value; |
|
| 25 | $this->color = $color; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return null|string |
|
| 30 | */ |
|
| 31 | public function getLabel() { |
|
| 32 | return $this->label; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return int |
|
| 37 | */ |
|
| 38 | public function getValue() { |
|
| 39 | return $this->value; |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @return null|Color |
|
| 44 | */ |
|
| 45 | public function getColor() { |
|
| 46 | return $this->color; |
|
| 47 | } |
|
| 48 | ||
| 49 | } |
|
| @@ 6-48 (lines=43) @@ | ||
| 3 | ||
| 4 | use rtens\domin\parameters\Color; |
|
| 5 | ||
| 6 | class DataSet { |
|
| 7 | ||
| 8 | /** @var null|string */ |
|
| 9 | private $label; |
|
| 10 | ||
| 11 | /** @var int[] */ |
|
| 12 | private $values = []; |
|
| 13 | ||
| 14 | /** @var null|Color */ |
|
| 15 | private $color; |
|
| 16 | ||
| 17 | /** |
|
| 18 | * @param int[] $values |
|
| 19 | * @param null|string $label |
|
| 20 | * @param Color|null $color |
|
| 21 | */ |
|
| 22 | public function __construct(array $values = [], $label = '', Color $color = null) { |
|
| 23 | $this->label = $label; |
|
| 24 | $this->values = $values; |
|
| 25 | $this->color = $color; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * @return null|string |
|
| 30 | */ |
|
| 31 | public function getLabel() { |
|
| 32 | return $this->label; |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @return int[] |
|
| 37 | */ |
|
| 38 | public function getValues() { |
|
| 39 | return $this->values; |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @return null|Color |
|
| 44 | */ |
|
| 45 | public function getColor() { |
|
| 46 | return $this->color; |
|
| 47 | } |
|
| 48 | } |
|