2009-03-25 18:32:45 +00:00
|
|
|
|
<?php
|
2009-03-26 11:44:14 +00:00
|
|
|
|
require_once '../graphs/lib/phpchartdir.php';
|
2009-03-25 18:32:45 +00:00
|
|
|
|
|
2009-03-26 11:44:14 +00:00
|
|
|
|
# The data for the line chart
|
|
|
|
|
$data = array(30, 28, 40, 55, 75);
|
|
|
|
|
|
|
|
|
|
# The labels for the line chart
|
|
|
|
|
$labelsX = array('2004','2005','2006','2007','2008',);
|
|
|
|
|
|
|
|
|
|
//@TODO : Sp<53>cifier le pourcentage min et max
|
|
|
|
|
for($i=0;$i<=100;$i++){
|
|
|
|
|
$labelsY[] = $i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Create a XYChart object of size 250 x 250 pixels
|
|
|
|
|
$c = new XYChart(280, 250);
|
|
|
|
|
|
|
|
|
|
$c->setPlotArea(40, 10, 200, 200);
|
|
|
|
|
|
|
|
|
|
$c->yAxis->setTitle("%");
|
|
|
|
|
$c->xAxis->setTitle("Ann<EFBFBD>es");
|
|
|
|
|
|
|
|
|
|
# Add a line chart layer using the given data
|
|
|
|
|
$c->addLineLayer($data);
|
|
|
|
|
|
|
|
|
|
# Set the labels.
|
|
|
|
|
$c->yAxis->setLabels($labelsY);
|
|
|
|
|
$c->yAxis->setLabelStep(10);
|
|
|
|
|
$c->xAxis->setLabels($labelsX);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Output the chart
|
|
|
|
|
header("Content-type: image/png");
|
|
|
|
|
print($c->makeChart2(PNG));
|
|
|
|
|
|
|
|
|
|
?>
|