Subversion Repositories Applications.gtt

Rev

Rev 61 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
<?php
2
/*
3
 * This work is hereby released into the Public Domain.
4
 * To view a copy of the public domain dedication,
5
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
6
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
7
 *
8
 */
9
 
10
require_once "../Pie.class.php";
11
 
12
 
13
$graph = new Graph(400, 250);
14
$graph->setAntiAliasing(TRUE);
15
 
16
$graph->title->set("Pie (example 17)");
17
$graph->title->setFont(new Tuffy(14));
18
 
19
$values = array(12, 16, 13, 18, 10, 20, 11);
20
 
21
$plot = new Pie($values, Pie::AQUA);
22
$plot->setCenter(0.4, 0.55);
23
$plot->setAbsSize(180, 180);
24
 
25
$plot->setLegend(array(
26
	'Mon',
27
	'Tue',
28
	'Wed',
29
	'Thu',
30
	'Fri',
31
	'Sat',
32
	'Sun'
33
));
34
 
35
$explode = array();
36
for($i = 0; $i < count($values); $i++) {
37
	$explode[] = 15;
38
}
39
 
40
$plot->explode($explode);
41
 
42
$plot->legend->setPosition(1.5);
43
$plot->legend->shadow->setSize(0);
44
 
45
$graph->add($plot);
46
$graph->draw();
47
 
48
?>