Bonjour,
J'ai ajouté
les courbes de seuil, moyenne, tendance linéaire, dans artichow
voici un exemple:
Voici le code de l'exemple:
require_once "../LinePlot.class.php";
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
$x = array(
45, 67, 23, 45, 62, 10, 25
);
$plot = new LinePlot($x);
$plot->setSpace(6, 6, 10, 10);
$plot->setXAxisZero(FALSE);
// Set a background gradient
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
// Change line color
$plot->setColor(new Color(0, 0, 150, 20));
// Set line background gradient
$plot->setFillGradient(
new LinearGradient(
new Color(150, 150, 210),
new Color(230, 230, 255),
90
)
);
// Change mark type
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->border->show();
// Ajout de Moyenne
$moy= new LinePlot($x,'', awLinePlot::MOYENNE);
$moy->setColor(new Color(255, 0, 0, 20));
// Ajout de Seuil max
$seuil_max= new LinePlot($x,'', awLinePlot::SEUIL);
$seuil_max->setSeuil(60);
$seuil_max->setColor(new Color(55, 155, 55, 20));
// Ajout de Seuil min
$seuil_min= new LinePlot($x,'', awLinePlot::SEUIL);
$seuil_min->setSeuil(20);
$seuil_min->setColor(new Color(55, 155, 55, 20));
//Tendance
$tendance= new LinePlot($x,'', awLinePlot::TENDANCE);
$tendance->setColor(new Color(0, 255, 0, 20));
$group = new PlotGroup;
$group->add($plot);
$group->add($moy);
$group->add($seuil_max);
$group->add($seuil_min);
$group->add($tendance);
$group->legend->add($plot, "Courbe", Legend::LINE);
$group->legend->add($moy, "Moyenne", Legend::LINE);
$group->legend->add($tendance, "Tendance", Legend::LINE);
$group->legend->add($seuil_max, "Seuil Max", Legend::LINE);
$group->legend->add($seuil_min, "Seuil Min", Legend::LINE);
$group->legend->setSpace(6);
$group->legend->setPosition(0.94, 0.23);
$graph->add($group);
$graph->draw();
?>
Si des personnes sont intéressés pour obtenir les classes d'artichow.
Message édité 1 fois. Dernière modification le le 27/12/09 à 10:44