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 "../../LinePlot.class.php";
11
 
12
 
13
$graph = new Graph(150, 100);
14
 
15
$graph->setAntiAliasing(TRUE);
16
 
17
$x = array(
18
	1, 2, 5, 4, 2, 3
19
);
20
 
21
$plot = new LinePlot($x);
22
 
23
// Change component padding
24
$plot->setPadding(10, 12, 12, 7);
25
 
26
// Set a background gradient
27
$plot->setBackgroundGradient(
28
	new LinearGradient(
29
		new Color(230, 230, 230),
30
		new Color(255, 255, 255),
31
 
32
	)
33
);
34
 
35
// Change line background color
36
$plot->setFillGradient(
37
	new LinearGradient(
38
		new Color(200, 240, 215, 30),
39
		new Color(150, 190, 165, 30),
40
 
41
	)
42
);
43
 
44
// Hide grid
45
$plot->grid->hide(TRUE);
46
$plot->grid->setNobackground();
47
 
48
$plot->yAxis->label->hide(TRUE);
49
$plot->xAxis->label->hide(TRUE);
50
 
51
$plot->label->set($x);
52
$plot->label->setBackgroundColor(new Color(240, 240, 240, 10));
53
$plot->label->border->setColor(new Color(255, 0, 0, 15));
54
$plot->label->setPadding(3, 2, 0, 0);
55
$plot->label->setFont(new Font1);
56
 
57
$graph->add($plot);
58
$graph->draw();
59
?>