ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilChartPie.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "Services/Chart/classes/class.ilChart.php";
5 
13 class ilChartPie extends ilChart
14 {
15  public function getDataInstance($a_type = null)
16  {
17  include_once "Services/Chart/classes/class.ilChartDataPie.php";
18  return new ilChartDataPie();
19  }
20 
21  protected function isValidDataType(ilChartData $a_series)
22  {
23  return ($a_series instanceof ilChartDataPie);
24  }
25 
26  protected function addCustomJS()
27  {
28  $tpl = $this->tpl;
29 
30  $tpl->addJavascript("Services/Chart/js/flot/jquery.flot.pie.js");
31  }
32 
33  public function parseGlobalOptions(stdClass $a_options)
34  {
35  // if no inner labels set, use legend
36  if (!isset($a_options->series->pie->label) &&
37  !$this->legend) {
38  $legend = new ilChartLegend();
39  $legend->setPosition("nw");
40  $this->setLegend($legend);
41  }
42  }
43 }
Chart legend.
parseGlobalOptions(stdClass $a_options)
getDataInstance($a_type=null)
Abstract Chart generator base class.
setLegend(ilChartLegend $a_legend)
Set chart legend.
$a_type
Definition: workflow.php:92
Generator for pie charts.
Chart data pie series.
Abstract chart data series base class.
isValidDataType(ilChartData $a_series)