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, 0.5, 3, 8, 7, 6, 2, -4
19
);
20
 
21
$plot = new LinePlot($x);
22
$plot->grid->setNobackground();
23
$plot->setPadding(20, 8, 8, 20);
24
$plot->setXAxisZero(FALSE);
25
 
26
// Set a background gradient
27
$plot->setBackgroundGradient(
28
	new LinearGradient(
29
		new Color(210, 210, 210),
30
		new Color(255, 255, 255),
31
 
32
	)
33
);
34
 
35
// Set semi-transparent background gradient
36
$plot->setFillGradient(
37
	new LinearGradient(
38
		new Color(230, 150, 150, 20),
39
		new Color(230, 230, 180, 50),
40
		90
41
	)
42
);
43
 
44
$plot->xAxis->label->hideFirst(TRUE);
45
$plot->xAxis->label->hideLast(TRUE);
46
$plot->xAxis->setNumberByTick('minor', 'major', 2);
47
 
48
$graph->add($plot);
49
$graph->draw();
50
?>