3 declare(strict_types=1);
30 class Bar implements C\Chart\Bar\Bar
50 $this->title = $title;
52 throw new \LogicException(
53 "Dataset must not be empty." 60 throw new \InvalidArgumentException(
61 "Expected parameter to be a CardinalDimension or RangeDimension." 65 $this->dataset = $dataset;
67 $this->bar_configs = $bar_configs;
73 $clone->title = $title;
85 $clone->dataset = $dataset;
91 return $this->dataset;
97 $clone->bar_configs = $bar_configs;
103 return $this->bar_configs;
108 $clone = clone $this;
109 $clone->title_visible = $title_visible;
115 return $this->title_visible;
120 $clone = clone $this;
121 $clone->legend_visible = $legend_visible;
127 return $this->legend_visible;
132 if (!in_array($legend_position, self::ALLOWED_POSITIONS)) {
133 throw new \InvalidArgumentException(
134 "Position must be 'bottom', 'top', 'left' or 'right'." 137 $clone = clone $this;
138 $clone->legend_position = $legend_position;
144 return $this->legend_position;
149 $clone = clone $this;
150 $clone->tooltips_visible = $tooltips_visible;
156 return $this->tooltips_visible;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
withTitleVisible(bool $title_visible)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
withLegendVisible(bool $legend_visible)
__construct(string $title, Dataset $dataset, array $bar_configs=[])
withBarConfigs(array $bar_configs)
withDataset(Dataset $dataset)
withLegendPosition(string $legend_position)
withTooltipsVisible(bool $tooltips_visible)