ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
base.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
31function 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:26