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
| <?php
require_once "Artichow-php4+5/Pie.class.php";
$graph = new Graph(300, 280);
$graph->setAntiAliasing(TRUE);
// Titre du graph :
$graph->title->set("Secteur / Budget total");
$graph->title->setFont(new Tuffy(14));
// Ombrage du graph :
$graph->shadow->setSize(3);
$graph->shadow->setColor(new Color(0xB4, 0xB4, 0xB4));
// Valeurs :
$reste = 100 - $_GET['pourcentage'];
$pourcentage = number_format($_GET['pourcentage'], 2, '.', ' ');
$reste = number_format($reste, 2, '.', ' ');
$values = array($pourcentage, $reste);
$colors = array(new Color(0xA6, 0x05, 0x05), new Color(0x68, 0xCE, 0x1E));
$plot = new Pie($values, $colors);
$plot->setCenter(0.55, 0.42);
$plot->setSize(0.65, 0.55);
// Mode 3D : 9px sur l'axe z :
$plot->set3D(9);
$plot->explode(array(1 => 10));
$plot->label->set($values);
$plot->label->setFont(new Tuffy(9));
$plot->setLabelPosition(9);
// Légende :
$plot->setLegend(array(
'Budget en cours : '.$_GET['budget_encours'],
'Budget total : '.$_GET['budget_total']
));
$plot->setLabelNumber(1);
$plot->legend->setPosition(1.15, 1.3);
$plot->legend->setTextFont(new Tuffy(9));
$plot->legend->setSpace(11);
$plot->legend->shadow->smooth(TRUE);
$plot->legend->setRows(2);
$graph->add($plot);
//$graph->draw();
//var_dump($graph->resource);
$a_fournir_en_premier_argument_a_addimage = $graph->drawAndGet();
var_dump($a_fournir_en_premier_argument_a_addimage);
?> |
Partager