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
|
require_once "pannel/stats/Artichow/LinePlot.class.php";
include ('connexion.php');
$annee = "SELECT DISTINCT year(SUIVRE_date) FROM suivre";
$execute = mysql_query($annee);
while($row = mysql_fetch_array($execute))
{
$monannee = $row[0];
$select = "SELECT sum(SUIVRE_nbr) FROM suivre WHERE year(SUIVRE_date) = '".$row[0]."'";
$query = mysql_query($select);
while($row2 = mysql_fetch_array($query))
{
$mesvaleurs = $row2[0];
}
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
$values = array($mesvaleurs);
$plot = new LinePlot($values);
$plot->setBackgroundColor(new Color(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new Color(180, 180, 180, 75));
$plot->grid->setBackgroundColor(new Color(235, 235, 180, 60));
$plot->yAxis->setLabelPrecision(2);
$days = array($monannee);
$plot->xAxis->setLabelText($days);
$plot->setSpace(6, 6, 10, 10);
$plot->mark->setType(Mark::IMAGE);
$plot->mark->setImage(new FileImage("pannel/stats/Artichow/images/star.png"));
$plot->label->set($values);
$plot->label->move(0, -23);
$plot->label->setBackgroundGradient(
new LinearGradient(
new Color(250, 250, 250, 10),
new Color(255, 200, 200, 30),
0
)
);
$plot->label->border->setColor(new Color(20, 20, 20, 20));
$plot->label->setPadding(3, 1, 1, 0);
$graph->add($plot);
$graph->draw();
} |
Partager