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 "../../BarPlot.class.php";
11
 
12
$graph = new Graph(450, 400);
13
 
14
$graph->setAntiAliasing(TRUE);
15
 
16
$blue = new Color(0, 0, 200);
17
$red = new Color(200, 0, 0);
18
 
19
$group = new PlotGroup;
20
$group->setPadding(40, 40);
21
$group->setBackgroundColor(
22
	new Color(240, 240, 240)
23
);
24
 
25
$values = array(12, 8, 20, 32, 15, 5);
26
 
27
$plot = new BarPlot($values, 1, 2);
28
$plot->setBarColor($blue);
29
$plot->setYAxis(Plot::LEFT);
30
 
31
$group->add($plot);
32
$group->axis->left->setColor($blue);
33
$group->axis->left->title->set("Blue bars");
34
 
35
$values = array(6, 12, 14, 2, 11, 7);
36
 
37
$plot = new BarPlot($values, 2, 2);
38
$plot->setBarColor($red);
39
$plot->setYAxis(Plot::RIGHT);
40
 
41
$group->add($plot);
42
$group->axis->right->setColor($red);
43
$group->axis->right->title->set("Red bars");
44
 
45
$graph->add($group);
46
$graph->draw();
47
?>