Bonjour, j'ai un problème avec mon graphique.
Je fais ma requete SQL, j'affiche mes valeurs dans un tableau, et j'aimerais avoir le graphique en dessous. Le problème il m'affiche un message d'erreur en dessous du tableau. Si vous pouviez m'aider, merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 $query = "SELECT Data_journee.valeur, Data_journee.date FROM Data_journee WHERE Data_journee.idLibelle_data = 1 " ; $resultat = mysql_query($query); echo '<center><table width=50% border=#000000 CELLSPACING=0>'; while($row = mysql_fetch_row($resultat)){ $valeur = $row[0]; $date = $row[1] ; echo "<tr><td width=50%><center>$valeur</center></td><td width=50%><center>$date</center></td></tr>"; } echo '</table></center>'; // Create the graph. These two calls are always required $graph = new Graph(400,400); $graph->SetScale("textlin"); // Setup margin and titles $graph->img->SetMargin(50,30,30,50); $graph->title->Set("TEMPS D'ENGAGEMENT"); $graph->xaxis->title->Set("Temps d'engagement"); $graph->yaxis->title->Set("Date"); $ydata = array($valeur); // Create the linear plot $lineplot=new LinePlot($ydata); // Add the plot to the graph $graph->Add($lineplot); // Display the graph $graph->Stroke();
Partager