ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
31 function base()
32 {
33  //Loading factories
34  global $DIC;
35  $f = $DIC->ui()->factory();
36  $df = new \ILIAS\Data\Factory();
37  $renderer = $DIC->ui()->renderer();
38 
39  //Generating Dimensions
40  $c_dimension = $df->dimension()->cardinal();
41 
42  //Generating Dataset with points
43  $dataset = $df->dataset(["Dataset" => $c_dimension]);
44 
45  $dataset = $dataset->withPoint("Item 1", ["Dataset" => 80]);
46  $dataset = $dataset->withPoint("Item 2", ["Dataset" => 0]);
47  $dataset = $dataset->withPoint("Item 3", ["Dataset" => 18]);
48  $dataset = $dataset->withPoint("Item 4", ["Dataset" => 55]);
49 
50  //Generating and rendering the vertical chart
51  $bar_chart = $f->chart()->bar()->vertical(
52  "A vertical bar chart",
53  $dataset
54  );
55 
56  // render
57  return $renderer->render($bar_chart);
58 }
$renderer
global $DIC
Definition: shib_login.php:22
base()
expected output: > ILIAS shows a column-chart with an maximum y-value of 80 and four entries with va...
Definition: base.php:31