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
function createPie($values, $title, $x, $y) {
13
 
14
	$plot = new Pie($values);
15
	$plot->title->set($title);
16
	$plot->title->setFont(new TuffyBold(8));
17
	$plot->title->move(NULL, -12);
18
 
19
	$plot->label->setFont(new Tuffy(7));
20
	$plot->legend->hide(TRUE);
21
	$plot->setLabelPosition(5);
22
	$plot->setSize(0.40, 0.40);
23
	$plot->setCenter($x, $y);
24
	$plot->setBorderColor(new Black);
25
 
26
	return $plot;
27
 
28
}
29
 
30
$graph = new Graph(400, 400);
31
$graph->setAntiAliasing(TRUE);
32
 
33
$plot = createPie(array(1, 4, 5, 2, 3), "Cowléoptère", 0.22, 0.25);
34
$graph->add($plot);
35
 
36
$plot = createPie(array(1, 9, 1, 2, 1), "Asticow", 0.66, 0.25);
37
$graph->add($plot);
38
 
39
$plot = createPie(array(5, 7, 8, 6, 3), "Cowlibri", 0.22, 0.75);
40
$graph->add($plot);
41
 
42
$plot = createPie(array(6, 4, 6, 5, 6), "Bourricow", 0.66, 0.75);
43
$plot->legend->hide(FALSE); // We print only one legend
44
$plot->legend->setPosition(1.25, 0);
45
$graph->add($plot);
46
 
47
$graph->draw();
48
?>