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
// Use cache
14
$graph = new Graph(400, 400, "Example-006", time() + 5);
15
$graph->setTiming(TRUE);
16
$graph->setAntiAliasing(TRUE);
17
 
18
 
19
$x = array();
20
for($i = 0; $i < 10; $i++) {
21
	$x[] = mt_rand(0, 100);
22
}
23
 
24
$plot = new LinePlot($x);
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->setYMin(-5);
39
 
40
$plot->yAxis->setLabelNumber(8);
41
$plot->yAxis->setLabelPrecision(1);
42
 
43
$plot->xAxis->setNumberByTick('minor', 'major', 3);
44
 
45
$plot->setXAxisZero(TRUE);
46
 
47
$graph->add($plot);
48
$graph->draw();
49
?>