19 declare(strict_types=1);
37 $f = $DIC->ui()->factory();
38 $df = new \ILIAS\Data\Factory();
42 $c_dimension = $df->dimension()->cardinal([
"",
"low",
"medium",
"high"]);
43 $r_dimension = $df->dimension()->range($c_dimension);
46 $dataset = $df->dataset([
47 "Target" => $r_dimension,
48 "Dataset 1" => $c_dimension,
49 "Dataset 2" => $c_dimension,
50 "Dataset 3" => $c_dimension,
53 $dataset = $dataset->withPoint(
56 "Target" => [0.99, 1.01],
62 $dataset = $dataset->withPoint(
65 "Target" => [2.99, 3.01],
71 $dataset = $dataset->withPoint(
74 "Target" => [2.99, 3.01],
80 $dataset = $dataset->withPoint(
83 "Target" => [1.99, 2.01],
89 $dataset = $dataset->withPoint(
92 "Target" => [2.99, 3.01],
98 $dataset = $dataset->withPoint(
101 "Target" => [0, 0.01],
108 $dataset = $dataset->withAlternativeInformation(
114 "Dataset 3" =>
"Custom 1" 117 $dataset = $dataset->withAlternativeInformation(
123 "Dataset 3" =>
"Custom 2" 126 $dataset = $dataset->withAlternativeInformation(
132 "Dataset 3" =>
"Custom 3" 135 $dataset = $dataset->withAlternativeInformation(
138 "Target" =>
"medium",
141 "Dataset 3" =>
"Custom 4" 144 $dataset = $dataset->withAlternativeInformation(
150 "Dataset 3" =>
"Custom 5" 153 $dataset = $dataset->withAlternativeInformation(
159 "Dataset 3" =>
"Custom 6" 165 $b1 = $b1->withRelativeWidth(1.1);
166 $b1 = $b1->withColor($df->color(
"#000000"));
168 $b2 = $b2->withRelativeWidth(0.6);
169 $b2 = $b2->withColor($df->color(
"#12436D"));
171 $b3 = $b3->withRelativeWidth(0.6);
172 $b3 = $b3->withColor($df->color(
"#28A197"));
174 $b4 = $b4->withRelativeWidth(0.6);
175 $b4 = $b4->withColor($df->color(
"#801650"));
185 $bar_chart =
$f->chart()->bar()->horizontal(
186 "A horizontal bar chart",
190 $bar_chart = $bar_chart->withTitleVisible(
false);
191 $x_axis =
new XAxis();
192 $x_axis = $x_axis->withMinValue(0);
193 $x_axis = $x_axis->withMaxValue(3);
194 $bar_chart = $bar_chart->withCustomXAxis($x_axis);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
custom()
expected output: > ILIAS shows a base horizontal bar chart but customized with e.g.