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
	0, 2, 5, 2, 3, 8
19
);
20
 
21
$plot = new LinePlot($x);
22
$plot->setXAxisZero(FALSE);
23
$plot->grid->setNobackground();
24
 
25
$plot->setSpace(6, 6, 10, 10);
26
$plot->setPadding(30, 6, 8, 18);
27
 
28
// Set a background gradient
29
$plot->setBackgroundGradient(
30
	new LinearGradient(
31
		new Color(210, 210, 210),
32
		new Color(255, 255, 255),
33
 
34
	)
35
);
36
 
37
// Change line color
38
$plot->setColor(new Color(0, 0, 150, 20));
39
 
40
// Set line background gradient
41
$plot->setFillGradient(
42
	new LinearGradient(
43
		new Color(150, 150, 210),
44
		new Color(230, 230, 255),
45
 
46
	)
47
);
48
 
49
// Change mark type
50
$plot->mark->setType(Mark::CIRCLE);
51
$plot->mark->border->show();
52
$plot->mark->setSize(6);
53
 
54
$plot->yAxis->setLabelPrecision(1);
55
$plot->yAxis->label->setFont(new Font1);
56
$plot->xAxis->label->setFont(new Font1);
57
 
58
$graph->add($plot);
59
$graph->draw();
60
?>