ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilChartPie.php
Go to the documentation of this file.
1 <?php
2 
20 class ilChartPie extends ilChart
21 {
22  public function getDataInstance(int $a_type = null): ilChartData
23  {
24  return new ilChartDataPie();
25  }
26 
27  protected function isValidDataType(ilChartData $a_series): bool
28  {
29  return ($a_series instanceof ilChartDataPie);
30  }
31 
32  protected function addCustomJS(): void
33  {
34  $tpl = $this->tpl;
35 
36  $tpl->addJavaScript("Services/Chart/js/flot/jquery.flot.pie.js");
37  }
38 
39  public function parseGlobalOptions(stdClass $a_options): void
40  {
41  // if no inner labels set, use legend
42  if (!isset($a_options->series->pie->label) &&
43  !$this->legend) {
44  $legend = new ilChartLegend();
45  $legend->setPosition("nw");
46  $this->setLegend($legend);
47  }
48  }
49 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
parseGlobalOptions(stdClass $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPosition(string $a_position)
setLegend(ilChartLegend $a_legend)
ilChartLegend $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.
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...
getDataInstance(int $a_type=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isValidDataType(ilChartData $a_series)