ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilChartPie.php
Go to the documentation of this file.
1<?php
2
23class ilChartPie extends ilChart
24{
25 public function getDataInstance(?int $a_type = null): ilChartData
26 {
27 return new ilChartDataPie();
28 }
29
30 protected function isValidDataType(ilChartData $a_series): bool
31 {
32 return ($a_series instanceof ilChartDataPie);
33 }
34
35 protected function addCustomJS(): void
36 {
38
39 $tpl->addJavaScript("assets/js/jquery.flot.pie.js");
40 }
41
42 public function parseGlobalOptions(stdClass $a_options): void
43 {
44 // if no inner labels set, use legend
45 if (!isset($a_options->series->pie->label) &&
46 !$this->legend) {
47 $legend = new ilChartLegend();
48 $legend->setPosition("nw");
49 $this->setLegend($legend);
50 }
51 }
52}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPosition(string $a_position)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseGlobalOptions(stdClass $a_options)
Convert (global) properties to flot config.
addCustomJS()
Add type-specific JS script.
getDataInstance(?int $a_type=null)
Get data series instance.
isValidDataType(ilChartData $a_series)
Validate data series.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilChartLegend $legend
setLegend(ilChartLegend $a_legend)
ilGlobalTemplateInterface $tpl
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.