ILIAS  release_8 Revision v8.24
base.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
7function base()
8{
9 //Loading factories
10 global $DIC;
11 $f = $DIC->ui()->factory();
12 $df = new \ILIAS\Data\Factory();
13 $renderer = $DIC->ui()->renderer();
14
15 //Generating Dimensions
16 $c_dimension = $df->dimension()->cardinal();
17
18 //Generating Dataset with points
19 $dataset = $df->dataset(["Dataset" => $c_dimension]);
20
21 $dataset = $dataset->withPoint("Item 1", ["Dataset" => 80]);
22 $dataset = $dataset->withPoint("Item 2", ["Dataset" => 0]);
23 $dataset = $dataset->withPoint("Item 3", ["Dataset" => 18]);
24 $dataset = $dataset->withPoint("Item 4", ["Dataset" => 55]);
25
26 //Generating and rendering the vertical chart
27 $bar_chart = $f->chart()->bar()->vertical(
28 "A vertical bar chart",
29 $dataset
30 );
31
32 // render
33 return $renderer->render($bar_chart);
34}
global $DIC
Definition: feed.php:28