Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks > Images > JpGraph
JpGraph Forum d'entraide pour la bibliothèque JpGraph permettant de manipuler des images en PHP. Avant de poster -> tutoriels JpGraph
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 07/04/2008, 11h27   #1
Invité de passage
 
Inscription : mars 2008
Messages : 13
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 13
Points : 3
Points : 3
Par défaut [JpGraph] Problème d'affichage de courbes

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 :
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();
brindherbe86 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/04/2008, 16h49   #2
Débutant
 
Avatar de afrodje
 
Homme Jérémy
Développeur Web
Inscription : octobre 2006
Messages : 1 094
Détails du profil
Informations personnelles :
Nom : Homme Jérémy
Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Développeur Web
Secteur : Industrie

Informations forums :
Inscription : octobre 2006
Messages : 1 094
Points : 614
Points : 614
Quelle erreur y a t-il?
__________________
Évènements dans le 06?
www.sortir06.com
afrodje est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/04/2008, 15h41   #3
Invité de passage
 
Inscription : mars 2008
Messages : 13
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 13
Points : 3
Points : 3
Citation:
JpGraph Error: HTTP headers have already been sent.
Caused by output from file IHM_Donnees.php at line 4.
Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).
Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".

Je vois à peu près à quoi cela fait référence, mais je vois pas comment réparer cette erreur.
Si tu pouvais m'aider, merci.
brindherbe86 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/05/2008, 17h35   #4
Membre du Club
 
Inscription : septembre 2006
Messages : 161
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 161
Points : 45
Points : 45
Bonjour,
Essaiye de remplacer la derniers ligne de code:
Code :
1
2
3
 
// Display the graph	
$graph->Stroke();
Par celle là:
Code :
1
2
3
 
// Display the graph	
$graph->Stroke("graphique.png");
Bonne chance
mouchkar est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 19h16.


 
 
 
 
Partenaires

Hébergement Web