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(400, 300);
14
$graph->setAntiAliasing(TRUE);
15
 
16
$x = array(
17
	1, 2, 5, 0.5, 3, 8, 7, 6, 2, -4
18
);
19
 
20
$plot = new LinePlot($x);
21
 
22
// Set a background gradient
23
$plot->setBackgroundGradient(
24
	new LinearGradient(
25
		new Color(210, 210, 210),
26
		new Color(255, 255, 255),
27
 
28
	)
29
);
30
 
31
// Set semi-transparent background gradient
32
$plot->setFillGradient(
33
	new LinearGradient(
34
		new Color(230, 150, 150, 20),
35
		new Color(230, 230, 180, 50),
36
		90
37
	)
38
);
39
 
40
$plot->yAxis->setLabelPrecision(1);
41
 
42
$graph->add($plot);
43
$graph->draw();
44
?>