ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
15 function base()
16 {
17  //Loading factories
18  global $DIC;
19  $f = $DIC->ui()->factory();
20  $df = new \ILIAS\Data\Factory();
21  $renderer = $DIC->ui()->renderer();
22 
23  //Generating Dimensions
24  $c_dimension = $df->dimension()->cardinal();
25 
26  //Generating Dataset with points
27  $dataset = $df->dataset(["Dataset" => $c_dimension]);
28 
29  $dataset = $dataset->withPoint("Item 1", ["Dataset" => 80]);
30  $dataset = $dataset->withPoint("Item 2", ["Dataset" => 0]);
31  $dataset = $dataset->withPoint("Item 3", ["Dataset" => 18]);
32  $dataset = $dataset->withPoint("Item 4", ["Dataset" => 55]);
33 
34  //Generating and rendering the vertical chart
35  $bar_chart = $f->chart()->bar()->vertical(
36  "A vertical bar chart",
37  $dataset
38  );
39 
40  // render
41  return $renderer->render($bar_chart);
42 }
$renderer
global $DIC
Definition: shib_login.php:25
base()
expected output: > ILIAS shows a column-chart with an maximum y-value of 80 and four entries with va...
Definition: base.php:15