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->setAntiAliasing(TRUE);
15
 
16
$graph->title->set("Customized colors");
17
$graph->title->setFont(new Tuffy(12));
18
$graph->title->move(80, 10);
19
 
20
$values = array(16, 9, 13, 23);
21
$colors = array(
22
	new LightOrange,
23
	new LightPurple,
24
	new LightBlue,
25
	new LightRed,
26
	new LightPink
27
);
28
 
29
$plot = new Pie($values, $colors);
30
$plot->setCenter(0.3, 0.53);
31
$plot->setAbsSize(200, 200);
32
$plot->setBorderColor(new White);
33
$plot->setStartAngle(234);
34
 
35
$plot->setLegend(array(
36
	'Arthur',
37
	'Abel',
38
	'Pascal',
39
	'Thamer'
40
));
41
 
42
$plot->setLabelPosition(-40);
43
$plot->label->setPadding(2, 2, 2, 2);
44
$plot->label->setFont(new Tuffy(7));
45
$plot->label->setBackgroundColor(new White(60));
46
 
47
$plot->legend->setPosition(1.38);
48
 
49
$graph->add($plot);
50
$graph->draw();
51
 
52
?>