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 57 58 59 60 61 62 63 64
|
<?php
session_start();
mysql_connect('localhost','root','');
mysql_select_db('ecoutes');
$requete_graphe="SELECT moyenne_20 FROM grille WHERE nom ="."'$_GET[nom_cdc]'"."and prenom ="."'$_GET[prenom_cdc]'";
$resultat_graphe =mysql_query($requete_graphe);
//$ligne_graphe =mysql_fetch_array($resultat_graphe);
require_once "../Artichow/LinePlot.class.php";
$rouge= new Color(200, 0, 0);
$vert= new Color(0, 200, 0);
$graph = new Graph(400, 400);
$graph->setAntiAliasing(TRUE);
$i=0;
$values =array();
$grille =array();
$vert= new Color(0, 200, 0);
$rouge= new Color(200, 0, 0);
while($ligne_graphe=mysql_fetch_array($resultat_graphe))
{
$values[$i]=$ligne_graphe[0];
$grille[$i]="GRILLE".($i+1);
$i++;
}
$j=0;
$plot = new LinePlot($values);
while ($j<=count($values[$j]))
{
if ($values[$j]>=10)
{
$plot->setColor($vert);
$j++;
}
else
{
$plot->setColor($rouge);
$j++;
}
}
$plot->label->set($values);
$plot->label->move(0, -23);
$plot->label->setBackgroundGradient(
new LinearGradient(
new Color(250, 250, 250, 10),
new Color(200, 0, 0, 30),
0
)
);
$plot->yAxis->setLabelPrecision(1);
$plot->xAxis->setLabelText($grille);
$graph->add($plot);
$graph->draw();
?> |
Partager