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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
<?php
// On vérifie que les données à afficher sur le graphique existent
if(isset($_GET['x'])) === FALSE) {
exit;
}
// On récupère les valeurs à afficher sur le graphique dans $_GET['values'] et on les désérialize
//$x = @unserialize($_GET['x']);
$param = stripslashes(urldecode($_GET['x']));
$x= unserialize ($param);
// On vérifie que les données passées en GET sont correctes
if(is_array($x) === FALSE) {
exit;
}
require_once "artichow/BarPlot.class.php";
$y = array ('hygiene', 'securite' ,'environnement');
$graph = new Graph(400, 400);
//$graph->setAntiAliasing(TRUE);
$plot = new BarPlot($x);
$plot->setSpace(4, 4, 10, 0);
$plot->setPadding(40, 15, 10, 40);
$plot->title->set("Recap de l'audit en %");
$plot->title->setFont(new TuffyBold(11));
$plot->title->border->show();
$plot->title->setBackgroundColor(new Color(255, 0, 0, 25));
$plot->title->setPadding(4, 4, 4, 4);
$plot->title->move(-20, 25);
$plot->yAxis->title->setFont(new TuffyBold(10));
$plot->yAxis->title->move(-4, 0);
$plot->yAxis->setTitleAlignment(Label::TOP);
$plot->xAxis->title->setFont(new TuffyBold(10));
$plot->xAxis->setTitleAlignment(Label::RIGHT);
$plot->setBackgroundGradient(
new LinearGradient(
new Color(255, 230, 230),
new Color(255, 255, 255),
0
)
);
$plot->barBorder->setColor(new Color(0, 0, 150, 20));
$plot->setBarGradient(
new LinearGradient(
new Color(255, 255, 0, 0),
new Color(230, 230, 255, 30),
0
)
);
$plot->xAxis->setLabelText($y);
$plot->xAxis->label->setFont(new TuffyBold(7));
$graph->shadow->setSize(4);
$graph->shadow->setPosition(Shadow::LEFT_TOP);
$graph->shadow->smooth(TRUE);
$graph->shadow->setColor(new Color(160, 160, 160));
$graph->add($plot);
$graph->draw();
?> |
Partager