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(400, 300);
13
 
14
$x = array(
15
	-4, -5, -2, -8, -3, 1, 4, 9, 5, 6, 2
16
);
17
 
18
$plot = new LinePlot($x);
19
 
20
// Filled an area with a color
21
$plot->setFilledArea(7, 9, new DarkGreen(25));
22
 
23
// Filled the area with a gradient
24
$gradient = new LinearGradient(
25
	new Yellow(25),
26
	new Orange(25),
27
	90
28
);
29
$plot->setFilledArea(1, 4, $gradient);
30
 
31
// Hide first label
32
$plot->xAxis->label->hideFirst(TRUE);
33
 
34
$graph->add($plot);
35
$graph->draw();
36
?>