merci ça fonctionne parfaitement,
j'ai juste un problème bizarre,
quand je met par exemple un 0, ça me met l'inverse de ce que je veux.
je m'explique, j'ai deux valeurs dans array(10,0) par exemple et quand je fais le graphique c'est la couleur du 0 qui domine :o
exemple ici > [
www.raquettebreceenne.com]
où j'ai ça dans le code :
<?php
require_once('Artichow/Pie.class.php');
function makePie($values, $legend, $title, $x, $y) {
$pie = new Pie($values, Pie::COLORED);
$pie->title->set($title);
$pie->title->setFont(new TuffyItalic(9));
$pie->title->move(0, -5);
$pie->label->set($values);
$pie->label->setCallbackFunction(NULL);
$pie->setLabelPosition(-35);
$pie->label->setFont(new Tuffy(10));
$pie->label->setBackgroundColor(new White(50));
$pie->label->setPadding(2, 2, 2, 2);
$pie->setCenter($x, $y);
$pie->setSize(.45, .45);
$pie->setBorderColor(new Black());
if (is_array($legend)) {
$pie->setLegend($legend);
$pie->legend->setTextFont(new Tuffy(8)); }
else {
$pie->legend->hide();
}
return $pie;
}
$graph = new Graph(450, 280);
$graph->shadow->setPosition(Shadow::RIGHT_BOTTOM);
$graph->shadow->setSize(4);
$graph->setBackgroundGradient(
new LinearGradient(
new Color(240, 240, 240, 0),
new White,
0
)
);
$pie = makePie(array(0, 1), NULL, 'Contre moins de points', .25, .23);
$graph->add($pie);
$pie = makePie(array(1, 20), NULL, 'Contre plus de points', .75, .23);
$graph->add($pie);
$pie = makePie(
array(2, 1),
array('Victoire', 'Défaite'),
'En tout',
.5,
.67
);
$colors = array(
new Color(190, 86, 86, 12));
$pie->legend->setModel(Legend::MODEL_BOTTOM);
$pie->legend->setPosition(-.08, 1);
$graph->add($pie);
$graph->draw();
?>
merci