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 9) - User defined colors");
17
$graph->title->border->show();
18
$graph->title->setBackgroundColor(new LightRed(60));
19
$graph->title->setPadding(3, 3, 3, 3);
20
 
21
$values = array(8, 4, 6, 3, 4);
22
$colors = array(
23
	new LightOrange,
24
	new LightPurple,
25
	new LightBlue,
26
	new LightRed,
27
	new LightPink
28
);
29
 
30
$plot = new Pie($values, $colors);
31
$plot->setSize(0.70, 0.60);
32
$plot->setCenter(0.40, 0.55);
33
$plot->set3D(10);
34
$plot->setBorderColor(new LightGray);
35
 
36
$plot->setLegend(array(
37
	'Alpha',
38
	'Beta',
39
	'Gamma',
40
	'Delta',
41
	'Epsilon'
42
));
43
 
44
$plot->legend->setPosition(1.30);
45
 
46
$graph->add($plot);
47
$graph->draw();
48
 
49
?>