IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[JpGraph] Problème d'affichage de courbes


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre à l'essai
    Inscrit en
    Mars 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 14
    Points : 11
    Points
    11
    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 : 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();

  2. #2
    Débutant
    Homme Profil pro
    Développeur Web
    Inscrit en
    Octobre 2006
    Messages
    1 125
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    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 125
    Points : 704
    Points
    704
    Par défaut
    Quelle erreur y a t-il?
    Évènements dans le 06?
    www.sortir06.com

  3. #3
    Membre à l'essai
    Inscrit en
    Mars 2008
    Messages
    14
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 14
    Points : 11
    Points
    11
    Par défaut
    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.

  4. #4
    Membre régulier
    Inscrit en
    Septembre 2006
    Messages
    179
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 179
    Points : 83
    Points
    83
    Par défaut
    Bonjour,
    Essaiye de remplacer la derniers ligne de code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    // Display the graph	
    $graph->Stroke();
    Par celle là:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    // Display the graph	
    $graph->Stroke("graphique.png");
    Bonne chance

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [JpGraph] JPGraphe:Probléme d'affichage de graphe et export pdf
    Par farhaenis dans le forum Bibliothèques et frameworks
    Réponses: 0
    Dernier message: 06/07/2011, 10h44
  2. Problème d'affichage de plusieurs courbes avec JFreechart
    Par marouene_ dans le forum Développement Web en Java
    Réponses: 1
    Dernier message: 31/03/2011, 23h45
  3. Problème d'affichage d'une courbe
    Par doukha dans le forum Qwt
    Réponses: 4
    Dernier message: 04/03/2010, 10h32
  4. [JpGraph] Problème d'affichage dans Firefox
    Par Eric_M_78 dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 18/01/2008, 15h21
  5. [JpGraph] Problème d'affichage d'erreurs
    Par cbv38 dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 19/07/2007, 10h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo