| 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(400, 400);
|
|
|
13 |
$graph->title->set('Two bars with depth');
|
|
|
14 |
|
|
|
15 |
$group = new PlotGroup;
|
|
|
16 |
$group->setPadding(NULL, NULL, 35, NULL);
|
|
|
17 |
$group->setSpace(5, 5, NULL, NULL);
|
|
|
18 |
|
|
|
19 |
$group->grid->hide(TRUE);
|
|
|
20 |
|
|
|
21 |
$values = array(1, 7, 2, 10, 6, 3, 4, 7);
|
|
|
22 |
|
|
|
23 |
$plot = new BarPlot($values, 1, 1, 5);
|
|
|
24 |
$plot->setBarColor(new LightBlue(25));
|
|
|
25 |
$group->add($plot);
|
|
|
26 |
|
|
|
27 |
$values = array(12, 8, 13, 2, 4, 8, 4, 3);
|
|
|
28 |
|
|
|
29 |
$plot = new BarPlot($values, 1, 1, 0);
|
|
|
30 |
$plot->setBarColor(new LightRed(25));
|
|
|
31 |
$group->add($plot);
|
|
|
32 |
|
|
|
33 |
$graph->add($group);
|
|
|
34 |
$graph->draw();
|
|
|
35 |
|
|
|
36 |
?>
|