1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <?php
require_once '../BarPlot.class.php';
$graph = new Graph(900, 500);
$group = new PlotGroup;
$group->setSize(0.82, 1);
$group->setCenter(0.41, 0.5);
$group->setPadding(35, 26, 40, 27);
$group->legend->setPosition(1.18);
// Add a bar plot
$x = array(16, 16, 12, 13, 11, 18, 10, 12, 11, 12, 11, 16);
$plot = new BarPlot($x, 1, 2);
$plot->setBarColor(new Blue);
$group->legend->add($plot, 'Bleu', Legend::BACKGROUND);
$group->add($plot);
// Add a bar plot
$x = array(0.20, 0.25, 0.20, 0.18, 0.16, 0.25, 0.29, 0.12, 0.15, 0.18, 0.21, 0.26);
$plot = new BarPlot($x, 2, 2);
$plot->setBarColor(new Color(120, 175, 80, 10));
$group->legend->add($plot, 'Vert', Legend::BACKGROUND);
$group->add($plot);
// graph
$graph->add($group);
$graph->draw(); |
Partager