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
18
);
19
 
20
$plot = new LinePlot($x);
21
 
22
$plot->setSpace(6, 6, 10, 10);
23
$plot->setXAxisZero(FALSE);
24
 
25
// Set a background gradient
26
$plot->setBackgroundGradient(
27
	new LinearGradient(
28
		new Color(210, 210, 210),
29
		new Color(255, 255, 255),
30
 
31
	)
32
);
33
 
34
// Change line color
35
$plot->setColor(new Color(0, 0, 150, 20));
36
 
37
// Set line background gradient
38
$plot->setFillGradient(
39
	new LinearGradient(
40
		new Color(150, 150, 210),
41
		new Color(230, 230, 255),
42
		90
43
	)
44
);
45
 
46
// Change mark type
47
$plot->mark->setType(Mark::CIRCLE);
48
$plot->mark->border->show();
49
 
50
$graph->add($plot);
51
$graph->draw();
52
?>