| 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 |
require_once "../../LinePlot.class.php";
|
|
|
12 |
|
|
|
13 |
$graph = new Graph(450, 400);
|
|
|
14 |
|
|
|
15 |
$graph->setAntiAliasing(TRUE);
|
|
|
16 |
|
|
|
17 |
$blue = new Color(150, 150, 230, 50);
|
|
|
18 |
$red = new Color(240, 50, 50, 25);
|
|
|
19 |
|
|
|
20 |
$group = new PlotGroup;
|
|
|
21 |
$group->setSpace(5, 5, 5, 0);
|
|
|
22 |
$group->setBackgroundColor(
|
|
|
23 |
new Color(240, 240, 240)
|
|
|
24 |
);
|
|
|
25 |
|
|
|
26 |
$values = array(18, 12, 14, 21, 11, 7, 9, 16, 7, 23);
|
|
|
27 |
|
|
|
28 |
$plot = new BarPlot($values);
|
|
|
29 |
$plot->setBarColor($red);
|
|
|
30 |
|
|
|
31 |
$group->add($plot);
|
|
|
32 |
|
|
|
33 |
$values = array(12, 8, 6, 12, 7, 5, 4, 9, 3, 12);
|
|
|
34 |
|
|
|
35 |
$plot = new LinePlot($values, LinePlot::MIDDLE);
|
|
|
36 |
$plot->setFillColor($blue);
|
|
|
37 |
|
|
|
38 |
$plot->mark->setType(Mark::SQUARE);
|
|
|
39 |
$plot->mark->setSize(7);
|
|
|
40 |
$plot->mark->setFill(new Color(255, 255, 255));
|
|
|
41 |
$plot->mark->border->show();
|
|
|
42 |
|
|
|
43 |
$group->add($plot);
|
|
|
44 |
|
|
|
45 |
$graph->add($group);
|
|
|
46 |
$graph->draw();
|
|
|
47 |
?>
|