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(300, 175);
14
$graph->setBackgroundGradient(
15
	new LinearGradient(
16
		new VeryLightGray(40),
17
		new White,
18
		90
19
	)
20
);
21
$graph->title->set("Arbitrary labels");
22
$graph->title->setAngle(90);
23
$graph->title->move(120, NULL);
24
 
25
$values = array(8, 4, 6, 2, 5, 3, 4);
26
 
27
$plot = new Pie($values);
28
$plot->setCenter(0.45, 0.5);
29
$plot->setSize(0.55, 0.55 * 300 / 175);
30
 
31
$plot->label->set(array(
32
	'Arthur', 'Abel', 'Bernard', 'Thierry', 'Paul', 'Gaston', 'Joe'
33
));
34
 
35
$plot->label->setCallbackFunction(NULL); // We must disable the default callback function
36
$plot->setLabelPosition(10);
37
 
38
$plot->setLegend(array(
39
	'ABC',
40
	'DEF',
41
	'GHI',
42
	'JKL',
43
	'MNO',
44
	'PQR',
45
	'STU'
46
));
47
 
48
$plot->legend->hide(TRUE);
49
 
50
$graph->add($plot);
51
$graph->draw();
52
 
53
?>