ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4include_once "Services/Chart/classes/class.ilChart.php";
5
13class 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 global $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 {
39 $legend = new ilChartLegend();
40 $legend->setPosition("nw");
41 $this->setLegend($legend);
42 }
43 }
44}
45
global $tpl
Definition: ilias.php:8
Chart data pie series.
Abstract chart data series base class.
Generator for pie charts.
parseGlobalOptions(stdClass $a_options)
Convert (global) properties to flot config.
getDataInstance($a_type=null)
Get data series instance.
addCustomJS()
Add type-specific JS script.
isValidDataType(ilChartData $a_series)
Validate data series.
Abstract Chart generator base class.
setLegend(ilChartLegend $a_legend)
Set chart legend.