forked from anuko/timetracker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPieChartEx.class.php
More file actions
49 lines (40 loc) · 1.16 KB
/
PieChartEx.class.php
File metadata and controls
49 lines (40 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require_once(APP_LIB_DIR.'/libchart/classes/libchart.php');
/**
* Pie chart extension to render pies with no title and labels
*
* @author pingw33n
*/
class PieChartEx extends PieChart
{
/**
* Render the chart image
*
* @access public
* @param array options: fileName, hideLogo, hideTitle, hidePie, hideLabel
*/
public function renderEx($options)
{
$hideLabel = isset($options['hideLabel']) && $options['hideLabel'] == true;
$this->computePercent();
if ($hideLabel) {
$this->plot->setGraphPadding(new Padding(0));
$this->plot->setTitleHeight(0);
}
$this->computeLayout(!$hideLabel);
$this->createImage();
if (!isset($options['hideLogo']) || $options['hideLogo'] == false)
$this->plot->printLogo();
if (!isset($options['hideTitle']) || $options['hideTitle'] == false)
$this->plot->printTitle();
if (!isset($options['hidePie']) || $options['hidePie'] == false)
$this->printPie();
if (!$hideLabel)
$this->printLabel();
/*if(isset($options['fileName']))
imagepng($this->img, $options['fileName']);
else
imagepng($this->img); */
$this->plot->render($options['fileName']);
}
}