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
$graph = new Graph(150, 100);
13
 
14
$graph->setAntiAliasing(TRUE);
15
 
16
$x = array();
17
for($i = 0; $i < 10; $i++) {
18
	$x[] = mt_rand(1, 99) / 10;
19
}
20
 
21
$plot = new LinePlot($x);
22
$plot->setBackgroundColor(new Color(240, 240, 240));
23
$plot->setPadding(30, 8, 8, 20);
24
 
25
$plot->setColor(
26
	new Color(60, 60, 150)
27
);
28
$plot->setFillGradient(
29
	new LinearGradient(
30
		new Color(120, 175, 80, 47),
31
		new Color(231, 172, 113, 30),
32
 
33
	)
34
);
35
 
36
$plot->grid->setType(Line::DASHED);
37
 
38
$plot->yAxis->setLabelNumber(2);
39
$plot->yAxis->setLabelPrecision(1);
40
 
41
$plot->xAxis->setLabelInterval(2);
42
$plot->xAxis->setNumberByTick('minor', 'major', 2);
43
 
44
$graph->add($plot);
45
$graph->draw();
46
?>